Skip to content

Commit

Permalink
improve stagedpassmanager docstring (#11284)
Browse files Browse the repository at this point in the history
* improve stagedpassmanager docstring

* don't call out swap gates

* reword optimization

* add word
  • Loading branch information
kevinsung authored Nov 22, 2023
1 parent 41b84b2 commit 33362cc
Showing 1 changed file with 15 additions and 13 deletions.
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

0 comments on commit 33362cc

Please sign in to comment.