Release Notes¶
0.3.0¶
New Features¶
PauliLindbladErrorobjects can now be embedded in slices ofQuantumCircuitusing thePauliLindbladErrorInstructionand will be handled properly bybackpropagate().
Bug Fixes¶
Fixed a bug in
qiskit_addon_obp.backpropagate()which often caused resets to be applied to the wrong qubit.
0.2.0¶
New Features¶
A new parameter
show_legendhas been added to each function in theqiskit_addon_obp.utils.visualizationmodule 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.OperatorBudgetnow holdsatolandrtolfields which are absolute and relative tolerances used to determine whether coefficients are zero while simplifying an operator.
truncate_binary_search()now accepts atolkwarg. Once an optimal truncation threshold, up to this value, has been found, the search for an optimal threshold will stop. The default tolerance is1e-8; whereas, the tolerance used prior to this release was1e-10.TruncationErrorBudgetnow holds atolfield. This field is used bybackpropagate()as thetolargument totruncate_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_pauliswas 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 towardsnum_trimmed_paulis.
The reported number of unique Paulis in
num_unique_paulisis 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
OperatorBudgetclass for specifying how large an operator may grow during back-propagation.
Adds the
max_secondskeyword-argument to thebackpropagate()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 aTruncationErrorBudgetclass, given an observable truncation strategy (e.g.max_error_total,max_error_per_slice,p_norm).
Upgrade Notes¶
The
backpropagate()function no longer acceptsmax_paulisandmax_qwc_groupskwargs for constraining the size of the operator during back-propagation. Users should instead use the newoperator_budgetkwarg, which takes anOperatorBudgetinstance.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_sliceskwarg has been removed frombackpropagate(). Users should now only pass in slices which they intend to back-propagate. If a user wants to attempt to only back-propagate the last20slices of anN-slice circuit, they would simply pass in the last20slices tobackpropagate()and, recombine any slices remaining after back-propagation with the originalN-20slices.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_sliceskwarg insetup_budget()has been renamed tonum_slices.
The
max_slicesattribute inOBPMetadatahas been renamed tonum_slices.
The project’s root Python namespace has been changed from
obptoqiskit_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, andp_normkwargs from thebackpropagate()signature. Instead, users must specify their observable truncation strategy with the newtruncation_error_budgetkwarg which accepts aTruncationErrorBudgetinstance.
Removed the
per_slice_budget,max_error_total, andp_normfields from theOBPMetadataclass. These fields will now be accessed through the newtruncation_error_budgetfield, which holds aTruncationErrorBudgetinstance.
Bug Fixes¶
The
setup_budget()erroneously distributed themax_error_totalwhennum_sliceswas also set. This has been fixed now, such that the budget always gets distributed evenly, regardless of the value ofp_norm.
When the
max_secondsargument to thebackpropagate()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()andleft_over_error_budget()were fixed to respect the Minkowski inequality. This is necessary, because a general Lp-norm (other thanp=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).