Union-Find Decoder Sandbox
Watch the full decoding pipeline end to end, in 3D. A parity-check matrix $H$ — random or your own — defines a syndrome graph: qubits $Q_j$ are edges, checks $C_i$ are vertices, and weight-1 columns attach to a boundary $\perp$ (there can be several). Inject an error, then step through Union-Find cluster growth and the peeling decoder — with $H$, the syndrome $s=He$, the growing clusters, the disjoint-set forest, the erasure $\mathcal{E}$, and the correction $\hat e$ all drawn and written out explicitly. Drag the graph to rotate it.
Decoding graph G = (V, E) · V = checks $C_i$ + boundaries $\perp$, E = qubits $Q_j$
⟲ drag to rotate · scroll to zoom
defect $s_i=1$
check $s_i=0$
boundary $\perp$
error $e_j=1$
growth front
correction $\hat e_j=1$
spanning forest
1 / 1
1 · Build the instance
Craft a custom $H$ (rows of 0/1)
One row per check, one column per qubit. Every column needs weight 1 (→ boundary) or 2 (→ two checks). Weight-1 columns are spread across the $b$ boundaries.
2 · Run the decoder
Parity-check matrix $H \in \mathbb{F}_2^{\,m\times n}$
Column $j$ is qubit $Q_j$ and defines an edge: weight 2 $\Rightarrow$ edge $\{C_a, C_b\}$; weight 1 $\Rightarrow$ edge $\{C_a, \perp\}$ (the $\partial$ row names the boundary). Red columns carry the error $e$; yellow the correction $\hat e$.
Syndrome $s = He \bmod 2 \in \mathbb{F}_2^{\,m}$
Union-Find clusters
A cluster $C$ (a component of the disjoint-set forest) is neutral $\iff$ it touches a boundary or holds an even number of defects:
$$\textstyle \big(\sum_{v\in C} s_v \equiv 0 \bmod 2\big) \ \ \lor\ \ (\perp \in C).$$
Only odd clusters keep growing.