ffsim.linalg.is_unitary

ffsim.linalg.is_unitary(mat, *, rtol=1e-05, atol=1e-08)[source]

Determine if a matrix is approximately unitary.

Parameters:
  • mat (ndarray) – The matrix.

  • rtol (float) – Relative numerical tolerance.

  • atol (float) – Absolute numerical tolerance.

Return type:

bool | bool

Returns:

Whether the matrix is unitary within the given tolerance.