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

[Frontend] Split non-commuting observables #821

Merged
merged 28 commits into from
Jun 19, 2024
Merged

Conversation

lillian542
Copy link
Contributor

@lillian542 lillian542 commented Jun 17, 2024

Context:
State-based simulators can generally get the values for non-commuting observables together on a single execution. Hardware and some simulators require non-commuting observables to be separated into different executions.

Description of the Change:
We add a non_commuting_observables flag to the TOML file. If True, the device can deal with non-commuting observables.

We check the non_commuting_observables_flag in device.preprocess, and add the split_non_commuting transform to the transform_program if it's False.

@lillian542
Copy link
Contributor Author

[sc-60186]

lillian542 added a commit to PennyLaneAI/pennylane-lightning that referenced this pull request Jun 18, 2024
**Context:**
Catalyst is adding `non_commuting_observables` as a flag in the TOML
file, and conditionally applying the `split_non_commuting` transform in
the QJIT device preprocessing if the backend doesn't allow non-commuting
observables.

**Description of the Change:**
Update the lightning TOML files to indicate that non-commuting
observables are supported.

**Benefits:**
Lightning stays consistent with the changes in [this
PR](PennyLaneAI/catalyst#821)

---------

Co-authored-by: ringo-but-quantum <[email protected]>
Copy link
Contributor

Hello. You may have forgotten to update the changelog!
Please edit doc/changelog.md on your branch 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 Jun 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.96%. Comparing base (5612227) to head (3a7aa23).
Report is 204 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #821   +/-   ##
=======================================
  Coverage   97.95%   97.96%           
=======================================
  Files          71       71           
  Lines       10244    10248    +4     
  Branches      902      903    +1     
=======================================
+ Hits        10035    10039    +4     
  Misses        167      167           
  Partials       42       42           

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

@lillian542 lillian542 changed the title [WIP][Frontend] Split non-commuting observables [Frontend] Split non-commuting observables Jun 18, 2024
Copy link
Contributor

@erick-xanadu erick-xanadu left a comment

Choose a reason for hiding this comment

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

Hi Lillian, I think this looks great! I think one small thing that is missing is a cuda quantum circuit with non commuting observables.

@lillian542 lillian542 merged commit 76df3f7 into main Jun 19, 2024
42 checks passed
@lillian542 lillian542 deleted the split-non-commuting branch June 19, 2024 19:12
@lillian542
Copy link
Contributor Author

lillian542 commented Jun 20, 2024

Edit: wrong story ID
[sc-60187]

@lillian542
Copy link
Contributor Author

[sc-60188]

@dime10
Copy link
Contributor

dime10 commented Jun 20, 2024

Did we add the flag to lightning as well? :)

@lillian542
Copy link
Contributor Author

Did we add the flag to lightning as well? :)

Yes!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
frontend Pull requests that update the frontend
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants