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

dialects: (qft) initialise dialect #67

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

dialects: (qft) initialise dialect #67

wants to merge 2 commits into from

Conversation

kimxworrall
Copy link
Contributor

Add a QFT dialect with the same motivation as the QEC dialect.

Adds the QFT GateAttr which has an integer parameter - this indicates the number of qubits the gate this attr is attached to acts on.

@kimxworrall kimxworrall added the dialects Changes on the dialects label Mar 5, 2025
@kimxworrall kimxworrall requested a review from alexarice March 5, 2025 10:27
@kimxworrall kimxworrall self-assigned this Mar 5, 2025
class QFTAttr(GateAttr):
name = "qft.n"

num_qubits_param: ParameterDef[IntAttr]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
num_qubits_param: ParameterDef[IntAttr]
qubits: ParameterDef[IntAttr]

Would this be simpler?


@irdl_attr_definition
class QFTAttr(GateAttr):
name = "qft.n"
Copy link
Collaborator

Choose a reason for hiding this comment

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

The alternative to this would be to have an algorithm or algo dialect and put qft inside. Do you see anything else being in this dialect?


"test.op"() {gate = #qft.n<5>} : () -> ()

// CHECK: "test.op"() {gate = #qft.n<5>} : () -> ()
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could have a test with a use of the gate to check that number of qubits is working correctly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dialects Changes on the dialects
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants