1 Introduction
Let be a prime power. Due to their elegant algebraic properties and connections to finite geometry, ary ReedMuller codes are longstanding research objects in coding theory, see [7, Chapters 13,14,15] for and [1, Section 5] for general . Moreover, second order ary ReedMuller codes are of particular interest, since they contain some famous subcodes such as Kerdock codes [7, Chapter 15, Section 5] and the wellrounded theory of quadratic forms over finite fields can be applied.
The weight distribution is a fundamental parameter of ReedMuller codes. For second order ary ReedMuller codes, their weight distributions have been computed in [11] for and in [8] for general . Unfortunately, as observed in [5, p. 2559], there are some errors and typos in the computation of [8] (some essential errors are spotted in Tables 4,8,10 and typos in Tables 3,6). Hence, in this paper, we aim to provide a precise account for the weight distribution of second order ary ReedMuller codes, with being a prime power. An outline is as follows, where the second order ary ReedMuller is denoted by .

Observe that is a disjoint union of cosets of the repetition code (when ) or cosets of the first order ReedMuller code (when ), where the coset representatives are exactly all quadratic forms from to (see (3.2)).

When , the weight distribution of each coset follows from the number of zeroes to a quadratic form (Proposition 2.9). When , the weight distribution of each coset can be derived from the results in [5] (Propositions 2.6, 2.7, 2.8 and 3.1). In both cases, the weight distribution of each coset depends only on the rank and type of the quadratic form, which is the coset representative. We remark that the canonical quadratic forms and related terminologies used in [5] are different from those in this paper. Thus, in order to employ the results in [5], we need to build the correspondence between different canonical quadratic forms and terminologies at first (Table 2.1).

The number of quadratic forms from to , with given rank and type, has been obtained by McEliece [8], following which we can compute the frequency of each weight in .
In addition, using a similar idea, the weight distributions of second order ary homogeneous ReedMuller codes and second order ary projective ReedMuller codes are also computed.
2 Quadratic forms over finite fields
The mathematical mechanism behind second order ReedMuller codes is the theory of quadratic forms over finite fields. In this section, we introduce some background knowledge about quadratic forms over finite fields.
Let be an
dimensional vector space over
. A quadratic form defined on is a function from to , such that
For each and , .

For each , , where is a symmetric bilinear form associated with .
For a symmetric bilinear form defined on , the radical of is defined to be
which is a vector space over . For a quadratic form defined on , the radical of is a vector space over , namely,
where is the symmetric bilinear form associated with . The rank of is defined to be
Let be a quadratic form defined on , then has the following unique representation
Let and be two quadratic forms defined on . They are equivalent if there exists an invertible matrix over , such that for each ,
Thus, two quadratic forms are equivalent, if one can be transformed into the other, by applying an invertible linear transformation on the variables.
Quadratic forms over finite fields have been classified in the sense that each quadratic form is equivalent to a canonical one. Following
[8, Table 1], we describe the canonical quadratic forms over finite fields with even and odd characteristic in the next two propositions. Note that we use Tr to denote the absolute trace function defined on a finite field.Proposition 2.1.
Let be an even prime power. For , each quadratic form from to with rank is equivalent to one of the following canonical quadratic forms.
If is odd,

.
If is even,

.

, where is a nonzero element of and satisfies .
Proposition 2.2.
Let be an odd prime power. For , each quadratic form from to with rank is equivalent to one of the following canonical quadratic forms.
If is odd,

.

, is a nonsquare of .
If is even,

.

, is a nonsquare of .
Now, we are ready to define the type of a quadratic form.
Definition 2.3.
Let be a quadratic form over .
A zero quadratic form, whose rank is , is defined to be of type .
Combining Propositions 2.1 and 2.2, we can see that up to equivalence, a quadratic form over finite field is determined by its rank and type, except when is even and has odd rank, in which the rank solely determines the quadratic form.
Next, we introduce more notations. For and , we use to denote the number of quadratic forms from to , with rank and type . We use to denote the number of quadratic forms from to , with rank and type . Moreover, for , we use to denote the number of quadratic forms from to with rank . Considering the action of orthogonal groups on quadratic forms over finite fields, the numbers and have been obtained in [8].
Proposition 2.4 ([8, Table 3]).
For quadratic forms from to , we have the following.

and

. For and ,
Remark 2.5.
Let be a function from to . Define
Let be the set of all linear functions from to . For each , define to be a constant function from to , which sends each element of to . Let be a quadratic form from to . For each , the multiset
has been computed in [5, Appendix A]. Consequently, we can determine the multiset
which will be used in the computation of weight distributions. It is worthy noting that when is odd, we used different canonical quadratic forms in [5]. Thus, in order to exploit Proposition 2.4 and the results in [5, Appendix A], we have to establish the correspondence between the canonical quadratic forms in [5, Proposition 3.8] and those in Propositions 2.1 and 2.2. Indeed, the relation is summarized in Table 2.1. The proof of this relation is technical and included in the Appendix.
terminologies of  terminologies of  
canonical quadratic forms  canonical quadratic forms  
in Definition 2.3  in [5, Proposition 3.8]  
even  odd rank  odd rank , type 
even rank , type  even rank , type  
even rank , type  even rank , type  
odd  odd rank , type ,  odd rank , type 
even rank , type ,  even rank , type 
When is odd, we use to denote the set of nonzero squares in and the set of nonsquares in . Following Table 2.1, we can rephrase [5, Lemmas A.2, A.4] in the next two propositions.
Proposition 2.6.
Let be an even prime power and a quadratic form from to . Let be the set of all linear functions from to and . Suppose ranges over . Then the following holds.
(1) Let have odd rank . If , then
If , then
(2) Let have even rank and type . If , then
If , then
Proposition 2.7.
Let be an odd prime power and a quadratic form from to . Let be the set of all linear functions from to and . Suppose ranges over . Then the following holds.
(1) Let have odd rank and type . If , then
If , then
If , then
(2) Let have even rank and type . If , then
If , then
Let be a quadratic form from to and , Propositions 2.6 and 2.7 describe the multiset
Now we are ready to determine the multiset . The following result follows from Propositions 2.6 and 2.7.
Proposition 2.8.
Let be a quadratic form from to . Suppose ranges over . Then the following holds.

If has odd rank , then

If has even rank and type , then
Note that when has odd rank, the multiset does not depend on the type of .
We finally mention the following well known result concerning , where is a quadratic form from to .
Proposition 2.9.
Let be a quadratic form from to . We have
3 The weight distribution of second order ReedMuller codes and their relatives
In this section, we compute the weight distributions of second order ReedMuller codes and their relatives. For this purpose, a brief introduction to ReedMuller codes, homogeneous ReedMuller codes and projective ReedMuller codes is also included. For a more detailed treatment, see [1, Section 5], [7, Chapters 13,14,15] for ReedMuller codes, [9] for homogeneous ReedMuller codes and [3, 4, 10] for projective ReedMuller codes. For the basic knowledge of coding theory, please refer to [7]. We only mention a few notations below.
Let be a code of length . For , is the Hamming weight of the codeword . For , we use to denote the number of codewords in with Hamming weight . The sequence is called the weight distribution of . The weight enumerator of is a polynomial , which gives a compact expression of the weight distribution.
3.1 ReedMuller codes
Let be a prime power. Let be an dimensional vector space over . We use to denote the vector space of all polynomials over with variables and degree at most . Let , the th order ary ReedMuller code of length is defined as
which is denoted by . In particular, when , the second order ary ReedMuller code has the following parameters [1, Theorem 5.4.1, Corollary 5.5.4]:
(3.1) 
We use and to denote the allzero and allone vector of length over . Let be the set of all quadratic forms from to . By definition, the second order ReedMuller code can be decomposed into a disjoint union of cosets:
(3.2) 
Note that when , we have for each . Thus, each linear function from to is actually a quadratic form. This explains the distinct decompositions in (3.2) for and , as well as the different dimensions in (3.1).
Thus, to compute the weight distribution of , it suffices to compute the weight distribution of or , for each . The following proposition says the weight distribution of depends only on the rank and type of .
Proposition 3.1.
Let be a quadratic form from to . Suppose ranges over . Then the following holds.

If has odd rank , then

If has even rank and type , then
Proof.
Recall that is the set of all linear functions from to . By definition, the first order ReedMuller code
Thus, the weight distribution of is the multiset
Therefore, the conclusion follows from Proposition 2.8. ∎
Now we are ready to compute the weight distribution of second order ReedMuller codes.
Theorem 3.2.
Proof.
Weight  Frequency 

Weight  Frequency 

,  
,  
,  
,  
Remark 3.3.
Example 3.4.
Numerical experiment shows that the second order binary ReedMuller code has weight enumerator
which is consistent with Table 3.1.
Example 3.5.
Numerical experiment shows that the second order ternary ReedMuller code has weight enumerator
which is consistent with Table 3.2.
3.2 Homogeneous ReedMuller codes
Some variations of ReedMuller codes were discussed in the literature. As an attempt to find subcodes of ReedMuller codes with large minimum distances, the concept of homogeneous ReedMuller codes was proposed [8, 9]. Let be an dimensional vector space over . We use to denote the vector space of all homogeneous polynomials over with variables and degree . Let , the th order ary homogeneous ReedMuller code of length is defined as
which is denoted by . Without loss of generality, suppose that is the zero vector in . Then by definition, the first coordinate of is always . Thus, in some literature, the homogeneous ReedMuller code is defined to be the punctured code of with the first coordinate deleted (see [2, 8] for instance). When , the second order ary homogeneous ReedMuller code has the following parameters [2, Proposition 4]:
Note that
where is the set of all quadratic forms from to . The weight distribution of follows easily from Propositions 2.4 and 2.9.
Theorem 3.6.
The weight distribution of the second order homogeneous ReedMuller code is listed in Table 3.3.
Remark 3.7.
Weight  Frequency 

,  
, 
Example 3.8.
Numerical experiment shows that the second order ternary homogeneous ReedMuller code has weight enumerator
which is consistent with Table 3.3.
3.3 Projective ReedMuller codes
Another variation of ReedMuller codes adopts a geometric viewpoint, in which the ReedMuller codes are regarded as codes defined on an affine space. As a natural projective analogue of ReedMuller codes, the concept of projective ReedMuller codes was proposed by Lachaud [3, 4]. Consider an dimensional vector space over , where is the zero vector. We introduce an equivalence relation among nonzero elements of as follows. For nonzero and in , we define if and only if there exists a nonzero , such that . It is easy to see that this relation is indeed an equivalence relation partitioning all nonzero elements of . Without loss of generality, for each , , assume that and belong to distinct equivalence classes. Thus, is a set of representatives of the equivalence classes in . Let , the th order ary projective ReedMuller code of length is defined as
which is denoted by . When , we know that is identical to the punctured code of , in which the coordinate associated with the zero vector is deleted. When , the second order ary projective ReedMuller code has the following parameters [10, Theorem 1]:
Comments
There are no comments yet.