-
Notifications
You must be signed in to change notification settings - Fork 323
Add detector support to CUDA-Q #3679
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
base: main
Are you sure you want to change the base?
Conversation
| // "quake.detector"(%6) : (!cc.stdvec<i64>) -> () | ||
| // clang-format on | ||
|
|
||
| // TODO - decide whether or not to keep this path. |
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.
This is almost certainly too fragile or dangerous to keep it this way. If there is a standard MLIR way to do this, we should do it here.
Signed-off-by: Ben Howe <[email protected]>
91ac4a2 to
11fa58e
Compare
| } | ||
| } | ||
|
|
||
| reportClangError(x, mangler, "detector argument types not supported: "); |
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.
Just want to check that we'd have some info after ':' in the error message.
Signed-off-by: Ben Howe <[email protected]>
Signed-off-by: Ben Howe <[email protected]>
Signed-off-by: Ben Howe <[email protected]>
schweitzpgi
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.
First, nice work pulling together this prototype from end to end. Very cool.
After talking to the architects, I think we should hold off merging this for now until we have a consensus on the user facing aspects, etc.
Overview
This PR introduces support for defining detectors in CUDA-Q kernels, a feature for Quantum Error Correction (QEC), and adds functionality to export kernels to the Stim circuit format.
Details
1. Detectors Support
cudaq::detector(C++) andcudaq.detector(Python) to define detectors. Detectors compare measurement results to check for errors (parity checks).quake.detectoroperation to the Quake dialect and its lowering to QIR (__quantum__qis__detector).EraseDetectorspass to remove detector operations when targeting backends that do not support them (e.g., standard hardware execution, or if explicitly undesired).cudaq.detectors()utility to extract detector metadata (measurement indices) from a kernel.2. Stim Integration
cudaq.to_stim(kernel): Added a new Python utility that converts a CUDA-Q kernel into a Stim circuit representation.3. Tracing Improvements
Tests