A binary linear code is a -dimensional subspace of with least nonzero weight . A parity-check matrix presents it as a kernel.
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.
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.
For distinct elements of a finite field, a Reed-Solomon code consists of the evaluation vectors of polynomials with degree less than . It has dimension and minimum Hamming distance , so it is a maximum distance separable code. A nonzero polynomial has at most its degree many distinct polynomial roots. Primitive cyclic Reed-Solomon codes use all nonzero field elements, ordered as powers of a primitive root of unity; arbitrary evaluation sets need not give a cyclic code.
Let and let be a primitive root of unity in . The length- cyclic code with consecutive zeros of a cyclic code has dimension . It equals the generalized Reed-Solomon code of vectors , . The choice is the unweighted Reed-Solomon code on these evaluation points; allowing other offsets makes this family closed under dual codes.
With syndromes and distinct error-location values , form and the error locator polynomial . There is an error evaluator polynomial of degree less than the number of errors satisfying the key equation. When the number of errors is at most , the Berlekamp-Massey algorithm or extended Euclidean algorithm recovers these polynomials, normalized by .
For and , the two evaluation forms are and , with and . Their dot product is , since every appearing exponent is between one and and the sums of those powers of vanish. Comparing dimensions proves equality with the dual code. In particular, the dual of the unweighted evaluation code has multipliers ; it need not be an unweighted evaluation code on the same ordered points.
A generalized Reed-Solomon code consists of , where the evaluation points are distinct, all coordinate multipliers are nonzero, and . It remains a maximum distance separable code. Its dual code is another generalized Reed-Solomon code with dimension and multipliers proportional to .
For a linear code of length and dimension over , the code rate is . There are possible messages represented by codewords of length . More generally a block code has rate . This is a dimensionless redundancy measure, distinct from information transmitted per unit physical time.
The asymptotic rate-distance function is . It is the best asymptotic code rate available at the specified relative minimum distance. A limsup is used because the definition does not assume an ordinary limit exists.
// Target: algebra.bigb
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.
A length-, dimension- binary linear code has full support when no coordinate vanishes on every codeword, equivalently when the union of the supports of a vector of all codewords covers every coordinate. Every coordinate is then a nonzero linear functional on the message vector space . Translation by a vector on which it is one pairs the zero and one fibers, so exactly codewords contribute one in that coordinate. Summing these contributions proves the formula. If there are nonzero columns in a full-rank generator matrix, the same argument gives instead.
For a binary linear code , the linear functional records Hamming weight modulo two. Its kernel of a linear map is the even-weight subcode. If vanishes, this is all of ; otherwise rank-nullity theorem gives dimension . This also proves closure under addition without treating ordinary integer weight as a linear function.
// Target: algebra.bigb
Suppose the generators of a binary linear code have Hamming weights divisible by four and have pairwise zero binary inner products. Their linear span is doubly even: for any two vectors,The binary inner product says the intersection size is even. Induction on the number of generators in a sum proves divisibility by four.
// Target: algebra.bigb
A linear subspace is self-orthogonal if for every . The standard bilinear form is nondegenerate, whence and . The condition with means every vector has even Hamming weight. Such a binary linear code gives the linear algebra behind the Eventown theorem.
If a self-orthogonal binary subspace has odd length and dimension , its dual code is obtained by adjoining the all-ones word. Self-orthogonality makes every codeword even-weight, so but . Comparing dimensions proves the formula. The dimension hypothesis alone is insufficient: at length three is a counterexample.
The code consisting of all even-weight binary words. For its dimension is , and its weight enumerator is , by selecting the even terms of the binomial theorem. The length-one code contains only zero.
The two-dimensional ternary linear code generated by and . Its eight nonzero words have exactly three nonzero entries, with precisely two opposite words for each position of the zero coordinate.
The homogeneous weight enumerator of a length- linear code is the polynomialIts coefficients count words of each Hamming weight. In this convention ; some references interchange .
For a binary linear code of dimension and its dual code, the weight enumerator convention givesTo prove it, insert into the enumerator sum. Summing independently over each coordinate of yields a factor if and if .
A parity bit records whether the number of one bits in a word is even or odd and can detect every error that flips an odd number of bits.
Apply one CNOT gate from each input qubit to the same target. Their actions commute because controls remain unchanged and each contribution is added modulo two. This reversible circuit computes the parity bit with exactly one two-qubit gate per input, and its inverse is the same circuit. Unlike measuring the inputs to compute parity classically, the unitary preserves quantum superposition and can be uncomputed after phase application.
The length- even-weight code consists of binary words whose coordinates sum to zero. It has parameters .
Store the Hamming weight of each possible byte in a 256-entry table. Extract each byte of a word by a logical right shift and a bit mask, then sum its table entries. The byte positions partition the word's bits, proving the formula. A 32-bit word needs four lookups, which can be unrolled. Logical extraction does not depend on the endianness of a stored word. The speed advantage depends on table-access costs as well as instruction counts.
The minimum Hamming distance of a nonzero linear code is the smallest Hamming weight of a nonzero codeword.
Every binary linear code satisfiesPuncturing on the support of a minimum-weight codeword reduces the rank by one and leaves minimum distance at least , which proves the bound inductively.
A generator matrix for a linear code has a basis of the code as its rows, so its row space is the code.
For a cyclic code whose generator polynomial has distinct roots in a splitting field , the rows impose precisely the codeword conditions . Expanding each value in a basis of over the original finite field, then discarding dependent equations, gives a parity-check matrix over that field of rank . Alternatively choose one root from each Frobenius conjugate orbit and expand its value in the field it generates.
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.
A binary check polynomial modulo gives the circulant matrix representing multiplication by . Its kernel is the cyclic code. Selecting independent rows gives a parity-check matrix of rank equal to the redundancy, even when the supplied polynomial is not the canonical check polynomial.
// Target: algebra.bigb
If a binary length- cyclic code has generator of degree and check polynomial of degree , use the coefficient vectors of as the rows of a parity-check matrix. They have distinct leading positions and are independent. Their scalar products with a word are the coefficients of in its product with , which vanish for codewords.
// Target: algebra.bigb
The syndrome of a received word with respect to a parity-check matrix is . It vanishes exactly when is a codeword and otherwise identifies the coset containing the error pattern.
For a linear code with parity-check matrix , write the received word as , where is a codeword and an error pattern. Its syndrome depends only on the error because . A syndrome decoder chooses a representative error with that syndrome and returns . Choosing a minimum-Hamming weight representative gives minimum-distance decoding; within the guaranteed correction radius it recovers the unique transmitted codeword. Several representatives may tie outside that radius.
For a rank- parity-check matrix of a linear code , two words have equal syndromes exactly when their difference lies in . Thus attainable syndromes label cosets bijectively. For a received word , its syndrome is that of the error , so minimum-weight representatives provide minimum-distance decoding.
// Target: algebra.bigb
A coset leader is a minimum-Hamming-weight word in a coset of a linear code. It represents a most economical error pattern with the associated syndrome. Several leaders can tie; they need not be unique outside the code's guaranteed correction radius.
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.
Shortening a code at one coordinate first retains only words with a chosen symbol there and then applies puncturing at that coordinate. The minimum distance cannot decrease. In a binary code one coordinate-symbol fibre contains at least half of the words.
The dual code consists of the words orthogonal to every word of under the standard dot product. A parity-check matrix for is a generator matrix for .
A linear code is self-dual when it equals its dual code under the standard dot product. For a length- code with a rank- generator matrix , this is equivalent to : orthogonality gives inclusion in the dual code, and equal dimensions give equality. Over , a generator matrix therefore generates a self-dual code exactly when .
For a binary self-dual code, every word satisfies . In characteristic two this is , so the all-ones word is orthogonal to every codeword and lies in the dual code, hence the code itself. The dual code dimension identity gives even length and half-length dimension.
The binary Reed-Muller code evaluates Boolean polynomials of degree at most on . It has parametersThe dimension counts square-free monomials, and the minimum weight follows inductively from the decomposition .
If have minimum distances , respectively, thenIndeed, , while the words and attain the two candidate bounds.
If is a parity-check matrix of , then a parity-check matrix of isIts equations say that the first half lies in and that the sum of the two halves lies in .
Under the standard binary inner product,The product of representing polynomials has degree at most , so its evaluation word has even weight; equality follows by comparing dimensions.
The binary Hamming code of redundancy has parameters . Its parity-check matrix has every nonzero vector of as a column.
For , use one nonzero representative from each one-dimensional subspace of as a parity-check matrix column. The rank is ; no zero or proportional columns imply minimum Hamming distance at least three. Two independent columns and the representative of their sum give a weight-three relation, proving equality. Every nonzero syndrome uniquely identifies one column and one nonzero error value.
For odd , put and choose of order in . Because is odd, the powers , , represent every projective point once. The cyclic code defined by is therefore monomially equivalent to a ternary Hamming code, with the displayed generator polynomial of a cyclic code. This statement requires a qualification: at , every ternary cyclic length-four, dimension-two code has a weight-two generator, so none has Hamming distance three.
Set and let be a primitive element of a finite field . The powers represent every projective point once. Their kernel code is a ternary Hamming code. Since , its polynomial description is a negacyclic code, generated by the minimal polynomial of an algebraic element over .
Let generate , , and set . The binary cyclic code defined by has a parity-check matrix consisting of every nonzero vector of once, after choosing a basis and ordering its columns. It is therefore a Hamming code. Its generator polynomial is the minimal polynomial of an algebraic element , of degree .
Here , and the weight enumerator convention is . The dual code is the binary simplex code, with enumerator . The MacWilliams identity gives the formula. For , the ordinary enumerator is ; for , the degenerate one-word code has enumerator .
For , a codeword in a Hamming code is a subset of the nonzero vectors of whose sum is zero. Ordered weight-three supports of a vector are determined by two distinct nonzero vectors, giving choices. For weight four, the third vector must avoid the three nonzero vectors in the linear span of the first two, giving choices. For weight five, the first three must be linearly independent, and the fourth must avoid all seven nonzero vectors in their linear span, giving choices. The final vector is their sum. Dividing by , , and counts unordered supports of a vector and proves the displayed weight enumerator coefficients.
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.
The binary linear code known as the Hamming code of length seven is the kernel of a parity-check matrix whose columns are all the nonzero vectors of . Its dimension is four. No one-column or two-column sum vanishes, but some three-column sum does, so its minimum Hamming distance is three. The syndrome of a one-bit error is its column, uniquely identifying the erroneous position.
Its relation to the Hamming code is duality, not equality of the code families.
When the columns of are every nonzero vector in , a nonzero row vector defines a nonzero linear functional . Exactly half the input vectors take value : translation by any vector on which the functional is pairs its zero and one fibres. Removing the zero input removes only a zero value. Thus every nonzero word in the binary simplex code has Hamming weight .
Articles by others on the same topic
There are currently no matching articles.