-
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
Add equivalence-library rules between rzz
and cp
#13019
Merged
Merged
Changes from all commits
Commits
Show all changes
2 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
17 changes: 17 additions & 0 deletions
17
releasenotes/notes/cphase-rzz-equivalence-e8afc37b71a74366.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,17 @@ | ||
--- | ||
features_circuits: | ||
- | | ||
The standard equivalence library (:data:`.SessionEquivalenceLibrary`) now has rules that can | ||
directly convert between Qiskit's standard-library 2q continuous Ising-type interactions (e.g. | ||
:class:`.CPhaseGate`, :class:`.RZZGate`, :class:`.RZXGate`, and so on) using local equivalence | ||
relations. Previously, several of these conversions would go via a 2-CX form, which resulted | ||
in less efficient circuit generation. | ||
|
||
.. note:: | ||
|
||
In general, the :class:`.BasisTranslator` is not guaranteed to find the "best" equivalence | ||
relation for a given :class:`.Target`, but will always find an equivalence if one exists. We | ||
rely on more expensive resynthesis and gate-optimization passes in the transpiler to improve | ||
the output. These passes are currently not as effective for basis sets with a continuously | ||
parametrized two-qubit interaction as they are for discrete super-controlled two-qubit | ||
interactions. |
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
Oops, something went wrong.
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.
why did you need to remove this test?
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.
The test is asserting that a failure occurs, and for most of the gates in the list, they shouldn't really fail - we've got enough equivalence and translation rules that it should be possible to translate the gate into one we can represent better. The
add_control
logic is just not super smart about gate translation.As a side effect of this PR, the RZ path now happens to convert things to
CPhaseGate
rather thanCRZGate
(or something like that), so the control works further than it did before.