← Back to Tools

BP / OSD / LSD Decoder Sandbox

Watch a quantum-LDPC decoder run end to end on a Tanner graph. A parity-check matrix $H$ links checks $C_i$ to qubits $q_j$; an error $e$ gives the syndrome $s = He$. Belief propagation passes soft messages along the edges to build per-qubit beliefs (log-likelihood ratios). When BP alone stalls on a trapping set, a post-processor finishes the job: OSD (ordered statistics) does one global most-reliable-basis solve, while LSD (localized statistics) grows clusters around the unsatisfied checks and solves each locally. Every message, belief, and solve is drawn and written out.

Tanner graph  T(H)  · squares = checks $C_i$, circles = qubits $q_j$, edges = 1’s of $H$
edge colour = check→qubit belief · thickness = |message|
unsatisfied check $s_i=1$ check $s_i=0$ qubit $\hat e_j=0$ qubit $\hat e_j=1$ true error $e_j=1$ belief → 0 belief → 1
0 / 0
Build an instance and inject an error to begin.

1 · Build the instance

7
12
0.12
12
Craft a custom $H$ (rows of 0/1)
One row per check, one column per qubit, space or comma separated. Columns are the qubits.

2 · Run the decoder

Parity-check matrix $H \in \mathbb{F}_2^{\,m\times n}$

Red columns carry the true error $e$; yellow the decoder's correction $\hat e$; blue the OSD information set (most-reliable basis).

Syndrome $s = He \bmod 2 \in \mathbb{F}_2^{\,m}$

A check $C_i$ is a defect when $s_i = 1$. The decoder seeks the lightest $\hat e$ with $H\hat e = s$.

Beliefs posterior LLR $\Lambda_j$

$\Lambda_j = L_j + \sum_{i} \lambda_{i\to j}$. Sign gives the hard decision $\hat e_j = [\Lambda_j < 0]$; magnitude is the confidence. Blue favours $0$, red favours $1$.

Step log