Skip to main contentIBM Quantum Documentation

Operator backpropagation (OBP) release notes


0.2.0

New Features

  • A new parameter show_legend has been added to each function in the qiskit_addon_obp.utils.visualization module that can show or hide the legend on a plot. The legend is shown by default. This can be useful when the legend becomes long and obstructs the plot.

  • qiskit_addon_obp.utils.simplify.OperatorBudget now holds atol and rtol fields which are absolute and relative tolerances used to determine whether coefficients are zero while simplifying an operator.

  • truncate_binary_search() now accepts a tol kwarg. Once an optimal truncation threshold, up to this value, has been found, the search for an optimal threshold will stop. The default tolerance is 1e-8; whereas, the tolerance used prior to this release was 1e-10.

    TruncationErrorBudget now holds a tol field. This field is used by backpropagate() as the tol argument to truncate_binary_search().

Upgrade Notes

  • This release adds support for Python 3.13. No code changes were necessary, so older releases are expected to work on Python 3.13 too.

  • This package is now compatible with Qiskit SDK 2.0.

Bug Fixes

  • The num_duplicate_paulis was previously unable to differentiate from Pauli terms that were trimmed due to their coefficient being close to zero. This is now tracked correctly with these trimmed terms only counting towards num_trimmed_paulis.

  • The reported number of unique Paulis in num_unique_paulis is now correct in cases where all gates in a slice commute with an observable.

  • Fixed a bug in qiskit_addon_obp.backpropagate() which caused slices with depth > 1 to be incorrectly forward-propagated. Gates from a given slice will now be correctly propagated into the observable in reverse order (i.e., from the back of the slice).


0.1.0

New Features

  • Added a OperatorBudget class for specifying how large an operator may grow during back-propagation.

  • Adds the max_seconds keyword-argument to the backpropagate() function, allowing the end-user to specify a maximum wall clock time for the algorithm. This can (for example) be useful for exploring different truncation error budget strategies while limiting the CPU time.

  • Introduced a new dataclass, TruncationErrorBudget, for holding information about the observable truncation strategy.

  • Introduced a new function, setup_budget(), which generates a TruncationErrorBudget class, given an observable truncation strategy (e.g. max_error_total, max_error_per_slice, p_norm).

Upgrade Notes

  • The backpropagate() function no longer accepts max_paulis and max_qwc_groups kwargs for constraining the size of the operator during back-propagation. Users should instead use the new operator_budget kwarg, which takes an OperatorBudget instance.

    To migrate, change this code

    from qiskit_addon_obp import backpropagate
     
    bp_obs, remaining_slices, metadata = backpropagate(
                                             obs,
                                             slices,
                                             max_paulis=100,
                                             max_qwc_groups=10,
                                             simplify=True
                                         )

    to this

    from qiskit_addon_obp import backpropagate
    from qiskit_addon_obp.utils.simplify import OperatorBudget
     
    op_budget = OperatorBudget(max_paulis=100, max_qwc_groups=10, simplify=True)
    bp_obs, remaining_slices, metadata = backpropagate(obs, slices, operator_budget=op_budget)
  • The max_slices kwarg has been removed from backpropagate(). Users should now only pass in slices which they intend to back-propagate. If a user wants to attempt to only back-propagate the last 20 slices of an N-slice circuit, they would simply pass in the last 20 slices to backpropagate() and, recombine any slices remaining after back-propagation with the original N-20 slices.

    For example

    from qiskit_addon_obp import backpropagate
    from qiskit_addon_obp.utils.truncating import setup_budget
    from qiskit_addon_utils.slicing import combine_slices
     
    num_slices = 20
    truncation_error_budget = setup_budget(max_error_total=0.02, num_slices=num_slices, p_norm=1)
    bp_obs, remaining_slices, metadata = backpropagate(
         obs, slices[-num_slices:], truncation_error_budget=truncation_error_budget
    )
    reduced_circuit = combine_slices(slices[:-num_slices] + remaining_slices)
  • The max_slices kwarg in setup_budget() has been renamed to num_slices.

  • The max_slices attribute in OBPMetadata has been renamed to num_slices.

  • The project’s root Python namespace has been changed from obp to qiskit_addon_obp. All package imports must be updated.

    For example:

    from obp import backpropagate

    should be changed to:

    from qiskit_addon_obp import backpropagate
  • Removed the max_error_total, max_error_per_slice, and p_norm kwargs from the backpropagate() signature. Instead, users must specify their observable truncation strategy with the new truncation_error_budget kwarg which accepts a TruncationErrorBudget instance.

  • Removed the per_slice_budget, max_error_total, and p_norm fields from the OBPMetadata class. These fields will now be accessed through the new truncation_error_budget field, which holds a TruncationErrorBudget instance.

Bug Fixes

  • The setup_budget() erroneously distributed the max_error_total when num_slices was also set. This has been fixed now, such that the budget always gets distributed evenly, regardless of the value of p_norm.

  • When the max_seconds argument to the backpropagate() method is used, but the timeout is not reached during the actual OBP execution, the signal will now be reset properly, thereby avoiding cancellations at a (seemingly) random later point in time (of course, it is not random but actually after the specified amount of time has passed, but the rest of the code being executed after OBP could be doing anything at this point).

  • The computation of the accumulated_error() and left_over_error_budget() were fixed to respect the Minkowski inequality. This is necessary, because a general Lp-norm (other than p=2) does not satisfy the parallelogram law which resulted in a non-rigorous upper bound of the actual accumulated errors (and left-over error budgets by extension).

Was this page helpful?
Report a bug or request content on GitHub.