Papers
Topics
Authors
Recent
Search
2000 character limit reached

Code Distances in Coding Theory

Updated 12 July 2026
  • Code distances are metric invariants that measure the separation between admissible information carriers, crucial for defining error detection and correction capabilities.
  • They are computed using diverse metrics—such as Hamming, Lee, Manhattan, and quantum distances—and analyzed through algebraic and semidefinite programming techniques.
  • These measures underpin practical error correction in classical, subspace, and quantum codes, influencing system design from communication standards to high-rate LDPC implementations.

Code distances are metric invariants that quantify separation between codewords or, more generally, between admissible information carriers in a coding system. In classical linear block coding, the basic quantity is usually the minimum Hamming distance, equivalently the minimum nonzero Hamming weight; in stabilizer quantum coding, the code distance is the minimum weight of a nontrivial logical Pauli operator; in subspace and flag coding, distance is defined from subspace metrics; and in bb-symbol, Lee, and Manhattan settings, the relevant distance depends on the channel model or ambient geometry (Chen, 2023, Dumer et al., 2014, Silberstein et al., 2010, Alonso-González et al., 2021).

1. Minimum distance and the classical Hamming framework

For a code CFqnC \subseteq \mathbb{F}_q^n, the Hamming weight of a=(a0,,an1)a=(a_0,\dots,a_{n-1}) is

wt(a)={i:ai0},\operatorname{wt}(a)=|\{i:a_i\neq 0\}|,

and the Hamming distance is d(a,b)=wt(ab)d(a,b)=\operatorname{wt}(a-b). For a linear code, the minimum Hamming distance is

d(C)=min{wt(c):0cC},d(C)=\min\{\operatorname{wt}(c):0\neq c\in C\},

so distance is the minimum nonzero weight. This quantity controls error detection and bounded-distance correction: d(C)1d(C)-1 errors can be detected, and d(C)12\left\lfloor \frac{d(C)-1}{2}\right\rfloor errors can be corrected (Chen, 2023).

Beyond the minimum distance, classical coding theory also studies the full distance distribution and weight distribution. For a code C(Fq)nC\subset (\mathbb{F}_q)^n, the weight distribution is the sequence Bi(C)B_i(C) counting codewords of weight CFqnC \subseteq \mathbb{F}_q^n0, while the distance distribution CFqnC \subseteq \mathbb{F}_q^n1 counts unordered pairs of distinct codewords at distance CFqnC \subseteq \mathbb{F}_q^n2. For systematic non-linear codes, these distributions are not generally accessible through linear duality, and brute-force pairwise comparison had been the only known general method for computing them. A Gröbner basis framework replaces this with algebraic ideals whose varieties encode codewords of bounded weight or pairs of codewords at bounded distance, thereby recovering the minimum distance, the full distance distribution, and all closest pairs (0909.1626).

A recurrent theme is that “code distance” may refer either to a minimum-distance parameter or to the whole set of realized pairwise distances. The latter viewpoint becomes central in the theory of CFqnC \subseteq \mathbb{F}_q^n3-distance codes and in settings where the distance spectrum, rather than only its minimum, is the object of study (Landjev et al., 11 Mar 2025).

2. Distance sets, few-distance codes, and symmetric distance spectra

An CFqnC \subseteq \mathbb{F}_q^n4-distance binary code of length CFqnC \subseteq \mathbb{F}_q^n5 is a code CFqnC \subseteq \mathbb{F}_q^n6 whose set of nonzero pairwise Hamming distances is exactly

CFqnC \subseteq \mathbb{F}_q^n7

For such codes, the maximum size satisfies the universal polynomial bound

CFqnC \subseteq \mathbb{F}_q^n8

with no restriction on the actual values CFqnC \subseteq \mathbb{F}_q^n9. A refinement subtracts a lower-order correction involving partition numbers a=(a0,,an1)a=(a_0,\dots,a_{n-1})0, but the dominant asymptotic term remains a=(a0,,an1)a=(a_0,\dots,a_{n-1})1. The bound is asymptotically optimal for fixed a=(a0,,an1)a=(a_0,\dots,a_{n-1})2: the family of all weight-a=(a0,,an1)a=(a_0,\dots,a_{n-1})3 binary words has size a=(a0,,an1)a=(a_0,\dots,a_{n-1})4 and realizes exactly a=(a0,,an1)a=(a_0,\dots,a_{n-1})5 distinct nonzero distances (Landjev et al., 11 Mar 2025).

A particularly rigid case is the a=(a0,,an1)a=(a_0,\dots,a_{n-1})6-ary two-distance condition a=(a0,,an1)a=(a_0,\dots,a_{n-1})7 for all distinct codewords. Such a=(a0,,an1)a=(a_0,\dots,a_{n-1})8-codes interpolate between equidistant codes and unrestricted block codes. The theory includes direct constructions from balls of radius 1, parity extensions, mutually orthogonal Latin squares, difference matrices, and, in the linear case, a classification theorem: for a=(a0,,an1)a=(a_0,\dots,a_{n-1})9, linear two-distance codes arise from linear equidistant codes by deleting or adding a coordinate; for wt(a)={i:ai0},\operatorname{wt}(a)=|\{i:a_i\neq 0\}|,0, an additional MOLS-derived family appears (Boyvalenkov et al., 2019).

The symmetric-distance condition imposes another global restriction. In a space with maximal distance wt(a)={i:ai0},\operatorname{wt}(a)=|\{i:a_i\neq 0\}|,1, a code has symmetric distances if its distance set wt(a)={i:ai0},\operatorname{wt}(a)=|\{i:a_i\neq 0\}|,2 is symmetric with respect to wt(a)={i:ai0},\operatorname{wt}(a)=|\{i:a_i\neq 0\}|,3, that is,

wt(a)={i:ai0},\operatorname{wt}(a)=|\{i:a_i\neq 0\}|,4

For binary constant-weight codes of length wt(a)={i:ai0},\operatorname{wt}(a)=|\{i:a_i\neq 0\}|,5 and weight wt(a)={i:ai0},\operatorname{wt}(a)=|\{i:a_i\neq 0\}|,6, viewed in the Johnson space wt(a)={i:ai0},\operatorname{wt}(a)=|\{i:a_i\neq 0\}|,7, this symmetry improves the usual Johnson-type cardinality bound. If the degree set has size wt(a)={i:ai0},\operatorname{wt}(a)=|\{i:a_i\neq 0\}|,8, then

wt(a)={i:ai0},\operatorname{wt}(a)=|\{i:a_i\neq 0\}|,9

This is interpreted through the language of d(a,b)=wt(ab)d(a,b)=\operatorname{wt}(a-b)0-bipartite d(a,b)=wt(ab)d(a,b)=\operatorname{wt}(a-b)1-polynomial association schemes, where the symmetry of the distance set forces a parity restriction on the annihilator polynomial. Equality is highly constrained: the paper identifies Hadamard-type one-distance examples and Erdős–Ko–Rado-type intersecting families, and derives number-theoretic restrictions showing that tight symmetric-distance codes are exceptional (Hegedüs et al., 20 Jan 2025).

3. Alternative metrics: subspace, flag, d(a,b)=wt(ab)d(a,b)=\operatorname{wt}(a-b)2-symbol, Lee, and Manhattan distances

When codewords are subspaces rather than vectors, the relevant metric changes. For subspaces d(a,b)=wt(ab)d(a,b)=\operatorname{wt}(a-b)3, possibly of different dimensions, the subspace distance is

d(a,b)=wt(ab)d(a,b)=\operatorname{wt}(a-b)4

For constant-dimension codes d(a,b)=wt(ab)d(a,b)=\operatorname{wt}(a-b)5, this reduces to

d(a,b)=wt(ab)d(a,b)=\operatorname{wt}(a-b)6

The same paper gives a rank formulation,

d(a,b)=wt(ab)d(a,b)=\operatorname{wt}(a-b)7

and a refined decomposition

d(a,b)=wt(ab)d(a,b)=\operatorname{wt}(a-b)8

which separates the contribution of identifying vectors from the residual rank term (Silberstein et al., 2010).

Flag codes generalize subspace codes by using nested chains of subspaces. For two flags

d(a,b)=wt(ab)d(a,b)=\operatorname{wt}(a-b)9

of a fixed type d(C)=min{wt(c):0cC},d(C)=\min\{\operatorname{wt}(c):0\neq c\in C\},0, the flag distance is

d(C)=min{wt(c):0cC},d(C)=\min\{\operatorname{wt}(c):0\neq c\in C\},1

Because the same total d(C)=min{wt(c):0cC},d(C)=\min\{\operatorname{wt}(c):0\neq c\in C\},2 can be realized by many different componentwise patterns, the notion of a distance vector

d(C)=min{wt(c):0cC},d(C)=\min\{\operatorname{wt}(c):0\neq c\in C\},3

is introduced. Valid distance vectors are characterized by evenness, coordinate bounds, a fixed total sum, and the Lipschitz-type condition

d(C)=min{wt(c):0cC},d(C)=\min\{\operatorname{wt}(c):0\neq c\in C\},4

Distance vectors then yield structural statements about shared subspaces, generalized disjointness, and cardinality bounds for flag codes (Alonso-González et al., 2021).

For channels with overlapping reads, the Hamming metric is replaced by the d(C)=min{wt(c):0cC},d(C)=\min\{\operatorname{wt}(c):0\neq c\in C\},5-symbol metric. If d(C)=min{wt(c):0cC},d(C)=\min\{\operatorname{wt}(c):0\neq c\in C\},6, its d(C)=min{wt(c):0cC},d(C)=\min\{\operatorname{wt}(c):0\neq c\in C\},7-symbol support is

d(C)=min{wt(c):0cC},d(C)=\min\{\operatorname{wt}(c):0\neq c\in C\},8

the d(C)=min{wt(c):0cC},d(C)=\min\{\operatorname{wt}(c):0\neq c\in C\},9-symbol weight is d(C)1d(C)-10, and

d(C)1d(C)-11

For linear codes, d(C)1d(C)-12 is the minimum nonzero d(C)1d(C)-13-symbol weight. The associated Singleton-like bound is

d(C)1d(C)-14

with d(C)1d(C)-15-symbol MDS and almost MDS codes defined by equality and a deficiency of 1, respectively (Xu et al., 2023).

On finite grids d(C)1d(C)-16, the Manhattan distance

d(C)1d(C)-17

coexists with Hamming and Lee distances. The paper shows

d(C)1d(C)-18

and studies the size of Manhattan balls d(C)1d(C)-19 as a function of the center. Balls centered at corners minimize d(C)12\left\lfloor \frac{d(C)-1}{2}\right\rfloor0, while those centered at innermost points maximize it. These extremal sizes feed directly into Manhattan-metric versions of the Hamming and Gilbert–Varshamov bounds (García-Claro et al., 2022).

4. Quantum code distance, error models, and topological effects

For a qubit stabilizer code d(C)12\left\lfloor \frac{d(C)-1}{2}\right\rfloor1, the quantum code distance is the minimum weight of a Pauli operator that commutes with the stabilizer but is not itself a stabilizer: d(C)12\left\lfloor \frac{d(C)-1}{2}\right\rfloor2 In CSS codes, the distance decomposes into d(C)12\left\lfloor \frac{d(C)-1}{2}\right\rfloor3 and d(C)12\left\lfloor \frac{d(C)-1}{2}\right\rfloor4, with

d(C)12\left\lfloor \frac{d(C)-1}{2}\right\rfloor5

This makes quantum distance the minimum weight of a nontrivial logical operator rather than merely the minimum distance between vectors in a linear space (Dumer et al., 2014).

