-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use retworkx for substitute_node_with_dag #6302
Merged
Merged
Changes from all commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
a32fef8
Use retworkx for substitute_node_with_dag
mtreinish acee0ab
DNM: Add retworkx from PR branch to CI
mtreinish ed9f2ec
Merge branch 'main' into perf-twaeks
mtreinish 773b7b1
Merge branch 'main' into perf-twaeks
mtreinish 2ee3216
Fix handling of input dag with direct edge from input to output
mtreinish baa8f91
Update requirements for testing
mtreinish d26cf7d
Run black
mtreinish ad51c04
Avoid node copy
mtreinish 0372583
Avoid op func call overhead
mtreinish ca42178
Fix lint
mtreinish b4e2efa
Expand substitute tests
mtreinish 193e224
Make failing test deterministic
mtreinish df153d5
Fix qasm example
mtreinish c0fc655
Fix lint
mtreinish d9f887a
Merge branch 'main' into perf-twaeks
mtreinish 1763563
Merge branch 'main' into perf-twaeks
mtreinish 4eb83c6
Merge branch 'main' into perf-twaeks
mtreinish 4014afe
Merge branch 'main' into perf-twaeks
mtreinish 85cd3b1
Merge branch 'main' into perf-twaeks
mtreinish bcd65ed
Merge branch 'main' into perf-twaeks
mtreinish 46dcdb7
Merge branch 'main' into perf-twaeks
mtreinish 0b5d4ac
Update retworkx source path
mtreinish 7b39b7e
Merge remote-tracking branch 'origin/main' into perf-twaeks
mtreinish 84d03a0
Fix rebase issues
mtreinish 8a64b39
Merge branch 'main' into perf-twaeks
mtreinish 4e926cc
Bump minimum retworkx version to latest release
mtreinish f571561
Reduce iterations building wire maps
mtreinish 3f8f1ca
Merge branch 'main' into perf-twaeks
mtreinish 9e0118b
Use a plain list comprehension instead of a lambda map
mtreinish a9a0633
Merge branch 'perf-twaeks' of github.com:mtreinish/qiskit-core into p…
mtreinish 9f50236
Apply suggestions from code review
mtreinish 7a12eac
Improve code comments
mtreinish 22d9393
Merge remote-tracking branch 'origin/main' into perf-twaeks
mtreinish c8d43f5
Add reno touting performance benefits
jakelishman 2088453
Merge branch 'main' into perf-twaeks
mergify[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To check, here you're just using the second argument of
lambda edge, wire=self_wire: edge == wire
purely for the normal safe scoping within the lambda, right? e.g. it's only ever intended to be called with one argument, likeself_wire.__eq__
but with conversion ofNotImplemented
to errors.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I did this solely for scoping. IIRC when I wrote this originally I didn't do this and lint or something complained. The
filter_fn
argument only gets passed a single arg which is the weight/data payload object for each edge: https://qiskit.org/documentation/retworkx/dev/stubs/retworkx.PyDiGraph.find_predecessors_by_edge.html#retworkx.PyDiGraph.find_predecessors_by_edge