CUDA-Q QEC Python API

class cudaq_qec.Code

Represents a quantum error correction code

get_observables_x(self: cudaq_qec._pycudaqx_qec_the_suffix_matters_cudaq_qec.qecrt.Code) numpy.ndarray[numpy.uint8]

Get the Pauli X observables of the code

get_observables_z(self: cudaq_qec._pycudaqx_qec_the_suffix_matters_cudaq_qec.qecrt.Code) numpy.ndarray[numpy.uint8]

Get the Pauli Z observables of the code

get_parity(self: cudaq_qec._pycudaqx_qec_the_suffix_matters_cudaq_qec.qecrt.Code) numpy.ndarray[numpy.uint8]

Get the parity check matrix of the code

get_parity_x(self: cudaq_qec._pycudaqx_qec_the_suffix_matters_cudaq_qec.qecrt.Code) numpy.ndarray[numpy.uint8]

Get the X-type parity check matrix of the code

get_parity_z(self: cudaq_qec._pycudaqx_qec_the_suffix_matters_cudaq_qec.qecrt.Code) numpy.ndarray[numpy.uint8]

Get the Z-type parity check matrix of the code

get_pauli_observables_matrix(self: cudaq_qec._pycudaqx_qec_the_suffix_matters_cudaq_qec.qecrt.Code) numpy.ndarray[numpy.uint8]

Get a matrix of the Pauli observables of the code

get_stabilizers(self: cudaq_qec._pycudaqx_qec_the_suffix_matters_cudaq_qec.qecrt.Code) list[SpinOperator]

Get the stabilizer generators of the code

class cudaq_qec.Decoder

Represents a decoder for quantum error correction

decode(self: cudaq_qec._pycudaqx_qec_the_suffix_matters_cudaq_qec.qecrt.Decoder, syndrome: list[float]) cudaq_qec._pycudaqx_qec_the_suffix_matters_cudaq_qec.qecrt.DecoderResult

Decode the given syndrome to determine the error correction

get_block_size(self: cudaq_qec._pycudaqx_qec_the_suffix_matters_cudaq_qec.qecrt.Decoder) int

Get the size of the code block

get_syndrome_size(self: cudaq_qec._pycudaqx_qec_the_suffix_matters_cudaq_qec.qecrt.Decoder) int

Get the size of the syndrome

class cudaq_qec.DecoderResult

A class representing the results of a quantum error correction decoding operation.

This class encapsulates both the convergence status and the actual decoding result.

property converged

Boolean flag indicating if the decoder converged to a solution.

True if the decoder successfully found a valid correction chain, False if the decoder failed to converge or exceeded iteration limits.

property result

The decoded correction chain or recovery operation.

Contains the sequence of corrections that should be applied to recover the original quantum state. The format depends on the specific decoder implementation.

cudaq_qec.sample_memory_circuit(*args, **kwargs)

Overloaded function.

  1. sample_memory_circuit(code: cudaq_qec._pycudaqx_qec_the_suffix_matters_cudaq_qec.qecrt.Code, numShots: int, numRounds: int, noise: Optional[cudaq.mlir._mlir_libs._quakeDialects.cudaq_runtime.NoiseModel] = None) -> tuple

Sample the memory circuit of the code

  1. sample_memory_circuit(code: cudaq_qec._pycudaqx_qec_the_suffix_matters_cudaq_qec.qecrt.Code, op: cudaq_qec._pycudaqx_qec_the_suffix_matters_cudaq_qec.qecrt.operation, numShots: int, numRounds: int, noise: Optional[cudaq.mlir._mlir_libs._quakeDialects.cudaq_runtime.NoiseModel] = None) -> tuple

Sample the memory circuit of the code with a specific initial operation

cudaq_qec.sample_code_capacity(*args, **kwargs)

Overloaded function.

  1. sample_code_capacity(code: cudaq_qec._pycudaqx_qec_the_suffix_matters_cudaq_qec.qecrt.Code, numShots: int, errorProb: float, seed: Optional[int] = None) -> tuple

Sample syndrome measurements with code capacity noise.

  1. sample_code_capacity(H: numpy.ndarray[numpy.uint8], numShots: int, errorProb: float, seed: Optional[int] = None) -> tuple

Sample syndrome measurements with code capacity noise.