cirq.SimulatorStep

class cirq.SimulatorStep(state, measurements, qubit_map, dtype)[source]
__init__(state, measurements, qubit_map, dtype)[source]

Results of a step of the simulator.

qubit_map
A map from the Qubits in the Circuit to the the index
of this qubit for a canonical ordering. This canonical ordering
is used to define the state (see the state() method).
measurements
A dictionary from measurement gate key to measurement
results, ordered by the qubits that the measurement operates on.

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.
sample(qubits, repetitions) Samples from the wave function at this point in the computation.
sample_measurement_ops(measurement_ops, …) Samples from the wave function at this point in the computation.
set_state(state, numpy.ndarray]) Updates the state of the simulator to the given new state.
state() Return the state (wave function) at this point in the computation.