-
Notifications
You must be signed in to change notification settings - Fork 174
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
Noise model enhancements #2168
base: main
Are you sure you want to change the base?
Noise model enhancements #2168
Conversation
CUDA Quantum Docs Bot: A preview of the documentation can be found here. |
CUDA Quantum Docs Bot: A preview of the documentation can be found here. |
CUDA Quantum Docs Bot: A preview of the documentation can be found here. |
- For the path via ExecutionManager: making sure the registration is early enough, i.e., at the point of registration. - For the Python path: need to let the registry know about the registration. - Propagate the custom op name all the way to the simulator.
CUDA Quantum Docs Bot: A preview of the documentation can be found here. |
CUDA Quantum Docs Bot: A preview of the documentation can be found here. |
@@ -58,5 +59,8 @@ def kernel(): | |||
# Make available to kernel builder object | |||
setattr(PyKernel, operation_name, | |||
partialmethod(__generalCustomOperation, operation_name)) | |||
# Let the runtime know about this registered operation. | |||
# Note: the matrix generator/construction is not known by the ExecutionManager in this case since we don't expect the ExecutionManager to be involved. | |||
cudaq_runtime.register_custom_operation(operation_name) |
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.
Q: Why do we need this?
(Is it for remote execution support?)
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.
The NoiseModel
class has a validation check for gate name when adding noise channels.
Previously, we only check against built-in gates. To support custom ops, I moved the custom gate map/registry to CustomOp.h
in common/
so that the NoiseModel
can check against registered custom ops. Python has a different registration mechanism here; hence we need to propagate this to the C++ registry as well via this call.
CUDA Quantum Docs Bot: A preview of the documentation can be found here. |
CUDA Quantum Docs Bot: A preview of the documentation can be found here. |
CUDA Quantum Docs Bot: A preview of the documentation can be found here. |
Description
(1) Noise model enhancements
Support a match-all condition (noise on a gate, any qubits)
Support noise defined via callback functions.
(2) Noise mapping for custom operations
Move the custom operation map to the
common/
location so that it can be accessed from anywhere.Make the registration a bit earlier so that we know that an operation is registered before actually running that gate.
Connect the Python registration to C++.
Propagate the custom op name all the way back to the runtime, i.e., simulator.