Skip to content

Generic decomp rule lowering#3021

Draft
kipawaa wants to merge 98 commits into
decomp/gateset-by-namefrom
generic-decomp-rule-lowering
Draft

Generic decomp rule lowering#3021
kipawaa wants to merge 98 commits into
decomp/gateset-by-namefrom
generic-decomp-rule-lowering

Conversation

@kipawaa

@kipawaa kipawaa commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Context:
Currently, multiple pathways exist for lowering a decomposition rule to MLIR. This increases maintenance burden and increases the surface for error and inconsistencies.
The current python-decomposition wrapper provides limited functionality, in particular it requires significant parsing after lowering to provide resources and target ID.

Description of the Change:
Improves the generic python_decomposition_wrapper to support precompiled, trace-time and on-demand decomposition rule lowering.

Benefits:
Consistent, unified decomposition rule lowering across all available timings and reduced maintenance burden.

Possible Drawbacks:

Related GitHub Issues:

[sc-122018]
[sc-122043]
[sc-122041]

@kipawaa
kipawaa force-pushed the generic-decomp-rule-lowering branch from 51198cb to 9421d61 Compare July 17, 2026 16:14
@kipawaa
kipawaa force-pushed the generic-decomp-rule-lowering branch from 9421d61 to 14cfd6d Compare July 17, 2026 17:38
@kipawaa
kipawaa changed the base branch from main to decomp/solver-id-support July 17, 2026 17:42
Base automatically changed from decomp/solver-id-support to main July 20, 2026 17:48
# TODO: not all PL ops have been migrated to the operator 2 format expected by mlir graph
# decomp This means some rules will fail the python callback compilation. When migration is
# complete, remove the try-except.
try:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This inner try-except around the op id generation means we can remove the original try-except around the qjit right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It's more-so around the compute_resources, but yes! This way we can skip incompatible rules without skipping the op entirely

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

@kipawaa
kipawaa changed the base branch from main to decomp/gateset-by-name July 22, 2026 18:53
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.

2 participants