arXiv:2610.28306cs.ITOct 2026Cited by 1 paper on PaperVantage

Manuscript Offprint

arXiv:2610.28306

Nonequivalence of ZpZp2\mathbb{Z}_p\mathbb{Z}_{p^2}-linear and Zps\mathbb{Z}_{p^s}-linear generalized Hadamard codes for odd primes

Dipak K. Bhunia

Abstract

The ZpZp2\mathbb{Z}_p\mathbb{Z}_{p^2}-additive codes are subgroups of Zpα1×Zp2α2\mathbb{Z}_p^{\alpha_1} \times \mathbb{Z}_{p^2}^{\alpha_2}, and they can be seen as linear codes over Zp\mathbb{Z}_p when α2=0\alpha_2 = 0, as Zp2\mathbb{Z}_{p^2}-additive codes when α1=0\alpha_1 = 0, and as Z2Z4\mathbb{Z}_2\mathbb{Z}_4-additive codes when p=2p = 2. A ZpZp2\mathbb{Z}_p\mathbb{Z}_{p^2}-linear generalized Hadamard (GH) code is a GH code over Zp\mathbb{Z}_p which is the Gray map image of a ZpZp2\mathbb{Z}_p\mathbb{Z}_{p^2}-additive code. For every prime pp, there are recursive constructions of ZpZp2\mathbb{Z}_p\mathbb{Z}_{p^2}-linear GH codes Hpt1,t2H_p^{t_1,t_2} with α1≠0\alpha_1 \neq 0 and α2≠0\alpha_2 \neq 0, and of Zps\mathbb{Z}_{p^s}-linear GH codes Hˉpt1,…,ts\bar{H}_p^{t_1,\ldots,t_s}. We show that the kernel blocks of a nonlinear code Hpt1,t2H_p^{t_1,t_2} give equivalent punctured codes, and that these punctured codes are linear. Any of them is called the derived code of Hpt1,t2H_p^{t_1,t_2}. We also determine the ranks of the codes Hpt1,t2H_p^{t_1,t_2} and Hˉpt1,t2\bar{H}_p^{t_1,t_2}. For odd pp, the rank of Hpt1,t2H_p^{t_1,t_2} depends on the Bernoulli numbers modulo pp. By comparing the derived codes and the ranks, we show that, for odd pp, no code Hpt1,t2H_p^{t_1,t_2} is equivalent to any of these Zps\mathbb{Z}_{p^s}-linear GH codes. For p=2p = 2, a nonlinear code H2t1,t2H_2^{t_1,t_2} is equivalent to a Z2s\mathbb{Z}_{2^s}-linear Hadamard code if and only if t2≥2t_2 \geq 2. Finally, we count the nonequivalent codes in the union of both families.

Keywords: Generalized Hadamard code, ZpZp2\mathbb{Z}_p\mathbb{Z}_{p^2}-linear code, Zps\mathbb{Z}_{p^s}-linear code, Gray map, kernel, rank, kernel block, derived code, equivalence, classification, Bernoulli number.

2020 Mathematics Subject Classification: 94B25, 94B60.

1 Introduction

