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

Add Pauli Product dialect (QEC) #1486

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

Add Pauli Product dialect (QEC) #1486

wants to merge 2 commits into from

Conversation

dime10
Copy link
Contributor

@dime10 dime10 commented Jan 24, 2025

@sengthai We can use this as the target of our Pauli product passes. (feel free to adjust if the need arises)

[sc-82892]


func.func @foo(%q1 : !quantum.bit, %q2 : !quantum.bit) {
%theta = arith.constant 0.1 : f64
qec.ppr [X, Z] (%theta) %q1, %q2 : !quantum.bit, !quantum.bit
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unfortunately I haven't been able to make this syntax for the PPMs work, I think there is an issue in MLIR with parsing an array attribute of enums. For example, if I build the op with a single Pauli letter instead of the array, the parsing of qec.ppr X (%theta) %q1, %q2 : !quantum.bit, !quantum.bit for example works just fine.

I also searched upstream for example dialects using array attributes of enums, and I did find linalg.generic and vector.contract using it. However, they both implemented custom parsers.

I think to get it working we could either implement a custom printer/parser or change to attribute to a different type, for example using strings for the Pauli letters (less efficient), or using integers directly to represent them instead of the enum (less readable).

Copy link
Contributor

Choose a reason for hiding this comment

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

Hi @dime10. Thanks for implementing and detail this issue. I will take a look through the MLIR more detail and I'll keep you in loop.

Copy link
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.

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