Recent progress on weight distributions of cyclic codes over finite fields ∗ Research Article

Cyclic codes are an interesting type of linear codes and have wide applications in communication and storage systems due to their efficient encoding and decoding algorithms. In coding theory it is often desirable to know the weight distribution of a cyclic code to estimate the error correcting capability and error probability. In this paper, we present the recent progress on the weight distributions of cyclic codes over finite fields, which had been determined by exponential sums. The cyclic codes with few weights which are very useful are discussed and their existence conditions are listed. Furthermore, we discuss the more general case of constacyclic codes and give some equivalences to characterize their weight distributions. 2010 MSC: 94B15, 11T71, 11T24


Introduction
The classes of cyclic codes play a very significant role in the theory of error-correcting codes.Cyclic codes can be efficiently encoded using shift registers, and they have rich algebraic structures for efficient error detection and correction, which explains their preferred role in engineering.Information Theory and Coding Theory have been widely considered to be born in 1948, when Claude Shannon's 1 landmark paper [75] on the mathematical theory of communication, showed that good codes exist 2 .Cyclic codes were introduced as early as 1957, nine years after that, in a series of papers by Prange [67]- [71].Since then, cyclic codes have been the most studied of all codes.Many well known codes, such as BCH, Kerdock, Golay, Reed-Muller, Preparata, Justesen, and binary Hamming codes, are either cyclic codes or can be constructed from cyclic codes.
In this paper, we survey some results on the weight distributions of cyclic codes over finite fields that have been recently determined by exponential sums.For a prime p, let F q be a finite field of characteristic p with q elements, i.e., q = p s , for some positive integer s.An [n, k, d] linear code C is a k-dimensional subspace of F n q with minimum distance d.Hereafter, we always assume that the code length n and the field characteristic p are coprime 3 .The code C is called cyclic if (c 0 , c 1 , . . ., c n−1 ) ∈ C implies (c n−1 , c 0 , c 1 , . . ., c n−2 ) ∈ C. By identifying the vector (c 0 , c 1 , . . ., c n−1 ) ∈ F n q with any code C of length n over F q corresponds to a subset of F q [x]/(x n −1).Then C is a cyclic code if and only if the corresponding subset is an ideal of F q [x]/(x n −1).Note that every ideal of F q [x]/(x n −1) is principal.
Hence there is a monic polynomial g(x) with least degree such that C = g(x) and g(x) | (x n − 1).Then g(x) is called the generator polynomial and h(x) = (x n − 1)/g(x) is called the check polynomial of the cyclic code C. Suppose that h(x) has t irreducible factors over F q , we call C the dual of the cyclic code with t zeros.
Let A i be the number of codewords with Hamming weight i in the code C of length n.The weight enumerator of C is defined by The sequence (1, A 1 , A 2 , . . ., A n ) is called the weight distribution of the code C. 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 decoding algorithms.This is quite useful in practice.Unfortunately, it is a very hard problem in general and remains open for most cyclic codes.
Let r = q m for a positive integer m and α a generator of F * r .Let h(x) = h 1 (x)h 2 (x) • • • h t (x), where h j (x) (1 ≤ j ≤ t) are distinct monic irreducible polynomials over F q .Let g j = α −sj be a root of h j (x) and as the founder of both digital computer and digital circuit design theory, when, in 1937, as a 21-year-old master's student at MIT, he wrote a thesis establishing that electrical application of Boolean algebra could construct and resolve any logical, numerical relationship.It has been claimed that this has been the most important master's thesis of all time.Shannon contributed to the field of cryptanalysis during World War II and afterwards, including basic work on code breaking. 2Shannon's theorem ensures that our hopes of getting the correct messages to the users will be fulfilled a certain percentage of the time.Based on the characteristics of the communication channel, it is possible to build the right encoders and decoders so that this percentage, although not 100%, can be made as high as we desire.However, the proof of Shannon's theorem is probabilistic and only guarantees the exixtence of such good codes.No specific codes were constructed in the proof that provides the desired accuracy for a given channel.The main goal of Coding Theory is to establish good codes that fulfill the assertions of Shannon's theorem.During the last 50 years, while many good codes have been constructed, but only from 1993, with the introduction of turbo codes [7], the rediscoveries of LDPC codes, and the study of related codes and associated iterative decoding algorithms, researchers started to see codes that approach the expectation of Shannon's theorem in practice. 3The case when the code length n is divisible by the characteristic p of the field yields the so-called repeated-root codes, which were first studied since 1967 by Berman [5], and then in the 1970s and 1980s by several authors such as Massey et al. [61], Falkner et al. [33], Roth and Seroussi [72].However, repeated-root codes were first investigated in the most generality in the 1990s by Castagnoli et al. [16], and van Lint [77], where they showed that repeated-root cyclic codes have a concatenated construction, and are asymptotically bad.To distinguish the two cases, codes when the code-length is not divisible by the characteristic p of the field are called simple-root codes.
n j the order of g j for 0 ≤ s j ≤ r − 2 (1 ≤ j ≤ t).Let m j be the least positive integer such that q mj ≡ 1 (mod n j ).In fact, we have deg(h j (x)) = m j for j = 1, 2, . . ., t. Denote δ = gcd(r − 1, s 1 , s 2 , . . ., s t ) and n = r−1 δ .A cyclic code C can be defined by where Tr q m j /q (a j ), Tr q m j /q (a j g j ), . . ., Tr q m j /q (a j g n−1 j )) and Tr q m j /q denotes the trace function from F q m j to F q .It follows from Delsarte's Theorem [22] that the code C is an [n, k] cyclic code over F q with the check polynomial h(x), In the rest of this paper, we use g i to denote the corresponding cyclic code.If we only give g 1 and g 2 , we mean that the dual of cyclic code has two zeros and the product of the minimal polynomials of g 1 and g 2 over F q is the check polynomial of such cyclic code.It is similar for cyclic codes whose duals have more zeros.In most cases, we also only list the cyclic codes whose weight distributions are known because they may have many nonzero weights.The reader can get the details on weight distributions in the corresponding references which are given.
For any a 1 , a 2 , . . ., a t ∈ F r , the Hamming weight of c(a 1 , a 2 , . . ., a t ) is equal to Tr q m j /q (a j g i j ) = 0}|.
Let φ be the canonical additive character of F q .Then ψ j = φ • Tr q m j /q is the canonical additive character of F r .By the orthogonal property of additive characters we have Tr q m j /q (a j g i j )) Hence determining the weight distribution of cyclic code is equivalent to determining the multiset {Z(r, t) : a j ∈ F q m j for j = 1, 2, . . .t}.
In general, it is very difficult and remains open for most cases.However, the weight distributions of cyclic codes had been determined in a few cases by using mathematical tools, such as Gauss periods, Gauss sums, quadratic forms, and the numbers of the solutions of equations over finite fields.
In view of the trace representation (2) of C, it is natural to study the weight distributions of irreducible cyclic codes (i.e., t = 1) and the duals of cyclic codes with two or three zeros (i.e., t = 2 or 3).There are few results [53,90] on weight distributions of cyclic codes with arbitrary zeros.Moreover, Ding and Yang [27] used Gauss periods to give an excellent survey on weight distributions of irreducible cyclic codes.In this paper, we mainly investigate the weight distributions of reducible cyclic codes which had been determined by exponential sums.The cyclic codes with few weights which are very useful are discussed and their existence conditions are listed.
The rest of this paper is organized as follows.In Section 2, we study the weight distributions of cyclic codes whose duals have two or three zeros.In Section 3, we present the results on weight distributions of cyclic codes whose duals have arbitrary zeros.In Section 4, we investigate the cyclic codes with Niho exponents.In Section 5, the cyclic codes with few weights are discussed and their existence conditions are listed.Section 6 discusses the more general case of constacyclic codes, we present some methods to study the equivalence classes of constacyclic codes.All constacyclic codes that are in the same equivalence class of cyclic codes share the same weight distributions and all results from previous sections hold for such constacyclic codes.
It is impractical to mention all recent work on weight distributions of cyclic codes in this paper.We focus on the weight distributions determined by exponential sums and some results may be omitted.An apparent omission is the weight distributions determined by combinatorial methods.However, we hope that this paper will show that weight distributions of cyclic codes which are determined by exponential sums in general.