Let Zps\mathbb{Z}_{p^s} be the ring of integers modulo psp^s with pp prime and s≥1s \geq 1. The set of nn-tuples over Zps\mathbb{Z}_{p^s} is denoted by Zpsn\mathbb{Z}_{p^s}^n, and its elements are called vectors. We denote the entries of a vector by the same letter with subscripts, in normal font when the vector is written in bold. For instance, x=(x1,…,xn)\mathbf{x} = (x_1, \ldots, x_n) and y=(y1,…,yn)y = (y_1, \ldots, y_n). A code over Zp\mathbb{Z}_p of length NN is a nonempty subset of ZpN\mathbb{Z}_p^N, and it is linear if it is a subspace of ZpN\mathbb{Z}_p^N. The Hamming distance between two vectors of ZpN\mathbb{Z}_p^N is the number of coordinates in which they differ. The minimum distance of a code over Zp\mathbb{Z}_p is the smallest Hamming distance between two different codewords. A Zps\mathbb{Z}_{p^s}-additive code is a subgroup of Zpsn\mathbb{Z}_{p^s}^n, and a ZpZp2\mathbb{Z}_p\mathbb{Z}_{p^2}-additive code is a subgroup of Zpα1×Zp2α2\mathbb{Z}_p^{\alpha_1} \times \mathbb{Z}_{p^2}^{\alpha_2}. A ZpZp2\mathbb{Z}_p\mathbb{Z}_{p^2}-additive code is a linear code over Zp\mathbb{Z}_p when α2=0\alpha_2 = 0, a Zp2\mathbb{Z}_{p^2}-additive code when α1=0\alpha_1 = 0, and a Z2Z4\mathbb{Z}_2\mathbb{Z}_4-additive code when p=2p = 2. A Zps\mathbb{Z}_{p^s}-additive code C⊆Zpsn\mathcal{C} \subseteq \mathbb{Z}_{p^s}^n is isomorphic, as an abelian group, to

Zpst1×Zps−1t2×⋯×Zpts\mathbb{Z}_{p^{s}}^{t_{1}}\times\mathbb{Z}_{p^{s}-1}^{t_{2}}\times\cdots\times\mathbb{Z}_{p}^{t_{s}}

for unique nonnegative integers t1,…,tst_1, \ldots, t_s, and we say that C\mathcal{C} is of type (n;t1,…,ts)(n; t_1, \ldots, t_s). Similarly, a ZpZp2\mathbb{Z}_p\mathbb{Z}_{p^2}-additive code C⊆Zpα1×Zp2α2\mathcal{C} \subseteq \mathbb{Z}_p^{\alpha_1} \times \mathbb{Z}_{p^2}^{\alpha_2} is isomorphic to Zp2t1×Zpt2\mathbb{Z}_{p^2}^{t_1} \times \mathbb{Z}_p^{t_2} for unique nonnegative integers

*This work has been granted by the Juan de la Cierva 2024 grant (JDC2024-053082-I), funded by Ministerio de Ciencia, Innovación y Universidades (MICIU/AEI/10.13039/501100011033) and co-funded by the European Social Fund Plus (FSE+).

t1t_1 and t2t_2, and we say that C\mathcal{C} is of type (α1,α2;t1,t2)(\alpha_1, \alpha_2; t_1, t_2). Then, ∣C∣=p2t1+t2|\mathcal{C}| = p^{2t_1 + t_2}. The Gray map from Zps\mathbb{Z}_{p^s} to Zpps−1\mathbb{Z}_p^{p^{s-1}} considered in [7, 8, 9, 10] is recalled in Section 2. It is given in [18], and, for p=2p = 2, it is Carlet's Gray map [13]. It is also a particular case of the Gray maps given in [28]. The Gray map transforms Zps\mathbb{Z}_{p^s}-additive codes and ZpZp2\mathbb{Z}_p\mathbb{Z}_{p^2}-additive codes into codes over Zp\mathbb{Z}_p, which are called Zps\mathbb{Z}_{p^s}-linear codes and ZpZp2\mathbb{Z}_p\mathbb{Z}_{p^2}-linear codes, respectively. We say that they have the same type as the corresponding additive codes.

We denote by 0\mathbf{0} and 1\mathbf{1} the all-zero and the all-one vectors, and by eke_k the vector whose kkth entry is 1 and whose other entries are 0. The length of these vectors is always clear from the context. Let SN\mathcal{S}_N be the symmetric group of permutations on {1,…,N}\{1, \ldots, N\}, and let Zp∗=Zp∖{0}\mathbb{Z}_p^* = \mathbb{Z}_p \setminus \{0\}. For π∈SN\pi \in \mathcal{S}_N and a=(a1,…,aN)∈(Zp∗)N\mathbf{a} = (a_1, \ldots, a_N) \in (\mathbb{Z}_p^*)^N, we define the monomial map μπ,a\mu_{\pi, \mathbf{a}} of ZpN\mathbb{Z}_p^N by μπ,a(x)π(i)=aixi\mu_{\pi, \mathbf{a}}(\mathbf{x})_{\pi(i)} = a_i x_i for 1≤i≤N1 \leq i \leq N. Thus, the entry of x\mathbf{x} at the position ii is multiplied by aia_i and moved to the position π(i)\pi(i). When a=1\mathbf{a} = \mathbf{1}, we simply write π\pi for μπ,1\mu_{\pi, \mathbf{1}}. Two codes C1C_1 and C2C_2 over Zp\mathbb{Z}_p of length NN are said to be equivalent if there are a vector y∈ZpN\mathbf{y} \in \mathbb{Z}_p^N and a monomial map μ\mu such that

C2={y+μ(x):x∈C1}.C_{2}=\{\mathbf{y}+\mu(\mathbf{x}):\mathbf{x}\in C_{1}\}.

They are said to be permutation equivalent if moreover y=0\mathbf{y} = \mathbf{0} and μ\mu is a permutation. In [8, 9, 10], two codes are called equivalent when they differ by a monomial map, and in [7, 16] when they differ by a translation and a permutation. Both notions are particular cases of the one above. Therefore, the nonequivalence results of this paper hold for each of them.

The rank of a code CC over Zp\mathbb{Z}_p, denoted by rank⁡(C)\operatorname{rank}(C), is the dimension of its linear span ⟨C⟩\langle C \rangle. Following [3, 25], the kernel of CC is

K(C)={x∈ZpN:x+C=C},\mathrm{K}(C)=\{\mathbf{x}\in\mathbb{Z}_{p}^{N}:\mathbf{x}+C=C\},

and its dimension is denoted by ker⁡(C)\ker(C). If 0∈C\mathbf{0} \in C, then K(C)\mathrm{K}(C) is a linear subcode of CC. If CC is linear, then K(C)=C=⟨C⟩\mathrm{K}(C) = C = \langle C \rangle. Two equivalent codes containing 0\mathbf{0} have the same rank and the same dimension of the kernel [4]. Hence, these parameters can be used to distinguish between nonequivalent codes.

A generalized Hadamard (GH) matrix H(p,λ)=(hij)H(p, \lambda) = (h_{ij}) of order pλp\lambda over Zp\mathbb{Z}_p is a pλ×pλp\lambda \times p\lambda matrix with entries from Zp\mathbb{Z}_p with the following property [20]. For every ii and jj with 1≤i<j≤pλ1 \leq i < j \leq p\lambda, the multiset {hik−hjk:1≤k≤pλ}\{h_{ik} - h_{jk} : 1 \leq k \leq p\lambda\} contains every element of Zp\mathbb{Z}_p exactly λ\lambda times. Two GH matrices are equivalent if one of them can be obtained from the other by permuting rows and columns, and by adding the same element of Zp\mathbb{Z}_p to all the entries of a row or of a column. Hence, every GH matrix is equivalent to a normalized one, that is, to one whose first row and first column contain only zeros. If HH is a normalized GH matrix and FHF_H is the set of its rows, then the code

CH=⋃ν∈Zp(FH+ν1)C_{H}=\bigcup_{\nu\in\mathbb{Z}_{p}}(F_{H}+\nu\mathbf{1})

