cirq.SimulationTrialResult.bloch_vector¶
-
SimulationTrialResult.bloch_vector(index: int) → numpy.ndarray[source]¶ Returns the bloch vector of a qubit.
Calculates the bloch vector of the qubit at indexin the wavefunction given by self.state. Given that self.statefollows the standard Kronecker convention of numpy.kron.Parameters: index – index of qubit who’s bloch vector we want to find.
Returns: A length 3 numpy array representing the qubit’s bloch vector.
Raises: ValueError– if the size of the state represents more than 25 qubits.IndexError– if index is out of range for the number of qubits corresponding to the state.