Module: cirq.linalg.transformations

Utility methods for transforming matrices or vectors.

Classes

class EntangledStateError: Raised when a product state is expected, but an entangled state is provided.

Functions

apply_matrix_to_slices(...): Left-multiplies an NxN matrix onto N slices of a numpy array.

density_matrix_kronecker_product(...): Merges two density matrices into a single unified density matrix.

factor_density_matrix(...): Factors a density matrix into two independent density matrices.

factor_state_vector(...): Factors a state vector into two independent state vectors.

match_global_phase(...): Phases the given matrices so that they agree on the phase of one entry.

partial_trace(...): Takes the partial trace of a given tensor.

partial_trace_of_state_vector_as_mixture(...): Returns a mixture representing a state vector with only some qubits kept.

reflection_matrix_pow(...): Raises a matrix with two opposing eigenvalues to a power.

state_vector_kronecker_product(...): Merges two state vectors into a single unified state vector.

sub_state_vector(...): Attempts to factor a state vector into two parts and return one of them.

targeted_conjugate_about(...): Conjugates the given tensor about the target tensor.

targeted_left_multiply(...): Left-multiplies the given axes of the target tensor by the given matrix.

to_special(...): Converts a unitary matrix to a special unitary matrix.

transpose_density_matrix_to_axis_order(...): Transposes the axes of a density matrix to a specified order.

transpose_state_vector_to_axis_order(...): Transposes the axes of a state vector to a specified order.

RaiseValueErrorIfNotProvided Instance of numpy.ndarray