-
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
defer_measurements
raises errors for unsupported measurements
#4701
Conversation
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.
I know there's a lot of debate over this, but I'm fine with this decision and its better than people being confused about what their answers actually mean.
For reference, @trbromley and I had a discussion offline and the decision was to go in this direction in the end. |
@mudit2812 Thank you for validating with @trbromley and for posting the update here. |
Co-authored-by: Tom Bromley <49409390+trbromley@users.noreply.github.com>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #4701 +/- ##
==========================================
- Coverage 99.64% 99.64% -0.01%
==========================================
Files 379 380 +1
Lines 34126 33983 -143
==========================================
- Hits 34005 33861 -144
- Misses 121 122 +1
☔ View full report in Codecov by Sentry. |
Looking back at this PR, we probably should have given a recommendation, i.e., if you're seeing an error because of |
Context:
Measurements that cover all wires can give users unexpected outputs when using mid-circuit measurements. So,
defer_measurements
now explicitly removes support for such measurements by raising errors.Description of the Change:
qml.state()
is used.qml.probs()
,qml.sample()
, orqml.counts()
is used if wires or an observable isn't specified.Benefits:
Possible Drawbacks:
Related GitHub Issues:
#4363