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

Fix capture of GlobalPhase and Identity when they act on no wires #6060

Merged
merged 4 commits into from
Aug 1, 2024

Conversation

albi3ro
Copy link
Contributor

@albi3ro albi3ro commented Aug 1, 2024

Context:

When writing tests for (#837), I found we weren't capturing Identity and GlobalPhase when they act on zero wires correctly.

Description of the Change:

Fix the capture of GlobalPhase and Identity when they act on no wires.

Benefits:

Possible Drawbacks:

Related GitHub Issues:

[sc-70350]

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 for the fix 👍

(Related issue regarding the documentation for GlobalPhase: #5820)

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.

Nice catch, thanks @albi3ro

pennylane/capture/primitives.py Show resolved Hide resolved
tests/capture/test_operators.py Show resolved Hide resolved
@albi3ro albi3ro enabled auto-merge (squash) August 1, 2024 21:40
Copy link

codecov bot commented Aug 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.65%. Comparing base (6715095) to head (80582ff).
Report is 4 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6060      +/-   ##
==========================================
- Coverage   99.66%   99.65%   -0.01%     
==========================================
  Files         430      430              
  Lines       41638    41387     -251     
==========================================
- Hits        41499    41246     -253     
- Misses        139      141       +2     

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

@albi3ro albi3ro merged commit 0b0e212 into master Aug 1, 2024
40 checks passed
@albi3ro albi3ro deleted the gphase-capture-fix branch August 1, 2024 22:54
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.

3 participants