-
Notifications
You must be signed in to change notification settings - Fork 23
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 invert functionality for quantum operations #416
Conversation
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.
Also here, many thanks for this nice and neatly organized contribution.
As in the other PR I have a few minor nitpicks and a reply to one of the general questions you posted in a comment. Should be pretty straight-forward to realize.
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.
Also here, some finishing touches before this is ready to merge.
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 ✅ Many thanks!
Would you mind quickly resolving the conflicts with the main branch that arose from the other PR just getting merged? Then this can be merged as well!
b493154
to
50726ba
Compare
Rebased! Thanks! |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #416 +/- ##
======================================
Coverage 89.5% 89.5%
======================================
Files 102 102
Lines 11820 11923 +103
Branches 2095 2098 +3
======================================
+ Hits 10580 10680 +100
- Misses 1240 1243 +3
|
Description
Add an
invert
function toOperation
. This mirrors the functionality of the OpenQASM 3.0inv
modifier.For Compound gates, this calls
invert
on each nested operation and reverses the order of the operations.For Standard gates, this checks which type of gate is being inverted and handles each case.
Checklist: