cirq.SimulatorStep.bloch_vector

SimulatorStep.bloch_vector(index: int) → numpy.ndarray

Returns the bloch vector of a qubit.

Calculates the bloch vector of the qubit at index
in the wavefunction given by self.state. Given that self.state
follows 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.