Finite Fields and Their Applications 86 (2023) 102140 Contents lists available at ScienceDirect Finite Fields and Their Applications journal homepage: www.elsevier.com/locate/ffa Linearity and classification of Zp Zp2 -linear generalized Hadamard codes ✩,✩✩ Dipak K. Bhunia ∗ , Cristina Fernández-Córdoba, Mercè Villanueva Department of Information and Communications Engineering, Universitat Autònoma de Barcelona, 08193 Cerdanyola del Vallès, Spain a r t i c l e i n f o a b s t r a c t α2 The Zp Zp2 -additive codes are subgroups of Zα p × Zp2 , and Article history: 1 Received 15 July 2022 can be seen as linear codes over Zp when α2 = 0, Zp2 -additive Received in revised form 16 codes when α1 = 0, or Z2 Z4 -additive codes when p = 2. A November 2022 Accepted 20 November 2022 Zp Zp2 -linear generalized Hadamard (GH) code is a GH code Available online 19 December 2022 over Zp which is the Gray map image of a Zp Zp2 -additive Communicated by W. Cary Huffman code. Recursive constructions of Zp Zp2 -additive GH codes of type (α1 , α2 ; t1 , t2 ) with t1 , t2 ≥ 1 are known. In this paper, we MSC: generalize some known results for Zp Zp2 -linear GH codes with 94B25 p = 2 to any p ≥ 3 prime when α1 = 0, and then we compare 94B60 them with the ones obtained when α1 = 0. First, we show for which types the corresponding Zp Zp2 -linear GH codes Keywords: are nonlinear over Zp . Then, for these codes, we compute Generalized Hadamard code the kernel and its dimension, which allow us to classify them Gray map Zp Zp2 -linear code completely. Moreover, by computing the rank of some of these Rank codes, we show that, unlike Z4 -linear Hadamard codes, the Kernel Zp2 -linear GH codes are not included in the family of Zp Zp2 - Classification linear GH codes with α1 = 0 when p ≥ 3 prime. Indeed, there are some families with infinite nonlinear Zp Zp2 -linear ✩ This work has been partially supported by the Spanish Ministerio de Ciencia e Innovación under Grant PID2019-104664GB-I00 (AEI / 10.13039/501100011033) and by the Catalan AGAUR scholarship 2020 FI SDUR 00475. ✩✩ The material in this paper was presented in part at the 12th International Workshop on Coding and Cryptography (WCC 2022), 7-11 March 2022 - Virtual [1]; and at the 2022 IEEE Information Theory Workshop (ITW 2022), 6-9 November 2022 [2]. * Corresponding author. E-mail address: dipak.bhunia@uab.cat (D.K. Bhunia). https://doi.org/10.1016/j.ffa.2022.102140 1071-5797/© 2022 The Author(s). Published by Elsevier Inc. This is an open access article under the CC BY-NC-ND license (http://creativecommons.org/licenses/by-nc-nd/4.0/). 2 D.K. Bhunia et al. / Finite Fields and Their Applications 86 (2023) 102140 GH codes, where the codes are not equivalent to any Zps - linear GH code with s ≥ 2. © 2022 The Author(s). Published by Elsevier Inc. This is an open access article under the CC BY-NC-ND license (http://creativecommons.org/licenses/by-nc-nd/4.0/). 1. Introduction Let Zps be the ring of integers modulo ps , where p is a prime. Let Znps denote the set of all n-tuples over Zps . In this paper, the elements of Znps will also be called vectors of length n. A code over Zp of length n is a nonempty subset of Znp , and it is linear if it is a subspace of Znp . Similarly, a nonempty subset of Znps is a Zps -additive code if it is a p × Zp2 . Note that a Zp Zp2 - α2 subgroup of Znps . A Zp Zp2 -additive code is a subgroup of Zα 1 additive code is a linear code over Zp when α2 = 0, a Zp2 -additive code when α1 = 0, or a Z2 Z4 -additive code when p = 2. The order of a vector u ∈ Znps , denoted by o(u), is the smallest positive integer m such that mu = (0, . . . , 0). Also, the order of u ∈ Zα p × Zp2 , 1 α2 denoted by o(u), is the smallest positive integer m such that mu = (0, . . . , 0 | 0, . . . , 0). Two codes C1 and C2 over Zp of length n are said to be monomially equivalent (or just equivalent) provided there is a monomial matrix M such that C2 = {cM : c ∈ C1 }. Recall that a monomial matrix is a square matrix with exactly one nonzero entry in each row and column. Both codes are said to be permutation equivalent if there is a permutation matrix P such that C2 = {cP : c ∈ C1 }. Recall that a permutation matrix is a square matrix with exactly one 1 in each row and column and zeros elsewhere. The Hamming weight of a vector u ∈ Znp , denoted by wtH (u), is the number of nonzero coordinates of u. The Hamming distance of two vectors u, v ∈ Znp , denoted by dH (u, v), is the number of coordinates in which they differ. Note that dH (u, v) = wtH (u − v). The minimum distance of a code C over Zp is d(C) = min{dH (u, v) : u, v ∈ C, u = v}. In [3], 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 map, which go from s−1 Z2s to Z22 [4–8]. The one given in [7] can be defined in terms of the elements of a Hadamard code [8], and Carlet’s Gray map [4] is a particular case of the one given in   [8] satisfying λi φ(2i ) = φ( λi 2i ) [9]. In this paper, we focus on a generalization of s−1 Carlet’s Gray map from Zps to Zpp , also denoted by φ, which is a particular case of s−1 the one given in [10]. Let Φ : Znps → Znp p be the extension of the Gray map φ given by Φ(y  ) = (φ(y1 ), . . . , φ(yn )), for any y  = (y1 , . . . , yn ) ∈ Znps . We also denote by Φ the p × Zp2 → Zp α2 extension Φ : Zα 1 α1 +pα2 , given by Φ((y | y  )) = (y, φ(y1 ), . . . , φ(yα 2 )),    for any y ∈ Zα p and y = (y1 , . . . , yα2 ) ∈ Zp2 . 1 α2 Let C ⊆ Znps be a Zps -additive code. We say that its Gray map image C = Φ(C) is a Zps -linear code of length nps−1 . Since C is a subgroup of Znps , it is isomorphic to an D.K. Bhunia et al. / Finite Fields and Their Applications 86 (2023) 102140 3 abelian structure Ztp1s × Ztp2s−1 × · · · × Ztps , and we say that C, or equivalently C = Φ(C), is of type (n; t1 , . . . , ts ). Note that |C| = pst1 p(s−1)t2 · · · pts . Similarly, if C ⊆ Zα p × Zp2 1 α2 is a Zp Zp2 -additive code, we say that its Gray map image C = Φ(C) is a Zp Zp2 -linear code of length α1 + pα2 . Since C can be seen as a subgroup of Zα 1 +α2 p2 , it is isomorphic to Ztp12 × Ztp2 , and we say that C, or equivalently C = Φ(C), is of type (α1 , α2 ; t1 , t2 ). Note that |C| = p2t1 +t2 . Note that a Zp2 -linear code of type (n; t1 , t2 ) can also be seen as a Zp Zp2 -linear code of type (0, n; t1 , t2 ). Unlike linear codes over finite fields, linear codes over rings do not have a basis, but there exist generator matrices for these codes having minimum number of rows. Two structural properties of codes over Zp are the rank and dimension of the kernel. The rank of a code C over Zp is simply the dimension of the linear span, C, of C. The kernel of a code C over Zp is defined as K(C) = {x ∈ Znp : x + C = C} [11,12]. 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 = C. We denote the rank of C as rank(C) and the dimension of the kernel as ker(C). These parameters can be used to distinguish between nonequivalent codes, since equivalent ones have the same rank and dimension of the kernel. A generalized Hadamard (GH) matrix H(p, λ) = (hij ) of order N = pλ over Zp is a pλ ×pλ matrix with entries from Zp with the property that for every i, j, 1 ≤ i < j ≤ pλ, each of the multisets {his − hjs : 1 ≤ s ≤ pλ} contains every element of Zp exactly λ times [13]. For μ ≥ 1, an ordinary Hadamard matrix of order 4μ corresponds to a GH matrix H(2, λ) over Z2 , where λ = 2μ [14]. Two GH matrices H1 and H2 of order N are said to be equivalent if one can be obtained from the other by a permutation of the rows and columns and adding the same element of Zp to all the coordinates in a row or in a column. Then, we can always change the first row and column of a GH matrix into zeros and we obtain an equivalent GH matrix which is called normalized. From a normalized GH matrix H, we denote by FH the code consisting of the rows of H. We define CH = ∪α∈Zp (FH + α1), where FH + α1 = {h + α1 : h ∈ FH } and 1 denotes the all-one vector. The code CH over Zp is called generalized Hadamard (GH) code [15]. Note that CH is generally a nonlinear code over Zp . Moreover, if it is of length N , it has pN codewords and d(CH ) = N (p − 1)/p. The Zps -additive (resp. Zp Zp2 -additive) codes such that after the Gray map Φ give GH codes are called Zps -additive (resp. Zp Zp2 -additive) GH codes and the corresponding images are called Zps -linear (resp. Zp Zp2 -linear) GH codes. The classification of Z2 Z4 - linear Hadamard codes of length 2t with α1 = 0 and α1 = 0 is given in [16,17], showing that there are (t − 1)/2 and t/2 such nonequivalent codes, respectively. Moreover, in [18], it is shown that each Z2 Z4 -linear Hadamard code with α1 = 0 is equivalent to a Z2 Z4 -linear Hadamard code with α1 = 0, so indeed there are only t/2 nonequivalent Z2 Z4 -linear Hadamard codes of length 2t . Later, in [19,9,20,21], an iterative construction for Zps -linear GH codes is described, the linearity is established, and a partial classifi- cation is obtained, giving the exact amount of nonequivalent nonlinear such codes for some parameters. The Zps -additive codes have also been studied in [22,23] as two-weight codes over Zps by considering the homogeneous weight. 4 D.K. Bhunia et al. / Finite Fields and Their Applications 86 (2023) 102140 This paper is focused mainly on Zp Zp2 -linear GH codes with α1 = 0 and p ≥ 3 prime, generalizing some results given for p = 2 in [17] related to the linearity, kernel, rank and classification of such codes. These codes are also compared with the Zps -linear GH codes studied in [19]. This paper is organized as follows. In Section 2, we recall the definition of the Gray map considered in this paper and some of its properties. Then, we recall the constructions of Zp Zp2 -additive GH codes of type (α1 , α2 ; t1 , t2 ) with α1 = 0 and p prime and some results related to that. In Sections 3 and 4, we establish for which types these codes are linear, and we give the kernel and its dimension whenever they are nonlinear. We also show that the dimension of the kernel is enough to classify completely the Zp Zp2 - linear GH codes with α1 = 0 of a given length, providing the number of nonequivalent such codes, like it was proved for Z2 Z4 -linear Hadamard codes in [17]. In Section 5, we compute the rank of some families of Zp Zp2 -linear GH codes with α1 = 0. Finally, in Section 6, we show that, unlike Z4 -linear Hadamard codes, the Zp2 -linear GH codes are not included in the family of Zp Zp2 -linear GH codes with α1 = 0 when p ≥ 3 prime. Indeed, we prove that there are some families of Zp Zp2 -linear GH codes, where the codes are not equivalent to any Zps -linear GH code with s ≥ 2. 2. Preliminary results In this section, we first give the definition of the Gray map considered in this paper for elements of Zps and some of its properties used in the paper. Then, we recall the constructions of Zp Zp2 -additive GH codes of type (α1 , α2 ; t1 , t2 ) with p prime when α1 = 0 and some results related to that. We consider the following Gray map φ, given in [4,24]: s−1 φ : Zps −→ Zpp (1) u → (us−1 , . . . , us−1 ) + (u0 , . . . , us−2 )Ys−1 , s−1 where u ∈ Zps , [u0 , u1 , . . . , us−1 ]p is the p-ary expansion of u, that is, u = i=0 pi ui (ui ∈ Zp ), and Ys−1 is a matrix of size (s − 1) × ps−1 whose columns are the elements of Zs−1 p . Without loss of generality, we assume that the columns of Ys−1 are ordered in ascending order, by considering the elements of Zs−1 p as the p-ary expansions of the elements of Zps−1 . Let u , v  ∈ Zp2 and [u0 , u1 ]p , [v0 , v1 ]p be the p-ary expansions of u and v  , respectively, i.e. u = u0 + u1 p and v  = v0 + v1 p. We define the operation “p ” between elements u and v  in Zp2 as u p v  = ξ0 + ξ1 p, where  1 if ui + vi ≥ p, ξi = 0 otherwise. Note that the p-ary expansion of u p v  is [ξ0 , ξ1 ]p , where ξ0 , ξ1 ∈ {0, 1}. For u, v ∈ Zp , we define u p v = 1 if u + v ≥ p and 0 otherwise. We denote in the same way, “p ”, D.K. Bhunia et al. / Finite Fields and Their Applications 86 (2023) 102140 5 the component-wise operation. For u = (u | u ), v = (v | v  ) ∈ Zα p × Zp2 , we denote 1 α2 u p v = (u p v | u p v  ). Note that p(u p v) = (0 | p(u p v  )). From [19], we have the following results: Lemma 2.1. [19] Let u ∈ Zp2 and λ ∈ Zp . Then, φ(u + λp) = φ(u) + (λ, . . . , λ). Corollary 2.1. [19] Let λ, μ ∈ Zp . Then, φ(λμp) = λφ(μp) = λμφ(p). Corollary 2.2. [19] Let u, v ∈ Zp2 . Then, φ(u) + φ(v) = φ(u + v − p(u p v)). Corollary 2.3. [19] Let u, v ∈ Zp2 . Then, φ(pu + v) = φ(pu) + φ(v). Corollary 2.4. [19] Let u, v ∈ Zp2 and [u0 , u1 ]p , [v0 , v1 ]p be the p-ary expansions of u and v, respectively. Then, φ(u + v) = φ(u) + φ(v) + (ξ0 , . . . , ξ0 ), where ξ0 = 1 if u0 + v0 ≥ p and 0 otherwise. Proposition 2.1. [4,24,19] Let u, v ∈ Zp2 . Then, dH (φ(u), φ(v)) = wtH (φ(u − v)). By Proposition 2.1, the Zp Zp2 -linear codes obtained from the Gray map Φ are distance invariant, that is, the Hamming weight distribution is invariant under translation by a codeword. Therefore, their minimum distance coincides with the minimum weight. Let 0, 1, 2, . . . , p2 − 1 be the vectors having the same element 0, 1, 2, . . . , p2 − 1 re- peated in all its coordinates, respectively. Let   1 1 ··· 1 p p ··· p A1,1 = . (2) p 0 1 ··· p−1 1 2 ··· p−1 Any matrix Atp1 ,t2 with t1 ≥ 1, t2 ≥ 2 or t1 ≥ 2, t2 ≥ 1 can be obtained by applying the following iterative constructions. First, if A is a generator matrix of a Zp Zp2 -additive p × Zp2 , then we denote by A1 the submatrix of A α2 code, that is, a subgroup of Zα 1 consisting of the first α1 columns over Zp , and A2 the submatrix consisting of the last α2 columns over Zp2 . We start with A1,1 p . Then, if we have a matrix A = Ap t1 ,t2 with t1 , t2 ≥ 1, we may construct the matrices   A1 A1 ··· A1 A2 A2 · · · A2 Apt1 ,t2 +1 = (3) 0 1 ··· p−1 p·0 p · 1 ··· p · (p − 1) and   A1 A1 ··· A1 pA1 ··· pA1 A2 A2 ··· A2 Atp1 +1,t2 = . (4) 0 1 ··· p−1 1 ··· p−1 0 1 ··· p2 − 1 6 D.K. Bhunia et al. / Finite Fields and Their Applications 86 (2023) 102140 Example 2.1. Let   1 1 1 3 3 A1,1 3 = 0 1 2 1 2 be the matrix described in (2) for p = 3. By using the constructions described in (3) and (4), we obtain A1,2 2,1 3 and A3 , respectively, as follows: ⎛ ⎞ 1 1 1 1 1 1 1 1 1 3 3 3 3 3 3 ⎜ ⎟ A1,2 3 = ⎝0 1 2 0 1 2 0 1 2 1 2 1 2 1 2⎠, 0 0 0 1 1 1 2 2 2 0 0 3 3 6 6 ⎛ ⎞ 1 1 1 1 1 1 1 1 1 3 3 3 3 3 3 3 3 ··· 3 3 ⎜ ⎟ A2,1 3 = ⎝0 1 2 0 1 2 0 1 2 0 3 6 0 3 6 1 2 ··· 1 2⎠. 0 0 0 1 1 1 2 2 2 1 1 1 2 2 2 0 0 ··· 8 8 We can consider that the matrices Atp1 ,t2 are constructed recursively starting from p in the following way. First, we add t1 − 1 rows of order p up to obtain Ap , and A1,1 2 t1 ,1 then we add t2 − 1 rows of order p up to achieve Ap . Note that in the first row there t1 ,t2 is always the row (1 | p). Let Hpt1 ,t2 be the Zp Zp2 -additive code of type (α1 , α2 ; t1 , t2 ) generated by the matrix Ap , with t1 , t2 ≥ 1, p prime, and α1 = 0. Let Hpt1 ,t2 = Φ(Hpt1 ,t2 ) be the corresponding t1 ,t2 Zp Zp2 -linear code. By Theorem 2.1, we have that Hpt1 ,t2 is a Zp Zp2 -linear GH code. Theorem 2.1. [25] Let t1 , t2 ≥ 1 and p prime. Then, the Zp Zp2 -linear code Hpt1 ,t2 of type (pt−t1 , pt−1 − pt−t1 −1 ; t1 , t2 ) is a GH code over Zp of length pt , with t = 2t1 + t2 − 1. Let H be a Zp Zp2 -additive code of type (α1 , α2 ; t1 , t2 ) with p prime. Let H1 (respec- tively, H2 ) be the punctured code of H by deleting the last α2 coordinates over Zp2 (respectively, the first α1 coordinates over Zp ). Remark 2.1. [25] Let H = Hpt1 ,t2 be a Zp Zp2 -additive GH code of type (α1 , α2 ; t1 , t2 ) with t1 , t2 ≥ 1 and p prime. Let H = Φ(Hpt1 ,t2 ) be the corresponding Zp Zp2 -linear GH code of length α1 + pα2 . Then, since H is a GH code, its minimum weight is (p − 1)(α1 + pα2 ) . p Note that, by construction, H1 is a GH code over Zp of length α1 and minimum weight (p − 1)α1 /p. Remark 2.2. [25] Since the length of the Zp Zp2 -linear GH code Φ(Hp1,1 ) is p2 , its minimum weight is (p − 1)p2 /p = p(p − 1) by Remark 2.1. D.K. Bhunia et al. / Finite Fields and Their Applications 86 (2023) 102140 7 Remark 2.3. [25] The above constructions (3) and (4) give always Zp Zp2 -linear GH codes with α2 = 0 since the starting matrix A1,1 p has α2 = 0. If α2 = 0, the Zp Zp2 -linear GH codes coincide with the codes obtained from a Sylvester GH matrix, so they are always linear and of type (pt2 −1 , 0; 0, t2 ) [15]. Therefore, in this paper, we only focus on the ones with α2 = 0. Finally, we give some notations and recall two results proved in [25], which are used in the next sections. When we include all the elements of Zp (resp. Zp2 ) as coordinates of a vector, we place them in increasing order. We denote by Np the set {0, 1, . . . , p − 1} ⊂ Zp2 and Np− = Np \ {0}. As before, when including all the elements in those sets as coordinates of a vector, we place them in increasing order. For a set S ⊆ Zp2 and λ ∈ Zp2 , we define λS = {λj : j ∈ S}. For example, N3 = {0, 1, 2} ⊂ Z9 , N3− = {1, 2} ⊂ Z9 , 2N3− = {2, 4}, 3Z9 = {0, 3, 6}, (Z3 , Z3 ) = (0, 1, 2, 0, 1, 2) ∈ Z63 and (Z3 | Z9 , 2N3− ) = (0, 1, 2 | 0, 1, 2, 3, 4, 5, 6, 7, 8, 2, 4) ∈ Z33 × Z11 9 . Lemma 2.2. [25] Let Hpt1 ,1 be the Zp Zp2 -additive code generated by the matrix Atp1 ,1 with t1 ≥ 2 and p prime. Let v1 , v2 , . . . , vt1 be the row vectors of Apt1 ,1 of order p2 .  t1 Let v = (v | v  ) ∈ Hpt1 ,1 such that v = i=1 λi vi , where λi ∈ Np and at least one  λi = 0. Then, v contains every element of pZp2 the same number of times and one of the following conditions is satisfied: 1. There exists λ ∈ Np− such that v  contains every element of λNp− the same number of times and every element of Zp2 \ (pZp2 ∪ λNp− ) zero times. 2. There exists λ ∈ Np− such that v  contains every element of λNp− the same number of times and every element of Zp2 \ (pZp2 ∪ λNp− ) the same number of times. 3. Every element of Zp2 \ pZp2 appears in v  the same number of times. Corollary 2.5. [25] Let Hpt1 ,t2 be the Zp Zp2 -additive code generated by the matrix Atp1 ,t2 with t1 ≥ 2, t2 ≥ 1, and p prime. Let u = (u | u ) ∈ Hpt1 ,t2 such that o(u) = p2 . Then, u contains every element of pZp2 the same number of times and the remaining coordinates are from Zp2 \ pZp2 . 3. Linearity of Zp Zp2 -linear GH codes with α1 = 0 As it is mentioned in Remark 2.3, since the Zp Zp2 -linear GH codes with α2 = 0 are linear, we only need to focus on the codes with α2 = 0. The linearity of Zp Zp2 -linear GH codes with α1 = 0 was studied in [16,17] for p = 2 and [19] for p ≥ 3 prime. When α1 = 0, they are the ones constructed from matrices Atp1 ,t2 given in Section 2. In [17], it is shown that the Z2 Z4 -linear Hadamard codes of type (α1 , α2 ; 1, t2 ) with t2 ≥ 1 are the only ones which are linear, when α1 = 0. The next result shows that there are no Zp Zp2 -linear GH codes of type (α1 , α2 ; t1 , t2 ), with α1 = 0, t1 , t2 ≥ 1 and p ≥ 3 prime, 8 D.K. Bhunia et al. / Finite Fields and Their Applications 86 (2023) 102140 which are linear. Note that this result for p ≥ 3 does not coincide with the known result for p = 2 if t1 = 1. Theorem 3.1. Let Hpt1 ,t2 be the Zp Zp2 -additive GH code of type (α1 , α2 ; t1 , t2 ) with α1 = 0, t1 , t2 ≥ 1 and p ≥ 3 prime. Then, Hpt1 ,t2 = Φ(Hpt1 ,t2 ) is nonlinear. Proof. First, we prove that Hp1,1 is nonlinear. Since u = (0, 1, . . . , p − 1 | 1, 2, . . . , p − 1) ∈ Hp1,1 , then (p −1)u = (0, (p −1) ·1, . . . , (p −1) ·(p −1) | (p −1) ·1, (p −1) ·2, . . . , (p −1) ·(p − 1)) ∈ Hp1,1 . Next, we see that Φ(u) + Φ((p − 1)u) ∈ / Hp1,1 . Since φ(1) + φ(p − 1) = 0 by the definition of φ, then the first 2p coordinates of the vector Φ(u) + Φ((p − 1)u) of length p2 are zero. Therefore, wtH (Φ(u) + Φ((p − 1)u)) ≤ p2 − 2p = p(p − 2) < p(p − 1). Moreover, it is easy to see that Φ(u) + Φ((p − 1)u) = 0. Hence, Φ(u) + Φ((p − 1)u) ∈ / Hp1,1 , since the minimum weight of Hp1,1 is p(p − 1) by Remark 2.2. Therefore, Hp1,1 is nonlinear. Second, we prove that if Hpt1 −1,t2 is nonlinear for t1 ≥ 2, t2 ≥ 1, then Hpt1 ,t2 is also nonlinear. Assume that Hpt1 ,t2 is linear. Then, by the iterative construction defined in (4), for any u = (u | u ), v = (v | v  ) ∈ Hpt1 −1,t2 , we have that ū, v̄ ∈ Hpt1 ,t2 , where . . . , pu, u , .p. ., u ), 2 ū = (u, . p. ., u | pu, p−1 . . . , pv, v  , .p. ., v  ). 2 v̄ = (v, . p. ., v | pv, p−1 Moreover, since Hpt1 ,t2 is linear, Φ(ū) + Φ(v̄) ∈ Hpt1 ,t2 . Again, by construction (4), . . . , pa, a , .p. ., a ) + λ(0, 1, . . . , p − 1 | 2 we have that Φ(ū) + Φ(v̄) = Φ((a, . p. ., a | pa, p−1 1, 2, . . . , p − 1, 0, 1, . . . , p − 1)) ∈ Hp , for some a = (a | a ) ∈ Hpt1 −1,t2 and 2 t1 ,t2 λ ∈ Zp2 . Considering the coordinates in positions 1 and 2p of ū and v̄, we have that Φ(u) + Φ(v) = Φ(a) ∈ Hpt1 −1,t2 , and then Hpt1 −1,t2 is linear, which is a contradiction. Finally, if Hpt1 ,t2 −1 is nonlinear, then as above we can show that Hpt1 ,t2 is also nonlinear, and hence the result follows.  Example 3.1. Let H31,1 be the Z3 Z9 -additive GH code of type (3, 2; 1, 1) generated by A1,1 3 given in Example 2.1. We have that Φ(0, 1, 2 | 1, 2) + Φ(0, 2, 1 | 2, 4) = (0, 1, 2, 0, 1, 2, 0, 2, 1) + (0, 2, 1, 0, 2, 1, 1, 2, 0) / H31,1 = Φ(H31,1 ), = (0, 0, 0, 0, 0, 0, 1, 1, 1) ∈ since H31,1 has minimum weight 6 by Remark 2.2. Therefore, H31,1 is nonlinear. Example 3.2. Considering all the integer solutions with t1 , t2 ≥ 1 of the equation 6 = 2t1 + t2 − 1, we have that the Zp Zp2 -linear GH codes with α1 = 0 of length p6 , p ≥ 3 prime, are the following: Hp1,5 , Hp2,3 and Hp3,1 . By Theorem 3.1, all of them are nonlinear. The types of these codes for p = 3 and p = 5 can be found in the row corresponding to t = 6 in Tables 1 and 2, respectively. D.K. Bhunia et al. / Finite Fields and Their Applications 86 (2023) 102140 9 Table 1 Type and parameters (r, k) of Z9 -linear and Z3 Z9 -linear GH codes. t Z9 -linear Z3 Z9 -linear (n; t1 , t2 ) (r, k) (α1 , α2 ; t1 , t2 ) (r, k) 2 (3;1,1) (3,3) (9, 0; 0, 3) (3,3) (3, 2; 1, 1) (4,2) 3 (9; 1, 2) (4,4) (27, 0; 0, 4) (4,4) (9; 2, 0) (5,2) (9, 6; 1, 2) (5,3) 4 (27; 1, 3) (5,5) (81, 0; 0, 5) (5,5) (27; 2, 1) (6,3) (27, 18; 1, 3) (6,4) (9, 24; 2, 1) (10,3) 5 (81; 1, 4) (6,6) (243, 0; 0, 6) (6,6) (81; 2, 2) (7,4) (81, 54; 1, 4) (7,5) (81; 3, 0) (11,3) (27, 72; 2, 2) (11,4) 6 (243; 1, 5) (7,7) (729, 0; 0, 7) (7,7) (243; 2, 3) (8,5) (243, 162; 1, 5) (8,6) (243; 3, 1) (12,4) (81, 216; 2, 3) (12,5) (27, 234; 3, 1) (20,4) 7 (729; 1, 6) (8,8) (2187, 0; 0, 8) (8,8) (729; 2, 4) (9,6) (729, 486; 1, 6) (9,7) (729; 3, 2) (13,5) (243, 648; 2, 4) (13,6) (729; 4, 0) (21,4) (81, 702; 3, 2) (21,5) 8 (2187; 1, 7) (9,9) (6561, 0; 0, 9) (9,9) (2187; 2, 5) (10,7) (2187, 1458; 1, 7) (10,8) (2187; 3, 3) (14,6) (729, 1944; 2, 5) (14,7) (2187; 4, 1) (22,5) (243, 2106; 3, 3) (22,6) (81, 2160; 4, 1) (35,5) Table 2 Type and parameters (r, k) of Z25 -linear and Z5 Z25 -linear GH codes. t Z25 -linear Z5 Z25 -linear (n; t1 , t2 ) (r, k) (α1 , α2 ; t1 , t2 ) (r, k) 2 (5;1,1) (3, 3) (25, 0; 0, 3) (3,3) (5,4;1,1) (5, 2) 3 (25; 1, 2) (4, 4) (125, 0; 0, 4) (4, 4) (25; 2, 0) (7, 2) (25, 20; 1, 2) (6, 3) 4 (125; 1, 3) (5, 5) (625, 0; 0, 5) (5, 5) (125; 2, 1) (8, 3) (125, 100; 1, 3) (7, 4) (25, 120; 2, 1) (18,3) 5 (625; 1, 4) (6, 6) (3125, 0; 0, 6) (6, 6) (625; 2, 2) (9, 4) (625, 500; 1, 4) (8, 5) (625; 3, 0) (22, 3) (125, 600; 2, 2) (19, 4) 6 (3125; 1, 5) (7, 7) (15625, 0; 0, 7) (7, 7) (3125; 2, 3) (10, 5) (3125, 2500; 1, 5) (9, 6) (3125; 3, 1) (23, 4) (625, 3000; 2, 3) (20, 5) (125, 3100; 3, 1) (50,4) 7 (15625; 1, 6) (8, 8) (78125, 0; 0, 8) (8, 8) (15625; 2, 4) (11, 6) (15625, 12500; 1, 6) (10, 7) (15625; 3, 2) (24, 5) (3125, 15000; 2, 4) (21, 6) (15625; 4, 0) (57, 4) (625, 15500; 3, 2) (51, 5) 8 (78125; 1, 7) (9,9) (390625, 0; 0, 9) (9,9) (78125; 2, 5) (12,7) (78125, 62500; 1, 7) (11,8) (78125; 3, 3) (25,6) (15625, 75000; 2, 5) (22,7) (78125; 4, 1) (58,5) (3125, 77500; 3, 3) (52,6) (625, 78000; 4, 1) (?,5) 10 D.K. Bhunia et al. / Finite Fields and Their Applications 86 (2023) 102140 4. Kernel of Zp Zp2 -linear GH codes with α1 = 0 Again, we focus on Zp Zp2 -linear GH codes with α2 = 0, because otherwise the codes are linear. The kernel of Zp Zp2 -linear GH codes with α1 = 0 and its dimension was studied in [16,17] for p = 2 and [19] for p ≥ 3 prime. The kernel of Z2 Z4 -linear Hadamard codes with α1 = 0 and its dimension are given in [17]. In this section, we generalize these results for Zp Zp2 -linear GH codes with α1 = 0 and p ≥ 3 prime. First, we determine the kernel, and then we establish a basis of the kernel, which gives us its dimension. Specifically, we prove that the dimension of the kernel of a ZpZp2 -linear GH code of type (α1 , α2 ; t1 , t2 ), with α1 = 0, t1 , t2 ≥ 1 and p ≥ 3 prime, is t1 + t2 . Again, note that this result for p ≥ 3 does not coincide with the known result for p = 2 when t1 = 1, since in this last case the codes are linear, so the dimension of kernel is 2t1 + t2 . Theorem 4.1. Let Hpt1 ,t2 be the Zp Zp2 -additive GH code of type (α1 , α2 ; t1 , t2 ) with α1 = 0, t1 , t2 ≥ 1 and p ≥ 3 prime. Let Hp be the subcode of Hpt1 ,t2 which contains all the codewords of order at most p. Then, K(Φ(Hpt1 ,t2 )) = Φ(Hp ). Proof. Let H = Hpt1 ,t2 and H = Φ(H). By Corollary 2.3, for all b = (b | b ) ∈ Hp and u = (u | u ) ∈ H, we have that Φ(b)+Φ(u) = (b+u, Φ(b )+Φ(u )) = (b+u, Φ(b +u )) ∈ H and, therefore, Φ(Hp ) ⊆ K(H). Now, let Φ(u) ∈ K(H), where u = (u | u ) ∈ H \ {0}. We prove that o(u) = p and thus K(H) ⊆ Φ(Hp ). Assume that o(u) = p2 , and consider two cases: when t1 = 1 and t1 ≥ 2. In both cases, to obtain a contradiction, we just need to find an element ũ ∈ H such that Φ(u) + Φ(ũ) ∈ / H. First, let t1 = 1. In this case, H = Hp1,t2 . Recall that − Np = {1, . . . , p − 1} ⊂ Zp2 . By construction, the row vector of Atp1 ,t2 of order p2 is . , Zp | Np− , α2 /(p−1) v = (Zp , α.1./p . . . , Np− ). Since o(u) = p2 , u can be expressed as u = λv + w, where λ ∈ Np− and w is a codeword of order at most p. Note that for λ ∈ Np− , {λj mod p : j ∈ Np− } = Np− . Therefore, we also have that λv = v1 +w1 , where v1 = (0 | v  ), v  contains every element of Np− exactly α2 /(p −1) times, and w1 is a vector of order at most p. By Corollary 2.3, Φ(u) = Φ(v1 ) + Φ(w1 +w). Now, by Corollaries 2.2 and 2.3, Φ(u) +Φ(λv) = Φ(λv+λv+w−p(v1 p v1 )). If we prove that p(v1 p v1 ) ∈ / H, then Φ(u) + Φ(λv) ∈ / H since λv, w ∈ H. Note that, from the definition of p , for a ∈ Zp2 , p(a p a) = 0 if and only if a mod p < p/2. Since v  contains an element a such that a mod p ≥ p/2, p(v  p v  ) = 0, so p(v1 p v1 ) = 0. We have that the number of ones in v  is α2 /(p − 1). Since φ(p(1 p 1)) = (0, . p. ., 0), wtH (Φ(p(v1 p v1 ))) = wtH (Φ(p(v  p v  ))) ≤ α2 p − α2 p/(p − 1) < (p − 1)α2 . By Remark 2.1, the minimum weight of Φ(H) is d = (p − 1)/p(α1 + pα2 ). Since α1 /p ≥ 1, (p − 1)α2 < d, and thus p(v1 p v1 ) ∈ / H. Therefore, we have that Φ(u) ∈ / K(H), which is a contradiction, so o(u) = p. Second, let t1 ≥ 2. Since o(u) = p2 , u can be expressed as u = v + w, where v = (v, . . . , v | v  , . . . , v  ) ∈ H, (v | v  ) ∈ Hpt1 ,1 , and w ∈ H is of order at most p. D.K. Bhunia et al. / Finite Fields and Their Applications 86 (2023) 102140 11 By Corollary 2.3, Φ(u) = Φ(v) + Φ(w). Now, Φ(u) + Φ(v) = Φ(w) + Φ(v) + Φ(v) = Φ(w) + Φ(v + v − p(v p v)) = Φ(v + v + w − p(v p v)) by Corollaries 2.2 and 2.3. If we prove that p(v p v) ∈ / H, then Φ(u) + Φ(v) ∈ / H since v, w ∈ H. By Lemma 2.2, there exist λ ∈ Np− such that v  contains every element of λNp− the same number of times. Note that {λj mod p : j ∈ Np− } = Np− , and hence λNp− always contains an element a such that a mod p > p/2. Therefore, we have that p(v  p v  ) = 0, so p(v p v) = 0. Now, by Corollary 2.5, v̄  = (v  , . . . , v  ) contains every element of pZp2 exactly m times, m > 0, and the remaining α2 − pm coordinates are from Zp2 \ pZp2 . Thus, wtH (Φ(p(v p v))) = wtH (Φ(p(v̄  p v̄  ))) ≤ (α2 − pm)(p − 1) < α2 (p − 1), and hence p(v p v) ∈/ H by Remark 2.1. Therefore, we have that Φ(u) ∈ / K(H), which is a contradiction, so o(u) = p.  Corollary 4.1. Let Hpt1 ,t2 be the Zp Zp2 -additive GH code of type (α1 , α2 ; t1 , t2 ) with α1 = 0, t1 , t2 ≥ 1 and p ≥ 3 prime. Let wk be the kth row of Atp1 ,t2 and Q = {(o(wk )/p)wk }tk=1 1 +t2 . Then, Φ(Q) is a basis of K(Φ(Hpt1 ,t2 )) and ker(Φ(Hpt1 ,t2 )) = t1 + t2 . Example 4.1. Let H31,2 be the Z3 Z9 -additive GH code of type (9, 6; 1, 2) generated by A1,2 1,2 3 given in Example 2.1. By Corollary 4.1, we have that ker(H3 ) = 1 + 2 = 3. Also 1,2 by Corollary 4.1, we can construct K(H3 ) from a basis. We have that Q = {(1 | 3), (0 | 3, 6, 3, 6, 3, 6), (0, 0, 0, 1, 1, 1, 2, 2, 2 | 0, 0, 3, 3, 6, 6)}. Thus, K(H31,2 ) = Φ(1 | 3), Φ(0 | 3, 6, 3, 6, 3, 6), Φ(0, 0, 0, 1, 1, 1, 2, 2, 2 | 0, 0, 3, 3, 6, 6). More generally, if Hp1,2 is the Zp Zp2 -additive GH code generated by A1,2 p with p ≥ 3 prime, then we have that K(Hp1,2 ) = Φ(1 | p), Φ(0 | u ), Φ(v | v  ), where u is the p-fold replication of (p, 2p, . . . , (p − 1)p), v = (0, 1, . . . , p − 1) with i = (i, . p. ., i) for i ∈ Zp , and v  = (0, p · 1, . . . , p · (p − 1)) with j = (j, p−1 . . . , j) for j ∈ Np . Therefore, ker(Hp1,2 ) = 3. Note that ker(H21,2 ) = 4, since H21,2 is linear [17]. Example 4.2. Let H32,1 be the Z3 Z9 -additive GH code of type (9, 24; 2, 1) generated by A2,1 2,1 3 given in Example 2.1. By Corollary 4.1, we have that ker(H3 ) = 1 + 2 = 3. Also by Corollary 4.1, we can construct K(H32,1 ) from a basis. We have that Q = {(1 | 3), (0 | 0, 0, 0, 0, 0, 0, u), (0 | 3, 3, 3, 6, 6, 6, v)}, where u is a 9-fold replication of (3, 6) and v is a 3-fold replication of (0, 0, 3, 3, 6, 6). Thus, K(H32,1 ) = Φ(1 | 3), Φ((0 | 0, 0, 0, 0, 0, 0, u)), Φ((0 | 3, 3, 3, 6, 6, 6, v)). More generally, if Hp2,1 is the Zp Zp2 -additive GH code generated by A2,1 p with p ≥ 3 prime, then we have that 12 D.K. Bhunia et al. / Finite Fields and Their Applications 86 (2023) 102140 K(Hp2,1 ) = Φ(1 | p), Φ(0 | 0, p. .−p 2 . , 0, u), Φ(0 | w, v), where u is the p2 -fold replication of (p, 2p, . . . , (p − 1)p), w = (p · 1, p · 2, . . . , p · (p − 1)) with i = (i, . p. ., i) for i ∈ Np− , and v = (p · 0, p · 1, . . . , p · (p2 − 1)) with j = (j, p−1 . . . , j) for j ∈ Zp2 . Therefore, ker(Hp2,1 ) = 3. Note that, in this case, it is also true for p = 2, since ker(H22,1 ) = 3 as shown in [17]. The dimension of the kernel is an invariant for the equivalence relation of codes over Zp , which allows us to give a complete classification of the Zp Zp2 -linear GH codes with α1 = 0 of length pt , as shown in the next result. Corollary 4.2. For any t ≥ 2 and p ≥ 3 prime, there are exactly t/2 nonequivalent nonlinear Zp Zp2 -linear GH codes with α1 = 0 of length pt by using the recursive con- structions given in (3) and (4). Proof. Considering all the integer solutions (t1 , t2 ) with t1 , t2 ≥ 1 of the equation t + 1 = 2t1 +t2 , we have that all the nonlinear Zp Zp2 -linear GH codes of length pt are Hpt1 ,t−2t1 +1 , where 1 ≤ t1 ≤ t/2 , by Theorem 3.1. Then, by Corollary 4.1, ker(Hpt1 ,t−2t1 +1 ) = t − t1 + 1, which gives different values for distinct values of t1 . Therefore, they are all pairwise nonequivalent codes. Therefore, the result follows.  Note that Corollary 4.2 is also true for the Zp Zp2 -linear GH codes obtained from more general recursive constructions given in [25], since all of them are equivalent to the constructions given in (3) and (4). Example 4.3. Let t = 6 and p = 3. All the nonlinear Z3 Z9 -linear GH codes with α1 = 0 of length 36 are H31,5 , H32,3 and H33,1 having a kernel of dimension 6, 5 and 4, respectively, as it is also shown in Table 1. Since these values are all different, all these codes are pairwise nonequivalent. We have only one linear Z3 Z9 -linear GH code of length 36 , which is of type (36 , 0; 0, 7). Therefore, there are exactly 6/2 + 1 = 4 nonequivalent Z3 Z9 -linear GH codes of length 36 . 5. Rank of some families of Zp Zp2 -linear GH codes In this section, we establish some results about the rank of some families of ZpZp2 - linear GH codes with α1 = 0. These results are used in Section 6 to show that these codes are not equivalent to the Zp Zp2 -linear GH codes with α1 = 0 (also called just Zp2 -linear GH codes) constructed in [19]. First, we prove some technical lemmas. Lemma 5.1. Let v = (Zp | Np− ) ∈ Zpp × Zp−1 p2 . Then, Φ(λv) + Φ((p − λ)v) = Φ(pv) + (p − 1)(0, 1, 1, . . . , 1) for any λ ∈ {1, 2, . . . , (p − 1)/2}. D.K. Bhunia et al. / Finite Fields and Their Applications 86 (2023) 102140 13 Proof. For the first p coordinates over Zp , it is clearly true, since the Gray map Φ is the identity. For λ ∈ {1, 2, . . . , (p − 1)/2} and i ∈ Np− , we can write that iλ = u0 + pu1 ∈ Zp2 , where u0 , u1 ∈ Np . Then, i(p − λ) = (p − u0 ) + p(i − u1 − 1). By Corollary 2.4, φ(iλ) + φ(i(p − λ)) = φ(ip) − (1, 1, . . . , 1) since u0 + p − u0 ≥ p. Therefore, Φ(λv) + Φ((p − λ)v) = Φ(pv) + (p − 1)(0, 1, 1, . . . , 1).  Lemma 5.2. Let v = (Zp | Np− ) ∈ Zpp × Zp−1 p2 . Then, Φ(λv) + Φ((p − λ)v) = (0, 0, 1, 2, . . . , p − 2) for any λ ∈ {1, 2, . . . , (p − 1)/2}. Proof. Straightforward from Lemmas 2.1 and 5.1.  Lemma 5.3. Let p ≥ 3 prime and a ∈ {1, . . . , p − 1}. Then, | ia mod p ≤ a : i ∈ {1, . . . , (p − 1)/2} | = (a − 1)/2 + 1. Proof. Let A = ia mod p : i ∈ {1, . . . , (p − 1)/2} and B = ia mod p ≤ a : i ∈ {1, . . . , (p − 1)/2} . Note that, for p = 3, A = {a} = B, and hence the lemma holds. Now, we assume that p > 3 prime, and consider two cases: when a ≤ 2 and when a > 2. First, if a ≤ 2, then A = {a, 2a, . . . , (p −1)a/2} and B = {a}, so the lemma holds. Second,   assume a > 2. Let β be the biggest integer such that (p−1)a 2 > βp, so β = (p−1)a 2p . Note that (p−1)a 2 < (β + 1)p. In this case, we consider a partition of A into disjoints subsets, β A = ∪b=0 Ab , where Ab = ia mod p : i ∈ {1, . . . , (p − 1)/2}, bp < ia ≤ (b + 1)p for b ∈ {0, . . . , β}. Note that β ≥ 1 since a > 2. Then, we have that  bp    bp    (b + 1)p  Ab = { + 1 a − bp, + 2 a − bp, . . . , a − bp}, a a a for b ∈ {0, 1, . . . , β − 1}, and  βp    βp   (p − 1)a Aβ = { + 1 a − βp, + 2 a − βp, . . . , − βp}. a a 2 Note that B = A ∩ B = ∪βb=0 (Ab ∩ B). For b ∈ {0, . . . , β}, we have that every element in Ab is smaller than p by definition, and we see that |Ab ∩ B| = 1. First, it is easy to see that A0 ∩ B = {a}. Next, for all b ∈ {1, 2, . . . , β − 1}, we see that, for    bp   bp  j ∈ {1, . . . , (b+1)p − a }, ( a + j)a − bp ≤ a if and only if j = 1. We can write bp = a  bp  ka + r, where k = bp a and 0 ≤ r < a. Then, ( a + j)a − bp = ka + ja − ka − r = ja − r. Since j ≥ 1 and 0 < a − r ≤ a, we have that ja − r ≤ a if and only if j = 1 and hence    βp  |Ab ∩ B| = 1. Similarly, for j ∈ {1, . . . , (p−1) 2 − βpa }, we have that ( a + j)a − βp ≤ a if and only if j = 1, and hence |Aβ ∩ B| = 1 14 D.K. Bhunia et al. / Finite Fields and Their Applications 86 (2023) 102140 β Finally, since B = ∪βb=0 (Ab ∩ B), we have that |B| = b=0 |Ab ∩ B| = β + 1 =  (p−1)a  (p−1)a + 1. Now, note that a − 1 < < a, so 2 < (p−1)a a−1 < a2 , and hence  (p−1)a   a−1  2p  a−1  p 2p 2p = 2 . Therefore, |B| = 2 + 1.  Lemma 5.4. Let p ≥ 3 prime and a ∈ {1, . . . , p − 1}. Then, | a + (ia mod p) ≥ p : i ∈ {1, . . . , (p − 1)/2} | = a/2 . Proof. Note that | ia mod p : i ∈ {1, . . . , p − 1} | = p − 1, and so | ia mod p ≥ p − a : i ∈ {1, . . . , p − 1} | = a. (5) Let i, a ∈ {1, 2 . . . , (p − 1)/2}. We can write that ia = u0 + pu1 ∈ Zp2 , where u0 , u1 ∈ Np . Then, (p − i)a = (p − u0 ) + p(a − u1 − 1) since i < p. We have that u0 ≤ a if and only if p − u0 ≥ p − a and, hence, ia mod p ≤ a if and only if (p − i)a mod p ≥ p − a. Therefore, | ia mod p ≥ p − a : i ∈ {(p + 1)/2, . . . , p − 1} | = | ia mod p ≤ a : i ∈ {(1, . . . , (p − 1)/2)} | = a−1 2 + 1 by Lemma 5.3. Finally, from (5), we have that | ia mod p ≥ p − a : i ∈ {1, . . . , (p − 1)/2} | = a − ( a−12 + 1) = a2 , which completes the proof.  Proposition 5.1. Let Hp1,1 be the Zp Zp2 -additive GH code of type (p, p − 1; 1, 1) with p ≥ 3 prime, and Hp1,1 = Φ(Hp1,1 ) be the corresponding Zp Zp2 -linear GH code of length p2 . Then, rank(Hp1,1 ) = 3 + (p − 1)/2. . . . , p) and v = (Zp | Np− ) ∈ Zpp × Zp−1 Proof. Let u = (1, . p. ., 1 | p, p−1 p2 . If x ∈ Hp , 1,1 then x can be expressed as x = λv + μu, where λ ∈ Zp2 and μ ∈ Np ⊂ Zp2 . By Corollary 2.3, we have that Φ(x) = Φ(λv) + Φ(μu) and also Φ(λv) = Φ(λ0 v) + Φ(λ1 pv), where λ = λ0 + λ1 p, and λ0 , λ1 ∈ Np . By Corollary 2.1, Φ(λ1 pv) = λ1 Φ(pv) and Φ(μu) = μΦ(u). Therefore, Φ(x) = Φ(λ0 v) + λ1 Φ(pv) + μΦ(u). By Corollary 2.4, for all i ∈ {1, . . . , (p − 1)/2}, we have that Φ((i + 1)v) = Φ(v) + Φ(iv) + vi , (6) where vi = (0, vi,1 , vi,2 , . . . , vi,p−1 ), vi,a ∈ {0, 1} for a ∈ {1, . . . , p − 1}, and 0, 1 are of length p. Consider the vector v(p−1)/2 . It is easy to see that  p−1 p−a 2 if a is odd, a mod p = 2 p− a 2 if a is even. Then, if a is odd, a +(p −a)/2 = (p +a)/2 < p; and if a is even, a +p −a/2 = p +a/2 ≥ p. Therefore, v(p−1)/2 = (0, 0, 1, 0, 1, . . . , 0, 1). D.K. Bhunia et al. / Finite Fields and Their Applications 86 (2023) 102140 15 Next, we show that Φ(λ0 v), for λ0 ∈ Np , is a linear combination of Φ(v) and λ0 −1 {vi }1≤i≤(p−1)/2 . First, for λ0 ∈ {2, 3, . . . , (p + 1)/2}, Φ(λ0 v) = λ0 Φ(v) + i=1 vi by applying recursively (6). Second, from Lemma 5.4,  (p−1)/2 p−1 p−1 p−1 vi = (0, 0, 1, 1, 2, 2, . . . , − 1, − 1, ), (7) i=1 2 2 2 (p−1)/2 so (0, 0, 1, 2, . . . , p − 2) = 2( i=1 vi ) − v(p−1)/2 since we have that v(p−1)/2 = (0, 0, 1, . . . , 0, 1). Then, for λ0 ∈ {(p + 1)/2 + 1, . . . , p − 1}, Φ(λ0 v) is a linear com- bination of Φ(v) and {vi }1≤i≤(p−1)/2 by Lemma 5.2. Therefore, Φ(x) is generated by Φ(u), Φ(v), Φ(pv) and {vi }1≤i≤(p−1)/2 . In other words, we can take a matrix G whose row vectors are Φ(u), Φ(v), Φ(pv) and {vi }1≤i≤(p−1)/2 , as a generator matrix of Hp1,1 . The vectors Φ(u), Φ(v) and Φ(pv) are clearly linearly independent over Zp . We consider the vectors vi , i ∈ {1, . . . , (p − 1)/2}, as the rows of a matrix V . Let Sa , a ∈ {1, . . . , p − 1}, be the set of p coordinate positions of v1,a in v1 . There exists a set of (p − 1)/2 linearly independent columns of V by taking one column of each Sa with a ∈ {2, 4, . . . , p − 1}, since the number of ones in each one of these columns is different by (7). Therefore, the vectors {vi }1≤i≤(p−1)/2 are linearly independent. In fact, it is easy to see that all the rows of G are linearly independent. Therefore, rank(Hp1,1 ) = 3 + (p − 1)/2.  Example 5.1. Let H71,1 be the Z7 Z49 -additive GH code of type (7, 6; 1, 1) and H71,1 = Φ(H71,1 ) be the corresponding Z7 Z49 -linear GH code of length 49. Let u = (1, 1, 1, 1, 1, 1, 1 | 7, 7, 7, 7, 7, 7) and v = (0, 1, . . . , 7 | 1, 2, . . . , 7). By the proof of Proposition 5.1, H71,1  can be generated by Φ(u), Φ(v), Φ(7v), and {vi }1≤i≤3 , where v1 = (0, 0, 0, 0, 1, 1, 1), v2 = (0, 0, 0, 1, 0, 1, 1), v3 = (0, 0, 1, 0, 1, 0, 1), and the vectors 0 and 1 are of length 7. Since these vectors are linearly independent, we have that rank(H71,1 ) = 6. 1,1 Example 5.2. Let H11 be the Z11 Z121 -additive GH code of type (11, 10; 1, 1) and 1,1 1,1 H11 = Φ(H11 ) be the corresponding Z11 Z121 -linear GH code of length 121. Let u = (1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 | 11, 11, 11, 11, 11, 11, 11, 11, 11, 11) and v = (0, 1, . . . , 10 | 1,1 1, 2, . . . , 10). By the proof of Proposition 5.1, H11  can be generated by Φ(u), Φ(v), Φ(11v), and {vi }1≤i≤5 , where 16 D.K. Bhunia et al. / Finite Fields and Their Applications 86 (2023) 102140 v1 = (0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1), v2 = (0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1), v3 = (0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1), v4 = (0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1), v5 = (0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1), and the vectors 0 and 1 are of length 11. Since these vectors are linearly independent, 1,1 we have that rank(H11 ) = 8. Let H be a Zp Zp2 -additive code of type (α1 , α2 ; t1 , t2 ) with p prime. Recall that H1 (respectively, H2 ) is the punctured code of H by deleting the last α2 coordinates over Zp2 (respectively, the first α1 coordinates over Zp ). Then, we can write that H = (H1 | H2 ). Let (Hi , . . . , Hi ) be the code having the following set of codewords {(hi , . . . , hi ) : hi ∈ Hi } for i ∈ {1, 2}. Theorem 5.1. Let Hp1,t−1 be the Zp Zp2 -additive GH code of type (pt−1 , (p −1)pt−2 ; 1, t −1) with t ≥ 2 and p ≥ 3 prime, and Hp1,t−1 = Φ(Hp1,t−1 ) be the corresponding Zp Zp2 -linear GH code of length pt . Then, rank(Hp1,t−1 ) = 1 + t + (p − 1)/2. Proof. We prove this theorem by induction on t. First, note that the result is true for t = 2, by Proposition 5.1. We assume that the result is true for a given t ≥ 2. Let Hp1,t−1 = (H1 | H2 ) and Hp1,t = Φ(Hp1,t ). Then, by the recursive construction (3), we can write  Hp1,t = ((H1 , . p. ., H1 | H2 , . p. ., H2 ) + λ(0, . . . , p − 1 | p · 0, . . . , p · p − 1)). λ∈Np By Corollary 2.3, we have that  Hp1,t = (Φ(H1 , . p. ., H1 | H2 , . p. ., H2 ) + Φ(λ(0, . . . , p − 1 | p · 0, . . . , p · p − 1))), λ∈Np so rank(Hp1,t ) = 1 + rank(Hp1,t−1 ). Therefore, by induction hypothesis, rank(Hp1,t ) = 1 + (1 + t) + (p − 1)/2.  Example 5.3. Let H71,2 be the Z7 Z49 -additive GH code of type (49, 42; 1, 2) and H71,2 = Φ(H71,2 ) be the corresponding Z7 Z49 -linear GH code of length 143. Let u = (u | u ) and v = (v | v  ) and vi = (0, vi ), 1 ≤ i ≤ 3 be the vectors given in Example 5.1. By applying  7   7  construction (3) to A1,1 7 , we have that ū = (u, . . ., u | u , . . ., u ), v̄ = (v, . . ., v | v , . . ., v ) 7 7 1,2 and w̄ = (0, 1, . . . , 6 | 0, 7, . . . , 42) are the rows of the generator matrix A7 . Therefore, D.K. Bhunia et al. / Finite Fields and Their Applications 86 (2023) 102140 17 by Example 5.1 and the proof of Theorem 5.1, we have that H71,2  can be generated by Φ(ū), Φ(v̄), Φ(7v̄), Φ(w̄) and {v̄i }1≤i≤3 , where v̄i = (0, . 7. ., 0, vi , . 7. ., vi ), 1 ≤ i ≤ 3. Since these vectors are linearly independent, we have that rank(H71,2 ) = 7. Proposition 5.2. Let Hp2,1 be a Zp Zp2 -additive GH code of type (p2 , (p − 1)(p + p2 ); 2, 1) with p ≥ 3 prime, and Hp2,1 = Φ(Hp2,1 ) be the corresponding Zp Zp2 -linear code of length p4 . Then, rank(Hp2,1 ) > p + 3. Proof. Let u = (1, .p. ., 1 | p, p. .−p 2 3 . , p), and v, w be the rows of A2,1 2 p of order p , that is,     v Zp Zp ··· Zp pZp2 ··· pZp2 Np− ··· Np− = . w 0 1 ··· p−1 1 ··· p−1 0 ··· p −1 2 By Corollary 2.4 and the proof of Proposition 5.1, for all i ∈ {1, . . . , (p − 1)/2}, we have that Φ((i + 1)w) = Φ(w) + Φ(iw) + wi , where wi = (0, wi,1 , wi,2 , . . . , wi,p−1 , ∗, . . . , ∗), wi,a ∈ {0, 1} for a ∈ {1, . . . , p − 1}, (p−1)/2 p2 2 − 1, 2 − 1, 2 , ∗, . . . , ∗), and j = (j, . . ., j) for wi = (0, 0, 1, 1, 2, 2, . . . , p−1 p−1 p−1 i=1 j ∈ {0, 1, . . . , (p − 1)/2}. The symbol ∗ in a coordinate means that it can be any element of Zp . If we consider the vectors wi , i ∈ {1, . . . , (p − 1)/2}, as the rows of a matrix, then we have a set of (p − 1)/2 linearly independent columns by taking one column of each wi,a with a ∈ {2, 4, . . . , p − 1}, since the number of ones in each one of these columns is different. Therefore, the vectors {wi }1≤i≤(p−1)/2 are linearly independent. Again, by Corollary 2.4 and the proof of Proposition 5.1, for all i ∈ {1, . . . , (p − 1)/2}, we have that Φ((i + 1)v) = Φ(v) + Φ(iv) + vi , 3 2 where vi = (0, .p. ., 0, v̄i , .p. ., v̄i ), v̄i = (vi,1 , vi,2 , . . . , vi,p−1 ), vi,a ∈ {0, 1} for a ∈ {1, . . . , p − (p−1)/2 3 2 1}, i=1 vi = (0, .p. ., 0, x̄, .p. ., x̄), k = (k, . p. ., k) for k ∈ {0, 1, . . . , (p − 1)/2}, and 2 − 1, 2 − 1, 2 ). x̄ = (0, 1, 1, 2, 2, . . . , p−1 p−1 p−1 We consider the vectors vi , i ∈ {1, . . . , (p − 1)/2}, as the rows of a matrix V . Let Sa , a ∈ {1, . . . , p − 1}, be the set of coordinate positions of v1,a in the first copy of v̄1 in v1 . There exists a set of (p −1)/2 linearly independent columns of V by taking one column of each Sa with a ∈ {2, 4, . . . , p − 1}, since the number of ones in each one of these columns is different. Therefore, the vectors {vi }1≤i≤(p−1)/2 are linearly independent. Note that Φ(u), Φ(v), Φ(pv), Φ(w), Φ(pw), {vi }1≤i≤(p−1)/2 , {wi }1≤i≤(p−1)/2 are all linearly independent. Therefore, rank(Hp2,1 ) > p + 3.  18 D.K. Bhunia et al. / Finite Fields and Their Applications 86 (2023) 102140 Example 5.4. Let H32,1 be the Z3 Z9 -additive GH code of type (9, 24; 2, 1) and H32,1 = Φ(H32,1 ) be the corresponding Z3 Z9 -linear GH code of length 81. Let u = (1 | 3), v = (0, 1, 2, 0, 1, 2, 0, 1, 2 | 0, 3, 6, 0, 3, 6, v, . 9. ., v), where v = (1, 2), and w = (0, 0, 0, 1, 1, 1, 2, 2, 2 | 1, 1, 1, 2, 2, 2, 0, 0, . . . , 8, 8) be the rows of the generator matrix A2,1 3 given in Example 2.1. We have that Φ(2v) = 2Φ(v) + v1 and Φ(2w) = 2Φ(w) + w1 , where v1 = (0, .27 . ., 0, v̄1 , . 9. ., v̄1 ), w1 = (0, .18 . ., 0, 1, . 9. ., 1, w̄1 , w̄1 , w̄1 ), v̄1 = (0, 0, 0, 1, 1, 1) and w̄1 = (0, .12 . ., 0, 1, . 6. ., 1). We also have that Φ(3v) = (0, .27.. 9 9 9 9 , 0, x, . . ., x), where x = (1, 1, 1, 2, 2, 2), and Φ(3w) = (0, . . ., 0, 1, . . ., 1, 2, . . ., 2, y, y, y), where y = (0, . 6. ., 0, 1, . 6. ., 1, 2, . 6. ., 2). Note that the set S generated by Φ(u), Φ(v), Φ(w), Φ(3v), Φ(3w), v1 and w1 , is a subspace of H32,1 . Since these vectors are linearly independent, we have that rank(H32,1 ) ≥ dim(S) = 7 > 6. Theorem 5.2. Let Hp2,t−3 be the Zp Zp2 -additive GH code of type (pt−2 , (p − 1)(pt−3 + pt−2 ); 2, t − 3) with t ≥ 4 and p ≥ 3 prime, and Hp2,t−3 = Φ(Hp2,t−3 ) be the corresponding Zp Zp2 -linear GH code of length pt . Then, rank(Hp2,t−3 ) > p + t − 1. Proof. We prove this theorem by induction on t. First, note that the result is true for t = 4, by Proposition 5.2. We assume that the result is true for a given t ≥ 4. By following the same argument as in the proof of Theorem 5.1, we obtain that rank(Hp2,t−2 ) = 1 +rank(Hp2,t−3 ). Therefore, by induction hypothesis, rank(Hp2,t−2 ) > 1 +p +t −1 = p +t, and the result follows.  6. Classification results The classification of Z2 Z4 -linear Hadamard codes with α1 = 0 of length 2t , for any t ≥ 3, using the rank or the dimension of the kernel is shown in [16,17]. For Z2 Z4 -linear Hadamard codes with α1 = 0 (that is, Z4 -linear Hadamard codes), the classification is also shown in [16,17]. Some partial results on the classification of Z2s -linear Hadamard codes of length 2t , for any t ≥ 3 and s > 2, are proved in [9,21]; and in general for Zps -linear GH codes of length pt , for any t ≥ 2, s ≥ 2, and p ≥ 3 prime, in [19,26]. For any t ≥ 2, the full classification of Zp Zp2 -linear GH codes of length pt , with α1 = 0 and p ≥ 3 prime, is given by Corollary 4.2 in Section 4, by using just the dimension of the kernel. In this section, we compare the Zp Zp2 -linear GH codes having α1 = 0 with the Zps -linear GH codes. First, we recall the construction given in [19] of Zps -linear GH codes with s ≥ 2 and p prime. We also recall for which types these codes are linear and what is the kernel D.K. Bhunia et al. / Finite Fields and Their Applications 86 (2023) 102140 19 and its dimension for these codes whenever they are nonlinear. Then, we compute some results about the rank of some families of Zp2 -linear GH codes, in order to determine whether these codes are equivalent or not to the Zp Zp2 -linear GH codes with α1 = 0 considered in this paper. Finally, we see that, unlike for the case p = 2, the Zp2 -linear GH codes with p ≥ 3 prime are not equivalent to the codes Zp Zp2 -linear GH codes with α1 = 0. There are at least two infinite families of Zp Zp2 -linear GH codes with α1 = 0 and p ≥ 3 prime, such that their codes are not equivalent to any Zp2 -linear GH code of the same length pt . Indeed, we prove that they are not equivalent to any Zps -linear GH code with s ≥ 2 and not only for s = 2. First, we describe the construction given in [19] of Zps -linear GH codes with s ≥ 2 and p prime. Let Ti = {j · pi−1 : j ∈ {0, 1, . . . , ps−i+1 − 1}} for all i ∈ {1, . . . , s}. Note that T1 = {0, . . . , ps − 1}. Let t1 , t2 ,. . . , ts be non-negative integers with t1 ≥ 1. Consider the matrix Ātp1 ,...,ts whose columns are exactly all the vectors of the form zT , z ∈ {1} × T1t1 −1 × T2t2 × · · · × Tsts . Example 6.1. For p = 3 and s = 2, we have the following matrices: ⎛ ⎞   111 111 111 1 1 1 ⎜ ⎟ Ā1,1 3 = , Ā1,2 3 = ⎝ 036 036 036 ⎠ , 0 3 6 000 333 666 ⎛ ⎞ 111111111 111111111 111111111 ⎜ ⎟ Ā2,1 3 = ⎝ 012345678 012345678 012345678 ⎠ . 000000000 333333333 666666666 Any matrix Ātp1 ,...,ts can also be obtained by applying the following recursive con- struction. We start with Āp1,0,...,0 = (1). Then, if we have a matrix Ā = Ātp1 ,...,ts , for any i ∈ {1, . . . , s}, we may construct the matrix   Ā Ā ··· Ā Āi = . (8) 0 · pi−1 1 · pi−1 ··· (ps−i+1 − 1) · pi−1 t ,...,ts Finally, permuting the rows of Āi , we obtain a matrix Āp1 , where tj = tj for j = i t ,...,t and ti = ti + 1. Note that any permutation of columns of Āi gives also a matrix Āp1 s . t1 ,...,ts We consider that the matrices Āp are constructed recursively starting from Ā1,0,...,0 p in the following way. First, we add t 1 − 1 rows of order ps , up to obtain Ātp1 ,0,...,0 ; then t2 rows of order ps−1 up to generate Āpt1 ,t2 ,...,0 ; and so on, until we add ts rows of order p to achieve Ātp1 ,...,ts . See [19] for examples. Let H̄pt1 ,...,ts be the Zps -additive code of type (n; t1 , . . . , ts ) generated by the ma- trix Ātp1 ,...,ts , where t1 , . . . , ts are non-negative integers with t1 ≥ 1 and p prime. Let H̄pt1 ,...,ts = Φ(H̄pt1 ,...,ts ) be the corresponding Zps -linear code. 20 D.K. Bhunia et al. / Finite Fields and Their Applications 86 (2023) 102140 (s) (s) Let wi be the ith row of Ātp1 ,...,ts , 1 ≤ i ≤ t1 + · · · + ts . By construction, w1 = 1 (s) (s) and o(wi ) ≤ o(wj ) if i > j. We define σ ∈ {1, . . . , s} as the integer such that o(w2 ) = ps+1−σ . For H̄p1,0,...,0 , we define σ = s. Note that σ = 1 if t1 > 1, and σ = min{i : ti > 0, i ∈ {2, . . . , s}} if t1 = 1. Theorem 6.1. [19] Let t1 , . . . , ts be non-negative integers with s ≥ 2 and t1 ≥ 1. The Zps -linear code H̄pt1 ,...,ts of type (n; t1 , . . . , ts ) is a GH code over Zp of length N = pt , s with t = ( i=1 (s − i + 1) · ti ) − 1 and n = pt−s+1 . Theorem 6.2. [19] The Zps -linear GH codes H̄p1,0,...,0,ts , with p ≥ 3 prime, s ≥ 2 and ts ≥ 0, are the only Zps -linear GH codes which are linear. Theorem 6.3. [19] Let H̄pt1 ,...,ts be the Zps -linear GH code of type (n; t1 , . . . , ts ) with p ≥ 3 prime, s ≥ 2, t1 ≥ 1, and ti ≥ 0 for i ∈ {2, . . . , s}. Then, s ker(H̄pt1 ,...,ts ) = ( ti ) + σ − 1. i=1 Now, we establish some results about the rank of a family of Zp2 -linear GH codes, in order to determine whether these codes are equivalent or not to the Zp Zp2 -linear GH codes with α1 = 0 considered in this paper. Proposition 6.1. Let H̄p2,0 be the Zp2 -additive GH code of type (p2 ; 2, 0) with p ≥ 3 prime, and H̄p2,0 = Φ(H̄p2,0 ) be the corresponding Zp2 -linear GH code of length p3 . Then, rank(H̄p2,0 ) = p + 2. 2 Proof. Let u = (1, .p. ., 1) and v = (0, 1, . . . , p2 − 1) be the rows of Ā2,0 p . Let λ, μ ∈ Zp2 . We can write λ = λ0 +λ1 p and μ = μ0 +μ1 p, where λ0 , λ1 , μ0 , μ1 ∈ Np . By Corollaries 2.1 and 2.3, we have that Φ(λu + μv) = Φ(λ0 u + μ0 v) + λ1 Φ(pu) + μ1 Φ(pv). (9) Now, we consider Φ(λ0 u + μ0 v) for all λ0 , μ0 ∈ Np . First, if μ0 = 1, then, by Corol- lary 2.4, we have that Φ(λ0 u + v) = Φ(λ0 u) + Φ(v) + vλ0 , where vλ0 = (v̄λ0 , . p. ., v̄λ0 ), v̄λ0 = (0, p−λ . . .0 , 0, 1, .λ.0., 1), (10) and the vectors 0 and 1 are of length p. Second, if μ0 ∈ {2, . . . , p − 1}, we have that Φ(λ0 u + μ0 v) = Φ(λ0 u) + Φ(μ0 v) + wλ0 ,μ0 , where wλ0 ,μ0 = (w̄λ0 ,μ0 , . p. ., w̄λ0 ,μ0 ), w̄λ0 ,μ0 = (0, wλ0 ,μ0 ,1 , . . . , wλ0 ,μ0 ,p−1 ), D.K. Bhunia et al. / Finite Fields and Their Applications 86 (2023) 102140 21 wλ0 ,μ0 ,a ∈ {0, 1} for a ∈ {1, . . . , p − 1}, and the vectors 0 and 1 are of length p. By the definition of Φ, since λ0 ∈ Np , it is easy to see that Φ(λ0 u) = λ0 Φ(u). For μ0 ∈ {2, . . . , p − 1}, we have that Φ(μ0 v) = Φ(v) + Φ((μ0 − 1)v) + xμ0 , where xμ0 = (x̄μ0 , . p. ., x̄μ0 ), x̄μ0 = (0, xμ0 ,1 , . . . , xμ0 ,p−1 ), xμ0 ,a ∈ {0, 1} for a ∈ {1, . . . , p − 1}, and the vectors 0 and 1 are of length p. Note that {(0, p−i−1 . . . , 0, 1, . i. ., 1)}1≤i≤p−1 is a basis of the vector space Zp−1 p . Thus, we have that wλ0 ,μ0 and xμ0 can be written as a linear combination of the vectors p−1 {vi }1≤i≤p−1 given in (10). Moreover, Φ(pv) = Φ((pNp , . p. ., pNp )) = i=1 vi . Therefore, from (9), H̄p2,0 can be generated by Φ(u), Φ(pu), Φ(v) and {vi }1≤i≤p−1 . Since these vectors are all linearly independent, we obtain that rank(H̄p2,0 ) = p + 2.  Example 6.2. Let H̄32,0 be the Z9 -additive GH code of type (9; 2, 0) and H̄32,0 = Φ(H̄32,0 ) be the corresponding Z9 -linear GH code of length 27. Let u = (1) and v = (0, 1, 2, 3, 4, 5, 6, 7, 8) be the rows of the generator matrix Ā2,0 3 . Let λ = λ0 + 3λ1 and μ = μ0 + 3μ1 , where λ0 , λ1 , μ0 , μ1 ∈ {0, 1, 2} ⊆ Z9 . Note that Φ(λu + μv) = Φ(λ0 u + μ0 v) + λ1 Φ(3u) + μ1 Φ(3v). (11) Now, for λ0 ∈ {1, 2}, we have that Φ(λ0 u + v) = Φ(λ0 u) + Φ(v) + vλ0 , where v1 = (0, 0, 1, 0, 0, 1, 0, 0, 1), v2 = (0, 1, 1, 0, 1, 1, 0, 1, 1), and the vectors 0 and 1 are of length 3. Moreover, we have that Φ(3v) = v1 + v2 , Φ(2u) = 2Φ(u), Φ(2v) = 2Φ(v) + v1 , (12) Φ(u + 2v) = Φ(u) + 2Φ(v) + v2 , Φ(2u + 2v) = 2Φ(u) + 2Φ(v) + v1 + v2 . Therefore, from (11) and (12), H̄32,0  can be generated by Φ(u), Φ(v), Φ(3u), v1 and v2 . Since these vectors are linearly independent, rank(H̄32,0 ) = 5. Theorem 6.4. Let H̄p2,t−3 be the Zp2 -additive GH code of type (pt−1 ; 2, t − 3) with t ≥ 3 and p ≥ 3 prime, and H̄p2,t−3 = Φ(H̄p2,t−3 ) be the corresponding Zp2 -linear GH code of length pt . Then, rank(H̄p2,t−3 ) = p + t − 1. 22 D.K. Bhunia et al. / Finite Fields and Their Applications 86 (2023) 102140 Proof. We prove this theorem by induction on t. First, note that the result is true for t = 3, by Proposition 6.1. We assume that the result is true for a given t ≥ 3. By following the same argument as in the proof of Theorem 5.1, we obtain that rank(H̄p2,t−2 ) = 1 +rank(H̄p2,t−3 ). Therefore, by induction hypothesis, rank(H̄p2,t−2 ) = 1 +p +t −1 = p +t, and the result follows.  Then, we present two corollaries that show that there are some families of the new Zp Zp2 -linear GH codes presented in this paper, containing an infinite number of codes, which are not equivalent to the Zps -linear GH codes presented in [19]. The first one uses just the dimension of the kernel to determine that the codes are not equivalent, and the second one uses both invariants, the rank and the dimension of the kernel. Corollary 6.1. For any t ≥ 2 and p ≥ 3 prime, the Zp Zp2 -linear GH code Hp1,t−1 of type (pt−1 , (p − 1)pt−2 ; 1, t − 1) is nonequivalent to a Zp Zp2 -linear GH code of any other type, having α1 = 0 and the same length pt . Moreover, it is also nonequivalent to any Zps -linear GH code with s ≥ 2 of length pt . Proof. From the proof of Corollary 4.2, the Zp Zp2 -linear GH code Hp1,t−1 is nonequiva- lent to any other Zp Zp2 -linear GH code with α1 = 0 of length pt , because the dimensions of the kernels are different. By Corollary 4.1, we have that ker(Hp1,t−1 ) = 1 + t − 1 = t. Let H̄pt1 ,...,ts be the Zps - s linear GH code of length pt . By Theorem 6.3, we have that ker(H̄pt1 ,...,ts ) = ( i=1 ti ) + σ −1. Now, to complete the proof, we just need to show that ker(Hp1,t−1 ) = ker(H̄pt1 ,...,ts ). s Assume ker(Hp1,t−1 ) = ker(H̄pt1 ,...,ts ), that is, t = ( i=1 ti ) + σ − 1. By Theorem 6.1, we have that st1 + (s − 1)t2 + · · · + 2ts−1 + ts = t + 1. Then, st1 + (s − 1)t2 + · · · + 2ts−1 + ts = s ( i=1 ti ) + σ, that is, (s − 1)t1 + (s − 2)t2 + · · · + ts−1 = σ. (13) From the definition of σ, we have that either σ = 1 when t1 ≥ 2, or 2 ≤ σ ≤ s when t1 = 1, t2 = · · · = tσ−1 = 0 and tσ ≥ 1. For the first case, we obtain a contradiction from (13). For the second case, (13) becomes (s − 1) + (s − σ)tσ + λ = σ, where λ = (s − σ − 1)tσ+1 + · · · + ts−1 . Thus, if σ < s, we have that tσ + 1 = 1−λs−σ , which is a contradiction, since tσ + 1 ≥ 2, λ ≥ 0, and s − σ > 0. If s = σ, s − 1 = s, which is also a contradiction. This completes the proof.  Example 6.3. Let t = 6 and p = 3. By the proof of Corollary 4.2 or from Example 4.3, the Z3 Z9 -linear GH code H31,5 is nonequivalent to any other Z3 Z9 -linear GH code with α1 = 0 of the same length 36 . Now, all the nonlinear Z3s -linear GH codes, with s ≥ 2, of length 36 are H̄33,1 , H̄32,3 , H̄3 , H̄32,0,1 , H̄31,1,2 , H̄31,1,0,0 , H̄31,0,1,1 , and H̄31,0,0,1,0 having a kernel of dimension 4, 1,2,0 5, 4, 3, 5, 3, 5, and 5, respectively, as it is shown in Table 4 given in [19]. All the linear Z3s -linear GH codes, with s ≥ 2, of length 36 are H̄31,5 , H̄31,0,4 , H̄31,0,0,3 , H̄31,0,0,0,2 , D.K. Bhunia et al. / Finite Fields and Their Applications 86 (2023) 102140 23 H̄31,0,0,0,0,1 and H̄31,0,0,0,0,0,0 . Therefore, since H31,5 is nonlinear and ker(H31,5 ) = 1 + 5 = 6 by Corollary 4.1, H31,5 is nonequivalent to any Z3s -linear GH codes, with s ≥ 2, of the same length 36 . Theorem 6.5. [26] Let H̄pt1 ,...,ts be a Zps -linear GH code with ts ≥ 1. Then, H̄pt1 ,...,ts is ... ,0,t1 −1,t2 ,...,ts−1 ,ts − 1,0,−1 equivalent to the Zps+ -linear GH code H̄p , for all  ∈ {1, . . . , ts }. Corollary 6.2. For any t ≥ 4 and p ≥ 3 prime, the Zp Zp2 -linear GH code Hp2,t−3 of type (pt−2 , (p − 1)(pt−3 + pt−2 ); 2, t − 3) is nonequivalent to a Zp Zp2 -linear GH code of any other type, having α1 = 0 and the same length pt . Moreover, it is also nonequivalent to any Zps -linear GH code with s ≥ 2 of length pt . Proof. From the proof of Corollary 4.2, the Zp Zp2 -linear GH code Hp2,t−3 is nonequiva- lent to any other Zp Zp2 -linear GH code with α1 = 0 of length pt , because the dimensions of the kernels are different. Let H̄pt1 ,...,ts be the Zps -linear GH code of length pt . By Theorem 6.1, we have that st1 + (s − 1)t2 + · · · + 2ts−1 + ts = t + 1. (14) t−4 By Theorem 6.5, H̄p2,t−3 , H̄p1,1,t−4 , H̄p1,0,1,t−5 , H̄p1,0,0,1,t−6 , . . . , H̄p1,0, ... ,0,1,0 are all pair- wise equivalent codes over Zp of length pt . Let t−4 F = {H̄p2,t−3 , H̄p1,1,t−4 , H̄p1,0,1,t−5 , H̄p1,0,0,1,t−6 , . . . , H̄p1,0, ... ,0,1,0 } and T = {(2, t − 3), (1, 1, t − 4), (1, 0, 1, t − 5), (1, 0, 0, 1, t − 6), . . . , (1, 0, t−4 . . ., 0, 1, 0)}. By Theorem 6.4, rank(H̄p 2,t−3 ) = p + t − 1, and hence H̄p 2,t−3 is nonequivalent to the Zp Zp2 - linear GH code Hp2,t−3 , since rank(Hp2,t−3 ) > p + t − 1 by Theorem 5.2. Therefore, all the codes in F are nonequivalent to Hp2,t−3 . By Corollary 4.1, we have that ker(Hp2,t−3 ) = 2 + t − 3 = t − 1. By Theorem 6.3, we s have that ker(H̄pt1 ,...,ts ) = ( i=1 ti ) + σ − 1. Now, to complete the proof, we just need to show that ker(Hp2,t−3 ) = ker(H̄pt1 ,...,ts ) for all H̄pt1 ,...,ts ∈/ F . Assume ker(Hp2,t−3 ) = s t1 ,...,ts ker(H̄p ), that is, t − 1 = ( i=1 ti ) + σ − 1, where (t1 , . . . , ts ) ∈ / T . Then, from (14), s we have that st1 + (s − 1)t2 + · · · + 2ts−1 + ts = ( i=1 ti ) + σ + 1, that is, we have that (s − 1)t1 + (s − 2)t2 + · · · + ts−1 = σ + 1, (15) where (t1 , . . . , ts ) ∈ / T . From the definition of σ, we have that either σ = 1 when t1 ≥ 2, or 2 ≤ σ ≤ s when t1 = 1, t2 = · · · = tσ−1 = 0 and tσ ≥ 1. For the first case, note that if t1 = 2 and s = 2, then H̄p2,t−3 is the only Zp2 -linear GH code of type (pt−1 ; 2, t2 ) by Theorem 6.1. If t1 ≥ 2 and s > 2, or t1 > 2 and s = 2, we obtain a contradiction from (15). 24 D.K. Bhunia et al. / Finite Fields and Their Applications 86 (2023) 102140 For the second case, if σ = s, then (15) becomes σ−1 = σ+1, which is a contradiction. Then, we consider that 2 ≤ σ < s. We can write (15) as (s − 1) + (s − σ)tσ + λ = σ + 1, where λ = (s − σ − 1)tσ+1 + · · · + ts−1 . Thus, (s − σ)(tσ + 1) = 2 − λ, (16) where (t1 , . . . , ts ) ∈ / T . Since 2 ≤ σ < s and tσ + 1 ≥ 2, we have that λ = 0. Then, (16) becomes (s − σ)(tσ + 1) = 2. (17) Again, since tσ + 1 ≥ 2, from (17), we have that s − σ = 1. Then, tσ = ts−1 = 1, and from (14), we have that s + 2 + ts = t + 1, that is, t − ts = s + 1. (18) Now, since (t1 , . . . , ts ) = (1, 0, . . . , 0, 1, ts ) ∈ / T , we have that ts ∈ / {t − 4, t − 5, . . . , 0}, that is, ts ≥ t − 3. Therefore, from (18), t − s − 1 ≥ t − 3, that is, s = 2, since s ≥ 2. Thus, σ = s − 1 = 1, and we obtain a contradiction, since 2 ≤ σ < s. This completes the proof.  Example 6.4. Let t = 6 and p = 3. By the proof of Corollary 4.2 or from Example 4.3, the Z3 Z9 -linear GH code H32,3 is nonequivalent to any other Z3 Z9 -linear GH code with α1 = 0 of same length 36 . Now, all the linear Z3s -linear GH codes, with s ≥ 2, of length 36 are H̄31,5 , H̄31,0,4 , 1,0,0,3 H̄3 , H̄31,0,0,0,2 , H̄31,0,0,0,0,1 and H̄31,0,0,0,0,0,0 . These codes are nonequivalent to H32,3 , since H32,3 is a nonlinear code of length 36 . All the nonlinear Z3s -linear GH codes, with s ≥ 2, of length 36 are H̄33,1 , H̄32,3 , H̄31,2,0 , H̄32,0,1 , H̄31,1,2 , H̄31,1,0,0 , H̄31,0,1,1 , and H̄31,0,0,1,0 having the following parameters (r, k), where r is the rank and k the dimension of the kernel: (12, 4), (8, 5), (12, 4), (14, 3), (8, 5), (14, 3), (8, 5) and (8, 5), respectively, as it is shown in Table 4 given in [19]. By Corollary 4.1, ker(H32,3 ) = 5. Therefore, H̄33,1 , H̄31,2,0 , H̄32,0,1 and H̄31,1,0,0 are nonequivalent to H32,3 , since they all have a kernel of dimension less than 5. Let F = {H̄32,3 , H̄31,1,2 , H̄31,0,1,1 , H̄31,0,0,1,0 }. Since all the codes in F have the same rank 8, they all are nonequivalent to H32,3 , since rank(H32,3 ) > 3 + 6 − 1 = 8 by Theorem 5.2. 7. Conclusions and further research In this paper, we study the linearity of the Zp Zp2 -linear GH codes with α1 = 0 constructed in Section 2, and found out that they are always nonlinear. We also determine D.K. Bhunia et al. / Finite Fields and Their Applications 86 (2023) 102140 25 the dimension of the kernel for these nonlinear codes, and prove that this invariant can be used to see that they are pairwise not equivalent for any given length. This generalizes some results given for Z2 Z4 -linear Hadamard codes and Zp2 -linear GH codes given in [17] and [19], respectively. Finally, the rank of some infinite families of codes has been computed, and this invariant has been used to prove that, unlike for p = 2, for p ≥ 3 prime, there are Zp2 -linear GH codes which are not equivalent to any Zp Zp2 -linear GH codes with α1 = 0. Actually, there are infinite families of Zp Zp2 -linear GH codes with α1 = 0 such that their codes are not equivalent to any Zps -linear GH codes with s ≥ 2. Therefore, we show that some nonlinear GH codes, without any known structure, now can be seen as the Gray map image of Zp Zp2 -additive codes. As a further research, it would be interesting to prove that the ZpZp2 -linear GH codes with α1 = 0 and p ≥ 3 prime are always not equivalent to any Zp2 -linear GH code of the same length pt , as it can be seen for p ∈ {3, 5} and 2 ≤ t ≤ 8, from Tables 1 and 2. More generally, it may be proved that indeed they are not equivalent to any Zps -linear GH codes with s ≥ 2 of same length pt , as it can be checked for p = 3 and 2 ≤ t ≤ 8 by looking at Tables 4 and 5 from [19]. Data availability No data was used for the research described in the article. References [1] D.K. Bhunia, C. Fernández-Córdoba, M. Villanueva, On Zp Zp2 -linear generalized Hadamard codes, in: Proc. of the 12th International Workshop on Coding and Cryptography (WCC 2022), 7-11 March 2022 - Virtual, 2022, pp. 7–11. [2] D.K. Bhunia, C. Fernández-Córdoba, M. Villanueva, On the classification of Zp Zp2 -linear general- ized Hadamard codes, in: Proc. of 2022 IEEE Information Theory (ITW 2022), 6–9 November 2022, IEEE, 2022, pp. 1–6. [3] A.R. Hammons, P.V. Kumar, A.R. Calderbank, N.J. Sloane, P. Solé, The Z4 -linearity of Kerdock, Preparata, Goethals, and related codes, IEEE Trans. Inf. Theory 40 (2) (1994) 301–319. [4] C. Carlet, Z2k -linear codes, IEEE Trans. Inf. Theory 44 (4) (1998) 1543–1547. [5] J. Borges, C. Fernández-Córdoba, J. Rifà, Every Z2k -code is a binary propelinear code, Electron. Notes Discrete Math. 10 (2001) 100–102. [6] S.T. Dougherty, C. Fernández-Córdoba, Codes over Z2k , Gray map and self-dual codes, Adv. Math. Commun. 5 (4) (2011) 571–588. [7] T. Honold, A.A. Nechaev, Weighted modules and representations of codes, Probl. Inf. Transm. 35 (3) (1999) 205–223. [8] D.S. Krotov, On Z2k -dual binary codes, IEEE Trans. Inf. Theory 53 (4) (2007) 1532–1537. [9] C. Fernández-Córdoba, C. Vela, M. Villanueva, On Z2s -linear Hadamard codes: kernel and partial classification, Des. Codes Cryptogr. 87 (2–3) (2019) 417–435. [10] M. Shi, R. Wu, D.S. Krotov, On Zp Zpk -additive codes and their duality, IEEE Trans. Inf. Theory 65 (6) (2019) 3841–3847. [11] H. Bauer, B. Ganter, F. Hergert, Algebraic techniques for nonlinear codes, Combinatorica 3 (1) (1983) 21–33. [12] K.T. Phelps, J. Rifà, M. Villanueva, Kernels and p-kernels of pr -ary 1-perfect codes, Des. Codes Cryptogr. 37 (2) (2005) 243–261. [13] D. Jungnickel, On difference matrices, resolvable transversal designs and generalized Hadamard matrices, Math. Z. 167 (1) (1979) 49–60. [14] E.F. Assmus, J.D. Key, Designs and Their Codes, Cambridge University Press, 1992. 26 D.K. Bhunia et al. / Finite Fields and Their Applications 86 (2023) 102140 [15] S.T. Dougherty, J. Rifà, M. Villanueva, Ranks and kernels of codes from generalized Hadamard matrices, IEEE Trans. Inf. Theory 62 (2) (2016) 687–694. [16] D.S. Krotov, Z4 -linear Hadamard and extended perfect codes, Electron. Notes Discrete Math. 6 (2001) 107–112. [17] K.T. Phelps, J. Rifà, M. Villanueva, On the additive (Z4 -linear and non-Z4 -linear) Hadamard codes: rank and kernel, IEEE Trans. Inf. Theory 52 (1) (2006) 316–319. [18] D.S. Krotov, M. Villanueva, Classification of the Z2 Z4 -linear Hadamard codes and their automor- phism groups, IEEE Trans. Inf. Theory 61 (2) (2015) 887–894. [19] D.K. Bhunia, C. Fernández-Córdoba, M. Villanueva, On the linearity and classification of Zps -linear generalized Hadamard codes, Des. Codes Cryptogr. 90 (2022) 1037–1058. [20] C. Fernández-Córdoba, C. Vela, M. Villanueva, On Z8 -linear Hadamard codes: rank and classifica- tion, IEEE Trans. Inf. Theory 66 (2) (2019) 970–982. [21] C. Fernández-Córdoba, C. Vela, M. Villanueva, Equivalences among Z2s -linear Hadamard codes, Discrete Math. 343 (3) (2020) 111721. [22] M. Shi, Z. Sepasdar, A. Alahmadi, P. Solé, On two-weight Z2k -codes, Des. Codes Cryptogr. 86 (6) (2018) 1201–1209. [23] M. Shi, T. Honold, P. Solé, Y. Qiu, R. Wu, Z. Sepasdar, The geometry of two-weight codes over Zpm , IEEE Trans. Inf. Theory 67 (12) (2021) 7769–7781. [24] M. Greferath, S.E. Schmidt, Gray isometries for finite chain rings and a nonlinear ternary (36, 312 , 15) code, IEEE Trans. Inf. Theory 45 (7) (1999) 2522–2524. [25] D.K. Bhunia, C. Fernández-Córdoba, M. Villanueva, On the constructions of Zp Zp2 -linear gener- alized Hadamard codes, Finite Fields Appl. 83 (2022) 102093. [26] D.K. Bhunia, C. Fernández-Córdoba, C. Vela, M. Villanueva, Equivalences among Zps -linear gen- eralized Hadamard codes, preprint arXiv:2203.15407, 2022.