-
Notifications
You must be signed in to change notification settings - Fork 34
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 XX-plus-YY
and XX-minus-YY
gate support to ZX library
#482
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #482 +/- ##
=====================================
Coverage 91.1% 91.1%
=====================================
Files 131 131
Lines 13667 13761 +94
Branches 2150 2166 +16
=====================================
+ Hits 12451 12539 +88
- Misses 1216 1222 +6
|
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.
LGTM. I checked with the qiskit decompositions and everything seems alright with me. Just a tiny optimization but for me its fine to omit it.
Another thing that I thought of is that Z rotations can be fused with the Control of CNOTs before or after (same for X rotations and targets). But I think that happens in more places than the added gates so it can be handled separately.
Thanks for the feedback! I remember that I even tried that from the very beginning but I was getting some kind of weird results and couldn't get tests to pass. |
340bde7
to
8455ffe
Compare
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
When floating point values are converted to `PiRational`s, they are constrained to the interval (-pi, pi]. This doesn't matter during computations in the ZX-library, but when converting from a quantum circuit, this can lead to problems when dealing with global phases. If global phases have to be introduced while parsing a `QuantumComputation, ' the original value of the phase must be passed along so the global phase is set correctly.
8455ffe
to
e67f692
Compare
Integer Division for Expressions was accidentally removed during rebase.
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.
@pehamTom many thanks for the changes here. Nice to see this go in!
Looking forward to the next QCEC release with the additional gate support and these fixes.
Description
This PR adds the last remaining unsupported gates to the ZX library.
In the process, it also introduces a new convenience function for integer division of parameter expressions that simplifies some code. In conjunction with #549, this also fixes #486.
Fixes #343
Checklist: