# cirq.diagonalize_real_symmetric_matrix¶

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

Returns an orthogonal matrix that diagonalizes the given matrix.

Parameters
• matrix – A real symmetric matrix to diagonalize.

• rtol – Relative error tolerance.

• atol – Absolute error tolerance.

• check_preconditions – If set, verifies that the input matrix is real and symmetric.

Returns

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

Raises

ValueError – Matrix isn’t real symmetric.