New Classes of p -ary Few Weights Codes
aa r X i v : . [ c s . I T ] M a r New Classes of p -ary Few Weights Codes ∗ Minjia Shi , , Rongsheng Wu , Liqin Qian , Lin Sok , , Patrick Sol´e School of Mathematical Sciences, Anhui University, Hefei, 230601, China National Mobile Communications Research Laboratory,Southeast University, 210096, Nanjing, China Department of Mathematics, Royal University of Phnom Penh, Cambodia CNRS/LAGA, University of Paris 8, 2 rue de la Libert´e, 93 526 Saint-Denis, France
Abstract:
In this paper, several classes of three-weight codes and two-weightcodes for the homogeneous metric over the chain ring R = F p + u F p + · · · + u k − F p , with u k = 0 , are constructed, that generalize the construction of Shi, Lin, Sol´e (2016),which is the special case of p = k = 2 . These codes are defined as trace codes. In somecases of their defining sets, they are abelian. Their homogeneous weight distributionsare computed by using exponential sums. In particular, in the two-weight case, wegive some conditions of optimality of their Gray images by using the Griesmer bound.Their dual homogeneous distance is also given. The codewords of these codes areshown to be minimal for inclusion of supports, a fact favorable to an application tosecret sharing schemes.
Keywords:
Two-weight codes; Three-weight codes; Homogeneous distance; Graymap ∗ This research is supported by National Natural Science Foundation of China (61672036), Tech-nology Foundation for Selected Overseas Chinese Scholar, Ministry of Personnel of China (05015133)and the Open Research Fund of National Mobile Communications Research Laboratory, SoutheastUniversity (2015D11) and Key projects of support program for outstanding young talents in Collegesand Universities (gxyqZD2016008). Introduction
Two-weight codes and three-weight codes form a class of combinatorial codeswhich are closely related to combinatorial designs, finite geometry and graph theory.Information on them can be found in [4, 5]. Some interesting two-weight and three-weight codes were presented in [6, 9, 12, 13]. It is worth mentioning that part ofthe codes they obtained have new parameters. A topical application of few weightscodes is their use in the Massey scheme [15] for secret sharing, an important topicin cryptography and computer security. In that application the poset based on thecodewords ordered by inclusion of support plays a crucial role [1, 7]. The mostfavorable case of access structures for the Massey scheme is that of all codewordsbeing minimal for that poset.Recently, the authors have constructed several infinite families of binary and p -aryfew weights codes from trace codes over F + u F , F p + u F p , and a non-chain ring,respectively in [17, 18, 19]. In addition, the authors have investigated the minimalcodewords of the codes they constructed, and proved that all the codewords areminimal.In the present paper, following this trend, we use as alphabet the larger ring R = F p + u F p + · · · + u k − F p , where p is a prime number and u k = 0 . Although mostof previous work on two-weight and three-weight codes were done on cyclic codes andcyclotomy [2], the first two families of codes we construct here are provably abelian.Their homogeneous weight distributions are determined by using exponential sums,Gauss sums in the second family, and sums similar to those in [12, 13] for the thirdfamily. By a Gray map, we obtain several infinite families of p -ary two-weight andthree-weight codes. As for the two-weight case, the image codes are shown to beoptimal for given length and dimension by the application of the Griesmer boundunder some conditions [10].The manuscript is organized as follows. Section 2 fixes some notations and defini-tions for this paper. Section 3 presents the main results. The optimality and the dualhomogeneous distance are discussed in Section 4. Section 5 determines the supportstructure of their Gray images, and the application to secret sharing schemes is given.Section 6 summarizes this paper and gives some challenging open problems.2 Preliminaries R Let R = F p m + u F p m + · · · + u k − F p m , which is a ring extension of R of degree m ,and m is a positive integer. There is a generalized Trace function , denoted by
T r ,from R down to R, and defined as T r ( a + a u + · · · + a k − u k − ) = tr ( a ) + tr ( a ) u + · · · + tr ( a k − ) u k − , for all a i ∈ F p m and i = 0 , , . . . , k −
1. Here tr () denotes thestandard trace of F p m down to F p . Any integer z can be written uniquely in base p as z = p ( z )+ pp ( z )+ p p ( z )+ · · · ,where 0 ≤ p i ( z ) ≤ p − , i = 0 , , , . . . . The Gray map
Φ : R → F p k − p is defined asfollows: Φ( a ) = ( b , b , b , . . . , b p k − − ) , where a = a + a u + · · · + a k − u k − . Then for all 0 ≤ i ≤ p k − − , ≤ ǫ ≤ p − , wehave b ip + ǫ = a k − + k − P l =1 p l − ( i ) a l + ǫa , if k ≥ ,a + ǫa , if k = 2 . We know that analogs Gray map have also been defined over finite chain rings in [11],linking the codes over rings to codes over finite fields. For instance, when p = k = 2,it is easy to check that the Gray map adopted in the trace codes of [17] is the sameas the Gray map defined here. As an additional example, when p = k = 3, writeΦ( a + a u + a u ) = ( b , b , b , . . . , b ). According to the definition above, we have0 ≤ i ≤
2, 0 ≤ ǫ ≤ k − P l =1 p l − ( i ) a l = p ( i ) a = ia . Then we get b = a , b = a + a , b = a + 2 a , b = a + a , b = a + a + a ,b = a + a + 2 a , b = a + 2 a , b = a + 2 a + a , b = a + 2 a + 2 a . It is easy to extend the Gray map from R n to F p k − np , and we also know from [20] thatΦ is injective and linear. 3 .3 Homogeneous metric For x = ( x , x , . . . , x n ) and y = ( y , y , . . . , y n ) ∈ F np , d H ( x, y ) = |{ i : x i = y i }| iscalled the Hamming distance between x and y and w H ( x ) = d H ( x, x . The Hamming weight of a codeword c = ( c , c , . . . , c n ) of F np can alsobe equivalently defined as w H ( c ) = n P i =1 w H ( c i ), where w H ( c i ) = 1, and it equals to 0if and only if c i is a zero element.The homogeneous weight of an element x ∈ R is defined as follows: w hom ( x ) = , if x = 0 ,p k − , if x ∈ ( u k − ) \{ } , ( p − p k − , if x ∈ R \ ( u k − ) . The homogeneous weight of a codeword c = ( c , c , . . . , c n ) of R n is defined as w hom ( c ) = n P i =1 w hom ( c i ). For any x, y ∈ R, the homogeneous distance d hom is givenby d hom ( x, y ) = w hom ( x − y ). As was observed in [20], Φ is a distance preservingisometry from ( R n , d hom ) to ( F p k − np , d H ), where d hom and d H denote the homogeneousand Hamming distance in R n and F p k − np , respectively. This means if C is a linear codeover R with parameters ( n, p t , d ), then Φ( C ) is a linear code of parameters [ p k − n, t, d ]over F p . Note that when p = k = 2, the homogeneous weight is none other than theLee weight, that was considered in [17]. Throughout this paper, let p be an odd prime, and let q = p m . Now we presentsome basic facts about Gauss sums. Denote the canonical additive characters of F p and F q by φ, χ , respectively. Denote the multiplicative characters of F p and F q by λ, ψ , respectively. The Gauss sums over F p and F q are defined respectively by G ( λ, φ ) = X x ∈ F ∗ p λ ( x ) φ ( x ) , G ( ψ, χ ) = X x ∈ F ∗ q ψ ( x ) χ ( x ) . Assume q is odd and let η be a quadratic multiplicative character of F q , which isdefined by η ( x ) = 1 , if x is the square of an element of F ∗ q and η ( x ) = − Q = X x ∈Q χ ( x ) , N = X x ∈N χ ( x ) , Q denotes the set of squares in F q and N denotes the set of nonsquares in F ∗ q .By orthogonality of characters [14, Lemma 9], it is easy to check that Q + N = − . Noting that the characteristic function of Q is η , then we get Q = G ( η, χ ) − , N = − G ( η, χ ) − . Let ( ap ) denote the Legendre symbol for a prime p and an integer a . The quadraticGauss sums are well known [8], and given as follows: G ( η, χ ) = ( − m − p ( p ∗ ) m , where p ∗ = ( − p ) p = ( − p − p. Let D be a subset of R ∗ , then we define a linear code over R as follows: C D = { ( T r ( xd )) d ∈D : x ∈ R} . D is called the defining set of the code C D . The selection of D directly affects theconstructed linear code, we can obtain few weights codes by the proper selection of D .In this subsection, we will give three defining sets of C D , and the weight enumeratoris computed in the next section. • The first defining set D : D = Q × F p m × · · · × F p m , so that |D | = p ( k − m ( p m − , where Q denotes theset of squares in F p m . • The second defining set D : D = R ∗ , where R ∗ denotes the group of units in R , i.e., R ∗ = { a + a u + · · · + a k − u k − : a ∈ F ∗ p m , a i ∈ F p m , i = 1 , , . . . , k − } , and it is immediate tocheck that the order of R ∗ is p ( k − m ( p m − D is a subgroup of D of index 2.Before defining the third defining set, we first introduce some notations. Let N ′ bea positive integer such that N ′ | ( p m − N ′ = lcm( N ′ , p m − p − ) and N ′ = gcd( N ′ , p m − p − ).Let α be a fixed primitive element of F p m . Define C N ′ i = α i h α N ′ i , i = 0 , , · · · , N ′ − , and h α N ′ i is a subgroup of F ∗ p m . Let n = N ′ /N ′ . Now we can define the third definingset. 5
The third defining set D : D = D ′ + u F p m + · · · + u k − F p m ⊆ R ∗ , where D ′ = { d j = α N ′ ( j − : j = 1 , , . . . , n } ⊆ C N ′ ⊆ F p m . Here { d , d , . . . , d n } forms a complete set of coset representatives of the factor group C N ′ / F ∗ p . For moredetails about the construction of D ′ , the reader may refer to [13]. In order to obtain our main results, we first introduce the following notations: • M is the maximal ideal of R , i.e., M = ( u ) = { a u + a u + · · · + a k − u k − : a i ∈ F p m , i = 1 , , . . . , k − } . • Ev i ( a ) = ( T r ( ax )) x ∈D i , where a is an element of the ring R , and i ∈ { , , } . Ev i () denote evaluation maps. • N = p k − |D | = ( p m − p ( k − m +1) / N = p k − |D | = ( p m − p ( k − m +1) ,and N = p k − |D | = n p ( k − m +1) = N ′ N ′ p ( k − m +1) . • ℜ (∆) is the real part of the complex number ∆.Abelian codes are a natural generalization of cyclic codes. Denote the ring ofintegers modulo m by Z m . With the integer n = s · s · · · · · s r , we associate thegroup G = Z s × Z s × · · · × Z s r . An Abelian code of length n over R attached tothe group G is an ideal in the algebra R [ X , X , . . . , X r ] / ( X s − , X s − , . . . , X s r r − . In other words, the code C over R is an ideal of the group ring R [ G ] , i.e., the coor-dinates of C are indexed by elements of G and G acts regularly on this set. In thespecial case when G is cyclic, that is r = 1 , the code is a cyclic code in the usualsense [14]. Proposition 1.
The subgroup D of R ∗ acts regularly on the coordinates of C D . Proof.
For any v ′ , u ′ ∈ D the change of variables x ( u ′ /v ′ ) x permutes the coordi-nates of C D , and maps v ′ to u ′ . Such a permutation is unique, given v ′ , u ′ . C D is thus an Abelian code with respect to the group D . In other words,it is an ideal of the group ring R [ D ] . As observed above, we do not know if C D iscyclic, since D is not a cyclic group. For the defining set D , the code C D has asimilar property, so we will not repeat it here. The next proposition shows that theGray images of C D and C D are invariant under a transitive group of permutations. Proposition 2.
A finite group of size N (resp. N ) acts transitively on the coordi-nates of Φ( C D ) (resp. Φ( C D ) ).Proof. We just consider the case k ≥ a = a + a u + · · · + a k − u k − bea codeword of C D , where a s ∈ F N p , s = 0 , , . . . , k −
1. According to the definitionof the Gray map, we assume that the value of the b ip + ǫ -th position of the codewordΦ( a ) is a k − + k − P l =1 p l − ( i ) a l + ǫ a , where 0 ≤ i ≤ p k − − ≤ ǫ ≤ p − d = (1 + d u + · · · + d k − u k − ) a , where d j ∈ F p ,j = 1 , . . . , k −
1, we know that the values of the b ip + ǫ -th positions of the codewordsΦ( d ) are a k − + d a k − + · · · + d k − a + k − P l =1 p l − ( i ) a l + ǫ a , it is easy to check that thevalues of the b ip + ǫ -th positions of the codewords Φ( d ) run through all the values of thecomponents in Φ( a ), so that Φ( C D ) is invariant under the involution that permutesthe p k − parts of a codeword. We have a similar proof for Φ( C D ), and omit detailshere.Let ω = exp( πip ) and y = ( y , y , . . . , y N ) ∈ F Np , then we define Θ( y ) = N P j =1 ω y j . For convenience, we write θ i ( a ) = Θ(Φ( Ev i ( a ))), and it can be verified that θ i ( sa ) =Θ(Φ( sEv i ( a ))), where i ∈ { , , } for any s ∈ F ∗ p . Before computing the homogeneousweight enumerator, we first state some auxiliary lemmas.
Lemma 1. [19, Lemma 1] For all y = ( y , y , . . . , y N ) ∈ F Np , we have p − X s =1 Θ( sy ) = ( p − N − pw H ( y ) . According to Lemma 1, we can check that for any codeword Ev i ( a ) of C D i , i ∈{ , , } , we have w hom ( Ev i ( a )) = ( p − N i − p − P s =1 θ i ( sa ) p . C D i ), i ∈{ , , } , and it guarantees that the dimension of the image code is km . The tracefunction is nondegenerate here, and the proof is easy, so we omit it. Lemma 2.
Fix i ∈ { , , } . If for some a, b ∈ R and all x ∈ D i , we have T r ( ax ) = T r ( bx ) , then a = b. Now, we discuss the homogeneous weight of the codewords in C D based on twocases. If m is even and p is odd prime, we will get an infinite class of three-weightcodes, while we will obtain an infinite class of two-weight codes when m is odd and p ≡ D m is even The following lemma is important to simplify the proof of part (iii) in Theorem 1.
Lemma 3.
Let a = a u + a u + · · · + a k − u k − ∈ M \{ } , x = x + x u + · · · + x k − u k − ∈ D and B = k − P i =1 a i x k − − i . Then P x ,...,x k − ∈ F pm ω tr ( B ) = 0 if and only if a i = 0 for i = 1 , , . . . , k − . Furthermore, we have P x ,...,x k − ∈ F pm ω tr ( B ) = p ( k − m when a = a = · · · = a k − = 0 . Proof.
Suppose otherwise that there exists an a j = 0, for j ∈ { , , . . . , k − } , suchthat P x ,...,x k − ∈ F pm ω tr ( B ) = 0, then we just need to consider the term P x k − − j ∈ F pm ω tr ( a j x k − − j ) ,which equals to zero, so P x ,...,x k − ∈ F pm ω tr ( B ) = 0, a contradiction. If a i = 0 for i = 1 , , . . . , k −
2, we have P x ,...,x k − ∈ F pm ω tr ( B ) = p ( k − m . The proof is completed. Theorem 1.
Assume a ∈ R , if m is even and p ≡ , then the homogeneousweight distribution of the codewords in C D is given below.(i) If a = 0 , then w hom ( Ev ( a )) = 0 ;(ii) If a ∈ R ∗ , then w hom ( Ev ( a )) = p − p N ;(iii) If a ∈ M \{ } , thenif a ∈ M \{ a k − u k − : a k − ∈ F p m } , then w hom ( Ev ( a )) = p − p N , f a = a ′ k − u k − , where a ′ k − ∈ F ∗ p m , then if a ′ k − ∈ Q , then w hom ( Ev ( a )) = p − p (cid:16) N + p ( k − m +1) ( p m + 1) / (cid:17) ,a ′ k − ∈ N , then w hom ( Ev ( a )) = p − p (cid:16) N − p ( k − m +1) ( p m − / (cid:17) . Proof.
Since m is even, it is easy to verify that s ∈ F ∗ p is always a square in F p m . Thus θ ( sa ) = θ ( a ) , for any s ∈ F ∗ p . Let x = x + x u + · · · + x k − u k − ∈ D , where x ∈ Q and x i ∈ F p m for i = 1 , , . . . , k −
1. The proof of part (i) is obvious.Assume a = a + a u + · · · + a k − u k − ∈ R ∗ , by a direct calculation we have T r ( ax ) = tr ( a x ) + tr ( a x + a x ) u + · · · + tr ( a x k − + a x k − + · · · + a k − x ) u k − =: E + E u + · · · + E k − u k − . Since P x k − ∈ F pm ω a x k − = 0, we can easily check that X x ∈Q X x ,x ,...,x k − ∈ F pm ω E k − = 0 . Note that each component of the Gray image Φ( Ev ( a )) contains E k − , so we can get θ ( a ) = 0 . Following Lemma 1, we obtain w hom ( Ev ( a )) = p − p N .Assume a = a u + a u + · · · + a k − u k − ∈ M \{ } , by a direct calculation we get T r ( ax ) = tr ( a x ) u + tr ( a x + a x ) u + · · · + tr ( a x k − + · · · + a k − x ) u k − =: B + B u + B u + · · · + B k − u k − . Let I = ∪ k − i =0 , where I t = { B t , B t , . . . , ( p − B t } , 0 ≤ t ≤ k −
2, so we knowthat I is a set with ( p − k −
1) elements. According to the Gray map defined inSubsection 2.2, we can write Φ(
T r ( ax )) = ( A , A , A , . . . , A k − ), where A = B k − , A j = { B k − + b i + b i + · · · + b i j | b i f ∈ I t , ≤ f ≤ j ≤ k − } and b i f are in thedifferent sets I t . Therefore, we haveΦ( Ev ( a )) = ( B k − , A , A , . . . , A k − ) x ,...,x k − . Since each component of Φ( Ev ( a )) contains B k − , using Lemma 3, it is easy to knowthat θ ( a ) = Θ(Φ( Ev ( a ))) = 0 if and only if a ∈ M \{ a k − u k − } , where a k − ∈ F p m ,which implies w hom ( Ev ( a )) = p − p N by the application of Lemma 1.9f a ∈ M \{ a k − u k − } , i.e., a = a ′ k − u k − , where a ′ k − ∈ F ∗ p m , then we have ax = a ′ k − x u k − . Thus T r ( ax ) = tr ( a ′ k − x ) u k − =: Du k − , and then Φ( Ev ( a )) = ( D, D, . . . , D | {z } p k − ) x ,x ,...,x k − . This gives θ ( a ) = Θ(Φ( Ev ( a ))) = p k − X x ∈Q X x ,...,x k − ∈ F pm ω D = p k − p ( k − m X x ∈Q ω D . After variable substitution, we see that the term P x ∈Q ω D equals Q or N dependingon a ′ k − ∈ Q or a ′ k − ∈ N . Because m is even and p ≡ G ( η ) = − p m , Q =( − p m − / N = ( p m − /
2. Then the statement follows from Lemma 1, i.e.,if a ′ k − ∈ Q , w hom ( Ev ( a )) = p − p ( N − p ( k − m +1) Q ) or w hom ( Ev ( a )) = p − p ( N − p ( k − m +1) N ) when a ′ k − ∈ N . Remark 1.
Theorem 1 together with Lemma 2 imply Φ( C D ) is a p -ary code oflength N , dimension km , with three nonzero weights w < w < w of values w = p − p (cid:16) N − p ( k − m +1) ( p m − / (cid:17) ,w = p − p N ,w = p − p (cid:16) N + p ( k − m +1) ( p m + 1) / (cid:17) , with respective frequencies f , f , f given by f = p m − , f = p km − p m , f = p m − . In the case of p ≡ G ( η, χ ) = p m when m is singly-even,and that G ( η, χ ) = − p m when m is doubly-even. We can also obtain a p -ary linearcode with three nonzero weights by using a similar approach, we omit the proof here.It is easy to check that whether p ≡ p ≡ m is even,the weight distribution of C D is the same.10 .1.2 m is odd and p ≡ G ( η, χ ) is imaginary, i.e., ℜ ( Q ) = ℜ ( N ) = − . Then, we give the following correlation lemma, which establishes alinkage between θ ( sa ) and ℜ ( θ ( a )). We use a similar method in Theorem 1 to discussthe homogeneous weight distribution of C D . Lemma 4. [19, Lemma 2] If p ≡ , then p − P s =1 θ ( sa ) = ( p − ℜ ( θ ( a )) . Theorem 2.
Assume a ∈ R , if m is odd and p ≡ , then the homogeneousweight distribution of the codewords in C D is given below.(i) If a = 0 , then w hom ( Ev ( a )) = 0 ;(ii) If a ∈ R ∗ , then w hom ( Ev ( a )) = p − p N ;(iii) If a ∈ M \{ } , thenif a ∈ M \{ a k − u k − : a k − ∈ F p m } , then w hom ( Ev ( a )) = p − p N ,if a = a ′ k − u k − , where a ′ k − ∈ F ∗ p m , then w hom ( Ev ( a )) = p − p (cid:16) N + p ( k − m +1) / (cid:17) .Proof. We just give the proof of the part (iii) here, the rest cases are similar to thosein Theorem 1. Note that ℜ ( θ ( a )) = 0 when a ∈ M \{ a k − u k − : a k − ∈ F p m } , and ℜ ( θ ( a )) = − p ( k − m +1) when a = a ′ k − u k − , where a ′ k − ∈ F ∗ p m . Combining Lemmas1 with 4, then we have pw hom ( Ev ( a )) = ( p − N − ( p − ℜ ( θ ( a )) . Then the result follows.
Remark 2.
Combining Theorem 2 with Lemma 2, we obtain an infinite family of p -ary two-weight codes of parameters [ N , km ] , with two nonzero weights w ′ < w ′ given by w ′ = p − p N , w ′ = p − p (cid:16) N + ( p ( k − m +1) ) / (cid:17) , with respective frequencies f ′ , f ′ given by f ′ = p km − p m , f ′ = p m − . It is necessary to distinguish the difference between the case when k = 2 in thepresent paper and the case in [19]. Although the ring and the defining set are the11ame as [19], which is not the special case of this paper, because the Gray maps aredifferent. We list their weight distributions in Tables I and II to show the difference.Table I . weight distribution of the three-weight case ( k = 2)Weight in [19, Theorem 1] Weight in Theorem 1 Frequency0 0 1( p m − p m − )( p m − p m ) ( p m +1 − p m )( p m − p m )2 p m − ( p m − p m − )( p m − ( p m +1 − p m )( p m − p m − p m ( p m − p m − )( p m + p m ) ( p m +1 − p m )( p m + p m )2 p m − Table II . weight distribution of the two-weight case ( k = 2)Weight in [19, Theorem 2] Weight in Theorem 2 Frequency0 0 1( p m − p m − )( p m − ( p m +1 − p m )( p m − p m − p m p m − ( p m +1 − p m ) p m ( p m +1 − p m )2 p m − ( p m +1 − p m )( p m − ( p m − p m − )( p m −
1) = p m ( p m +1 − p m )2 p m − ( p m +1 − p m ) = p , and we know the length of the codes has the same proportional relationship, namely,( p m − p m +1 ( p m − p m ) = p . D In this subsection, we will discuss the homogeneous weight of the codewords in C D . Using the similar method in Theorem 1, we give the next theorem withoutproof. Theorem 3.
Assume p is a prime number and a ∈ R , then the homogeneous weightdistribution of the codewords in C D is given below.(i) If a = 0 , then w hom ( Ev ( a )) = 0 ; ii) If a ∈ R ∗ , then w hom ( Ev ( a )) = p − p N ;(iii) If a ∈ M \{ } , thenif a ∈ M \{ a k − u k − : a k − ∈ F p m } , then w hom ( Ev ( a )) = p − p N ,if a = a ′ k − u k − , where a ′ k − ∈ F ∗ p m , then w hom ( Ev ( a )) = p − p (cid:16) N + p ( k − m +1) (cid:17) . Remark 3.
Theorem 3 together with Lemma 2, we can obtain Φ( C D ) is a p -arycode of length N , dimension km , with two nonzero weights w ′′ < w ′′ of values w ′′ = p − p N , w ′′ = p − p (cid:16) N + p ( k − m +1) (cid:17) , with respective frequencies f ′′ , f ′′ given by f ′′ = p km − p m , f ′′ = p m − . Note that when p = k = 2, the weight distribution of C D is exactly the same in[17]. This means Theorem 3 includes Theorem 1 in [17] as a special case.On the other hand, according to Theorems 2 and 3 in this section, we have obtainedtwo infinite classes of p -ary two-weight codes, it is easy to check that the correspondingdimension and frequency are the same, and the corresponding length and the nonzeroweights have constant ratio, i.e., w ′ w ′′ = w ′ w ′′ = N N = ( p m − p ( k − m +1) / p m − p ( k − m +1) = 12 , where w ′ and w ′ can be found in Remark 2. However, the conditions on p and m inTheorems 2 and 3 are different. D Let D ′ = { d j = α N ′ ( j − : j = 1 , , . . . , n } ⊆ F p m introduced in Subsection 2.5,then a linear code over F p of length n is defined by C D ′ = { ( tr ( xd ) , tr ( xd ) , . . . , tr ( xd n )) : x ∈ F p m } . Before giving the parameters of the code C D , we first introduce some weightformulas for the code C D ′ , which can be found in [13]. Let c b be a nonzero codewordin C D ′ , we write c b as ( tr ( bd ) , tr ( bd ) , . . . , tr ( bd n )), where b ∈ F ∗ q . Then we define N ( b ) = |{ ≤ j ≤ n : tr ( bd j ) = 0 }| , w H ( c b ) = n − N ( b ) . From [13], we know pN ( b ) = n + 1 N ′ N ′ − X j =0 G ( ¯ ϕ j , χ ) ϕ j ( b ) , (1)where ϕ is a multiplicative character of order N ′ in b F ∗ q and N ′ = gcd(N ′ , p m − − ). Here, b F ∗ q denotes multiplicative character group. Theorem 4.
Let N ′ = 1 . Assume m is even or m is odd and p ≡ .(i) If a = 0 , then w hom ( Ev ( a )) = 0 ;(ii) If a ∈ R ∗ , then w hom ( Ev ( a )) = ( p m − p ( k − m +1) − ;(iii) If a ∈ M \{ } , thenif a ∈ M \{ a k − u k − : a k − ∈ F p m } , then w hom ( Ev ( a )) = ( p m − p ( k − m +1) − ,if a = a ′ k − u k − , where a ′ k − ∈ F ∗ p m , then w hom ( Ev ( a )) = p k ( m +1) − . Proof.
It is suffices to prove the second condition of the part (iii), the proof of theremaining parts are similar to that of Theorems 1 and 2. Let x = x + x u + · · · + x k − u k − ∈ D and a = a ′ k − u k − , where a ′ k − ∈ F ∗ p m , by a direct calculation we get T r ( ax ) = T r ( a ′ k − x u k − ) = tr ( a ′ k − x ) u k − =: F u k − . Employing the Gray map yieldsΦ( Ev ( a )) = ( F, F, . . . , F | {z } p k − ) x ,x ,...,x k − . Then we have w hom ( Ev ( a )) = w H (Φ( Ev ( a ))) = p ( k − m +1) ( n − N ( a ′ k − )) , where N ( a ′ k − ) = |{ x ∈ D ′ : tr ( a ′ k − x ) = 0 }| . When N ′ = 1, we know n = p m − p − , by Formula (1), we know pN ( a ′ k − ) = n −
1, which implies w hom ( Ev ( a )) = p m − p ( k − m +1) . Remark 4.
Theorem 4 together with Lemma 2 implies that Φ( C D ) is a p -ary code oflength ( p m − p ( k − m +1) p − , dimension km , with two nonzero weights w ′′′ < w ′′′ of values w ′′′ = ( p m − p ( k − m +1) − , w ′′′ = p k ( m +1) − , f ′′′ , f ′′′ given by f ′′′ = p km − p m , f ′′′ = p m − . So far, we have obtained three infinite classes of p -ary two-weight codes in Theo-rems 2, 3 and 4, but they have different parameters. In Remark 3, we have comparedthe difference and correlation between the first two infinite classes of two-weight codesin Theorem 2 and Theorem 3, so it suffices to compare the parameters of the codesobtained from Theorems 3 and 4. For convenience, we list their weight distributionsin Table III to show the difference.Table III . weight distribution of C D and C D Weight in Theorem 3 Weight in Theorem 4 Frequency0 0 1( p − p m − p ( k − m +1) − ( p m − p ( k − m +1) − p km − p m ( p − p k ( m +1) − p k ( m +1) − p m − p −
1. However, the conditions on p and m in Theorems 3 and 4 aredifferent. Example 1.
Let ( p, m, k ) = (3 , , . If N ′ = 2 , then N ′ = 1 . In the light of Theorem , we can obtain Φ( C D ) is a [1053 , , ternary code, the nonzero weights are and and the corresponding frequencies are and , respectively. Theorem 5.
Suppose < N ′ < p m + 1 . Assume m is even or m is odd and p ≡ . Then C D is a ( N , p km , d hom ) linear code over R which has at most N ′ + 1 nonzero homogeneous weights, and p ( k − m +1) − · p m − ( N ′ − p m N ′ ≤ d hom ≤ p ( k − m +1) − · p m − N ′ . Proof.
We also assume that x = x + x u + · · · + x k − u k − ∈ D and a = a ′ k − u k − ,where a ′ k − ∈ F ∗ p m . We know from the proof of Theorem 4 that w hom ( Ev ( a )) = w H (Φ( Ev ( a ))) = p ( k − m +1) ( n − N ( a ′ k − )), where N ( a ′ k − ) = |{ x ∈ D ′ : tr ( a ′ k − x ) =15 }| . From Formula (1) and n = p m − p − N ′ , we have n − N ( a ′ k − ) = n − np − N ′ − P j =0 G ( ¯ ϕ j , χ ) ϕ j ( a ′ k − ) pN ′ = p m pN ′ − N ′ − P j =1 G ( ¯ ϕ j , χ ) ϕ j ( a ′ k − ) pN ′ . Note that (cid:12)(cid:12)(cid:12)(cid:12) N ′ − P j =1 G ( ¯ ϕ j , χ ) ϕ j ( a ′ k − ) (cid:12)(cid:12)(cid:12)(cid:12) ≤ ( N ′ − p m . Since N ′ < p m + 1, then p ( k − m +1) − · p m − ( N ′ − p m N ′ ≤ w hom ( Ev ( a )) ≤ p ( k − m +1) − · p m + ( N ′ − p m N ′ , here ϕ is a multiplicative character of order N ′ in b F ∗ q , so the above case gives at most N ′ nonzero homogeneous weights. The other cases give only a nonzero homogeneousweight p − p N by a similar discussion in Theorems 1 and 2. Hence the code C D has at most N ′ + 1 nonzero weights. In addition, it is easy to check that p − p N
Let m be even and N ′ > . Assume there exists a positive integer k ′ such that p k ′ ≡ − N ′ ) . Let t = m k ′ .(i) If N ′ is even, p, t and p k ′ +1 N ′ are odd, then the code C D is a three-weight linearcode provided that N ′ < p m + 1 , and its weight distribution is given in TableIV. Table IV . weight distribution of C D Weight Frequency0 1 p ( k − m +1) − · p m − ( N ′ − p m N ′ p m − N ′ p ( k − m +1) − · p m − N ′ p km − p m p ( k − m +1) − · p m + p m N ′ ( N ′ − p m − N ′ (ii) In all other cases, the code C D is a three-weight linear code provided that p m +( − t ( N ′ − > and its weight distribution is given in Table V. . weight distribution of C D Weight Frequency0 1 p ( k − m +1) − · p m +( − t ( N ′ − p m N ′ p m − N ′ p ( k − m +1) − · p m − N ′ p km − p m p ( k − m +1) − · p m − ( − t p m N ′ ( N ′ − p m − N ′ Proof.
In the part (i), let a = a ′ k − u k − , where a ′ k − ∈ F ∗ p m , we know from Theorem 5that this case gives at most N ′ nonzero weights in the following set n p m − pN ′ − pN ′ t s : s = 0 , , . . . , N ′ − o , where t s = N ′ − P j =0 G ( ¯ ϕ j , χ ) ϕ j ( a ′ k − ). In the proof of [13, Theorem 4.1], we have t s = ( − N ′ − p m if s = N ′ , − − p m otherwise . The other cases only give a nonzero weight p − p N , i.e., p ( k − m +1) − · p m − N ′ , then theresult follows. The part (ii) can be obtained in the same way. Example 2.
Let ( p, m, k ) = (3 , , . If N ′ = 4 , then k ′ = 1 and t = 2 . In the lightof Theorem 6, we can obtain Φ( C D ) is a [2430 , , ternary code, the nonzeroweights are , and , and the corresponding frequencies are , and , respectively. Remark 5.
In Theorems 6, when t is odd, then the parameters in Table IV andTable V are the same, while t is even, the parameters in both tables are different.According to Theorems 1 and 6, we have obtained three infinite classes of p -arythree-weight codes. If t is odd, it is easy to check the length and two of the threenonzero weights have constant ratio, i.e., w p ( k − m +1) − · p m − N ′ = w p ( k − m +1) − · p m + p m N ′ = N N = ( p − N ′ , where w = p − p N and w = p − p (cid:16) N + p ( k − m +1) ( p m + 1) / (cid:17) (see Theorem 1). Since N ′ >
2, we can check w p ( k − m +1) − · p m + p m N ′ = N ′ ( p − p m − p m )2( p m − ( N ′ − p m ) = ( p − N ′ , w = p − p (cid:16) N − p ( k − m +1) ( p m − / (cid:17) (see Theorem 1). On the other hand,the corresponding frequencies are also different. When t is even, we can discuss in asimilar way to show that these three infinite three-weight codes are different. Remark 6.
As for the defining set D , we have obtained several few weights p -arylinear codes by a linear Gray map. Although we adopt the idea about the constructionof the defining set D in [13], the results we obtained are completely different. Forinstance, Theorems 3.2 and 4.1 of [13] lead to several classes of p -ary one-weight andtwo-weight codes, while Theorems 4 and 6 produce several classes of p -ary two-weightand three-weight codes. In Section 3, we have shown that C D is a two-weight code or three-weight codedepending on the choice of m , p or other conditions. Now, we continue to exploreother properties about the codes we have constructed in Section 3. In this sectionwe will study the optimality of the image codes Φ( C D ), and the dual homogeneousdistance of the codes C D . Φ( C D ) If C is a linear code with parameters [ n, k, d ], and no [ n, k, d + 1] code exists, thenwe call the code C optimal. The next lemma introduces the Griesmer bound, whichapplies specifically to linear codes over finite fields. Lemma 5. [10, Griesmer bound] Let C be a linear p -ary code of parameters [ n, K, d ] ,where K ≥ . Then K − X i =0 (cid:24) dp i (cid:25) ≤ n. Theorem 7.
Assume m is odd and p ≡ . If the code C D is defined asabove for given length and dimension, then Φ( C D ) is optimal if m ≥ max n k, j p k − − k + 12( k − k + 1 o . Proof.
In the light of Theorem 2, we know Φ( C D ) is a [ N , km, d ] code, where d = w ′ = p − p N . Next we explore the condition such that km − P i =0 l d +1 p i m > N by using the18he Griesmer bound. First of all, we guarantee that ( m + 1) k − m − ≤ km −
1, i.e., m > k. Then we classify the range of i to determine the value of l d +1 p i m . • If 0 i ( m + 1) k − m − , then l d +1 p i m = ( p − p m − p ( m +1) k − m − − i + 1; • If ( m + 1) k − m − i km − , then l d +1 p i m = p − · p ( m +1) k − − i .This implies that km − X i =0 l d + 1 p i m = ( m +1) k − m − X i =0 l d + 1 p i m + km − X i =( m +1) k − m − l d + 1 p i m = ( p − p m − ( m +1) k − m − X i =0 ( p ( m +1) k − m − − i + 1) + p − km − X i =( m +1) k − m − p ( m +1) k − − i = p m −
12 ( p ( k − m +1) −
1) + ( m + 1) k − m − p m − p k − . So we need km − P i =0 ⌈ d +1 p i ⌉ − N > , i.e., km + k − m − − p k − >
0, and thus we get m ≥ j p k − − k +12( k − k + 1. In all, we have m ≥ max n k, j p k − − k +12( k − k + 1 o . Theorem 8.
Assume p is a prime number. Then the code Φ( C D ) is optimal if m ≥ max n k, j p k − − kk − k + 1 o . Proof.
Using a similar approach in Theorem 7, we know d = w ′′ = p − p N here. Wefirst guarantee that ( k − m + 1) ≤ km −
1, i.e., m > k. Then we have the sameclassification about the range of i to determine the value of l d +1 p i m . • If 0 i ( k − m + 1) − , then l d +1 p i m = ( p − p m − p ( k − m +1) − − i + 1; • If ( k − m + 1) i km − , then l d +1 p i m = ( p − · p ( m +1) k − − i .This implies that km − X i =0 l d + 1 p i m = ( k − m +1) − X i =0 l d + 1 p i m + km − X i =( k − m +1) l d + 1 p i m = ( p m − p ( k − m +1) −
1) + ( k − m + 1) + p m − p k − .
19o we need km − P i =0 l d +1 p i m − N > , i.e., km + k − m − p k − >
0, and thus we get m ≥ j p k − − kk − k + 1. In all, we have m ≥ max n k, j p k − − kk − k + 1 o .The next theorem is about the condition for the optimality of Φ( C D ), the proofis the same as Theorems 7 and 8, so we will not repeat here. Theorem 9.
Assume N ′ = 1 , m is even or m is odd and p ≡ . Then thecode Φ( C D ) is optimal if m ≥ max n k, j p k − − p ( k −
1) + k − p − k − k + 1 o . C D If x = ( x , x , . . . , x n ) and y = ( y , y , . . . , y n ) are two elements of R n , their stan-dard inner product is defined by h x, y i = n P i =1 x i y i , where the operation is performedin R . The dual code of C D is denoted by C ⊥D and defined as C ⊥D = { y ∈ R |D| |h x, y i =0 , ∀ x ∈ C D } . In this subsection, we will compute the dual homogeneous distance of C D . A property of the trace function we need is that it is nondegenerate. The follow-ing lemma plays an important role in determining the dual homogeneous distance.The process of the proof is similar to [19, Lemma 3], so we omit it here. Lemma 6.
For a fixed element x ∈ R , if T r ( ax ) = 0 for a ∈ R , then x = 0 . Theorem 10.
For m ≥ , the dual homogeneous distance d ′ hom of C D is p − p k − . Proof.
First, we need to show that C ⊥D does not contain a codeword whose onlynonzero digit has homogeneous weight ( p − p k − . If not, we assume that there isa codeword of C ⊥D that has a symbol γ = γ + γ u + · · · + γ k − u k − ∈ R \ ( u k − )at some x ∈ D , so we know that there at least exists a coefficient γ j = 0 , where j ∈ { , , . . . , k − } . Let a = a + a u + · · · + a k − u k − ∈ R and x = x + x u + · · · + x k − u k − ∈ D . Then we have γT r ( ax ) = 0, which gives k equations with respect tothe coefficients of u i . Comparing the coefficients of constant terms in γT r ( ax ) = 0,we have tr ( γ a x ) = 0, according to Lemma 6, we know γ x = 0, but x = 0 , so γ = 0. Considering the other coefficients of u i in the equation γT r ( ax ) = 0, we canobtain γ = γ = · · · = γ k − = 0, a contradiction.Next, we prove that there exists a codeword of C ⊥D that has homogeneous weight2( p − p k − . Since 2( p − p k − > p k − , we need to show that C ⊥D does not contain a20odeword that has only one digit of homogeneous weight p k − . We can use a similarapproach as above to prove it, and we omit it here. Then we assume that there existsa codeword of C ⊥D which has two values α = α + α u + · · · + α k − u k − and β = β + β u + · · · + β k − u k − ∈ R \ ( u k − ) at some x, y ∈ D , where x = x + x u + · · · + x k − u k − and y = y + y u + · · · + y k − u k − . Thus we have αT r ( ax ) + βT r ( ay ) = 0, i.e., k equations as follows: α x + β y = 0; α x + α x + β y + β y = 0;... α x k − + α x k − + · · · + α k − x + β y k − + β y k − + · · · + β k − y = 0 . We can treat it as a system of homogeneous linear equations with indeterminateelements α i , β j , where i, j ∈ { , , . . . , k − } . It is easy to show that this system hasnonzero solutions. Due to x , y ∈ Q , without loss of generality, we let α = x − = 0and β = − y − = 0, thus such α and β exist. This proves the result.With a similar argument to Theorem 10, we give the dual homogeneous distanceof C D and C D in the following theorem, and we omit the proof here. Theorem 11.
For m ≥ , the dual homogeneous distance d ′′ hom and d ′′′ hom of C D and C D , respectively, is p − p k − . Remark 7.
In the case of ( p, k ) = (2 ,
2) with the defining set D , we know from The-orem 11 that the dual homogeneous distance is 2, it is consistent with [17, Theorem7.2]. The support of a vector c = ( c , c , . . . , c n ) ∈ F nq is defined as { ≤ i ≤ n | c i = 0 } .We say that a vector x covers a vector y if the support of x contains the support of y . A nonzero codeword is called minimal codeword if its support does not containthe support of any other nonzero codeword as proper subset. The covering problem of a linear code is to determine all the minimal codewords. However, in general21etermining the minimal codewords of a given linear code is a difficult task. Inspecial cases, the Ashikhmin-Barg lemma [1] is very useful in determining the minimalcodewords. Lemma 7. (Ashikhmin-Barg) In an [ n, k ; q ] code C , let w min and w max be the mini-mum and maximum nonzero weights, respectively. If w min w max > q − q , (2) then all nonzero codewords of C are minimal. We can infer from there the support structure for the codes of this paper.
Proposition 3.
If one of the following two conditions satisfied(1) m ≥ even;(2) m > odd, and p ≡ , then all the nonzero codewords of Φ( C D ) are minimal.Proof. Following Theorem 1 and Lemma 7, we know w min = w and w max = w . Then we calculate pw − ( p − w as follows: pw − ( p − w = p − p p ( k − m +1) (cid:16) p m −
12 + p m + 12 − p m +1 (cid:17) . Since p is odd prime and m ≥ p m + p m − p m +1 > . The inequality (2) inLemma 7 is satisfied.Likewise, take w min = w ′ and w max = w ′ . By a simple calculation we have pw ′ − ( p − w ′ > p ≡ m > Proposition 4.
All the nonzero codewords of Φ( C D ) and Φ( C D ) introduced in The-orem , for m ≥ , are minimal.Proof. Let w min = w ′′ and w max = w ′′ in the inequality (2) of Lemma 7, then wecan check that the inequality holds for m ≥
2. The same discussion to Φ( C D ) inTheorem 4 with w min = w ′′′ and w max = w ′′′ .22 .2 Secret sharing schemes Secret sharing schemes (SSS) were first introduced by Blakley [3] and Shamir [16]at the end of the 1970s. Since then, many constructions have been proposed. Massey’sscheme is a construction of such a scheme which pointed out the relationship betweenthe access structure and the minimal codewords of the dual code of the underlyingcode [15]. See [21] for a detailed explanation of the mechanism of that scheme. Itwould be interesting to know the dual Hamming distance (not the dual homogeneousdistance), as this would impact the SSS democratic or dictatorial character [7]. Weleave this as an open problem to the diligent reader.
This paper is devoted to the study of trace codes over a special finite chain ringof arbitrary depth. Using a character sum approach, we have been able to determinetheir homogeneous weight distribution. Thus, several classes of p -ary two-weightcodes, and three-weight codes are obtained by the application of Φ , a linear Gray mapdefined in [20]. Furthermore, we have determined their dual homogeneous distance.In particular, we have proved that the code Φ( C D ) and Φ( C D ) in the two-weightcase, and the code Φ( C D ) are optimal under some conditions. The codes we constructhere have different parameters from those of the codes in [4, 18, 19], thus the obtainedcodes in the present paper are new, to the best of our knowledge. Moreover, when( p, k ) = (2 ,
2) with the defining set D in this paper, the results coincide with [17].Equivalently, this paper includes [17] as a special case. Determining the dual Ham-ming distance of the considered codes is a challenging open problem, well-motivatedby the secret sharing applications. References [1] Ashikhmin, A., Barg, A.: Minimal vectors in linear codes, IEEE Transactionson Information Theory, 1998, 44(5):2010-2017.[2] Brouwer, A.E., Haemers, W.H.:
Spectra of Graphs , Springer New York, 2012.[3] Blakley, G.R.: Safeguarding cryptographic keys, Proc. 1979 National ComputerConf., New York, Jun. 1979, pp. 313-317.234] Calderbank, R., Kantor, W.M.: The geometry of two-weight codes, Bulletin ofthe London Mathematical Society, 1986, 18(2):97-122.[5] Delsarte, P.: Weights of linear codes and strongly regular normed spaces, DiscreteMathematics, 1972, 3(1-3):47-64.[6] Ding, C., Li, C., Li, N., Zhou, Z.: Three-weight cyclic codes and their weightdistributions, Discrete Mathematics, 2016, 339(2):415-427.[7] Ding, C., Yuan, J.: Covering and secret sharing with linear codes, Lecture Notesin Computer Science, 2003, 2731:11-25.[8] Ding, C., Yang, J.: Hamming weights in irreducible cyclic codes, Discrete Math-ematics, 2013, 313(4):434-446.[9] Ding, K., Ding C.: A class of two-weight and three-weight codes and their ap-plications in secret sharing, IEEE Transactions on Information Theory, 2015,61(11):5835-5842.[10] Griesmer, J.H.: A Bound for Error-Correcting Codes, IBM Journal of Research& Development, 1960, 4(5):532-542.[11] Greferath, M., Schmidt, S.E.: Gray isometries for finite chain rings and a nonlin-ear ternary (36 , ,
15) code, IEEE Transactions on Information Theory, 1999,45(7):2522-2524.[12] Heng, Z., Yue, Q.: A class of binary codes with at most three weights, IEEECommunications Letters, 2015, 19(9):1488-1491.[13] Heng, Z., Yue, Q.: A class of q -ary linear codes derived from irreducible cycliccodes, 2015, http://arxiv.org/abs/1511.09174.[14] MacWilliams, F.J., Sloane, N.J.A.: The theory of error-correcting codes , North-Holland Pub. Co., 1977.[15] Massey, J.L.: Minimal codewords and secret sharing, Proc. 6th Joint Swedish-Russian Workshop on Information Theory, M¨ o lle, Sweden, 1993, pp. 276-279.[16] Shamir, A.: How to share a secret, Communications of the Acm, 1979,22(11):612-613.[17] Shi, M., Liu, Y., Sol´e, P.: Optimal two weight codes over F + u F , IEEECommunications Letters, 2016, 20(12):2346-2349.[18] Shi, M., Liu, Y., Sol´e, P.: Optimal two weight codes from trace codes over anon-chain ring, Discrete Applied Mathematics (219)2017:176-181.2419] Shi, M., Wu, R., Liu, Y., Sol´e, P.: Two and three weight codes over F p + u F p ,Cryptography & Communications, 2017, doi:10.1007/s12095-016-0206-5.[20] Shi, M., Zhu, S., Yang, S.: A class of optimal p -ary codes from one-weight codesover F p [ u ] / ( u mm