Skip to content
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

[WIP] Implement a conversion from Clifford+T ops to PPR ops #1499

Draft
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

sengthai
Copy link
Contributor

@sengthai sengthai commented Feb 6, 2025

Context:
This PR implements a new pass Clifford_ppr that converts Clifford+T quantum operations to their equivalent Pauli Product Rotation (PPR) representations. This conversion is a crucial step in enabling Quantum Error Correction (QEC) compilation capabilities.

Implementation Details

  • The new dialect for PPR and PPM was introduced in Add Pauli Product dialect (QEC) #1486.
  • Introduces a new lowering pass that converts:
    • Basic Clifford+T gates (H, S, T, CNOT) to their PPR decompositions
    • Measurement operations to Pauli Product Measurements (PPM)
  • Gate decompositions follow the conventions from "A Game of Surface Codes"
  • Supported gate conversions:
    • Hadamard (H) → PPR with Pauli sequence [Z, X, Z] and θ = π/4
    • S gate → PPR with Pauli sequence [Z] and θ = π/4
    • T gate → PPR with Pauli sequence [Z] and θ = π/8
    • CNOT → PPR with Pauli sequence [Z, X] and θ = π/4

Benefits:

  • Enables compilation pathways for QEC
  • Provides a standardized representation of quantum operation in term of Pauli rotations

TODO:

  • Convert Clifford gates to pi/4 rotations and T to pi/8 rotation
  • Convert CNOT gates to C(Z, X)
  • Convert measurement op to PPR measurement
  • Implement to support running in Pennylane

[sc-82894]

@sengthai sengthai changed the title Implement a conversion from Clifford+T ops in the quantum dialect to PPR ops Implement a conversion from Clifford+T ops to PPR ops Feb 6, 2025
@sengthai sengthai changed the title Implement a conversion from Clifford+T ops to PPR ops [WIP] Implement a conversion from Clifford+T ops to PPR ops Feb 6, 2025
@dime10
Copy link
Contributor

dime10 commented Feb 6, 2025

@sengthai Are you able to rebase this PR onto main now that #1486 is merged? :)

@sengthai
Copy link
Contributor Author

sengthai commented Feb 6, 2025

@sengthai Are you able to rebase this PR onto main now that #1486 is merged? :)

Yes, @dime10. I've just rebased the conv_quantum2ppr branch onto main. Thanks for the reminder!

@sengthai sengthai self-assigned this Feb 6, 2025
@dime10
Copy link
Contributor

dime10 commented Feb 7, 2025

@sengthai Are you able to rebase this PR onto main now that #1486 is merged? :)

Yes, @dime10. I've just rebased the conv_quantum2ppr branch onto main. Thanks for the reminder!

Oh right, my commits from that PR still show up in the history, so it's not actually rebased, but a merge is also fine 😅

Copy link
Contributor

@dime10 dime10 left a comment

Choose a reason for hiding this comment

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

I guess this is still in progress, so feel free to ignore some of the style comments until later 😄 But it's looking great so far 👍

mlir/include/QEC/Transforms/Passes.td Outdated Show resolved Hide resolved
mlir/test/QEC/QECLoweringTest.mlir Outdated Show resolved Hide resolved
mlir/lib/QEC/Transforms/QECLowering.cpp Outdated Show resolved Hide resolved
mlir/lib/QEC/Transforms/QECLowering.cpp Outdated Show resolved Hide resolved
mlir/lib/QEC/Transforms/QECLowering.cpp Outdated Show resolved Hide resolved
mlir/lib/QEC/Transforms/QECLowering.cpp Outdated Show resolved Hide resolved
mlir/lib/QEC/Transforms/QECLowering.cpp Show resolved Hide resolved
Copy link
Contributor

github-actions bot commented Feb 7, 2025

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.

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