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

Update generate_samples in LK and LGPU to support qml.measurements.Shots #839

Merged
merged 38 commits into from
Aug 21, 2024

Conversation

maliasadi
Copy link
Member

@maliasadi maliasadi commented Aug 5, 2024

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]

Copy link
Contributor

github-actions bot commented Aug 5, 2024

Hello. You may have forgotten to update the changelog!
Please edit .github/CHANGELOG.md with:

  • A one-to-two sentence description of the change. You may include a small working example for new features.
  • A link back to this PR.
  • Your name (or GitHub username) in the contributors section.

Copy link

codecov bot commented Aug 5, 2024

Codecov Report

Attention: Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 81.65%. Comparing base (83ac9d8) to head (17d9912).
Report is 83 commits behind head on master.

Files with missing lines Patch % Lines
...ane_lightning/lightning_kokkos/lightning_kokkos.py 0.00% 1 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (83ac9d8) and HEAD (17d9912). Click for more details.

HEAD has 52 uploads less than BASE
Flag BASE (83ac9d8) HEAD (17d9912)
60 8
Additional details and impacted files
@@             Coverage Diff             @@
##           master     #839       +/-   ##
===========================================
- Coverage   98.33%   81.65%   -16.68%     
===========================================
  Files         113       17       -96     
  Lines       18741     1930    -16811     
===========================================
- Hits        18429     1576    -16853     
- Misses        312      354       +42     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

@Shiro-Raven Shiro-Raven changed the title 🚧 Build Lightning against PL:/ad/facade-wrapper Build Lightning against PL:/ad/facade-wrapper Aug 16, 2024
@Shiro-Raven Shiro-Raven marked this pull request as ready for review August 16, 2024 14:24
requirements-dev.txt Outdated Show resolved Hide resolved
pennylane_lightning/lightning_kokkos/lightning_kokkos.py Outdated Show resolved Hide resolved
tests/test_apply.py Outdated Show resolved Hide resolved
Co-authored-by: Ali Asadi <10773383+maliasadi@users.noreply.github.com>
@maliasadi maliasadi changed the title Build Lightning against PL:/ad/facade-wrapper Update generate_samples in LK and LGPU to support qml.measurements.Shots Aug 16, 2024
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! Just a comment...

tests/test_adjoint_jacobian.py Show resolved Hide resolved
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.

Good job @Shiro-Raven and @maliasadi. Thank you 😄

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.

Nice work so far.

requirements-dev.txt Outdated Show resolved Hide resolved
tests/test_adjoint_jacobian.py Show resolved Hide resolved
tests/test_expval.py Show resolved Hide resolved
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.

Nice work! I'm ready to approve. Could you please merge master?

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 that! Good job!

@Shiro-Raven Shiro-Raven merged commit 03aafa2 into master Aug 21, 2024
76 of 78 checks passed
@Shiro-Raven Shiro-Raven deleted the facade-wrapper-test branch August 21, 2024 03:33
multiphaseCFD pushed a commit that referenced this pull request Aug 21, 2024
…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>
maliasadi added a commit that referenced this pull request Aug 22, 2024
…legacy device for MPI LGPU (#864)

### Before submitting

Please complete the following checklist when submitting a PR:

- [x] 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!

- [x] 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`.

- [x] 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:**

- PR PennyLaneAI/pennylane#6021 removed code
duplication for `BasisEmbedding` and `BasisState`. As the result
`BasisState` no longer decomposes to `BasisStatePreparation`. This PR
updates Python unit tests to support this generalization of basis state
preparation.

- PR PennyLaneAI/pennylane#6046 added a facade
wrapper class for "legacy" devices. This PR is a follow up to PR #839
updating Multi-GPU LGPU device and tests.

**Description of the Change:**

**Benefits:**

**Possible Drawbacks:**

**Related GitHub Issues:**

---------

Co-authored-by: ringo-but-quantum <github-ringo-but-quantum@xanadu.ai>
multiphaseCFD pushed a commit that referenced this pull request Sep 8, 2024
…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>
multiphaseCFD pushed a commit that referenced this pull request Sep 8, 2024
…legacy device for MPI LGPU (#864)

### Before submitting

Please complete the following checklist when submitting a PR:

- [x] 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!

- [x] 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`.

- [x] 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:**

- PR PennyLaneAI/pennylane#6021 removed code
duplication for `BasisEmbedding` and `BasisState`. As the result
`BasisState` no longer decomposes to `BasisStatePreparation`. This PR
updates Python unit tests to support this generalization of basis state
preparation.

- PR PennyLaneAI/pennylane#6046 added a facade
wrapper class for "legacy" devices. This PR is a follow up to PR #839
updating Multi-GPU LGPU device and tests.

**Description of the Change:**

**Benefits:**

**Possible Drawbacks:**

**Related GitHub Issues:**

---------

Co-authored-by: ringo-but-quantum <github-ringo-but-quantum@xanadu.ai>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants