cirq.is_unitary

Determines if a matrix is approximately unitary.

A matrix is unitary if it's square and its adjoint is its inverse.

matrix The matrix to check.
rtol The per-matrix-entry relative tolerance on equality.
atol The per-matrix-entry absolute tolerance on equality.

Whether the matrix is unitary within the given tolerance.