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 hadamard_grad with wires-broadcasted measurements #5860

Merged
merged 9 commits into from
Jun 20, 2024
Merged

Conversation

dwierichs
Copy link
Contributor

@dwierichs dwierichs commented Jun 15, 2024

Context:

Description of the Change:
Takes the case into account where qml.probs does not have wires specified, requiring hadamard_grad to consider tape wires.

Benefits:

Possible Drawbacks:

Related GitHub Issues:
Fixes #5840

[sc-65711]

Copy link

codecov bot commented Jun 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.66%. Comparing base (248a808) to head (1990579).
Report is 242 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5860      +/-   ##
==========================================
- Coverage   99.67%   99.66%   -0.01%     
==========================================
  Files         422      422              
  Lines       40709    40362     -347     
==========================================
- Hits        40577    40228     -349     
- Misses        132      134       +2     

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

@dwierichs dwierichs added the review-ready 👌 PRs which are ready for review by someone from the core team. label Jun 15, 2024
@dwierichs dwierichs added this to the v0.37 milestone Jun 17, 2024
@EmilianoG-byte EmilianoG-byte self-requested a review June 18, 2024 16:05
Copy link
Contributor

@EmilianoG-byte EmilianoG-byte left a comment

Choose a reason for hiding this comment

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

Nice implementation and great fix 😄! I just left two non-blocking comments and one that might need to be addressed.

pennylane/gradients/hadamard_gradient.py Show resolved Hide resolved
pennylane/gradients/hadamard_gradient.py Show resolved Hide resolved
@dwierichs dwierichs enabled auto-merge (squash) June 20, 2024 09:18
@dwierichs dwierichs merged commit d330e9d into master Jun 20, 2024
40 checks passed
@dwierichs dwierichs deleted the hadamard-probs branch June 20, 2024 09:44
mudit2812 pushed a commit that referenced this pull request Jul 2, 2024
**Context:**

**Description of the Change:**
Takes the case into account where `qml.probs` does not have wires
specified, requiring `hadamard_grad` to consider tape wires.

**Benefits:**

**Possible Drawbacks:**

**Related GitHub Issues:**
Fixes #5840 

[sc-65711]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
review-ready 👌 PRs which are ready for review by someone from the core team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] hadamard gradient does not work with wires-broadcasted measurements
3 participants