is called a generalized Hadamard (GH) code over Zp\mathbb{Z}_p [14]. A GH code over Zp\mathbb{Z}_p of length NN has pNpN codewords and minimum distance (p−1)N/p(p-1)N/p [14]. Thus, any two different codewords of a GH code over Zp\mathbb{Z}_p differ in at least a proportion (p−1)/p(p-1)/p of the coordinates. A Zps\mathbb{Z}_{p^s}-linear code which is a GH code is called a Zps\mathbb{Z}_{p^s}-linear GH code, and similarly for ZpZp2\mathbb{Z}_p\mathbb{Z}_{p^2}-linear codes. For p=2p=2, GH codes are the usual binary Hadamard codes, and the Z2s\mathbb{Z}_{2^s}-linear and Z2Z4\mathbb{Z}_2\mathbb{Z}_4-linear GH codes are called Z2s\mathbb{Z}_{2^s}-linear and Z2Z4\mathbb{Z}_2\mathbb{Z}_4-linear Hadamard codes.

For p=2p = 2 and t≥3t \geq 3, the Z2Z4\mathbb{Z}_2\mathbb{Z}_4-linear Hadamard codes of length 2t2^t with α1=0\alpha_1 = 0 and with α1≠0\alpha_1 \neq 0 are classified in [21, 26]. There are ⌊(t−1)/2⌋\lfloor(t-1)/2\rfloor and ⌊t/2⌋\lfloor t/2\rfloor nonequivalent such codes, respectively. Moreover, every Z4\mathbb{Z}_4-linear Hadamard code is equivalent to a Z2Z4\mathbb{Z}_2\mathbb{Z}_4-linear Hadamard code with α1≠0\alpha_1 \neq 0 [23]. Hence, for every even t≥4t \geq 4, the codes of exactly one of the ⌊t/2⌋\lfloor t/2\rfloor classes of the latter codes are not equivalent to any Z4\mathbb{Z}_4-linear Hadamard code. In [16], it is shown that, for even tt with 4≤t≤104 \leq t \leq 10, these codes are not equivalent to any Z2s\mathbb{Z}_{2^s}-linear Hadamard code either. The same statement for every even t≥12t \geq 12 is proposed there as further research. The

Z2s\mathbb{Z}_{2s}-linear Hadamard codes are also studied in [15, 17]. The Z2Z4Z8\mathbb{Z}_{2}\mathbb{Z}_{4}\mathbb{Z}_{8}-linear Hadamard codes are studied in [5, 6, 11, 12]. In [6], it is shown that no nonlinear Z2Z4Z8\mathbb{Z}_{2}\mathbb{Z}_{4}\mathbb{Z}_{8}-linear Hadamard code is equivalent to a Z4\mathbb{Z}_{4}-linear, a Z2Z4\mathbb{Z}_{2}\mathbb{Z}_{4}-linear or a Z2s\mathbb{Z}_{2s}-linear Hadamard code of the same length.

For any prime pp, a recursive construction of Zps\mathbb{Z}_{p^{s}}-linear GH codes Hˉpt1,…,ts\bar{H}_{p}^{t_{1},\ldots,t_{s}} of length ptp^{t}, where t+1=∑i=1s(s−i+1)tit+1=\sum_{i=1}^{s}(s-i+1)t_{i}, is given in [9, 15]. For p=2p=2, every Z2s\mathbb{Z}_{2^{s}}-linear Hadamard code is equivalent to one of these codes [15, 22]. For odd pp, it is not known whether the same holds. As in [4, 7, 9], by the Zps\mathbb{Z}_{p^{s}}-linear GH codes of length ptp^{t} we mean the codes Hˉpt1,…,ts\bar{H}_{p}^{t_{1},\ldots,t_{s}} of length ptp^{t}, with s≥1s\geq1. Their linearity and their kernel are determined in [15, 21, 26] for p=2p=2, and in [9] for odd pp. Some equivalences among them are given in [7, 16], and their full classification, for every prime pp, is obtained in [4].

As in [8, 10], we focus on the ZpZp2\mathbb{Z}_p\mathbb{Z}_{p^2}-linear GH codes with α1≠0\alpha_1 \neq 0 and α2≠0\alpha_2 \neq 0, since the codes with α1=0\alpha_1 = 0 are Zp2\mathbb{Z}_{p^2}-linear codes, and those with α2=0\alpha_2 = 0 are linear codes over Zp\mathbb{Z}_p. A recursive construction of such codes Hpt1,t2H_p^{t_1,t_2} of type (α1,α2;t1,t2)(\alpha_1, \alpha_2; t_1, t_2), with t1,t2≥1t_1, t_2 \geq 1, is given in [8]. Their length is ptp^t with t=2t1+t2−1t = 2t_1 + t_2 - 1. For p=2p = 2, they are the Z2Z4\mathbb{Z}_2\mathbb{Z}_4-linear Hadamard codes with α1≠0\alpha_1 \neq 0 given in [26, 27]. It is also shown in [8] that several other recursive constructions give permutation equivalent codes. For odd pp, it is proved in [10] that the codes Hpt1,t2H_p^{t_1,t_2} are nonlinear, and that the dimension of the kernel of Hpt1,t2H_p^{t_1,t_2} is t1+t2t_1 + t_2. Hence, there are exactly ⌊t/2⌋\lfloor t/2 \rfloor nonequivalent such codes of length ptp^t. It is also shown in [10] that, for odd pp, the codes Hp1,t−1H_p^{1,t-1} and Hp2,t−3H_p^{2,t-3} are not equivalent to any Zps\mathbb{Z}_{p^s}-linear GH code of the same length. For p=3p = 3 and 2≤t≤82 \leq t \leq 8, the values of the rank and the dimension of the kernel show that no code H3t1,t2H_3^{t_1,t_2} of length 3t3^t is equivalent to a Z3s\mathbb{Z}_{3^s}-linear GH code [8, 10]. Proving this for every odd prime pp and every length was proposed in [8, 10] as further research.

In this paper, we solve this problem, and we also study the case p=2p = 2. Our main tool is the derived code introduced in [4]. Let CC be a code over Zp\mathbb{Z}_p containing the all-zero vector. Two coordinates of CC lie in the same kernel block when the vectors of the kernel of CC which vanish at one of them are exactly those which vanish at the other one. When the codes obtained by puncturing CC outside its kernel blocks are pairwise equivalent, any of them is called the derived code of CC. It is an equivalence invariant. For p=2p = 2, the ranks of these punctured codes form the kernel-block rank profile used in [5, 6]. Every nonlinear Zps\mathbb{Z}_{p^s}-linear GH code is equivalent to a code Hˉpu1,…,ur\bar{H}_p^{u_1,\ldots,u_r} with r≥2r \geq 2 and u1≥2u_1 \geq 2 [4]. For odd pp, the derived code of this code is Hˉpu1,…,ur−2,ur−1+1\bar{H}_p^{u_1,\ldots,u_{r-2},u_{r-1}+1}, and it is linear only when r=2r = 2.

We show that every kernel block of a nonlinear code Hpt1,t2H_p^{t_1,t_2} has pt1p^{t_1} coordinates, and that the derived code of Hpt1,t2H_p^{t_1,t_2} is the linear GH code Hˉpt1+1\bar{H}_p^{t_1+1}. For odd pp, it follows that, if Hpt1,t2H_p^{t_1,t_2} were equivalent to a Zps\mathbb{Z}_{p^s}-linear GH code, then we would have t1≥2t_1 \geq 2, and Hpt1,t2H_p^{t_1,t_2} would be equivalent to the Zp2\mathbb{Z}_{p^2}-linear GH code Hˉpt1,t2\bar{H}_p^{t_1,t_2}. These two codes have the same length and the same dimension of the kernel. They also have the same number of kernel blocks, of the same size, and the same derived code. Figure 1 shows their kernel blocks for p=3p = 3 and (t1,t2)=(2,1)(t_1, t_2) = (2, 1). In order to separate them, we regard each coordinate of both codes as a function of the coefficients which define the codewords, and we describe these functions by polynomials over Zp\mathbb{Z}_p. In this way, we determine the ranks of Hpt1,t2H_p^{t_1,t_2} and Hˉpt1,t2\bar{H}_p^{t_1,t_2} for every prime pp. We show that the rank of Hˉpt1,t2\bar{H}_p^{t_1,t_2} is smaller than the rank of Hpt1,t2H_p^{t_1,t_2} for every odd prime pp. Therefore, for odd pp, the codes Hpt1,t2H_p^{t_1,t_2} are not equivalent to any Zps\mathbb{Z}_{p^s}-linear GH code. In particular, unlike the binary case [23], no Zp2\mathbb{Z}_{p^2}-linear GH code is equivalent to a code Hpt1,t2H_p^{t_1,t_2}.

The rank of Hpt1,t2H_p^{t_1,t_2} depends on the coefficients of the polynomial over Zp\mathbb{Z}_p, of degree at most p−1p-1, whose value at the residue of x∈{0,…,p−1}x \in \{0, \ldots, p-1\} is the residue of (xp−x)/p(x^p - x)/p modulo pp. For odd pp, we show that the coefficients of the monomials of degree at least 2 are given by Bernoulli numbers modulo pp. Hence, the rank of Hpt1,t2H_p^{t_1,t_2} depends on the even integers mm with 2≤m≤p−32 \leq m \leq p-3 such that pp divides the numerator of the Bernoulli number BmB_m in lowest terms. An odd prime pp is regular if there is no such mm. For regular primes, we obtain a closed formula for the rank of Hpt1,t2H_p^{t_1,t_2}.

For p=2p = 2, the same argument shows that, if a nonlinear code H2t1,t2H_{2}^{t_{1},t_{2}} is equivalent to a Z2s\mathbb{Z}_{2^{s}} linear Hadamard code, then it is equivalent to one of two codes. The first one is the Z4\mathbb{Z}_4-linear Hadamard code Hˉ2t1+1,t2−2\bar{H}_2^{t_1+1,t_2-2}, when t2≥2t_2 \geq 2, and the second one is the Z8\mathbb{Z}_8-linear Hadamard code Hˉ22,t1−3,t2\bar{H}_2^{2,t_1-3,t_2}, when t1≥3t_1 \geq 3. The second code is excluded by the rank, and the first one is equivalent to H2t1,t2H_2^{t_1,t_2} [23]. Hence, a nonlinear code H2t1,t2H_2^{t_1,t_2} is equivalent to a Z2s\mathbb{Z}_{2^s}-linear Hadamard code if and only if t2≥2t_2 \geq 2. This answers the question of [16] for every even t≥4t \geq 4.

Finally, we count the equivalence classes of the union of both families. For odd pp and t≥2t \geq 2, there are exactly P(t+1)−P(t)+⌊t/2⌋\mathcal{P}(t+1) - \mathcal{P}(t) + \lfloor t/2 \rfloor classes, where P(n)\mathcal{P}(n) is the number of partitions of nn. For p=2p = 2 and t≥3t \geq 3, there are exactly P(t+1)−P(t)\mathcal{P}(t+1) - \mathcal{P}(t) classes if tt is even, and P(t+1)−P(t)−1\mathcal{P}(t+1) - \mathcal{P}(t) - 1 classes if tt is odd. Figure 2 shows these classes for t=8t = 8.

The paper is organized as follows. In Section 2, we recall the Gray map and the known results on the codes Hˉpt1,…,ts\bar{H}_p^{t_1,\ldots,t_s} and Hpt1,t2H_p^{t_1,t_2}. In Section 3, we recall the kernel blocks and the derived code from [4], and we determine the kernel blocks and the derived code of the nonlinear codes Hpt1,t2H_p^{t_1,t_2}. In Section 4, we determine the ranks of Hpt1,t2H_p^{t_1,t_2} and Hˉpt1,t2\bar{H}_p^{t_1,t_2} for every prime pp. In Section 5, we prove the main result for odd pp, and we count the nonequivalent codes. In Section 6, we study the case p=2p = 2. Finally, in Section 7, we give some conclusions and further research on this topic.

References (23)