-
Notifications
You must be signed in to change notification settings - Fork 35
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
Add MPO support to lightning.tensor
#859
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #859 +/- ##
==========================================
- Coverage 96.29% 91.78% -4.52%
==========================================
Files 212 68 -144
Lines 29415 5937 -23478
==========================================
- Hits 28324 5449 -22875
+ Misses 1091 488 -603 ☔ View full report in Codecov by Sentry. |
…ots (#839) **Context:** PR PennyLaneAI/pennylane#6046 wraps the legacy device API automatically in various device creation, qnode, and execute functions. As LK and LGPU plugins still rely on the legacy device API, the shots tests and the `generate_samples` logic in `lightning_kokkos.py` and `lightning_gpu.py` should be updated to adhere the new convention. **Related Shortcut Stories:** [sc-65998] --------- Co-authored-by: ringo-but-quantum <github-ringo-but-quantum@xanadu.ai> Co-authored-by: Shiro-Raven <exclass9.24@gmail.com> Co-authored-by: albi3ro <chrissie.c.l@gmail.com>
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`. - [ ] Add a new entry to the `.github/CHANGELOG.md` file, summarizing the change, 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:** **Description of the Change:** **Benefits:** **Possible Drawbacks:** **Related GitHub Issues:** --------- Co-authored-by: ringo-but-quantum <github-ringo-but-quantum@xanadu.ai>
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.
Hey @multiphaseCFD! Fantastic work, so far!
pennylane_lightning/core/src/simulators/lightning_tensor/tncuda/MPOTNCuda.hpp
Outdated
Show resolved
Hide resolved
pennylane_lightning/core/src/simulators/lightning_tensor/tncuda/MPOTNCuda.hpp
Outdated
Show resolved
Hide resolved
pennylane_lightning/core/src/simulators/lightning_tensor/tncuda/MPOTNCuda.hpp
Outdated
Show resolved
Hide resolved
pennylane_lightning/core/src/simulators/lightning_tensor/tncuda/MPSTNCuda.hpp
Outdated
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.
Great work @multiphaseCFD! 🚀
pennylane_lightning/core/src/simulators/lightning_tensor/tncuda/MPOTNCuda.hpp
Outdated
Show resolved
Hide resolved
pennylane_lightning/core/src/simulators/lightning_tensor/tncuda/MPOTNCuda.hpp
Outdated
Show resolved
Hide resolved
pennylane_lightning/core/src/simulators/lightning_tensor/tncuda/MPOTNCuda.hpp
Show resolved
Hide resolved
pennylane_lightning/core/src/simulators/lightning_tensor/tncuda/MPOTNCuda.hpp
Outdated
Show resolved
Hide resolved
pennylane_lightning/core/src/simulators/lightning_tensor/tncuda/MPOTNCuda.hpp
Outdated
Show resolved
Hide resolved
pennylane_lightning/core/src/simulators/lightning_tensor/tncuda/MPOTNCuda.hpp
Outdated
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.
Thanks @multiphaseCFD! Looks good to go as long as we revisit the support for further expansion and optimization in follow-up PRs as planned. Nice work 💯
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.
🪂
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.
Would you happen to know why codecov is failing around the _tensornet.py file?
I'm wondering which commit you were checking. Please check here the patch coverage of latest commit is 100%. |
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.
Thank you, for checking the coverage, and the nice work!
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 work @multiphaseCFD !!! Just a few comments but feel free to ignore them if you need.
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-70902]
MPO(Matrix Product Operator) is added to
lightning.tensor
for all gates support. Any 2 more wires gates and 1 more target wire controlled gates can be supported viaMPO
. Current implementation only accepts the decomposed gate data. For the python users,MPO
decomposition is conducted in the python layer withnumpy
. Further improvement can be done by conducting MPO decomposition withcusolver
for large unitary matrices.Description of the Change:
Benefits:
Possible Drawbacks:
Related GitHub Issues: