pennylane
pennylane copied to clipboard
Support multiple measurements and shot vectors in `param_shift(... broadcast=True)`
Context:
Shot vectors and multiple measurements are currently explicitly not supported when using param_shift
with the broadcast=True
option.
In #5666 , a crucial subroutine _evaluat_gradient
is being prepared to allow for support of these scenarios.
Description of the Change:
Allow for shot vectors and/or multiple measurements in param_shift(..., broadcast=true)
.
Due to the changes in #5666 including unit tests for the relevant subroutines, this PR mostly is concerned with integration tests.
Benefits:
Feature parity with broadcast=False
, allowing faster gradient evaluation.
Possible Drawbacks:
Related GitHub Issues: fixes #5598
[sc-62283]
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.
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 99.67%. Comparing base (
9b3060f
) to head (d2a6689
). Report is 4 commits behind head on master.
Additional details and impacted files
@@ Coverage Diff @@
## master #5667 +/- ##
==========================================
- Coverage 99.67% 99.67% -0.01%
==========================================
Files 421 421
Lines 40189 39872 -317
==========================================
- Hits 40060 39742 -318
- Misses 129 130 +1
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.