-
Notifications
You must be signed in to change notification settings - Fork 61
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
Update gate.clifford
value in rotations given a new angle
#1257
Conversation
gate.clifford
value in rotations given a new thetagate.clifford
value in rotations given a new angle
I think it would be cleaner to transform |
Once it is a property, you shouldn't even need a setter. The property getter (the function decorated with |
Co-authored-by: Alessandro Candido <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1257 +/- ##
=======================================
Coverage 99.85% 99.85%
=======================================
Files 73 73
Lines 10638 10683 +45
=======================================
+ Hits 10623 10668 +45
Misses 15 15
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Thanks @MatteoRobbiati. The current approach looks good to me, I believe there is only still some issue with the tests (at least the CI). In principle you don't even need the @property
def clifford(self):
return False and overwrite it to |
Exactly! I decided to use I am open to modifications in case :) |
Only in Clifford gates (in cases where it should return |
I proposed this to @MatteoRobbiati to limit the amount of changes, but even the property is certainly an option, and a bit cleaner (since you don't need a mutable variable per instance, but if the information is stored once per class is enough). So, if you're willing to pay the price of 2-3 extra lines per Clifford class, you'd save one attribute for every instance of a Gate (making them marginally lighter). |
I second this. It seems like a better solution to me. |
Thanks for the suggestions! I left |
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.
Thanks @MatteoRobbiati, looks good to me.
This PR fixes the
gate.clifford
value when a new theta is set into a rotational (or controlled-rotational) gate.I am not sure this approach is the best, in particular considering the already implemented
@Gate.parameters.setter
in theabstract.py
file. Do you have any feedback on this @stavros11 (I bother you because you implemented theParametrizedGate
some years ago)?Checklist: