Here is a list of codes whose codewords have constant weight.
| Code | Description |
|---|---|
| Balanced code | An even-length-\(n\) \(q\)-ary code whose nonzero codewords all have a Hamming weight of \(n/2\). A code is \(\epsilon\)-balanced if the relative weight (i.e., weight divided by \(n\)) of all nonzero codewords lies in the interval \([\frac{1-\epsilon}{2},\frac{1+\epsilon}{2}]\). A code is \(\gamma\)-unbiased if the relative weight lies in the interval \((\frac{1}{2}-\frac{1}{n^{\gamma}},\frac{1}{2}+\frac{1}{n^{\gamma}})\). |
| Binary balanced spherical code | An \((n-1,K,\frac{nd}{nw-w^2})\) spherical code obtained from a constant-weight-\(w\) binary \((n,K,d)\) code via the component-wise binary balanced mapping. |
| Combinatorial design | A constant-weight binary code that is mapped into a combinatorial \(t\)-design. |
| Constant-dimension code | A subspace code whose codewords are \(k\)-dimensional subspaces of \(\mathbb{F}_q^n\) for fixed \(k\). Constant-dimension codes are equivalent to linear authentication codes [1; Thm. 4.1]. |
| Constant-excitation (CE) code | Code whose codewords lie in an excited-state eigenspace of a Hamiltonian governing the total energy or total number of excitations of the underlying quantum system. For qubit codes, such a Hamiltonian is often the total spin Hamiltonian, \(H=\sum_i Z_i\). For spin-\(S\) codes, this generalizes to \(H=\sum_i J_z^{(i)}\), where \(J_z\) is the spin-\(S\) \(Z\)-operator. For bosonic (and, similarly, for fermion) codes, such as Fock-state codes, codewords are often in an eigenspace with eigenvalue \(N>0\) of the total excitation or energy Hamiltonian, \(H=\sum_i \hat{n}_i\). |
| Constant-weight block code | A block code whose codewords all have the same number of nonzero coordinates. Code constructions exist for codes over fields [2] or rings [3]. |
| Constant-weight code | A binary code whose codewords are all constrained to have the same Hamming weight \(w\). In the linear setting, this usually refers to all nonzero codewords having the same weight, since every linear code contains the zero codeword. |
| Divisible code | A linear \(q\)-ary block code is \(\Delta\)-divisible if the Hamming weight of each of its codewords is divisible by divisor \(\Delta\). A \(2\)-divisible (\(4\)-divisible, \(8\)-divisible) code is called even (doubly even, triply even) [4,5]. A code is called singly even if all codewords are even and at least one has weight equal to 2 modulo 4. More generally, a code is \(m\)-even if it is \(2^{m}\)-divisible. |
| Hadamard code | An \([2^m,m,2^{m-1}]\) balanced binary code. The \([2^m,m+1,2^{m-1}]\) augmented Hadamard code is the first-order RM code (a.k.a. RM\((1,m)\)), while the \([2^m-1,m,2^{m-1}]\) shortened Hadamard code is the simplex code (a.k.a. RM\(^*(1,m)\)). |
| Linear \(q\)-ary code | An \((n,K,d)_q\) linear code is denoted as \([n,k,d]_q\), where \(k=\log_q K\) need not be an integer. Its codewords form a linear subspace, i.e., for any codewords \(x,y\), \(\alpha x+ \beta y\) is also a codeword for any \(q\)-ary digits \(\alpha,\beta\). This extra structure yields much information about their properties, making them a large and well-studied subset of codes. |
| Linear binary code | An \((n,2^k,d)\) linear code is denoted as \([n,k]\) or \([n,k,d]\), where \(k\) is the code’s dimension, and where \(d\) is the code’s distance. Its codewords form a linear subspace, i.e., for any codewords \(x,y\), \(x+y\) is also a codeword. A code that is not linear is called nonlinear. |
| Linear code over \(\mathbb{Z}_q\) | A code encoding \(K\) states (codewords) in \(n\) coordinates over the ring \(\mathbb{Z}_q\) of integers modulo \(q\) that forms an Abelian subgroup of \(\mathbb{Z}_q^n\) under addition. Since addition of \(m\) identical elements is equivalent to multiplying by \(m\), linear codes over \(\mathbb{Z}_q\) are automatically closed under scalar multiplication. More technically, linear codes over \(\mathbb{Z}_q\) are submodules of \(\mathbb{Z}_q^n\). |
| One-hot code | A nonlinear binary code whose codewords are all those with Hamming weight one. The reverse of this code, where all codewords have Hamming weight \(n-1\) is called a one-cold code. |
| One-versus-one (OVO) code | A length-\(n\) ternary code over \(\{\pm 1,0\}\) whose whose generator matrix has columns with one \(+1\), one \(-1\), and with the rest of the entries zero. |
| Two-in-five code | A nonlinear binary code consisting of the 10 weight-two five-bit strings, thereby providing an encoding for the decimal digits 0 through 9. |
| Two-weight code | A linear \(q\)-ary code whose codewords all have one of two possible nonzero Hamming weights. |
| Universally optimal \(q\)-ary code | A \(q\)-ary code that (weakly) minimizes all completely monotonic potentials on Hamming space [6]. |
| Weight-two code | A length-\(n\) binary code whose codewords all have Hamming weight two. Such codes provide slightly extra redundancy for storage of small-scale information such as ZIP codes or decimal digits. |
| \([2^m-1,m,2^{m-1}]\) simplex code | A member of the equidistant code family that is dual to the \([2^m-1,2^m-m-1,3]\) Hamming family. The columns of its generator matrix are in one-to-one correspondence with the elements of the projective space \(PG(m-1,2)\), with each column being a chosen representative of the corresponding element. Simplex codes saturate the Plotkin bound and hence have nonzero codewords all of the same weight, \(2^{m-1}\) [7; Th. 11(a)]. The codewords form a \((2^m,2^m+1)\) simplex spherical code under the antipodal mapping. |
| \([7,3,4]\) simplex code | Second-smallest nontrivial member of the simplex-code family. The columns of its generator matrix are in one-to-one correspondence with the elements of the projective space \(PG(2,2)\), with each column being a chosen representative of the corresponding element. The codewords form a \((8,9)\) simplex spherical code under the antipodal mapping. As a simplex code, it is equidistant: every nonzero codeword has Hamming weight \(4\). |
| \(q\)-ary code over \(\mathbb{Z}_q\) | A code encoding \(K\) states (codewords) in \(n\) coordinates over the ring \(\mathbb{Z}_q\) of integers modulo \(q\). |
| \(q\)-ary simplex code | An \([n,m,q^{m-1}]_q\) equidistant projective code with \(n=\frac{q^m-1}{q-1}\), denoted as \(S(q,m)\). The columns of the generator matrix are in one-to-one correspondence with the elements of the projective space \(PG(m-1,q)\), with each column being a chosen representative of the corresponding element. All nonzero simplex codewords have a constant weight of \(q^{m-1}\) [8,9]. |
References
- [1]
- Huaxiong Wang, Chaoping Xing, and R. Safavi-Naini, “Linear authentication codes: bounds and constructions”, IEEE Transactions on Information Theory 49, 866 (2003) DOI
- [2]
- Fang-Wei Fu, A. J. Han Vinck, and Shi-Yi Shen, “On the constructions of constant-weight codes”, IEEE Transactions on Information Theory 44, 328 (1998) DOI
- [3]
- J. A. Wood, “The structure of linear codes of constant weight”, Transactions of the American Mathematical Society 354, 1007 (2001) DOI
- [4]
- S. Kurz, “Divisible Codes”, (2025) arXiv:2112.11763
- [5]
- J. H. Conway and N. J. A. Sloane, Sphere Packings, Lattices and Groups (Springer New York, 1999) DOI
- [6]
- H. Cohn and Y. Zhao, “Energy-Minimizing Error-Correcting Codes”, IEEE Transactions on Information Theory 60, 7442 (2014) arXiv:1212.1913 DOI
- [7]
- F. J. MacWilliams and N. J. A. Sloane. The theory of error correcting codes. Elsevier, 1977.
- [8]
- A. E.F. Jr. and H. F. Mattson, “Error-correcting codes: An axiomatic approach”, Information and Control 6, 315 (1963) DOI
- [9]
- E. Weiss, “Linear Codes of Constant Weight”, SIAM Journal on Applied Mathematics 14, 106 (1966) DOI