SparsePauliOp.is_unitary

SparsePauliOp.is_unitary(atol=None, rtol=None)[source]

Return True if operator is a unitary matrix.

Parameters
  • atol (float) – Optional. Absolute tolerance for checking if coefficients are zero (Default: 1e-8).

  • rtol (float) – Optinoal. relative tolerance for checking if coefficients are zero (Default: 1e-5).

Returns

True if the operator is unitary, False otherwise.

Return type

bool