What happens when I use VD?#
When you call mitiq.experimental.vd.vd.execute_with_vd(), the following steps occur automatically in the backend.
Two identical noisy copies of the quantum state of interest are prepared (e.g. \(C\otimes C |0^{2n}\rangle\) where \(C\) is the circuit of interest)
The two states are then entangled using the \(B_i\) gate defined below. The correlations created by the entanglement allow the post-processing algorithm to extract information about the “virtually distilled” pure state \(\frac{\rho^2}{\text{Tr}(\rho^2)}\), which has suppressed contributions from non-dominant eigenvectors compared to the original noisy state \(\rho\).
The entire process requires only unitary operations and computational basis measurements, making it practical for near-term quantum devices while providing exponential error suppression in the ideal case.
Step-by-Step Workflow#
1. Circuit Duplication#
The original circuit acting on \(N\) qubits is duplicated to create two parallel copies, resulting in a circuit on \(2N\) qubits.
2. Diagonalizing Gate Application#
A diagonalizing gate \(B_i^{(2)}\) is applied between corresponding qubits in the two copies:
This gate is applied to qubit pairs \((i, i + N)\) for \(i = 0, 1, \ldots, N - 1\).
3. Measurement#
All qubits in both copies are measured in the computational basis, yielding bitstrings \(z^1\) and \(z^2\) for the first and second copies respectively.
4. Post-Processing#
The measurement results are processed to compute the error-mitigated expectation values using:
Numerator for qubit \(i\):
Denominator:
Final Result:
5. Return Values#
The function returns a list of length \(N\) containing the error-mitigated expectation values \(\langle Z_i \rangle_{\text{corrected}}\) for each qubit in the original circuit.
Implementation Details#
The circuit construction uses
_copy_circuit_parallel()to create parallel copiesThe diagonalizing gate is applied via
_apply_diagonalizing_gate()Measurement results are processed by
combine_results()which implements the mathematical formulas aboveThe implementation handles both
LineQubitandGridQubitqubit types, but has only been tested on contiguous groups of qubits.