1 Introduction

Let \(\mathbb {Z}_{2^s}\) be the ring of integers modulo \(2^s\) with \(s\ge 1\). The set of n-tuples over \(\mathbb {Z}_{2^s}\) is denoted by \(\mathbb {Z}_{2^s}^n\). In this paper, the elements of \(\mathbb {Z}^n_{2^s}\) will also be called vectors over \(\mathbb {Z}_{2^s}\) of length n. A binary code of length n is a nonempty subset of \(\mathbb {Z}_2^n\), and it is linear if it is a subspace of \(\mathbb {Z}_{2}^n\). Similarly, a nonempty subset of \(\mathbb {Z}_{2^s}^n\) is a \(\mathbb {Z}_{2^s}\)-additive if it is a subgroup of \(\mathbb {Z}_{2^s}^n\). Note that, when \(s=1\), a \(\mathbb {Z}_{2^s}\)-additive code is a binary linear code and, when \(s=2\), it is a quaternary linear code or a linear code over \(\mathbb {Z}_4\).

Two binary codes, \(C_1\) and \(C_2\), are said to be equivalent if there is a vector \(\mathbf{a}\in \mathbb {Z}_2^n\) and a permutation of coordinates \(\pi \) such that \(C_2=\{ \mathbf{a}+\pi (\mathbf{c}) : \mathbf{c} \in C_1 \}\). Two \(\mathbb {Z}_{2^s}\)-additive codes, \({{\mathcal {C}}}_1\) and \({{\mathcal {C}}}_2\), are said to be permutation equivalent if they differ only by a permutation of coordinates, that is, if there is a permutation of coordinates \(\pi \) such that \({{\mathcal {C}}}_2=\{ \pi (\mathbf{c}) : \mathbf{c} \in {{\mathcal {C}}}_1 \}\).

The Hamming weight of a binary vector \(\mathbf{u}\in \mathbb {Z}_{2}^n\), denoted by \(\mathrm{wt}_H(\mathbf{u})\), is the number of nonzero coordinates of \(\mathbf{u}\). The Hamming distance of two binary vectors \(\mathbf{u},\mathbf{v}\in \mathbb {Z}_{2}^n\), denoted by \(d_H(\mathbf{u},\mathbf{v})\), is the number of coordinates in which they differ. Note that \(d_H(\mathbf{u},\mathbf{v})=\mathrm{wt}_H(\mathbf{v}-\mathbf{u})\). The minimum distance of a binary code C is \(d(C)=\min \{ d_H(\mathbf{u},\mathbf{v}) : \mathbf{u},\mathbf{v} \in C, \mathbf{u} \not = \mathbf{v} \}\) The Lee weight of an element \(i\in \mathbb {Z}_{2^s}\) is \(\mathrm{wt}_L(i)=\min \lbrace i, 2^s-i\rbrace \) and the Lee weight of a vector \(\mathbf{u}=(u_1,u_2,\dots ,u_n)\in \mathbb {Z}_{2^s}^n\) is \(\mathrm{wt}_L(\mathbf{u})=\sum _{j=1}^n \mathrm{wt}_L(u_j)\in \mathbb {Z}_{2^s}\). The Lee distance of two vectors \(\mathbf{u},\mathbf{v}\in \mathbb {Z}_{2^s}^n\) is \(d_L(\mathbf{u},\mathbf{v})=\mathrm{wt}_L(\mathbf{v}-\mathbf{u})\). The minimum distance of a \(\mathbb {Z}_{2^s}\)-additive code \({{\mathcal {C}}}\) is \(d({{\mathcal {C}}})=\min \{ d_L(\mathbf{u},\mathbf{v}) : \mathbf{u},\mathbf{v}\in {{\mathcal {C}}}, \mathbf{u} \not = \mathbf{v} \}\).

In [12], a Gray map from \(\mathbb {Z}_4\) to \(\mathbb {Z}_2^2\) is defined as \(\phi (0)=(0,0)\), \(\phi (1)=(0,1)\), \(\phi (2)=(1,1)\) and \(\phi (3)=(1,0)\). There exist different generalizations of this Gray map, which go from \(\mathbb {Z}_{2^s}\) to \(\mathbb {Z}_2^{2^{s-1}}\) [4, 7, 8, 14, 17]. The one given in [7], by Carlet, is the map \(\phi :\mathbb {Z}_{2^s}\rightarrow \mathbb {Z}_2^{2^{s-1}}\) defined as follows:

$$\begin{aligned} \phi (u)=(u_{s-1},\dots ,u_{s-1})+(u_0,\dots ,u_{s-2})Y, \end{aligned}$$
(1)

where \(u\in \mathbb {Z}_{2^s}\), \([u_0,u_1, \ldots , u_{s-1}]_2\) is the binary expansion of u, that is \(u=\sum _{i=0}^{s-1}2^{i}u_i\) (\(u_i \in \lbrace 0,1\rbrace \)), and Y is a matrix of size \((s-1)\times 2^{s-1}\) which columns are the elements of \(\mathbb {Z}_2^{s-1}\). Note that \((u_{s-1},\dots ,u_{s-1})\) and \((u_0,\dots ,u_{s-2})Y\) are binary vectors of length \(2^{s-1}\), and that the rows of Y form a basis of a first order Reed-Muller code after adding the all-one row. The generalization given in [17] can be defined in terms of the elements of a Hadamard code [14]. In this paper, we will focus on Carlet’s Gray map \(\phi \), which is a particular case of the last one satisfying that \(\sum \lambda _i \phi (2^i) =\phi (\sum \lambda _i 2^i)\) as we will see later. Then, we define \({\varPhi }:\mathbb {Z}_{2^s}^ n\rightarrow \mathbb {Z}_2^{n2^{s-1}}\) as the component-wise Gray map \(\phi \).