Weights of the duals of cyclic codes with two or three zeros
We begin with the weight distributions of cyclic codes whose duals have two or three zeros because Ding and Yang had given an elegant survey on irreducible cyclic codes.For details we refer the readers to [27] and the references therein.Below we consider the cyclic codes whose duals have two zeros.The weight distributions of such codes are settled for a few special cases and is quite complex in general [17].
Let g 1 , g 2 , and g 3 be three zeros of h 1 (x), h 2 (x), and h 3 (x), respectively, and C the cyclic code as (1) with the check polynomial h(x) = h 1 (x)h 2 (x)h 3 (x).Now we assume that m 1 = m 2 = m 3 = m if we do not give a special statement and α is a primitive element of F q m .The weights of C were first studied in [14,18,81] by using exponential sums and combinatorial methods.Yuan et al. [91] used exponential sums to present the weight distributions of cyclic codes from perfect nonlinear functions.We refer the reader to [15] for a survey of highly nonlinear functions.Feng and Luo [34] presented a unified way to determine the weight distributions of cylic codes defined by perfect nonlinear functions.
Remark 2.2.Let the assumptions and the notations be as above theorem.Then f (x) = x p l +1 is called Dembowski-Ostrom function [23] and is called Coulter-Matthews function [21].

Quadratic forms and weight distributions
Quadratic form is an effective tool to determine the weight distributions of cyclic codes.Below we recall some results on quadratic forms.We refer the readers to [54] for more details on quadratic forms.Let H be an m × m symmetric matrix over F p .By identifying Suppose that r = rank(H).Then there exists M ∈ GL m (F p ) such that H = M HM ⊥ is a diagonal matrix and H = diag(a 1 , . . ., a r , 0, . . ., 0), where ).Then we have the following proposition.
Proposition 2.3.[35,54] Suppose that p is an odd prime.Let ( ∆ p ) denote the Legendre symbol and ζ p = e 2π √ −1 p be a complex p-th root of unity.Then we have By employing the above proposition, Feng and Luo [35,55] presented the weight distributions of several classes of cyclic codes.Since then a series of jobs were motivated by their original idea.
There is a parallel result on the exponential sums over quadratic forms for even p.Luo et al. [59] investigated these exponential sums and gave the weight distributions of cyclic codes associated with generalized Kasami sequences.
Theorem 2.5.[59] For even m, let l be an integer with 1 ≤ l ≤ m − 1 and l = m 2 .Then the weight distributions of binary cyclic codes C are known in the following cases: Remark 2.6.In the above theorem, m 1 = m 2 , m 2 = m and m 3 = m.
For the binary cyclic codes whose duals have two zeros, the calculations of their weight distributions is more important because it is equivalent to determine the value distribution of the cross-correlation function between two m-sequences and the Walsh transforms of monomials over finite fields.In fact, they represent the same mathematical problem (i.e., the calculation of exponential sum) in most cases.For more results of their relationships, cross-correlation function between two m-sequences, and the Walsh transforms of monomials, we refer the readers to [13,36,38,40,41,44,51,65,93] and references therein.

Gauss periods and weight distributions
There is another useful tool which is called Gauss periods to determine the weight distributions of cyclic codes.Now we recall the definition of Gauss period.
Let r − 1 = nN and α be a fixed primitive element of F r , where r = q m = p sm .We define C (N,r) i = α i α N for i = 0, 1, . . ., N − 1, where α N denotes the subgroup of F * r generated by α N .The Gauss periods of order N are given by where ψ is the canonical additive character of F r and η In general, the explicit evaluation of Gauss periods is a very difficult problem.However, they can be computed in a few cases: N = 2, 3, 4, semi-primitive case, and index 2 case [27,64].By using these known Gauss periods, the weight distributions of some classes of cyclic codes were determined.
For future use, here we also introduce Gauss sums which are closely related to Gauss periods.Let be a multiplicative character of F * r .Now we define the Gauss sum over F r by It is easy to see that G(λ 0 ) = −1, where λ 0 is the trivial multiplicative character, i.e., λ 0 (x) = 1 for all x ∈ F * r .Gauss sums can be viewed as the Fourier coefficients in the Fourier expansion of the restriction of ψ to F * r in terms of the multiplicative characters of F r , i.e., By (4), we can obtain where λ is a primitive multiplicative character of order N over F * r .Generally, the explicit determination of Gauss sums is a difficult problem.However, they can be explicitly evaluated in the following cases [6,89]: quadratic Gauss sums, semi-primitive Gauss sums, and index 2 Gauss sums.
Ding [24] used Gauss periods to determine the weight distributions of irreducible cyclic codes.Moreover, a survey on the weight distributions of irreducible cyclic codes determined by Gauss periods was given by Ding and Yang [27].Below we consider the weight distributions of reducible cyclic codes.
Let m 1 = m 2 = m, r = q m , and α a generator of F * r .Let h be a positive factor of q − 1 and e > 1 an integer such that e | gcd(q − 1, hm).Define We easily see that the order of g is n and (βg) n = 1.It had been proved that the minimal polynomials of g −1 and (βg) −1 over F q are distinct except when q = 3, h = 1, e = m = 2 [87].Hence their product is a factor of x n − 1.
Let g 1 = g −1 and g 2 = (βg) −1 .In general, we have then the weight distribution of the code C which is called the dual of primitive cyclic code with two zeros had been studied in [9,13,14,18,62,63,74].
In this subsection, we only consider cyclic codes whose weight distributions are determined by Gauss periods, so we do not describe the results on primitive cyclic codes here.In fact, to determine the weight distributions of cyclic codes, more mathematical tools are employed, such as Gauss sums, Jacobi sums, and elliptic curves.9. e = 2 and p j + 1 ≡ 0 (mod N ) for some positive integer j [88].
In [79], Vega presented an extended version for the class of cyclic codes studied by Ma et al. [60] and gave their weight distributions.Moreover, a general description for such reducible cyclic codes which generalizes the code C with e = 2 was given by Vega and Morales [80].The weight distributions of these general cyclic codes were determined explicitly and the main tool is also Gauss periods.
Theorem 2.8.[80] Suppose that q is odd and sm is even.Let d, a 1 , a 2 , and δ be four integers such that 2d | sm, a 1 − a 2 = ± r−1 2 , and δ = gcd( r−1 q−1 , a 1 ).Let λ 1 , λ 2 be two divisors of q − 1 such that δ and its weight distribution can be computed explicitly; 2. C is a projective linear code which means the minimum weight of its dual code is at least three if and only if δ = 1 and λ = 2.
In this subsection, we have investigated the weight distributions of cyclic codes in the case m 1 = m 2 = m.Now we concentrate on the case m 1 = m 2 .In [46,47], the authors used Gauss periods to express the weight distributions of such cyclic codes.Moreover, a more general result on cyclic codes whose duals have two zeros was given in [48].Based on the expression via Gauss periods, the weight distributions of several classes of cyclic codes were explicitly presented.
Let α be a fixed primitive element of F r and F * q m i = α i , where , dN 1 ), and d 4 = gcd(M 2 , dN 2 ), then the weight distribution of the cyclic code C with g 1 = α −N1 1 and g 2 = α −N2 2 is given by Table 1.

Weight
Frequency 0 1 Table 2. Weight distribution of C from two distinct finite fields.
As an application of Theorem 2.9, the weight distribution of cyclic code from two distinct finite fields (i.e., N 1 = N 2 = 1) was presented.
cyclic code and its weight distribution is given by Table 2.
If gcd(m 1 , m 2 ) = 1, then the weight distributions of the cyclic codes C can be explicitly determined when the Gauss periods of order δ are known.
three-weight cyclic code and its weight distribution can be explicitly determined.

If gcd
four-weight cyclic code and its weight distribution can be explicitly determined.
In particular, if (q − 1) | m 1 or (q − 1) | m 2 , then we have δ = 1 by gcd(m 1 , m 2 ) = 1.Thus C is a three-weight cyclic code.Moreover, if q = 2, then the corresponding code C is a three-weight binary cyclic code which is more interesting in communication and storage systems.
If N 1 = N 2 = 2, then we have the following theorem.
Theorem 2.12.[48] Let r = q m with q odd, m 1 , m 2 be two divisors of m with gcd(m 1 , m 2 ) = 1 and , m 1 +m 2 ] cyclic code with five nonzero weights and its weight distribution can be explicitly determined.
More classes of cyclic codes can be presented by Theorem 2.9 and it is unnecessary to state them here.We refer the readers to [46][47][48] for more results.
In fact, the weight distributions of most cyclic codes whose duals have few zeros are open.Moreover, zeta functions were also employed to determine the weight distributions of the duals of cyclic codes with two zeros [9].It is a good research problem to present the weight distributions of cyclic codes by using zeta functions, quadratic forms, Gauss periods, or other mathematical tools.

