Skip to main content
KetQat

Appearance

Definition · introductory

Linear code

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\F_q be the finite field with qq elements. For x,y∈Fqnx, y \in \F_q^n the Hamming weight wt⁡(x)\operatorname{wt}(x) is the number of nonzero coordinates of xx, and the Hamming distance is d(x,y)=wt⁡(x−y)d(x, y) = \operatorname{wt}(x - y), the number of coordinates in which xx and yy differ.

A linear code of length nn and dimension kk over Fq\F_q is a kk-dimensional subspace C⊆FqnC \subseteq \F_q^n. Its elements are codewords, its rate is R=k/nR = k/n, and its minimum distance is

d  =  min⁡c,c′∈Cc≠c′d(c,c′)  =  min⁡c∈C∖{0}wt⁡(c),d \;=\; \min_{\substack{c, c' \in C \\ c \ne c'}} d(c, c') \;=\; \min_{c \in C \setminus \{0\}} \operatorname{wt}(c) ,

the two expressions agreeing because c−c′∈Cc - c' \in C. Such a code is called an [n,k,d]q[n, k, d]_q code; the subscript is dropped when q=2q = 2.

  • A generator matrix is a k×nk \times n matrix GG whose rows form a basis of CC, so that C={ uG:u∈Fqk }C = \{\, uG : u \in \F_q^k \,\}.
  • A parity-check matrix is a matrix HH with nn columns such that C={ c∈Fqn:HcT=0 }C = \{\, c \in \F_q^n : H c^{T} = 0 \,\}. It has rank n−kn - k; it may have more than n−kn - k rows, the extra ones being redundant checks.
  • The syndrome of a word y∈Fqny \in \F_q^n is s(y)=HyTs(y) = H y^{T}. It vanishes exactly on CC and is constant on each coset y+Cy + C.

The two descriptions are related by GHT=0G H^{T} = 0. A code that is not required to be a subspace, with MM codewords and minimum distance dd, is written (n,M,d)q(n, M, d)_q.

Instances

Open in the knowledge graph

Contributions about this record

Nobody has published a contribution about it yet.

Publish a result, reproduction or commentPropose a correction to this page

References

  1. R. W. Hamming (1950). Error Detecting and Error Correcting Codes. Bell System Technical Journal 29 (2), 147-160. doi:10.1002/j.1538-7305.1950.tb00463.x
  2. W. Cary Huffman, Vera Pless (2003). Fundamentals of Error-Correcting Codes. Cambridge University Press. doi:10.1017/CBO9780511807077

Contributors

  • KetQat maintainers · @ketqatConceptualization; Supervision (CRediT roles)
  • Claude (AI drafting assistant)Writing, original draft (CRediT roles)

Review history

  1. 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

  1. 2026-12-01Content release 2.1.0: 35 more topics, an independent source check of every record, intake hardening (#17)80537b7e
  2. 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).