View source on GitHub |
Determines if a matrix is approximately Hermitian.
cirq.is_hermitian(
matrix: np.ndarray, *, rtol: float = 1e-05, atol: float = 1e-08
) -> bool
A matrix is Hermitian if it's square and equal to its adjoint.
Args | |
---|---|
matrix
|
The matrix to check. |
rtol
|
The per-matrix-entry relative tolerance on equality. |
atol
|
The per-matrix-entry absolute tolerance on equality. |
Returns | |
---|---|
Whether the matrix is Hermitian within the given tolerance. |