Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
On the Kernel of Z2s -Linear Hadamard Codes∗† Cristina Fernández-Córdoba, Carlos Vela, Mercè Villanueva arXiv:1801.05189v1 [cs.IT] 16 Jan 2018 January 17, 2018 Abstract The Z2s -additive codes are subgroups of Zn 2s , and can be seen as a generalization of linear codes over Z2 and Z4 . A Z2s -linear Hadamard code is a binary Hadamard code which is the Gray map image of a Z2s additive code. It is known that the dimension of the kernel can be used to give a complete classification of the Z4 -linear Hadamard codes. In this paper, the kernel of Z2s -linear Hadamard codes and its dimension are established for s > 2. Moreover, we prove that this invariant only provides a complete classification for some values of t and s. The exact amount of nonequivalent such codes are given up to t = 11 for any s ≥ 2, by using also the rank and, in some cases, further computations. Keywords: kernel, Hadamard code, Z2s -linear code, Z2s -additive code, Gray map, classification. Mathematics Subject Classification (2000): 94B25, 94B60 1 Introduction Let Z2s be the ring of integers modulo 2s with s ≥ 1. The set of n-tuples over Z2s is denoted by Zn2s . In this paper, the elements of Zn2s will also be called vectors over Z2s of length n. A binary code of length n is a nonempty subset of Zn2 , and it is linear if it is a subspace of Zn2 . Equivalently, a nonempty subset of Zn2s is a Z2s -additive if it is a subgroup of Zn2s . Note that, when s = 1, a Z2s -additive code is a binary linear code and, when s = 2, it is a quaternary linear code or a linear code over Z4 . Two binary codes, C1 and C2 , are said to be equivalent if there is a vector a ∈ Zn2 and a permutation of coordinates π such that C2 = {a + π(c) : c ∈ C1 }. Two Z2s -additive codes, C1 and C2 , are said to be permutation equivalent if they differ only by a permutation of coordinates, that is, if there is a permutation of coordinates π such that C2 = {π(c) : c ∈ C1 }. The Hamming weight of a binary vector u ∈ Zn2 , denoted by wtH (u), is the number of nonzero coordinates of u. The Hamming distance of two binary vectors u, v ∈ Zn2 , denoted by dH (u, v), is the number of coordinates in which ∗ This work has been partially supported by the Spanish MINECO under Grants TIN201677918-P (AEI/FEDER, UE) and MTM2015-69138-REDT, and by the Catalan AGAUR under Grant 2014SGR-691. The authors are with the Department of Information and Communications Engineering, Universitat Autònoma de Barcelona, 08193 Cerdanyola del Vallès, Spain. † The material in this paper was presented in part at “5th International Castle Meeting on Coding Theory and Applications” in Vihula Manor, Estonia, 2017 [9]. 1 they differ. Note that dH (u, v) = wtH (v − u). The minimum distance of a binary code C is d(C) = min{dH (u, v) : u, v ∈ C, u 6= v} The Lee weight of an element i ∈ Z2s is wtL (i) = min{i, P 2s − i} and the Lee weight of a vector n u = (u1 , u2 , . . . , un ) ∈ Zn2s is wtL (u) = j=1 wtL (uj ) ∈ Z2s . The Lee distance of two vectors u, v ∈ Zn2s is dL (u, v) = wtL (v − u). The minimum distance of a Z2s -additive code C is d(C) = min{dL (u, v) : u, v ∈ C, u 6= v}. In [12], a Gray map from Z4 to Z22 is defined as φ(0) = (0, 0), φ(1) = (0, 1), φ(2) = (1, 1) and φ(3) = (1, 0). There exist different generalizations of this Gray s−1 [7, 8, 13, 14]. The one given in [7], by Carlet, map, which go from Z2s to Z22 s−1 is the map φ : Z2s → Z22 defined as follows: φ(u) = (us−1 , . . . , us−1 ) + (u0 , . . . , us−2 )Y, (1) where u ∈ Z2s , [u0 , u1 , . . . , us−1 ]2 is the binary expansion of u, that is u = Ps−1 i s−1 which columns i=0 2 ui (ui ∈ {0, 1}), and Y is a matrix of size (s − 1) × 2 s−1 are the elements of Z2 . Note that (us−1 , . . . , us−1 ) and (u0 , . . . , us−2 )Y are binary vectors of length 2s−1 , and that the rows of Y form a basis of a first order Reed-Muller code. The generalization given in [13] can be defined in terms of the elements of a Hadamard code [14]. In this paper, we will focus on Carlet’s Gray map P P φ, which is a particular case of the last one satisfying that s−1 λi φ(2i ) = φ( λi 2i ) as we will see later. Then, we define Φ : Zn2s → Zn2 2 as the component-wise Gray map φ. Let C be a Z2s -additive code of length n. We say that its binary image C = Φ(C) is a Z2s -linear code of length 2s−1 n. Since C is a subgroup of Zn2s , t it is isomorphic to an abelian structure Zt21s × Zt22s−1 × · · · × Z4s−1 × Zt2s , and we say that C, or equivalently C = Φ(C), is of type (n; t1 , . . . , ts ). Note that |C| = 2st1 2(s−1)t2 · · · 2ts . Unlike linear codes over finite fields, linear codes over rings do not have a basis, but there exists a generator matrix for these codes. If C is a Z2s -additive code of type (n; t1 , . . . , ts ), then a generator matrix of C with minimum number of rows has exactly t1 + · · · + ts rows. Two structural properties of binary codes are the rank and the dimension of the kernel. The rank of a binary code C is simply the dimension of the linear span, hCi, of C. The kernel of a binary code C is defined as K(C) = {x ∈ Zn2 : x + C = C} [3]. If the all-zero vector belongs to C, then K(C) is a linear subcode of C. Note also that if C is linear, then K(C) = C = hCi. We denote the rank of a binary code C as rank(C) and the dimension of the kernel as ker(C). These parameters can be used to distinguish between nonequivalent binary codes, since equivalent ones have the same rank and dimension of the kernel. A binary code of length n, 2n codewords and minimum distance n/2 is called a Hadamard code. Hadamard codes can be constructed from normalized Hadamard matrices [2, 17]. Note that linear Hadamard codes are in fact first order Reed-Muller codes, or equivalently, the dual of extended Hamming codes [17, Ch.13 §3]. The Z2s -additive codes that, under the Gray map Φ, give a Hadamard code are called Z2s -additive Hadamard codes and the corresponding binary images are called Z2s -linear Hadamard codes. The Z4 -linear Hadamard codes of length 2t can be classified by using either the rank or the dimension of the kernel [15, 18]. Specifically, it is known that for a Z4 -linear Hadamard code C of type (2t−1 ; t1 , t2 ), ker(C) = t1 + t2 + 1 if t1 > 2, and ker(C) = 2t1 + t2 if t1 = 1 or 2, where t2 = t + 1 − 2t1 . For 2 any integer t ≥ 3 and each t1 ∈ {1, . . . , ⌊(t + 1)/2⌋}, there is a unique (up to equivalence) Z4 -linear Hadamard code of type (2t−1 ; t1 , t + 1 − 2t1 ), and all these codes are pairwise nonequivalent, except for t1 = 1 and t1 = 2, where the codes are equivalent to the linear Hadamard code [15]. Therefore, the number of nonequivalent Z4 -linear Hadamard codes of length 2t is ⌊ t−1 2 ⌋ for all t ≥ 3, and it is 1 for t = 1 and t = 2. Linear codes over Zps , which are a generalization of Z2s -additive codes, were studied by Blake [4] and Shankar [19] in 1975 and 1979, respectively. Nevertheless, the study of codes over rings increased significantly after the publication of some good properties of linear codes over Z4 and the definition of the Gray map [12]. After that, Z2s -additive codes and their images under the Gray map are deeply studied, for example, in [7], and later in [20] and [11]. In [14], Krotov studied Z2s -linear Hadamard codes and their dual codes by using different generalizations of the Gray map. Recently, in [1], considering Carlet’s generalization of the Gray map, two-weight Z2s -linear codes are studied. Note that Z2s -linear Hadamard codes are in fact a particular case of these two-weight codes. In this paper, in order to try to classify the Z2s -linear Hadamard codes of length 2t , for any t ≥ 3 and s > 2, we establish the kernel and its dimension for these codes. Moreover, we point out that this invariant does not always provide a complete classification, once we fix t ≥ 3 and s > 2, unlike for s = 2. However, we give some new classification results for t ≤ 11 and any s > 2. This correspondence is organized as follows. In Section 2, we recall some results and we prove new ones related to the Carlet’s generalized Gray map. In Section 3, we describe the construction of the Z2s -linear Hadamard codes of type (n; t1 , . . . , ts ) when this Gray map is used. This result is already proved in [14] in a more general way, but using other techniques. In Section 4, we establish for which types these codes are linear, and we give the kernel and its dimensions whenever they are nonlinear. In section 5, through several examples, we show that, unlike for s = 2, the dimension of the kernel is not enough to classify completely Z2s linear Hadamard codes for some values of t and s. Moreover, we give the exact amount of nonequivalent such codes up to t = 11 for any s ≥ 2, by using also the rank and, in some cases, further computations. Finally, in Section 6, we give some conclusions and further research on this topic. 2 Generalized Gray Map In this section, we present some general results about the Carlet’s generalized Gray map, which will be used to prove the main results related to Z2s -linear Hadamard codes and given in next sections. Let ei be the vector that has 1 in the ith position and 0 otherwise. Let u, v ∈ Z2s and [u0 , u1 , . . . , us−1 ]2 , [v0 , v1 , . . . , vs−1 ]2 be the binary expansions of u and Ps−1 v, respectively. The operation “⊙” on Z2s is defined as u ⊙ v = i=0 2i ui vi . Note that the binary expansion of u ⊙ v is [u0 v0 , u1 v1 , . . . , us−1 vs−1 ]2 . Proposition 2.1 [20] Let u, v ∈ Z2s . Then, φ(u) + φ(v) = φ(u + v − 2(u ⊙ v)). Corollary 2.1 Let u ∈ Z2s and 0 ≤ p ≤ s − 1. Then, φ(u) + φ(2p ) = φ(u + 2p − 2p+1 up ), where [u0 , u1 . . . , us−1 ]2 is the binary expansion of u. 3 Corollary 2.2 Let u ∈ Z2s . Then, φ(u) + φ(2s−1 ) = φ(u + 2s+1 ). Lemma 2.1 Let u ∈ {2s−2 , . . . , 2s−1 − 1} ∪ {3 · 2s−2 , . . . , 2s − 1} ⊂ Z2s . Then, φ(u) + φ(2s−2 ) = φ(u + 2s−2 + 2s−1 ). Proof. By Proposition 2.1, we have that φ(u)+φ(2s−2 ) = φ(u+2s−2 −2(u⊙ 2 )). The binary expansion of 2s−2 is [0, . . . , 0, 1, 0]2 and, if u ∈ {2s−2 , . . . , 2s−1 − 1} ∪ {3 · 2s−2 , . . . , 2s − 1}, the binary expansion of u is [u0 , u1 , . . . , us−3 , 1, us−1 ]2 . Then, −2(u ⊙ 2s−2 ) = 2s−1 and the statement follows.  s−2 Corollary 2.3 Let v ∈ {2s−2 , 3 · 2s−2 } and U = {2s−2 , . . . , 2s−1 − 1} ∪ {3 · 2s−2 , . . . , 2s − 1} ⊂ Z2s . Then,  φ(u + v + 2s−1 ) if u ∈ U φ(u) + φ(v) = φ(u + v) if u ∈ Z2s \ U. Proof. Straightforward from Corollary 2.1 and Lemma 2.1.  Ps−2 Ps−2 Lemma 2.2 Let λi ∈ Z2 , i ∈ {0, . . . , s−2}. Then, i=0 λi φ(2i ) = φ( i=0 λi 2i ), where 2i ∈ Z2s . Proof. Let yi be the ith row of Y . By the definition of φ given by (1), Ps−2 Ps−2 Ps−2 we know that i=0 λi φ(2i ) = i=0 λi ei+1 Y = i=0 λi yi+1 = λY , where λ = Ps−2 i (λ0 , . . . , λs−2 ). Since [λ0 , . . . , λs−2 , 0]2 is the binary expansion of i=0 λi 2 , Ps−2 i then we have that λY = φ( i=0 λi 2 ).  Proposition 2.2 [7] Let u, v ∈ Z2s . Then, dH (φ(u), φ(v)) = wtH (φ(u − v)). Lemma 2.3 Let u ∈ Z2s . Then, dH (φ(u), φ(2s−1 )) + dH (φ(u), φ(0)) = 2s−1 . Proof. By the properties of the distance, we have that dH (φ(u), φ(2s−1 )) + dH (φ(u), φ(0)) = wtH (φ(2s−1 ) − φ(u)) + wtH (φ(u)). Then, since φ(2s−1 ) = 1, wtH (φ(2s−1 ) − φ(u)) = 2s−1 − wtH (φ(u)), and the result follows.  Corollary 2.4 Let u, v ∈ Z2s . Then, dH (φ(u), φ(v + 2s−1 )) + dH (φ(u), φ(v)) = 2s−1 . Proof. Straightforward from Corollary 2.1 and Lemma 2.3.  3 Construction of Z2s -Linear Hadamard Codes The description of a generator matrix having minimum number of rows for a Z4 -additive Hadamard code, as long as recursive constructions of these matrices, are given in [15]. In [14], these results are generalized for any s > 2. In 4 this section, we give another proof of the theorem that establishes that the constructed matrices generate Z2s -linear Hadamard codes, in the case that Carlet’s Gray map is considered. Let Ti = {j · 2i−1 : j ∈ {0, 1, . . . , 2s−i+1 − 1}} for all i ∈ {1, . . . , s}. Note that T1 = {0, . . . , 2s − 1}. Let t1 , t2 ,. . . ,ts be nonnegative integers with t1 ≥ 1. Consider the matrix At1 ,...,ts whose columns are of the form zT , z ∈ {1} × T1t1 −1 × T2t2 × · · · × Tsts . Example 3.1 For s = 3, for example, we have the following matrices:       11 1111 11111111 1,0,1 1,1,0 2,0,0 A = , A = , A = , 04 0246 01234567     1111 1111 11111111 11111111 A1,1,1 =  0 2 4 6 0 2 4 6  , A2,0,1 =  0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7  , 0000 4444 00000000 44444444   11111111 11111111 11111111 11111111 A2,1,0 =  0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7  . 00000000 22222222 44444444 66666666 Let 0, 1, 2, . . . , 2s − 1 be the vectors having the elements 0, 1, 2, . . . , 2s − 1 from Z2s repeated in each coordinate, respectively. The order of a vector u over Z2s , denoted by ord(u), is the smallest positive integer m such that mu = 0. Any matrix At1 ,...,ts can be obtained by applying the following iterative construction. We start with A1,0,...,0 = (1). Then, if we have a matrix A = At1 ,...,ts , for any i ∈ {1, . . . , s}, we may construct the matrix   A A ··· A Ai = . (2) 0 · 2i−1 1 · 2i−1 · · · (2s−i+1 − 1) · 2i−1 ′ ′ Finally, permuting the rows of Ai , we obtain a matrix At1 ,...,ts , where t′j = tj for j 6= i and t′i = ti + 1. Example 3.2 From the matrix A1,0,0 = (1), we obtain the matrix A2,0,0 ; and from A2,0,0 we can construct A2,0,1 , where A2,0,0 and A2,0,1 are the matrices given in Example 3.1. Note that we can also generate another matrix A2,0,1 as follows: from A1,0,0 = (1) we obtain the matrix A1,0,1 given in Example 3.1, and from A1,0,1 we can construct the matrix   1111111111111111 A1 =  0 4 0 4 0 4 0 4 0 4 0 4 0 4 0 4  . 0011223344556677 Then, after permuting the rows of A1 , we have the matrix   1111111111111111 A2,0,1 =  0 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7  , 0404040404040404 which is different to the matrix A2,0,1 of Example 3.1. These two matrices A2,0,1 generate permutation equivalent codes. 5 Along this paper, we consider that the matrices At1 ,t2 ,...,ts are constructed recursively starting from A1,0,...,0 in the following way. First, we add t1 − 1 rows of order 2s , up to obtain At1 ,0,...,0 ; then t2 rows of order 2s−1 up to generate At1 ,t2 ,0,...,0 ; and so on, until we add ts rows of order 2 to achieve At1 ,t2 ,...,ts . t1 ,...,ts , where Let Ht1 ,...,ts be the Z2s -additive code generated by the P matrix A t1 , . . . , ts ≥ 0 with t1 ≥ 1. Let n = 2t−s+1 , where t = ( si=1 (s − i + 1) · ti ) − 1. It is easy to see that Ht1 ,...,ts is of length n and has |Ht1 ,...,ts | = 2s n = 2t+1 codewords. Note that this code is of type (n; t1 , t2 , . . . , ts ). Let H t1 ,...,ts = Φ(Ht1 ,...,ts ) be the corresponding Z2s -linear code. Example 3.3 The code H1,0,...,0 is generated by A1,0,...,0 = (1), so H1,0,...,0 = Z2s . This code has length n = 1, cardinality 2s and minimum distance 1. Thus, H 1,0,...,0 = Φ(H1,0,...,0 ) has length N = 2s−1 , cardinality 2N = 2s and minimum (Hamming) distance N/2 = 2s−2 , so it is a binary Hadamard code. Actually, H 1,0,...,0 = Φ(Z2s ) is the binary linear Hadamard code of length 2s−1 [7], or equivalently, the first order Reed-Muller code of length 2s−1 , denoted by RM (1, s − 1) [17, Ch.13 §3]. The result given by Theorem 3.1 is already proved in [14]. In that paper, it is shown that each Z2s -linear Hadamard code is equivalent to H t1 ,...,ts for some t1 , . . . , ts ≥ 0 with t1 ≥ 1, considering a generalized Gray map that includes the one given by Carlet. We present a new proof of this theorem, in the case that Carlet’s Gray map is considered. This new proof does not use neither the dual of the Z2s -additive codes nor another generalization of the Gray map for these dual codes, unlike the proof given in [14]. Let G be a generator matrix of a Z2s -additive code C of length n. Then, (G · · · G) is a generator matrix of the r-fold replication code of C, (C, . . . , C) = {(c, . . . , c) : c ∈ C}, of length r · n. Theorem 3.1 [14] Let t1 , . . . , ts be nonnegative integers with t1 ≥ 1. The Z2s t1 ,...,ts linear code H P of type (n; t1 , t2 , . . . , ts ) is a binary Hadamard code of length s t 2 , with t = ( i=1 (s − i + 1) · ti ) − 1 and n = 2t−s+1 . Proof. We prove this theorem by induction on the integers ti , i ∈ {1, . . . , s}. First, by Example 3.3, the code H 1,0,...,0 is a Hadamard code. Let H = Ht1 ,...,ts be the Z2s -additive code of length n generated by the matrix A = At1 ,...,ts . We assume that H = Φ(H) is a Hadamard code of length N = 2s−1 n. Let i ∈ {1, . . . , s}. Define Ai as in (2) and let Hi be the Z2s additive code generated by the matrix Ai . We have that Hi is permutation ′ ′ equivalent to Ht1 ,...,ts , where t′j = tj for j 6= i and t′i = ti + 1. Now, we shall prove that Hi = Φ(Hi ) is a Hadamard code. Note that Hi can be seen as the union of 2s−i+1 cosets of the 2s−i+1 -fold replication code of H, (H, . . . , H), which are (H, . . . , H) + r · wi , (3) for r ∈ {0, . . . 2s−i+1 −1}, where wi = (0, 2i−1 , 2·2i−1 , . . . , (2s−i+1 −1)·2i−1 ). The code H of length n has cardinality 2s n. It is easy to see that Hi has length ni = 2s−i+1 n and cardinality 22s−i+1 n. Therefore, the length of Hi = Φ(Hi ) is Ni = 2s−1 ni and the cardinality 2Ni . Now, we just have to prove that the minimum distance of Hi is Ni /2. 6 By Proposition 2.2, the minimum distance of Hi is equal to the minimum weight of Hi . Thus, we just have to check that the minimum weight of any coset (3) is Ni /2. When r = 0, we have that wtH (Φ((u, . . . , u))) = 2s−i+1 wtH (Φ(u)) = 2s−i+1 N/2 = Ni /2. Otherwise, when r 6= 0, we consider wtH (Φ((u, . . . , u) + r · wi )) = dH (Φ((u, . . . , u)), Φ(r · wi )). (4) Note that, by construction, the coordinates of any nonnegative multiple of wi can be partitioned into two multisets V and V ′ such that |V | = |V ′ | = 2s−i and there is a bijection from V to V ′ mapping any element v ∈ V into an element v′ ∈ V ′ such that v′ − v = 2s−1 . Therefore, (4) can be written as X X dH (Φ(u), Φ(v)) + dH (Φ(u), Φ(v′ )) = v′ ∈V ′ v∈V X dH (Φ(u), Φ(v)) + dH (Φ(u), Φ(v + 2s−1 )) = v∈V |V | · 2s−1 n = 2s−i 2s−1 n = Ni /2, (5) where (5) holds by Corollary 2.4.  Example 3.4 Let H2,0,0 be the Z8 -additive code generated by A2,0,0 given in Example 3.1. The Z8 -linear code H 2,0,0 = Φ(H2,0,0 ) has length N = 32, 2N = 64 codewords and minimum (Hamming) distance N/2 = 16. Therefore, it is a binary Hadamard code. 4 Kernel of Z2s -Linear Hadamard Codes The computation of the kernel and its dimension for Z4 -linear Hadamard codes is given in [15, 18]. In this section, we generalize these results for Z2s -linear Hadamard codes with s > 2. First, we establish when these codes are linear, and, in the case that they are nonlinear, we construct the kernel and compute its dimension. Proposition 4.1 The Z2s -linear Hadamard codes H 1,0,...,0 and H 1,0,...,0,1,0 , with s > 2, are linear. Proof. By Example 3.3, we know that H 1,0...,0 is linear. Now, we consider H = H1,0,...,0,1,0 and H = Φ(H). Recall that the code H is generated by   1 1 1 1 1,0,...,0,1,0 A = . 0 2s−2 2s−1 3 · 2s−2 Let β i = (2i , 2i , 2i , 2i ) for 0 ≤ i ≤ s − 1, β s = (0, 2s−1 , 0, 2s−1 ) and β s+1 = β i) : 0 ≤ (0, 2s−2 , 2s−1 , 3 · 2s−2 ). Let C be the linear code generated by B = {Φ(β Ps+1 β i ) ∈ C, where i ≤ s + 1}. Now, we prove that C ⊆ H. Let c = i=0 λi Φ(β λi ∈ Z2 . By Corollary 2.2, we only have to see that β s+1 ) + c′ = λs+1 Φ(β s−2 X i=0 7 β i ) ∈ H. λi Φ(β Ps−2 β i) = On the one hand, if λs+1 = 0, then we have that c′ ∈ H, since i=0 λi Φ(β Ps−2 Φ( i=0 λiβ i ) by Lemma 2.2. On the other hand, if λs+1 = 1, then we have Ps−2 that c′ = Φ((0, 2s−2 , 2s−1 , 3 · 2s−2 )) + Φ((u, u, u, u)), where u = i=0 λi 2i . Let U = {2s−2 , . . . , 2s−1 − 1} ∪ {3 · 2s−2 , . . . , 2s − 1} ⊂ Z2s . Then, by Corollary 2.3, c′ = Φ((0, 2s−2 , 2s−1 , 3 · 2s−2 ) + (u, u, u, u) + (0, 2s−1, 0, 2s−1 )) if u ∈ U , and c′ = Φ((0, 2s−2 , 2s−1 , 3 ·2s−2 )+ (u, u, u, u)) if u ∈ Z2s \ U . In both cases, c′ ∈ H. Since |C| = |H| = 2s+2 , then C = H, and thus H is linear.  Let u = (u1 , . . . , un ) ∈ Zn2s and [ui,0 , ui,1 , . . . , ui,s−1 ]2 be the binary expansion of ui , i ∈ {1, . . . , n}. Let p be an integer such that p ∈ {0, . . . , s − 1}. Then, we denote by u(p) the binary vector having in the ith coordinate the pth element of the binary expansion of ui , that is, u(p) = (u1,p , . . . , un,p ). Lemma 4.1 If v = 2b (0, 1, . . . , 2a − 1) ∈ Zn2s , with n = 2a and b ≤ s − 1, then wtH (v(p) ) = 2a−1 for all p ∈ {b, . . . , a + b − 1}. Proof. The 2a coordinates of v contain exactly the 2a elements of Z2s which have a binary expansion of the form [0, . . . , 0, vb , vb+1 , . . . , va+b−1 , 0, . . . , 0]2 with vp ∈ {0, 1}, for all p ∈ {b, . . . , a + b − 1}. Note that we have 2a different elements of Z2s , represented by exactly a binary coordinates. Hence, half of the coordinates of v satisfy that vp = 1 and the other half that vp = 0. Therefore, wtH (v(p) ) = 2a /2 = 2a−1 for all p ∈ {b, . . . , a + b − 1}.  As shown in [15], the codes H 1,t2 and H 2,t2 , t2 ≥ 0, are the only Z4 -linear Hadamard codes which are linear. In [11], it is proved that the codes H 1,0,...,0,ts , ts ≥ 0, are linear. The next result shows that, for s > 2 and ts ≥ 0, the codes H 1,0,...,0,1,ts and H 1,0,...,0,ts are linear, and they are the only Z2s -linear Hadamard codes which are linear. Theorem 4.1 The codes H 1,0,...,0,1,ts and H 1,0,...,0,ts , with s > 2 and ts ≥ 0, are the only Z2s -linear Hadamard codes which are linear. Proof. First, we show that these codes are linear by induction on ts . By Proposition 4.1, the codes H 1,0,...,0 and H 1,0,...,0,1,0 are linear. We assume that H = Φ(H), where H = H1,0,...,0,ts−1 ,ts , ts−1 ∈ {0, 1} and ts ≥ 0, is linear. Now, we prove that Hs = H 1,0,...,0,ts−1 ,ts +1 is linear. Since H is a linear Hadamard code of length 2ts +2ts−1 −1 , it is the Reed-Muller code RM (1, ts + 2ts−1 − 1) [17, Ch.13 §3]. By the iterative construction (2), we have that Hs = {Φ((h, h) + (0, v)) : h ∈ H, v ∈ {0, 2s−1 }}. By Corollary 2.2, Hs = {(Φ(h), Φ(h) + Φ(v)) : h ∈ H, v ∈ {0, 2s−1}} = {(h′ , h′ + v′ ) : h′ ∈ H, v′ ∈ {0, 1}}, which corresponds to the Reed-Muller code RM (1, ts + 2ts−1 ). Therefore, Hs is linear. Now, we prove the nonlinearity of H = Φ(H), where H = H1,0,...,0,2,0 . Let r = (0, 2s−2 , 2s−1 , 3 · 2s−2 ). Recall that H has length 16 and is generated by   1 1 1 1 . r r r A1,0,...,0,2,0 =  r s−2 s−1 s−2 0 2 2 3·2 By Corollaries 2.2 and 2.3, we have Φ((r, r, r, r))+Φ((0, 2s−2 , 2s−1 , 3 · 2s−2 )) = Φ(z), where z = (r, r, r, r) + (0, 2s−2 , 2s−1 , 3 · 2s−2 ) + (0, u, 0, u) and u = 8 (0, 2s−1 , 0, 2s−1 ). Since H is linear over Z2s , z ∈ H if and only if (0, u, 0, u) ∈ H. Since wtH (Φ((0, u, 0, u))) = 4 · 2s−1 = N/4, where N is the length of H, Φ((0, u, 0, u)) 6∈ H, so Φ(z) 6∈ H. Therefore, H = H 1,0,...,0,2,0 is nonlinear. Let H = Φ(H), where H = Ht1 ,...,ts . For any i ∈ {1, . . . , s}, we define ′ ′ Hi = Φ(Hi ), where Hi = Ht1 ,...,ts , t′i = ti + 1 and t′j = tj for j 6= i. Next, we consider H = Φ(H), where H = H1,0,...,0 , and we prove that Hi is nonlinear for any i ∈ {1, . . . , s−2}. Note that the generator matrix of Hi has two rows: w1 = 1 and w2 = 2i−1 (0, 1, . . . , 2s+1−i − 1). By Corollary 2.1, we know (i−1) that Φ(w2 )+Φ(2i−1 ) = Φ(w2 +2i−1 −2i w2 ). Therefore, we just need to show (i−1) (i−1) i that 2 w2 6∈ Hi . We have that wtH (w2 ) = 2s−i by Lemma 4.1. Since (i−1) i s−1 i s−2 )) = 2s−i · 2s−2 = 2 6∈ {0, 2 }, wtH (φ(2 )) = 2 . Then, wtH (Φ(2i w2 2s−2−i t 2 . Recall that the length of H is N = 2 , where t = 2s − i. Therefore, we (i−1) (i−1) have that wtH (Φ(2i w2 )) = 2t−2 = N/4, and then Φ(2i w2 ) 6∈ Hi . Finally, in general, for H = Φ(H), where H = Ht1 ,...,ts , we prove that if H is nonlinear, then Hi is nonlinear for any i ∈ {1, . . . , s}. Assume that Hi is linear. Then, by the iterative construction (2), for any u, v ∈ H, we have that (u, . . . , u), (v, . . . , v) ∈ Hi . Moreover, since Hi is linear, Φ((u, . . . , u)) + Φ((v, . . . , v)) = Φ((a, . . . , a) + λ · 2i−1 (0, 1, . . . , 2s−i+1 − 1)) ∈ Hi , where a ∈ H and λ ∈ Z2s . Therefore, Φ(u) + Φ(v) = Φ(a) ∈ H, and we have that H is linear and the result follows.  Let At1 ,...,ts be the generator matrix of Ht1 ,...,ts , considered along this paper, and let wi be the ith row vector of At1 ,...,ts . By construction, w1 = 1 and ord(wi ) ≤ ord(wj ) if i > j. We define σ ∈ {1, . . . , s} as the integer such that ord(w2 ) = 2s+1−σ . Note that σ = 1 if t1 > 1, and σ = min{i : ti > 0, i ∈ {2, . . . , s}} if t1 = 1. In the case σ = s, the code is H1,0,...,0,ts , which is linear. Example 4.1 Considering all nonnegative integer solutions with t1 ≥ 1 of the equation 5 = 3t1 + 2t2 + t3 − 1, we have that the Z8 -linear Hadamard codes of length 2t = 32 are the following: H 1,0,3 , H 1,1,1 and H 2,0,0 . By Theorem 4.1, we have that H 1,0,3 and H 1,1,1 are linear, so ker(H 1,0,3 ) = ker(H 1,1,1 ) = 6. By the same theorem, we also have that H 2,0,0 is nonlinear, so ker(H 2,0,0 ) < 6. Proposition 4.2 Let H = Ht1 ,...,ts be the Z2s -additive Hadamard code of type (n; t1 , . . . , ts ) such that Φ(H) is nonlinear. Let Hb be the subcode of H which contains all the codewords of order two. Let P = {2p }σ−2 p=0 if σ ≥ 2, and P = ∅ if σ = 1. Then, + * s−2 X 2i ) ⊆ K(Φ(H)) Φ(Hb ), Φ(P ), Φ( i=0 and ker(Φ(H)) ≥ σ + Ps i=1 ti . P Proof. Let H = Φ(H) and τ = si=1 ti . Let Q = {(ord(wq )/2)wq }τq=0 . Since Hb contains all the elements of H of order two, we have that the set Φ(Q) is a base for the binary linear subcode Hb = Φ(Hb ) of H. By Corollary 2.2, for all b ∈ Hb and u ∈ H, we have that Φ(b) + Φ(u) = Φ(b + u) ∈ H and, therefore, Hb ⊆ K(H). Assume σ ≥ 2. Now, we prove that Φ(2p ) ∈ K(H) for all p ∈ {0, . . . , σ − 2}. Equivalently, we show that Φ(2p ) + Φ(u) ∈ H for all u ∈ H. If u ∈ H, 9 then u = λ · 1 + u′ , where λ ∈ Z2s and ord(u′ ) ≤ ord(w2 ) = 2s+1−σ . Let u = (u1 , . . . , un ) ∈ Zn2s and [ui,0 , ui,1 , . . . , ui,s−1 ]2 be the binary expansion of ui , i ∈ {1, . . . , n}. Let [λ0 , λ1 , . . . , λs−1 ]2 be the binary expansion of λ ∈ Z2s . By Corollary 2.1, we have that Φ(2p ) + Φ(u) = Φ(2p + u − 2p+1 u(p) ), where u(p) = (u1,p , . . . , un,p ). Note that if v ∈ Z2s is of order 2j , then its binary expansion is of the form [0, . . . , 0, 1, vs−j+1 , . . . , vs−1 ]2 . Since p ∈ {0, . . . , σ − 2} and ord(u′ ) ≤ 2s+1−σ , we have that u(p) = (λp , . . . , λp ). Therefore, 2p+1 u(p) = λp 2p+1 ∈ H and Φ(2p ) + Φ(u) = Φ(2p + u − λp 2p+1 ) ∈ H. Ps−2 Next, we show that Φ( i=0 2i ) ∈ K(H). Let u = (u1 , . . . , un ) ∈ H and v = Ps−2 i (v1 , . . . , vn ) = i=0 2 . First, we prove that φ(vi ) + φ(ui ) = φ(vi + ui − 2ui ) for all i ∈ {1, . . . , n}. Note that the binary expansion of vi and ui are [1, . . . , 1, 0]2 and [ui,0 , ui,1 , . . . , ui,s−1 ]2 , respectively. Then, it is easy to check that 2(vi ⊙ ui ) = 2ui . Therefore, by Proposition 2.1, φ(vi ) + φ(ui ) = φ(vi + ui − 2ui ). Hence, Φ(v) + Φ(u) = Φ(v + u − 2u) ∈ H for all u ∈ H. Ps−2 Finally, we have to see that the elements of the set {Φ(Q), Φ(P ), Φ( i=0 2i )} are linearly independent. By construction, the generator matrix At1 ,...,ts is a block upper triangular matrix, so it is easy to see that the codewords in Φ(Q) Ps−2 are linearly independent of the ones in {Φ(P ), Φ( i=0 2i )}. Note that σ < s since H is nonlinear. Ps−2 Thus, by Lemma 2.2, it is easy to see that the codewords in {Φ(P ), Φ( i=0 2i )} are linearly independent. Therefore, we have that the dimension of the linear span of this set is σ + τ , so ker(H) ≥ σ + τ .  Ps−1 Lemma 4.2 Let v ∈ Z2s and λi ∈ Z2 , i ∈ {0, . . . , s−1}. Then, v⊙ i=0 λi 2i = Ps−1 i i=0 v ⊙ λi 2 . Proof. Let v ∈ Z2s and [v0 , v1 , . . . , vs−1 ]2 its binary expansion. By definiPs−1 Ps−1 tion, we have that v ⊙ i=0 λi 2i = i=0 vi λi 2i . Note that vi λi 2i = v ⊙ λi 2i , Ps−1 Ps−1 so v ⊙ i=0 λi 2i = i=0 v ⊙ λi 2i .  Lemma 4.3 Let H = Ht1 ,...,ts be the Z2s -additive Hadamard code of type (n; t1 , Ps−2 Ps−2 . . . , ts ). Let N = { i=σ−1 λi 2i : λi ∈ Z2 } \ { i=σ−1 2i } if σ ≤ s − 1. Then, Φ(N ) ∩ K(Φ(H)) = {0}. Ps−2 Proof. Let H = Φ(H). Let u = i=σ−1 λi 2i ∈ N such that Φ(u) ∈ K(H). We want to prove that u = 0. By construction, the second row w2 of At1 ,...,ts is a 2t−2s+σ -fold replication of v = 2σ−1 (0, 1, . . . , 2s+1−σ − 1), and ord(w2 ) = 2s+1−σ . By Proposition 2.1, we have that Φ(w2 ) + Φ(u) = Φ(w2 + u − 2(w2 ⊙ u)). Since Φ(u) ∈ K(H), 2(w2 ⊙ u) ∈ H. Note that, by Lemma 4.2, we have that 2(w2 ⊙ u) = Ps−2 Ps−2 (i) i i 2 i=σ−1 wP 2 ⊙ λi 2 = 2 i=σ−1 λi w2 2 ∈ H. s Let τ = i=1 ti . If τ = 2, then H has length 2s+1−σ and the only vectors in At1 ,...,ts are 1 and w2 = v. If τ ≥ 3, for i ∈ {3, . . . , τ }, the ith row wi of At1 ,...,ts contains zeros in the first 2s+1−σ coordinates by construction. Since σ ≤ s − 1, τ ≥ 2, and hence any element of H restricted to the first 2s+1−σ coordinates is Ps−2 (i) λi w2 2i of the form µ1 1 + µ2 v for some µ1 , µ2 ∈ Z2s . We have that 2 i=σ−1 P s−2 restricted to the first 2s+1−σ coordinates is 2 i=σ−1 λi v(i) 2i , so we have to Ps−2 find µ1 , µ2 ∈ Z2s such that 2 i=σ−1 λi v(i) 2i = µ1 1 + µ2 v. 10 Since the first coordinate of v is 0, the first coordinate of v(i) is 0 for all Ps−2 i. Then, we have that µ1 = 0, so 2 i=σ−1 λi v(i) 2i = µ2 v. Note that v = Ps−1 Ps−1 (i) i Ps−1 Ps−2 (i) i (i) i (i) i i=σ−1 v 2 . i=0 v 2 = i=σ−1 v 2 . Therefore, 2 i=σ−1 λi v 2 = µ2 Since u ∈ N , there exists j ∈ {σ − 1, . . . , s − 2} such that λj = 0. Then, regrouping the terms, we obtain that s−2 X (µ2 − 2λi )v(i) 2i + µ2 v(j) 2j + µ2 v(s−1) 2s−1 = 0. i=σ−1 i6=j s−1 Note that {v(i) }i=σ−1 is a subset of a basis of the RM (1, t). Then, we have i that (µ2 − 2λi )2 = 0, for i ∈ {σ − 1, · · · , s − 2} \ {j}, µ2 2j = 0 and µ2 2s−1 = 0. As a result, µ2 = 0 and λi = 0 for all i ∈ {σ − 1, · · · , s − 2}. Hence, u = Ps−2 i i=σ−1 λi 2 = 0, and the result holds.  code of type (n; t1 , Lemma 4.4 Let H = Ht1 ,...,ts be the Z2s -additive Hadamard P . . . , ts ). Let wi be the ith row of At1 ,...,ts and τ = si=1 ti . Let M = {v = Ps−2 Ps−2 Pτ −ts i i i=σ−1 λi 2 : λi ∈ Z2 }\{ i=σ−1 2 } i=2 λi wi : λi ∈ Z2s , ord(v) > 2}, N = { if σ ≤ s − 1 and M + N = {vM + vN : vM ∈ M ∪ {0}, vN ∈ N }. Then, Φ(M + N ) ∩ K(Φ(H)) = {0}. Proof. Let H = Φ(H), which has length N = 2t = n · 2s−1 . By Lemma 4.3, we already know that Φ(N )∩K(H) = {0}. Now, we prove that Φ(M)∩K(H) = ∅. Pτ −ts s+1−σ Let v = , i=2 λi wi ∈ M. Since ord(v) > 2 and ord(wi ) ≤ 2 p ord(v) = 2 for some 2 ≤ p ≤ s + 1 − σ. By the iterative construction (2) of At1 ,...,ts , we know that all the elements of Z2s of order equal to or less than 2p appear as a coordinate of v. Moreover, exactly half of the coordinates of v are of order 2p . We consider two cases depending on the value of p. First, we consider that 2 < p ≤ s + 1 − σ. We have that Φ(v) + Φ(2s−p ) = Φ(v + 2s−p − 2s−p+1 v(s−p) ) by Corollary 2.1. As before, it is enough to see that 2s−p+1 v(s−p) 6∈ H to prove that Φ(v) 6∈ K(H). Since half of the coordinates of v are of order 2p and the other half are of order less than 2p , we have that half of the coordinates of 2s−p+1 v(s−p) are equal to 2s−p+1 and the rest of coordinates are zero. Note that 2s−p+1 6∈ {0, 2s−1 } since p > 2. Therefore, since wtH (φ(2s−p+1 )) = 2s−2 , we have that wtH (Φ(2s−p+1 v(s−p) )) = n/2 · 2s−2 = 2t−2 = N/4 and hence Φ(v) 6∈ K(H). Next, we consider that p = 2, that is, ord(v) = 4. Then, ord(λi wi ) = 4 or λi = 0 for all i ∈ {2, . . . , τ − ts }. By Proposition 2.1, Φ(v) + Φ(2s−σ−1 w2 ) = Φ(v + 2s−σ−1 w2 − 2(v ⊙ 2s−σ−1 w2 )). Again, it is enough to see that 2(v ⊙ 2s−σ−1 w2 ) 6∈ H to show that Φ(v) 6∈ K(H). Note that 2s−σ−1 w2 is a 2t−s−1 fold replication of b1 = (0, 2s−2 , 2s−1 , 3·2s−2 ). Now, we consider the coordinates divided into groups of 4 consecutive coordinates, which will be referred to as blocks. Note that every block of λi wi contains the same value in its 4 coordinates, for all i ∈ {3, . . . , τ − ts }. If λ2 = 0, then every block of v also contains the same value in its 4 coordinates. Thus, every block in 2(v ⊙ 2s−σ−1 w2 ) is of the form 2(k ⊙ b1 ) for some 11 k ∈ {0, 2s−2 , 2s−1 , 3 · 2s−2 }. We have that  (0, 0, 0, 0) if k ∈ {0, 2s−1 } 2(k ⊙ b1 ) = s−1 s−1 (0, 2 , 0, 2 ) if k ∈ {2s−2 , 3 · 2s−2 }. By construction, note that v contains the same number of blocks k for each k ∈ {0, 2s−2 , 2s−1 , 3 · 2s−2}. Then, it is easy to see that wtH (Φ(2(v ⊙ 2s−σ−1 w2 ))) = wtH (φ(2s−1 )) · 4 · n/16 = 2s−1 · n/4 = 2t−2 = N/4, so Φ(v) 6∈ K(H) in this case. Otherwise, if λ2 6= 0, then every block of v is of the form bi + k, for some i ∈ {1, 2} and k ∈ {0, 2s−2 , 2s−1 , 3 · 2s−2 }, where b1 = (0, 2s−2 , 2s−1 , 3 · 2s−2 ) and b2 = (0, 3 · 2s−2 , 2s−1 , 2s−2 ). Then, we have that  (0, 0, 0, 0) if k ∈ {2s−2 , 3 · 2s−2 } 2((bi + k) ⊙ b1 ) = s−1 s−1 (0, 2 , 0, 2 ) if k ∈ {0, 2s−1 }, for i ∈ {1, 2}. Again, by construction, v contains the same number of blocks bi + k for each k ∈ {0, 2s−2 , 2s−1 , 3 · 2s−2 }. Therefore, as before, wtH (Φ(2(v ⊙ 2s−σ−1 w2 ))) = N/4, and Φ(v) 6∈ K(H). We have just shown that Φ(M) ∩ K(H) = ∅. Now, we prove that Φ(M + N ) ∩ K(H) = {0}. Let v = vM + vN ∈ M + N \{0}, where vM ∈ M and vN ∈ N . We just proved that Φ(v) 6∈ K(H) if vM = 0 or vN = 0. Therefore, we can assume that vM 6= 0 and vN 6= 0. We know that vN = (v, . . . , v). Let [v0 , v1 , . . . , vs−1 ]2 be the binary expansion of v. Let vN1 and vN2 be the elements of Z2s having binary expansion [0, . . . , 0, vs−p , . . . , vs−1 ]2 and [v0 , . . . , vs−p−1 , 0, . . . , 0]2 , respectively. Then, vN = vN1 +vN2 , where vNi = (vNi , . . . , vNi ) for i ∈ {1, 2}. Since ord(vM ) = 2p with 2 ≤ p ≤ s + 1 − σ, the binary expansion of each one of its coordinates of is of the form [0, . . . , 0, (vM )s−p , . . . , (vM )s−1 ]2 . Note that we also have that ord(vN1 ) ≤ ord(vM ) by construction. On the one hand, we consider 2 < p ≤ s + 1 − σ. It is easy to see that 2(vN2 ⊙ 2s−p ) = 0. Therefore, wtH (Φ(2(v ⊙ 2s−p ))) = wtH (Φ(2((vM + vN1 ) ⊙ 2s−p ))). Since ord(vN1 ) ≤ ord(vM ), it is easy to see that there exists a permutation of coordinates π such that π(vM + vN1 ) = vM . Thus, wtH (Φ(2((vM + vN1 ) ⊙ 2s−p ))) = wtH (Φ(2(vM ⊙ 2s−p ))) and the result holds by using the same arguments as above. On the other hand, we consider that p = 2. Note that ord(vM ) = 4, and then ord(vN1 ) = 4. It is easy to see that 2(vN2 ⊙ 2s−σ−1 w2 ) = 0, hence we have that wtH (Φ(2(v ⊙ 2s−σ−1 w2 ))) = wtH (Φ(2((vM + vN1 ) ⊙ 2s−σ−1 w2 ))). Recall t−s−1 that 2s−σ−1 -fold replication of b1 . Taking into account that 2 is the 2 Pτ −tw s vM = i=2 λi wi , note that the blocks of vM + vN1 are of the form k for some k ∈ {0, 2s−2 , 2s−1 , 3·2s−2 } if λ2 = 0; or bi +k for some k ∈ {0, 2s−2 , 2s−1 , 3·2s−2 } and i ∈ {1, 2} if λ2 6= 0. Therefore, the proof is analogous to the above one to show that Φ(v) 6∈ K(H) with v ∈ M. Then, the result holds.  Theorem 4.2 Let H = Ht1 ,...,ts be the Z2s -additive Hadamard code of type (n; t1 , . . . , ts ) such that Φ(H) is nonlinear. Let Hb be the subcode of H which contains all the codewords of order two. Let P = {2p }σ−2 p=0 if σ ≥ 2, and P = ∅ if σ = 1. Then, + * s−2 X i 2 ) = K(Φ(H)) Φ(Hb ), Φ(P ), Φ( i=0 12 and ker(Φ(H)) = σ + Ps i=1 ti . Proof. The result follows by Proposition 4.2 and Lemma 4.4.  Corollary 4.1 Let H = Ht1 ,...,ts be the Z2s -additive Hadamard code of type (n; t1P , . . . , ts ) such that Φ(H) is nonlinear. Let wi be the ith row of At1 ,...,ts and s τ = i=1 ti . Let Q = {(ord(wq )/2)wq }τq=0 and P = {2p }σ−2 p=0 if σ ≥ 2, and Ps−2 i P = ∅ if σ = 1. Then, {Φ(Q), Φ(P ), Φ( i=0 2 } is a basis of K(Φ(H)). Example 4.2 Let H 2,0,0 be the Z8 -linear Hadamard code considered in Example 3.4. By Theorem 4.2, we have that ker(H 2,0,0 ) = 3. Moreover, we can construct K(H 2,0,0 ) from a basis, by Corollary 4.1. First, we have that Q = {4, (0, 4, 0, 4, 0, 4, 0, 4)}. Since σ = 1, in this case, we have that P = ∅. Thus, K(H 2,0,0 ) = hΦ(4), Φ((0, 4, 0, 4, 0, 4, 0, 4)), Φ(3)i. 5 Classification of Z2s -Linear Hadamard Codes The classification of the Z4 -linear Hadamard codes of length 2t , for any t ≥ 3, using the rank or the dimension of the kernel is shown in [15, 18]. In this section, we show that the dimension of the kernel can not be used to establish a complete classification of the Z2s -linear Hadamard codes of length 2t , in general, for any t ≥ 3 and s > 2. However, we see that this invariant allows us to show some partial results on the classification of these codes, through some examples. First of all, recall that, for any t ≥ 3, only the Z4 -linear Hadamard codes H 1,t2 and H 2,t2 of length 2t are linear [15], so these are equivalent to the ReedMuller code RM (1, t). By Theorem 4.1, for any t ≥ 3 and s > 2, there are also at most two Z2s -linear Hadamard codes of length 2t , H 1,0,...,0,1,ts and H 1,0,...,0,ts , that are linear. Moreover, the following result implies that we can focus on t ≥ 5 and 2 ≤ s ≤ t − 2 to try to classify the nonlinear ones. Theorem 5.1 Let At,s be the number of nonequivalent Z2s -linear Hadamard codes of length 2t . Then,   0 if t ≥ 3 and s ≥ t + 2 1 if t ≥ 3 and s ∈ {t − 1, t, t + 1} At,s =  1 if t = 4 and s = 2, and the Z2s -linear Hadamard code is linear when At,s = 1. Moreover, if t ≥ 5 and 2 ≤ s ≤ t − 2, then At,s ≥ 2, and there is one which is linear and at least one which is nonlinear. Proof. First, if t ≥ 3 and s ≥ t + 2, then the equation t= s X i=1  (s − i + 1) · ti − 1, (6) with t1 ≥ 1, has not any nonnegative integer solution, so At,s = 0. If t ≥ 3 and s = t + 1, then (6) has only one solution (t1 , . . . , ts ) = (1, 0, . . . , 0). If t ≥ 3 and 13 s = t, (6) has only the solution (1, 0, . . . , 0, 1). If t ≥ 3 and s = t − 1, (6) has exactly two solutions (1, 0, . . . , 0, 2) and (1,0,. . . ,0,1,0). Note that, when t = 3 and s = 2, both solutions are (1, 2) and (2, 0). By Theorem 4.1, for all the above solutions, we obtain a linear code H t1 ,...,ts . Finally, if t ≥ 5 and 2 ≤ s ≤ t−2, (6) always has the solutions (1, 0, . . . , 0, t− s + 1) and (1, 0, . . . , 0, 1, t − s − 1), which give a linear code. However, for these cases, there is at least another solution. On the one hand, if s = 2, At,s = ⌊(t−1)/2⌋ ≥ 2 since t ≥ 5 [15]. On the other hand, if s = 3, (2, 0, · · · , 0, t−2s+1) is a solution since t ≥ 2s − 1 when t ≥ 5; and if s ≥ 4, (1, 0, · · · , 0, 1, 0, t − s − 2) is a solution. Therefore, for all the cases, At,s ≥ 2 by Theorem 4.1.  The following example shows that the dimension of the kernel can not be used, in general, to classify completely all nonlinear Z2s -linear Hadamard codes of length 2t , once t ≥ 5 and 2 < s ≤ t − 2 are fixed. Example 5.1 The Z8 -linear Hadamard codes of length 2t = 256 are the following: H 1,0,6 , H 1,1,4 , H 1,2,2 , H 1,3,0 , H 2,0,3 , H 2,1,1 and H 3,0,0 . The first two are equivalent as they are linear by Theorem 4.1. The remaining ones have kernels of dimension 7, 6, 6, 5 and 4, respectively, by Theorem 4.2. Therefore, by using this invariant, we can say that all of them are nonequivalent, with the exception of H 1,3,0 and H 2,0,3 which have the same dimension of the kernel. For these two codes, by using the computer algebra system Magma [6], we have computed that rank(H 1,3,0 ) = 12 and rank(H 2,0,3 ) = 11, so they are also nonequivalent. Actually, all these nonlinear codes have ranks 10, 12, 11, 13 and 17, respectively, so we can use the rank instead of the dimension of the kernel to classify completely the Z8 -linear Hadamard codes of length 256. As shown in the next example, for some values of t ≥ 5 and 2 < s ≤ t−2, it is indeed possible to establish a complete classification by using just the dimension of the kernel, like it happens for any t ≥ 5 and s = 2 [15]. Example 5.2 By Theorem 4.2, it is possible to check that for any 5 ≤ t ≤ 7 and 2 ≤ s ≤ t − 2, all nonlinear Z2s -linear Hadamard codes of length 2t have a different dimension of the kernel, so this invariant allows us to classify them. For t = 8, t = 9, t = 10 and t = 11, it also works, except when s ∈ {3}, s ∈ {3, 4}, s ∈ {3, 4, 5} and s ∈ {3, 4, 5, 6}, respectively. For these given values of t and s, we can just obtain a partial classification by using the kernel. By using Magma, we have also computed the rank of the nonlinear Z2s -linear Hadamard codes of length 2t , for any 5 ≤ t ≤ 11 and 2 ≤ s ≤ t − 2. Tables 1 and 4 show the values of (t1 , . . . , ts ) and the pair (r, k), where r is the rank and k the dimension of the kernel, for all nonlinear Z2s -linear Hadamard codes of length 2t , for 5 ≤ t ≤ 10. Note that the results given by Example 5.1, and Example 5.2 for 5 ≤ t ≤ 10, can also be checked by looking at these tables. These tables also show that all nonlinear Z2s -linear Hadamard codes of length 2t have a different value of the rank, once 5 ≤ t ≤ 10 and 2 ≤ s ≤ t − 2 are fixed. Therefore, for these cases, as in Example 5.1, we have that the codes are pairwise nonequivalent, so we have a complete classification by using the rank and we can establish the following result. 14 Z4 t=5 (t1 , . . . , ts ) (r, k) (3, 0) (7,4) (2, 0, 0) t=6 (t1 , . . . , ts ) (r, k) (3, 1) (8,5) (8,3) (1, 2, 0) (2, 0, 1) (8,5) (9,4) (1, 1, 0, 0) (9,4) Z8 Z16 Z32 t=7 (t1 , . . . , ts ) (3, 2) (4, 0) (1, 2, 1) (2, 0, 2) (2, 1, 0) (1, 0, 2, 0) (1, 1, 0, 1) (2, 0, 0, 0) (1, 0, 1, 0, 0) (r, k) (9,6) (11,5) (9,6) (10,5) (12,4) (9,6) (10,5) (14,3) (10,5) Table 1: Rank and kernel for all nonlinear Z2s -linear Hadamard codes of length 2t . Theorem 5.2 Let At,s be the number of nonequivalent Z2s -linear Hadamard codes of length 2t . Then, for any t ≥ 3 and 2 ≤ s ≤ t − 1, At,s ≤ |{(t1 , . . . , ts ) ∈ Ns : t = s X i=1  (s − i + 1) · ti − 1, t1 ≥ 1}| − 1. Moreover, for any 3 ≤ t ≤ 11 and 2 ≤ s ≤ t − 1, this bound is tight. Proof. Straightforward from Theorem 4.1, the proof of Theorem 5.1, Tables 1 and 4, and further computations by using Magma for t = 11.  By Theorems 5.2 and 5.1 (or Tables 1 and 4), we can obtain exactly the number of nonequivalent Z2s -linear Hadamard codes of length 2t , for some values of t and s. Table 2 shows these numbers, for 3 ≤ t ≤ 11 and 2 ≤ s ≤ 9. The cases where the dimension of the kernel is not enough to classify these codes are shown in bold type. However, in all these cases, the rank can be used to obtain the classification. t Z4 Z8 Z16 Z32 Z64 Z128 Z256 Z512 3 1 1 1 0 0 0 0 0 4 1 1 1 1 0 0 0 0 5 2 2 1 1 1 0 0 0 6 2 3 2 1 1 1 0 0 7 3 4 4 2 1 1 1 0 8 3 6 5 4 2 1 1 1 9 4 7 8 6 4 2 1 1 10 4 9 10 9 6 4 2 1 11 5 11 14 12 10 6 4 2 Table 2: Number At,s of nonequivalent Z2s -linear Hadamard codes of length 2t . The values of At,2 given in Table 2 where already proved in [15]. Specifically, in that paper, it is shown that there are ⌊ t−1 2 ⌋ nonequivalent Z4 -linear Hadamard codes of length 2t for all t ≥ 3. Next, we focus on establishing 15 some relationships between the already known Z2s -linear Hadamard codes with s = 2 and the ones with s > 2, once only the length 2t is fixed. First, Example 5.3 shows that there are Z2s -linear Hadamard codes, with s > 2, which are not equivalent to any Z4 -linear Hadamard code. Then, Example 5.4 also shows that there are Z4 -linear Hadamard codes which are not equivalent to any Z2s -linear Hadamard codes with s > 2. Example 5.3 Let H 2,0,0 be the Z8 -linear Hadamard code of length 32 considered in Examples 3.4 and 4.2. Recall that ker(H 2,0,0 ) = 3 by Theorem 4.2, and hence H 2,0,0 is nonlinear. It is known that there are three Z4 -linear Hadamard codes of length 32, H 1,4 , H 2,2 and H 3,0 . The first two are linear, and the last one has ker(H 3,0 ) = 4 by Theorem 4.2 or [15]. Hence, there is no Z4 -linear Hadamard code equivalent to the Z8 -linear Hadamard code H 2,0,0 . Example 5.4 By Table 1, for t = 5, there are only two nonlinear Z2s -linear Hadamard codes, H 3,0 and H 2,0,0 . In Example 5.3, we have seen that they are not equivalent, since they have different dimension of the kernel. Other examples like this one can be found when t is odd. For example, by Tables 1 and 4 and further computations in Magma, for t = 7, t = 9 and t = 11, there are Z4 -linear Hadamard codes, H 4,0 , H 5,0 and H 6,0 , respectively, which are not equivalent to any Z2s -linear Hadamard codes with s > 2 of the same length, by using both invariants, the rank and the dimension of the kernel. It is also worth to mention that there are Hadamard codes, called Z2 Z4 linear Hadamard codes, which came from the image of a generalized Gray map β of subgroups of Zα 2 × Z4 . Note that if α = 0, they correspond to Z4 -linear Hadamard codes. More information on Z2 Z4 -linear codes in general can be found in [5]. The classification of Z2 Z4 -linear Hadamard codes of length 2t with α 6= 0 is given in [18], where it is shown that there are ⌊ 2t ⌋ nonequivalent of such codes, for all t ≥ 3; and either the rank or the dimension of the kernel can be used to classify them, like for Z4 -linear Hadamard codes. Recall that there t are ⌊ t−1 2 ⌋ nonequivalent Z4 -linear Hadamard codes of length 2 for all t ≥ 3 [15]. However, in [16], it is shown that each Z2 Z4 -linear Hadamard code with α = 0, that is, each Z4 -linear Hadamard code, is equivalent to a Z2 Z4 -linear Hadamard code with α 6= 0, so there are only ⌊ 2t ⌋ nonequivalent Z2 Z4 -linear Hadamard codes of length 2t . The following example shows that there are Z2 Z4 -linear Hadamard codes (with α 6= 0) which are not equivalent to any Z2s -linear Hadamard codes with s ≥ 2. Example 5.5 For t = 4, there is a Z2 Z4 -linear Hadamard code (with α 6= 0) which is not equivalent to any Z4 -linear Hadamard code [16]. This code has parameters (r, k) = (6, 3) [18], so it is not equivalent to any Z2s -linear Hadamard code with s ≥ 2, since all of them are linear by Theorem 5.1. Other examples like this one can be found when t is even. For example, for t = 6, t = 8 and t = 10, there is also a Z2 Z4 -linear Hadamard code (with α 6= 0) which is not equivalent to any Z4 -linear Hadamard code [16]. They have parameters (10, 4), (15, 5) and (21, 6) [18], respectively, so again they are not equivalent to any Z2s linear Hadamard code with s ≥ 2 of length 26 , 28 and 210 , respectively, by Tables 1 and 4. 16 Finally, we focus on establishing how many nonequivalent Z2s -linear Hadamard codes of length 2t there are, once only the length 2t is fixed for some values of t. First, we give some lower and upper bounds. From Tables 1 and 4, and further computations in Magma for t = 11, we can determine a lower bound (K) taking into account just the dimension of the kernel. This lower bound can be improved (RK) if we consider both invariants, the rank and the dimension of the kernel. These results are summarized in Table 3, where we give these bounds for all 3 ≤ t ≤ 11. t lower bound K lower bound RK upper bound 3 1 1 1 4 1 1 1 5 3 3 3 6 3 3 5 7 5 6 10 8 5 7 16 9 7 11 26 10 7 13 38 11 9 20 57 Table 3: Bounds for the number At of nonequivalent Z2s -linear Hadamard codes of length 2t . An upper bound can be given easily by considering all nonequivalent Z2s linear Hadamard codes of length 2t , once t and s are fixed, as it is shown in the next theorem. These values for all 3 ≤ t ≤ 11 are also shown in Table 3. Theorem 5.3 Let At,s be the number of nonequivalent Z2s -linear Hadamard codes of length 2t . Let At be the number of nonequivalent Z2s -linear Hadamard Pt−2 t codes of length 2 , for any s ≥ 2. Then, At ≤ s=2 (At,s − 1) + 1. Theorem 5.4 There are exactly 1,1,3, 3 and 6 nonequivalent Z2s -linear Hadamard codes of length 2t for t equal to 3, 4, 5, 6 and 7, respectively. Proof. For t equal to 3, 4 and 5, the result is true, since the lower and upper bounds given in Table 3 coincides. By using Magma, it is possible to check that, for t = 6, both Z2s -linear Hadamard codes having the same parameters (r, k) = (8, 5) are equivalent; and the ones having (r, k) = (9, 4) are also equivalent. Therefore, in this case, the upper bound goes from 5 to 3, and then coincides with the lower bound given in Table 3. Similarly, or t = 7, it is also possible to check that the codes having the same parameters (r, k) are all equivalent, so the upper bound became equal to the lower bound 6, and the result also holds.  6 Conclusions The kernel of Z2s -linear Hadamard codes of length 2t has been studied for s > 2. We compute the kernel of these codes and its dimension in order to classify them, like it is done for s = 2. We first have considered that the parameters t and s are fixed. Examples 5.1 and 5.2 show that, only for some values of t and s, we can use the dimension of the kernel to distinguish between nonequivalent Z2s -linear Hadamard codes of length 2t . However, when this is not possible, by using Magma, we also show that in these examples the rank is enough to classify them. A further research on this topic would be to determine exactly for which values of t and s the dimension of the kernel classify them, or to compute the rank of these codes in order to prove that this invariant is enough to established their complete classification, for any t and s. 17 Z4 t=8 (t1 , . . . , ts ) (3, 3) (4, 1) (r, k) (10,7) (12,6) t=9 (t1 , . . . , ts ) (3, 4) (4, 2) (5, 0) (1, 2, 3) (1, 3, 1) (2, 0, 4) (2, 1, 2) (2, 2, 0) (3, 0, 1) (r, k) (11,8) (13,7) (16,6) (11,8) (13,7) (12,7) (14,6) (17,5) (18,5) (1, 2, 2) (1, 3, 0) (2, 0, 3) (2, 1, 1) (3, 0, 0) (10,7) (12,6) (11,6) (13,5) (17,4) Z16 (1, 0, 2, 1) (1, 1, 0, 2) (1, 1, 1, 0) (2, 0, 0, 1) (10,7) (11,6) (13,5) (15,4) (1, 0, 2, 2) (1, 0, 3, 0) (1, 2, 0, 0) (1, 1, 0, 3) (1, 1, 1, 1) (2, 0, 0, 2) (2, 0, 1, 0) (11,8) (13,7) (18,5) (12,7) (14,6) (16,5) (20,4) Z32 (1, 0, 0, 2, 0) (1, 0, 1, 0, 1) (1, 1, 0, 0, 0) (10,7) (11,6) (15,4) (1, 0, 0, 2, 1) (1, 0, 1, 0, 2) (1, 0, 1, 1, 0) (1, 1, 0, 0, 1) (2, 0, 0, 0, 0) (11,8) (12,7) (14,6) (16,5) (26,3) (1, 0, 0, 1, 0, 0) (11,6) (1, 0, 0, 0, 2, 0) (1, 0, 0, 1, 0, 1) (1, 0, 1, 0, 0, 0) (11,8) (12,7) (16,5) (1, 0, 0, 0, 1, 0, 0) (12,7) Z8 Z64 Z128 Z256 t = 10 (t1 , . . . , ts ) (3, 5) (4, 3) (5, 1) (1, 2, 4) (1, 3, 2) (1, 4, 0) (2, 0, 5) (2, 1, 3) (2, 2, 1) (3, 0, 2) (3, 1, 0) (1, 0, 2, 3) (1, 0, 3, 1) (1, 1, 0, 4) (1, 1, 1, 2) (1, 1, 2, 0) (1, 2, 0, 1) (2, 0, 0, 3) (2, 0, 1, 1) (2, 1, 0, 0) (1, 0, 0, 2, 2) (1, 0, 0, 3, 0) (1, 0, 1, 0, 3) (1, 0, 1, 1, 1) (1, 0, 2, 0, 0) (1, 1, 0, 0, 2) (1, 1, 0, 1, 0) (2, 0, 0, 0, 1) (1, 0, 0, 0, 2, 1) (1, 0, 0, 1, 0, 2) (1, 0, 0, 1, 1, 0) (1, 0, 1, 0, 0, 1) (1, 1, 0, 0, 0, 0) (1, 0, 0, 0, 0, 2, 0) (1, 0, 0, 0, 1, 0, 1) (1, 0, 0, 1, 0, 0, 0) (1, 0, 0, 0, 0, 1, 0, 0) Table 4: Rank and kernel for all nonlinear Z2s -linear Hadamard codes of length 2t . We have also considered that only the length 2t is fixed. Examples 5.4 and 5.5 seem to point out that for any t odd (t even), there is exactly one Z4 -linear Hadamard code (Z2 Z4 -linear Hadamard code with α 6= 0) of length 2t which is not equivalent to any Z2s -linear Hadamard code with s > 2; and the others Z4 -linear Hadamard codes (Z2 Z4 -linear Hadamard codes with α 6= 0) of the 18 (r, k) (12,9) (14,8) (17,7) (12,9) (14,8) (17,7) (13,8) (15,7) (18,6) (19,6) (24,5) (12,9) (14,8) (13,8) (15,7) (18,6) (19,6) (17,6) (21,5) (28,4) (12,9) (14,8) (13,8) (15,7) (19,6) (17,6) (21,5) (27,4) (12,9) (13,8) (15,7) (17,6) (27,4) (12,9) (13,8) (17,6) (13,8) same length are equivalent to a Z8 -linear Hadamard code, although they may also have other structures with s > 3. Another further research in this sense would be to establish whether this is always true; and whether all Z2s -linear Hadamard codes of the same length, having the same rank and dimension of the kernel, are equivalent. Finally, we have established some bounds for the exact number of nonequivalent Z2s -linear Hadamard codes of length 2t , when both t and s are fixed, and when just t is fixed; denoted by At,s and At , respectively. For some values of t and s, we provide their exact values, by using Magma. It would also be interesting to determine them for any possible t and s, as a further research; as well as equivalent results by considering the generalized Gray map used in [14]. References [1] Alahmadi, A., Sepasdar, Z., Shi, M., Solé, P.: On two-weight Z2k -codes. Designs, Codes and Cryptography (2017). doi:10.1007/s10623-017-0390-0 [2] Assmus, E. F., Key, J. D.: Designs and their codes. Cambridge University Press, Great Britain (1992). [3] Bauer, H., Ganter, B., Hergert, F.: Algebraic techniques for nonlinear codes. Combinatorica, 3, no. 1, pp. 21–33 (1983). [4] Blake, I.F.: Codes over integer residue rings. Inform. Control, 29, pp. 295– 300 (1975). [5] Borges, J., Fernández-Córdoba, C., Pujol, J., Rifà, J., Villanueva, M.: Z2 Z4 -linear codes: generator matrices and duality. Designs, Codes and Cryptography, 54, no. 2, pp. 167–179 (2010). [6] Bosma W., Cannon, J. J., Fieker, C., book of Magma functions, Edition 2.22 http://magma.maths.usyd.edu.au/magma/. Steel, A.: 5669 pages Hand(2016). [7] Carlet, C.: Z2k -linear codes. IEEE Trans. Inform. Theory, 44, no. 4, pp. 1543–1547 (1998). [8] Dougherty, S. T., Fernández-Córdoba, C.: Codes Over Z2k , Gray Map and Self-Dual Codes. Advances in Mathematics of Communications, 5, no. 4, pp. 571–588 (2011). [9] Fernández-Córdoba, C., Vela, C., Villanueva, M.: On the Kernel of Z2s linear Hadamard Codes. Coding theory and Applications, ICMCTA 2017. Lecture Notes in Computer Science, 10495, pp. 107–117 (2017). [10] Fernández-Córdoba, C., Vela, C., Villanueva, M.: Construction and Classification of the Z2s -linear Hadamard codes. Electronic Notes in Discrete Mathematics, 54, pp. 247–252 (2016). [11] Gupta, M. K., Bhandari M.C., Lal, A.K.: On some linear codes over Z2s . Designs, Codes and Cryptography, 36, no. 3, pp. 227–244 (2005). 19 [12] Hammons, A. R., Kumar, P. V., Calderbank, A. R., Sloane, N. J. A., Solé, P.: The Z4 -linearity of Kerdock, Preparata, Goethals and related codes. IEEE Trans. Inform. Theory, 40, no. 2, pp. 301–319 (1994). [13] Honold, T., Nechaev, A. A.: Weighted modules and representations of codes. Probl. Inf. Transm., 35, no. 3, pp. 1839 (1999). [14] Krotov, D. S.: On Z2k -dual binary codes. IEEE Trans. Inf. Theory, 53, no 4, pp. 1532–1537 (2007). [15] Krotov, D. S.: Z4 -linear Hadamard and extended perfect codes. International Workshop on Coding and Cryptography, ser. Electron. Notes Discrete Math. 6, pp. 107–112 (2001). [16] Krotov, D. S., Villanueva, M.: Classification of the Z2 Z4 -linear Hadamard codes and their automorphism groups. IEEE Trans. Inf. Theory, 61, no. 2, pp. 887–894 (2015). [17] MacWilliams, F. J., Sloane, N. J. A.: The theory of error-correcting codes. 16, Elsevier (1977). [18] Phelps, K. T., Rifà, J., Villanueva, M.: On the additive (Z4 -linear and nonZ4 -linear) Hadamard codes: rank and kernel. IEEE Trans. Inf. Theory, 52, no. 1, pp. 316–319 (2006). [19] Shankar, P.: On BCH codes over arbitrary integer rings. IEEE Trans. Inf. Theory, 25, no. 4, pp. 480–483 (1979). [20] Tapia-Recillas, H., Vega, G.: On Z2k -linear and quaternary codes. SIAM J. Discrete Math., 17, no. 1, pp. 103–113 (2003). 20