qiskit/releasenotes/notes/1.0/upgrade-pass-manager-98aa64...

81 lines
2.7 KiB
YAML

---
upgrade_transpiler:
- |
A pattern for the pass piepline construction was upgraded.
The syntactic sugar shown below for instantiation of flow controller was removed.
.. code-block:: python
from qiskit.transpiler import PassManager
pm = PassManager()
pm.append(my_pass, condition=condition_callable, do_while=do_while_callable)
Instead of using this keyword argument pattern, you should explicitly instantiate the
flow controller.
.. code-block:: python
from qiskit.passmanager import ConditionalController, DoWhileController
from qiskit.transpiler import PassManager
pm = PassManager()
pm.append(
ConditionalController(
DoWhileController(my_pass, do_while=do_while_callable),
condition=condition_callable,
)
)
Note that you can manage the pecking order of controllers when you want to nest them,
which was not possible with keyword arguments.
You can also build the pipeline with the constructor of the pass manager like below
because there is no reason to call the append method now.
.. code-block:: python
pm = PassManager(
ConditionalController(
DoWhileController(my_pass, do_while=do_while_callable),
condition=condition_callable,
)
)
- |
The append method of built-in flow controllers was removed. This includes
* ``ConditionalController.append``
* ``DoWhileController.append``
* ``FlowControllerLinear.append``
The task pipeline in a flow controller is frozen, and it must be passed
when the controller instance is created.
- |
Removed the ``passess`` methods of :class:`.PassManager` and :class:`.StagedPassManager` that
returned a representation of included passes in the form of list of dictionaries.
However, this format doesn't efficiently represent more complicated pass pipeline,
which may include conditional branching and nested conditions.
Instead of using this representation, please use following pattern
.. code-block:: python
pm = PassManager(...)
pm.to_flow_controller().tasks
This directly returns a linearized base task instances in tuple format.
- |
The ``max_iteration`` argument was removed from :meth:`.PassManager.append`
and :meth:`.PassManager.replace`.
- |
The following legacy classes were removed from the pass manager and transpiler modules following
their deprecation in Qiskit 0.46:
* ``qiskit.passmanager.flow_controllers.FlowController``
* ``qiskit.transpiler.fencedobjs.FencedObject``
* ``qiskit.transpiler.fencedobjs.FencedPropertySet``
* ``qiskit.transpiler.fencedobjs.FencedDAGCircuit``
* ``qiskit.transpiler.runningpassmanager.RunningPassManager``