-
Notifications
You must be signed in to change notification settings - Fork 29
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
[Frontend] Add support for the new PL arithmetic operators #250
Conversation
Codecov Report
@@ Coverage Diff @@
## main #250 +/- ##
==========================================
+ Coverage 99.26% 99.32% +0.06%
==========================================
Files 38 38
Lines 6923 6972 +49
Branches 343 355 +12
==========================================
+ Hits 6872 6925 +53
+ Misses 28 26 -2
+ Partials 23 21 -2
|
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.
Nice, good start 💯
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 for the new op math support 🥳
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:
PennyLane is in the process of replacing
Hamiltonian
andTensor
observables with a set of general arithmetic operators. These consist of Prod, Sum and SProd. By default, using dunder methods (eg. +, -, @, *) to combine operators with scalars or other operators will create Hamiltonian’s and Tensor’s. However, these two classes will be replaced in coming releases of PennyLane. To enable the new arithmetic operators path, one can use those three classes directly or call enable_new_opmath.This PR adds support for Prod, Sum and SProd in Catalyst by implementing converter methods that serialize these classes to Runtime known observable classes at tracing.
Benefits:
qml.ops.op_math
:Prod
,Sum
,Sprod
.[sc-41351]