qiskit/releasenotes/notes/2.0/remove-deprecated-transpile...

50 lines
2.3 KiB
YAML

---
upgrade_transpiler:
- |
The following :func:`.transpile` and :func:`.generate_preset_pass_manager` input arguments,
deprecated since Qiskit 1.3 , have been removed from the API:
* `instruction_durations`
* `timing_constraints`
In addition to this, the specification of custom basis gates through the ``basis`` gate argument of
:func:`.transpile` and :func:`.generate_preset_pass_manager`, also deprecated in Qiskit 1.3, is
no longer allowed, and a ``ValueError`` will be raised in these cases.
The information formerly provided through these can still be specified via the ``backend`` or
``target`` arguments. You can build a `Target` instance with defined instruction durations doing::
Target.from_configuration(..., instruction_durations=...)
For specific timing constraints::
Target.from_configuration(..., timing_constraints=...)
And for custom basis gates, you can manually add them to the target or use ``.from_configuration``
with a custom name mapping, for example::
from qiskit.circuit.library import XGate
from qiskit.transpiler.target import Target
basis_gates = ["my_x", "cx"]
custom_name_mapping = {"my_x": XGate()}
target = Target.from_configuration(
basis_gates=basis_gates, num_qubits=2, custom_name_mapping=custom_name_mapping
)
- |
The :func:`.transpile` and :func:`.generate_preset_pass_manager` interfaces now
raise a ``UserWarning`` when providing a ``coupling_map`` and/or ``basis_gates``
along with a ``backend``. In these cases there are multiple sources of truth,
the user intentions are not always clear, and there can be conflicts that
:func:`.generate_preset_pass_manager` may not know how to resolve. In these cases,
we highly encourage the creation of a custom target that combines the chosen
constraints.
One of these situations is the specification of a gate with 3 or more qubits in
`backend` or `basis_gates` together with a custom coupling map. The coupling map
does not provide the necessary connectivity details to be able to determine the
action of the gate. In these cases, :func:`.transpile` and
:func:`.generate_preset_pass_manager` now raise a ``ValueError``.