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

[Capture] lightning.qubit can execute circuits transformed by qml.defer_measurements, add support for ctrl and adjoint #1069

Merged
merged 19 commits into from
Mar 7, 2025

Conversation

astralcai
Copy link
Contributor

@astralcai astralcai commented Feb 26, 2025

Context:
This PR follows up on PennyLaneAI/pennylane#6838 to add support to execute circuits transformed with defer_measurements on lightning.qubit.

This PR mirrors the same implementation as for default.qubit: PennyLaneAI/pennylane#6937

Description of the Change:
Update LightningInterpreter to support ctrl_transform and adjoint_transform primitives using CollectOpsandMeas.

Related Shortcut Story:
[sc-82056] [sc-82065]

@astralcai astralcai requested a review from mudit2812 February 26, 2025 19:46
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 Feb 26, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 64.44%. Comparing base (9e26a91) to head (2408dbe).
Report is 1 commits behind head on master.

❗ There is a different number of reports uploaded between BASE (9e26a91) and HEAD (2408dbe). Click for more details.

HEAD has 56 uploads less than BASE
Flag BASE (9e26a91) HEAD (2408dbe)
62 6
Additional details and impacted files
@@             Coverage Diff             @@
##           master    #1069       +/-   ##
===========================================
- Coverage   97.98%   64.44%   -33.55%     
===========================================
  Files         233       28      -205     
  Lines       40090     2652    -37438     
===========================================
- Hits        39284     1709    -37575     
- Misses        806      943      +137     

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

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mudit2812
Copy link
Contributor

@astralcai PennyLaneAI/pennylane#6961 makes breaking changes to the DeferMeasurementsInterpreter, so your implementation should use that as the base.

@mudit2812 mudit2812 self-requested a review March 3, 2025 16:57
@astralcai astralcai changed the title [Capture] lightning.qubit can execute circuits transformed by qml.defer_measurements in analytic mode [Capture] lightning.qubit can execute circuits transformed by qml.defer_measurements Mar 4, 2025
Copy link
Contributor

@mudit2812 mudit2812 left a comment

Choose a reason for hiding this comment

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

Looks great, just one test suggestion. Otherwise ready to approve.

@astralcai astralcai requested a review from mudit2812 March 5, 2025 22:10
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.

Thanks @astralcai! No blocker from my side, just a few questions before approving the PR 🙂

@astralcai astralcai changed the title [Capture] lightning.qubit can execute circuits transformed by qml.defer_measurements [Capture] lightning.qubit can execute circuits transformed by qml.defer_measurements, add support for ctrl and adjoint Mar 6, 2025
@astralcai astralcai requested a review from maliasadi March 6, 2025 16:08
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.

Thanks @astralcai! Feel free to merge the PR 🎉

@astralcai astralcai merged commit 4726c9a into master Mar 7, 2025
69 of 70 checks passed
@astralcai astralcai deleted the defer_measurement branch March 7, 2025 14:45
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