Skip to content

Conversation

@kimworrall
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.

@kimworrall kimworrall added the dialects Changes on the dialects label Mar 5, 2025
@kimworrall kimworrall requested a review from alexarice March 5, 2025 10:27
@kimworrall kimworrall 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

@alexarice
Copy link
Collaborator

@kimxworrall what's the plan with this?

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.

3 participants