diff --git a/qiskit/transpiler/preset_passmanagers/common.py b/qiskit/transpiler/preset_passmanagers/common.py index c9bcc9a7904c..28879b348f05 100644 --- a/qiskit/transpiler/preset_passmanagers/common.py +++ b/qiskit/transpiler/preset_passmanagers/common.py @@ -15,6 +15,7 @@ import collections from typing import Optional +import warnings from qiskit.circuit.equivalence_library import SessionEquivalenceLibrary as sel from qiskit.circuit.controlflow import CONTROL_FLOW_OP_NAMES @@ -454,6 +455,18 @@ def generate_translation_passmanager( Raises: TranspilerError: If the ``method`` kwarg is not a valid value """ + if backend_props is not None: + warnings.warn( + "The backend_props argument for this function has been deprecated. " + "The BackendProperties data structure has been deprecated and will be " + "removed in Qiskit 2.0, instead you should use a Target object with the " + "required target argument. You can use Target.from_configuration() " + "to build the target from the properties object, but in 2.0 you will need " + "to generate a target directly.", + DeprecationWarning, + stacklevel=2, + ) + if method == "translator": unroll = [ # Use unitary synthesis for basis aware decomposition of diff --git a/releasenotes/notes/deprecate-bp-args-gtpm-4023a5f86668d96d.yaml b/releasenotes/notes/deprecate-bp-args-gtpm-4023a5f86668d96d.yaml new file mode 100644 index 000000000000..f833fbe1bf44 --- /dev/null +++ b/releasenotes/notes/deprecate-bp-args-gtpm-4023a5f86668d96d.yaml @@ -0,0 +1,10 @@ +--- +deprecations_transpiler: + - | + The ``backend_props`` argument of the + :func:`.generate_translation_pass_manager` function is deprecated and + will be removed in Qiskit 2.0. This argument is optional and is superseded + if the required ``target`` argument is populated. As the + :class:`.BackendProperties` is deprecated and will be removed in Qiskit + 2.0 specifying this option will also no longer work. Usage of the argument + can safely be removed in 1.x as long as you were passing in a target.