-
Notifications
You must be signed in to change notification settings - Fork 632
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
Make BasisRotation
jit compatible
#6779
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## v0.40.0-rc0 #6779 +/- ##
==============================================
Coverage ? 99.60%
==============================================
Files ? 476
Lines ? 45222
Branches ? 0
==============================================
Hits ? 45045
Misses ? 177
Partials ? 0 ☔ View full report in Codecov by Sentry. |
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.
Just something I noticed passing by 😸
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, thanks for this! 🚀
Context:
PR #6019 only fixes
BasisRotation
when using backprop ondefault.qubit
. It is not jit compatible on any other device. This is becauseunitary_matrix
was being considered a hyperparameter, not a piece of data. So we could not detect that the matrix was a tracer and we were in jitting mode, and we could not convert the matrix back into numpy data.Description of the Change:
Make
unitary_matrix
a piece of data instead of a hyperparameter. This allows us to detect when it is being jitted.As a by-product, I also made it valid pytree.
By making
unitary_matrix
a piece of data, we were able to get rid of the custom comparison method inqml.equal
.Benefits:
Possible Drawbacks:
Related GitHub Issues:
[sc-51603] Fixes #6004