cirq.partial_trace_of_state_vector_as_mixture
Returns a mixture representing a state vector with only some qubits kept.
cirq.partial_trace_of_state_vector_as_mixture(
state_vector: np.ndarray,
keep_indices: List[int],
*,
atol: Union[int, float] = 1e-08
) -> Tuple[Tuple[float, np.ndarray], ...]
The input state vector can have any shape, but if it is one-dimensional it
will be interpreted as qubits, since that is the most common case, and fail
if the dimension is not size 2 ** n
. States in the output mixture will
retain the same type of shape as the input state vector.
If the state vector cannot be factored into a pure state over keep_indices
then eigendecomposition is used and the output mixture will not be unique.
Args |
state_vector
|
The state vector to take the partial trace over.
|
keep_indices
|
Which indices to take the partial trace of the
state_vector on.
|
atol
|
The tolerance for determining that a factored state is pure.
|
Returns |
A single-component mixture in which the factored state vector has
probability '1' if the partially traced state is pure, or else a
mixture of the default eigendecomposition of the mixed state's
partial trace.
|
Raises |
ValueError
|
If the input state_vector is one dimension, but that
dimension size is not a power of two.
|
IndexError
|
If any indexes are out of range.
|
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."],[],[]]