Topological quantum codes sharpen the dependence of distance on geometry and on the allowed error model. In dislocation-based surface codes with twist defects separated by lattice distance d(C)12\left\lfloor \frac{d(C)-1}{2}\right\rfloor6, an earlier estimate gave distance d(C)12\left\lfloor \frac{d(C)-1}{2}\right\rfloor7 under an error model allowing only physical d(C)12\left\lfloor \frac{d(C)-1}{2}\right\rfloor8 and d(C)12\left\lfloor \frac{d(C)-1}{2}\right\rfloor9 errors. When C(Fq)nC\subset (\mathbb{F}_q)^n0 errors are allowed, a shorter undetectable logical operator exists: local C(Fq)nC\subset (\mathbb{F}_q)^n1 patterns near the twists merge into a single C(Fq)nC\subset (\mathbb{F}_q)^n2-chain across the bulk, and the logical operator weight becomes

C(Fq)nC\subset (\mathbb{F}_q)^n3

Accordingly,

C(Fq)nC\subset (\mathbb{F}_q)^n4

This example makes explicit that quoted code distances can depend on the permitted physical errors even when the algebraic definition of distance itself does not change (Gidney, 2019).

Generalized bicycle (GB) codes provide another quantum setting in which distance depends strongly on structural constraints. A GB code is a CSS code built from two binary circulant matrices, with length C(Fq)nC\subset (\mathbb{F}_q)^n5. Unlike many simple quantum LDPC ansätze, unrestricted GB codes may have linear distance scaling. For bounded generator weight C(Fq)nC\subset (\mathbb{F}_q)^n6, however, incommensurate GB codes can be mapped to CSS codes local in dimension C(Fq)nC\subset (\mathbb{F}_q)^n7, yielding upper bounds

C(Fq)nC\subset (\mathbb{F}_q)^n8

For low-density families with row weights C(Fq)nC\subset (\mathbb{F}_q)^n9 and Bi(C)B_i(C)0, exhaustive enumeration is reported to be consistent with

Bi(C)B_i(C)1

with Bi(C)B_i(C)2 increasing with Bi(C)B_i(C)3 (Wang et al., 2022).

5. Distance constructions in highly structured families

Several families are designed specifically to preserve additional algebraic structure while retaining nontrivial distance growth. For Euclidean self-dual repeated-root cyclic codes over Bi(C)B_i(C)4, the paper constructs infinite families of lengths

Bi(C)B_i(C)5

with minimum distance

Bi(C)B_i(C)6

For Hermitian self-dual repeated-root cyclic codes over Bi(C)B_i(C)7, it constructs families of lengths

Bi(C)B_i(C)8

with

Bi(C)B_i(C)9

These are “square-root-like” distance bounds: the minimum distance is CFqnC \subseteq \mathbb{F}_q^n00 within a strongly constrained self-dual cyclic setting (Chen, 2023).

A different structural program concerns embedding ordinary binary linear codes into self-orthogonal codes. For CFqnC \subseteq \mathbb{F}_q^n01, algorithmic procedures append carefully chosen simplex columns to a generator matrix CFqnC \subseteq \mathbb{F}_q^n02 so as to obtain a self-orthogonal code of the shortest possible length, preserving the same dimension and guaranteeing a minimum distance CFqnC \subseteq \mathbb{F}_q^n03. The same work gives exact formulas for

CFqnC \subseteq \mathbb{F}_q^n04

for every CFqnC \subseteq \mathbb{F}_q^n05, and for

CFqnC \subseteq \mathbb{F}_q^n06

for all CFqnC \subseteq \mathbb{F}_q^n07 outside the congruence classes

CFqnC \subseteq \mathbb{F}_q^n08

thereby determining optimal minimum distances for large classes of self-orthogonal codes (Kim et al., 2020).

Matrix product codes furnish still another distance mechanism. If

CFqnC \subseteq \mathbb{F}_q^n09

with CFqnC \subseteq \mathbb{F}_q^n10 an CFqnC \subseteq \mathbb{F}_q^n11 matrix of rank CFqnC \subseteq \mathbb{F}_q^n12, then the minimum CFqnC \subseteq \mathbb{F}_q^n13-symbol distance satisfies

CFqnC \subseteq \mathbb{F}_q^n14

