Skip to content

Decomp/generic rule lowering - #3053

Open
kipawaa wants to merge 33 commits into
decomp/gateset-by-namefrom
decomp/generic-rule-lowering
Open

Decomp/generic rule lowering#3053
kipawaa wants to merge 33 commits into
decomp/gateset-by-namefrom
decomp/generic-rule-lowering

Conversation

@kipawaa

@kipawaa kipawaa commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Context:

Description of the Change:
This PR provides the core infrastructure changes for Operator2 support in Catalyst. This is centred on the python_decomposition function, which lowers all of the decomposition for a given Operator2 instance. Precompiled, trace-time and on-demand decomposition rules will all be lowered through this utility, providing a unified and universal decomposition rule lowering system. We provide the generic utilities needed by each of the lowering pathways, as well as a unified testing infrastructure with mock Operator2 instances.

Benefits:

Possible Drawbacks:
This PR deprecates the legacy interface for decomposition.
Note also that tests using any PennyLane operators will fail until the ops are migrated to PL Operator2, since callbacks are only supported for Operator2 instances (required for graph IDs).

Related GitHub Issues:

[sc-122043]
[sc-122018]

@kipawaa
kipawaa changed the base branch from main to decomp/gateset-by-name July 23, 2026 14:30
Comment thread frontend/catalyst/decomposition/precompile_decomposition_rules.py Outdated
@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.

Comment thread frontend/catalyst/decomposition/precompile_decomposition_rules.py Outdated
@kipawaa
kipawaa force-pushed the decomp/generic-rule-lowering branch from 4ddbc97 to af0e384 Compare July 29, 2026 17:41
kipawaa and others added 10 commits July 29, 2026 14:53
… track of arg names (#3065)

[sc-125811]

---------

Co-authored-by: River McCubbin <river.mccubbin@xanadu.ai>
Co-authored-by: Ali Asadi <10773383+maliasadi@users.noreply.github.com>
Co-authored-by: David Ittah <dime10@users.noreply.github.com>
TODO: update PennyLane version once TestPyPI uploads resume

**Context:**
Decomposition rule lowering requires correctly mapping parameters, which
cannot be done reliably with the current `DecomposableGate` interface.

**Description of the Change:**
Update the `DecomposableGate` interface to return dictionaries
(`llvm::StringMap`s) of data, to permit reconstruction.

**Benefits:**
python-decompositions are improved.

**Possible Drawbacks:**

**Related GitHub Issues:**

[sc-125812]

---------

Co-authored-by: paul0403 <paulhaochen.wang@gmail.com>
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