-
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.
Use retworkx for substitute_node_with_dag (#6302)
* Use retworkx for substitute_node_with_dag This commit leverage the substitute_node_with_subgraph method being added Qiskit/rustworkx#312 for the dagcircuit method substitute_node_with_dag. * DNM: Add retworkx from PR branch to CI * Fix handling of input dag with direct edge from input to output * Update requirements for testing * Run black * Avoid node copy * Avoid op func call overhead * Fix lint * Expand substitute tests * Make failing test deterministic * Fix qasm example * Fix lint * Update retworkx source path * Fix rebase issues * Bump minimum retworkx version to latest release * Reduce iterations building wire maps * Use a plain list comprehension instead of a lambda map * Apply suggestions from code review Co-authored-by: Kevin Krsulich <[email protected]> * Improve code comments * Add reno touting performance benefits Co-authored-by: Kevin Krsulich <[email protected]> Co-authored-by: Jake Lishman <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
- Loading branch information
1 parent
4fd83bb
commit 1eb6681
Showing
4 changed files
with
139 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
9 changes: 9 additions & 0 deletions
9
releasenotes/notes/retworkx-substitute_node_with_dag-speedup-d7d1f0d33716131d.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,9 @@ | ||
--- | ||
features: | ||
- | | ||
Various transpilation internals now use new features in `retworkx | ||
<https://github.com/Qiskit/retworkx>`__ 0.10 when operating on the internal | ||
circuit representation. This can often result in speedups in calls to | ||
:obj:`~qiskit.transpile` of around 10-40%, with greater effects at higher | ||
optimisation levels. See `#6302 | ||
<https://github.com/Qiskit/qiskit-terra/pull/6302>`__ for more details. |
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 |
---|---|---|
|
@@ -12,6 +12,7 @@ | |
|
||
|
||
"""Test the BasisTranslator pass""" | ||
|
||
import os | ||
|
||
from numpy import pi | ||
|