1.
Introduction
Let Fq be a finite field with q elements, where q is a power of a prime 2. Let Trq/2 be the trace function from Fq onto F2. An [n,k,d] binary linear code C is a k-dimensional subspace of Fn2 with minimum Hamming distance d. Let D={x1,x2,…,xn}⊆Fq. A binary linear code of length n over F2 is defined by
If the set D is well chosen, the code CD may have good parameters. Let Ai be the number of codewords in CD with Hamming weight i. The weight enumerator of CD is defined by
The sequence (1,A1,A2,…,Al) is called the weight distribution of CD. It is said to be a t-weight code if the number of nonzero Ai in the sequence (1,A1,…,Al) is equal to t.
In coding theory, it is often desirable to know the weight distributions of the codes because they can be used to estimate the error correcting capability and the error probability of error detection and correction with respect to some algorithms. Hence weight distributions of codes are an interesting topic and were investigated in [4,5,7,8,9,10,11,12,13,18,19,21,22] etc. Moreover, those codes with few nonzero weights are of special interest in association schemes, secret sharing schemes, and frequency hopping sequences [2].
In this paper, let p be an odd prime with p≡1(mod4), N=pm a positive integer, ordN(2)=f, and q=2f, where f=ϕ(N)2 and ϕ(⋅) is the Euler's function. Let α be a primitive element of Fq and β=αq−1N an N-th primitive root of unity in Fq. We choose
as a defining set of CDa, and
It is obvious that the dimension of CDa is ϕ(N)2.
For C∈CDa, the Hamming weights of the codeword C with respect to b∈Fq is denoted by WH(C).
Denote
The length of CDa is
If b=0, then WH(C)=0.
If b≠0, then WH(C)=n−Z(b) and
It is simple to see that ∑x∈F∗q(−1)Trq/2(bx)=−1. Then
In order to obtain the length of CDa and the weight of C∈CDa, we only need to calculate S(a,0) and S(a,b). In general, the exact values of S(a,0) and S(a,b) are hard to calculate, in Section 3, we shall consider two special cases.
This paper is organized as follows. In Section 2, we recall some concepts and several results about Gaussian sums in semi-primitive case. In Sections 3, we focus on the computation of the weight distribution of CDa defined as (1.1). In Section 4, we make a conclusion.
2.
Preliminaries
Let Fq be a finite field with q elements and α a fixed primitive element of Fq, i.e., F∗q=⟨α⟩. For two positive integers n>1 and N>1 with q−1=nN, define cyclotomic cosets of order N in Fq: C(N,q)i=αi⟨αN⟩,i=0,1,…,N−1. The cyclotomic numbers of order N in Fq are defined as follows:
When q=p is an odd prime, Lemmas 2.1–2.3 give cyclotomic numbers of order 2, 6 and order 8, respectively.
Lemma 2.1. [17] If p≡1(mod4), then (0,0)2=p−54,(0,1)2=(1,0)2=(1,1)2=p−14. If p≡3(mod4), then (0,1)2=p+14,(0,0)2=(1,0)2=(1,1)2=p−34.
Lemma 2.2. [3] Suppose that p≡1(mod24) is a prime. Then 4p=u2+27v2, u,v∈Z and u≡1(mod3). The possible values for the cyclotomic numbers of order 6 as follows (Table 1):
These 10 fundamental constants (0,0),…,(2,4) are given by the relations contained in the following table (Table 2).
Lemma 2.3. [1,3] Suppose that p≡1(mod16) is a prime. Then p=E2+4F2=A2+2B2, E,F,A,B∈Z and E≡A≡1(mod4). The possible values for the cyclotomic numbers of order 8 as follows (Table 3):
These 15 fundamental constants (0,0),…,(2,5) are given by the relations contained in the following table (Table 4).
Let q be odd, define the quadratic multiplicative character of Fq denoted by η as follows: η(c)=1 if c is the square element of F∗q and η(c)=−1 otherwise. If q is an odd prime, then for c∈F∗q, we have η(c)=(cq), where (⋅q) is the Legendre symbol.
Let Trq/2 be the trace function from Fq to F2 defined by Trq/2(x)=x+x2+⋯+xq/2, x∈Fq, and χ is the canonical additive character of Fq: For c∈Fq, χ(c)=(−1)Trq/2(c). It is a well-known fact that ∑c∈Fqχ(c)=0. In the following, we list a useful result, which is called the semi-primitive case.
Lemma 2.4. [15]HY__HY, Theorem 1] Let q=22sd and N∣(2d+1), where s and d are positive integers. Let α be a primitive element of Fq. Then for a=αb∈F∗q and Indα(a)=b,
Lemma 2.5. [3] Suppose that p is a prime and p≡1(mod24). Then p=A2+3B2 and 4p=u2+27v2, where A,B∈Z and A≡1(mod3), u,v∈Z, u≡1(mod3) and v=A−B3.
3.
Main results
In this section, let p be an odd prime with p≡1(mod4), N=pm a positive integer, ordN(2)=f, and q=2f, where f=ϕ(N)2 and ϕ(⋅) is the Euler's function. We always suppose that α is a primitive element of Fq, β=αq−1N and γ=βpm−1 is a primitive N-th and p-th root of unity in Fq.
Recall that the length of CDa is equal to
and for b∈F∗q, the weight WH(C),C∈CDa is
The length of CDa and the weight WH(C),C∈CDa is relate to the value S(a,0) and S(a,b), respectively.
Let S(a)=∑N−1i=0(−1)Trq/2(aβi). Then
Recall that for b∈F∗q,
Let H=⟨αN⟩, F∗q=∪N−1i=0αiH. Then
By p≡1(mod4) and Lemma 2.4,
In the following, for two cases about a∈Fq, we calculate the values S(a,0) and S(a,b),b∈F∗q. Let F∗p=⟨θ⟩=H0∪H1, H0=⟨θ2⟩ is a subgroup consisting of all square elements of index 2 in F∗p, and H1=θH0 consists of all non-square elements in F∗p. First, we give an lemma.
Lemma 3.1. [14] Suppose that H1 is the set consisting of all non-square elements in F∗p, then for 0≤i≤N−1,
Suppose that r|(p−1) and a=∑r−1j=0γwζjr∈Fq, where γ=βpm−1, w∈F∗p, and ζr is a primitive r-th root of unity in Fp.
For 0≤i≤N−1, let i=kpm−1+l, 0≤k≤p−1, 0≤l≤pm−1−1. By Lemma 3.1 and note that if l≠0, then Trq/2(β(k+wζjr)pm−1+l)=0. Then
where
Let W={−w,−wζr,…,−wζr−1r}. By Lemma 3.1 and by the fact that the product of any two square elements or any two non-square elements is a square element and the product of a square element with a non-square element is a non-square element, we can easily check that if x∈Fp∖W, then ∑r−1j=0Trq/2(γx+wζjr) and Trq/2(γΠr−1j=0(x+wζjr)) have the same parity. Then
Theorem 3.2. The notations are as above. Let p≡1(mod24) be a prime. Then 4p=u2+27v2, u,v∈Z and u≡1(mod3). Suppose that a=∑5j=0γwζj6∈Fq.
(1) If (2p)3=1, then
(1) If (2p)3≠1, then
Proof. By (3.1), we only need to calculate Ω denoted by (3.2). Let
where W={−w,−wζ6,−wζ26,−wζ36,−wζ46,−wζ56}.
Let F∗p=⟨θ⟩, C(2,p)i=θi⟨θ2⟩, i=0,1, and C(6,p)i=θj⟨θ6⟩,j=0,1,2,3,4,5. It is clear that C(2,p)0=C(6,p)0∪C(6,p)2∪C(6,p)4 and C(2,p)1=C(6,p)1∪C(6,p)3∪C(6,p)5. For w∈F∗p, Π5j=0(x+wζj6)=x6−w6. Now we count the number :
If x=0, then x6−w6=y2 has a solution y∈Fp, i.e., when x=0, there exists a y∈Fp, but not unique, such that x6−w6=y2.
If x≠0, x6−w6=y6 is equivalent to 1+(−(wx)6)=(yx)6, then the number of wx such that 1+(−(wx)6)=(yx)6 is equal to |(1+C(6,q)0)∩C(6,q)0|=(0,0)6 and the number of x such that x6−w6=y6 is equal to 6(0,0)6. Similarly, the number of x such that x6−w6=γ2y6 is equal to 6(0,2)6 and the number of x such that x6−w6=γ4y6 is equal to 6(0,4)6.
Suppose that 2 is a cubic residue modulo p, i.e, (2p)3=1. By Lemma 2.2,
Suppose that 2 is not a cubic residue modulo p, i.e., (2p)3≠1. By Lemma 2.2,
Moreover, by p≡1(mod24),
Similarly,
Thus
Note that
Hence
□
Theorem 3.3. The notations are as above. Let p≡1(mod16) be a prime. Then p=E2+4F2=A2+2B2, E,F,A,B∈Z and E≡A≡1(mod4). Suppose that a=∑7j=0γwζj8∈Fq, then
Proof. By (3.1), we only need to calculate Ω denoted by (3.2). Let
where W={−w,−wζ8,−wζ28,−wζ38,−wζ48,−wζ58,−wζ68,−wζ78}.
Let F∗p=⟨θ⟩, C(2,p)i=θi⟨θ2⟩, i=0,1, and C(8,p)i=θj⟨θ8⟩,j=0,1,2,3,4,5,6,7. It is clear that C(2,p)0=C(8,p)0∪C(8,p)2∪C(8,p)4∪C(8,p)6. For w∈F∗p, Π7j=0(x+wζj8)=x8−w8. Now we count the number :
If x=0, then x8−w8=y2 has a solution y∈Fp, i.e., when x=0, there exists a y∈Fp, but not unique, such that x6−w6=y2.
If x≠0, similar to the discussion of Theorem 3.2, the number of x such that x8−w8=y8, x8−w8=γ2y8, x8−w8=γ4y8, and x8−w8=γ6y8 is equal to 8(0,0)8, 8(0,2)8, 8(0,4)8, and 8(0,6)8, respectively.
Suppose that (2p)4=1 or suppose that (2p)4≠1. By Lemma 2.3,
Moreover, by p≡1(mod16), it is easy to check that if x∈W, then
Thus
Hence
and
□
Recall that the length of CDa defined as (1.1) is equal to n=12(q−1+S(a,0)) and S(a,0)=q−1NS(a). Then the following results are obtained.
Theorem 3.4. The notations are as Theorem 3.2.
(1) If (2p)3≠1, then the length of CDa defined as (1.1) is equal to
(2) If (2p)3=1, then the length of CDa defined as (1.1) is equal to
Theorem 3.5. The notations are as Theorem 3.3. The length of CDa defined as (1.1) is equal to
Now we return to investigate the weight WH(C) of C∈CDa.
Theorem 3.6. Let p≡1(mod24) be a prime. Then 4p=u2+27v2, u,v∈Z and u≡1(mod3). Suppose that a=∑5j=0γwζj6∈Fq, where w∈H0.
(1) If (2p)3≠1, then CDa defined as (1.1) is a two weight binary linear code with length (q−1)(2pm−p+5−u−9v)2pm and its weight distributions are given by Table 5.
(2) If (2p)3=1, then CDa defined as (1.1) is a two weight binary linear code with length (q−1)(2pm−p+5+2u)2pm and its weight distributions are given by Table 6.
Proof. Suppose that a=∑5j=0γwζj6∈Fq, w∈H0. By Theorem 3.2,
If b∈F∗q, then
We only need to count the number of b∈F∗q such that Trq/2(ab−q−1N)=0 or 1. It is clear that ord(b−q−1N)=pt,0≤t≤m.
If t≥2, then ord(γwζj6b−q−1N)=pt>p, where j=0,…,5. So by Lemma 3.1, Trq/2(ab−q−1N)=0. Moreover, b=αpm−tμ, where 0<μ≤q−1pm−t−1 and gcd(μ,p)=1. Hence there are ∑mt=2(q−1pm−t−q−1pm−t+1)=q−1−q−1pm−1 such elements b∈F∗q such that ord(b−q−1N)>p.
If 0≤t≤1, i.e, b−q−1N=γx, 0≤x≤p−1, it is obvious that there are q−1pm elements b.
Moreover,
Suppose that x∈W={−w,−wζ6,−wζ26,−wζ36,−wζ46,−wζ56}. Then
Hence there are 6(q−1)pm such elements b∈F∗q such that b−q−1N=γx.
Suppose that x∈Fp∖W. Then
By the proof of Theorem 3.2, there are Δ=p−7−u−9v2 such elements x∈Fp∖W such that Trq/2(ab−q−1N)=0; there are p−6−Δ=p−5+u+9v2 such elements x∈Fp∖W such that Trq/2(ab−q−1N)=1, where 4p=u2+27v2, u,v∈Z and u≡1(mod3).
Therefore there are
elements b∈F∗q such that Trq/2(ab−q−1N)=0; there are p−5+u+9v2⋅q−1pm such elements b∈F∗q such that Trq/2(ab−q−1N)=1. Then the Table 5 is given.
Suppose that (2p)3=1, we obtain the Table 6 similarly.□
Theorem 3.7. Let p≡1(mod16) be a prime. Then p=E2+4F2=A2+2B2, E,F,A,B∈Z and E≡A≡1(mod4). Suppose that a=∑7j=0γwζj8∈Fq, where w∈H1. Then CDa defined in (1.1) is a two weight binary linear code with length (q−1)(2pm−p−2E−4A−9)2pm and its weight distributions are given by Table 7.
Proof. Suppose that a=∑7j=0γwζj8∈Fq, w∈H1. By Theorem 3.3,
If b∈F∗q, then
We only need to count the number of b∈F∗q such that Trq/2(ab−q−1N)=0 or 1. It is clear that ord(b−q−1N)=pt,0≤t≤m.
If t≥2, then ord(γwζj8b−q−1N)=pt>p, where j=0,…,7. So by Lemma 3.1, Trq/2(ab−q−1N)=0. Moreover, b=αpm−tμ, where 0<μ≤q−1pm−t−1 and gcd(μ,p)=1. Hence there are ∑mt=2(q−1pm−t−q−1pm−t+1)=q−1−q−1pm−1 such elements b∈F∗q such that ord(b−q−1N)>p.
If 0≤t≤1, i.e, b−q−1N=γx, 0≤x≤p−1. it is obvious that there are q−1pm elements b.
Moreover,
Suppose that x∈W={−w,−wζ8,−wζ28,−wζ38,−wζ48,−wζ58,−wζ68,−wζ78}. Then
Hence there are 8(q−1)pm such elements b∈F∗q such that b−q−1N=γx.
Suppose that x∈Fp∖W. Then
By the proof of Theorem 3.3, there are Δ=p−9−2E−4A2 such elements x∈Fp∖W such that Trq/2(ab−q−1N)=0; there are p−8−Δ=p−7+2E+4A2 such elements x∈Fp∖W such that Trq/2(ab−q−1N)=1, where p=E2+4F2=A2+2B2, E,F,A,B∈Z and E≡A≡1(mod4).
Therefore there are
such elements b∈F∗q such that Trq/2(ab−q−1N)=0; there are p+9+2E+4A2⋅q−1pm such elements b∈F∗q such that Trq/2(ab−q−1N)=1.
The desired result follows.□
In the following, we give some examples.
Example 3.8. Let p=17. Then CDa is an [135,8,64] two-weight binary linear code with weight enumerator 1+135z64+120z72. The dual is an [135,127,3] binary linear code and is optimal, due to [6]. The code is also obtained from Theorem 3.2 in [20].
Example 3.9. Let p=97. Then 97≡1(mod24) and 97≡1(mod16). By Theorem 3.6 (1), 4p=192+27v2, by Lemma 2.5, v=1. By Theorem 3.7, p=92+4F2=52+2B2, F2=4 and B2=36. The weight distributions of CDa are given by Table 8.
From the above Table 8, we can see that the minimum Hamming distance of the line code in Theorems 3.6 (1) is larger than that of in Theorem 3.7.
Example 3.10. Let p=193. Then 193≡1(mod24) and 193≡1(mod16). By Theorem 3.6 (1), 4p=(−23)2+27v2, by Lemma 2.5, v=3. By Theorem 3.7, p=(−7)2+4F2=(−11)2+2B2, F2=36 and B2=36. The weight distributions of CDa are given by Table 9.
From the above Table 9, we can see that the minimum Hamming distance of the line code in Theorems 3.7 is larger than that of in Theorem 3.6.
4.
Conclusions
Suppose that p≡1(mod4) is a prime and ϕ(pm)2 is the multiplicative order of 2 modulo pm. Let q=2ϕ(pm)2, in this paper, we constructed two classes of two-weight linear codes over Fq and obtained their weight distributions. The main work was the calculations of two classes of exponential sums, which were special forms of exponential sums defined by Moisio in [16]. The technique that we adopted was to count the number of the square elements by cyclotomic numbers over Fp. By this method, other problems such as cross correlations of sequences and Walsh spectrums of functions can also be investigated.
Acknowledgments
We are very grateful to the reviewers and the editor for their valuable comments and suggestions that much improved the quality of this paper. The work was supported by National Natural Science Foundation of China under Grant 12171420 and Natural Science Foundation of Shandong Province under Grant ZR2021MA046.
Conflict of interest
The authors declare no conflicts of interest.