The Hamming weight of a string of bits is the number of 1's in it. For instance, the Hamming weight of 11101 is 4. The term was named after Richard Hamming.
The Hammingweight of a string is its Hamming distance from the zero string (string consisting of all zeros) of the same length.
The Hamming distance of binary strings is also equivalent to the Manhattan distance between two vertices in an n-dimensional hypercube, where n is the length of the words.
Hammingweight analysis of bits is used in several disciplines including information theory, coding theory, and cryptography.
Determine the weight distribution for the code C. The distribution is returned in the form of a sequence of tuples, where the i-th tuple contains the i-th weight, w_i say, and the number of codewords having weight w_i.
This function applies the MacWilliams transform to W to obtain the weight distribution W' of the dual code of C. The transform is a combinatorial algorithm based on n, k, q and W alone.
The complete weight enumerator (W)_C(z_0,..., z_(q - 1)) for the linear code C where q is the size of the alphabet K of C. Let the q elements of K be denoted by omega _0,..., omega _(q - 1).