-
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
Fix SabreSwap with classically conditioned gates #8041
Merged
mergify
merged 6 commits into
Qiskit:main
from
jakelishman:fix-sabreswap-classical-condition
May 12, 2022
Merged
Changes from 4 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
034840d
Fix SabreSwap with classically conditioned gates
jakelishman ea3c58d
Use `successors` to calculate required predecessors
jakelishman 165135c
Merge remote-tracking branch 'ibm/main' into fix-sabreswap-classical-…
jakelishman ab5d539
Fix incorrect import
jakelishman 18aef6a
Fix decremented typo
jakelishman ed7ef7d
Merge branch 'main' into fix-sabreswap-classical-condition
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
8 changes: 8 additions & 0 deletions
8
releasenotes/notes/sabreswap-fix-condition-593f36e855f9064c.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,8 @@ | ||
--- | ||
fixes: | ||
- | | ||
The :class:`.SabreSwap` transpiler pass, used in :func:`.transpile` when | ||
``routing_method="sabre"`` is set, will no longer sporadically drop | ||
classically conditioned gates and their successors from circuits during the | ||
routing phase of transpilation. See | ||
`#8040 <https://github.com/Qiskit/qiskit-terra/issues/8040>`__. |
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
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.
I'm wondering if doing something like:
would work and be faster. Not that I expect this to be a bottleneck. It just took me a sec to grok this.
I guess there might be an issue because of the input nodes as we'd be including the first layer nodes and they'd have a required predecessor count for the inputs. That's not too different than what this outputs now because we'll end up with output nodes in the
out
dict but that should be ok because we'll never do a lookup on an output wire.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.
I think this will count
DAGInNodes
too? We ought to discount those to do things properly, but we could just loop through the originalfront_layer
and automatically set those to zero.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.
Oh, I clearly didn't read your comment properly sorry!
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.
Lets just leave this as is. We can revisit this after #7977 and see if we're actually seeing this in profiles or not.