-
Notifications
You must be signed in to change notification settings - Fork 1
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
utils: (qssa-builder) introduce builder for qssa #34
Conversation
I'm curious about this, what's the use-case and intended API? Do you have a circuit that you'd like to have some sugar for? |
I have a circuit which was a real pain to write without this. Essentially it's much easier to write a circuit when thinking of a gate as an operation which mutates qubits rather than as an SSA operation, and this builder lets you write in the first style and converts to the SSA style Edit: circuit appears in future PR which has not been pushed yet |
@superlopuh https://github.com/xdslproject/inconspiquous/blob/temp/inconspiquous/transforms/qec/inline.py here is some code that uses this builder. Would be keen to know if you can think of a better way to achieve this, or if you think subclassing the builder is a bad idea |
Nice! It's not a bad idea, although I wonder if there's already some quantum circuit DSL/library that you could IR gen from instead? This already looks rather pretty so it's your call. |
I don't think there's a dsl that would let you mix in the classical mlir operations in this way. |
An alternative could be to have a direct generation method on |
I had a play around and don't particularly like the method on |
I also played around with having a contextmanager for ancilla qubits, which would allocate them and then measure them an the end, but I couldn't find a satisfying interface for returning the measured value |
Lets a qssa program be built in a style similar to qref programs.
Still needs some unit tests. I also don't think the name hints are propagating correctly yet.