cirq.is_special_unitary

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

Determines if a matrix is approximately unitary with unit determinant.

A matrix is special-unitary if it is square and its adjoint is its inverse
and its determinant is one.
Parameters:
  • 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 unitary with unit determinant within the given tolerance.