Gives the guaranteed unitary eigendecomposition of a normal matrix.
cirq.unitary_eig(
matrix: np.ndarray, check_preconditions: bool = True, atol: float = 1e-08
) -> Tuple[np.ndarray, np.ndarray]
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
Args |
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.
|
Returns |
A Tuple of
eigvals: The eigenvalues of matrix .
V: The unitary matrix with the eigenvectors as columns.
|
Raises |
ValueError
|
if the input matrix is not normal.
|