Qiskit / qiskit

Qiskit is an open-source SDK for working with quantum computers at the level of extended quantum circuits, operators, and primitives.
https://www.ibm.com/quantum/qiskit
Apache License 2.0
5.24k stars 2.36k forks source link

Shadow Tomography #8581

Open Zoufalc opened 2 years ago

Zoufalc commented 2 years ago

What should we add?

It would be great if we had a shadow tomography module - which enables the extraction of particular information about a quantum state with less measurements than full state tomography.

References: Shadow Tomography of Quantum States

ShellyGarion commented 2 years ago

I agree that shadow tomography would be a great contribution to Qiskit. The main question is where does it belong?

Currently, the tomography experiments belong to Qiskit Experiments: https://qiskit.org/documentation/experiments/ including:

Another possibility may be Qiskit prototypes: https://github.com/qiskit-community/prototypes

chriseclectic commented 2 years ago

Shadow tomography as described in the Huang, Kueng, Preskill paper is just standard partial linear inversion state tomography. The only difference is you don't reconstruct the density matrix at the end, but instead store the "state" as a list of measurement probs and corresponding stabilizer basis states that were measured. If you do local shadow tomography with C(1)^N it is exactly standard Pauli basis measurements so basically everything exists already in qiskit experiments to do this except for having a nice representation of the "shadow state" to return that you can use to compute quantities from it. (If you wanted full N-qubit Clifford group shadow tomography, instead of C(1)^N, then you would need a new measurement basis which would be easy to do, but your tomography measurement basis is highly entangled N-qubit measurements so would have tonnes of spam error).

One approach could be to add a new QuantumState subclass like LocalShadowState/ShadowState that is basically a density matrix stored as a linear combination of Pauli stabilizer states/Stabilizer states so you can have an interface to computing quantities like expectation values and fidelity's that you might want to use these for.

The biggest caveat is that the estimated state generally wont have trace = 1 unless you rescale your sampled measurement outcomes (which iirc you typically don't do in shadow estimation protocols as they bias your estimates of expectation values), and it wont correspond to a PSD state (and you can't rescale it to be a PSD state without constructing the dense density matrix first to do eigenvalue rescaling, but if you do this you are exactly doing standard partial linear inversion tomography so don't need anything else than what we already have.)