-
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 only discrete-basis translations in GateDirection
#10786
Merged
mtreinish
merged 3 commits into
Qiskit:main
from
jakelishman:discrete-basis-gatedirection
Oct 16, 2023
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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/discrete-basis-gatedirection-bdffad3b47c1c532.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:`.GateDirection` transpiler pass will now use discrete-basis translations rather than | ||
relying on a continuous :class:`.RYGate`, which should help make some discrete-basis-set targets | ||
slightly more reliable. In general, :func:`.transpile` only has partial support for basis sets | ||
that do not contain a continuously-parametrised operation, and so it may not always succeed in | ||
these situations, and will almost certainly not produce optimal results. |
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
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.
From a performance PoV there isn't a huge difference either way. For each ECR gate we flip we end up doing two extra products here: https://github.com/Qiskit/qiskit/blob/main/qiskit/transpiler/passes/optimization/optimize_1q_decomposition.py#L197 but they're all 2x2 so it'll be fast. There might actually be an immeasurable speed up because we don't have to build 2 matrices for the ry gates when
to_matrix()
is called. From a memory overhead perspective I think with #10314 this is actually more efficient because 2 Ry(..) is about 1kb and this ends up being 6 pointers (assumingSGate()
andSdgGate()
are instantiated somewhere already,SXGate
should be because it's always in the default IBM basis with ECR).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, that's actually true about memory usage, the gate arrays and the singleton objects - I hadn't been thinking about that at all. I think I wrote this PR before we landed any of the singleton-gate stuff, so it wasn't on my mind at the time.