|View source on GitHub|
Returns a mixture representing a state vector with only some qubits kept.
cirq.linalg.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
then eigendecomposition is used and the output mixture will not be unique.
||The state vector to take the partial trace over.|
||Which indices to take the partial trace of the state_vector on.|
||The tolerance for determining that a factored state is pure.|
|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.|
If the input
||If any indexes are out of range.|