-
Notifications
You must be signed in to change notification settings - Fork 1
Restructure and move qubit dialect #557
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
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
☂️ Python Coverage
Overall Coverage
New Files
Modified Files
|
johnzl-777
left a comment
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.
LGTM! Just a dangling print statement and some (very) minor nitpicks. Thank you for doing this!
| ctrls: ir.SSAValue = info.argument(ilist.IListType[qubit.QubitType, N]) | ||
| qargs: ir.SSAValue = info.argument(ilist.IListType[qubit.QubitType, N]) | ||
| ctrls: ir.SSAValue = info.argument(ilist.IListType[QubitType, N]) | ||
| qargs: ir.SSAValue = info.argument(ilist.IListType[QubitType, N]) |
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.
I know this isn't part of the PR (so feel free to just resolve this) but I'm curious, why is it a qarg here when we usually do something like controls vs. targets?
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.
Oh, that was introduced by @weinbe58 somewhere. I think I even left a similar comment on the PR? Should we change it? (Not in this PR, of course).
|
CI is now failing because of #566 :/ |
As discussed in #549, this restructures the qubit dialect. I also moved it to the top level of bloqade, since it's used in multiple places. It's still re-exported by squin, though.
I've got it down to a single failing test, where the
AggressiveUnrollfails because the constant propagation doesn't hint the loop iterable as constant for some reason.This breaks the syntax such that you have to change the function calls using lists such as
squin.qubit.measure(q: IList[Qubit])tosquin.broadcast.measure(q: IList[Qubit]).Edit: turns out I was just too eager to remove the type inference method @weinbe58 added in #508. That resolves the failing test.
Edit2: I've also changed
QubitIdandMeasurementIdto be "broadcasted" (i.e., they now operate on lists of qubits / measurements and return lists). This means that now all statements exceptqubit.neware broadcasted, which is as consistent as we can have it, I think.