CudaQDecoder¶
- class guppyft.decoder.cudaq.CudaQDecoder[source]¶
Realtime decoding using Nvidia GPUs on Quantinuum hardware.
Corresponds to the CUDA-Q QEC Realtime decoding API at https://github.com/NVIDIA/cudaqx/blob/7eae5b2/libs/qec/lib/realtime/quantinuum/quantinuum_decoding.h
The decoder maintains internal state for multiple decoder instances, each identified by a unique decoder_id. Syndromes are enqueued for processing, and corrections (detected bit flips) can be retrieved after decoding.
Note
All syndrome and correction data is represented as bit-packed integers (uint64), with a maximum size of 64 bits per operation.
- enqueue_syndromes(decoder_id, syndrome_size, syndrome, tag)[source]¶
Enqueue a syndrome for decoding.
- Return type:
- Parameters:
decoder_id (int) – The ID of the decoder to use.
syndrome_size (int) – The size of the syndrome (in bits). This must be <= 64.
syndrome (int) – The bit-packed syndrome to enqueue. The least significant bit (i.e. syndrome & 1) is the first bit of the syndrome. The last valid bit is syndrome_size - 1 (i.e. syndrome & (1 << (syndrome_size - 1)).
tag (int) – The tag to use for the syndrome (logging only).
- get_corrections(decoder_id, return_size, reset)[source]¶
Get the corrections for a given decoder.
- Return type:
- Parameters:
decoder_id (int) – The ID of the decoder to use.
return_size (int) – The number of bits to return (in bits). This must be <= 64. This is expected to match the number of observables in the decoder. The least significant bit (i.e. return_value & 1) is the first bit of the corrections. The last valid bit is return_size - 1.
reset (int) – Whether to reset the decoder corrections after retrieving them.
- Returns:
- The corrections (detected bit flips) for the given decoder, based on
all of the decoded syndromes since the last time any corrections were reset.
- Return type: