A linear code is a subspace of the n-tuples over a finite field. It is described by a generator matrix, whose rows span it, or by a parity-check matrix, whose kernel it is; its minimum distance is the smallest weight of a nonzero codeword.
Established definitionMachine-checkedUpdated 2026-12-01 · last verified 2026-12-01
AI-assisted text, machine-checked, not yet reviewed by a person. Citations resolve and an automated pass compared the statements with the cited sources. That is not peer review; check the sources for anything you depend on.
Let Fq be the finite field with q elements. For x,y∈Fqn the Hamming
weightwt(x) is the number of nonzero coordinates of x, and the
Hamming distance is d(x,y)=wt(x−y), the number of coordinates
in which x and y differ.
A linear code of length n and dimension k over Fq is a k-dimensional
subspace C⊆Fqn. Its elements are codewords, its rate is R=k/n,
and its minimum distance is
d=c,c′∈Cc=c′mind(c,c′)=c∈C∖{0}minwt(c),
the two expressions agreeing because c−c′∈C. Such a code is called an
[n,k,d]q code; the subscript is dropped when q=2.
A generator matrix is a k×n matrix G whose rows form a basis of C, so
that C={uG:u∈Fqk}.
A parity-check matrix is a matrix H with n columns such that
C={c∈Fqn:HcT=0}. It has rank n−k; it may have more than
n−k rows, the extra ones being redundant checks.
The syndrome of a word y∈Fqn is s(y)=HyT. It vanishes exactly on
C and is constant on each coset y+C.
The two descriptions are related by GHT=0. A code that is not required to be a
subspace, with M codewords and minimum distance d, is written (n,M,d)q.
Claude (AI drafting assistant)Writing, original draft (CRediT roles)
Review history
Automated source check · Pass · 2026-12-01 · Independent automated verification pass (AI, not the drafting session)
Definitions (Hamming weight/distance, [n,k,d]_q, generator and parity-check matrices, syndrome, G H^T = 0) re-derived and compared with Guruswami-Rudra-Sudan, Essential Coding Theory (open draft, Aug 2025), Defs 1.3.3, 1.5.1, 2.3.2 and Prop. 1.5.4; Huffman-Pless (2003) is not openly readable, so it was not opened; hamming-1950 and huffman-pless-2003 metadata compared with Crossref.
Revision history
2026-12-01Content release 2.1.0: 35 more topics, an independent source check of every record, intake hardening (#17)80537b7e
2026-11-30KetQat Commons: free learning paths, knowledge records, research problems, literature intake (#14)571c9b10
Current revision 87a7809b5715da6d. Source file knowledge/records/definition/linear-code.md in the content repository (readable there once it is public).