Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve stagedpassmanager docstring (backport #11284) #11303

Merged
merged 1 commit into from
Nov 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 15 additions & 13 deletions qiskit/transpiler/passmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ def passes(self) -> list[dict[str, BasePass]]:


class StagedPassManager(PassManager):
"""A Pass manager pipeline built up of individual stages
"""A pass manager pipeline built from individual stages.

This class enables building a compilation pipeline out of fixed stages.
Each ``StagedPassManager`` defines a list of stages which are executed in
Expand All @@ -349,21 +349,23 @@ class StagedPassManager(PassManager):
pass manager you are not able to modify the individual passes and are only able
to modify stages.

By default instances of ``StagedPassManager`` define a typical full compilation
By default, instances of ``StagedPassManager`` define a typical full compilation
pipeline from an abstract virtual circuit to one that is optimized and
capable of running on the specified backend. The default pre-defined stages are:

#. ``init`` - any initial passes that are run before we start embedding the circuit to the backend
#. ``layout`` - This stage runs layout and maps the virtual qubits in the
circuit to the physical qubits on a backend
#. ``routing`` - This stage runs after a layout has been run and will insert any
necessary gates to move the qubit states around until it can be run on
backend's coupling map.
#. ``translation`` - Perform the basis gate translation, in other words translate the gates
in the circuit to the target backend's basis set
#. ``optimization`` - The main optimization loop, this will typically run in a loop trying to
optimize the circuit until a condition (such as fixed depth) is reached.
#. ``scheduling`` - Any hardware aware scheduling passes
#. ``init`` - Initial passes to run before embedding the circuit to the backend.
#. ``layout`` - Maps the virtual qubits in the circuit to the physical qubits on
the backend.
#. ``routing`` - Inserts gates as needed to move the qubit states around until
the circuit can be run with the chosen layout on the backend's coupling map.
#. ``translation`` - Translates the gates in the circuit to the target backend's
basis gate set.
#. ``optimization`` - Optimizes the circuit to reduce the cost of executing it.
These passes will typically run in a loop until a convergence criteria is met.
For example, the convergence criteria might be that the circuit depth does not
decrease in successive iterations.
#. ``scheduling`` - Hardware-aware passes that schedule the operations in the
circuit.

.. note::

Expand Down