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

Fix up docstring for VF2PostLayout #9027

Merged
merged 2 commits into from
Oct 31, 2022
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
17 changes: 9 additions & 8 deletions qiskit/transpiler/passes/layout/vf2_post_layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,25 +51,26 @@ class VF2PostLayout(AnalysisPass):
"""A pass for choosing a Layout after transpilation of a circuit onto a
Coupling graph, as a subgraph isomorphism problem, solved by VF2++.

Unlike the :class:`~.VF2PostLayout` transpiler pass which is designed to find an
Unlike the :class:`~.VF2Layout` transpiler pass which is designed to find an
initial layout for a circuit early in the transpilation pipeline this transpiler
pass is designed to try and find a better layout after transpilation is complete.
The initial layout phase of the transpiler doesn't have as much information available
as we do after transpilation. This pass is designed to be paired in a similar pipeline
as the layout passes. This pass will strip any idle wires from the circuit, use VF2
to find a subgraph in the coupling graph for the circuit to run on with better fidelity
and then update the circuit layout to use the new qubits.
and then update the circuit layout to use the new qubits. The algorithm used in this
pass is described in `arXiv:2209.15512 <https://arxiv.org/abs/2209.15512>`__.

If a solution is found that means there is a "perfect layout" and that no
further swap mapping or routing is needed. If a solution is found the layout
will be set in the property set as ``property_set['layout']``. However, if no
solution is found, no ``property_set['layout']`` is set. The stopping reason is
If a solution is found that means there is a lower error layout available for the
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
If a solution is found that means there is a lower error layout available for the
If a solution is found that means there is a low error layout available for the

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is actually better as is. The VF2PostLayout pass is searching for a lower estimate error rate subgraph than the current layout. It's not guaranteed to find a low error rate in general it actually could still be quite high it's just relative to the input layout when the pass is run.

circuit. If a solution is found the layout will be set in the property set as
will be set in the property set as ``property_set['post_layout']``. However, if no
solution is found, no ``property_set['post_layout']`` is set. The stopping reason is
set in ``property_set['VF2PostLayout_stop_reason']`` in all the cases and will be
one of the values enumerated in ``VF2PostLayoutStopReason`` which has the
following values:

* ``"solution found"``: If a perfect layout was found.
* ``"nonexistent solution"``: If no perfect layout was found.
* ``"solution found"``: If a solution was found.
* ``"nonexistent solution"``: If no solution was found.
* ``">2q gates in basis"``: If VF2PostLayout can't work with basis

"""
Expand Down