-
Notifications
You must be signed in to change notification settings - Fork 49
Implement a decomposition of PPRs into PPMs #1664
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…asurements based on a boolean control. - Added convenience builders. - Improve the doc
Support PPR with negative angle Support Pass options for CLI
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as outdated.
This comment was marked as outdated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work!! :) So far I'm leaving some comments regarding organization, documentation, naming, etc. I will leave a second review regarding the C++ implementation tomorrow :)
Co-authored-by: David Ittah <[email protected]>
Co-authored-by: David Ittah <[email protected]>
Updated docstring reference in `DecomposeNonCliffordPPR`.
…tate preparation rules. Added verification logic to enforce these rules.
5a2b393
to
19b42d3
Compare
1d12842
to
2ad7e59
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love the code, it's so clean 😍
|
Also, it is still possible to review this PR in |
…#1750) **Context:** Introduced the `ppm_compilation` pass as a top-level composition of existing transformation and optimization passes. This allows users to apply the transformation Clifford+T to Pauli product measurements (PPMs) in a single step without managing sub-pass sequencing manually. The sub-paseses comprise: * `to_ppr`: Converts gates into Pauli Product Rotations (PPRs) (Transformation) #1486 #1499 * `commute_ppr`: Commutes PPRs past non-Clifford PPRs (Optimization) #1563 * `merge_ppr_ppm`: Merges PPRs into PPMs (Optimization) #1580 * `ppr_to_ppm`: Decomposes PPRs into PPMs (Transformation) #1664 **Example:** ```python import pennylane as qml from catalyst import measure, passes, qjit pipe = [("pipe", ["enforce-runtime-invariants-pipeline"])] @qjit(pipelines=pipe, target="mlir") @passes.ppm_compilation(decompose_method="auto-corrected", avoid_y_measure=True, max_pauli_size=2) @qml.qnode(qml.device("null.qubit", wires=2)) def circuit(): qml.CNOT([0, 1]) qml.CNOT([1, 0]) qml.adjoint(qml.T)(0) qml.T(1) return measure(0), measure(1) print(circuit.mlir_opt) ``` **Benefits:** - Simplifies the user workflow for compilation. [[sc-90149]] --------- Co-authored-by: Josh Izaac <[email protected]> Co-authored-by: David Ittah <[email protected]> Co-authored-by: Joey Carter <[email protected]>
Context:
This PR introduces a new pass that decomposes Pauli Product Rotations (PPR) into Pauli Product Measurements (PPMs) consuming magic states. Two decomposition strategies are supported: inject-magic-state and auto-corrected. Related prior work on qec.ppr began in #1486 #1563 #1580.
Description of the Change:
qec.select.ppm
– conditional Pauli product measurement based on a boolean controlqec.prepare
– prepares logical qubits in a specified initial state (|0⟩, |1⟩, |+⟩, |-⟩, |Y⟩, |-Y⟩, |m⟩, or |m̅⟩)qec.ppr
andqec.ppm
to support conditional executioninject-magic-state
andauto-corrected
.Example:
Input:
Run:
$ quantum-opt --decompose_clifford_ppr='decompose-method=auto-corrected' test.mlir
Outputs:
Run:
$ quantum-opt --decompose_clifford_ppr='decompose-method=inject-magic-state' test.mlir
Outputs:
[sc-89168]
[sc-90158]