Skip to content
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

Merged
merged 503 commits into from
Sep 18, 2024
Merged

Add MPO support to lightning.tensor #859

merged 503 commits into from
Sep 18, 2024

Conversation

multiphaseCFD
Copy link
Member

@multiphaseCFD multiphaseCFD commented Aug 19, 2024

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 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:

[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 via MPO. Current implementation only accepts the decomposed gate data. For the python users, MPO decomposition is conducted in the python layer with numpy. Further improvement can be done by conducting MPO decomposition with cusolver for large unitary matrices.

Description of the Change:

Benefits:

Possible Drawbacks:

Related GitHub Issues:

Copy link

codecov bot commented Aug 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.78%. Comparing base (3718dd6) to head (6b0a268).
Report is 1 commits behind head on master.

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.
📢 Have feedback on the report? Share it here.

ringo-but-quantum and others added 29 commits August 21, 2024 13:23
…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>
Copy link
Contributor

@AmintorDusko AmintorDusko left a 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!

Copy link
Member

@maliasadi maliasadi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work @multiphaseCFD! 🚀

Copy link
Member

@maliasadi maliasadi left a 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 💯

pennylane_lightning/lightning_tensor/_tensornet.py Outdated Show resolved Hide resolved
pennylane_lightning/lightning_tensor/_tensornet.py Outdated Show resolved Hide resolved
pennylane_lightning/lightning_tensor/_tensornet.py Outdated Show resolved Hide resolved
pennylane_lightning/lightning_tensor/_tensornet.py Outdated Show resolved Hide resolved
pennylane_lightning/lightning_tensor/_tensornet.py Outdated Show resolved Hide resolved
pennylane_lightning/lightning_tensor/_tensornet.py Outdated Show resolved Hide resolved
pennylane_lightning/lightning_tensor/_tensornet.py Outdated Show resolved Hide resolved
Copy link
Member

@maliasadi maliasadi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🪂

Copy link
Contributor

@AmintorDusko AmintorDusko left a 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?

@multiphaseCFD
Copy link
Member Author

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%.

Copy link
Contributor

@AmintorDusko AmintorDusko left a 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!

Copy link
Contributor

@LuisAlfredoNu LuisAlfredoNu left a 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.

@multiphaseCFD multiphaseCFD merged commit eb709d5 into master Sep 18, 2024
108 of 109 checks passed
@multiphaseCFD multiphaseCFD deleted the add_mpo_ltensor branch September 18, 2024 16:54
@Qottmann Qottmann mentioned this pull request Sep 19, 2024
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci:build_wheels Activate wheel building. urgent Mark a pull request as high priority
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants