API Reference

Complete reference for all public QECSync Python SDK classes and methods.

DecoderEngine

The primary interface for syndrome decoding. Initialize with a decoder algorithm, code distance, and noise model.

DecoderEngine(algorithm, code_distance, noise_model)
algorithmstr"mwpm" or "union-find". MWPM provides higher accuracy; Union-Find provides lower latency.
code_distanceintCode distance d. Must be odd ≥ 3. Determines (2d-1)² physical qubit count.
noise_modelNoiseModelPer-device or synthetic noise model. Drives edge weight computation.
DecoderEngine.decode_rounds(syndromes, rounds) → DecoderResult
syndromesnp.ndarray[bool]3D boolean array of shape (rounds, rows, cols). Rows and cols each equal d-1 for a d×d surface code.
roundsintNumber of syndrome measurement rounds included.
DecoderEngine.from_device(device_spec, code_distance) → DecoderEngine

Class method. Constructs a decoder with noise model derived from a DeviceSpec object. Algorithm defaults to "mwpm".

NoiseModel

Encapsulates per-qubit and per-gate error rates used for decoder weight computation.

NoiseModel.depolarizing(p, n_qubits) → NoiseModel
pfloatDepolarizing error rate per gate. Typical range 0.001–0.01.
n_qubitsintNumber of physical qubits. Must equal (2d-1)² for target code distance.
NoiseModel.from_ibm_json(path) → NoiseModel

Load from an IBM Quantum calibration export (JSON format from IBM Quantum Experience dashboard).

NoiseModel.from_quantinuum_json(path) → NoiseModel

Load from a Quantinuum H-series calibration export.

Compiler

Translates logical Clifford+T circuits into fault-tolerant physical gate schedules.

Compiler(device) → Compiler
deviceDeviceSpecTarget hardware device specification.
Compiler.compile(circuit, code_distance, target_logical_error) → CompilerResult
circuitCircuitSpecLogical Clifford+T circuit to compile.
code_distanceintTarget surface code distance.
target_logical_errorfloatTarget total logical error budget for the circuit.

DeviceSpec

Hardware device specification. Captures qubit topology, native gate set, and per-qubit noise characteristics.

DeviceSpec.from_ibm_json(path) → DeviceSpec
DeviceSpec.from_quantinuum_json(path) → DeviceSpec
device.qubit_count → int
device.topology → str

Returns topology identifier: "grid", "heavy-hex", "all-to-all", or "custom".

DecoderResult

Returned by DecoderEngine.decode_rounds().

result.logical_correction → PauliString
result.latency_ms → float
result.syndrome_graph → SyndromeGraph