Skip to content

Conversation

@lazypanda10117
Copy link
Member

@lazypanda10117 lazypanda10117 commented Oct 23, 2025

Context:

There is currently no way for users to write PPRs and PPMs in the Pennylane frontend and have it lowered to the QEC dialect directly. Note that this feature is only supported when qml.capture.enabled() is true.

Description of the Change:

qml.PauliRot and qml.pauli_measure will be converted into the appropriate qec.ppr and qec.ppm operations in the MLIR, allowing us to use the existing ppr/ppm compilation passes directly, as well as writing custom decomposition rules in terms of them.

Benefits:

This allows researchers to test PPR/PPM compilation passes easily by writing circuits in terms of PPRs and PPMs and directly integrate with the Catalyst's ppm_compilation pass (and sub-passes).

Related GitHub PRs:
PennyLaneAI/pennylane#8544

[sc-101578]
[sc-102095]

@lazypanda10117 lazypanda10117 changed the title PPR/PPM Support Support for qml.PauliRot and qml.PauliMeasure in Catalyst Oct 24, 2025
@lazypanda10117 lazypanda10117 changed the title Support for qml.PauliRot and qml.PauliMeasure in Catalyst Support for PauliRot and PauliMeasure in Catalyst Oct 24, 2025
@lazypanda10117 lazypanda10117 requested a review from dime10 October 27, 2025 21:22
Copy link
Contributor

@isaacdevlugt isaacdevlugt left a comment

Choose a reason for hiding this comment

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

Thanks @lazypanda10117 🚀 !!

I'll make another PR to Catalyst for more docs changes once other adjacent features are merged to PennyLane :). This looks great!

paul0403 added a commit that referenced this pull request Nov 24, 2025
**Context:**
When a user places a PPR op in an adjoint qfunc (see #2145 ), the
`--adjoint-lowering` pass will not correctly distribute the adjoint into
the region onto PPRs, because the pass does not recognize PPRs.

**Description of the Change:**
Add pattern for PPR ops in adjoint lowering pass.

**Benefits:**
Correct behavior

**Possible Drawbacks:**
None
@sengthai
Copy link
Contributor

Does any work need to be done in this PR?

@paul0403
Copy link
Member

Does any work need to be done in this PR?

@isaacdevlugt

@lazypanda10117
Copy link
Member Author

lazypanda10117 commented Nov 25, 2025

Does any work need to be done in this PR?

The code is all done, but we are waiting for a few things to be merged first so that it is actually consistent with the documented usage. In particular, we need the following PRs:

  1. qml.transform updates:
  2. qml.specs updates:

@sengthai
Copy link
Contributor

Are there any ways to make it less dependent on its blockers? 🤔

@lazypanda10117
Copy link
Member Author

Are there any ways to make it less dependent on its blockers? 🤔

This is a blocker from the documentation side, so @isaacdevlugt would probably have a better idea on how to proceed.

@lazypanda10117 lazypanda10117 merged commit edf77a2 into main Nov 26, 2025
38 checks passed
@lazypanda10117 lazypanda10117 deleted the lazypanda10117/ppr-support branch November 26, 2025 22:09
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.

6 participants