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

Minor program capture fixes #5889

Merged
merged 8 commits into from
Jun 21, 2024
Merged

Minor program capture fixes #5889

merged 8 commits into from
Jun 21, 2024

Conversation

albi3ro
Copy link
Contributor

@albi3ro albi3ro commented Jun 20, 2024

Context:

Catalyst PR #837 needs a couple minor updates to the capture module.

Description of the Change:

  1. makes it possible to do from pennylane.capture import AbstractOperator, AbstractMeasurement, qnode_prim so we don't have to touch private functions

  2. Adds qnode as a keyword argument that gets bound to the qnode primitive

  3. Makes it so we can capture a sample measurement specified like qml.sample(wires=1)

Benefits:

Possible Drawbacks:

Related GitHub Issues:
[sc-66703]

@albi3ro albi3ro requested a review from dwierichs June 20, 2024 19:34
Copy link
Contributor

Hello. You may have forgotten to update the changelog!
Please edit doc/releases/changelog-dev.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.

@albi3ro albi3ro requested a review from mudit2812 June 20, 2024 19:42
Copy link
Contributor

@dwierichs dwierichs left a comment

Choose a reason for hiding this comment

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

Thanks @albi3ro, LGTM!
May I ask to add the PR to the changelog entry for the capture effort?

tests/capture/test_measurements_capture.py Outdated Show resolved Hide resolved
tests/capture/test_measurements_capture.py Show resolved Hide resolved
albi3ro and others added 2 commits June 20, 2024 15:51
Co-authored-by: David Wierichs <david.wierichs@xanadu.ai>
@albi3ro
Copy link
Contributor Author

albi3ro commented Jun 20, 2024

Thanks @albi3ro, LGTM! May I ask to add the PR to the changelog entry for the capture effort?

changelog link added.

@albi3ro albi3ro enabled auto-merge (squash) June 20, 2024 20:03
@albi3ro albi3ro added the merge-ready ✔️ All tests pass and the PR is ready to be merged. label Jun 20, 2024
Copy link

codecov bot commented Jun 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.66%. Comparing base (8fec135) to head (a2fcde0).
Report is 242 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5889      +/-   ##
==========================================
- Coverage   99.67%   99.66%   -0.01%     
==========================================
  Files         422      425       +3     
  Lines       40651    40455     -196     
==========================================
- Hits        40518    40321     -197     
- Misses        133      134       +1     

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

Copy link
Contributor

@dwierichs dwierichs left a comment

Choose a reason for hiding this comment

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

Thanks for pointing out the post-approval changes!

pennylane/capture/__init__.py Show resolved Hide resolved
@albi3ro albi3ro merged commit 96a3d56 into master Jun 21, 2024
39 checks passed
@albi3ro albi3ro deleted the from-plxpr-fixes branch June 21, 2024 14:54
mudit2812 pushed a commit that referenced this pull request Jul 2, 2024
**Context:**

Catalyst PR #837 (PennyLaneAI/catalyst#837)
needs a couple minor updates to the capture module.

**Description of the Change:**

1) makes it possible to do `from pennylane.capture import
AbstractOperator, AbstractMeasurement, qnode_prim` so we don't have to
touch private functions

2) Adds `qnode` as a keyword argument that gets bound to the qnode
primitive

3) Makes it so we can capture a sample measurement specified like
`qml.sample(wires=1)`

**Benefits:**

**Possible Drawbacks:**

**Related GitHub Issues:**
[sc-66703]

---------

Co-authored-by: David Wierichs <david.wierichs@xanadu.ai>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge-ready ✔️ All tests pass and the PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants