-
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.
Speedup constant factors in
LookaheadSwap
(#8068)
* Speedup constant factors in `LookaheadSwap` This picks some of the low-hanging fruit in `LookaheadSwap`, avoiding recalculating various properties and entities that are already known, and making some access patterns more efficient. It does not change the complexity properties of the algorithm, which will still cause its runtime to be excessive for large circuits. * Put comment in correct location Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
- Loading branch information
1 parent
4d251d1
commit 0e3e68d
Showing
2 changed files
with
132 additions
and
96 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
10 changes: 10 additions & 0 deletions
10
releasenotes/notes/speedup-lookahead-swap-4dd162fee2d25d10.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,10 @@ | ||
--- | ||
features: | ||
- | | ||
The transpiler pass :class:`.LookaheadSwap` (used by :func:`.transpile` when | ||
``routing_method="lookahead"``) has seen some performance improvements and | ||
will now be approximately three times as fast. This is purely being more | ||
efficient in its calculations, and does not change the complexity of the | ||
algorithm. In most cases, a more modern routing algorithm like | ||
:class:`.SabreSwap` (``routing_method="sabre"``) will be vastly more | ||
performant. |