-
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
Defer calculating classical cotransform and argnums till needed #6716
Conversation
Co-authored-by: Christina Lee <[email protected]>
…ylane into add-resolve-exec-config
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 #6716 +/- ##
=======================================
Coverage 99.60% 99.60%
=======================================
Files 476 476
Lines 45210 45224 +14
=======================================
+ Hits 45033 45047 +14
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.
Very nice! Always found this behaviour rather odd. 😄
Just a few minor comments.
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.
No blockers other than the CotransformCache
typo.
Co-authored-by: Andrija Paurevic <[email protected]> Co-authored-by: Mudit Pandey <[email protected]>
Context:
Currently, we do preprocessing and transform program setup in the qnode. We have to do this, because we have to cache the classical cotransforms and argnums in the qnode layer. If we tried to setup the full transform program later, we wouldn't have access to the classical cotransform information anymore.
But by caching the qnode, args, and kwargs instead of calculated cotransform information, we can further add to and modify the transform program after we have moved on from the qnode level. This allows us to setup the workflow inside of
qml.execute
. Now we only use the qnode-like kwargs fromqml.execute
. We don't use the "developer like" kwargs likeinner_transform_program
andconfig
. We will no longer need two "modes" for qml.execute, where one mimics the qnode and one is more developer focused. We can strictly mirror the interface of the QNode inqml.execute
. This also allows us to run our resolution and setup inqml.execute
.This does also provide some improvements. Where we previously got:
We now get:
We can also specify
diff_method="best"
inqml.execute
.Description of the Change:
Benefits:
Possible Drawbacks:
Related GitHub Issues: