simplify

simplify(operator, *, atol=None, rtol=None)[source]

Simplifies the provided Pauli operator.

This is an adaption of SparsePauliOp.simplify() which tracks metadata of the simplified terms.

Parameters:
  • operator (SparsePauliOp) – the SparsePauliOp to simplify.

  • atol (float | None) – the absolute tolerance for checking if coefficients are zero. If None, this will fallback to using SparsePauliOp.atol.

  • rtol (float | None) – the relative tolerance for checking if coefficients are zero. If None, this will fallback to using SparsePauliOp.rtol.

Returns:

The simplified Pauli operator.

Return type:

tuple[SparsePauliOp, SimplifyMetadata]