where CFqnC \subseteq \mathbb{F}_q^n15 is the minimum Hamming distance of the code generated by the first CFqnC \subseteq \mathbb{F}_q^n16 rows of CFqnC \subseteq \mathbb{F}_q^n17. When CFqnC \subseteq \mathbb{F}_q^n18 is nonsingular by columns,

CFqnC \subseteq \mathbb{F}_q^n19

This framework yields exact CFqnC \subseteq \mathbb{F}_q^n20-symbol distance formulas for Reed–Muller codes,

CFqnC \subseteq \mathbb{F}_q^n21

when CFqnC \subseteq \mathbb{F}_q^n22, and also produces CFqnC \subseteq \mathbb{F}_q^n23-symbol almost MDS families from the CFqnC \subseteq \mathbb{F}_q^n24-construction (Xu et al., 2023).

6. Computational, semidefinite, and standards-based distance analysis

The computation of code distance is itself a substantial research area. For systematic non-linear codes, Gröbner basis ideals CFqnC \subseteq \mathbb{F}_q^n25 and CFqnC \subseteq \mathbb{F}_q^n26 encode respectively the existence of codewords of weight at most CFqnC \subseteq \mathbb{F}_q^n27 and pairs of codewords at distance at most CFqnC \subseteq \mathbb{F}_q^n28. The minimum distance is the first value at which CFqnC \subseteq \mathbb{F}_q^n29 exceeds the diagonal, and the distance distribution follows recursively from the sizes of these varieties (0909.1626).

For classical and quantum linear codes, several generic numerical techniques have been adapted to distance computation. In the complexity-exponent notation

CFqnC \subseteq \mathbb{F}_q^n30

the paper surveys sliding-window, random-window, bipartition-match, and punctured-bipartition methods, then introduces a linked-cluster technique for classical and quantum LDPC codes. In an CFqnC \subseteq \mathbb{F}_q^n31-LDPC code, any minimum-weight codeword induces a connected cluster in the graph formed by code positions and shared parity checks. Enumerating only connected supports yields a complexity exponent

CFqnC \subseteq \mathbb{F}_q^n32

linear in the relative distance CFqnC \subseteq \mathbb{F}_q^n33, improving deterministic searches for the small-CFqnC \subseteq \mathbb{F}_q^n34 regime characteristic of known quantum LDPC families (Dumer et al., 2014).

Upper bounds on code size can also be sharpened by moving beyond pairwise distances. A quadruple-based semidefinite programming hierarchy defines CFqnC \subseteq \mathbb{F}_q^n35 using positive semidefiniteness constraints on matrices indexed by codes of size at most 4. This yields, among other results,

CFqnC \subseteq \mathbb{F}_q^n36

showing that the quadruply shortened Golay code is optimal, together with improved upper bounds for many other values of CFqnC \subseteq \mathbb{F}_q^n37 (Gijswijt et al., 2010).

In quasi-cyclic LDPC codes used by communication standards, minimum distance is often constrained by the protograph. For IEEE 802 QC-LDPC codes with polynomial parity-check matrix CFqnC \subseteq \mathbb{F}_q^n38 and weight matrix CFqnC \subseteq \mathbb{F}_q^n39, the Smarandache–Vontobel bound gives

CFqnC \subseteq \mathbb{F}_q^n40

so the upper bound depends only on the protomatrix and is independent of the circulant size CFqnC \subseteq \mathbb{F}_q^n41. Search-based minimum distances for multiple IEEE 802 standards are often significantly below these structural upper bounds, especially at high rates (Butler, 2016).

A recent 5G NR analysis applies related QC-LDPC distance methods to BG1 codes. For the high-rate punctured BG1 6-layer code CFqnC \subseteq \mathbb{F}_q^n42, the minimum distance is bounded by

CFqnC \subseteq \mathbb{F}_q^n43

while for the low-rate all-layer BG1 code CFqnC \subseteq \mathbb{F}_q^n44,

CFqnC \subseteq \mathbb{F}_q^n45

The same work proposes an early-termination scheme based on circulant modular reduction, reducing syndrome-calculation complexity while preserving the underlying code-distance analysis (Danilko et al., 6 Jul 2026).

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Code Distances.