cirq.ProductState
A quantum state that is a tensor product of one qubit states.
cirq.ProductState(
states=None
)
For example, the |00⟩ state is cirq.KET_ZERO(q0) * cirq.KET_ZERO(q1)
.
The |+⟩ state is a length-1 tensor product state and can be constructed
with cirq.KET_PLUS(q0)
.
Attributes |
qubits
|
|
states
|
Dataclass field
|
Methods
projector
View source
projector(
qubit_order: Optional['cirq.QubitOrder'] = None
) -> np.ndarray
The projector associated with this state expressed as a matrix.
This is |s⟩⟨s| where |s⟩ is this state.
state_vector
View source
state_vector(
qubit_order: Optional['cirq.QubitOrder'] = None
) -> np.ndarray
The state-vector representation of this state.
__eq__
View source
__eq__(
other
) -> bool
Return self==value.
__getitem__
View source
__getitem__(
qubit: 'cirq.Qid'
) -> _NamedOneQubitState
Return the _NamedOneQubitState at the given qubit.
__iter__
View source
__iter__() -> Iterator[Tuple['cirq.Qid', _NamedOneQubitState]]
__len__
View source
__len__() -> int
__mul__
View source
__mul__(
other: 'cirq.ProductState'
) -> 'cirq.ProductState'
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.
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"Missing the information I need"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"Too complicated / too many steps"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"Out of date"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"Samples / code issue"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]
{"lastModified": "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."],[],[]]