Decoder Library#

1D Minimum-Weight Perfect Matching#

Syndrome measurement#

for each consecutive pair of data qubits
    do a parity check (pairwise XOR for classical bits, ZZ or XX for qubits) and store the result in an auxiliary bit/qubit

Decoding algorithm#

option 1: assume data qubit 0 had no error
from left to right, for each parity check bit indexed i >= 0
    error on qubit i + 1 = error on qubit i XOR parity check qubit i

option 2: assume data qubit 0 had an error
from left to right, for each parity check bit indexed i >= 0
    error on qubit i + 1 = error on qubit i XOR parity check qubit i

compare options 1 and 2, and pick the one that has fewer errors (minimum weight)


Version History#

v0: Sep 12, 2025, github/@aasfaw