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 MCM support in LQ (new device API) #650

Merged
merged 311 commits into from
Mar 22, 2024
Merged

Add MCM support in LQ (new device API) #650

merged 311 commits into from
Mar 22, 2024

Conversation

vincentmr
Copy link
Contributor

@vincentmr vincentmr commented Mar 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:
Native-execution of circuits with mid-measurements is enabled via the dynamic-one-shot transform. To support the transform, a device must implement methods to apply MidMeasureMP.

MidMeasureMP is a special kind of operation where a sample is drawn from the state vector probability distribution and a projector is applied to the state vector accordingly. It may also support options like reset and post-selection.

The most straightforward way to deal with the requirements is to enhance the state vector class StateVectorLQubit.

Description of the Change:

Benefits:

Possible Drawbacks:

Related GitHub Issues:
#621
Add mid circuit measurements to lightning [sc-58448]
Lightning Qubit implement MidMeasureMP method [sc-57704]

@maliasadi maliasadi self-requested a review March 20, 2024 20:49
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.

The PR is great and ready to merge. I just left a few suggestions, especially focused on improving the migration process for our other devices.

tests/test_native_mcm.py Outdated Show resolved Hide resolved
tests/test_native_mcm.py Outdated Show resolved Hide resolved
tests/test_native_mcm.py Outdated Show resolved Hide resolved
tests/test_native_mcm.py Outdated Show resolved Hide resolved
tests/test_native_mcm.py Outdated Show resolved Hide resolved
tests/test_native_mcm.py Outdated Show resolved Hide resolved
tests/test_native_mcm.py Outdated Show resolved Hide resolved
tests/test_native_mcm.py Outdated Show resolved Hide resolved
tests/test_native_mcm.py Outdated Show resolved Hide resolved
vincentmr and others added 10 commits March 21, 2024 09:05
Co-authored-by: Amintor Dusko <87949283+AmintorDusko@users.noreply.github.com>
Co-authored-by: Amintor Dusko <87949283+AmintorDusko@users.noreply.github.com>
Co-authored-by: Amintor Dusko <87949283+AmintorDusko@users.noreply.github.com>
Co-authored-by: Amintor Dusko <87949283+AmintorDusko@users.noreply.github.com>
Co-authored-by: Amintor Dusko <87949283+AmintorDusko@users.noreply.github.com>
Co-authored-by: Amintor Dusko <87949283+AmintorDusko@users.noreply.github.com>
Co-authored-by: Amintor Dusko <87949283+AmintorDusko@users.noreply.github.com>
Co-authored-by: Amintor Dusko <87949283+AmintorDusko@users.noreply.github.com>
Co-authored-by: Amintor Dusko <87949283+AmintorDusko@users.noreply.github.com>
Base automatically changed from lightning-qubit-new-api to master March 21, 2024 13:55
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.

Oops, I ran into meetings this morning without having the chance to submit my review comments...

.github/workflows/tests_linux.yml Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
pennylane_lightning/lightning_kokkos/lightning_kokkos.py Outdated Show resolved Hide resolved
tests/test_native_mcm.py Outdated Show resolved Hide resolved
tests/test_native_mcm.py Show resolved Hide resolved
tests/test_native_mcm.py Show resolved Hide resolved
vincentmr and others added 4 commits March 21, 2024 11:58
Co-authored-by: Ali Asadi <10773383+maliasadi@users.noreply.github.com>
Co-authored-by: Ali Asadi <10773383+maliasadi@users.noreply.github.com>
Co-authored-by: Ali Asadi <10773383+maliasadi@users.noreply.github.com>
@vincentmr vincentmr added the ci:build_wheels Activate wheel building. label Mar 21, 2024
@vincentmr vincentmr merged commit 5f95a2f into master Mar 22, 2024
85 of 86 checks passed
@vincentmr vincentmr deleted the feature/new_api_mcms branch March 22, 2024 18:41
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants