From 78cab9e2c4d24f57cf69ac96a4b793cd6eda258e Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Mon, 31 Oct 2022 19:27:28 -0400 Subject: [PATCH] Fix up docstring for VF2PostLayout (#9027) This commit fixes a few copy paste errors and errors in the docstring for the VF2PostLayout pass. It also adds a a link to the paper for the pass. This was originally part of #9026 as these fixes were part of modifying the docstring to document the new feature being added in that PR. This commit just extracts those docstring fixes from that PR. Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> (cherry picked from commit 234816c2243f592381bba634a394f78f70c61738) --- .../transpiler/passes/layout/vf2_post_layout.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/qiskit/transpiler/passes/layout/vf2_post_layout.py b/qiskit/transpiler/passes/layout/vf2_post_layout.py index 01576adc89e6..17fc04a56779 100644 --- a/qiskit/transpiler/passes/layout/vf2_post_layout.py +++ b/qiskit/transpiler/passes/layout/vf2_post_layout.py @@ -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 `__. - 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 + 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 """