arXiv:2608.26457cs.ITAug 2026

Manuscript Offprint

arXiv:2608.26457

Weight Distributions of Single Parity-Check Product Codes via Character Sums

Makson Miller Alves Ribeiro, Sara D. Cardell

Abstract

We investigate structural and enumerative properties of binary single parity-check product codes. For each n≥2n \geq 2, SPC(n)\text{SPC}(n) denotes the binary single parity-check code of length nn, consisting of all binary vectors of length nn having even Hamming weight. We determine the generalized Hamming weight hierarchy of the product code Cm,n=SPC(m)⊗SPC(n)\mathcal{C}_{m,n} = \text{SPC}(m) \otimes \text{SPC}(n), whose codewords can be represented as m×nm \times n binary matrices in which every row and every column has even Hamming weight. For the square product Cn=SPC(n)⊗SPC(n)\mathcal{C}_n = \text{SPC}(n) \otimes \text{SPC}(n), we also determine the maximum codeword weight and prove that its homogeneous weight enumerator is symmetric if and only if nn is even. After characterizing the dual code, we apply the MacWilliams identity in its Walsh–Hadamard formulation to derive an exact closed-form expression for the weight enumerator. By grouping the auxiliary binary vectors according to their Hamming weights, we obtain an explicit formula for each coefficient in terms of binomial coefficients and alternating convolutions. Finally, using Krawtchouk polynomials, we present an exact procedure for computing the full weight distribution without exhaustively enumerating all codewords. Numerical examples illustrate the formulas and verify the resulting computations.

Keywords: Product codes, single parity-check codes, weight enumerators, weight distributions, character sums, Walsh–Hadamard transform, generalized Hamming weights.

MSC Classification: 94B05, 05A15, 43A25

1 Introduction

The weight distribution is one of the fundamental invariants of a linear code. It records the number of codewords of each Hamming weight and, in particular, determines the minimum distance of the code. Weight enumerators also play an important role in the study of duality, decoding performance, and combinatorial identities associated with linear codes (see, for example, [1, 2]). Despite their importance, determining the full weight distribution of a linear code is generally a difficult problem. Indeed, a direct computation for a binary linear code of dimension K may require examining all its 2K2^K codewords, and the structure of a generator or parity-check matrix does not usually lead immediately to a closed formula.

Product codes, introduced by Elias [3], form a natural family of linear codes obtained by imposing the constraints of shorter component codes along different dimensions of an array. The binary single parity-check code of length nn, denoted by SPC(n)\text{SPC}(n), consists of all vectors in F2n\mathbb{F}_2^n having even Hamming weight. It has parameters [n,n−1,2]2[n, n-1, 2]_2. For integers m,n≥2m, n \geq 2, we consider the product code Cm,n=SPC(m)⊗SPC(n)\mathcal{C}_{m,n} = \text{SPC}(m) \otimes \text{SPC}(n). This is a binary linear code with parameters [mn,(m−1)(n−1),4]2[mn, (m-1)(n-1), 4]_2, whose codewords can be represented as m×nm \times n binary matrices in which every row and every column has even Hamming weight. When m=nm = n, we write Cn=Cn,n\mathcal{C}_n = \mathcal{C}_{n,n}.

Single parity-check product codes have been studied in connection with iterative decoding and their performance over different communication channels [4–7]. Several works have also addressed weight enumeration for product codes. Tolhuizen [8] characterized certain families of low-weight codewords and expressed their multiplicities in terms of the weight distributions of the component codes. El-Khamy and Garello [9] observed that the full weight enumerator remains unknown for most product codes and developed average weight-enumerator approximations. The weight distribution and asymptotic behavior of iterated single parity-check product codes were studied by Caire, Taricco, and Battail [5]. These results illustrate both the importance of weight enumeration for product codes and the difficulty of obtaining exact finite-length formulas.

Another invariant considered in this work is the generalized Hamming weight hierarchy. Generalized Hamming weights, introduced by Wei [10], extend the notion of minimum distance by measuring the smallest support of a subcode of a prescribed dimension. They provide a finer description of the support structure of a linear code and have applications, among others, to information security and wiretap channels. For product codes whose components satisfy the chain condition, a formula for the generalized Hamming weights was conjectured by Wei and Yang [11] and proved by Schaathun [12]; see also the extension obtained by Martínez-Pérez and Willems [13]. Since binary single parity-check codes satisfy this condition, the formula provides an explicit description of the complete generalized Hamming weight hierarchy of their product codes.

Determining the coefficient AwA_w in the weight enumerator of Cm,n\mathcal{C}_{m,n} is equivalent to counting the m×nm \times n binary matrices containing exactly ww entries equal to one and having even row and column sums. Although each individual parity condition is elementary, their simultaneous imposition makes the enumeration nontrivial. Every matrix entry participates in both a row constraint and a column constraint, and the complete family of m+nm+n parity equations contains a global linear dependency. Moreover, direct enumeration requires considering all 2(m−1)(n−1)2^{(m-1)(n-1)} codewords, which rapidly becomes impractical as the component lengths increase.

We first apply the product formula for codes satisfying the chain condition to determine the generalized Hamming weight hierarchy of Cm,n\mathcal{C}_{m,n}. For the square product Cn\mathcal{C}_n, we also determine the maximum possible Hamming weight of a codeword. It is equal to n2n^2 when nn is even and to n2−nn^2 - n when nn is odd. As a consequence, we prove that the homogeneous weight enumerator of Cn\mathcal{C}_n is symmetric if and only if nn is even.

Our main enumerative result is an exact closed-form expression for the weight enumerator of Cm,n\mathcal{C}_{m,n}. We first characterize its dual code and then apply the MacWilliams identity in its Walsh–Hadamard formulation. The dual codewords are parametrized by two auxiliary binary vectors, and their Hamming weights depend only on the weights of these vectors. Grouping the corresponding terms according to these two weights reduces the expression to a double sum and yields explicit formulas for both the homogeneous and one-variable weight enumerators. Expanding the resulting expression also provides a formula for every coefficient AwA_w in terms of binomial coefficients and alternating convolutions.

The structure of the coefficient formula leads to an exact computational procedure. Terms producing the same contribution are first grouped together, after which the coefficients are evaluated using a recurrence for binary Krawtchouk polynomials. For a code of length N=mnN = mn, the resulting procedure requires at most O(N2)O(N^2) arithmetic operations and O(N)O(N) auxiliary memory, while avoiding the enumeration of the 2(m−1)(n−1)2^{(m-1)(n-1)} codewords. Numerical examples for different component lengths illustrate the formulas and provide consistency checks for the computed weight distributions.

The remainder of the paper is organized as follows. We first recall the necessary background on linear codes, single parity-check codes, product codes, generalized Hamming weights, additive characters, the Walsh–Hadamard transform, and the MacWilliams identity. We then study the generalized Hamming weights, maximum weight, and symmetry properties of single parity-check product codes. Next, we derive the closed-form expression for the weight enumerator and its coefficients. The computational procedure based on Krawtchouk polynomials is subsequently presented together with numerical examples. Finally, we summarize the main results and indicate possible directions for further research.