forked from Qiskit/qiskit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not contract control-flow operations during
SabreSwap
(Qiskit#13790
) The previous implementation of control-flow handling for `SabreSwap` caused control-flow blocks to contract away from idle qubit wires as a side effect of its algorithm. This will no longer be always valid with the addition of `Box`, and besides, that optimisation isn't part of a routing algorithm's responsibilities, so it's cleaner to have it in a separate pass (now `ContractIdleWiresInControlFlow`) where it can be applied at times other than routing, like in the optimisation loop.
- Loading branch information
1 parent
7995cab
commit 288d2f4
Showing
3 changed files
with
85 additions
and
33 deletions.
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
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,6 @@ | ||
--- | ||
fixes: | ||
- | | ||
:class:`.SabreSwap` will no longer contract idle qubit wires out of control-flow blocks during routing. | ||
This was generally a valid optimization, but not an expected side effect of a routing pass. | ||
You can now use the :class:`.ContractIdleWiresInControlFlow` pass to perform this contraction. |
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