View source on GitHub |
An interface for quantum states as targets for operations.
cirq.SimulationStateBase(
*,
qubits: Sequence['cirq.Qid'],
classical_data: Optional['cirq.ClassicalDataStore'] = None
)
Args | |
---|---|
qubits
|
The canonical ordering of qubits. |
classical_data
|
The shared classical data container for this simulation. |
Attributes | |
---|---|
classical_data
|
|
log_of_measurement_results
|
Gets the log of measurement results. |
qubit_map
|
|
qubits
|
Methods
apply_operation
apply_operation(
op: 'cirq.Operation'
)
copy
@abc.abstractmethod
copy( deep_copy_buffers: bool = True ) -> Self
Creates a copy of the object.
Args | |
---|---|
deep_copy_buffers
|
If True, buffers will also be deep-copied. Otherwise the copy will share a reference to the original object's buffers. |
Returns | |
---|---|
A copied instance. |
create_merged_state
@abc.abstractmethod
create_merged_state() -> TSimulationState
Creates a final merged state.
sample
@abc.abstractmethod
sample( qubits: List['cirq.Qid'], repetitions: int = 1, seed: 'cirq.RANDOM_STATE_OR_SEED_LIKE' = None ) -> np.ndarray
Samples the state value.
__getitem__
@abc.abstractmethod
__getitem__( item: Optional['cirq.Qid'] ) -> TSimulationState
Gets the item associated with the qubit.
__iter__
@abc.abstractmethod
__iter__() -> Iterator[Optional['cirq.Qid']]
Iterates the keys of the mapping.
__len__
@abc.abstractmethod
__len__() -> int
Gets the number of items in the mapping.