Split non commuting pass is added to Catalyst in MLIR#2437
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2437 +/- ##
==========================================
+ Coverage 96.76% 96.87% +0.10%
==========================================
Files 156 155 -1
Lines 17030 16838 -192
Branches 1664 1623 -41
==========================================
- Hits 16479 16311 -168
+ Misses 403 392 -11
+ Partials 148 135 -13 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
sengthai
left a comment
There was a problem hiding this comment.
Well done, well written! I have a few comments below.
Co-authored-by: Sengthai Heng <sengthai37@gmail.com>
|
Technically this is for the other pass, but |
Co-authored-by: David Ittah <dime10@users.noreply.github.com>
lillian542
left a comment
There was a problem hiding this comment.
Thanks @rniczh! Looks good, everything seems to behave as expected :) I've made a couple of minor suggestions to the docs and tests, but after that no further comments from me!
Co-authored-by: lillian542 <38584660+lillian542@users.noreply.github.com>
Co-authored-by: lillian542 <38584660+lillian542@users.noreply.github.com>
lillian542
left a comment
There was a problem hiding this comment.
Thanks @rniczh, this looks great 🚀
**Context:** #2437 implements the `split-non-commuting` pass as an MLIR pass. This allows for MLIR representations with multiple qnodes, which is not currently supported by `mlir_specs`. **Description of the Change:** Adds support for MLIR passes with multiple `qnode` entry points to `mlir_specs` **Benefits:** **Possible Drawbacks:** **Related GitHub Issues:** [sc-110647] PennyLaneAI/pennylane#9120 to add frontend support for this feature --------- Co-authored-by: Andrija Paurevic <46359773+andrijapau@users.noreply.github.com>
Context:
Description of the Change:
Adds the split-non-commuting pass, which splits quantum functions that measure non-commuting observables into multiple execution groups (In this inital implemenation, we treat each expval as different group). Each group runs in a separate call from the main function.
Steps:
split-to-single-termspass to decompose Hamiltonian expval values into single-term observables before this pass runs.Before:
After:
Shots are distributed among groups using integer division (rounded down); e.g., 100 shots with 3 groups yields 33 shots per group
Benefits:
Possible Drawbacks:
Related GitHub Issues:
[sc-93667]