Skip to content

Commit

Permalink
docs: explain two-qubit density matrix reconstruction steps
Browse files Browse the repository at this point in the history
  • Loading branch information
stavros11 committed Oct 30, 2024
1 parent 74d2625 commit 1bafd6c
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/qibocal/protocols/two_qubit_state_tomography.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,11 +179,18 @@ def project_psd(matrix):
def _fit(data: StateTomographyData) -> StateTomographyResults:
"""Post-processing for two qubit state tomography.
Uses the standard linear inversion algorithm described in
https://en.wikipedia.org/wiki/Quantum_tomography#Linear_inversion
to reconstruct the density matrix.
The matrix is also post projected after the linear inversion
using ``project_psd``.
Uses a linear inversion algorithm to reconstruct the density matrix
from measurements, with the following steps:
1. Construct a linear transformation M, from density matrix
to Born-probabilities in the space of all two-qubit measurement bases
(in our case XX, XY, XZ, YX, YY, YZ, ZX, ZY, ZZ).
2. Invert M to get the transformation from Born-probabilities to
density matrices.
3. Calculate vector of Born-probabilities from experimental measurements (frequencies).
4. Map this vector to a density matrix (``measured_raw_density_matrix``) using the
inverse of M from step 2.
5. Project the calculated density matrix to the space of positive semidefinite
matrices (``measured_density_matrix``) using the function ``project_psd``.
"""
rotations = [
np.kron(rotation_matrix(basis1), rotation_matrix(basis2))
Expand Down

0 comments on commit 1bafd6c

Please sign in to comment.