Experiment to conduct state tomography.

Generates data collection protocol for the state tomography experiment. Does the fitting of generated data to determine the density matrix.

qubits Qubits to do the tomography on.
prerotations Tuples of (phase_exponent, exponent) parameters for gates to apply to the qubits before measurement. The actual rotation applied will be cirq.PhasedXPowGate with the specified values of phase_exponent and exponent. If None, we use [(0, 0), (0, 0.5), (0.5, 0.5)], which corresponds to rotation gates [I, X0.5, Y0.5].

rot_circuit Circuit with parameterized rotation gates to do before the final measurements.
rot_sweep The list of rotations on the qubits to perform before measurement.
mat Matrix of coefficients for the system. Each row is one equation corresponding to a rotation sequence and bit string outcome for that rotation sequence. Each column corresponds to the coefficient on one term in the density matrix.
num_qubits Number of qubits to do tomography on.



View source

Solves equation mat * rho = probs.

counts A 2D array where each row contains measured counts of all n-qubit bitstrings for the corresponding pre-rotations in rot_sweep. The order of the probabilities corresponds to to rot_sweep and the order of the bit strings corresponds to increasing integers up to 2**(num_qubits)-1.

TomographyResult with density matrix corresponding to solution of this system.