← All visualizers

Repetition Code Decoder

Encode one classical bit into an odd number of data bits. Toggle X errors, then infer the minimum-weight correction using only the adjacent Z-parity checks.

Model: independent bit flips, perfect parity checks, and an initial logical 0. The two error strings compatible with a syndrome are complements. Minimum-weight decoding chooses the lower-weight string; a residual all-ones string is a logical X. This code does not protect against phase errors.