Weight distributions of cyclic codes with arbitrary zeros
In this section, we survey the weight distributions of cyclic codes with arbitrary zeros.It is in general very difficult to compute Z(r, t) if the dual of cyclic code has more zeros.Hence there are few results on such cyclic codes.

Hermitian forms graphs and weight distributions
Let G be a finite Abelian group and D a subset of G.The Cayley graph Cay(G, D) on G with connection set D is the directed graph with vertex set G and edge set {(g, h) : g, h ∈ G, gh −1 ∈ D}.
Let A = (a gh ) with entries in {0, 1} be a square matrix such that a gh = 1 if gh −1 ∈ D and a gh = 0 otherwise.We call A the adjacency matrix of Cay(G, D).It is known that each character χ of G corresponds to an eigenvector of A with eigenvalue χ(D) = d∈D χ(d) .Furthermore, the spectrum of Cay(G, D) is the multiset {χ(D) : χ ∈ G}, where G is the character group of G.
In this subsection, we always suppose that m = 2l for some integer l and s = 1, i.e., q = p.A matrix H over F p 2 is called Hermitian if H = H * , where H * is the conjugate transpose of H. Let H denote the Abelian group formed by all l × l Hermitian matrices over F p 2 under the matrix addition.The Hermitian forms graph is the Cayley graph Cay(H, D), where Then the Hermitian forms graph on W is the Cayley graph Cay(H, D).The eigenvalues of the Hermitian forms graph were first computed by Stanton [76] and a more accessible formula was given in [10] by using the Gaussian binomial coefficients.For details and more information on the spectrum of Hermitian forms graph, we refer the readers to [10].
Li et al. [53] proposed an elegant method to study this problem by building a connection between the corresponding exponential sums and the spectra of Hermitian forms graphs.
Very recently, Zhou et al. [99] generalized this class of p-ary cyclic codes proposed in [53] and the weight distributions of the generalized cyclic codes were settled for both even l and odd l along with the idea of Li, Hu, Feng, and Ge.

Yang-Xiong-Ding-Luo cyclic codes
By Yang-Xiong-Ding-Luo cyclic codes we mean a class of cyclic codes with arbitrary number of zeros proposed in [90].Now we describe this class of cyclic codes.
Main Assumptions: Let r = q m = p sm be a prime power for two integers s, m and let e ≥ t ≥ 2. Assume that 1. a ≡ 0 (mod r − 1) and e | (r − 1); 3. g j = α −aj for 1 ≤ j ≤ t, their minimal polynomials over F q are pairwise distinct, and and We easily see that eδ | N (q − 1).
It follows from Delsarte's Theorem [22] that the corresponding code C is an [n, tm] cyclic code over F q .
It was proved that Condition (3) can be met by the following simple criterion.
Criterion: [90] Suppose that for any proper factor of m (i.e.| m and < m) we have Then Condition (3) in the Main Assumptions holds.In particular, if N ≤ √ r, then Condition (3) in the Main Assumptions is met.
If t = 2, let a 1 = q−1 h and a 2 = q−1 h + r−1 e for positive integers e, h such that e | h and h | (q − 1), the code C had been studied in [26,37,60,82,[86][87][88]. Hence this class of cyclic codes with arbitrary zeros can be viewed as the generalization of cyclic codes whose duals have two zeros.The proper choices of these a i 's is key to compute the weight distribution of the code C. It may be very difficult to find the weight distribution if the integers a i are not chosen in the right way.
If t = e ≥ 2, the set {∆ j : 1 ≤ j ≤ e} is a complete residue system modulo e, so we may take Theorem 3.3.[90] Under the Main Assumptions, when N = 1 and t = e ≥ 2, the corresponding code C is a t-weight cyclic code over F q and its weight distribution can be explicitly presented.
The Gauss periods are known for N = 2, 3, 4, semi-primitive case, and index 2 case.Hence the weight distributions of more cyclic codes can be determined.Theorem 3.4.[90] Suppose that the Gaussian periods η (N,r) j of order N have µ distinct values {η 1 , η 2 , . . ., η µ }, and for each i(1 ≤ i ≤ µ), there are exactly τ i distinct js such that η ) Then, the corresponding code C is an [n, em] cyclic code over F q with at most µ+e e − 1 nonzero weights and its weight distribution can be explicitly presented when Gauss periods are known.

Cyclic codes from F l conjugates
Let F q be a finite field with q = l t and γ a primitive element of F q , where l is a prime power and t is a positive integer.Let g be an element in the algebraic closure of F q and m g (x) its minimal polynomial over F q .Suppose that deg(m g (x)) = m and F q m = F q (g).Then g = α −N and N | (q m − 1), where α is a primitive element of F q m .Let C be a cyclic code over F q with check polynomial where m g l u (x) is the minimal polynomial of g l u over F q for u = 0, 1, . . ., t − 1.It follows from Delsarte's Theorem [22] that the code C is an [n, tm] cyclic code over F q , where n = q m −1 N .It is well known that g(x) = (x n − 1)/h(x) ∈ F q [x] and every codeword of C is c(x) = a(x)g(x), where a(x) ∈ F q [x] and deg(a(x)) ≤ tm − 1.Note that the roots of h(x) are all the conjugates of g with respect to F l .Then h(x) ∈ F l [x] is the minimal polynomial of g over F l and g(x where s u (x) ∈ F l [x] and deg(s u (x)) ≤ tm − 1 for u = 0, 1, . . ., t − 1.Then we get It is easy to see that each s u (x)g(x) is a codeword of the irreducible cyclic code over F l whose check polynomial is h(x) for u = 0, 1, . . ., t − 1.Let T := Tr q m /l denote the trace function from F q m to F l .Then by the trace representation of the irreducible cyclic code, the cyclic code C can be expressed by C = {c(a 0 , a 1 , . . ., a t−1 ) : a 0 , a 1 , . . ., a t−1 ∈ F q m }, where c(a 0 , a 1 , . . ., a t−1 ) = ( When gcd( q m −1 l−1 , N ) = 1, the zeros of the check polynomial of the cyclic code C are α −N l u for u = 0, 1, . . ., t−1.In [90], Yang et al. also dealt with such problem and the zeros of the check polynomials of Yang-Xiong-Ding-Luo cyclic codes are α −(a+ q m −1 t u) for u = 0, 1, . . ., t − 1, where t | (q m − 1) and a ≡ 0 (mod q m − 1).Hence this class of cyclic codes with arbitrary number of zeros are different from Yang-Xiong-Ding-Luo cyclic codes.Theorem 3.5.[49] Let the notations be as above.If gcd( q m −1 l−1 , N ) = 1, then the corresponding code C is a t-weight cyclic code and its weight distribution can be explicitly determined.

Weight distributions of cyclic codes with Niho exponents
In this section, we always assume that q = p, i.e., s = 1.Now we consider the weight distributions of cyclic codes over F p with Niho exponents which are due to [65].
A positive integer d is of Niho exponent if d ≡ p i (mod p l − 1), where m = 2l for some integer l.Without loss of generality, we can assume that d ≡ 1 (mod p l −1).For two Niho exponents d = s(p l −1)+1 and d = s (p l − 1) + 1, we call them equivalent if d ≡ p i d (mod p m − 1) for some integer i.Moreover, d ≡ p l d (mod p m − 1) if and only if s + s ≡ 1 (mod p l + 1).Hence, s can be restricted in the range 1 ≤ s ≤ p l−1 + 1.
Let g 1 = α −d1 and g 2 = α −d2 for two Niho exponents d 1 , d 2 .Suppose that g 1 and g 2 are not conjugates over F p .To determine the weight distribution of the corresponding cyclic code C, by (3) we have to deal with the exponential sums Tr p m 1 /p (a1x d 1 )+Tr p m 2 /p (a2x d 2 ) p for a 1 , a 2 ∈ F r .If one of d 1 , d 2 is equal to 1 and p = 2, this class of cyclic codes with few nonzero weights were studied [18].Li, Feng, and Ge [52] gave some sufficient conditions for these codes to have few nonzero weights for both p = 2 and odd p.
Some preliminaries are necessary for determining the exponential sums T (a, b).Let F p m be a finite field with m = 2l and r = p m .Denote S = {x ∈ F r : xx = 1}, where x = x p l .Then S is a cyclic group of order p l + 1 and S = η with η = α p l −1 .From the properties of trace function, we easily obtain the following moment identities which is very important to determine the value distribution of T (a, b).Lemma 4.2. 1. a,b∈Fr

2.
a,b∈Fr is the number of solutions of the equations x d1 + y d1 = 0 x d2 + y d2 = 0 , x, y ∈ F r .

3.
a,b∈Fr is the number of solutions of the equations From the above two lemmas we see that determining the weight distributions of cyclic codes with Niho exponents is equivalent to count the number of solutions of the equation and the system of equations over finite fields.Hence, if cyclic codes with Niho exponents have many nonzero weights, it is very difficult to determine their weight distributions.Recently, Li, Feng, and Ge [52] presented the weight distributions of three classes of cyclic codes with Niho exponents.for integer t satisfying t ≡ 2 (mod 4) and t ≡ 0 (mod p l + 1).

Cyclic codes with few weights
Cyclic codes with few weights are of much interest in coding theory due to their applications in cryptography and combinatorics.In this section, we begin with some definitions.
A linear code is called to be projective if the minimum weight of its dual code is at least three.Moreover, a linear code is a N -weight code if the number of non-zero weights of this code is N .
A cyclic code of length n over F q is irreducible if its check polynomial is irreducible (its polynomial representation is a minimal ideal).It is said to be non-degenerate if its check polynomial is a primitive divisor of x n − 1 over F q (that is, the order of this polynomial is n).

One-weight cyclic codes
Let F r be a finite field with r = q m elements.When the length of a cyclic code C is r − 1 and the check polynomial is the minimal polynomial over F q of a primitive root of F r (in fact, C is an irreducible cyclic code), then the code C is called a simplex code or a subfield code.It is easily proved that C is a 1-weight code with (q − 1)q m−1 as its unique non-zero weight.
In [84], Wolfmann first gave some descriptions of one-weight cyclic codes via Pless identities [66].Furthermore, Vega and Wolfmann [81] presented a better and more simple characterization of one-weight irreducible cyclic codes.
Theorem 5.1.[81] Let C be an [n, k] irreducible cyclic code over F q with n = λ r−1 q−1 , where λ divides q −1.Let ρ be the order of the check polynomial of C, that is, the common order of its roots.The following assertions are equivalent: 1. C is a one-weight cyclic code; 2. C contains a codeword of weight λq m−1 ;

Two-weight cyclic codes
Two-weight linear codes are closely related to strongly regular graphs, partial difference sets, and finite projective spaces.There is a survey [12] to investigate their relationships.
For two-weight irreducible cyclic codes, Schmidt and White [73] in 2002 gave a classification by Gauss sums.They presented some necessary and sufficient numerical conditions on the parameters of an irreducible cyclic code to have at most two nonzero weights.It is conjectured that an irreducible cyclic code is a two-weight code if and only if it is a semi-primitive code or one of the eleven sporadic examples.Moreover, they gave a partial proof of this conjecture via generalized Riemann hypothesis.
Let q = p be a prime, and let u, m be positive integers such that u divides p m −1 p−1 .Let C be an irreducible cyclic code over F p defined by g 1 = α −u .For a positive integer x, let S p (x) denote the sum of the p-digits of x, that is, if Denote f =: ord u (p) (i.e., the least positive integer such that p f ≡ 1 (mod u)) and Then we have the following theorem.3.
In [85], Wolfmann gave a characterization of projective two-weight linear codes.Furthermore, a family of projective 2-weight irreducible cyclic codes were presented.
Similarly, a conjecture on projective two-weight non-degenerate irreducible cyclic codes was proposed in [85].
Conjecture 5.5.[85] Any projective two-weight non-degenerate irreducible cyclic code is a code satisfying conditions (1)-(3) of Theorem 5.4 except for eleven special cases deduced from Table 3.
Wolfmann [84] also characterized projective two-weight cyclic codes and proved that if a linear code C is a two-weight projective cyclic code of dimension m over F q , then either: (1) C is irreducible, or (2) if q = 2, C is the direct sum of two one-weight irreducible cyclic codes of length n = λ q m −1 q−1 , where λ divides q − 1 and λ = 1 and direct sum means direct sum as vector spaces.
It is clear that the code C is reducible in case (2) of Wolfmann's characterization [84].Two-weight reducible cyclic codes had also been presented in [39] and [81].Motivated by these results, in 2008, Vega [78] presented a family of two-weight reducible cyclic codes which were constructed as the direct sum of two one-weight cyclic codes and obtained their weight distributions.Moreover, this new family gives a unified explanation for all these two-weight cyclic codes that were presented in [39] and [81].To get Vega's result, Gauss sum introduced in Section 2 is a necessary tool.
Theorem 5.6.[78] Let p, q, and m be defined as before.Denote ∆ = q m −1 q−1 .Let a 1 , a 2 and v be integers such that a 1 q i ≡ a 2 (mod q m − 1), for all i ≥ 0, v = gcd(a 1 − a 2 , q − 1), and a 2 ∈ Z * ∆ .For some integer satisfying | gcd(a 1 , a 2 , q − 1), we set λ = (q−1) gcd(a1,a2,q−1) , n = λ∆, µ = q−1 ∆ , and ] be the minimal polynomials of α −a1 and α −a2 , respectively.Suppose that at least one of the following two conditions holds: and a 1 is a unit in the ring Z ∆ , or 2. for some integer j , with 1 ≤ p j < q m , we have where a 2 is the inverse of a 2 in Z ∆ .Then the following four assertions are true: (a) h 1 (x) and h 2 (x) are the check polynomials for two different one-weight cyclic codes of length n and dimension m.
(d) C is a projective code if and only if µ = v.

Three-weight cyclic codes
Cyclic codes with three nonzero weights have been applied in association schemes [11] and secret sharing schemes [97].Hence constructing three-weight cyclic codes is a good research problem.Recently, perfect nonlinear (or planar) and almost perfect nonlinear functions are employed to find three weight cyclic codes.
In [91], Yuan, Ding, and Carlet used planar functions to get two classes of three-weight cyclic codes.Feng and Luo [34] presented a unified way to investigate the weight distributions of cyclic codes from planar functions.Theorem 5.7.Let m ≥ 3 be odd and let q be an odd prime.Then the corresponding cyclic code C is a three-weight [q m − 1, 2m] cyclic code in the following cases: Table 4. Weight distribution of cyclic code from planar functions.
Moreover, its weight distribution is presented in Table 4.
Luo and Feng [58] extended the second construction in Theorem 5.7.
Theorem 5.8.[58] Let m ≥ 3 be odd and let q be an odd prime.Then the code C over F q defined by g 1 = α −1 and g 2 = α −v is a three-weight [q m − 1, 2m] cyclic code with the weight distribution in Table 5 if v = q l +1 2 , where l is a positive integer satisfying gcd(2m, l) = 1.
We remark that Table 4 and Table 5 are same when p = 3.Additionally, Ding, Gao, and Zhou [25,96] presented several classes of three-weight cyclic codes over F 3 from almost perfect nonlinear functions.Theorem 5.9.Let q = 3 and C be the ternary cyclic code defined by g 1 = α −1 and g 2 = α −v .Then C is a [q m − 1, 2m] three-weight cyclic code with weight distribution depicted in Table 4 or 5 in the following cases: Table 6.Weight distribution of three classes of cyclic code in [25].
Weight Frequency 0 1 Remark 5.10.For q = 3, x v is an almost perfect nonlinear function over F q m for the following v: if m ≡ 3 (mod 4); There are another three classes of three-weight cyclic codes whose weight distributions are given in Table 6 and are different from the one in Table 4 or 5.
In 2014, Li et al. [50] gave a more general description of three-weight cyclic codes defined by g 1 = α −1 and g 2 = α −v .Theorem 5.12.[50] Let m ≥ 3 be odd.Let q be any odd prime.If v is an integer satisfying (q l + 1)v ≡ 2 (mod q m − 1) for some positive integer v with gcd(m, l) = d, then C is a [q m − 1, 2m] cyclic code with the weight distribution in Table 7 if v ≡ 1 + q−1 2 (mod q − 1) and Table 8 when v ≡ 1 (mod q − 1).
There are more classes of three-weight cyclic codes presented in the literature.Three-weight cyclic codes were also constructed from Niho exponents [52] and two distinct finite fields [48].It is unnecessary to list all the results on three-weight cyclic codes and we have to omit some results here.In [35,96], the cyclic codes were proved to be three-weight by using quadratic forms.Table 8.Case: v ≡ 1 (mod q − 1).

Generalization to constacyclic codes
The concept of cyclic codes was extended naturally to negacyclic codes, 4 and then to constacyclic codes.Given a nonzero element λ of F q , a linear code C of length n over Just like cyclic codes, λ-constacyclic codes of length n over F q are classified as the ideals g(X) of the quotient ring F q [X]/ X n − λ , where the generator polynomial g(X) is the unique monic polynimial of minimum degree in the code, which is a divisor of X n −λ.When λ =1, λ-constacyclic codes are just cyclic codes and when λ = −1, λ-constacyclic codes are negacyclic codes.In general, the dual of a λ-constacyclic code of length n is a λ −1 -constacyclic code of length n.
There are cases when one code can be mapped onto another by means of a map which preserves the Hamming distances.Two codes C 1 , C 2 are considered to be of the same quality if there exists a mapping ϕ : F n q −→ F n q with ϕ(C 1 ) = C 2 which preserves the Hamming distance, i.e. d H ϕ(a), ϕ(a ) = d H (a, a ), for any a, a ∈ F n q .Mappings with the latter property are called isometries, and such codes are naturally called equivalent.There are various ways in which such an equivalence relation can be defined.For example, if C 1 , C 2 are linear codes, then we can naturally assume furthermore that the isometry ϕ is a linear map (e.g., [8]).
Since each λ-constacyclic code is an ideal of F q [X]/ X n − λ , it is natural to assume that isometries between constacyclic codes preserve the algebraic structures and Hamming distances.It turns out that if we can classify all the equivalence classes of constacyclic codes, we then only have to study the represtentative of those equivalence classes.In particular, if we can determine all constacyclic codes that are equivalent to cyclic codes, then all our results about Hamming weight and weight distributions of cyclic codes in previous sections hold true for those constacyclic codes.We devote this section to consider two type of equivalences, and for each type, we give the necessary and sufficient conditions for λ-and µ-constacyclic codes to be equivalent. 4As mentioned before, cyclic codes were introduced in 1957.Just about 11 years after that, negacyclic codes over finite fields Fp were initiated by Berlekamp in 1968 [3,4], where he showed that these codes are more useful for correcting errors measured relative to the Lee metric.Berlekamp also designed a decoding algorithm that can correct errors with Lee weight at most p−1 2 .A couple of years after that, in 1971, Kelsch and Green [45] were sucessful to provide non-binary negacyclic codes exceeding Berlekamp's p−1 First of all, some special results have been obtained in the literature.
is an F q -algebra isomorphism which is Hamming distance preserving.
In particular, in case n is odd, for λ = −1, it is obvious that µ = −1 satisfies the hypothesis of the above lemma.That means that negacyclic codes of odd length are scalar equivalent to cyclic codes of the same length, which is a well known result that was proven to be true for the more general case when the alphabet is a finite commutative ring.
Noting this fact, Dinh [29] established a one-to-one correspondence between negacyclic and cyclic codes, carrying results on negacyclic codes to cyclic codes accordingly.Proposition 6.2.[29, Proposition 6.1] Let p be an odd prime and q a power of p. Then the map ξ : X p s −1 .Equivalently, A is a negacyclic code of length p s over F q if and only if B is a cyclic code of length p s over F q .
Later on, Dinh in [30] showed that all constacyclic codes of length p s over F q are scalar equivalent to negacyclic codes.Proposition 6.3.[30, Proposition 3.1] Let p be an odd prime and q a power of p.Let λ ∈ F * q .Then there exists a unique element λ 0 in F * q such that λ p s 0 = −λ −1 .Let Φ be the map Φ : X p s −λ , given by Φ(f (X)) = f (λ 0 X).Then Φ is an F q -algebra isomorphism, and it is Hamming distance preserving.
For the more general alphabets of finite rings, [83] showed that cyclic and negacyclic codes over Z 4 have the same structure for odd code lengths.Dinh and López-Permouth in [28] generalized that to obtain that this fact holds true for cyclic and negacyclic codes of odd lengths over any finite chain ring.Batoul et al. in [2,Proposition 3.4] extended this result to a more general setting.Generalizing the ideas above, Chen et al. in [19] introduced a concept called "isometry" for the nonzero elements of F q to classify constacyclic codes over F q such that the constacyclic codes belonging to the same isometry class have the same distance structures and the same algebraic structures.Definition 6.4.[19, Definition 3.1] Let λ, µ ∈ F * q .We say that an F q -algebra isomorphism is an isometry if it preserves the Hamming distances on the algebras, i.e.
And, if there is an isometry between F q [X]/ X n −λ and F q [X]/ X n −µ , then we say that λ is n-isometric to µ in F q , written λ ∼ =n µ.
Clearly, the n-isometry " ∼ =n" is an equivalence relation on F * q , hence F * q is partitioned into n-isometry classes.If λ ∼ =n µ, then the λ-constacyclic codes of length n are in one to one correspondence with the µconstacyclic codes of length n such that the corresponding constacyclic codes have the same dimension and the same distance distribution, specifically, have the same minimum distance; at that case for convenience, the λ-constacyclic codes of length n are said to be isometric to the µ-constacyclic codes of length n.So, it is enough to study the n-isometry classes of constacyclic codes.
We have the following result.Theorem 6.5.[19, Theorem 3.2] For any λ, µ ∈ F * q , the following three statements are equivalent to each other: (ii) λ, ξ n = µ, ξ n , where λ, ξ n denotes the subgroup of F * q generated by λ and ξ n .
(iii) There is a positive integer k < n with gcd(k, n) = 1 and an element a ∈ F * q such that a n λ = µ k and the following map which maps any element f In particular, the number of n-isometry classes of F * q is equal to the number of positive divisors of gcd(n, q − 1).
Taking µ = 1, we see that λ ∼ =n 1 implies that there is an isometry ϕ a : F q [X]/ X n − 1 → F q [X]/ X n − λ such that ϕ(X) = aX.Thus for the constacyclic codes n-isometric to cyclic codes, the following consequence is closely related to [42,Lemma 3.1] or [1, Corollary 2.1].Corollary 6.6.[19,Corollary 3.4] Let n be a positive integer, and λ ∈ F * q .The λ-constacyclic codes of length n are isometric to the cyclic codes of length n if and only if a n λ = 1 for an element a ∈ F * q ; further, in that case the map which maps f (X) to f (aX), is an isometry, and is an irreducible factorization of X n − λ in F q [X], where n = n p s with s ≥ 0 and p | n , M ri (X) is the irreducible factor of X n − 1 over F q corresponding to the q-cyclotomic coset containing r i .In particular, any λ-constacyclic code C has a generator polynomial as follows: As an immediate application of Corollary 6.6, the next result can be regarded as a generalization of Proposition 6.3.Corollary 6.7.(cf.[19,Corollary 3.5]) If n is a positive integer coprime to q − 1, then there is only one n-isometry class in F * q ; in particular, for any λ ∈ F * q the λ-constacyclic codes of length n are isometric to the cyclic codes of length n, i.e. a n λ = 1 for an a ∈ F * q and all the (7), ( 8) and ( 9) hold.
Although λ ∼ =n µ means there exists an isometry φ between the rings F q [X]/ X n − λ and F q [X]/ X n − µ , it is not easy to connect the generator polynomial of the λ-constacyclic code C with the generator polynomial of φ(C), and as a result, it is not easy to describe the relationship between the duals C ⊥ and φ(C) ⊥ .
To overcome this problem, Chen, Dinh and Liu in [20] considered a more specified relationship than the isometry " ∼ =n ", that enabled us to obtain a much more explicit description of the generator polynomials of all constacyclic codes.This detailed description also allows us to establish the generator polynomials of the dual codes.A new equivalence relationship " ∼ n " is introduced on the nonzero elements of F q to classify constacyclic codes of length n over F q .Some necessary and sufficient conditions for any two nonzero elements of F q to be equivalent to each other are established.It is shown that, if λ ∼ n µ then there exists a very explicit F q -algebra isomorphism ϕ between F q [X]/ X n − λ and F q [X]/ X n − µ .Furthermore, the generator polynomial of the λ-constacyclic code C and the generator polynomial of the µ-constacyclic code ϕ(C) are connected in a very simple way.Definition 6.8.[20, Definition 3.1] Let n be a positive integer.For any elements λ, µ of F * q we say that λ and µ are n-equivalent in F * q and denote by λ ∼ n µ if the polynomial λX n − µ has a root in F q .In this case, we say λ-constacyclic codes are n-equivalent to µ-constacyclic codes.
It is routine to check that ∼ n is an equivalence relationship on F * q .The next result shows that λ and µ are n-equivalent if and only if they are belonging to the same coset of ξ n in ξ .In other words, the cosets of ξ n in ξ give all the n-equivalence classes, thus each n-equivalence class contains the same number of elements.Theorem 6.9.[20, Theorem 3.2] For any λ, µ ∈ F * q , the following four statements are equivalent: (i) There exists an a ∈ F * q such that ψ : is an F q -algebra isomorphism.
(ii) λ and µ are n-equivalent in F * q .
In particular, the number of the n-equivalence classes in F * q is gcd(n, q − 1).
Comparing with the equivalence relation " ∼ =n " mentioned previously, one can easily find that λ ∼ n µ implies λ ∼ =n µ.However, the converse of this statement is not true in general.In fact, Theorem 6.5 implies that if λ ∼ =n µ then there exists a positive integer k coprime to n such that λ ∼ n µ k .Therefore, every isometry class is equal to some unions of n-equivalence classes.We give the following illustrative example.

Concluding remarks
In this paper, we investigated the weight distributions of cyclic codes determined by exponential sums.It is clear that Gauss periods, Gauss sums, and quadratic forms are important tools.The weight distributions of cyclic codes have been studied for many years and are known in some cases.However, it remains open for most cyclic codes.Thus there are many challenging problems to be solved.

Theorem 4 . 3 .
[52] Let C be a cyclic code defined by g 1 = α −d1 and g 2 = α −d2 for two Niho exponents d 1 , d 2 .Then the weight distribution of the p-ary cyclic code C with the following Niho exponents are known:

2 bound. 1 2 1 2
They constructed 2-errorcorrecting negacyclic codes of length 3 m −with redundancy 2m over F3, and all negacyclic codes of length p m −with redundancy mt over Fp.