cirq.kron_factor_4x4_to_2x2s¶
-
cirq.kron_factor_4x4_to_2x2s(matrix: numpy.ndarray, tolerance: cirq.linalg.tolerance.Tolerance = Tolerance(rtol=1e-05, atol=1e-08, equal_nan=False)) → Tuple[complex, numpy.ndarray, numpy.ndarray][source]¶ Splits a 4x4 matrix U = kron(A, B) into A, B, and a global factor.
Requires the matrix to be the kronecker product of two 2x2 unitaries.Requires the matrix to have a non-zero determinant.Parameters: - matrix – The 4x4 unitary matrix to factor.
- tolerance – Acceptable numeric error thresholds.
Returns: A scalar factor and a pair of 2x2 unit-determinant matrices. The kronecker product of all three is equal to the given matrix.
Raises: ValueError– The given matrix can’t be tensor-factored into 2x2 pieces.