---
title: Operator backpropagation (OBP) release notes
description: Changes made to Operator backpropagation (OBP)
source: https://quantum.cloud.ibm.com/docs/en/api/qiskit-addon-obp/release-notes
---

# Operator backpropagation (OBP) release notes

## Upcoming release (`main`)

### Upgrade Notes

- Support for Python 3.9 has been removed. The minimum supported Python version is now 3.10.

## 0.3.0

### New Features

- [`PauliLindbladError`](/docs/api/qiskit-ibm-runtime/results-pauli-lindblad-error)"(in Qiskit Runtime IBM Client)") objects can now be embedded in slices of `QuantumCircuit` using the [`PauliLindbladErrorInstruction`](/docs/api/qiskit-addon-obp/utils-noise-pauli-lindblad-error-instruction "qiskit_addon_obp.utils.noise.PauliLindbladErrorInstruction") and will be handled properly by [`backpropagate()`](/docs/api/qiskit-addon-obp/qiskit-addon-obp#backpropagate "qiskit_addon_obp.backpropagate").

### Bug Fixes

- Fixed a bug in [`qiskit_addon_obp.backpropagate()`](/docs/api/qiskit-addon-obp/qiskit-addon-obp#backpropagate "qiskit_addon_obp.backpropagate") which often caused resets to be applied to the wrong qubit.

## 0.2.0

### New Features

- A new parameter `show_legend` has been added to each function in the [`qiskit_addon_obp.utils.visualization`](/docs/api/qiskit-addon-obp/utils-visualization#module-qiskit_addon_obp.utils.visualization "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`](/docs/api/qiskit-addon-obp/utils-simplify#operatorbudget "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()`](/docs/api/qiskit-addon-obp/utils-truncating#truncate_binary_search "qiskit_addon_obp.utils.truncating.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`](/docs/api/qiskit-addon-obp/utils-truncating#truncationerrorbudget "qiskit_addon_obp.utils.truncating.TruncationErrorBudget") now holds a `tol` field. This field is used by [`backpropagate()`](/docs/api/qiskit-addon-obp/qiskit-addon-obp#backpropagate "qiskit_addon_obp.backpropagate") as the `tol` argument to [`truncate_binary_search()`](/docs/api/qiskit-addon-obp/utils-truncating#truncate_binary_search "qiskit_addon_obp.utils.truncating.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`](/docs/api/qiskit-addon-obp/utils-simplify#num_duplicate_paulis "qiskit_addon_obp.utils.simplify.SimplifyMetadata.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`](/docs/api/qiskit-addon-obp/utils-simplify#num_trimmed_paulis "qiskit_addon_obp.utils.simplify.SimplifyMetadata.num_trimmed_paulis").

- The reported number of unique Paulis in [`num_unique_paulis`](/docs/api/qiskit-addon-obp/utils-simplify#num_unique_paulis "qiskit_addon_obp.utils.simplify.SimplifyMetadata.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()`](/docs/api/qiskit-addon-obp/qiskit-addon-obp#backpropagate "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`](/docs/api/qiskit-addon-obp/utils-simplify#operatorbudget "qiskit_addon_obp.utils.simplify.OperatorBudget") class for specifying how large an operator may grow during back-propagation.

- Adds the `max_seconds` keyword-argument to the [`backpropagate()`](/docs/api/qiskit-addon-obp/qiskit-addon-obp#backpropagate "qiskit_addon_obp.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`](/docs/api/qiskit-addon-obp/utils-truncating#truncationerrorbudget "qiskit_addon_obp.utils.truncating.TruncationErrorBudget"), for holding information about the observable truncation strategy.

- Introduced a new function, [`setup_budget()`](/docs/api/qiskit-addon-obp/utils-truncating#setup_budget "qiskit_addon_obp.utils.truncating.setup_budget"), which generates a [`TruncationErrorBudget`](/docs/api/qiskit-addon-obp/utils-truncating#truncationerrorbudget "qiskit_addon_obp.utils.truncating.TruncationErrorBudget") class, given an observable truncation strategy (e.g. `max_error_total`, `max_error_per_slice`, `p_norm`).

### Upgrade Notes

- The [`backpropagate()`](/docs/api/qiskit-addon-obp/qiskit-addon-obp#backpropagate "qiskit_addon_obp.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`](/docs/api/qiskit-addon-obp/utils-simplify#operatorbudget "qiskit_addon_obp.utils.simplify.OperatorBudget") instance.

  To migrate, change this code

  ```python
  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

  ```python
  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()`](/docs/api/qiskit-addon-obp/qiskit-addon-obp#backpropagate "qiskit_addon_obp.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()`](/docs/api/qiskit-addon-obp/qiskit-addon-obp#backpropagate "qiskit_addon_obp.backpropagate") and, recombine any slices remaining after back-propagation with the original `N-20` slices.

  For example

  ```python
  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()`](/docs/api/qiskit-addon-obp/utils-truncating#setup_budget "qiskit_addon_obp.utils.truncating.setup_budget") has been renamed to `num_slices`.

- The `max_slices` attribute in [`OBPMetadata`](/docs/api/qiskit-addon-obp/utils-metadata-obp-metadata "qiskit_addon_obp.utils.metadata.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:

  ```python
  from obp import backpropagate
  ```

  should be changed to:

  ```python
  from qiskit_addon_obp import backpropagate
  ```

- Removed the `max_error_total`, `max_error_per_slice`, and `p_norm` kwargs from the [`backpropagate()`](/docs/api/qiskit-addon-obp/qiskit-addon-obp#backpropagate "qiskit_addon_obp.backpropagate") signature. Instead, users must specify their observable truncation strategy with the new `truncation_error_budget` kwarg which accepts a [`TruncationErrorBudget`](/docs/api/qiskit-addon-obp/utils-truncating#truncationerrorbudget "qiskit_addon_obp.utils.truncating.TruncationErrorBudget") instance.

- Removed the `per_slice_budget`, `max_error_total`, and `p_norm` fields from the [`OBPMetadata`](/docs/api/qiskit-addon-obp/utils-metadata-obp-metadata "qiskit_addon_obp.utils.metadata.OBPMetadata") class. These fields will now be accessed through the new `truncation_error_budget` field, which holds a [`TruncationErrorBudget`](/docs/api/qiskit-addon-obp/utils-truncating#truncationerrorbudget "qiskit_addon_obp.utils.truncating.TruncationErrorBudget") instance.

### Bug Fixes

- The [`setup_budget()`](/docs/api/qiskit-addon-obp/utils-truncating#setup_budget "qiskit_addon_obp.utils.truncating.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()`](/docs/api/qiskit-addon-obp/qiskit-addon-obp#backpropagate "qiskit_addon_obp.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()`](/docs/api/qiskit-addon-obp/utils-metadata-obp-metadata#accumulated_error "qiskit_addon_obp.utils.metadata.OBPMetadata.accumulated_error") and [`left_over_error_budget()`](/docs/api/qiskit-addon-obp/utils-metadata-obp-metadata#left_over_error_budget "qiskit_addon_obp.utils.metadata.OBPMetadata.left_over_error_budget") were fixed to respect the [Minkowski inequality](https://en.wikipedia.org/wiki/Minkowski_inequality). This is necessary, because a general Lp-norm (other than `p=2`) does not satisfy the [parallelogram law](https://en.wikipedia.org/wiki/Parallelogram_law) which resulted in a non-rigorous upper bound of the actual accumulated errors (and left-over error budgets by extension).
