Single-qubit state tomography.

The density matrix of the output state of a circuit is measured by first doing projective measurements in the z-basis, which determine the diagonal elements of the matrix. A X/2 or Y/2 rotation is then added before the z-basis measurement, which determines the imaginary and real parts of the off-diagonal matrix elements, respectively.

See Vandersypen and Chuang, Rev. Mod. Phys. 76, 1037 for details.

sampler The quantum engine or simulator to run the circuits.
qubit The qubit under test.
circuit The circuit to execute on the qubit before tomography.
repetitions The number of measurements for each basis rotation.

A TomographyResult object that stores and plots the density matrix.