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
Support autodiff and batching in kernel matrix functions #3742
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3742 +/- ##
=======================================
Coverage 99.82% 99.82%
=======================================
Files 329 329
Lines 28848 28856 +8
=======================================
+ Hits 28797 28805 +8
Misses 51 51
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
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 minor questions and comments, but overall, the changes are clear and well-thought out.
Co-authored-by: Mudit Pandey <muditpandey2812@gmail.com>
Merge queue setting changed
* everything,everywhere,all at once * changelog * add lintable test file * Apply suggestions from code review Co-authored-by: Mudit Pandey <muditpandey2812@gmail.com> --------- Co-authored-by: Mudit Pandey <muditpandey2812@gmail.com> Co-authored-by: Romain Moyard <rmoyard@gmail.com>
Context:
There are two utility functions in
pennylane/kernels/utils.py
:square_kernel_matrix
andkernel_matrix
. They are written for Numpy, and partially for Autograd.Description of the Change:
This PR makes the two functions fully compatible with Autograd, JAX, Tensorflow and PyTorch.
In addition it adds batching support to the functions, allowing the kernel to return a one-dimensional instead of a scalar output.
Benefits:
Differentiation/interface support. One can now make use of shot vector execution together with kernels.
Possible Drawbacks:
usual overhead of
qml.math
.Related GitHub Issues:
implements #2492