unitaria.util.is_unitary

unitaria.util.is_unitary(U: ndarray, tol: float = 1e-08) bool[source]

Check if a matrix is unitary within a given tolerance.

Parameters:
  • U – The matrix to check.

  • tol – Tolerance for unitarity check (default: 1e-8).

Returns:

True if U is unitary, False otherwise.