-
Notifications
You must be signed in to change notification settings - Fork 196
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 a few state-related cc ops #2354
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Anna Gringauze <[email protected]>
…ate-ops Signed-off-by: Anna Gringauze <[email protected]>
Signed-off-by: Anna Gringauze <[email protected]>
…ate-ops Signed-off-by: Anna Gringauze <[email protected]>
Signed-off-by: Anna Gringauze <[email protected]>
Signed-off-by: Anna Gringauze <[email protected]>
Signed-off-by: Anna Gringauze <[email protected]>
…ate-ops Signed-off-by: Anna Gringauze <[email protected]>
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'm thinking we should put these in the quake dialect.
First, these really correspond to quantum
operations in the end. As such they are successively lowered to (recursive?) kernel application or high-level abstract calls to a quantum simulator/emulator.
Second, they just don't have a classical computation semantics (see issue 1). In that context, they really aren't anything the compiler can reason about in terms of classical computation and behave as opaque calls to unknown external code.
Signed-off-by: Anna Gringauze <[email protected]>
+1 I wonder with the |
Signed-off-by: Anna Gringauze <[email protected]>
…ate-ops Signed-off-by: Anna Gringauze <[email protected]>
That sounds reasonable to me, but I would like to address it in a separate PR, to keep changes smaller. |
I agree. It's morphed its way from being just a vector of complex (as in exactly the CC type) to its own distinct type that only makes sense when used in a quantum context. I think moving it to |
Description
Add a few state-related quake ops:
quake.create_state
quake.delete_state
quake.get_number_of_qubits
quake.get_state
The ops are created by the kernel builder or the AST bridge and are either optimized away during argument synthesis, or converted to MLIR in
QuakeToCodegen
pass.This simplifies passes that intend to remove those ops, such as
DeleteStates
,ArgumentConversion
, orReplaceStateWithKernel
(to be added in the dependent PR below)Note: this is also a prerequisite for creating a simpler quantum state synthesis passes: #2291