Let \({{\mathcal {C}}}\) be a \(\mathbb {Z}_{2^s}\)-additive code of length n. We say that its binary image \(C={\varPhi }({{\mathcal {C}}})\) is a \(\mathbb {Z}_{2^s}\)-linear code of length \(2^{s-1}n\). Since \({{\mathcal {C}}}\) is a subgroup of \(\mathbb {Z}_{2^s}^n\), it is isomorphic to an abelian structure \(\mathbb {Z}_{2^s}^{t_1}\times \mathbb {Z}_{2^{s-1}}^{t_2}\times \dots \times \mathbb {Z}_4^{t_{s-1}}\times \mathbb {Z}_2^{t_s}\), and we say that \({{\mathcal {C}}}\), or equivalently \(C={\varPhi }({{\mathcal {C}}})\), is of type \((n;t_1,\dots ,t_{s})\). Note that \(|{{\mathcal {C}}}|=2^{st_1}2^{(s-1)t_2}\cdots 2^{t_s}\). 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 \({{\mathcal {C}}}\) is a \(\mathbb {Z}_{2^s}\)-additive code of type \((n;t_1,\dots ,t_s)\), then a generator matrix of \({{\mathcal {C}}}\) with minimum number of rows has exactly \(t_1+\cdots +t_s\) 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, \(\langle C \rangle \), of C. The kernel of a binary code C is defined as \(\mathrm {K}(C)=\{\mathbf{x}\in \mathbb {Z}_2^n : \mathbf{x}+C=C \}\) [2]. If the all-zero vector belongs to C, then \(\mathrm {K}(C)\) is a linear subcode of C. Note also that if C is linear, then \(K(C)=C=\langle C \rangle \). We denote the rank of a binary code C as \(\text {rank}(C)\) and the dimension of the kernel as \(\text {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 Hadamard matrices [1, 16]. Note that linear Hadamard codes are in fact first order Reed-Muller codes, or equivalently, the dual of extended Hamming codes [16, Ch.13 § 3]. The \(\mathbb {Z}_{2^s}\)-additive codes that, under the Gray map \({\varPhi }\), give a Hadamard code are called \(\mathbb {Z}_{2^s}\)-additive Hadamard codes and the corresponding binary images are called \(\mathbb {Z}_{2^s}\)-linear Hadamard codes.

The \(\mathbb {Z}_4\)-linear Hadamard codes of length \(2^t\) can be classified by using either the rank or the dimension of the kernel [13, 18]. Specifically, it is known that for a \(\mathbb {Z}_4\)-linear Hadamard code C of type \((2^{t-1}; t_1, t_2)\), \(\text {ker}(C)=t_1+t_2+1\) if \(t_1>2\), and \(\text {ker}(C)=2t_1+t_2\) if \(t_1=1\) or 2, where \(t_2=t+1-2t_1\). For any integer \(t\ge 3\) and each \(t_1 \in \{1,\ldots ,\lfloor (t+1)/2 \rfloor \}\), there is a unique (up to equivalence) \(\mathbb {Z}_4\)-linear Hadamard code of type \((2^{t-1}; t_1, t+1-2t_1)\), and all these codes are pairwise nonequivalent, except for \(t_1=1\) and \(t_1=2\), where the codes are equivalent to the linear Hadamard code [13]. Therefore, the number of nonequivalent \(\mathbb {Z}_4\)-linear Hadamard codes of length \(2^t\) is \(\lfloor \frac{t-1}{2}\rfloor \) for all \(t\ge 3\), and it is 1 for \(t=1\) and \(t=2\).

Linear codes over \(\mathbb {Z}_{p^s}\), which are a generalization of \(\mathbb {Z}_{2^s}\)-additive codes, were studied by Blake [3] 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 \(\mathbb {Z}_4\) and the definition of the Gray map [12]. After that, \(\mathbb {Z}_{2^s}\)-additive codes and their images under the Gray map are deeply studied, for example, in [7], and later in [21] and [11]. In [14], Krotov studied \(\mathbb {Z}_{2^s}\)-linear Hadamard codes and their dual codes by using different generalizations of the Gray map. Recently, in [20], considering Carlet’s generalization of the Gray map, two-weight \(\mathbb {Z}_{2^s}\)-linear codes are studied. Note that \(\mathbb {Z}_{2^s}\)-linear Hadamard codes are in fact a particular case of these two-weight codes.

In this paper, in order to try to classify the \(\mathbb {Z}_{2^s}\)-linear Hadamard codes of length \(2^t\), for any \(t\ge 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\ge 3\) and \(s>2\), unlike for \(s=2\). However, we give some new classification results for \(t\le 11\) and any \(s>2\). This correspondence is organized as follows. In Sect. 2, we recall some results and we prove new ones related to the Carlet’s generalized Gray map. In Sect. 3, we describe the construction of the \(\mathbb {Z}_{2^s}\)-linear Hadamard codes of type \((n;t_1, \dots , t_s)\) when this Gray map is used. This result is already proved in [14] in a more general way, but using other techniques. In Sect. 4, we establish for which types these codes are linear, and we give the kernel and its dimensions whenever they are nonlinear. In Sect. 5, through several examples, we show that, unlike for \(s=2\), the dimension of the kernel is not enough to classify completely \(\mathbb {Z}_{2^s}\)-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\ge 2\), by using also the rank. Finally, in Sect. 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 \(\mathbb {Z}_{2^s}\)-linear Hadamard codes and given in next sections.

Let \(e_i\) be the vector that has 1 in the ith position and 0 otherwise. Let \(u,v\in \mathbb {Z}_{2^s}\) and \([u_0,u_1,\dots ,u_{s-1}]_2,[v_0,v_1,\dots ,v_{s-1}]_2\) be the binary expansions of u and v, respectively. The operation “\(\odot \)” on \(\mathbb {Z}_{2^s}\) is defined as \(u\odot v=\sum _{i=0}^{s-1}2^iu_iv_i\). Note that the binary expansion of \(u\odot v\) is \([u_0v_0,u_1v_1,\dots ,u_{s-1}v_{s-1}]_2\).

Proposition 1

[21] Let \(u,v\in \mathbb {Z}_{2^s}\). Then, \(\phi (u)+\phi (v)=\phi (u+v-2(u\odot v))\).

Corollary 1

Let \(u\in \mathbb {Z}_{2^s}\) and \(0\le p\le s-1\). Then, \(\phi (u)+\phi (2^{p})=\phi (u+2^p-2^{p+1}u_p)\), where \([u_0,u_1 \ldots , u_{s-1}]_2\) is the binary expansion of u.

Corollary 2

Let \(u\in \mathbb {Z}_{2^s}\). Then, \(\phi (u)+\phi (2^{s-1})=\phi (u+2^{s-1})\).

Lemma 1

Let \(u\in \lbrace 2^{s-2},\dots ,2^{s-1}-1\rbrace \cup \lbrace 3\cdot 2^{s-2},\dots ,2^{s}-1\rbrace \subset \mathbb {Z}_{2^s}\). Then, \(\phi (u)+\phi (2^{s-2})=\phi (u+2^{s-2}+2^{s-1})\).

Proof

By Proposition 1, we have that \(\phi (u)+\phi (2^{s-2})=\phi (u+2^{s-2}-2(u\odot 2^{s-2}))\). The binary expansion of \(2^{s-2}\) is \([0,\dots ,0,1,0]_2\) and, if \(u\in \lbrace 2^{s-2},\dots ,\)\(2^{s-1}-1\rbrace \cup \lbrace 3\cdot 2^{s-2},\dots ,2^{s}-1\rbrace \), the binary expansion of u is \([u_0, u_1, \dots , u_{s-3},\)\( 1, u_{s-1}]_2\). Then, \(-2(u\odot 2^{s-2})=2^{s-1}\) and the statement follows. \(\square \)

Corollary 3

Let \(v\in \lbrace 2^{s-2},3\cdot 2^{s-2}\rbrace \) and \(U=\lbrace 2^{s-2},\dots ,2^{s-1}-1\rbrace \cup \lbrace 3\cdot 2^{s-2},\dots ,2^{s}-1\rbrace \subset \mathbb {Z}_{2^s}\). Then,

$$\begin{aligned} \phi (u)+\phi (v)=\left\{ \begin{array}{ll} \phi (u+v+2^{s-1}) &{} \text {if } u\in U\\ \phi (u+v) &{} \text {if } u\in \mathbb {Z}_{2^s}\setminus U.\\ \end{array}\right. \end{aligned}$$

Proof

Straightforward from Corollary 1 and Lemma 1. \(\square \)

Lemma 2

Let \(\lambda _i\in \mathbb {Z}_2\), \(i\in \lbrace 0,\dots ,s-2\rbrace \). Then, \(\sum _{i=0}^{s-2}\lambda _i\phi (2^ i)=\phi (\sum _{i=0}^{s-2}\lambda _i2^i)\), where \(2^i\in \mathbb {Z}_{2^s}\).

Proof

Let \(y_{i}\) be the ith row of Y. By the definition of \(\phi \) given by (1), we know that \(\sum _{i=0}^{s-2}\lambda _i\phi (2^ i)=\sum _{i=0}^{s-2}\lambda _ie_{i+1}Y=\sum _{i=0}^{s-2}\lambda _iy_{i+1}=\varvec{\lambda }Y\), where \(\varvec{\lambda }=(\lambda _0,\dots ,\lambda _{s-2})\). Since \([\lambda _0,\dots ,\lambda _{s-2},0]_2\) is the binary expansion of \(\sum _{i=0}^{s-2}\lambda _i2^i\), then we have that \(\varvec{\lambda }Y=\phi (\sum _{i=0}^{s-2}\lambda _i2^i)\). \(\square \)

Proposition 2

[7] Let \(u,v\in \mathbb {Z}_{2^s}\). Then, \(d_H(\phi (u),\phi (v))=\mathrm{wt}_H(\phi (u-v))\).

Lemma 3

Let \(u\in \mathbb {Z}_{2^s}\). Then, \(d_H(\phi (u),\phi (2^{s-1}))+d_H(\phi (u),\phi (0))=2^{s-1}\).

Proof

By the properties of the distance, we have that \(d_H(\phi (u),\phi (2^{s-1}))+d_H(\phi (u),\phi (0))=\mathrm{wt}_H(\phi (2^{s-1} )-\phi (u))+\mathrm{wt}_H(\phi (u))\). Then, since \(\phi (2^{s-1})={\mathbf {1}}\), \(\mathrm{wt}_H(\phi (2^{s-1})-\phi (u))=2^{s-1}-\mathrm{wt}_H(\phi (u))\), and the result follows. \(\square \)

Corollary 4

Let \(u,v\in \mathbb {Z}_{2^s}\). Then, \(d_H(\phi (u),\phi (v+2^{s-1}))+d_H(\phi (u),\phi (v))=2^{s-1}\).

Proof

Straightforward from Corollary 1 and Lemma 3. \(\square \)

3 Construction of \(\mathbb {Z}_{2^s}\)-linear Hadamard codes

The description of a generator matrix having minimum number of rows for a \(\mathbb {Z}_4\)-additive Hadamard code, as long as recursive constructions of these matrices, are given in [13]. In [14], these results are generalized for any \(s>2\). In this section, we give another proof of the theorem that establishes that the constructed matrices generate \(\mathbb {Z}_{2^s}\)-linear Hadamard codes, in the case that Carlet’s Gray map is considered.

Let \(T_i=\lbrace j\cdot 2^{i-1}\, :\, j\in \lbrace 0,1,\dots ,2^{s-i+1}-1\rbrace \rbrace \) for all \(i \in \{1,\ldots ,s \}\). Note that \(T_1=\lbrace 0,\dots ,2^{s}-1\rbrace \). Let \(t_1\), \(t_2\),...,\(t_s\) be nonnegative integers with \(t_1\ge 1\). Consider the matrix \(A^{t_1,\dots ,t_s}\) whose columns are exactly all the vectors of the form \(\mathbf {z}^T\), \(\mathbf {z}\in \lbrace 1\rbrace \times T_1^{t_1-1}\times T_{2}^{t_2}\times \cdots \times T_s^{t_s}\).

Example 1

For \(s=3\), for example, we have the following matrices:

$$\begin{aligned}&A^{1,0,1}=\left( \begin{array}{ll} 1 &{}\quad 1\\ 0 &{}\quad 4\\ \end{array}\right) ,\quad A^{1,1,0}=\left( \begin{array}{llll} 1 &{}\quad 1 &{}\quad 1 &{}\quad 1\\ 0 &{}\quad 2 &{}\quad 4 &{}\quad 6\\ \end{array}\right) ,\quad A^{2,0,0}=\left( \begin{array}{llllllll} 1 &{}\quad 1 &{}\quad 1 &{}\quad 1 &{}\quad 1 &{}\quad 1 &{}\quad 1 &{}\quad 1\\ 0 &{}\quad 1 &{}\quad 2 &{}\quad 3 &{}\quad 4 &{}\quad 5 &{}\quad 6 &{}\quad 7\\ \end{array}\right) , \\&A^{1,1,1}=\left( \begin{array}{lllllllll} 1 &{}\quad 1 &{}\quad 1 &{}\quad 1 &{}\quad &{}\quad 1 &{}\quad 1 &{}\quad 1 &{}\quad 1\\ 0 &{}\quad 2 &{}\quad 4 &{}\quad 6 &{}\quad &{}\quad 0 &{}\quad 2 &{}\quad 4 &{}\quad 6\\ 0 &{}\quad 0 &{}\quad 0 &{}\quad 0 &{}\quad &{}\quad 4 &{}\quad 4 &{}\quad 4 &{}\quad 4\\ \end{array}\right) ,\\&A^{2,0,1}=\left( \begin{array}{lllllllllllllllll} 1 &{}\quad 1 &{}\quad 1 &{}\quad 1 &{}\quad 1 &{}\quad 1 &{}\quad 1 &{}\quad 1 &{}\quad &{}\quad 1 &{}\quad 1 &{}\quad 1 &{}\quad 1 &{}\quad 1 &{}\quad 1 &{}\quad 1 &{}\quad 1 \\ 0 &{}\quad 1 &{}\quad 2 &{}\quad 3 &{}\quad 4 &{}\quad 5 &{}\quad 6 &{}\quad 7 &{}\quad &{}\quad 0 &{}\quad 1 &{}\quad 2 &{}\quad 3 &{}\quad 4 &{}\quad 5 &{}\quad 6 &{}\quad 7 \\ 0 &{}\quad 0 &{}\quad 0 &{}\quad 0 &{}\quad 0 &{}\quad 0 &{}\quad 0 &{}\quad 0 &{}\quad &{}\quad 4 &{}\quad 4 &{}\quad 4 &{}\quad 4 &{}\quad 4 &{}\quad 4 &{}\quad 4 &{}\quad 4\\ \end{array}\right) , \\&A^{2,1,0}{\,=}\left( \begin{array}{lllllllllllllllllllllllllllllllllll} 1 &{}1 &{}1 &{}1 &{}1 &{}1 &{}1 &{}1 &{}&{}1 &{}1 &{}1 &{}1 &{}1 &{}1 &{}1 &{}1 &{}&{}1 &{}1 &{}1 &{}1 &{}1 &{}1 &{}1 &{}1 &{}&{}1 &{}1 &{}1 &{}1 &{}1 &{}1 &{}1 &{}1\\ 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\\ 0 &{}0 &{}0 &{}0 &{}0 &{}0 &{}0 &{}0 &{}&{}2 &{}2 &{}2 &{}2 &{}2 &{}2 &{}2 &{}2 &{}&{}4 &{}4 &{}4 &{}4 &{}4 &{}4 &{}4 &{}4 &{}&{}6 &{}6 &{}6 &{}6 &{}6 &{}6 &{}6 &{}6\\ \end{array}\right) . \end{aligned}$$

Let \(\mathbf {0}, \mathbf {1},\mathbf {2},\ldots , \mathbf {2^{s}-1}\) be the vectors having the elements \(0, 1, 2, \ldots , 2^s-1\) from \(\mathbb {Z}_{2^s}\) repeated in each coordinate, respectively. The order of a vector \({\mathbf {u}}\) over \(\mathbb {Z}_{2^s}\), denoted by \({\text {ord}}(\mathbf {u})\), is the smallest positive integer m such that \(m \mathbf {u} ={\mathbf {0}}\).

Any matrix \(A^{t_1,\dots ,t_s}\) can be obtained by applying the following iterative construction. We start with \(A^{1,0,\dots ,0}=(1)\). Then, if we have a matrix \(A=A^{t_1,\dots ,t_s}\), for any \(i\in \{1,\ldots ,s\}\), we may construct the matrix

$$\begin{aligned} A_i= \left( \begin{array}{cccc} A &{} A &{}\cdots &{} A \\ 0\cdot \mathbf {2}^{\mathbf{i}-\mathbf {1}} &{} 1\cdot \mathbf {2}^{\mathbf{i}-\mathbf {1}} &{} \cdots &{} (2^{s-i+1}-1)\cdot \mathbf {2}^{\mathbf{i}-\mathbf {1}} \\ \end{array}\right) . \end{aligned}$$
(2)

Finally, permuting the rows of \(A_i\), we obtain a matrix \(A^{t'_1,\ldots ,t'_s}\), where \(t'_j=t_j\) for \(j\not =i\) and \(t'_i=t_i+1\). Note that any permutation of columns of \(A_i\) gives also a matrix \(A^{t_1',\dots ,t_s'}\).

Example 2

From the matrix \(A^{1,0,0}=(1)\), we obtain the matrix \(A^{2,0,0}\); and from \(A^{2,0,0}\) we can construct \(A^{2,0,1}\), where \(A^{2,0,0}\) and \(A^{2,0,1}\) are the matrices given in Example 1. Note that we can also generate another matrix \(A^{2,0,1}\) as follows: from \(A^{1,0,0}=(1)\) we obtain the matrix \(A^{1,0,1}\) given in Example 1, and from \(A^{1,0,1}\) we can construct the matrix

$$\begin{aligned} A_1= & {} \left( \begin{array}{cccccccccccccccc} 1 &{}\quad 1 &{}\quad 1 &{}\quad 1 &{}\quad 1 &{}\quad 1 &{}\quad 1 &{}\quad 1 &{}\quad 1 &{}\quad 1 &{}\quad 1 &{}\quad 1 &{}\quad 1 &{}\quad 1 &{}\quad 1 &{}\quad 1 \\ 0 &{}\quad 4 &{}\quad 0 &{}\quad 4 &{}\quad 0 &{}\quad 4 &{}\quad 0 &{}\quad 4 &{}\quad 0 &{}\quad 4 &{}\quad 0 &{}\quad 4 &{}\quad 0 &{}\quad 4 &{}\quad 0 &{}\quad 4 \\ 0 &{}\quad 0 &{}\quad 1 &{}\quad 1 &{}\quad 2 &{}\quad 2 &{}\quad 3 &{}\quad 3 &{}\quad 4 &{}\quad 4 &{}\quad 5 &{}\quad 5 &{}\quad 6 &{}\quad 6 &{}\quad 7 &{}\quad 7 \\ \end{array}\right) . \end{aligned}$$

Then, after permuting the rows of \(A_1\), we have the matrix

$$\begin{aligned} A^{2,0,1}=\left( \begin{array}{cccccccccccccccc} 1 &{}\quad 1 &{}\quad 1 &{}\quad 1 &{}\quad 1 &{}\quad 1 &{}\quad 1 &{}\quad 1 &{}\quad 1 &{}\quad 1 &{}\quad 1 &{}\quad 1 &{}\quad 1 &{}\quad 1 &{}\quad 1 &{}\quad 1 \\ 0 &{}\quad 0 &{}\quad 1 &{}\quad 1 &{}\quad 2 &{}\quad 2 &{}\quad 3 &{}\quad 3 &{}\quad 4 &{}\quad 4 &{}\quad 5 &{}\quad 5 &{}\quad 6 &{}\quad 6 &{}\quad 7 &{}\quad 7 \\ 0 &{}\quad 4 &{}\quad 0 &{}\quad 4 &{}\quad 0 &{}\quad 4 &{}\quad 0 &{}\quad 4 &{}\quad 0 &{}\quad 4 &{}\quad 0 &{}\quad 4 &{}\quad 0 &{}\quad 4 &{}\quad 0 &{}\quad 4 \\ \end{array}\right) , \end{aligned}$$

which is different to the matrix \(A^{2,0,1}\) of Example 1. These two matrices \(A^{2,0,1}\) generate permutation equivalent codes.

Along this paper, we consider that the matrices \(A^{t_1,t_2,\ldots ,t_s}\) are constructed recursively starting from \(A^{1,0,\ldots ,0}\) in the following way. First, we add \(t_1-1\) rows of order \(2^s\), up to obtain \(A^{t_1,0,\ldots ,0}\); then \(t_2\) rows of order \(2^{s-1}\) up to generate \(A^{t_1,t_2,0,\ldots ,0}\); and so on, until we add \(t_s\) rows of order 2 to achieve \(A^{t_1,t_2,\ldots ,t_s}\).

Let \(\mathcal {H}^{t_1,\dots ,t_s}\) be the \(\mathbb {Z}_{2^s}\)-additive code generated by the matrix \(A^{t_1,\dots ,t_s}\), where \(t_1,\dots ,t_s\ge 0\) with \(t_1\ge 1\). Let \(n=2^{t-s+1}\), where \(t=\left( \sum _{i=1}^{s}(s-i+1)\cdot t_i\right) -1\). It is easy to see that \(\mathcal {H}^{t_1,\dots ,t_s}\) is of length n and has \(|\mathcal {H}^{t_1,\dots ,t_s}|=2^{s}n=2^{t+1}\) codewords. Note that this code is of type \((n;t_1,t_2,\dots ,t_s)\). Let \(H^{t_1,\dots ,t_s}={\varPhi }(\mathcal {H}^{t_1,\dots ,t_s})\) be the corresponding \(\mathbb {Z}_{2^s}\)-linear code.

Example 3

The code \(\mathcal {H}^{1,0,\dots ,0}\) is generated by \(A^{1,0,\dots ,0}=(1)\), so \(\mathcal {H}^{1,0,\dots ,0}=\mathbb {Z}_{2^s}\). This code has length \(n=1\), cardinality \(2^s\) and minimum distance 1. Thus, \(H^{1,0,\dots ,0}={\varPhi }(\mathcal {H}^{1,0,\dots ,0})\) has length \(N=2^{s-1}\), cardinality \(2N=2^s\) and minimum (Hamming) distance \(N/2=2^{s-2}\), so it is a binary Hadamard code. Actually, \(H^{1,0,\dots ,0}={\varPhi }(\mathbb {Z}_{2^s})\) is the binary linear Hadamard code of length \(2^{s-1}\) [7], or equivalently, the first order Reed-Muller code of length \(2^{s-1}\), denoted by \(RM(1,s-1)\) [16, Ch.13 § 3].

The result given by Theorem 1 is already proved in [14]. In that paper, it is shown that each \(\mathbb {Z}_{2^s}\)-linear Hadamard code is equivalent to \(H^{t_1,\ldots ,t_s}\) for some \(t_1,\ldots ,t_s\ge 0\) with \(t_1\ge 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 \(\mathbb {Z}_{2^s}\)-additive codes nor another generalization of the Gray map for these dual codes, unlike the proof given in [14].

Let \(\mathcal {G}\) be a generator matrix of a \(\mathbb {Z}_{2^s}\)-additive code \(\mathcal {C}\) of length n. Then, \((\mathcal {G}\cdots \mathcal {G})\) is a generator matrix of the r-fold replication code of \(\mathcal {C}\), \((\mathcal {C},\dots ,\mathcal {C})=\lbrace (\mathbf{c},\dots ,\mathbf{c}) : \mathbf{c} \in \mathcal {C}\rbrace \), of length \(r\cdot n\).

Theorem 1

[14] Let \(t_1,\dots ,t_s\) be nonnegative integers with \(t_1\ge 1\). The \(\mathbb {Z}_{2^s}\)-linear code \(H^{t_1,\dots ,t_s}\) of type \((n;t_1,t_2,\dots ,t_s)\) is a binary Hadamard code of length \(2^t\), with \(t=\left( \sum _{i=1}^{s}(s-i+1)\cdot t_i\right) -1\) and \(n=2^{t-s+1}\).

Proof

We prove this theorem by induction on the integers \(t_i\), \(i\in \lbrace 1,\dots ,s\rbrace \). First, by Example 3, the code \(H^{1,0,\dots ,0}\) is a Hadamard code.

Let \(\mathcal {H}=\mathcal {H}^{t_1,\dots ,t_s}\) be the \(\mathbb {Z}_{2^ s}\)-additive code of length n generated by the matrix \(A=A^{t_1,\dots ,t_s}\). We assume that \(H={\varPhi }(\mathcal {H})\) is a Hadamard code of length \(N=2^{s-1}n\). Let \(i\in \lbrace 1,\dots ,s\rbrace \). Define \(A_i\) as in (2) and let \(\mathcal {H}_i\) be the \(\mathbb {Z}_{2^s}\)-additive code generated by the matrix \(A_i\). We have that \(\mathcal {H}_i\) is permutation equivalent to \(\mathcal {H}^{t'_1,\dots ,t'_s}\), where \(t'_j=t_j\) for \(j\not =i\) and \(t'_i=t_i+1\). Now, we shall prove that \(H_i={\varPhi }(\mathcal {H}_i)\) is a Hadamard code.

Note that \(\mathcal {H}_i\) can be seen as the union of \(2^{s-i+1}\) cosets of the \(2^{s-i+1}\)-fold replication code of \(\mathcal {H}\), \((\mathcal {H}, \ldots ,\mathcal {H})\), which are

$$\begin{aligned} \left( \mathcal {H},\dots ,\mathcal {H} \right) +r\cdot \mathbf {w}_i, \end{aligned}$$
(3)

for \(r\in \lbrace 0,\dots 2^{s-i+1}-1\rbrace \), where \(\mathbf {w}_i= (0,\;\mathbf {2}^{\mathbf{i}-\mathbf {1}},\;2\cdot \mathbf {2}^{\mathbf{i}-\mathbf {1}},\;\dots ,\;(2^{s-i+1}-1)\cdot \mathbf {2}^{\mathbf{i}-\mathbf {1}})\).

The code \(\mathcal {H}\) of length n has cardinality \(2^sn\). It is easy to see that \(\mathcal {H}_i\) has length \(n_i=2^{s-i+1}n\) and cardinality \(2^{2s-i+1}n\). Therefore, the length of \(H_i={\varPhi }(\mathcal {H}_i)\) is \(N_i=2^{s-1}n_i\) and the cardinality \(2N_i\). Now, we just have to prove that the minimum distance of \(H_i\) is \(N_i/2\).

By Proposition 2, the minimum distance of \(H_i\) is equal to the minimum weight of \(H_i\). Thus, we just have to check that the minimum weight of any coset (3) is \(N_i/2\). When \(r=0\), we have that \(\mathrm{wt}_H({\varPhi }((\mathbf {u},\dots ,\mathbf {u})))=2^{s-i+1}\mathrm{wt}_H({\varPhi }(\mathbf {u}))\)\(=2^{s-i+1}N/2=N_i/2\). Otherwise, when \(r\not =0\), we consider

$$\begin{aligned} \mathrm{wt}_H({\varPhi }((\mathbf {u},\dots ,\mathbf {u})+r\cdot \mathbf {w}_i))=d_H({\varPhi }((\mathbf {u},\dots ,\mathbf {u})),{\varPhi }(r\cdot \mathbf {w}_i)). \end{aligned}$$
(4)

Note that, by construction, the coordinates of any nonnegative multiple of \(\mathbf {w}_i\) can be partitioned into two multisets V and \(V'\) such that \(|V|=|V'|=2^{s-i}\) and there is a bijection from V to \(V'\) mapping any element \(\mathbf {v}\in V\) into an element \(\mathbf {v}'\in V'\) such that \(\mathbf {v}'-\mathbf {v}=\mathbf {2}^{\mathbf{s}-\mathbf {1}}\). Therefore, (4) can be written as

$$\begin{aligned}&\sum _{\mathbf {v}\in V}d_H({\varPhi }(\mathbf {u}),{\varPhi }(\mathbf {v}))+\sum _{\mathbf {v}'\in V'}d_H({\varPhi }(\mathbf {u}),{\varPhi }(\mathbf {v'})) \nonumber \\&\quad = \sum _{\mathbf {v}\in V}d_H({\varPhi }(\mathbf {u}),{\varPhi }(\mathbf {v}))+d_H({\varPhi }(\mathbf {u}),{\varPhi }(\mathbf {v+2^{s-1}})) \nonumber \\&\quad = |V|\cdot 2^{s-1}n=2^{s-i}2^{s-1}n=N_i/2, \end{aligned}$$
(5)

where (5) holds by Corollary 4. \(\square \)

Example 4

Let \(\mathcal {H}^{2,0,0}\) be the \(\mathbb {Z}_8\)-additive code generated by \(A^{2,0,0}\) given in Example 1. The \(\mathbb {Z}_8\)-linear code \(H^{2,0,0}={\varPhi }(\mathcal {H}^{2,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 \(\mathbb {Z}_{2^s}\)-linear Hadamard codes

The computation of the kernel and its dimension for \(\mathbb {Z}_4\)-linear Hadamard codes is given in [13, 18]. In this section, we generalize these results for \(\mathbb {Z}_{2^s}\)-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 3

The \(\mathbb {Z}_{2^s}\)-linear Hadamard codes \(H^{1,0,\dots ,0}\) and \(H^{1,0,\dots ,0,1,0}\), with \(s>2\), are linear.

Proof

By Example 3, we know that \(H^{1,0\dots ,0}\) is linear.

Now, we consider \(\mathcal {H}=\mathcal {H}^{1,0,\dots ,0,1,0}\) and \(H={\varPhi }(\mathcal {H})\). Recall that the code \(\mathcal {H}\) is generated by

$$\begin{aligned} A^{1,0,\dots ,0,1,0}=\left( \begin{array}{cccc} 1 &{} 1 &{} 1 &{} 1\\ 0 &{} 2^{s-2} &{} 2^{s-1} &{} 3\cdot 2^{s-2}\\ \end{array}\right) . \end{aligned}$$

Let \(\pmb {\beta }_i=(2^{i},2^{i},2^{i},2^{i})\) for \(0\le i\le s-1\), \(\pmb {\beta }_{s}=(0,2^{s-1},0,2^{s-1})\) and \(\pmb {\beta }_{s+1}=(0,2^{s-2},2^{s-1},3\cdot 2^{s-2})\). Let C be the linear code generated by \(B=\lbrace {\varPhi }(\pmb {\beta }_i):0\le i\le s+1\rbrace \). Now, we prove that \(C\subseteq H\). Let \(\mathbf {c}=\sum _{i=0}^{s+1}\lambda _i{\varPhi }(\pmb {\beta }_i)\in C\), where \(\lambda _i\in \mathbb {Z}_2\). By Corollary 2, we only have to see that

$$\begin{aligned} \mathbf {c}'=\lambda _{s+1}{\varPhi }(\pmb {\beta }_{s+1})+\sum _{i=0}^{s-2}\lambda _i{\varPhi }(\pmb {\beta }_i)\in H. \end{aligned}$$

On the one hand, if \(\lambda _{s+1}=0\), then we have that \(\mathbf {c}'\in H\), since \(\sum _{i=0}^{s-2}\lambda _i{\varPhi }(\pmb {\beta }_i)={\varPhi }(\sum _{i=0}^{s-2}\lambda _i\pmb {\beta }_i)\) by Lemma 2. On the other hand, if \(\lambda _{s+1}=1\), then we have that \(\mathbf {c}'={\varPhi }((0,2^{s-2},2^{s-1},3\cdot 2^{s-2}))+{\varPhi }((u,u,u,u))\), where \(u=\sum _{i=0}^{s-2}\lambda _i2^{i}\). Let \(U=\lbrace 2^{s-2},\dots ,2^{s-1}-1\rbrace \cup \lbrace 3\cdot 2^{s-2},\dots ,2^{s}-1\rbrace \subset \mathbb {Z}_{2^s}\). Then, by Corollary 3, \(\mathbf {c}'={\varPhi }((0,2^{s-2},2^{s-1},3\cdot 2^{s-2})+(u,u,u,u)+(0,2^{s-1},0,2^{s-1}))\) if \(u\in U\), and \(\mathbf {c}'={\varPhi }((0,2^{s-2},2^{s-1},3\cdot 2^{s-2})+(u,u,u,u))\) if \(u\in \mathbb {Z}_{2^s}\setminus U\). In both cases, \(\mathbf {c}'\in H\).

Since \(|C|=|H|=2^{s+2}\), then \(C=H\), and thus H is linear. \(\square \)

Let \(\mathbf{u}=(u_1,\ldots ,u_n)\in \mathbb {Z}_{2^s}^n\) and \([u_{i,0}, u_{i,1}, \ldots , u_{i,s-1}]_2\) be the binary expansion of \(u_i\), \(i\in \{1,\ldots ,n\}\). Let p be an integer such that \(p\in \{0,\ldots ,s-1\}\). Then, we denote by \(\mathbf{u}^{(p)}\) the binary vector having in the ith coordinate the pth element of the binary expansion of \(u_i\), that is, \(\mathbf{u}^{(p)}=(u_{1,p},\ldots , u_{n,p})\).

Lemma 4

If \(\mathbf {v}=2^b(0,1,\dots ,2^a-1) \in \mathbb {Z}_{2^s}^n\), with \(n=2^a\), \(a\ge 1\) and \(a+b\le s\), then \(\mathrm{wt}_H(\mathbf {v}^{(p)})=2^{a-1}\) for all \(p \in \{ b,\ldots , a+b-1\}\).

Proof

The \(2^a\) coordinates of \(\mathbf {v}\) contain exactly the \(2^a\) elements of \(\mathbb {Z}_{2^s}\) which have a binary expansion of the form \([0,\ldots ,0,v_b, v_{b+1},\ldots , v_{a+b-1},0,\ldots ,0]_2\) with \(v_p \in \{0,1\}\), for all \(p \in \{b,\ldots , a+b-1\}\). Note that we have \(2^a\) different elements of \(\mathbb {Z}_{2^s}\), represented by exactly a binary coordinates. Hence, half of the coordinates of \(\mathbf {v}\) satisfy that \(v_p=1\) and the other half that \(v_p=0\). Therefore, \(\mathrm{wt}_H(\mathbf {v}^{(p)})=2^a/2=2^{a-1}\) for all \(p \in \{ b,\ldots , a+b-1\}\). \(\square \)

As shown in [13], the codes \(H^{1,t_2}\) and \(H^{2,t_2}\), \(t_2\ge 0\), are the only \(\mathbb {Z}_4\)-linear Hadamard codes which are linear. In [11], it is proved that the codes \(H^{1,0,\dots ,0,t_s}\), \(t_s\ge 0\), are linear. The next result shows that, for \(s>2\) and \(t_s\ge 0\), the codes \(H^{1,0,\dots ,0,1,t_s}\) and \(H^{1,0,\dots ,0,t_s}\) are linear, and they are the only \(\mathbb {Z}_{2^s}\)-linear Hadamard codes which are linear.

Theorem 2

The codes \(H^{1,0,\dots ,0,1,t_s}\) and \(H^{1,0,\dots ,0,t_s}\), with \(s>2\) and \(t_s\ge 0\), are the only \(\mathbb {Z}_{2^s}\)-linear Hadamard codes which are linear.

Proof

First, we show that these codes are linear by induction on \(t_s\). By Proposition 3, the codes \(H^{1,0,\dots ,0}\) and \(H^{1,0,\dots ,0,1,0}\) are linear. We assume that \(H={\varPhi }(\mathcal {H})\), where \(\mathcal {H}=\mathcal {H}^{1,0,\dots ,0,t_{s-1},t_s}\), \(t_{s-1}\in \lbrace 0,1\rbrace \) and \(t_s\ge 0\), is linear. Now, we prove that \(H_s=H^{1,0,\dots ,0,t_{s-1},t_s+1}\) is linear. Since H is a linear Hadamard code of length \(2^{t_s+2t_{s-1}-1}\), it is the Reed-Muller code \(RM(1,t_s+2t_{s-1}-1)\) [16, Ch.13 § 3]. By the iterative construction (2), we have that \(H_s=\lbrace {\varPhi }((\mathbf {h},\mathbf {h})+({\mathbf {0}},\mathbf {v})):\mathbf {h}\in \mathcal {H}, \mathbf {v}\in \lbrace {\mathbf {0}},\mathbf {2}^{\mathbf{s}-\mathbf {1}}\rbrace \rbrace \). By Corollary 2, \(H_s=\lbrace ({\varPhi }(\mathbf {h}),{\varPhi }(\mathbf {h})+{\varPhi }(\mathbf {v})):\mathbf {h}\in \mathcal {H}, \mathbf {v}\in \lbrace {\mathbf {0}},\mathbf {2}^{\mathbf{s}-\mathbf {1}}\rbrace \rbrace =\lbrace (\mathbf {h}', \mathbf {h}'+\mathbf {v}'):\mathbf {h}'\in H, \mathbf {v}'\in \lbrace {\mathbf {0}},{\mathbf {1}}\rbrace \rbrace \), which corresponds to the Reed-Muller code \(RM(1,t_s+2t_{s-1}).\) Therefore, \(H_s\) is linear.

Now, we prove the nonlinearity of \(H={\varPhi }({\mathcal {H}})\), where \({\mathcal {H}} ={\mathcal {H}}^{1,0,\dots ,0,2,0}\). Let \(\mathbf {r}=(0, 2^{s-2}, 2^{s-1}, 3\cdot 2^{s-2})\). Recall that \({\mathcal {H}}\) has length 16 and is generated by

$$\begin{aligned} A^{1,0,\dots ,0,2,0}=\left( \begin{array}{cccccccccccccccc} \mathbf {1} &{}\quad \mathbf {1} &{}\quad \mathbf {1} &{}\quad \mathbf {1} \\ \mathbf {r} &{}\quad \mathbf {r} &{}\quad \mathbf {r} &{}\quad \mathbf {r} \\ \mathbf {0} &{}\quad \mathbf {2^{s-2}} &{}\quad \mathbf {2}^{\mathbf{s}-\mathbf {1}} &{}\quad \mathbf {3}\cdot 2^{\mathbf {s}-\mathbf {2}} \\ \end{array}\right) . \end{aligned}$$

By Corollaries 2 and 3, we have \({\varPhi }((\mathbf {r}, \mathbf {r}, \mathbf {r}, \mathbf {r}))+{\varPhi }((\mathbf {0}, \mathbf {2}^{\mathbf{s}-\mathbf {2}}, \mathbf {2}^{\mathbf{s}-\mathbf {1}}\), \(\mathbf {3}\cdot 2^{\mathbf{s}-\mathbf {2}}))={\varPhi }(\mathbf {z})\), where \(\mathbf {z}=(\mathbf {r}, \mathbf {r}, \mathbf {r}, \mathbf {r})+(\mathbf {0}, \mathbf {2}^{\mathbf{s}-\mathbf {2}}, \mathbf {2}^{\mathbf{s}-\mathbf {1}},\mathbf {3}\cdot 2^{\mathbf{s}-\mathbf {2}})+(\mathbf {0},\mathbf {u},\mathbf {0},\mathbf {u})\) and \(\mathbf {u}=(0,2^{s-1},0,2^{s-1})\). Since \({\mathcal {H}}\) is linear over \(\mathbb {Z}_{2^s}\), \(\mathbf {z} \in {\mathcal {H}}\) if and only if \((\mathbf {0},\mathbf {u},\mathbf {0},\mathbf {u})\in \mathcal {H}\). Since \(\mathrm{wt}_H({\varPhi }((\mathbf {0},\mathbf {u},\mathbf {0},\mathbf {u})))=4\cdot 2^{s-1}=N/4\), where N is the length of H, \({\varPhi }((\mathbf {0},\mathbf {u},\mathbf {0},\mathbf {u})) \not \in H\), so \({\varPhi }(\mathbf {z}) \not \in H\). Therefore, \(H=H^{1,0,\dots ,0,2,0}\) is nonlinear.

Let \(H={\varPhi }(\mathcal {H})\), where \(\mathcal {H}=\mathcal {H}^{t_1,\dots ,t_s}\). For any \(i\in \{1,\ldots ,s\}\), we define \(H_i={\varPhi }(\mathcal {H}_i)\), where \(\mathcal {H}_i=\mathcal {H}^{t'_1,\dots ,t'_s}\), \(t'_i=t_i+1\) and \(t'_j=t_j\) for \(j\not =i\).

Next, we consider \(H={\varPhi }(\mathcal {H})\), where \(\mathcal {H}=\mathcal {H}^{1,0,\dots ,0}\), and we prove that \(H_i\) is nonlinear for any \(i\in \{1,\ldots ,s-2\}\). Note that the generator matrix of \(\mathcal {H}_i\) has two rows: \(\mathbf {w}_1={\mathbf {1}}\) and \(\mathbf {w}_2=2^{i-1}(0,1,\dots ,2^{s+1-i}-1)\). By Corollary 1, we know that \({\varPhi }(\mathbf{w}_2)+{\varPhi }(\mathbf {2}^{\mathbf{i}-\mathbf {1}})={\varPhi }(\mathbf {w}_2+\mathbf {2}^{\mathbf{i}-\mathbf {1}}-2^{i}\mathbf {w}_2^{(i-1)})\). Therefore, we just need to show that \(2^{i}\mathbf {w}_2^{(i-1)}\not \in \mathcal {H}_i\). We have that \(\mathrm{wt}_H(\mathbf{w}_2^{(i-1)})=2^{s-i}\) by Lemma 4. Since \(2^i \not \in \{0,2^{s-1}\}\), \(\mathrm{wt}_H(\phi (2^{i}))=2^{s-2}\). Then, \(\mathrm{wt}_H({\varPhi }(2^{i}\mathbf {w}_2^{(i-1)}))=2^{s-i}\cdot 2^{s-2}= 2^{2s-2-i}\). Recall that the length of H is \(N=2^t\), where \(t=2s-i\). Therefore, we have that \(\mathrm{wt}_H({\varPhi }(2^{i}\mathbf {w}_2^{(i-1)}))=2^{t-2}=N/4\), and then \({\varPhi }(2^{i}{} \mathbf{w}_2^{(i-1)})\not \in H_i\).

Finally, in general, for \(H={\varPhi }(\mathcal {H})\), where \(\mathcal {H}=\mathcal {H}^{t_1,\dots ,t_s}\), we prove that if H is nonlinear, then \(H_i\) is nonlinear for any \(i\in \{1,\ldots ,s\}\). Assume that \(H_i\) is linear. Then, by the iterative construction (2), for any \(\mathbf {u},\mathbf {v}\in \mathcal {H}\), we have that \((\mathbf {u},\dots ,\mathbf {u}),(\mathbf {v},\dots ,\mathbf {v})\in \mathcal {H}_i\). Moreover, since \(H_i\) is linear, \({\varPhi }((\mathbf {u},\dots ,\mathbf {u}))+{\varPhi }((\mathbf {v},\dots ,\mathbf {v}))={\varPhi }( (\mathbf {a},\dots ,\mathbf {a}) +\lambda \cdot 2^{i-1} (0, 1, \dots , 2^{s-i+1}-1))\in H_i\), where \(\mathbf {a}\in \mathcal {H}\) and \(\lambda \in \mathbb {Z}_{2^s}\). Therefore, \({\varPhi }(\mathbf {u})+{\varPhi }(\mathbf {v})={\varPhi }(\mathbf {a}) \in H\), and we have that H is linear and the result follows. \(\square \)

Let \(A^{t_1,\dots ,t_s}\) be the generator matrix of \(\mathcal {H}^{t_1,\dots ,t_s}\), considered along this paper, and let \(\mathbf {w}_i\) be the ith row vector of \(A^{t_1,\dots ,t_s}\). By construction, \(\mathbf {w}_1={\mathbf {1}}\) and \({\text {ord}}(\mathbf {w}_i)\le {\text {ord}}(\mathbf {w}_j)\) if \(i>j\). We define \(\sigma \in \lbrace 1,\dots ,s\rbrace \) as the integer such that \({\text {ord}}(\mathbf{w}_2)=2^{s+1-\sigma }\). Note that \(\sigma =1\) if \(t_1>1\), and \(\sigma =\min \lbrace i : t_i>0, i\in \lbrace 2,\dots ,s\rbrace \rbrace \) if \(t_1=1\). In the case \(\sigma =s\), the code is \(\mathcal {H}^{1,0,\dots ,0,t_s}\), which is linear.

Example 5

Considering all nonnegative integer solutions with \(t_1\ge 1\) of the equation \(5=3t_1+2t_2+t_3-1\), we have that the \(\mathbb {Z}_8\)-linear Hadamard codes of length \(2^t=32\) are the following: \(H^{1,0,3}\), \(H^{1,1,1}\) and \(H^{2,0,0}\). By Theorem 2, we have that \(H^{1,0,3}\) and \(H^{1,1,1}\) are linear, so \(\text {ker}(H^{1,0,3})=\text {ker}(H^{1,1,1})=6\). By the same theorem, we also have that \(H^{2,0,0}\) is nonlinear, so \(\text {ker}(H^{2,0,0})<6\).

Proposition 4

Let \(\mathcal {H}=\mathcal {H}^{t_1,\dots ,t_s}\) be the \(\mathbb {Z}_{2^s}\)-additive Hadamard code of type \((n; t_1,\)\(\dots , t_s)\) such that \({\varPhi }(\mathcal {H})\) is nonlinear. Let \(\mathcal {H}_b\) be the subcode of \(\mathcal {H}\) which contains all the codewords of order two. Let \(P=\lbrace \mathbf {2}^{\mathbf{p}}\rbrace _{p=0}^{\sigma -2}\) if \(\sigma \ge 2\), and \(P=\emptyset \) if \(\sigma =1\). Then,

$$\begin{aligned} \left\langle {\varPhi }(\mathcal {H}_b),{\varPhi }(P), {\varPhi }\left( \sum _{i=0}^{s-2}\mathbf {2}^{\mathbf{i}}\right) \right\rangle \subseteq K({\varPhi }(\mathcal {H})) \end{aligned}$$

and \(\text {ker}({\varPhi }(\mathcal {H}))\ge \sigma +\sum _{i=1}^{s}t_i\).

Proof

Let \(H={\varPhi }(\mathcal {H})\) and \(\tau =\sum _{i=1}^{s}t_i\). Let \(Q=\lbrace ({\text {ord}}(\mathbf{w}_q)/2)\mathbf {w}_q \rbrace _{q=0}^{\tau }\). Since \(\mathcal {H}_b\) contains all the elements of \(\mathcal {H}\) of order two, we have that the set \({\varPhi }(Q)\) is a basis for the binary linear subcode \(H_b={\varPhi }(\mathcal {H}_b)\) of H. By Corollary 2, for all \(\mathbf {b}\in \mathcal {H}_b\) and \(\mathbf {u}\in \mathcal {H}\), we have that \({\varPhi }(\mathbf {b})+{\varPhi }(\mathbf {u})={\varPhi }(\mathbf {b}+\mathbf {u})\in H\) and, therefore, \(H_b\subseteq K(H)\).

Assume \(\sigma \ge 2\). Now, we prove that \({\varPhi }(\mathbf {2}^{\mathbf{p}})\in K(H)\) for all \(p \in \{0,\ldots , \sigma -2\}\). Equivalently, we show that \({\varPhi }(\mathbf {2}^{\mathbf{p}})+{\varPhi }(\mathbf{u})\in H\) for all \(\mathbf{u}\in \mathcal {H}\). If \(\mathbf{u}\in \mathcal {H}\), then \(\mathbf{u}=\lambda \cdot {\mathbf {1}}+\mathbf{u}'\), where \(\lambda \in \mathbb {Z}_{2^s}\) and \({\text {ord}}(\mathbf{u}')\le {\text {ord}}(\mathbf{w}_2)=2^{s+1-\sigma }\). Let \(\mathbf{u}=(u_1,\ldots ,u_n)\in \mathbb {Z}_{2^s}^n\) and \([u_{i,0}, u_{i,1}, \ldots , u_{i,s-1}]_2\) be the binary expansion of \(u_i\), \(i\in \{1,\ldots ,n\}\). Let \([\lambda _0,\lambda _1,\ldots ,\lambda _{s-1}]_2\) be the binary expansion of \(\lambda \in \mathbb {Z}_{2^s}\). By Corollary 1, we have that \({\varPhi }(\mathbf {2}^{\mathbf{p}})+{\varPhi }(\mathbf {u})={\varPhi }(\mathbf {2}^{\mathbf{p}}+\mathbf {u}-2^{p+1}{} \mathbf{u}^{(p)})\), where \(\mathbf{u}^{(p)}=(u_{1,p},\ldots , u_{n,p})\). Note that if \(v\in \mathbb {Z}_{2^s}\) is of order \(2^j\), then its binary expansion is of the form \([0,\dots ,0,1,v_{s-j+1},\dots ,v_{s-1}]_2\). Since \(p\in \{0,\ldots ,\sigma -2\}\) and \({\text {ord}}(\mathbf{u}')\le 2^{s+1-\sigma }\), we have that \(\mathbf{u}^{(p)}=(\lambda _p,\ldots ,\lambda _p)\). Therefore, \(2^{p+1}\mathbf {u}^{(p)}=\lambda _p\mathbf {2}^{\mathbf{p}+\mathbf {1}}\in \mathcal {H}\) and \({\varPhi }(\mathbf {2}^{\mathbf{p}})+{\varPhi }(\mathbf{u})={\varPhi }(\mathbf {2}^{\mathbf{p}}+\mathbf{u}-\lambda _p\mathbf {2}^{\mathbf{p}+\mathbf {1}})\in H\).

Next, we show that \({\varPhi }(\sum _{i=0}^{s-2}\mathbf {2}^{\mathbf{i}})\in K(H)\). Let \(\mathbf{u}=(u_1,\dots ,u_{n})\in \mathcal {H}\) and \(\mathbf{v}=(v_1,\dots ,v_n)=\sum _{i=0}^{s-2}\mathbf {2}^i\). First, we prove that \(\phi (v_i)+\phi (u_i)=\phi (v_i+u_i-2u_i)\) for all \(i\in \lbrace 1,\dots ,n\rbrace \). Note that the binary expansion of \(v_i\) and \(u_i\) are \([1,\dots ,1,0]_2\) and \([u_{i,0},u_{i,1},\ldots , u_{i,{s-1}}]_2\), respectively. Then, it is easy to check that \(2(v_i\odot u_i)=2u_i\). Therefore, by Proposition 1, \(\phi (v_i)+\phi (u_i)=\phi (v_i+u_i-2u_i)\). Hence, \({\varPhi }(\mathbf{v})+{\varPhi }(\mathbf{u})={\varPhi }(\mathbf{v}+\mathbf{u}-2\mathbf{u})\in H\) for all \(\mathbf{u}\in \mathcal {H}\).

Finally, we have to see that the elements of the set \(\lbrace {\varPhi }(Q), {\varPhi }(P), {\varPhi }(\sum _{i=0}^{s-2}\mathbf {2}^{\mathbf{i}})\rbrace \) are linearly independent. By construction, the generator matrix \(A^{t_1,\ldots ,t_s}\) is a block upper triangular matrix, so it is easy to see that the codewords in \({\varPhi }(Q)\) are linearly independent of the ones in \(\lbrace {\varPhi }(P), {\varPhi }(\sum _{i=0}^{s-2}\mathbf {2}^{\mathbf{i}})\rbrace \). Note that \(\sigma <s\) since H is nonlinear. Thus, by Lemma 2, it is easy to see that the codewords in \(\lbrace {\varPhi }(P), {\varPhi }(\sum _{i=0}^{s-2}\mathbf {2}^{\mathbf{i}})\rbrace \) are linearly independent. Therefore, we have that the dimension of the linear span of this set is \(\sigma +\tau \), so \(\text {ker}(H)\ge \sigma +\tau \). \(\square \)

Lemma 5

Let \(v\in \mathbb {Z}_{2^s}\) and \(\lambda _i\in \mathbb {Z}_2\), \(i\in \lbrace 0,\dots ,s-1\rbrace \). Then, \(v\odot \sum _{i=0}^{s-1}\lambda _i2^i=\sum _{i=0}^{s-1}v\odot \lambda _i 2^i\).

Proof

Let \(v\in \mathbb {Z}_{2^s}\) and \([v_0,v_1,\dots ,v_{s-1}]_2\) its binary expansion. By definition, we have that \(v\odot \sum _{i=0}^{s-1}\lambda _i2^i=\sum _{i=0}^{s-1}v_i\lambda _i2^i\). Note that \(v_i\lambda _i2^i=v\odot \lambda _i2^i\), so \(v\odot \sum _{i=0}^{s-1}\lambda _i2^i=\sum _{i=0}^{s-1}v\odot \lambda _i 2^i\). \(\square \)

Lemma 6

Let \(\mathcal {H}=\mathcal {H}^{t_1,\dots ,t_s}\) be the \(\mathbb {Z}_{2^s}\)-additive Hadamard code of type \((n; t_1,\)\(\dots , t_s)\). Let \(\mathcal {N}=\{ \sum _{i=\sigma -1}^{s-2}\lambda _i\mathbf {2}^{\mathbf{i}} : \lambda _i\in \mathbb {Z}_2\}\setminus \{\sum _{i=\sigma -1}^{s-2}\mathbf {2}^{\mathbf{i}}\}\) if \(\sigma \le s-1\). Then, \({\varPhi }(\mathcal {N})\cap K({\varPhi }(\mathcal {H}))=\{{\mathbf {0}}\}\).

Proof

Let \(H={\varPhi }(\mathcal {H})\). Let \(\mathbf {u}=\sum _{i=\sigma -1}^{s-2}\lambda _i\mathbf {2}^{\mathbf{i}}\in \mathcal {N}\) such that \({\varPhi }(\mathbf {u})\in K(H)\). We want to prove that \(\mathbf {u}=\mathbf {0}\).

By construction, the second row \(\mathbf {w}_2\) of \(A^{t_1,\dots ,t_s}\) is a \(2^{t-2s+\sigma }\)-fold replication of \(\mathbf {v}=2^{\sigma -1}(0,1,\dots ,2^{s+1-\sigma }-1)\), and \({\text {ord}}(\mathbf {w}_2)=2^{s+1-\sigma }\). By Proposition 1, we have that \({\varPhi }(\mathbf{w}_2)+{\varPhi }(\mathbf {u})={\varPhi }(\mathbf{w}_2+\mathbf {u}- 2(\mathbf{w}_2\odot \mathbf {u}))\). Since \({\varPhi }(\mathbf {u})\in K(H)\), \(2(\mathbf{w}_2\odot \mathbf {u})\in \mathcal {H}\). Note that, by Lemma 5, we have that \(2(\mathbf{w}_2\odot \mathbf {u})=2\sum _{i=\sigma -1}^{s-2}\mathbf {w}_2 \odot \lambda _i \mathbf {2}^{\mathbf{i}} =2\sum _{i=\sigma -1}^{s-2}\lambda _i\mathbf {w}_2^{(i)}2^i\in \mathcal {H}\).

Let \(\tau =\sum _{i=1}^s t_i\). If \(\tau =2\), then \(\mathcal {H}\) has length \(2^{s+1-\sigma }\) and the only rows in \(A^{t_1,\dots ,t_s}\) are \(\mathbf {1}\) and \(\mathbf {w}_2=\mathbf {v}\). If \(\tau \ge 3\), for \(i\in \lbrace 3,\dots ,\tau \rbrace \), the ith row \(\mathbf {w}_i\) of \(A^{t_1,\dots ,t_s}\) contains zeros in the first \(2^{s+1-\sigma }\) coordinates by construction. Since \(\sigma \le s-1\), \(\tau \ge 2\), and hence any element of \(\mathcal {H}\) restricted to the first \(2^{s+1-\sigma }\) coordinates is of the form \(\mu _1{\mathbf {1}}+\mu _2\mathbf{v}\) for some \(\mu _1,\mu _2\in \mathbb {Z}_{2^s}\). We have that \(2\sum _{i=\sigma -1}^{s-2}\lambda _i\mathbf {w}_2^{(i)}2^i\) restricted to the first \(2^{s+1-\sigma }\) coordinates is \(2\sum _{i=\sigma -1}^{s-2}\lambda _i\mathbf {v}^{(i)}2^i\), so we have to find \(\mu _1,\mu _2\in \mathbb {Z}_{2^s}\) such that \(2\sum _{i=\sigma -1}^{s-2}\lambda _i\mathbf {v}^{(i)}2^i=\mu _1{\mathbf {1}}+\mu _2\mathbf {v}\).

Since the first coordinate of \(\mathbf {v}\) is 0, the first coordinate of \(\mathbf {v}^{(i)}\) is 0 for all i. Then, we have that \(\mu _1=0\), so \(2\sum _{i=\sigma -1}^{s-2}\lambda _i\mathbf {v}^{(i)}2^i=\mu _2\mathbf {v}\). Note that \(\mathbf {v}=\sum _{i=0}^{s-1}\mathbf {v}^{(i)}2^i=\sum _{i=\sigma -1}^{s-1}\mathbf {v }^{(i)}2^i\). Therefore, \(2\sum _{i=\sigma -1}^{s-2}\lambda _i\mathbf {v}^{(i)}2^i=\mu _2\sum _{i=\sigma -1}^{ s-1}\mathbf {v}^{(i)}2^i\). Since \(\mathbf {u} \in \mathcal {N}\), there exists \(j\in \{\sigma -1,\dots ,s-2\}\) such that \(\lambda _j=0\). Then, regrouping the terms, we obtain that

$$\begin{aligned} \sum _{\begin{array}{c} i=\sigma -1\\ i\not =j \end{array}}^{s-2}(\mu _2-2\lambda _i)\mathbf {v}^{(i)} 2^i+\mu _2\mathbf {v}^{(j)}2^j+\mu _2\mathbf {v}^{(s-1)}2^{s-1}={\mathbf {0}}. \end{aligned}$$

Note that \(\{\mathbf {v}^{(i)}\}_{i=\sigma -1}^{s-1}\) is a subset of a basis of the RM(1, t). Then, we have that \((\mu _2-2\lambda _i)2^i=0\), for \(i\in \{\sigma -1,\cdots ,s-2\}\setminus \{j\}\), \(\mu _22^j=0\) and \(\mu _22^{s-1}=0\). As a result, \(\mu _2=0\) and \(\lambda _i=0\) for all \(i\in \{\sigma -1,\cdots ,s-2\}\). Hence, \(\mathbf {u}=\sum _{i=\sigma -1}^{s-2}\lambda _i\mathbf {2}^{\mathbf{i}}=\mathbf {0}\), and the result holds. \(\square \)

Lemma 7

Let \(\mathcal {H}=\mathcal {H}^{t_1,\dots ,t_s}\) be the \(\mathbb {Z}_{2^s}\)-additive Hadamard code of type \((n; t_1,\)\(\dots , t_s)\). Let \(\mathbf {w}_i\) be the \(i\hbox {th}\) row of \(A^{t_1,\dots ,t_s}\) and \(\tau =\sum _{i=1}^st_i\). Let \(\mathcal {M}=\lbrace \mathbf {v}=\sum _{i=2}^{\tau -t_s}\lambda _i\mathbf {w}_i:\lambda _i\in \mathbb {Z}_{2^s},\,{\text {ord}}(\mathbf {v})>2\rbrace \), \(\mathcal {N}=\{ \sum _{i=\sigma -1}^{s-2}\lambda _i\mathbf {2}^{\mathbf{i}} : \lambda _i\in \mathbb {Z}_2 \}\setminus \{\sum _{i=\sigma -1}^{s-2}\mathbf {2}^{\mathbf{i}}\}\) if \(\sigma \le s-1\) and \(\mathcal {M}+\mathcal {N}=\{\mathbf {v}_\mathcal {M}+\mathbf {v}_\mathcal {N}:\mathbf {v}_\mathcal {M}\in \mathcal {M}\cup \{{\mathbf {0}}\},\mathbf {v}_\mathcal {N}\in \mathcal {N}\}\). Then, \({\varPhi }( \mathcal {M+N})\cap K({\varPhi }(\mathcal {H}))=\{{\mathbf {0}}\}\).

Proof

Let \(H={\varPhi }(\mathcal {H})\), which has length \(N=2^t=n\cdot 2^{s-1}\). By Lemma 6, we already know that \({\varPhi }(\mathcal {N})\cap K(H)=\{\mathbf {0}\}\). Now, we prove that \({\varPhi }(\mathcal {M})\cap K(H)=\emptyset \).

Let \(\mathbf{v}=\sum _{i=2}^{\tau -t_s}\lambda _i\mathbf{w}_i \in \mathcal {M}\). Since \({\text {ord}}(\mathbf {v})>2\) and \({\text {ord}}(\mathbf {w}_i)\le 2^{s+1-\sigma }\), \({\text {ord}}(\mathbf{v})=2^{p}\) for some \(2\le p\le s+1-\sigma \). By the iterative construction (2) of \(A^{t_1,\dots ,t_s}\), we know that all the elements of \(\mathbb {Z}_{2^s}\) of order equal to or less than \(2^{p}\) appear as a coordinate of \(\mathbf {v}\). Moreover, exactly half of the coordinates of \(\mathbf{v}\) are of order \(2^{p}\). We consider two cases depending on the value of p.

First, we consider that \(2<p\le s+1-\sigma \). We have that \({\varPhi }(\mathbf{v})+{\varPhi }(\mathbf {2}^{\mathbf{s}-\mathbf{p}})={\varPhi }(\mathbf{v}+\mathbf {2}^{\mathbf{s}-\mathbf{p}}-2^{s-p+1}{} \mathbf{v}^{(s-p)})\) by Corollary 1. As before, it is enough to see that \(2^{s-p+1}{} \mathbf{v}^{(s-p)} \not \in \mathcal {H}\) to prove that \({\varPhi }(\mathbf{v}) \not \in K(H)\). Since half of the coordinates of \(\mathbf{v}\) are of order \(2^{p}\) and the other half are of order less than \(2^p\), we have that half of the coordinates of \(2^{s-p+1}\mathbf{v}^{(s-p)}\) are equal to \(2^{s-p+1}\) and the rest of coordinates are zero. Note that \(2^{s-p+1} \not \in \{0,2^{s-1}\}\) since \(p>2\). Therefore, since \(\mathrm{wt}_H(\phi (2^{s-p+1}))=2^{s-2}\), we have that \(\mathrm{wt}_H({\varPhi }( 2^{s-p+1}{} \mathbf{v}^{(s-p)}))= n/2 \cdot 2^{s-2}=2^{t-2}=N/4\) and hence \({\varPhi }(\mathbf {v}) \not \in K(H)\).

Next, we consider that \(p=2\), that is, \({\text {ord}}(\mathbf {v})=4\). Then, \({\text {ord}}(\lambda _i\mathbf {w}_i)=4\) or \(\lambda _i=0\) for all \(i\in \{2,\dots ,\tau -t_s\}\). By Proposition 1, \({\varPhi }(\mathbf {v})+{\varPhi }(2^{s-\sigma -1}\mathbf {w}_2)={\varPhi }(\mathbf {v}+2^{s-\sigma -1}\mathbf {w}_2-2(\mathbf {v}\odot 2^{s-\sigma -1}\mathbf {w}_2))\). Again, it is enough to see that \(2(\mathbf {v}\odot 2^{s-\sigma -1}\mathbf {w}_2)\not \in \mathcal {H}\) to show that \({\varPhi }(\mathbf {v})\not \in K(H)\). Note that \(2^{s-\sigma -1}\mathbf {w}_2\) is a \(2^{t-s-1}\)-fold replication of \(\mathbf{b}_1=(0,2^{s-2},2^{s-1},3\cdot 2^{s-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 \(\lambda _i\mathbf{w}_i\) contains the same value in its 4 coordinates, for all \(i\in \lbrace 3,\dots ,\tau -t_s\rbrace \).

If \(\lambda _2=0\), then every block of \(\mathbf{v}\) also contains the same value in its 4 coordinates. Thus, every block in \(2(\mathbf {v}\odot 2^{s-\sigma -1}\mathbf {w}_2)\) is of the form \(2(\mathbf {k}\odot \mathbf{b}_1)\) for some \(k\in \{0,2^{s-2},2^{s-1},3\cdot 2^{s-2}\}\). We have that

$$\begin{aligned} 2(\mathbf {k}\odot \mathbf{b}_1)=\left\{ \begin{array}{lll} (0,0,0,0) &{}\quad \text {if }k\in \{0,2^{s-1}\}\\ (0,2^{s-1},0,2^{s-1}) &{}\quad \text {if }k\in \{2^{s-2},3\cdot 2^{s-2}\}.\\ \end{array}\right. \end{aligned}$$

By construction, note that \(\mathbf {v}\) contains the same number of blocks \(\mathbf {k}\) for each \(k\in \{0,2^{s-2},2^{s-1},3\cdot 2^{s-2}\}\). Then, it is easy to see that \(\mathrm{wt}_H({\varPhi }(2(\mathbf {v}\odot 2^{s-\sigma -1}\mathbf {w}_2)))=\mathrm{wt}_H(\phi (2^{s-1}))\cdot 4 \cdot n/16=2^{s-1}\cdot n/4=2^{t-2}=N/4\), so \({\varPhi }(\mathbf {v})\not \in K(H)\) in this case.

Otherwise, if \(\lambda _2\not =0\), then every block of \(\mathbf {v}\) is of the form \(\mathbf{b}_i+\mathbf {k}\), for some \(i\in \{1,2\}\) and \(k\in \{0,2^{s-2},2^{s-1},3\cdot 2^{s-2}\}\), where \(\mathbf{b}_1=(0,2^{s-2},2^{s-1},3\cdot 2^{s-2})\) and \(\mathbf{b}_2=(0,3\cdot 2^{s-2},2^{s-1},2^{s-2})\). Then, we have that

$$\begin{aligned} 2((\mathbf{b}_i+\mathbf {k})\odot \mathbf{b}_1)=\left\{ \begin{array}{ll} (0,0,0,0) &{}\quad \text {if }k\in \{2^{s-2},3\cdot 2^{s-2}\}\\ (0,2^{s-1},0,2^{s-1}) &{}\quad \text {if }k\in \{0,2^{s-1}\},\\ \end{array}\right. \end{aligned}$$

for \(i\in \{1,2\}\). Again, by construction, \(\mathbf {v}\) contains the same number of blocks \(\mathbf{b}_i+\mathbf {k}\) for each \(k\in \{0,2^{s-2},2^{s-1},3\cdot 2^{s-2}\}\). Therefore, as before, \(\mathrm{wt}_H({\varPhi }(2(\mathbf {v}\odot 2^{s-\sigma -1}\mathbf {w}_2)))=N/4\), and \({\varPhi }(\mathbf {v})\not \in K(H)\). We have just shown that \({\varPhi }(\mathcal {M})\cap K(H)=\emptyset \).

Now, we prove that \({\varPhi }(\mathcal {M+N})\cap K(H)=\{{\mathbf {0}}\}\). Let \(\mathbf {v}=\mathbf {v}_\mathcal {M}+\mathbf {v}_\mathcal {N} \in \mathcal {M+N}\backslash \{{\mathbf {0}}\} \), where \(\mathbf {v}_\mathcal {M}\in \mathcal {M}\) and \(\mathbf {v}_\mathcal {N}\in \mathcal {N}\). We just proved that \({\varPhi }(\mathbf {v}) \not \in K(H)\) if \(\mathbf {v}_\mathcal {M}={\mathbf {0}}\) or \(\mathbf {v}_\mathcal {N}={\mathbf {0}}\). Therefore, we can assume that \(\mathbf {v}_\mathcal {M}\not ={\mathbf {0}}\) and \(\mathbf {v}_\mathcal {N}\not ={\mathbf {0}}\).

We know that \(\mathbf {v}_\mathcal {N}=(v,\dots ,v)\). Let \([v_0,v_1,\dots ,v_{s-1}]_2\) be the binary expansion of v. Let \(v_{\mathcal {N}_1}\) and \(v_{\mathcal {N}_2}\) be the elements of \(\mathbb {Z}_{2^s}\) having binary expansion \([0,\dots ,0,v_{s-p},\dots ,v_{s-1}]_2\) and \([v_{0},\dots ,v_{s-p-1},0,\dots ,0]_2\), respectively. Then, \(\mathbf {v}_\mathcal {N}=\mathbf {v}_{\mathcal {N}_1}+\mathbf {v}_{\mathcal {N}_2}\), where \( \mathbf {v}_{\mathcal {N}_i} = (v_{\mathcal {N}_i}, \ldots , v_{\mathcal {N}_i})\) for \(i \in \{1,2\}\). Since \({\text {ord}}(\mathbf {v}_\mathcal {M})=2^p\) with \(2\le p\le s+1-\sigma \), the binary expansion of each one of its coordinates is of the form \([0,\dots ,0,(v_{\mathcal {M}})_{s-p},\dots ,(v_{\mathcal {M}})_{s-1}]_2\). Note that we also have that \({\text {ord}}(\mathbf {v}_{\mathcal {N}_1}) \le {\text {ord}}(\mathbf {v}_\mathcal {M})\) by construction.

On the one hand, we consider \(2< p\le s+1-\sigma \). It is easy to see that \(2(\mathbf {v}_{\mathcal {N}_2}\odot \mathbf {2}^{\mathbf{s}-\mathbf{p}})={\mathbf {0}}\). Therefore, \(\mathrm{wt}_H({\varPhi }(2(\mathbf {v}\odot \mathbf {2}^{\mathbf{s}-\mathbf{p}})))=\mathrm{wt}_H({\varPhi }(2((\mathbf {v}_{{\mathcal {M}}}+\mathbf {v}_{\mathcal {N}_1})\odot \mathbf {2}^{\mathbf{s}-\mathbf{p}})))\). Since \({\text {ord}}(\mathbf {v}_{\mathcal {N}_1}) \le {\text {ord}}(\mathbf {v}_\mathcal {M})\), it is easy to see that there exists a permutation of coordinates \(\pi \) such that \(\pi (\mathbf {v}_{{\mathcal {M}}}+\mathbf {v}_{\mathcal {N}_1} )= \mathbf {v}_{{\mathcal {M}}}\). Thus, \( \mathrm{wt}_H({\varPhi }(2((\mathbf {v}_{{\mathcal {M}}}+\mathbf {v}_{\mathcal {N}_1})\odot \mathbf {2}^{\mathbf{s}-\mathbf{p}}))) =\mathrm{wt}_H({\varPhi }(2(\mathbf {v}_{{\mathcal {M}}}\odot \mathbf {2}^{\mathbf{s}-\mathbf{p}})))\) and the result holds by using the same arguments as above.

On the other hand, we consider that \(p=2\). Note that \({\text {ord}}(\mathbf {v}_\mathcal {M})=4\), and then \({\text {ord}}(\mathbf {v}_{\mathcal {N}_1})=4\). It is easy to see that \(2(\mathbf {v}_{\mathcal {N}_2}\odot 2^{s-\sigma -1}\mathbf {w}_2)={\mathbf {0}}\), hence we have that \(\mathrm{wt}_H({\varPhi }(2(\mathbf {v}\odot 2^{s-\sigma -1}\mathbf {w}_{\mathbf{2}})))=\mathrm{wt}_H({\varPhi }(2((\mathbf {v}_{{\mathcal {M}}}+\mathbf {v}_{\mathcal {N}_1})\odot 2^{s-\sigma -1} \mathbf {w}_{\mathbf{2}})))\). Recall that \(2^{s-\sigma -1}\mathbf {w}_2\) is the \(2^{t-s-1}\)-fold replication of \(\mathbf {b}_1\). Taking into account that \(\mathbf {v}_\mathcal {M}=\sum _{i=2}^{\tau -t_s}\lambda _i\mathbf{w}_i\), note that the blocks of \(\mathbf {v}_{{\mathcal {M}}}+\mathbf {v}_{\mathcal {N}_1}\) are of the form \(\mathbf {k}\) for some \(k\in \{0,2^{s-2},2^{s-1},3\cdot 2^{s-2}\}\) if \(\lambda _2=0\); or \(\mathbf {b}_i+\mathbf {k}\) for some \(k\in \{0,2^{s-2},2^{s-1},3\cdot 2^{s-2}\}\) and \(i\in \{1,2\}\) if \(\lambda _2\not =0\). Therefore, the proof is analogous to the above one to show that \({\varPhi }(\mathbf {v})\not \in K(H)\) with \(\mathbf {v}\in \mathcal {M}\). Then, the result holds. \(\square \)

Theorem 3

Let \(\mathcal {H}=\mathcal {H}^{t_1,\dots ,t_s}\) be the \(\mathbb {Z}_{2^s}\)-additive Hadamard code of type \((n; t_1,\)\(\dots , t_s)\) such that \({\varPhi }(\mathcal {H})\) is nonlinear. Let \(\mathcal {H}_b\) be the subcode of \(\mathcal {H}\) which contains all the codewords of order two. Let \(P=\lbrace \mathbf {2}^{\mathbf{p}}\rbrace _{p=0}^{\sigma -2}\) if \(\sigma \ge 2\), and \(P=\emptyset \) if \(\sigma =1\). Then,

$$\begin{aligned} \left\langle {\varPhi }(\mathcal {H}_b),{\varPhi }(P), {\varPhi }\left( \sum _{i=0}^{s-2}\mathbf {2}^{\mathbf{i}}\right) \right\rangle = K({\varPhi }(\mathcal {H})) \end{aligned}$$

and \(\text {ker}({\varPhi }(\mathcal {H}))=\sigma +\sum _{i=1}^{s}t_i\).

Proof

The result follows by Proposition 4 and Lemma 7. \(\square \)

Corollary 5

Let \(\mathcal {H}=\mathcal {H}^{t_1,\dots ,t_s}\) be the \(\mathbb {Z}_{2^s}\)-additive Hadamard code of type \((n; t_1,\)\(\dots , t_s)\) such that \({\varPhi }(\mathcal {H})\) is nonlinear. Let \(\mathbf {w}_i\) be the ith row of \(A^{t_1,\dots ,t_s}\) and \(\tau =\sum _{i=1}^st_i\). Let \(Q=\lbrace ({\text {ord}}(\mathbf {w}_q)/2)\mathbf {w}_q\rbrace _{q=0}^{\tau }\) and \(P=\lbrace \mathbf {2}^{\mathbf{p}}\rbrace _{p=0}^{\sigma -2}\) if \(\sigma \ge 2\), and \(P=\emptyset \) if \(\sigma =1\). Then, \(\{ {\varPhi }(Q), {\varPhi }(P), {\varPhi }(\sum _{i=0}^{s-2}\mathbf {2}^{\mathbf{i}}) \}\) is a basis of \(K({\varPhi }(\mathcal {H}))\).

Example 6

Let \(H^{2,0,0}\) be the \(\mathbb {Z}_8\)-linear Hadamard code considered in Example 4. By Theorem 3, we have that \(\text {ker}(H^{2,0,0})=3\). Moreover, we can construct \(K(H^{2,0,0})\) from a basis, by Corollary 5. First, we have that \(Q=\{ \mathbf {4},(0,4,0,4,0,4,0,4)\}\). Since \(\sigma =1\), in this case, we have that \(P=\emptyset \). Thus,

$$\begin{aligned} K(H^{2,0,0})=\langle {\varPhi }(\mathbf {4}),{\varPhi }((0,4,0,4,0,4,0,4)),{\varPhi }(\mathbf {3})\rangle . \end{aligned}$$

5 Classification of \(\mathbb {Z}_{2^s}\)-linear Hadamard codes

The classification of the \(\mathbb {Z}_4\)-linear Hadamard codes of length \(2^t\), for any \(t\ge 3\), using the rank or the dimension of the kernel is shown in [13, 18]. In this section, we show that the dimension of the kernel can not be used to establish a complete classification of the \(\mathbb {Z}_{2^s}\)-linear Hadamard codes of length \(2^t\), in general, for any \(t\ge 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\ge 3\), only the \(\mathbb {Z}_4\)-linear Hadamard codes \(H^{1,t_2}\) and \(H^{2,t_2}\) of length \(2^t\) are linear [13], so these are equivalent to the Reed-Muller code RM(1, t). By Theorem 2, for any \(t\ge 3\) and \(s>2\), there are also at most two \(\mathbb {Z}_{2^s}\)-linear Hadamard codes of length \(2^t\), \(H^{1,0,\dots ,0,1,t_s}\) and \(H^{1,0,\dots ,0,t_s}\), that are linear. Moreover, the following result implies that we can focus on \(t\ge 5\) and \(2\le s \le t-2\) to try to classify the nonlinear ones.

Theorem 4

Let \({{\mathcal {A}}}_{t,s}\) be the number of nonequivalent \(\mathbb {Z}_{2^s}\)-linear Hadamard codes of length \(2^t\). Then,

$$\begin{aligned} {{\mathcal {A}}}_{t,s}=\left\{ \begin{array}{ll} 0 &{}\quad \text {if } t\ge 3 \text { and } s \ge t+2\\ 1 &{}\quad \text {if } t\ge 3 \text { and } s \in \{t-1,t,t+1\}\\ 1 &{}\quad \text {if } t=4 \text { and } s=2,\\ \end{array}\right. \end{aligned}$$

and the \(\mathbb {Z}_{2^s}\)-linear Hadamard code is linear when \({{\mathcal {A}}}_{t,s}=1\). Moreover, if \(t\ge 5\) and \(2\le s \le t-2\), then \({{\mathcal {A}}}_{t,s} \ge 2\), and there is one which is linear and at least one which is nonlinear.

Proof

First, if \(t\ge 3\) and \(s \ge t+2\), then the equation

$$\begin{aligned} t=\left( \sum _{i=1}^{s}(s-i+1)\cdot t_i\right) -1, \end{aligned}$$
(6)

with \(t_1\ge 1\), does not have any nonnegative integer solution, so \({{\mathcal {A}}}_{t,s}=0\). If \(t\ge 3\) and \(s=t+1\), then (6) has only one solution \((t_1,\ldots ,t_s)=(1,0,\ldots ,0)\). If \(t\ge 3\) and \(s=t\), (6) has only the solution \((1,0,\ldots ,0,1)\). If \(t\ge 3\) and \(s=t-1\), (6) has exactly two solutions \((1,0,\ldots ,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 2, for all the above solutions, we obtain a linear code \(H^{t_1,\ldots ,t_s}\).

Finally, if \(t\ge 5\) and \(2\le s \le t-2\), (6) always has the solutions \((1,0,\ldots ,0,t-s+1)\) and \((1,0,\ldots ,0,1,t-s-1)\), which give a linear code. However, for these cases, there is at least another solution. On one hand, if \(s=2\), \({{\mathcal {A}}}_{t,s}=\lfloor (t-1)/2\rfloor \ge 2\) since \(t\ge 5\) [13]. On the other hand, if \(s=3\), \((2,0,\ldots ,0,t-2s+1)\) is a solution since \(t\ge 2s-1\) when \(t\ge 5\); and if \(s\ge 4\), \((1,0,\ldots ,0,1,0,t-s-2)\) is a solution. Therefore, for all the cases, \({{\mathcal {A}}}_{t,s}\ge 2\) by Theorem 2. \(\square \)

The following example shows that the dimension of the kernel can not be used, in general, to classify completely all nonlinear \(\mathbb {Z}_{2^s}\)-linear Hadamard codes of length \(2^t\), once \(t\ge 5\) and \(2 < s \le t-2\) are fixed.

Example 7

The \(\mathbb {Z}_8\)-linear Hadamard codes of length \(2^t=256\) (\(t=8\)) 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 2. The remaining ones have kernels of dimension 7, 6, 6, 5 and 4, respectively, by Theorem 3. 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 \(\text {rank}(H^{1,3,0})=12\) and \(\text {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 \(\mathbb {Z}_8\)-linear Hadamard codes of length 256.

As shown in the next example, for some values of \(t\ge 5\) and \(2< s \le 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\ge 5\) and \(s=2\) [13].

Example 8

By Theorem 3, it is possible to check that for any \(5\le t \le 7\) and \(2\le s\le t-2\), all nonlinear \(\mathbb {Z}_{2^s}\)-linear Hadamard codes of length \(2^t\) 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\in \{3\}\), \(s\in \{3,4\}\), \(s\in \{3,4,5\}\) and \(s\in \{3,4,5,6\}\), respectively. For these given values of t and s, we can just obtain a partial classification by using the kernel.

Table 1 Rank and kernel for all nonlinear \(\mathbb {Z}_{2^s}\)-linear Hadamard codes of length \(2^t\)

By using Magma, we have also computed the rank of the nonlinear \(\mathbb {Z}_{2^s}\)-linear Hadamard codes of length \(2^t\), for any \(5\le t\le 11\) and \(2 \le s \le t-2\). Tables 1 and 3 show the values of \((t_1,\ldots ,t_s)\) and the pair (rk), where r is the rank and k the dimension of the kernel, for all nonlinear \(\mathbb {Z}_{2^s}\)-linear Hadamard codes of length \(2^t\), for \(5\le t\le 11\). Note that the results given in Examples 7 and 8 can also be checked by looking at these tables. These tables also show that all nonlinear \(\mathbb {Z}_{2^s}\)-linear Hadamard codes of length \(2^t\) have different values of the rank, once \(5\le t\le 11\) and \(2 \le s \le t-2\) are fixed. Therefore, for these cases, as in Example 7, 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.

Theorem 5

Let \({{\mathcal {A}}}_{t,s}\) be the number of nonequivalent \(\mathbb {Z}_{2^s}\)-linear Hadamard codes of length \(2^t\). Then, for any \(t \ge 3\) and \(2 \le s \le t-1\),

$$\begin{aligned} {{\mathcal {A}}}_{t,s} \le \left| \left\{ (t_1,\ldots ,t_s)\in {\mathbb {N}}^s : t=\left( \sum _{i=1}^{s}(s-i+1)\cdot t_i \right) -1, \ t_1\ge 1 \right\} \right| -1. \end{aligned}$$

Moreover, for any \(3 \le t \le 11\) and \(2 \le s \le t-1\), this bound is tight.

Proof

Straightforward from Theorem 2, the proof of Theorem 4, and Tables 1 and 3. \(\square \)

By Theorems 4 and 5 (or Tables 1 and 3), we can obtain exactly the number of nonequivalent \(\mathbb {Z}_{2^s}\)-linear Hadamard codes of length \(2^t\), for some values of t and s. Table 2 shows these numbers, for \(3 \le t \le 11\) and \(2 \le s \le 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.

Table 2 Number \({{\mathcal {A}}}_{t,s}\) of nonequivalent \(\mathbb {Z}_{2^s}\)-linear Hadamard codes of length \(2^t\)
Table 3 Rank and Kernel for all nonlinear \(\mathbb {Z}_{2^s}\)-linear Hadamard codes of length \(2^t\)

The values of \({{\mathcal {A}}}_{t,2}\) given in Table 2 where already proved in [13]. Specifically, in that paper, it is shown that there are \(\lfloor \frac{t-1}{2}\rfloor \) nonequivalent \(\mathbb {Z}_4\)-linear Hadamard codes of length \(2^t\) for all \(t\ge 3\). Next, we focus on establishing some relationships between the already known \(\mathbb {Z}_{2^s}\)-linear Hadamard codes with \(s=2\) and the ones with \(s>2\), once only the length \(2^t\) is fixed. First, Example 9 shows that there are \(\mathbb {Z}_{2^s}\)-linear Hadamard codes, with \(s>2\), which are not equivalent to any \(\mathbb {Z}_4\)-linear Hadamard code. Then, Example 10 also shows that there are \(\mathbb {Z}_4\)-linear Hadamard codes which are not equivalent to any \(\mathbb {Z}_{2^s}\)-linear Hadamard codes with \(s>2\).

Example 9

Let \(H^{2,0,0}\) be the \(\mathbb {Z}_8\)-linear Hadamard code of length 32 considered in Examples 4 and 6. Recall that \(\text {ker}(H^{2,0,0})=3\) by Theorem 3, and hence \(H^{2,0,0}\) is nonlinear. It is known that there are three \(\mathbb {Z}_4\)-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 \(\text {ker}(H^{3,0})=4\) by Theorem 3 or [13]. Hence, there is no \(\mathbb {Z}_4\)-linear Hadamard code equivalent to the \(\mathbb {Z}_8\)-linear Hadamard code \(H^{2,0,0}\).

Example 10

By Table 1, for \(t=5\), there are only two nonlinear \(\mathbb {Z}_{2^s}\)-linear Hadamard codes, \(H^{3,0}\) and \(H^{2,0,0}\). In Example 9, 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 3, for \(t=7\), \(t=9\) and \(t=11\), there are \(\mathbb {Z}_4\)-linear Hadamard codes, \(H^{4,0}\), \(H^{5,0}\) and \(H^{6,0}\), respectively, which are not equivalent to any \(\mathbb {Z}_{2^s}\)-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 \(\mathbb {Z}_2\mathbb {Z}_4\)-linear Hadamard codes, which came from the image of a generalized Gray map of subgroups of \(\mathbb {Z}_2^\alpha \times \mathbb {Z}_4^\beta \). Note that if \(\alpha =0\), they correspond to \(\mathbb {Z}_4\)-linear Hadamard codes. More information on \(\mathbb {Z}_2\mathbb {Z}_4\)-linear codes in general can be found in [5]. The classification of \(\mathbb {Z}_2\mathbb {Z}_4\)-linear Hadamard codes of length \(2^t\) with \(\alpha \not =0\) is given in [18], where it is shown that there are \(\lfloor \frac{t}{2} \rfloor \) nonequivalent of such codes, for all \(t\ge 3\); and either the rank or the dimension of the kernel can be used to classify them, like for \(\mathbb {Z}_4\)-linear Hadamard codes. Recall that there are \(\lfloor \frac{t-1}{2}\rfloor \) nonequivalent \(\mathbb {Z}_4\)-linear Hadamard codes of length \(2^t\) for all \(t\ge 3\) [13]. However, in [15], it is shown that each \(\mathbb {Z}_2\mathbb {Z}_4\)-linear Hadamard code with \(\alpha =0\), that is, each \(\mathbb {Z}_4\)-linear Hadamard code, is equivalent to a \(\mathbb {Z}_2 \mathbb {Z}_4\)-linear Hadamard code with \(\alpha \not =0\), so there are only \(\lfloor \frac{t}{2} \rfloor \) nonequivalent \(\mathbb {Z}_2\mathbb {Z}_4\)-linear Hadamard codes of length \(2^t\).

The following example shows that there are \(\mathbb {Z}_2\mathbb {Z}_4\)-linear Hadamard codes (with \(\alpha \not =0\)) which are not equivalent to any \(\mathbb {Z}_{2^s}\)-linear Hadamard codes with \(s\ge 2\).

Example 11

For \(t=4\), there is a \(\mathbb {Z}_2\mathbb {Z}_4\)-linear Hadamard code (with \(\alpha \not =0\)) which is not equivalent to any \(\mathbb {Z}_4\)-linear Hadamard code [15]. This code has parameters \((r,k)=(6,3)\) [18], so it is not equivalent to any \(\mathbb {Z}_{2^s}\)-linear Hadamard code with \(s\ge 2\), since all of them are linear by Theorem 4. Other examples like this one can be found when t is even. For example, for \(t=6\), 8 and 10, there is also a \(\mathbb {Z}_2\mathbb {Z}_4\)-linear Hadamard code (with \(\alpha \not =0\)) which is not equivalent to any \(\mathbb {Z}_4\)-linear Hadamard code [15]. They have parameters (10, 4), (15, 5) and (21, 6) [18], respectively, so again they are not equivalent to any \(\mathbb {Z}_{2^s}\)-linear Hadamard code with \(s\ge 2\) of length \(2^6\), \(2^8\) and \(2^{10}\), respectively, by Tables 1 and 3.

Finally, we focus on establishing how many nonequivalent \(\mathbb {Z}_{2^s}\)-linear Hadamard codes of length \(2^t\) there are, once only the length \(2^t\) is fixed for some values of t. First, we give some lower and upper bounds. From Tables 1 and 3, 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. Note that there are codes having the same dimension of the kernel with different ranks (for \(t=7,8,9,10,11\)), and codes having the same rank with different dimensions of the kernel (for \(t=9,10,11\)). These results are summarized in Table 4, where we give these bounds for all \(3\le t \le 11\).

An upper bound can be given easily by considering all nonequivalent \(\mathbb {Z}_{2^s}\)-linear Hadamard codes of length \(2^t\), once t and s are fixed, as it is shown in the next theorem. These values for all \(3\le t \le 11\) are also shown in Table 4.

Table 4 Bounds for the number \({{\mathcal {A}}}_{t}\) of nonequivalent \(\mathbb {Z}_{2^s}\)-linear Hadamard codes of length \(2^t\)

Theorem 6

Let \({{\mathcal {A}}}_{t,s}\) be the number of nonequivalent \(\mathbb {Z}_{2^s}\)-linear Hadamard codes of length \(2^t\). Let \({{\mathcal {A}}}_{t}\) be the number of nonequivalent \(\mathbb {Z}_{2^s}\)-linear Hadamard codes of length \(2^t\), for any \(s\ge 2\). Then, \({{\mathcal {A}}}_{t} \le \sum _{s=2}^{t-2} ({{\mathcal {A}}}_{t,s}-1) +1\).

Theorem 7

There are exactly 1,1,3, 3 and 6 nonequivalent \(\mathbb {Z}_{2^s}\)-linear Hadamard codes of length \(2^t\) 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 4 coincides. By using Magma, it is possible to check that, for \(t=6\), both \(\mathbb {Z}_{2^s}\)-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 4. Similarly, for \(t=7\), it is also possible to check that the codes having the same parameters (rk) are all equivalent, so the upper bound became equal to the lower bound 6, and the result also holds. \(\square \)

6 Conclusions

The kernel of \(\mathbb {Z}_{2^s}\)-linear Hadamard codes of length \(2^t\) 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 7 and 8 show that, only for some values of t and s, we can use the dimension of the kernel to distinguish between nonequivalent \(\mathbb {Z}_{2^s}\)-linear Hadamard codes of length \(2^t\). 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.

We have also considered that only the length \(2^t\) is fixed. Examples 10 and 11 seem to point out that for any t odd (t even), there is exactly one \(\mathbb {Z}_4\)-linear Hadamard code (\(\mathbb {Z}_2\mathbb {Z}_4\)-linear Hadamard code with \(\alpha \not =0\)) of length \(2^t\) which is not equivalent to any \(\mathbb {Z}_{2^s}\)-linear Hadamard code with \(s>2\); and the others \(\mathbb {Z}_4\)-linear Hadamard codes (\(\mathbb {Z}_2\mathbb {Z}_4\)-linear Hadamard codes with \(\alpha \not =0\)) of the same length are equivalent to a \(\mathbb {Z}_8\)-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 \(\mathbb {Z}_{2^s}\)-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 \(\mathbb {Z}_{2^s}\)-linear Hadamard codes of length \(2^t\), when both t and s are fixed, and when just t is fixed; denoted by \({{\mathcal {A}}}_{t,s}\) and \({{\mathcal {A}}}_{t}\), 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].