cirq.QuantumStateRepresentation
Attributes |
can_represent_mixed_states
|
Subclasses that can represent mixed states should override this.
|
supports_factor
|
Subclasses that allow factorization should override this.
|
Methods
copy
View source
@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.
|
factor
View source
factor(
axes: Sequence[int], *, validate=True, atol=1e-07
) -> Tuple[Self, Self]
Splits two state spaces after a measurement or reset.
kron
View source
kron(
other: Self
) -> Self
Joins two state spaces together.
measure
View source
@abc.abstractmethod
measure(
axes: Sequence[int], seed: 'cirq.RANDOM_STATE_OR_SEED_LIKE' = None
) -> List[int]
Measures the state.
Args |
axes
|
The axes to measure.
|
seed
|
The random number seed to use.
|
Returns |
The measurements in order.
|
reindex
View source
reindex(
axes: Sequence[int]
) -> Self
Physically reindexes the state by the new basis.
Args |
axes
|
The desired axis order.
|
Returns |
The state with qubit order transposed and underlying representation
updated.
|
sample
View source
sample(
axes: Sequence[int],
repetitions: int = 1,
seed: 'cirq.RANDOM_STATE_OR_SEED_LIKE' = None
) -> np.ndarray
Samples the state. Subclasses can override with more performant method.
Args |
axes
|
The axes to sample.
|
repetitions
|
The number of samples to make.
|
seed
|
The random number seed to use.
|
Returns |
The samples in order.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-06-27 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-06-27 UTC."],[],[]]