cirq.experiments.StateTomographyExperiment

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.

Methods

`fit_density_matrix`

View source

Solves equation mat * rho = probs.

Args
`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.

Returns
`TomographyResult` with density matrix corresponding to solution of this system.

[{ "type": "thumb-down", "id": "missingTheInformationINeed", "label":"Missing the information I need" },{ "type": "thumb-down", "id": "tooComplicatedTooManySteps", "label":"Too complicated / too many steps" },{ "type": "thumb-down", "id": "outOfDate", "label":"Out of date" },{ "type": "thumb-down", "id": "samplesCodeIssue", "label":"Samples / code issue" },{ "type": "thumb-down", "id": "otherDown", "label":"Other" }]
[{ "type": "thumb-up", "id": "easyToUnderstand", "label":"Easy to understand" },{ "type": "thumb-up", "id": "solvedMyProblem", "label":"Solved my problem" },{ "type": "thumb-up", "id": "otherUp", "label":"Other" }]