-
Notifications
You must be signed in to change notification settings - Fork 42
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 measurements with dynamic wires #1081
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1081 +/- ##
==========================================
+ Coverage 96.00% 99.08% +3.07%
==========================================
Files 232 111 -121
Lines 39306 17114 -22192
==========================================
- Hits 37737 16957 -20780
+ Misses 1569 157 -1412 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Good job! Nice integration with the tests we already have in place.
I'm assuming the coverage is showing false positives as usual. Please triple-check. (quadruplet-check?)
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 @josephleekl! Happy to approve 🙌
Before submitting
Please complete the following checklist when submitting a PR:
All new features must include a unit test.
If you've fixed a bug or added code that should be tested, add a test to the
tests
directory!All new functions and code must be clearly commented and documented.
If you do make documentation changes, make sure that the docs build and
render correctly by running
make docs
.Ensure that the test suite passes, by running
make test
.Add a new entry to the
.github/CHANGELOG.md
file, summarizing thechange, and including a link back to the PR.
Ensure that code is properly formatted by running
make format
.When all the above are checked, delete everything above the dashed
line and fill in the pull request template.
Context:
Currently when using dynamically determined wire count (e.g.
qml.device("lightning.qubit")
orqml.device("lightning.qubit", shots = x)
), we have an issue when we perform measurements without specifying any observables or wires, i.e.incorrect result is returned, since the number of wires is not known.
Description of the Change:
For measurements with no wires (i.e. no observables or wires provided), we edit the measurement process to include the number of wires. This is fixed for with and without shots.
Benefits:
Get correct results.
Possible Drawbacks:
Related GitHub Issues:
fixes #1086
[sc-85837]