View source on GitHub |
A container for a Qid
-to-SimulationState
dictionary.
Inherits From: SimulationStateBase
cirq.SimulationProductState(
sim_states: Dict[Optional['cirq.Qid'], TSimulationState],
qubits: Sequence['cirq.Qid'],
split_untangled_states: bool,
classical_data: Optional['cirq.ClassicalDataStore'] = None
)
Attributes | |
---|---|
classical_data
|
|
log_of_measurement_results
|
Gets the log of measurement results. |
qubit_map
|
|
qubits
|
|
sim_states
|
|
split_untangled_states
|
Methods
apply_operation
apply_operation(
op: 'cirq.Operation'
)
copy
copy(
deep_copy_buffers: bool = True
) -> 'cirq.SimulationProductState[TSimulationState]'
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
create_merged_state() -> TSimulationState
Creates a final merged state.
get
get(
key, default=None
)
D.get(k[,d]) -> D[k] if k in D, else d. d defaults to None.
items
items()
D.items() -> a set-like object providing a view on D's items
keys
keys()
D.keys() -> a set-like object providing a view on D's keys
sample
sample(
qubits: List['cirq.Qid'],
repetitions: int = 1,
seed: 'cirq.RANDOM_STATE_OR_SEED_LIKE' = None
) -> np.ndarray
Samples the state value.
values
values()
D.values() -> an object providing a view on D's values
__contains__
__contains__(
key
)
__eq__
__eq__(
other
)
Return self==value.
__getitem__
__getitem__(
item: Optional['cirq.Qid']
) -> TSimulationState
Gets the item associated with the qubit.
__iter__
__iter__() -> Iterator[Optional['cirq.Qid']]
Iterates the keys of the mapping.
__len__
__len__() -> int
Gets the number of items in the mapping.