cirq.StateVectorMixin

class cirq.StateVectorMixin(qubit_map: Optional[Dict[cirq.ops.raw_types.Qid, int]] = None, *args, **kwargs)[source]

A mixin that provide methods for objects that have a state vector.

__init__(qubit_map: Optional[Dict[cirq.ops.raw_types.Qid, int]] = None, *args, **kwargs)[source]
Parameters

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_vector() method).

Methods

bloch_vector_of(qubit)

Returns the bloch vector of a qubit in the state.

density_matrix_of([qubits])

Returns the density matrix of the state.

dirac_notation([decimals])

Returns the state vector as a string in Dirac notation.

state_vector()

Return the state vector (wave function).

Attributes

qubit_map