-
Notifications
You must be signed in to change notification settings - Fork 569
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
Move defer_measurements
out of QNode
construction
#4432
Conversation
[sc-42758] |
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.
what's the status for the new device API?
The new device API already calls |
Codecov Report
@@ Coverage Diff @@
## master #4432 +/- ##
=======================================
Coverage 99.71% 99.71%
=======================================
Files 378 378
Lines 34242 34242
=======================================
Hits 34144 34144
Misses 98 98
|
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 great! the new device docs are pretty straightforward with when this is run, and new devices will provide their own preprocessing function if they want to support mid-circuit measurements
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.
👍
* Moved defer_measurements to device * Updated changelog * Update pennylane/_device.py * Fix error * Added test * Linting * Fixed tests * Updated tests * Added small integration test * [skip ci] Added new test * [skip ci] linting --------- Co-authored-by: Christina Lee <christina@xanadu.ai>
Context:
Currently
QNode
unconditionally applies thedefer_measurements
transform during construction. This should change so that devices that support native mid-circuit measurements can use their capabilities.Description of the Change:
defer_measurements
transform fromQNode.construct
.defer_measurements
transform step toqml.Device.batch_transform
for devices that don't support mid-circuit measurements natively.Benefits:
defer_measurements
is not applied unconditionally, allowing devices with native mid-circuit measurement support to define the behaviour without being able to use it.Possible Drawbacks:
Related GitHub Issues: