## Description

A linear \(q\)-ary code whose codewords all have one of two possible nonzero Hamming weights.

## Protection

Bounds on two-weight codes are known [1] along with complete weight enumerators [2]. Sizes of maximal two-weight, three-weight, and four-weight binary codes have been determined [3].

There is a classification of two-weight codes of length 40 [4] as well as of \([n,m,d]_q\) codes with the two weights \(n,d\) [5].

## Notes

See [6,7] for overviews of two-weight codes and Refs. [8,9] for examples.There are relations between two- and three-weight codes and Bent functions [10]; see [11; Ch. 18].

## Parent

## Child

## Cousins

- Divisible code — Two-weight codes are \(m\)-divisible, where \(m\) is the greatest common factor of their two possible weights.
- Projective geometry code — There are several correpondences between projective and two-weight codes [5,7,12].
- Weight-two code — Codewords of two-weight codes have one of two possible Hamming weights, while those of weight-two codes have Hamming weight two.
- \(q\)-ary simplex code — \(q\)-ary MacDonald codes are the unique two-weight codes with weights \(q^{m-1}-q^{m-1}\) and \(q^{m-1}\) [13].

## References

- [1]
- P. G. Boyvalenkov et al., “On two-weight codes”, (2020) arXiv:2005.13623
- [2]
- C. Zhu and Q. Liao, “Complete weight enumerators for several classes of two-weight and three-weight linear codes”, (2021) arXiv:2107.02447
- [3]
- A. Barg et al., “On the size of maximal binary codes with 2, 3, and 4 distances”, (2022) arXiv:2210.07496
- [4]
- I. Bouyukliev, M. Dzhumalieva-Stoeva, and V. Monev, “Classification of Binary Self-Dual Codes of Length 40”, IEEE Transactions on Information Theory 61, 4253 (2015) DOI
- [5]
- D. Jungnickel and V. D. Tonchev, “The classification of antipodal two-weight linear codes”, Finite Fields and Their Applications 50, 372 (2018) DOI
- [6]
- A. E. Brouwer, "Two-weight Codes." Concise Encyclopedia of Coding Theory (Chapman and Hall/CRC, 2021) DOI
- [7]
- R. Calderbank and W. M. Kantor, “The Geometry of Two-Weight Codes”, Bulletin of the London Mathematical Society 18, 97 (1986) DOI
- [8]
- A. Cossidente and O. H. King, “Some two-character sets”, Designs, Codes and Cryptography 56, 105 (2010) DOI
- [9]
- A. Cossidente and G. Marino, “Veronese embedding and two–character sets”, Designs, Codes and Cryptography 42, 103 (2006) DOI
- [10]
- Z. Zhou et al., “Linear Codes with Two or Three Weights From Quadratic Bent Functions”, (2015) arXiv:1506.06830
- [11]
- S. Mesnager, Bent Functions (Springer International Publishing, 2016) DOI
- [12]
- A. E. Brouwer and M. van Eupen, Designs, Codes and Cryptography 11, 261 (1997) DOI
- [13]
- A. Patel, “Maximal&lt;tex&gt;q&lt;/tex&gt;-nary linear codes with large minimum distance (Corresp.)”, IEEE Transactions on Information Theory 21, 106 (1975) DOI

## Page edit log

- Victor V. Albert (2023-04-15) — most recent

## Cite as:

“Two-weight code”, The Error Correction Zoo (V. V. Albert & P. Faist, eds.), 2023. https://errorcorrectionzoo.org/c/two_weight