ORNL-QCI / tnqvm

Tensor Network QPU Simulator for Eclipse XACC
43 stars 10 forks source link

Enabling density matrix computation for noisy simulations #84

Open DmitryLyakh opened 3 years ago

DmitryLyakh commented 3 years ago

TN-QVM should be enhanced to compute the density matrix of a noisy quantum circuit, |Psi><Psi|. The implementation will be very similar to the wavefunction computation. The initial state will consist of 2N 1-body qubit tensors in |0> state, instead of N, that is |0000><0000|. The gates will be applied to both |Psi> and <Psi|. Additionally, after each gate application the corresponding Krauss tensor (1-body, 2-body, etc.) will be inserted between |Psi> and <Psi|. The resulting tensor network will be submitted to ExaTN for evaluation. Additionally, one may want to compute only a slice of the density matrix or individual amplitudes, absolutely analogously to the corresponding wavefunction features. And, of course, we need to be able to compute expectation values of operators via tracing the density matrix with the operator. This will enable noise modelling with an arbitrary rank of correlations (1-body gate noise, 2-body gate noise, etc). And read-out noise (which is currently done via an XACC decorator?).

DmitryLyakh commented 3 years ago

Also, similarly to the Wavefunction computation, some kind of API will be needed to access the density matrix or its slices from XACC, like Accelerator.getDensityMatrix(Mask) -> const DensityMatrix &, where Mask specifies which qubits are projected to concrete bits and which are kept open in Thien's notation.

DmitryLyakh commented 3 years ago

Since the density matrix is much larger than the wavefunction, I think the priority should go to the direct expectation value computation via tracing with the operator (a single closed tensor network submitted to ExaTN). Computing the full density matrix or its slice can be implemented after that (less priority).