Skip to content

Support new discrete qp.PPR in to_ppr pass. - #3185

Open
dwierichs wants to merge 23 commits into
mainfrom
lower-ppr
Open

Support new discrete qp.PPR in to_ppr pass.#3185
dwierichs wants to merge 23 commits into
mainfrom
lower-ppr

Conversation

@dwierichs

Copy link
Copy Markdown
Contributor

Context:
PennyLaneAI/pennylane#10107 adds a new qp.PPR class that represents discrete PPRs.
We would like this op to get lowered into a pbc.ppr directly when using to_ppr.

Description of the Change:
Register PPR in to_ppr and lower it to pbc.ppr.

Benefits:
Cheaper decompositions/compilation.

Possible Drawbacks:

Related GitHub Issues:

dwierichs and others added 12 commits September 3, 2026 16:54
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…dings

- Validate that the quantum.operator PPR angle_denominator attribute is a
  signless integer with bit width >= 2 before calling IntegerAttr::getInt().
  A handwritten si64 previously crashed the compiler (assertion failure),
  and a bare i1 true silently sign-extended to -1. Both now emit the
  existing integer-angle-denominator diagnostic.
- Split the combined qubit-mode diagnostic into a register-mode message
  and a zero-qubit message, with small dedicated tests for each.
- Tighten the positive to-ppr PPR-operator MLIR checks with CHECK-LABEL/
  CHECK-NOT and by capturing SSA values so the second PPR is checked to
  consume the first PPR's output.
- Document the to_ppr PPR direct-lowering improvement in the dev
  changelog, referencing upstream PennyLane PR #10107.
- Remove the inert "PPR" entry from RUNTIME_OPERATIONS (no shipped
  device declares it and the runtime cannot execute raw PPR) and the
  now-tautological test_ppr_is_supported_by_qjit_capabilities test; the
  real frontend integration tests already prove PPR survives and lowers
  without PauliRot.
- Remove committed internal workflow artifacts under docs/superpowers/
  (this repo uses doc/ for shipped documentation).

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Comment thread doc/releases/changelog-dev.md Outdated
return convertMultiRZGate(originOp, rewriter);
} else if (auto originOp = dyn_cast<PauliRotOp>(op)) {
return convertPauliRotGate(originOp, rewriter);
} else if (auto originOp = dyn_cast<OperatorOp>(op)) {

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.

Would it be better to add a PPROp similar to PauliRotOp? 🤔

@@ -0,0 +1,180 @@
# Adjoint PPR-to-PPM Implementation Plan

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.

Will have to work on the agent not committing its helper files. Sorry about that.

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.

1 participant