-
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
Fix adjoint validation with global measurements #5761
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.
Potentially we could add a device_wires
keyword argument to adjoint_state_measurements
, and then pass in device_wires
or adjoint_state_measurements
to the StateMP
. And if both are None
, maybe we just default to one qubit?
While this would work for the validation, would it actually work for the execution part?
Is the current approach not a good idea? Note that the execution is not affected by the bug, it's just the validation, because it calls |
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.
Ignore earlier comment. This seems to be a perfectly straightforward fix that gets the job done :)
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 @dwierichs , LGTM!
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #5761 +/- ##
==========================================
- Coverage 99.67% 99.66% -0.02%
==========================================
Files 416 413 -3
Lines 38686 38813 +127
==========================================
+ Hits 38562 38684 +122
- Misses 124 129 +5 ☔ View full report in Codecov by Sentry. |
Context:
Validation of the adjoint method did not take device wires into account, leading to the linked issue.
Description of the Change:
Include
validate_device_wires
in_supports_adjoint
inDefaultQubit
.Benefits:
Possible Drawbacks:
Related GitHub Issues:
fixes #5760
[sc-64278]