Factors a state vector into two independent state vectors.
cirq.linalg.transformations.factor_state_vector(
t: np.ndarray, axes: Sequence[int], *, validate=True, atol=1e-07
) -> Tuple[np.ndarray, np.ndarray]
This function should only be called on state vectors that are known to be
separable, such as immediately after a measurement or reset operation. It
does not verify that the provided state vector is indeed separable, and
will return nonsense results for vectors representing entangled states.
Args |
t
|
The state vector to factor.
|
axes
|
The axes to factor out.
|
validate
|
Perform a validation that the density matrix factors cleanly.
|
atol
|
The absolute tolerance for the validation.
|
Returns |
A tuple with the (extracted, remainder) state vectors, where
extracted means the sub-state vector which corresponds to the axes
requested, and with the axes in the requested order, and where
remainder means the sub-state vector on the remaining axes, in the
same order as the original state vector.
|
Raises |
EntangledStateError
|
If the tensor is already in entangled state, and
the validate flag is set.
|
ValueError
|
If the tensor factorization fails for any other reason.
|