Binary linear code 2026-10-14
A linear code over the two-element finite field. Its dimension gives codewords. Its weight enumerator in the convention is symmetric in exactly when the all-ones word belongs to : adding that word complements every bit and replaces weight by . Conversely symmetry makes the coefficient of equal the coefficient of , which is one.
Code encoding 2026-10-14
Code encoding maps messages injectively to codewords. For a dimension- linear code with generator matrix , the standard encoder maps to . The redundancy makes error detection and recovery possible; for a Reed-Solomon code, encoding can instead evaluate a message polynomial at the chosen field elements.
Codeword 2026-10-14
A codeword is a member of the specified set of words used to encode messages. For a linear code specified by a parity-check matrix , the codewords are precisely the vectors satisfying . The minimum distance between distinct codewords controls error correction.
Coding theory Created 2026-09-24 Updated 2026-10-18
Coding theory studies representations of messages that make decoding efficient, reliable, or compact. In channel coding, messages are mapped to separated codewords, so a corrupted word can still be recognized as coming from one particular message. In lossless source coding, a prefix code instead assigns short descriptions to frequent symbols. The objectives differ, but both exploit structure in the set of allowed words.
The simplest error-correction example sends as and as . If the receiver sees , at most one bit flip is consistent with , whereas two flips would be needed to obtain it from . A repetition code therefore recovers the original by taking the majority function of the received bits. The Hamming distance between the valid codewords is three: the spaces of one-error outputs around them do not overlap. This turns error correction into geometry in a discrete space.
The central tradeoff is between code rate and minimum distance. Additional separation makes correction possible but leaves fewer words available for messages at a fixed length. The Hamming bound counts disjoint error neighborhoods, while linear codes turn encoding and error detection into computations with matrices over finite fields. These connections explain why combinatorics, linear algebra, and probability theory all enter the subject.
Richard W. Hamming's Error Detecting and Error Correcting Codes appeared in the Bell System Technical Journal in April 1950, pp. 147–160. Its introduction motivates automatic correction through failures in digital computing, and its constructions go beyond detecting an error to identifying and correcting its location.[ref]
CSS code 2026-10-14
For binary linear codes , the CSS code has basis for . Its X stabilizers come from and its Z stabilizers from the dual code ; their commutation follows from orthogonality. For positive logical dimension, and , with quantum code distance . Thus arbitrary errors on at most qubits are correctable. Stabilizer errors are harmless even if their weight is small; the distances exclude them.
Error-correcting code Created 2026-10-03 Updated 2026-10-14
An error-correcting code is a set of codewords chosen with enough separation to recover a transmitted message after specified errors. For equal-length words and bit-flip errors, separation is measured by Hamming distance. If the minimum distance is , any nonzero pattern of at most flips changes a valid word into an invalid word and can therefore be detected. Every pattern of at most flips can be corrected by choosing the unique nearby codeword.
The distinction matters. A distance-two code detects a single flip but need not locate it; a distance-three code corrects a single flip. The triangle inequality explains the correction threshold: a received word within distance of two distinct codewords would put those codewords within distance , a contradiction. Actual decoders also need an efficient way to find the nearby word; a parity-check matrix and syndrome decoding exploit the structure of a linear code to do this.
Extended Hamming code 2026-10-14
Adding an overall parity bit to the Hamming code of length seven gives an eight-bit linear code with minimum Hamming distance four: every resulting weight is even, every original nonzero weight is at least three, and a weight-three word extends to weight four. Thus it detects up to three errors when testing codeword membership and corrects one error. Joint single-error correction and double-error detection uses the overall parity together with the seven-bit syndrome.
Generator matrix Created 2026-09-24 Updated 2026-09-29
A generator matrix for a linear code has a basis of the code as its rows, so its row space is the code.
Kravchuk polynomials Created 2026-10-14 Updated 2026-10-18
These polynomials are orthogonal for a binomial distribution weight and encode the coefficient transformation in the MacWilliams identity. Their generating function follows by expanding the two factors:
For binary linear codes, . Expanding the factors gives , where binomial coefficients outside their usual integer range are zero. Orthogonality follows by multiplying generating functions and summing over with weight : the result is , whose coefficient of is zero for and for .
MacWilliams identity 2026-10-05
For a binary linear code of dimension and its dual code, the weight enumerator convention gives
To prove it, insert into the enumerator sum. Summing independently over each coordinate of yields a factor if and if .
A nonzero length-, dimension- linear code is maximum distance separable if its minimum Hamming distance equals , attaining the Singleton bound. Reed-Solomon codes and generalized Reed-Solomon codes provide examples because a nonzero polynomial of degree at most has at most distinct polynomial roots.
Minimum distance of a code Created 2026-10-03 Updated 2026-10-14
The minimum distance of a code is the least Hamming distance between distinct codewords. For a linear code, translation invariance makes this equal to the least Hamming weight of a nonzero codeword.
Minimum Hamming distance of a linear code Created 2026-09-24 Updated 2026-09-24
The minimum Hamming distance of a nonzero linear code is the smallest Hamming weight of a nonzero codeword.
Two linear codes are monomially equivalent if a permutation of coordinates followed by multiplication of individual coordinates by nonzero field elements takes one to the other. This preserves dimension and Hamming distance. Choosing different representatives for projective parity-check columns produces this equivalence.
Negacyclic code 2026-10-14
A linear code is negacyclic if being a codeword implies that is a codeword. Polynomial identification makes it an ideal modulo . For odd , the substitution gives a monomial equivalence of linear codes between negacyclic and cyclic codes.
For binary linear codes , the coset superpositions of the CSS code have checks labelled by and checks by . A bit-error pattern gives the classical syndrome for , and a phase-error pattern gives the syndrome for the dual code . Errors with and are jointly correctable. Every pairwise Pauli-error product either anticommutes with a check, giving zero code compression, or its low-weight components belong to the stabilizer and give scalar compression. Thus the Knill--Laflamme condition covers coherent superpositions and quantum channels as well as definite bit and phase errors.
Write the Steane code basis as uniform quantum superpositions over a binary linear code and a disjoint coset , where is the even-weight part of the length-seven Hamming code. For , diagonal Pauli Z gates cannot connect the two cosets. Within coset , the overlap is
If , translation by a word with negates this sum, so it vanishes. Since the dual code is the length-seven Hamming code of minimum Hamming distance three, every nonzero of Hamming weight one or two has vanishing overlap. Taking from proves the displayed identity. The eight two-dimensional error images are orthogonal, so their projective measurement determines the error syndrome without revealing the logical state; applying the identified phase flip again recovers every code state. This proves nondegenerate quantum error-correcting code behaviour for the identity and all single-site phase flips, including their coherent linear span.
In the usual column convention, a codeword of a linear code obeys , so its nonzero coordinates give a linear dependence among columns of its parity-check matrix. Conversely a dependence gives a nonzero codeword supported on those coordinates. Minimizing the support gives the minimum Hamming distance of a linear code. In the transposed convention , the corresponding objects are the rows of . The size of a dependent set means the number of its coordinate positions, even when some check vectors coincide.
Parity-check extension of a linear code Created 2026-09-24 Updated 2026-09-24
The parity-check extension of a binary linear code appends to each codeword the sum of its coordinates in , making every extended word have even Hamming weight.
Parity-check matrix Created 2026-09-24 Updated 2026-09-24
A parity-check matrix for a linear code satisfies