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 (check) full support for sampling in full parity with Lightning #836

Merged
merged 59 commits into from
Aug 9, 2024

Conversation

LuisAlfredoNu
Copy link
Contributor

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:
Migrate the lightning.kokkos device to the new device API.

Description of the Change:
Add the necessary method for the LightningKokkos that allows the use of new device API. It should have a similar structure as the LightningQubit class.

Note: Lightning Kokkos does not support MCMC sampling.

Benefits:
Integration of LighntingKokkos with the new device API.

Possible Drawbacks:

Related GitHub Issues:

Partial / Freezzed PR ⚠️ ❄️

To make a smooth integration of LightningKokkos with the new device API, we set the branch kokkosNewAPI_backend as the base branch target for this development.

The branch kokkosNewAPI_backend has the mock of all classes and methods necessary for the new API. Also, several tests were disabled with

if device_name == "lightning.kokkos":
    pytest.skip("Kokkos new API in WIP.  Skipping.",allow_module_level=True)

Additionally, the CI testing from PennyLane for LKokkos is temporally disabled through commenting on the following lines in .github/workflows files

: # pl-device-test --device ${DEVICENAME} --skip-ops --shots=20000 $COVERAGE_FLAGS --cov-append
: # pl-device-test --device ${DEVICENAME} --shots=None --skip-ops $COVERAGE_FLAGS --cov-append

However, these tests will unblocked as the implementation progresses.

After all the developments for integrating LightningKokkos with the new API have been completed then the PR will be open to merging to master

[sc-68820]

LuisAlfredoNu and others added 30 commits July 25, 2024 15:31
Co-authored-by: Vincent Michaud-Rioux <[email protected]>
Copy link
Contributor

github-actions bot commented Aug 2, 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 2, 2024

Codecov Report

Attention: Patch coverage is 97.97980% with 2 lines in your changes missing coverage. Please review.

Please upload report for BASE (kokkosNewAPI_backend@3eea0d1). Learn more about missing BASE report.

Files with missing lines Patch % Lines
...ane_lightning/lightning_kokkos/lightning_kokkos.py 97.95% 2 Missing ⚠️
Additional details and impacted files
@@                   Coverage Diff                   @@
##             kokkosNewAPI_backend     #836   +/-   ##
=======================================================
  Coverage                        ?   87.11%           
=======================================================
  Files                           ?       20           
  Lines                           ?     2274           
  Branches                        ?        0           
=======================================================
  Hits                            ?     1981           
  Misses                          ?      293           
  Partials                        ?        0           

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

@LuisAlfredoNu LuisAlfredoNu marked this pull request as ready for review August 6, 2024 12:57
@vincentmr vincentmr self-requested a review August 7, 2024 12:36
Copy link
Contributor

@vincentmr vincentmr left a comment

Choose a reason for hiding this comment

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

First round of review incoming! Cheers @LuisAlfredoNu .

LuisAlfredoNu and others added 2 commits August 7, 2024 13:57
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.

Looks good, thanks @LuisAlfredoNu! I'll review tests when reviewing the base branch.

@LuisAlfredoNu LuisAlfredoNu requested a review from vincentmr August 8, 2024 15:02
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.

Looks good!

Comment on lines 319 to 321
# As ControlledQubitUnitary == C(QubitUnitrary),
# it can be removed from `_operations` to keep
# consistency with `lightning_qubit.toml`
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want to keep this comment?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think now it is not necessary. I will delete it 👍

Copy link
Contributor

@vincentmr vincentmr left a comment

Choose a reason for hiding this comment

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

LGTM, cheers @LuisAlfredoNu .

@LuisAlfredoNu LuisAlfredoNu merged commit f9ab86f into kokkosNewAPI_backend Aug 9, 2024
56 of 57 checks passed
@LuisAlfredoNu LuisAlfredoNu deleted the kokkosNewAPI_fullSupport branch August 9, 2024 16:21
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.

4 participants