-
Notifications
You must be signed in to change notification settings - Fork 118
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
feat: add U and GPhase gates #799
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #799 +/- ##
==========================================
Coverage 100.00% 100.00%
==========================================
Files 129 129
Lines 8398 8519 +121
Branches 1871 1905 +34
==========================================
+ Hits 8398 8519 +121 ☔ View full report in Codecov by Sentry. |
angle_1: Union[FreeParameterExpression, float], | ||
angle_2: Union[FreeParameterExpression, float], | ||
angle_3: Union[FreeParameterExpression, float], |
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.
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.
Might be tricky since only the first gate would have a default, so maybe we circle back to this in another pr
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.
Maybe we just add documentation that setting angle_1 to pi/2 is equivalent to U2
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.
Looks like u2/u3 are defined with a combination of gphase and U here. I like the idea to define u_i / update the docstring in another PR.
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.
Looks good, just some nits
Issue #, if available:
Adding the U and GPhase gates so customers can build circuits from OpenQASM3 and simulate them with the local simulator.
This allows to import "stdgates.inc".
Description of changes:
Created a U and GPhase class and adding them to the translator dict.
Testing done:
Adding a series of new tests.
Merge Checklist
Put an
x
in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your pull request.General
Tests
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.