-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't run ElidePermutation if routing is disabled (#13184)
* Don't run ElidePermutation if routing is disabled We have a routing plugin named "none" which is used to assert that no routing should be performed (it errors if there is routing required). We were previously running the ElidePermutations pass in this case which is not the expected or correct behavior because it causes the same kind of permutation as routing and would eliminate and swap gates in the circuit. As the typical use case for routing_method='none' is when you've already routed a circuit (or constructed it by hand to match the connectivity constraints) we shouldn't be doing this. This commit fixes this behavior so if the routing_method is set to "none" we no longer run the ElidePermutations pass. Fixes #13144 * Move release note to the correct location
- Loading branch information
Showing
3 changed files
with
45 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
releasenotes/notes/no-elide-routing-none-7c1bebf1283d48c0.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
fixes: | ||
- | | ||
Fixed an issue when running :func:`.transpile` or | ||
:meth:`~.StagedPassManager.run` on a pass manager generated by | ||
:func:`.generate_preset_pass_manager` using ``optimization_level`` 2 or 3 | ||
when the ``routing_method`` argument is set to ``"none"`` to explicitly | ||
disable routing. Previously under these conditions the transpiler would run | ||
the :class:`.ElidePermutation` pass as part of the init stage as under normal | ||
conditions this is a useful optimization to remove :class:`.SwapGate` | ||
and :class:`.PermutationGate` instances from the circuit. But when | ||
``routing_method="none"`` this optimization wasn't expected as it permutes | ||
the circuit in a similar manner to routing which shouldn't be performed | ||
when ``routing_method="none"``. This has been fixed by no longer | ||
running :class:`.ElidePermutation` if ``routing_method="none"`` is set. | ||
Fixed `#13144 <https://github.com/Qiskit/qiskit/issues/13144>`__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters