Abstract
In this paper, several classes of two-weight or three-weight linear codes over \( {{\mathbb {F}}}_p\) from quadratic or non-quadratic functions are constructed and their weight distributions are determined. From the constructed codes, we obtain some optimal linear codes with respect to the Singleton bound and the Griesmer bound. These two- or three-weight linear codes may have applications in secret sharing, authentication codes, association schemes and strongly regular graphs.
Similar content being viewed by others
Explore related subjects
Discover the latest articles, news and stories from top researchers in related subjects.Avoid common mistakes on your manuscript.
1 Introduction
Let \( {{\mathbb {F}}}_{p^m}\) be a finite field of size \(p^m\), where p is an odd prime. An [n, k] linear code \({{\mathcal {C}}}\) over \( {{\mathbb {F}}}_p\) is a k-dimensional linear subspace of \( {{\mathbb {F}}}_p^n\). The Hamming weight of a codeword \((c_0, c_1, \ldots , c_{n-1})\) in \({{\mathcal {C}}}\) is the number of nonzero \(c_i\) for \(0\le i\le n-1\). Let \(A_i\) denote the number of nonzero codewords with Hamming weight i in \({{\mathcal {C}}}\). The weight enumerator of \({{\mathcal {C}}}\) is defined by \(1 + A_1 z + \cdots + A_n z^n\). The sequence \((1, A_1, \ldots , A_n)\) is called the weight distribution of \({{\mathcal {C}}}\). The weight distribution of a code not only gives the error correcting ability of the code, but also allows the computation of the error probability of error detection and correction [17]. Therefore, the research of the weight distribution of a linear code is important in both theory and applications.
Let \(\mathrm{Tr}\) denote the trace function from \( {{\mathbb {F}}}_{p^m}\) to \( {{\mathbb {F}}}_p\). From a subset \(D=\{d_1, d_2, \ldots , d_n\}\subset {{\mathbb {F}}}_{p^m}\), Ding et al. defined a generic class of linear codes of length \(n=|D|\) over \( {{\mathbb {F}}}_p\) as
Here D is called the defining set of \({{\mathcal {C}}}_D\). This construction is generic in the sense that many classes of known codes could be produced by selecting the defining set D.
As far as we know, this technique was first employed in [3, 4] for obtaining good linear codes. Recently, Ding in [5, 6] studied linear codes whose defining sets were chosen from some specific classes of 2-designs or (pre)images of certain Boolean functions. In the past three years, many authors worked on this topic. The reader is referred to [5,6,7,8, 14,15,16, 19, 21,22,23, 25,26,28] and the references therein.
Let f be a polynomial over \( {{\mathbb {F}}}_{p^m}\). Define
Using \(D_f\) as a defining set, Zhang et al. in [26] showed the complete weight enumerators of a class of linear codes from a general quadratic polynomial f(x) over \( {{\mathbb {F}}}_{p^m}\). From [26] we know that the parameters of the linear code \({{\mathcal {C}}}_{D_f}\) depend on the rank and determinant of the quadratic form \(\mathrm{Tr}(f)\), which are difficult to determine in general.
In fact, from the point of view of geometry, the weight distribution of \({{\mathcal {C}}}_{D_f}\) is connected to the size of the intersection of the set \(D_f\) and the hyperplane \(H_a=\{x\, |\, \mathrm{Tr}(ax)=0\}\). If f is a DO polynomial, then \(D_f\) is a quadric. When the quadric and hyperplane have the same size, Games in [13] determined the intersection sizes and their corresponding frequencies. In this paper, we will present a class of linear codes from binomial quadratic polynomials over \( {{\mathbb {F}}}_{p^m}\) and determine their weight distributions explicitly by the application of the theory of quadratic forms over finite fields. Second, motivated by the idea of [29, 30], we study a class of linear codes \({{\mathcal {C}}}_{D_f}\) from \(f=x^\ell \) for \(\ell \) satisfying some congruence conditions and derive their weight distributions by converting the exponential sum related to non-quadratic forms to that related to quadratic forms. From the constructed codes, we obtain some optimal linear codes with respect to the Griesmer bound and the Singleton bound.
The remainder of this paper is organized as follows. Section 2 gives some preliminaries on quadratic forms over finite fields. In Sect. 3 we present the weight distributions of a class of linear codes from some special DO polynomials. Section 4 determines the weight distributions of a class of linear codes from some non-quadratic functions. Finally, Sect. 5 concludes this paper.
2 Preliminaries
Let p be an odd prime and \( {{\mathbb {F}}}_{p^m}\) be a finite field of size \(p^m\). A polynomial \(f(x)\in {{\mathbb {F}}}_{p^m}[x]\) called a DO polynomial was defined in [11] with the following shape:
It is clear that f(x) is also a homogeneous quadratic polynomial. A function \(Q(x_1, x_2, \ldots , x_m)\) from \( {{\mathbb {F}}}_{p}^m\) to \( {{\mathbb {F}}}_p\) is called a quadratic form if it is a homogenous polynomial of degree two as follows:
We fix a basis \(\{\alpha _1, \alpha _2, \ldots , \alpha _m\}\) of \({\mathbb {F}}_{p^m}\) over \({\mathbb {F}}_p\) and identify \(x=\sum _{i=1}^mx_i\alpha _i\) with the vector \((x_1,x_2,\ldots ,x_m)\in {\mathbb {F}}_p^m\), then \(\mathrm{Tr} ( f(x))\) is a quadratic form in the coordinates of \( {{\mathbb {F}}}_p^m\). Moreover, every quadratic form Q(x) from \( {{\mathbb {F}}}_{p^m}\) to \( {{\mathbb {F}}}_p\) can be represented as
where f(x) is a DO polynomial defined above. The rank of the quadratic form Q(x) is defined as the codimension of \( {{\mathbb {F}}}_p\)-vector space
which is denoted by rank(Q). Then \(|V| = p^{m-\mathrm{rank}(Q)}\).
For a quadratic form Q(x) with m variables over \( {{\mathbb {F}}}_p\), there exists a symmetric matrix A such that \(Q(x)=XAX^\prime \), where \(X=(x_1, x_2, \ldots , x_m)\in {{\mathbb {F}}}_p^m\) and \(X^\prime \) denotes the transpose of X. The determinant \(\mathrm{det}(Q)\) of Q(x) is defined to be the determinant of A, and Q(x) is nondegenerate if \(\mathrm{det}(Q)\ne 0\). It is known that there exists a nonsingular matrix T such that \(TAT^\prime \) is a diagonal matrix [18]. Making a nonsingular linear substitution \(X=YT\) with \(Y=(y_1, y_2, \ldots , y_m)\), we have
where \(r(\le m)\) is the rank of Q(x). The following lemma gives a general result on an exponential sum of a quadratic function from \( {{\mathbb {F}}}_{p^m}\) to \( {{\mathbb {F}}}_p\).
Lemma 1
(see Theorems 5.15 and 5.33 of [18]) Let Q(x) be a quadratic function from \( {{\mathbb {F}}}_{p^m}\) to \( {{\mathbb {F}}}_p\) with rank r, and \(\eta \) be the quadratic multiplicative character of \( {{\mathbb {F}}}_p\). Then
where \(\omega _p\) is a pth primitive root of unity, and \(\varDelta \) is the determinant of Q(x), and \(\delta _{p,r} = (-1)^{\frac{r(p-1)^2}{8}}\). Moreover, for any \(z\in {{\mathbb {F}}}_{p}^*\),
It is well known that the parameters of an [n, k, d] linear code \({{\mathcal {C}}}\) over \( {{\mathbb {F}}}_p\) satisfy
and
where \(\lceil x\rceil \) denotes the smallest integer, which is larger than or equal to x. If the equality in (2) holds, then \({{\mathcal {C}}}\) is called an optimal code with respect to the Singleton bound. If the equality in (3) holds, then \({{\mathcal {C}}}\) is called an optimal code with respect to the Griesmer bound.
Two linear codes \({\mathcal {C}}\) and \(\mathcal {C'}\) of length n over \( {{\mathbb {F}}}_{p^m}\) are equivalent (see Sect. 1 of Chapter 2 in [20]) if there exist n permutations \(\pi _0, \pi _1, \ldots , \pi _{n-1}\) of the \(p^m\) elements in \( {{\mathbb {F}}}_{p^m}\) and a permutation \(\sigma \) of the n coordinate positions such that if \((c_0,c_1,\ldots ,c_{n-1}) \in {\mathcal {C}}\), then \(\sigma (\pi _0(c_0),\pi _1(c_1),\ldots ,\pi _{n-1}(c_{n-1})) \in \mathcal {C'}\). That is to say, let G and \(G^\prime \) be generator matrices of \({{\mathcal {C}}}\) and \({{\mathcal {C}}}^\prime \) respectively. The codes \({\mathcal {C}}\) and \(\mathcal {C'}\) are equivalent if there exists a monomial matrix M such that \(G^\prime = G M\), where M is a square matrix such that in every row (and in every column) there is exactly one nonzero element in \( {{\mathbb {F}}}_{p^m}\).
In order to discuss the existence of the solutions for two congruence equations in Sect. 4, we need the following well known facts.
Lemma 2
Let \(\phi , \varphi , \mu \) be three nonzero elements in \({\mathbb {F}}_{p^m}\). Then for any congruence equation \(\phi x\equiv \varphi \pmod \mu \), the equation has solutions if and only if \(\gcd (\phi ,\mu )\ | \ \varphi \). Moreover, the number of solutions is \(\gcd (\phi ,\mu )\).
Lemma 3
Let h, g be two positive integers. Then
3 Linear codes from DO polynomials
Let \( {{\mathbb {F}}}_{p^m}\) be a finite field with \(p^m\) elements, where p is an odd prime and m is a positive integer. Let \(\mathrm{Tr}\) denote the trace function from \( {{\mathbb {F}}}_{p^m}\) to \( {{\mathbb {F}}}_p\). Let f(x) be a DO polynomial over \( {{\mathbb {F}}}_{p^m}\). Recall that
From this set, we obtain a linear code proposed in [8] as follows:
From [10, 26], we can get the following lemmas.
Lemma 4
Let \({{\mathcal {C}}}_{D_f}\) be the linear code defined in (4) and n be the length of the codewords in \({{\mathcal {C}}}_{D_f}\). Let r be the rank of the quadratic form \(Q(x)= \mathrm{Tr}(f(x))\) and its determinant be denoted by \(\varDelta \). Then
where \(\eta \) is the quadratic character of \( {{\mathbb {F}}}_p\) and \(\delta _{p,r}\) is defined in Lemma 1.
Lemma 5
Let f be a DO polynomial over \( {{\mathbb {F}}}_{p^m}\) and \(\mathrm{Tr}(f)\) be a quadratic form with rank r. Let \({{\mathcal {C}}}_{D_f}\) be the linear code defined in (4).
-
(1)
If r is odd, then \({{\mathcal {C}}}_{D_f}\) is a \([p^{m-1}-1, m, (p-1)(p^{m-2}-p^{\frac{2m-r-3}{2}})]\) code with the weight distribution in Table 1.
-
(2)
If r is even, then \({{\mathcal {C}}}_{D_f}\) is a \([p^{m-1}-1+\epsilon (p-1)p^{\frac{2m-r-2}{2}}, m]\) code with the weight distribution in Table 2, where \(\epsilon =\eta (\varDelta )\delta _{p,r}\), \(\varDelta \) is the determinant of \(\mathrm{Tr}(f)\), \(\eta \) is the quadratic character of \( {{\mathbb {F}}}_p\), and \(\delta _{p,r}\) is defined in Lemma 1.
It is observed that the Hamming weight of each codeword in the code \({{\mathcal {C}}}_{D_f}\) has a common divisor \(p-1\). This indicates that \({{\mathcal {C}}}_{D_f}\) may be punctured into a shorter one whose weight distribution is derived from that of the original code. To this end, we define a equivalence relation in the set \(D_f\) as follows. For \(\beta ,\gamma \in D_f\), we say that \(\beta \) is equivalent to \(\gamma \) if and only if there exists \(a\in {{\mathbb {F}}}_p^*\) such that \(\beta =a \gamma \). The elements chosen from each equivalent class in \(D_f\) consist of a set \({\bar{D}}_f\). It is obvious that
Then \({{\mathcal {C}}}_{{\bar{D}}_f}\) is a punctured version of \({{\mathcal {C}}}_{D_f}\), whose parameters are given in the following proposition.
Proposition 1
Let f be a DO polynomial over \( {{\mathbb {F}}}_{p^m}\) and r be the rank of quadratic form \(\mathrm{Tr}(f)\). Let \({{\mathcal {C}}}_{{\bar{D}}_f}\) be the linear code defined above, where \({\bar{D}}_f\) is defined in (5).
-
(1)
If r is odd, then \({{\mathcal {C}}}_{{\bar{D}}_f}\) is a \([\frac{p^{m-1}-1}{p-1}, m, p^{m-2}-p^{\frac{2m-r-3}{2}}]\) code with the weight distribution in Table 3.
-
(2)
If r is even, then \({{\mathcal {C}}}_{{\bar{D}}_f}\) is a \([\frac{p^{m-1}-1}{p-1}+\epsilon p^{\frac{2m-r-2}{2}}, m]\) code with the weight distribution in Table 4, where \(\epsilon =\eta (\varDelta )\delta _{p,r}\), \(\varDelta \) is the determinant of \(\mathrm{Tr}(f)\), \(\eta \) is the quadratic character of \( {{\mathbb {F}}}_p\) and \(\delta _{p,r}\) is defined in Lemma 1.
From the weight distribution of \({{\mathcal {C}}}_{{\bar{D}}_f}\) above, we obtain some optimal linear codes with respect to the Singleton bound or the Griesmer bound as follows.
Corollary 1
Let f be a DO polynomial over \( {{\mathbb {F}}}_{p^m}\) and r be the rank of quadratic form \(\mathrm{Tr}(f)\). Let \({{\mathcal {C}}}_{{\bar{D}}_f}\) be the linear code defined above.
-
(1)
If \(r=m=3\), then \({{\mathcal {C}}}_{{\bar{D}}_f}\) is a \([p+1,3,p-1]\) code. This code is optimal with respect to the Singleton bound and the Griesmer bound.
-
(2)
If \(r=m=4\), and the determinant of \(\mathrm{Tr}(f)\) is a non-square element in \( {{\mathbb {F}}}_p^*\), then \({{\mathcal {C}}}_{{\bar{D}}_f}\) is a \([p^2+1,4,p^2-p]\) code. This code is optimal with respect to the Griesmer bound.
Proof
When \(r=m=3\), from Proposition 1 we know that the length n of \({{\mathcal {C}}}_{{\bar{D}}_f}\) is \(p+1\), the dimension k of \({{\mathcal {C}}}_{{\bar{D}}_f}\) is 3, and the minimal distance d is \(p-1\). It is easy to verify that these parameters of the code \({{\mathcal {C}}}_{{\bar{D}}_f}\) satisfy the equality in (2) and (3), respectively. Therefore, \({{\mathcal {C}}}_{{\bar{D}}_f}\) is optimal with respect to the Singleton bound and the Griesmer bound. The proof of case (2) is similar, and we omit the details here. \(\square \)
Remark 1
Section 5 of Chapter 11 in [20] has proved that there exist \([p+1,3,p-1]\) (cyclic) MDS codes. Corollary 1 only provides a class of MDS code with this parameters by trace representations.
It is well known that an [n, k] linear code is called projective if no two columns of a generator matrix G are linearly dependent, i.e., if the columns of G are pairwise different points in a projective \((k-1)\)-dimensional space. A strong regular graph with parameters \((v, K, \lambda , \mu )\) is a finite simple graph with v vertices which is regular of degree K, and any two distinct vertices have \(\lambda \) common neighbours if they are adjacent and \(\mu \) common neighbours if they are non-adjacent. There are strong connections between projective two-weight codes and strong regular graphs.
Let q be a power of a prime and \( {{\mathbb {F}}}_q\) be a finite field with q elements. In 1985, Calderbank and Kantor [9] showed that if an [n, k] linear code with weights \(w_1\) and \(w_2\) over \({\mathbb {F}}_q\) is a projective two-weight code, then we can obtain a strong regular graph with the following parameters (Corollary 3.7 in [2]),
In 2006, Bouyukliev et al. [1] showed that a two-weight code \([q^2+1, 4, q^2-q]\) with weights \(w_1=q^2-q\) and \(w_2=q^2\) is a projective two-weight code. Hence, from the code in Corollary 1, we can obtain a strong regular graph with parameters \((p^4, p^3-p^2+p-1, p-2, p^2-p)\).
Example 1
(1) Let \(p=3\) and \(m=3\). Let \(f(x)=x^2\), \(x^4\), \(x^{10}-x^6-x^2\) or \(x^{10}+x^6-x^2\). Then the code \(C_{{\bar{D}}_f}\) has parameters [4, 3, 2] and the weight enumerator \(1+12x^2+8x^3+6x^4\). This code is an MDS code and is optimal with respect to the Griesmer bound.
(2) Let \(p=7\) and \(m=4\). Let \(f(x)=x^{50}\) or \(\alpha ^{11}x^8+\alpha ^{20}x^2\), where \(\alpha \) is a primitive element of \( {{\mathbb {F}}}_{7^4}\). Then the code \(C_{{\bar{D}}_f}\) has parameters [50, 4, 42] and weight enumerator \(1+2100x^{42}+300x^{49}\). This code is optimal with respect to the Griesmer bound.
3.1 A class of linear codes from some special DO polynomials
From Proposition 1, in order to determine the parameters of the linear code \({{\mathcal {C}}}_{{\bar{D}}_f}\), we need to know the rank and determinant of the quadratic form \(\mathrm{Tr}(f)\), and they are difficult to determine in general. In this subsection, we present a class of linear codes from binomial polynomials and determine their weight distributions explicitly.
Proposition 2
Let \(\nu _2(\cdot )\) denote the 2-adic order function. Let i and j be positive integers with \(i>j\). Let \(f(x)=x^{p^i+1} + x^{p^j+1}\in {{\mathbb {F}}}_{p^m}[x]\) and \({{\mathcal {C}}}_{{\bar{D}}_f}\) be the linear code defined above.
-
(1)
If m is odd, then \({{\mathcal {C}}}_{{\bar{D}}_f}\) is a \([\frac{p^{m-1}-1}{p-1}, m, p^{m-2}-p^{\frac{m-3}{2}}]\) code with the weight distribution in Table 5.
-
(2)
If \(v=\nu _2(i)=\nu _2(j)<\nu _2(m)\) and \(\nu _2(m)\le \mathrm{min}\{ \nu _2(i-j), \nu _2(i+j)\}\), then \({{\mathcal {C}}}_{{\bar{D}}_f}\) is a \([\frac{p^{m-1}-1}{p-1}+(-1)^{\frac{m}{2^{v+1}}}p^{\frac{m-2}{2}}, m]\) code with the weight distribution in Table 6.
-
(3)
Let \(v=\nu _2(i)=\nu _2(j)\) and \(d=\gcd (i+j, m)\). If \(v<\nu _2(m)\) and \(\nu _2(i+j)<\nu _2(m)\le \nu _2(i-j)\), then \({{\mathcal {C}}}_{{\bar{D}}_f}\) is a \([\frac{p^{m-1}-1}{p-1}+(-1)^{\frac{m-d}{2^{v+1}}}p^{\frac{m+d-2}{2}}, m]\) code with the weight distribution in Table 7.
-
(4)
Let \(v=\nu _2(i)=\nu _2(j)\) and \(d=\gcd (i-j, m)\). If \(v<\nu _2(m)\) and \(\nu _2(i-j)<\nu _2(m)\le \nu _2(i+j)\), then \({{\mathcal {C}}}_{{\bar{D}}_f}\) is a \([\frac{p^{m-1}-1}{p-1}+(-1)^{\frac{m-d}{2^{v+1}}}p^{\frac{m+d-2}{2}}, m]\) code with the weight distribution in Table 7.
In order to prove Proposition 2, we need the following lemma.
Lemma 6
(see Theorem 7.3 of [12]) Let \(\nu _2(\cdot )\) denote the 2-adic order function. Let \(f\in {{\mathbb {F}}}_{p^m}[x]\) be a DO polynomial given in Proposition 2 with \(\nu _2(i)=\nu _2(j)<\nu _2(m)\). Then
where \(v=\nu _2(i)\), \(\varDelta \) and r are the determinant and the rank of \(\mathrm{Tr}(f)\), respectively.
Proof of Proposition 2
It is known that the weight distribution of \({{\mathcal {C}}}_{{\bar{D}}_f}\) is related to the determinant and rank of \(\mathrm{Tr}(f)\), and they have a connection given in Lemma 6. So, we may obtain the weight distribution of \({{\mathcal {C}}}_{{\bar{D}}_f}\) if we can determine the rank of \(\mathrm{Tr}(f)\).
Note that the rank of \(\mathrm{Tr}(f)\) equals the codimension of \( {{\mathbb {F}}}_p\)- vector space
where
So, the rank of \(\mathrm{Tr}(f)\) is equal to the codimension of the null space of L(x).
Cases (1) and (2): From (6) we have
Set \(z= x^{p^{i-j}}+x\). (7) is reduced to
Obviously, \(z=0\) is a solution of (8). If \(z\ne 0\), then we obtain \(z^{p^{i+j}-1}=-1\). Let \(\alpha \) be a primitive element of \( {{\mathbb {F}}}_{p^m}\) and \(z=\alpha ^s \) for some positive integer s. Then \(z^{p^{i+j}-1}=-1\) is reduced to
which is equivalent to
In Cases (1) and (2), it is easy to see that \(\gcd (p^{i+j}-1, p^m-1) \not \mid \frac{p^m-1}{2}\) since \(\nu _2(m)\le \nu _2(i+j)\). By Lemma 2, (9) has no solution for s. It follows that (8) has only one solution \(z=0\). Similarly, one can verify that \(x^{p^{i-j}} + x =0\) has also only one solution \(x=0\) since \(\nu _2(m)\le \nu _2(i-j)\). That is to say, the rank of \(\mathrm{Tr}(f)\) is m. In the case of m being odd, from Table 3 we get the weight distribution of \({{\mathcal {C}}}_{{\bar{D}}_f}\), which is given in Table 5. In the case of \(\nu _2(m)>0\), from Lemma 6 we have
Substituting this \(\epsilon \) and \(r=m\) into Table 4, we get Table 6.
Case (3): From (6) we get
Set \(y= x^{p^{i+j}}+x\). (10) is reduced to
Then using similar techniques as we prove the number of solutions in (8), we obtain that (11) has only one solution \(y=0\), and \(x^{p^{i+j}} + x =0\) has \(p^d\) solutions since \(\nu _2(i+j)<\nu _2(m)\le \nu _2(i-j)\), where \(d=\gcd (i+j, m)\). So, the rank of \(\mathrm{Tr}(f)\) is equal to \(m-d\). In this case, from Lemma 6 we have
Substituting this \(\epsilon \) and \(r=m-d\) into Table 4, we get Table 7.
The proof of Case (4) is similar to that of Case (3). \(\square \)
Example 2
(1) Let \(p=3, m=3\) and \(f(x)=x^{10}+x^4\) or \(x^{28}+x^4\). Then the code \(C_{{\bar{D}}_f}\) has parameters [4, 3, 2] and the weight enumerator \(1+12x^2+8x^3+6x^4\). This code is an MDS code and optimal with respect to the Griesmer bound.
(2) Let \(p=3, m=6\) and \(f(x)=x^{28}+x^4\). Then the code \(C_{{\bar{D}}_f}\) has parameters [224, 6, 72] and the weight enumerator \(1+504x^{72}+224x^{81}\).
(3) Let \(p=3, m=12\) and \(f(x)=x^{3^9+1}+x^{4}\) or \(x^{3^7+1}+x^{4}\). Then the code \(C_{{\bar{D}}_f}\) has parameters [87844, 12, 58320] or [82012, 12, 52488] and the weight enumerators \(1+39528x^{58320}+ 472392x^{58563} + 19520x^{59049}\) or \(1+504x^{52488}+ 224x^{59049}+472392x^{54675}\), respectively.
4 Linear codes from \(f=x^\ell \) for \(\ell \) satisfying some congruence conditions
Let \( {{\mathbb {F}}}_{p^m}\) be a finite field of size \(p^m\), where m is odd and p is an odd prime with \(p \equiv 3 \pmod 4\). Let \(\ell \) be an even integer satisfying one of the following conditions:
where k is a nonnegative integer. Next, we show that there exists an even integer satisfying one of congruence equations in (12). Since m is odd, by Lemma 3 we have \(2=\gcd (p^k+1, p^m-1)\ |\ \frac{p^m+1}{2}\) and \(2=\gcd (\frac{p^m+1}{2}, p^m-1)\ | \ p^k+1\). Then the congruence equations in (12) have solutions for any integer k by Lemma 2. On the other hand, let b be an integer satisfying the first congruence equation. Then \((p^k+1)(b+\frac{p^m-1}{2}) \equiv (p^k+1)b \equiv \frac{p^m+1}{2} \pmod {p^m-1}\). Similarly, if an integer b satisfies the second congruence equation, then \(\frac{p^m+1}{2}(b+\frac{p^m-1}{2}) \equiv \frac{p^m+1}{2}b \equiv p^k+1\pmod {p^m-1}\). These show that if an integer b satisfies one of the congruence equations in (12), then \(b+\frac{p^m-1}{2}\) satisfies the corresponding congruence equation. Since \(p \equiv 3 \pmod 4\) and m is odd, the number \(\frac{p^m-1}{2}\) is odd. Hence, there exists an even integer satisfying each congruence equation in (12).
In this section, we will investigate the weight distribution of a linear code defined by
where the defining set \(D_f\) is as follows:
The following lemma presents the length of the linear code \({{\mathcal {C}}}_{D_f}\).
Lemma 7
Let p be an odd prime with \(p\equiv 3 \pmod 4\). Let m be an odd number and \(\ell \) be an even number satisfying one of the conditions in (12). Let \({{\mathcal {C}}}_{D_f}\) be the linear code defined in (13). Then the length of the codewords in \({{\mathcal {C}}}_{D_f}\) is \(p^{m-1}-1\).
Proof
We only prove the case of \(\ell \) satisfying the first condition of (12), i.e., \(( p^k+1) \ell \equiv \frac{p^m+1}{2} \pmod {p^m-1}\), and the proof of the case of \(\ell \) satisfying the second condition of (12) is similar.
Let SQ and NSQ denote the set of all square elements and non-square elements in \( {{\mathbb {F}}}_{p^m}^*\), respectively. Let n be the length of a codeword in \({{\mathcal {C}}}_{D_f}\).
where in the fourth equality, we used the fact that \(\{ x^{p^k+1} \, |\, x\in {{\mathbb {F}}}_{p^m}^* \}= \{ x^2 \, |\, x\in {{\mathbb {F}}}_{p^m}^* \}\) since \(\gcd (p^k+1, p^m-1) =2\).
It is easy to see that \(\gcd (\frac{p^m+1}{2}, p^m-1)=2\) since \(p\equiv 3 \pmod 4\) and m is odd. So, \(\{ x^\frac{p^m+1}{2} \, |\, x\in {{\mathbb {F}}}_{p^m}^* \} = \{ x^2 \, |\, x\in {{\mathbb {F}}}_{p^m}^* \}\). From Lemma 1, we have
\(\square \)
To determine the weight distribution of \({{\mathcal {C}}}_{D_f}\), we need to show the value distribution of the set
for b running over \( {{\mathbb {F}}}_{p^m}^*\). To this end, we will investigate the relation of the value distribution between \(N_\ell (b)\) and the following two sets
and
for b running through \( {{\mathbb {F}}}_{p^m}^*\).
Lemma 8
Let p be a prime with \(p\equiv 3 \pmod 4\). Let m be an odd number and \(\ell \) be an even number satisfying one of the conditions in (12). When b runs over \( {{\mathbb {F}}}_{p^m}^*\), the sets \(N_\ell (b), N_k(b, 1)\) and \(N_{k}(1,b)\) have the same value distribution as follows:
Proof
Let \(\mathrm{SQ}\) and \(\mathrm{NSQ}\) denote all square elements and non-square elements in \( {{\mathbb {F}}}_{p^m}^*\), respectively. It is easy to verify that \( \{ x^{p^k+1} \,|\, x \in {{\mathbb {F}}}_{p^m}\}= \{ x^2 \,|\, x\in {{\mathbb {F}}}_{p^m} \}\) for m being odd. If \(\ell \) satisfies the first condition of (12), then
Observe that \(x^{\frac{p^m+1}{2}}=x\) or \(-x\) for x in \(\mathrm{SQ}\) or \(\mathrm{NSQ}\), respectively. Since \(\ell \) is even and m is odd, we have
This shows that the sets \(N_\ell (b)\) and \(N_k(b,1)\) have the same value distribution for b running over \( {{\mathbb {F}}}_{p^m}^*\). Similarly, if \(\ell \) satisfies the second condition of (12), then the sets \(N_\ell (b)\) and \(N_k(1,b)\) have the same value distribution for b running over \( {{\mathbb {F}}}_{p^m}^*\).
Next, we show that the sets \(N_k(1, b)\) and \(N_k(b, 1)\) have the same value distribution given in (15). Let
Note that m is odd, by Theorem 2 in [24], for a, c running over \( {{\mathbb {F}}}_{p^m}^*\), the set N(a, c) has the following value distribution,
For a fixed \(a\in {{\mathbb {F}}}_{p^m}^*\), if a is a square element in \( {{\mathbb {F}}}_{p^m}^*\), then there exists \(\beta \in {{\mathbb {F}}}_{p^m}\) such that \(a=\beta ^{p^k+1}\), and
If a is a non-square element in \( {{\mathbb {F}}}_{p^m}^*\), then there exists \(\beta \in {{\mathbb {F}}}_{p^m}\) such that \(-a=\beta ^{p^k+1}\), and
From (18) and (19), we know that for a fixed \(a\in {{\mathbb {F}}}_{p^m}^*\) and c running over \( {{\mathbb {F}}}_{p^m}^*\), N(a, c) has the same value distribution as that of \(N_k(1, b)\) for b running over \( {{\mathbb {F}}}_{p^m}^*\). Hence, from (17) we obtain that \(N_k(1, b)\) has the value distribution given in (15) for b running over \( {{\mathbb {F}}}_{p^m}^*\). Similarly, \(N_k(b, 1)\) has the value distribution given in (15) for b running over \( {{\mathbb {F}}}_{p^m}^*\). By (16), the result follows. \(\square \)
Now, we give the weight distribution of the linear code \({{\mathcal {C}}}_{D_f}\) defined in (13).
Theorem 1
Let p be an odd prime with \(p\equiv 3 \pmod 4\). Let m be an odd number and \(\ell \) be an even number satisfying one of the conditions in (12). Then \({{\mathcal {C}}}_{D_f}\) in (13) is a \([p^{m-1}-1,m,(p-1)(p^{m-2}-p^{\frac{m-3}{2}})]\) code with the weight distribution in Table 8.
Proof
We only prove the case of \(\ell \) satisfying the first condition of (12), i.e., \(( p^k+1) \ell \equiv \frac{p^m+1}{2} \pmod {p^m-1}\), and the proof of the second case is similar.
Let \({{\mathcal {C}}}_{D_f}\) be the linear code defined in (13), and its length n is determined in Lemma 7. For \(b \in {{\mathbb {F}}}_{p^m}^*\), a codeword in \({{\mathcal {C}}}_{D_f}\) is
where \(d_1,d_2,\ldots ,d_n\) are the elements of \(D_f\). Its Hamming weight is as follows:
Since \(\sum _{x \in {{\mathbb {F}}}_{p^m}}\sum _{y \in {{\mathbb {F}}}_p}\omega _p^{y\mathrm{Tr}(x^\ell )}=p^m\) and \(\sum _{x \in {{\mathbb {F}}}_{p^m}}\sum _{z \in {{\mathbb {F}}}_p}\omega _p^{z\mathrm{Tr}(bx)}=0\), then
Set \(z=uy\). It is clear that when (y, z) runs through \( {{\mathbb {F}}}_{p^m}^*\times {{\mathbb {F}}}_{p^m}^*\), (u, y) also runs through \( {{\mathbb {F}}}_{p^m}^*\times {{\mathbb {F}}}_{p^m}^*\). It is easy to verify that \(N_k(b, 1) = N_k(ub, 1)\) for any \(u\in {{\mathbb {F}}}_p^*\). We have
By Lemma 8 and (20), we get the weight distribution of \({{\mathcal {C}}}_{D_f}\). From the fact that \(wt(\mathbf {c}_b)>0\) for any \(b \in {{\mathbb {F}}}_{p^m}^*\), we deduce that the dimension of \({{\mathcal {C}}}_{D_f}\) is m. \(\square \)
Remark 2
When \(k=0\), it is easy to see that \(\ell =2\) is a solution of the second congruence equation in (12). So, in this case, the linear codes in Theorem 1 and those in [8] are the same.
One can verify that when \(p=m=3\), \(\ell =10\) is a solution of the first and the second congruence equation in (12) for the case \(k=1\) and \(k=2\), respectively. Magma shows that when \(p=m=3\), the linear code in [8] has a generator matrix
Accordingly, when \(p=m=3\) and \(\ell =10\), the linear code in Theorem 1 has a generator matrix
From the connection between linear transformations and multiplication of monomial matrices, we have that there is no monomial matrix M in \( {{\mathbb {F}}}_{3^3}\) such that \(G_2 = G_1 M\). This means that there exists \(\ell \) in (12) such that the linear codes in Theorem 1 and those in [8] are not equivalent.
Let \({\bar{D}}_f\) be a defining set as in (5). The weight distribution of the punctured version of \({{\mathcal {C}}}_{D_f}\) is as follows.
Proposition 3
Let p be an odd prime with \(p\equiv 3 \pmod 4\). Let m be an odd number and \(\ell \) be an even number satisfying one of the conditions in (12). Then \({{\mathcal {C}}}_{{\bar{D}}_f}\) is a \([\frac{p^{m-1}-1}{p-1},m,p^{m-2}-p^{\frac{m-3}{2}}]\) code with the weight distribution in Table 5.
From the weight distribution of \({{\mathcal {C}}}_{{\bar{D}}_f}\) above, we have the following corollary.
Corollary 2
Let \({{\mathcal {C}}}_{{\bar{D}}_f}\) be the linear code defined above. If \(m=3\), then \({{\mathcal {C}}}_{{\bar{D}}_f}\) is a \([p+1,3,p-1]\) code. This code is optimal with respect to the Singleton bound and the Griesmer bound.
Example 3
(1) Let \(p=3\) and \(m=3\). Let \(\ell =4\) or 10. Then the code \({{\mathcal {C}}}_{{\bar{D}}_f}\) has parameters [4, 3, 2] and the weight enumerator \(1+12x^2+8x^3+6x^4\). This code is optimal with respect to the Griesmer bound and the Singleton bound.
(2) Let \(p=7\) and \(m=3\). Let \(\ell =8\) or 278. Then the code \({{\mathcal {C}}}_{{\bar{D}}_f}\) has parameters [8, 3, 6] and the weight enumerator \(1+126x^6+48x^7+168x^8\). This code is optimal with respect to the Griesmer bound and the Singleton bound.
5 Concluding remarks
In this paper, we presented several classes of linear codes with two or three weights and determined their weight distributions. From the punctured version of the constructed linear codes, we obtained some optimal linear codes with respect to the Singleton bound or the Griesmer bound.
Let \(w_{min}\) and \(w_{max}\) denote the minimum and maximum nonzero weights of a linear code \({\mathcal {C}}\). Ding and Ding in [8] showed that if the linear code \({\mathcal {C}}\) with \(w_{min}/w_{max}>(p-1)/p\), then the secret sharing scheme based on the dual code \({\mathcal {C}}^{\perp }\) has the nice access structure. Using similar techniques as in [8], one can verify that when \(m\ge 12\) and \(r\ge 6\), the codes constructed in the paper satisfy \(w_{min}/w_{max}>(p-1)/p\). It then follows that the dual codes \({\mathcal {C}}_{D_f}^{\perp }\) and \({\mathcal {C}}_{{\bar{D}}_f}^{\perp }\) can be employed to obtain secret sharing schemes with interesting access structures.
References
Bouyukliev, I., Fack, V., Winne, J., Willems, W.: Projective two-weight codes with small parameters and their corresponding graphs. Des. Codes Cryptogr. 41, 59–78 (2006)
Calderbank, A.R., Kantor, W.M.: The geometry of two-weight codes. Bull Lond. Math. Soc. 18, 97–122 (1986)
Ding, C., Niederreiter, H.: Cyclotomic linear codes of order 3. IEEE Trans. Inf. Theory 53(6), 2274–2277 (2007)
Ding, C., Luo, J., Niederreiter, H.: Two weight codes punctured from irreducible cyclic codes, In: Li, Y., Ling, S., Niederreiter, H., Wang, H., Xing, C., Zhang, S. (Eds.) Proceedings of the First International Workshop on Coding Theory and Cryptography, World Scientific, Singapore, pp. 119–124 (2008)
Ding, C.: Linear codes from some 2-designs. IEEE Trans. Inf. Theory 61(6), 3265–3275 (2015)
Ding, C.: A construction of binary linear codes from Boolean functions. Discrete Math. 339(9), 2288–2303 (2016)
Ding, K., Ding, C.: Binary linear codes with three weights. IEEE Commun. Lett. 18, 1879–1882 (2014)
Ding, K., Ding, C.: A class of two-weight and three-weight codes and their applications in secret sharing. IEEE Trans. Inf. Theory 61(11), 5835–5842 (2015)
Faldum, A., Willems, W.: A characterization of MMD codes. IEEE Trans. Inf. Theory 44(4), 1555–1558 (1998)
Klapper, A.: Cross-correlations of quadratic form sequences in odd characteristic. Des. Codes Cryptogr. 3, 289–305 (1997)
Dembowski, P., Ostrom, T.G.: Planes of order \(n\) with collineation groups of order \(n^2\). Math. Zeitschrift 193(3), 239–258 (1968)
Draper, S., Hou, X.: Explicit evalution of certain exponential sums of quadratic functions over \({\mathbb{F}}_{p^m}\), \(p\) odd. arXiv:0708.3619
Games, R.A.: The geometry of quadrics and correlations of sequences. IEEE Trans. Inf. Theory 32(2), 423–426 (1986)
Heng, Z., Yue, Q.: A class of binary linear codes with at most three weights. IEEE Commun. Lett. 19, 1488–1491 (2015)
Heng, Z., Yue, Q., Li, C.: Three classes of linear codes with two or three weights. Discrete Math. 339, 2832–2847 (2016)
Heng, Z., Yue, Q.: Evaluation of the Hamming weights of a classes of linear codes based on Gauss sums. Des. Codes Cryptogr. 83(2), 307–326 (2017)
Kløve, T.: Codes for Error Detection. World Scientific, Hackensack (2007)
Lidl, R., Niederreiter, H.: Finite Fields, Encyclopedia of Mathematics, vol. 20. Cambridge University Press, Cambridge (1983)
Li, F., Wang, Q., Lin, D.: A class of three-weight and five-weight linear codes. Discrete Appl Math 241(31), 25–38 (2018)
MacWilliams, F.J., Sloane, N.J.A.: The Theory of Error Correcting Codes. Elsevier, Amsterdam (1977)
Wang, Q., Ding, K., Xue, R.: Binary linear codes with two weight. IEEE Commun. Lett. 19, 1097–1100 (2015)
Xia, Y., Li, C.: Three-weight ternary linear codes from a family of power functions. Finite Fields Appl. 46, 17–37 (2017)
Xiang, C.: Linear codes from a generic construction. Cryptogr. Commun. 8, 525–539 (2016)
Yuan, J., Carlet, C., Ding, C.: The weight distribution of a class of linear codes from perfect nonlinear functions. IEEE Trans. Inf. Theory 52(2), 712–717 (2006)
Zeng, X., Hu, L., Jiang, W., Yue, Q., Cao, X.: The weight distribution of a class of p-ary cyclic codes. Finite Fields Appl. 16, 56–73 (2010)
Zhang, D., Fan, C., Peng, D., Tang, X.: Complete weight enumerators of some linear codes from quadratic forms. Cryptogr. Commun. 9, 151–163 (2017)
Zheng, D., Bao, J.: Four classes of linear codes from cyclotomic cosets. Des. Codes Cryptogr. 86, 1007–1022 (2018)
Zhou, Z., Li, N., Fan, C., Helleseth, T.: Linear codes with two or three weight from quafratic bent functions. Des. Codes Cryptogr. 81(2), 283–295 (2016)
Zhou, Z., Ding, C.: Seven classes of three-weight cyclic codes. IEEE Trans. Commun. 61(10), 4120–4126 (2013)
Zhou, Z., Ding, C.: A class of three-weight cyclic codes. Finite Fields Appl. 25, 79–93 (2014)
Acknowledgements
The authors would like to thank Prof. Q. Xiang for providing Reference [13], and the reviewers and the editor for their helpful comments and valuable suggestions, which have greatly improved the presentation of this paper. This work of X. Wang and H. Liu was supported by the self-determined research funds of CCNU from the collegess basic research and operation of MOE (Grant No. CCNU18TS028).
Author information
Authors and Affiliations
Corresponding author
Rights and permissions
About this article
Cite this article
Wang, X., Zheng, D. & Liu, H. Several classes of linear codes and their weight distributions. AAECC 30, 75–92 (2019). https://doi.org/10.1007/s00200-018-0359-x
Received:
Revised:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s00200-018-0359-x