cirq.unitary_eig

Gives the guaranteed unitary eigendecomposition of a normal matrix.

All hermitian and unitary matrices are normal matrices. This method was introduced as for certain classes of unitary matrices (where the eigenvalues are close to each other) the eigenvectors returned by numpy.linalg.eig are not guaranteed to be orthogonal. For more information, see https://github.com/numpy/numpy/issues/15461

matrix A normal matrix. If not normal, this method is not guaranteed to return correct eigenvalues. A normal matrix is one where \(A A^\dagger = A^\dagger A\).
check_preconditions When true and matrix is not unitary, a ValueError is raised when the matrix is not normal.
atol The absolute tolerance when checking whether the original matrix was unitary.

A Tuple of eigvals: The eigenvalues of matrix. V: The unitary matrix with the eigenvectors as columns.

ValueError if the input matrix is not normal.