cirq.diagonalize_real_symmetric_matrix

cirq.diagonalize_real_symmetric_matrix(matrix: numpy.ndarray, *, rtol: float = 1e-05, atol: float = 1e-08) → numpy.ndarray[source]

Returns an orthogonal matrix that diagonalizes the given matrix.

Parameters:
  • matrix – A real symmetric matrix to diagonalize.
  • rtol – float = 1e-5,
  • atol – float = 1e-8
Returns:

An orthogonal matrix P such that P.T @ matrix @ P is diagonal.

Raises:

ValueError – Matrix isn’t real symmetric.