Add wires strategy to split-non-commuting pass#2657
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2657 +/- ##
=======================================
Coverage 97.12% 97.12%
=======================================
Files 156 156
Lines 17742 17742
Branches 1694 1694
=======================================
Hits 17232 17232
Misses 373 373
Partials 137 137 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
lillian542
approved these changes
Apr 9, 2026
Contributor
lillian542
left a comment
There was a problem hiding this comment.
Thanks @rniczh! I left a few minor suggestions on the tests, but this looks great 🚀
Co-authored-by: lillian542 <38584660+lillian542@users.noreply.github.com>
JerryChen97
reviewed
Apr 9, 2026
Co-authored-by: Yushao Chen (Jerry) <chenys13@outlook.com>
paul0403
reviewed
Apr 9, 2026
Member
paul0403
left a comment
There was a problem hiding this comment.
Really nice! This is a big optimization 🥳
Just 2 small comments regarding the mlir api
paul0403
approved these changes
Apr 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context:
Currently, every observable gets its own execution after spit-non-commuting pass. It works, but inefficient for circuits that has measurements on non-overlap wires.
We would like to add the grouping_strategy="wires" to group up all observables on different wires together, e.g. for a circuit returning some combination of observables X(0), Y(1) and Y(0), we would get two groups, and two
quantum.nodes.Description of the Change:
Add the grouping strategy to the pass option and support both wires grouping mechanism and deduplicated for split-non-commuting pass.
Benefits:
Possible Drawbacks:
Related GitHub Issues:
[sc-109333]