Manuscript Offprint
arXiv:2609.10274Revisiting the Weight Spectrum of the Affine Grassmann Code
Abstract
Affine Grassmann codes, introduced by Beelen, Ghorpade and Høholdt, are linear codes over obtained by evaluating linear combinations of minors of a generic matrix. The weight spectrum of the affine Grassmann code was determined by Piñero and Singh via a case analysis on the rank of an associated alternating matrix. We give an independent and more streamlined derivation, valid for all and every prime power , in which each codeword is written in a compact matrix form and its Hamming weight is expressed through a single closed formula involving two explicit affine subspaces and their intersection.
Keywords: Affine Grassmann codes, Weight spectrum, Grassmann codes.
MSC2020: 94B27, 14G50
1 Introduction
Evaluation codes are linear codes obtained by evaluating a fixed vector space of functions at every point of a fixed set of points. Projective systems [TVN07] provide a useful general framework for studying such codes. A classical example is the Reed–Muller family, whose codewords are obtained by evaluating polynomials of bounded degree at every point of an affine space. Affine Grassmann codes generalize this construction by evaluating linear combinations of minors of a generic matrix at every point of the corresponding affine space over .
Let and be positive integers with , put and , and let denote the -rational points of the affine open cell of the Grassmannian defined by the nonvanishing of a chosen Plücker coordinate. In the standard local coordinates on this cell,
*Email: rohityadavau1998@gmail.com
Department of Mathematics, Indian Institute of Technology, Jammu, Jammu-181221, India.
a point of is naturally identified with an matrix over , since the coordinates are precisely the entries of such a matrix. This identification underlies the entire construction and is used throughout the paper. Under the Plücker embedding, this cell is itself a projective system \mathbb{A}^{\delta}(\mathbb{F}_q) \subseteq \mathbb{P}(\mathbb{F}_q)^{(m)}_{\ell}^{-1} (see [BGH10, Section VII]), and the resulting code, denoted , is the affine Grassmann code associated with it. When , the only minors of the generic matrix are the constant 1 and its entries, so is exactly the -ary first-order Reed–Muller code . For , the higher-order minors provide genuinely new information, and it is in this sense that affine Grassmann codes generalize first-order Reed–Muller codes (cf. [BGH10, Sec. 1]). Affine Grassmann codes were first studied by Beelen, Ghorpade and Høholdt [BGH10], who showed that is an code with
characterized its minimum weight codewords, and showed that its automorphism group is quite large. Its dual was studied in a subsequent article [BGH12], where it was described as an evaluation code of certain functions on the set of matrices.
The automorphism group of was later determined completely by Ghorpade and Kaipa [GK13], and Datta and Ghorpade [DG15] computed some of its initial and terminal generalized Hamming weights. A majority logic decoder for these codes over nonbinary fields, building on earlier work on Grassmann codes [BS21] and Schubert codes [Sin22], was proposed in [PGSY26].
Among the invariants of a code, its weight spectrum, which records the weight of every codeword together with the number of codewords of each weight, is particularly informative. It determines the weight spectrum of the dual code via the MacWilliams identities, and it governs the probability of a decoding error on a memoryless channel [MS77]. It also refines the minimum distance, since it records how many codewords lie at every distance, rather than only the smallest distance. For affine Grassmann codes, this invariant is known only when . Piñero and Singh [PS19] showed that a codeword of corresponds to an alternating matrix whose rank governs its weight, and determined the spectrum through a case analysis on that rank. The first case with , namely , was subsequently determined by the present author and Prasant Singh [SY26]. Beyond that, the weight spectrum of remains open.
In this paper, we revisit the case and give an independent proof of its weight spectrum. We replace the case analysis of [PS19] with a single closed formula expressing the Hamming weight of a codeword in terms of the sizes of two explicit affine subspaces of and their intersection. In this formula, the zero codeword and the nonzero constant codewords appear as degenerate instances, rather than as cases requiring separate treatment, and every step works uniformly over every prime power , without requiring a separate argument in characteristic two. The uniform treatment is also useful beyond the case . Specialising one row of the generic matrix carries a codeword of to a codeword of , and the closed formula proved here is the key ingredient in that reduction when (see [SY26]).
This article is organized as follows. Section 2 recalls the general construction of affine Grassmann codes and fixes the notation used throughout, and then contains our main results. Theorem 2.2 gives the unified weight formula for codewords of , Theorem 2.5 assembles the complete weight distribution, and we conclude with a worked example.
Choose an enumeration of , that is, of the matrices over . The evaluation map
is -linear and injective [BGH10], and its image is the code described in the introduction. For we write , so the Hamming weight of is simply the number of matrices at which is nonzero.
The weight distribution of was first found by Piñero and Singh [PS19]. We give an independent derivation below, which reduces the weight of a codeword to a simple point count involving two affine subspaces of and their intersection.
From now on, we fix and , so . By (1.1), then has length and dimension . When , the matrix has only two rows, so its minors reduce to the entries themselves and the minors , and every therefore has a unique expression
with .
To these coefficients, we attach the vectors
and the matrix with
Thus, is alternating, meaning that and all diagonal entries are zero. (In characteristic two, alone would not force the diagonal to vanish. Here it does so automatically, since the entries of come directly from the minors.)
Let and denote the transpose of the first row and the second row of , respectively. A direct expansion of then gives
Conversely, for every choice of , , and an alternating , there exists a unique giving rise to these parameters, as is confirmed by the parameter count
Since a point of is, for , a matrix with exactly two rows, evaluating at such a point amounts to assigning values to and , and we may therefore identify the evaluation points of with pairs , where is the transpose of the first row and is the second row of the matrix. By (2.1),
Thus, for fixed , the function is affine in , with linear part and constant term . This observation is the key to the weight computation.
We now distinguish the values of u for which the linear part vanishes from those for which the constant term vanishes.
Both sets are affine subspaces of , although either one may be empty. Here gives a linear map from to itself, while gives a linear functional on . Put
Since is alternating, its rank is even, say rank with , so . The next lemma determines the possible values of and .
Lemma 2.1. With the notation above, the following hold.
(1) We have if and only if . In that case for any with , so
(2) If , then M=0 when , and M=N when .
(3) Let and , and fix as in (1). Then if and only if , and in that case , where
Hence takes values in , and the last value occurs only when .
Proof. (1) The condition says . This is solvable if and only if lies in the image of the linear map . The solution set of an inhomogeneous linear system, when nonempty, is a coset of the kernel. So and .
(2) If , then for , and for . Both claims are immediate.
(3) Let , so with and . A point can be written as with and . Thus, if and only if . Since is a hyperplane, there are two possibilities for the relative position of and . If , then . If , then , so the condition holds automatically. In the first case, is equivalent to , or equivalently, . In the second case, implies , so is always nonempty.
In either case, choose . Then and , because a coset is unchanged when its representative is replaced by any of its elements. Hence and . Finally, is the intersection of with the hyperplane . So its dimension is if , and otherwise.
Theorem 2.2. Let and let . With and as above,
Explicitly, if rank , then takes one of the three values
Proof. We split the sum defining the weight according to whether :
Let . Then , so by (2.2) the map is a nonconstant affine function of . Its zero set is a coset of the hyperplane , so it has elements. Hence
and the contribution from is .
Now let . Then , so (2.2) reduces to the constant , which does not depend on . Therefore, equals if , and 0 if . Hence the contribution from is .
Adding the two contributions,
which is (2.3). Substituting the possible values of and from Lemma 2.1 gives the explicit list. If , then , so the formula gives . If , then . The three substitutions give , then , and finally .
Remark 2.3. Formula (2.3) also covers the two degenerate codewords, so they need no separate discussion. If , then , , and , so and , which gives . If is a nonzero constant codeword, then and , so and , which gives . Both cases are included in the part of the explicit list in Theorem 2.2.
For , set
where denotes the Gaussian binomial coefficient. The next lemma identifies these three quantities. Recall that a subspace of dimension is the kernel of some alternating matrix of rank 2r.
Lemma 2.4. The following hold.
(1) The quantity counts the nondegenerate alternating matrices over . Equivalently, for a fixed subspace of dimension , it is the number of alternating matrices of rank with .
(2) The quantity counts the alternating matrices of rank , and .
(3) For a fixed nonzero , the quantity counts the alternating matrices of rank with .
Proof. (1) An alternating matrix of rank with kernel corresponds to a nondegenerate alternating form on the -dimensional quotient . The number of nondegenerate alternating matrices is given by the classical formula .
(2) To choose an alternating matrix of rank , we first choose its kernel, a subspace of dimension , and then choose a nondegenerate alternating form on the quotient. There are choices for the kernel, so by (1). Every alternating matrix has even rank, so summing over all admissible values of counts all alternating matrices.
(3) The kernel is a hyperplane, so it has dimension . By the same argument, the number of admissible kernels is .
For , write
and , and let denote the number of codewords of of weight . Combining Theorem 2.2 with Lemma 2.4 now gives the complete weight distribution of .
Theorem 2.5. The weights , , and , for , are pairwise distinct, and together they exhaust the weights of . Moreover,
In particular, r = 0 gives with , and with .
Proof. We have for every . Also determines , because the exponents and are strictly decreasing in . So the listed weights are pairwise distinct, and by Theorem 2.2 every codeword has one of these weights. It remains to count the codewords of each weight.
Fix and an alternating of rank . By Lemma 2.1(1), we have for exactly of the vectors , namely those with . For the remaining vectors, we have . When , the weight is necessarily . We therefore restrict to the vectors for which and count the codewords of weights and . By Theorem 2.2, these are the codewords with and with respectively. The remaining possibility, , also gives the weight .
First, let . By Lemma 2.1(2), we get when , and when . Choose one of the alternating matrices of rank and one of the admissible vectors . Taking gives one codeword of weight , while taking gives codewords of weight . Thus, this case contributes codewords of weight and codewords of weight .
Now let . By Lemma 2.1(3), the case requires . When , we always have , which gives the weight . So assume . By Lemma 2.4(3), there are such for each of the choices of . Fix such a pair, fix one of the admissible vectors , and let satisfy . Since , the value does not depend on the choice of . So, by Lemma 2.1(3), the condition reads . This condition holds for exactly one of the possible values of and fails for the remaining values. The unique value giving produces the weight , whereas the remaining values give and hence the weight . Thus, this case contributes codewords of weight and codewords of weight .
Adding the two cases gives . In both cases, the number of codewords of weight is times that of weight , since has possible nonzero values in the former case and a unique value in the latter. Hence . Finally, , so there are codewords in all. Then is what remains after removing, for each , the codewords of weight .
For , we have , so and . Hence and , while and . These are the zero codeword and the nonzero constants.
Example 2.6. Let and , so . Then has length and codewords. In this case, . For , we get the weights 0 and 729, with multiplicities 1 and 2, respectively. For , where all Gaussian binomial coefficients are evaluated at , we get , and . Hence and , with and . Finally, . Thus, the five weights 0, 432, 486, 513, 729, with multiplicities 1, 2106, 52728, 4212, 2, account for all 59049 codewords.
Remark 2.7. By Theorem 2.5, has exactly distinct weights, compared with for the Grassmann code itself [Nog96]. Thus, passing to the affine cell gives approximately twice as many distinct weights. The weight formula (2.3) obtained here is used in [SY26] to determine the weight spectrum of , the first affine Grassmann code with . In that work, specialising one row of the generic matrix reduces a codeword of to a codeword of , and it is precisely this formula that makes the reduction work.
Acknowledgment
The author would like to thank Prasant Singh for useful discussions on this problem.
References
[BGH10] Peter Beelen, Sudhir R. Ghorpade, and Tom Høholdt, Affine Grassmann codes, IEEE Trans. Inform. Theory 56 (2010), no. 7, 3166–3176. MR2798982 ↑2, 3
[BGH12] ______, Duals of affine Grassmann codes and their relatives, IEEE Trans. Inform. Theory 58 (2012), no. 6, 3843–3855. MR2924405 ↑2
[BS21] Peter Beelen and Prasant Singh, Point-line incidence on Grassmannians and majority logic decoding of Grassmann codes, Finite Fields Appl. 73 (2021), Paper No. 101843, 24. MR4241603 ↑2
[DG15] Mrinnoy Datta and Sudhir R. Ghorpade, Higher weights of affine Grassmann codes and their duals, Algorithmic arithmetic, geometry, and coding theory, 2015, pp. 79–91. MR3364443 ↑2
[GK13] Sudhir R. Ghorpade and Krishna V. Kaipa, Automorphism groups of Grassmann codes, Finite Fields Appl. 23 (2013), 80–102. MR3061086 ↑2
[MS77] F. J. MacWilliams and N. J. A. Sloane, The theory of error-correcting codes. I, North-Holland Mathematical Library, vol. Vol. 16, North-Holland Publishing Co., Amsterdam-New York-Oxford, 1977. MR465509 ↑2
[Nog96] D. Yu. Nogin, Codes associated to Grassmannians, Arithmetic, geometry and coding theory (Luminy, 1993), 1996, pp. 145–154. MR1394931 ↑9
[PGSY26] Fernando Piñero González, Prasant Singh, and Rohit Yadav, Majority logic decoding of affine Grassmann codes over nonbinary fields, Des. Codes Cryptogr. 94 (2026), no. 8, Paper No. 174. MR5107461 ↑2
[PS19] Fernando Piñero and Prasant Singh, The weight spectrum of certain affine Grassmann codes, Des. Codes Cryptogr. 87 (2019), no. 4, 817–830. MR3923598 ↑2, 3
[Sin22] Prasant Singh, Majority logic decoding for certain Schubert codes using lines in Schubert varieties, IEEE Trans. Inform. Theory 68 (2022), no. 2, 795–805. MR4395442 ↑2
[SY26] Prasant Singh and Rohit Yadav, The weight spectrum of the affine grassmann code , arXiv (2026). MR2609.08784 ↑2, 3, 9
[TVN07] Michael Tsfasman, Serge Vlădut, and Dmitry Nogin, Algebraic geometric codes: basic notions, Mathematical Surveys and Monographs, vol. 139, American Mathematical Society, Providence, RI, 2007. MR2339649 ↑1