is_unitary_matrix¶
-
forest.benchmarking.operator_tools.validate_operator.
is_unitary_matrix
(matrix: numpy.ndarray, rtol: float = 1e-05, atol: float = 1e-08) → bool¶ Checks if a square matrix A is unitary, \(A^\dagger A = A A^\dagger = Id\), where \(^\dagger\) denotes conjugate transpose and Id denotes the identity.
Parameters: - matrix – a M by M matrix.
- rtol – The relative tolerance parameter in np.allclose
- atol – The absolute tolerance parameter in np.allclose
Returns: True if the matrix is normal; False otherwise.