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

Correctly querying wire IDs for SetState and SetBasisState in L-Kokkos #878

Merged
merged 8 commits into from
Sep 5, 2024

Conversation

vincentmr
Copy link
Contributor

@vincentmr vincentmr commented Aug 28, 2024

Context:
Catalyst recently fixed a bug where recycling a device when a previous execution involves stateprep causes a crash:
PennyLaneAI/catalyst#1047

The fix is made to lightning.qubit, and thus we need to fix it for lightning.kokkos here as well.

Description of the Change:
In LightningKokkosSimulator, SetState and SetBasisState now correctly query the DevQubits from the SimQubits in its qubit_manger's map.

Benefits:
We can now have multiple qnode functions involving stateprep in a workflow

Possible Drawbacks:

Related GitHub Issues:
PennyLaneAI/catalyst#1044

…kos (#869)

**Context:**
Catalyst recently fixed a bug where recycling a device when a previous
execution involves stateprep causes a crash:
PennyLaneAI/catalyst#1047

The fix is made to `lightning.qubit`, and thus we need to fix it for
`lightning.kokkos` here as well.


**Description of the Change:**
In `LightningKokkosSimulator`, `SetState` and `SetBasisState` now
correctly query the DevQubits from the SimQubits in its qubit_manger's
map.

**Benefits:**
We can now have multiple qnode functions involving stateprep in a
workflow

**Possible Drawbacks:**

**Related GitHub Issues:**
PennyLaneAI/catalyst#1044

---------

Co-authored-by: ringo-but-quantum <github-ringo-but-quantum@xanadu.ai>
Co-authored-by: Vincent Michaud-Rioux <vincentm@nanoacademic.com>
Co-authored-by: Ali Asadi <10773383+maliasadi@users.noreply.github.com>
Copy link
Contributor

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 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 53.39%. Comparing base (e4acf2e) to head (a325975).
Report is 79 commits behind head on master.

❗ There is a different number of reports uploaded between BASE (e4acf2e) and HEAD (a325975). Click for more details.

HEAD has 29 uploads less than BASE
Flag BASE (e4acf2e) HEAD (a325975)
34 5
Additional details and impacted files
@@             Coverage Diff             @@
##           master     #878       +/-   ##
===========================================
- Coverage   96.62%   53.39%   -43.24%     
===========================================
  Files         208       20      -188     
  Lines       28386     2330    -26056     
===========================================
- Hits        27428     1244    -26184     
- Misses        958     1086      +128     

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

Copy link
Contributor

@dime10 dime10 left a comment

Choose a reason for hiding this comment

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

Thanks Vincent!

@vincentmr vincentmr requested a review from a team August 28, 2024 19:23
@vincentmr vincentmr changed the title Correctly querying wire IDs for SetState and SetBasisState in kok… Correctly querying wire IDs for SetState and SetBasisState in L-Kokkos Aug 28, 2024
@vincentmr vincentmr merged commit 00ebcdf into master Sep 5, 2024
57 of 58 checks passed
@vincentmr vincentmr deleted the bugfix_setstate branch September 5, 2024 13:49
multiphaseCFD pushed a commit that referenced this pull request Sep 5, 2024
…okkos (#878)

**Context:**
Catalyst recently fixed a bug where recycling a device when a previous
execution involves stateprep causes a crash:
PennyLaneAI/catalyst#1047

The fix is made to `lightning.qubit`, and thus we need to fix it for
`lightning.kokkos` here as well.


**Description of the Change:**
In `LightningKokkosSimulator`, `SetState` and `SetBasisState` now
correctly query the DevQubits from the SimQubits in its qubit_manger's
map.

**Benefits:**
We can now have multiple qnode functions involving stateprep in a
workflow

**Possible Drawbacks:**

**Related GitHub Issues:**
PennyLaneAI/catalyst#1044

---------

Co-authored-by: paul0403 <79805239+paul0403@users.noreply.github.com>
Co-authored-by: ringo-but-quantum <github-ringo-but-quantum@xanadu.ai>
Co-authored-by: Ali Asadi <10773383+maliasadi@users.noreply.github.com>
multiphaseCFD pushed a commit that referenced this pull request Sep 8, 2024
…okkos (#878)

**Context:**
Catalyst recently fixed a bug where recycling a device when a previous
execution involves stateprep causes a crash:
PennyLaneAI/catalyst#1047

The fix is made to `lightning.qubit`, and thus we need to fix it for
`lightning.kokkos` here as well.


**Description of the Change:**
In `LightningKokkosSimulator`, `SetState` and `SetBasisState` now
correctly query the DevQubits from the SimQubits in its qubit_manger's
map.

**Benefits:**
We can now have multiple qnode functions involving stateprep in a
workflow

**Possible Drawbacks:**

**Related GitHub Issues:**
PennyLaneAI/catalyst#1044

---------

Co-authored-by: paul0403 <79805239+paul0403@users.noreply.github.com>
Co-authored-by: ringo-but-quantum <github-ringo-but-quantum@xanadu.ai>
Co-authored-by: Ali Asadi <10773383+maliasadi@users.noreply.github.com>
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.

5 participants