-
Notifications
You must be signed in to change notification settings - Fork 39
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 qml.probs for lightning.tensor #906
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #906 +/- ##
===========================================
+ Coverage 40.29% 97.88% +57.59%
===========================================
Files 39 212 +173
Lines 2683 28279 +25596
===========================================
+ Hits 1081 27681 +26600
+ Misses 1602 598 -1004 ☔ 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.
If possible, could you point out the bug in a comment for future reference?
pennylane_lightning/core/src/simulators/lightning_tensor/tncuda/TNCudaBase.hpp
Outdated
Show resolved
Hide resolved
...ne_lightning/core/src/simulators/lightning_tensor/tncuda/measurements/MeasurementsTNCuda.hpp
Outdated
Show resolved
Hide resolved
Sure, added it to the PR description. |
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.
Nice job @multiphaseCFD! I made a few comments 👍
...ne_lightning/core/src/simulators/lightning_tensor/tncuda/measurements/MeasurementsTNCuda.hpp
Show resolved
Hide resolved
...ne_lightning/core/src/simulators/lightning_tensor/tncuda/measurements/MeasurementsTNCuda.hpp
Outdated
Show resolved
Hide resolved
...ne_lightning/core/src/simulators/lightning_tensor/tncuda/measurements/MeasurementsTNCuda.hpp
Outdated
Show resolved
Hide resolved
...ne_lightning/core/src/simulators/lightning_tensor/tncuda/measurements/MeasurementsTNCuda.hpp
Outdated
Show resolved
Hide resolved
...ne_lightning/core/src/simulators/lightning_tensor/tncuda/measurements/MeasurementsTNCuda.hpp
Show resolved
Hide resolved
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 good to me, thanks @multiphaseCFD .
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.
LGTM Thank you @multiphaseCFD for fixing a bug! I left a question for future discussion 🚀
...ne_lightning/core/src/simulators/lightning_tensor/tncuda/measurements/MeasurementsTNCuda.hpp
Show resolved
Hide resolved
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`](../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`. - [x] Add a new entry to the `.github/CHANGELOG.md` file, summarizing the change, and including a link back to the PR. - [x] 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:** [SC-73501] `cutensornet`'s `Accessor` API allows the users to extract single state amplitudes (elements of the state tensor), slices of state amplitudes (slices of the state tensor) as well as the full state tensor. Previous implementation summed up the slices of the state tensor and compute the probabilities, which was a bug. This PR sums up the prob of each slices of the state tensor and fixes the bug. **Description of the Change:** **Benefits:** Analytic probs is supported **Possible Drawbacks:** The computation cost could be too expensive to afford if the number of projected wires is large. **Related GitHub Issues:** --------- Co-authored-by: ringo-but-quantum <github-ringo-but-quantum@xanadu.ai>
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:
[SC-73501]
cutensornet
'sAccessor
API allows the users to extract single state amplitudes (elements of the state tensor), slices of state amplitudes (slices of the state tensor) as well as the full state tensor. Previous implementation summed up the slices of the state tensor and compute the probabilities, which was a bug. This PR sums up the prob of each slices of the state tensor and fixes the bug.Description of the Change:
Benefits:
Analytic probs is supported
Possible Drawbacks:
The computation cost could be too expensive to afford if the number of projected wires is large.
Related GitHub Issues: