-
Notifications
You must be signed in to change notification settings - Fork 615
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 qml.math.grad and qml.math.jacobian for differentiating any interface #6741
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #6741 +/- ##
=======================================
Coverage 99.60% 99.60%
=======================================
Files 475 476 +1
Lines 45121 45210 +89
=======================================
+ Hits 44944 45033 +89
Misses 177 177 ☔ 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.
🚀 🥳
Co-authored-by: Pietropaolo Frisoni <[email protected]>
Co-authored-by: Yushao Chen (Jerry) <[email protected]>
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.
Added a few suggestions to match the doc output on my laptop. Please let me know if it is different on yours 👍
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 all good on my side! Just several minor suggestions on error msg. Thanks a lot!
Also, the similar error handling branch in |
Co-authored-by: Pietropaolo Frisoni <[email protected]> Co-authored-by: Yushao Chen (Jerry) <[email protected]>
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.
🚀
Context:
We often have to rewrite tests four different ways to test differentiability for each different interface. This is rather time-intensive and annoying. By adding and using a
qml.math.grad
, we can write one test that applies to all interfaces.Description of the Change:
Adds a
qml.math.grad
andqml.math.jacobian
with a jax-like interface that can differentiate with respect to any argument inputs.Benefits:
Possible Drawbacks:
We have several different options for interface, but I decided to do my best to mirror the jax interface.
Related GitHub Issues: