Skip to content

Various fixes to the to_ppr pass#2896

Merged
dime10 merged 7 commits into
mainfrom
to-ppr-fixes
Jun 3, 2026
Merged

Various fixes to the to_ppr pass#2896
dime10 merged 7 commits into
mainfrom
to-ppr-fixes

Conversation

@dime10
Copy link
Copy Markdown
Contributor

@dime10 dime10 commented May 29, 2026

The following has been changed:

  • extend support to gates that trivially convert to PPR
  • raise an error for controlled operations (previously: crash)
  • docstring updates
  • technical improvements

fixes #2886

[sc-121168]

dime10 added 6 commits May 29, 2026 15:02
Any gate-like operation from the quantum dialect must be converted to
PPR form. We can use our interfaces and dynamic legality to do this
robustly.
Since these are not supported in the conversion. Only CNOT (as an
explicit gate, not controlled-X) is supported.
Using an interface pattern allows us to cover all the quantum ops we
marked illegal, without having to register them one-by-one (which is
sensitive to future changes).
@dime10 dime10 requested review from a team and sengthai May 29, 2026 20:32
@github-actions
Copy link
Copy Markdown
Contributor

Hello. You may have forgotten to update the changelog!
Please edit doc/releases/changelog-dev.md on your branch 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
Copy link
Copy Markdown

codecov Bot commented May 29, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.01%. Comparing base (4c013b1) to head (8a2cc5c).
⚠️ Report is 9 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2896      +/-   ##
==========================================
- Coverage   97.01%   97.01%   -0.01%     
==========================================
  Files         167      167              
  Lines       18830    18873      +43     
  Branches     1770     1772       +2     
==========================================
+ Hits        18268    18309      +41     
- Misses        417      418       +1     
- Partials      145      146       +1     

☔ 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.

Copy link
Copy Markdown
Contributor

@sengthai sengthai left a comment

Choose a reason for hiding this comment

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

Thanks for this PR! @dime10 💯

Comment thread frontend/catalyst/passes/builtin_passes.py Outdated
Co-authored-by: Sengthai Heng <sengthai37@gmail.com>
@dime10 dime10 requested a review from lazypanda10117 June 1, 2026 14:46
Copy link
Copy Markdown
Contributor

@kipawaa kipawaa left a comment

Choose a reason for hiding this comment

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

Nice! Thanks @dime10 !

@dime10 dime10 merged commit 8a83d6b into main Jun 3, 2026
39 of 40 checks passed
@dime10 dime10 deleted the to-ppr-fixes branch June 3, 2026 15:04
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.

to-ppr MLIR pass crashes when converting any multi-qubit controlled gate that is not a simple CNOT/ctrl(PauliX)

3 participants