OperatorBudget

class OperatorBudget(max_paulis=None, max_qwc_groups=None, simplify=True)[source]

Bases: object

A class for storing the constants that determine how large an operator may grow.

Backpropagation will stop if either of the following conditions is met:

  • The number of Pauli terms across all of the observables exceeds max_paulis. When max_paulis = None, the number of Pauli terms in the observables is not constrained.

  • The number of qubit-wise commuting Pauli groups across all of the observables exceed max_qwc_groups. When max_qwc_groups = None, the number of qubit-wise commuting Pauli groups in the observables is not constrained.

Attributes

max_paulis: int | None = None

The maximum number of Pauli terms the backpropagated operator may contain.

max_qwc_groups: int | None = None

The maximum number of qubit-wise commuting Pauli groups the backpropagated operator may contain.

simplify: bool = True

A flag denoting whether to call simplify() at every iteration.

Methods

is_active()[source]

Return whether self places any bounds on operator size.

Return type:

bool