-
Notifications
You must be signed in to change notification settings - Fork 595
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
Making arithmetic templates QJIT compatible #6307
Conversation
Hello. You may have forgotten to update the changelog!
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #6307 +/- ##
=======================================
Coverage 99.39% 99.40%
=======================================
Files 446 446
Lines 42328 42364 +36
=======================================
+ Hits 42073 42110 +37
+ Misses 255 254 -1 ☔ 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.
Thank you for working on this, looks good! Is it possible to add a test using qjit?
The qjit tests live in the Catalyst repo. See this PR for the added tests. |
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.
🚀
This PR makes the following template QJIT compatible.
The issue stems from the use of
qml.adjoint()
as an iterable in the PhaseAdder and Multiplier templates. In Catalyst, the correspondingHybridAdjoint
class is compatible with PennyLane'sAdjoint
class for single operations, but incompatible for multiple operations (see this Catalyst PR). The solution is add eachqml.adjoint(op)
to the decomposition list individually, instead of extending the list by treating the adjoint as an iterable.While this PR makes OutAdder and OutMultiplier QJIT compatible, there is another issue with them that prevents them from returning the correct answer when compiled with QJIT. This bug will be addressed in a separate PR.
This PR addresses sc-74445.