PennyLaneAI / pennylane

PennyLane is a cross-platform Python library for quantum computing, quantum machine learning, and quantum chemistry. Train a quantum computer the same way as a neural network.
https://pennylane.ai
Apache License 2.0
2.17k stars 568 forks source link

Transform to split sums into single terms #5884

Open lillian542 opened 1 week ago

lillian542 commented 1 week ago

Context: Some simulators can handle non-commuting observables but don't take multi-term observables.

Description of the Change: We add a transform that splits the observables on a tape up into single-term observables.

github-actions[bot] commented 1 week ago

Hello. You may have forgotten to update the changelog! Please edit doc/releases/changelog-dev.md with:

lillian542 commented 1 week ago

[sc-60187]

lillian542 commented 1 week ago

[sc-60188]

codecov[bot] commented 1 week ago

Codecov Report

Attention: Patch coverage is 33.33333% with 26 lines in your changes missing coverage. Please review.

Project coverage is 99.60%. Comparing base (ab8b6d5) to head (2c59b61). Report is 19 commits behind head on master.

Files Patch % Lines
pennylane/transforms/split_to_single_terms.py 29.41% 24 Missing :warning:
pennylane/transforms/split_non_commuting.py 50.00% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #5884 +/- ## ========================================== - Coverage 99.68% 99.60% -0.08% ========================================== Files 421 426 +5 Lines 40499 40496 -3 ========================================== - Hits 40370 40336 -34 - Misses 129 160 +31 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.