cirq.SimulationTrialResult¶
-
class
cirq.SimulationTrialResult(params: cirq.study.resolver.ParamResolver, measurements: Dict[str, numpy.ndarray], final_state: numpy.ndarray)[source]¶ Results of a simulation by a SimulatesFinalWaveFunction.
Unlike TrialResult these results contain the final state (wave function)of the system.-
params¶
A ParamResolver of settings used for this result.
-
measurements¶
A dictionary from measurement gate key to measurementresults. Measurement results are a numpy ndarray of actual booleanmeasurement results (ordered by the qubits acted on by themeasurement gate.)-
final_state¶
The final state (wave function) of the system after thetrial finishes. The state is returned in the computational basiswith these basis states defined by the qubit ordering of thesimulation. In particular the qubit ordering can be used to producea list of qubits, and these qubits can the be associated with theirindex in the list. This mapping of qubit to index is thentranslated into binary vectors where the last qubit is the1s bit of the index, the second-to-last is the 2s bit of the index,and so forth (i.e. big endian ordering). Example:qubit ordering: [QubitA, QubitB, QubitC]Then the returned vector will have indices mapped to qubit basisstates like the following table| | QubitA | QubitB | QubitC |+—+——–+——–+——–+| 0 | 0 | 0 | 0 || 1 | 0 | 0 | 1 || 2 | 0 | 1 | 0 || 3 | 0 | 1 | 1 || 4 | 1 | 0 | 0 || 5 | 1 | 0 | 1 || 6 | 1 | 1 | 0 || 7 | 1 | 1 | 1 |+—+——–+——–+——–+-
__init__(params: cirq.study.resolver.ParamResolver, measurements: Dict[str, numpy.ndarray], final_state: numpy.ndarray) → None[source]¶ Initialize self. See help(type(self)) for accurate signature.
Methods
bloch_vector(index)Returns the bloch vector of a qubit. density_matrix(indices)Returns the density matrix of the wavefunction. dirac_notation(decimals)Returns the wavefunction as a string in Dirac notation. -