Skip to content

Add wires strategy to split-non-commuting pass#2657

Merged
rniczh merged 12 commits intomainfrom
rniczh/add-wires-strategy
Apr 10, 2026
Merged

Add wires strategy to split-non-commuting pass#2657
rniczh merged 12 commits intomainfrom
rniczh/add-wires-strategy

Conversation

@rniczh
Copy link
Copy Markdown
Member

@rniczh rniczh commented Apr 7, 2026

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]

@rniczh rniczh requested a review from lillian542 April 7, 2026 18:19
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.12%. Comparing base (9e4b582) to head (b134761).
⚠️ Report is 2 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@rniczh rniczh requested a review from a team April 9, 2026 17:29
Copy link
Copy Markdown
Contributor

@lillian542 lillian542 left a comment

Choose a reason for hiding this comment

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

Thanks @rniczh! I left a few minor suggestions on the tests, but this looks great 🚀

rniczh and others added 2 commits April 9, 2026 16:00
Co-authored-by: lillian542 <38584660+lillian542@users.noreply.github.com>
rniczh and others added 2 commits April 9, 2026 16:31
Co-authored-by: Yushao Chen (Jerry) <chenys13@outlook.com>
Copy link
Copy Markdown
Member

@paul0403 paul0403 left a comment

Choose a reason for hiding this comment

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

Really nice! This is a big optimization 🥳

Just 2 small comments regarding the mlir api

@rniczh rniczh merged commit 06e4a18 into main Apr 10, 2026
38 checks passed
@rniczh rniczh deleted the rniczh/add-wires-strategy branch April 10, 2026 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants