Ranks and Kernels of Codes from Generalized Hadamard Matrices

The ranks and kernels of generalized Hadamard matrices are studied. It is proven that any generalized Hadamard matrix $H(q,\lambda)$ over $F_q$, $q>3$, or $q=3$ and $\gcd(3,\lambda)\not =1$, generates a self-orthogonal code. This result puts a natural upper bound on the rank of the generalized Hadamard matrices. Lower and upper bounds are given for the dimension of the kernel of the corresponding generalized Hadamard codes. For specific ranks and dimensions of the kernel within these bounds, generalized Hadamard codes are constructed.


I. Introduction
Let F q = GF(q) denote the finite field with q elements, where q = p e , p prime. Let F n q be the vector space of dimension n over F q . The Hamming distance between vectors w, v ∈ F n q , denoted by d(w, v), is the number of coordinates in which w and v differ. A code C over F q of length n is a nonempty subset of F n q . The elements of C are called codewords. A code C over F q is called linear if it is a linear space over F q and, it is called K-additive if it is a linear space over a subfield K ⊂ F q .
The dimension of a K-additive code C over F q is defined as the number k such that q k = |C|. Note that k is not necessarily an integer, but ke is an integer, where q = |K| e . The minimum distance of a code is the smallest Hamming distance between any pair of distinct codewords. Two codes C 1 , C 2 ⊂ F n q are said to be permutation equivalent if there exists a permutation σ of the n coordinates such that C 2 = {σ(c 1 , c 2 , . . . , c n ) = (c σ −1 (1) , . . . , c σ −1 (n) ) : (c 1 , c 2 , . . . , c n ) ∈ C 1 }, [3], [10]. Without loss of generality, we shall assume, unless stated otherwise, that the all-zero vector, denoted by 0, is in C.
Two structural parameters of (nonlinear) codes are the dimension of the linear span and the kernel. The linear span of a code C over F q , denoted by R(C), is the subspace over F q spanned by C, that is R(C) = C . The dimension of R(C) is called the rank of C and is denoted by rank(C). If q = p e , p prime, we can also define R p (C) and rank p (C) as the subspace over F p spanned by C and its dimension, respectively.
The kernel of a code C over F q , denoted by K(C), is defined as K(C) = {x ∈ F n q : αx + C = C for all α ∈ F q }. If q = p e , p prime, we can also define the p-kernel of C as K p (C) = {x ∈ F n q : x + C = C}. Since we assume that 0 ∈ C, then K(C) is a linear subcode of C and K p (C) is an F p -additive subcode.
We denote the dimension of the kernel and p-kernel of C by ker(C) and ker p (C), respectively. These concepts were first defined in [15] for codes over F q , generalizing the binary case described previously in [2], [14]. In [15], it was proved that the code C over F q can be written as the union of cosets of K(C) (resp. K p (C)), and K(C) (resp. K p (C)) is the largest such linear code over F q (resp. F p ) for which this is true. Moreover, it is clear that K(C) ⊆ K p (C).
A generalized Hadamard (GH) matrix H(q, λ) = (h ij ) of order n = qλ over F q is a qλ × qλ matrix with entries from F q with the property that for every i, j, 1 ≤ i < j ≤ qλ, each of the multisets {h is − h js : 1 ≤ s ≤ qλ} contains every element of F q exactly λ times. It is known that since (F q , +) is an abelian group then H(q, λ) T is also a GH matrix, where H(q, λ) T denotes the transpose of H(q, λ) [9].
An ordinary Hadamard matrix of order 4µ corresponds to a GH matrix H(2, λ) over F 2 , where λ = 2µ.
Two GH matrices H 1 and H 2 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 F q to all the coordinates in a row or in a column. 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 Hadamard matrix H, we denote by F H the code over F q consisting of the rows of H, and C H the one defined as To check whether two GH matrices are equivalent is known to be an NP-hard problem. However, we can use the invariants related to the linear span and kernel of the corresponding GH codes in order to help in their classification, since if two GH codes have different ranks or dimensions of the kernel, the GH matrices are nonequivalent. Lemma 1.1: Let H be a GH matrix over F q . Then rank(C H ) = rank(F H )+1 and ker(C H ) = ker(F H )+

1.
Proof: It is straightforward from the definitions.
In this paper, we shall only study GH codes over a finite field because of the following proposition.

Proposition 1.2:
Let H be a GH matrix over a ring R that is not a field. Then K(F H ) is trivial.

Proof:
If v is a row of H and v ∈ K(F H ), then αv must be in F H for all α in the ring. If α is a non-unit, αv cannot have, as coordinates, every element of R λ times and so αv is not in F H . Hence the kernel is trivial.
The rank and dimension of the kernel for ordinary Hadamard codes over F 2 have been studied in [16], [17], [18]. Specifically, lower and upper bounds for these two parameters were established, and the construction of an Hadamard code for all allowable ranks and dimensions of the kernel between these bounds was also given.
In this paper, we present a generalization of the above results. The paper is organized as follows. In Section II, we give the implications for the rank and kernel for the standard Kronecker sum construction.
In Section III, we find lower and upper bounds for the dimension of the kernel of a GH code, constructing examples for some specific values in this interval. In Section IV, we establish an upper bound for the rank, by proving that the GH codes are self-orthogonal unless q = 3 and gcd(λ, q) = 1. Finally, in Section V, we give some conclusions and discuss further avenues of research on this topic.

II. Kronecker sum construction
A standard method to construct GH matrices from other GH matrices is given by the Kronecker sum construction [13], [21]. That is, if H(q, λ) = (h ij ) is any qλ × qλ GH matrix over F q , and B 1 , B 2 , . . . , B qλ are any qµ × qµ GH matrices over F q , then the matrix in Table I gives a q 2 λµ × q 2 λµ GH matrix over Let S q be the normalized GH matrix H(q, 1) given by the multiplicative table of F q . As for ordinary Hadamard matrices over F 2 , starting from a GH matrix S 1 = S q , we can recursively define S t as a GH matrix H(q, q t−1 ), constructed as S t = S q ⊕ [S t−1 , S t−1 , . . . , S t−1 ] = S q ⊕ S t−1 for t > 1, which is called a Sylvester GH matrix.
it is easy to see that all row vectors in H = H 1 ⊕H 2 are linearly generated by v i ⊕0 and 0⊕w j . Moreover, since the two vectors v i ⊕ 0 and 0 ⊕ w j are linearly independent for any v i = 0 and w j = 0, we have that rank(F H ) = rank(F H1 ) + rank(F H2 ). By Lemma 1.1, rank(C H ) = rank(F H ) + 1 = rank(F H1 ) + rank(F H2 ) + 1 = rank(C H1 ) + rank(C H2 ) − 1.
For the kernel, we have that v i ⊕ w j ∈ K(F H ) if and only if v i ∈ K(F H1 ) and w j ∈ K(F H2 ). Hence, the vectors v i ⊕ 0 and 0 ⊕ w j , where v i ∈ K(F H1 ) and w j ∈ K(F H2 ), linearly generate K(F H ) and so, ker(F H ) = ker(F H1 ) + ker(F H2 ). Finally, the result follows by Lemma 1.1. Proof: It follows directly from Lemma 2.1 and the fact that C Sq is a linear code of dimension 2, which means that rank(C Sq ) = ker(C Sq ) = 2.

Proposition 2.3:
Let H 1 and H 2 be two GH matrices over F q with H = H 1 ⊕ H 2 . Let K be a subfield of F q . If C H1 and C H2 are K-additive, then C H is also K-additive and dim K ( Proof: It is straightforward using the same argument as in the proof of Lemma 2.1.
Proof: The row vectors in a GH matrix are linearly generated by some of its rows. Let v i be the ith generator row of H 1 . Using the same argument as in the proof of Lemma 2.1, we see that the vectors v i ⊕0 and 0 ⊕ w jk linearly generate H, where w jk is the jth generator row of B k . Hence, we can conclude that Proof: It is straightforward from Lemma 2.4 and the fact that C Sq is a linear code of dimension 2.
Proof: Note that the row vectors in S q are linearly generated by one of its rows, for instance e. Hence, the rows in S q can be described by e i = ω i e, where ω is a primitive element in to any other B s for s = i, we can conclude that when e k ⊕ b jk ∈ K(F H ) we have that e k = 0 and Finally, as the all-one vector 1 belongs to all the kernels K(C Bi ), for i ∈ {1, 2, . . . , q}, and also to K(C H ), we obtain the statement.

III. Kernel dimension of GH codes
In [16], it was proved that the Hadamard codes obtained from Hadamard matrices H(2, , and a construction of binary Hadamard codes of length n = 2 t , with t ≥ 4, for each one of these values was given. In [17], this result was Moreover, by the properties of the kernel, since F H can be written as the union of cosets of K p (F H ), we   Moreover, they have a trivial intersection.
Proof: Recall that S q is the matrix given by the multiplicative table of F q and let S ′ q be the matrix S q after a transposition of the second and third column. The entries of both matrices are elements from (1) , . . ., ω (q−2) be the elements 0, 1, ω, . . . , ω q−2 repeated λ times, respectively, where ω is a primite element in F q .

Proposition 3.4:
For q > 2, there exists a GH matrix H(q, q) over F q such that the GH code C H of length n = q 2 over F q has ker(C H ) = 2.
Proof: A GH matrix H(q, q) over F q such that ker(C H ) = 2 can be obtained by using a switching construction. This kind of construction has already been used for Hadamard matrices over F 2 in [16], [17]. Let K be the linear subcode of S 2 = S q ⊕ S q generated by the q + 1 row vector v, that is, To prove that H is a GH matrix, we just need to show that the multisets {v s − w s : 1 ≤ s ≤ q 2 }, for w ∈ S 2 \(K + x) and v ∈ K + x + e, contains every element of F q exactly q times. We have that It is clear that k ′′ + x ′′ ∈ S 2 and each element of F q appears once in each block of q coordinates. Adding e to k ′′ + x ′′ , we just change the order of the elements in the second block of q coordinates, so H fulfills the condition to be a GH matrix.
We have seen that the statement is true for any q > 3 and h = 2; and for q = 3 and h ∈ {2, 3}. Finally, by induction we will prove the result for any h ≥ 2. Suppose it is true for n = q h−1 , that is, there exists a GH code C Hi of length q h−1 with kernel of dimension i for all i ∈ {1, . . . , h}. By Corollary 2.2, the Proof: If ker(C H ) > 1, then ker(F H ) ≥ 1 by Lemma 1.1. We can assume without loss of generality that v = (0, 1, ω (1) , . . . , ω (q−2) ) ∈ K(F H ). We consider all n = q h s coordinate positions divided into q blocks of size λ = q h−1 s, such that the coordinates of v in each block coincide.
β be the number of times an element β ∈ F q appears in the coordinates of the ith block of x. Since x ∈ F H , we have that for all α ∈ F q . Adding these q equations, we obtain Since x + ω j v ∈ F H , we have that for all α ∈ F q and j ∈ {0, . . . , q − 2}. For a fixed j ∈ {0, . . . , q − 2}, adding the q equations, we obtain The size of each block is λ, so we also have that for all i ∈ {1, . . . , q}, and adding these q equations, we obtain the same relation as in Equation (3). From these q(q + 1) equations, given by Equations (2), (4), and (5), we have seen that there are q which are linear dependent, and the rest are linear independent. The fact that they are linear independent is easily seen by writing the equations in matrix form. The system of equations has a unique solution η (i) α = λ/q for all α ∈ F q and i ∈ {1, . . . , q}, which means that λ has to be a multiple of q, so h ≥ 2. in K(C) except v which coincides with 1. Using the same argument as in the proof of Lemma 3.7, it is easy to see that C is a GH code. By using the induction hypothesis k − 1 ≤ h − 1, so k ≤ h.

IV. Rank of GH codes
In [16], it was proved that the Hadamard codes obtained from Hadamard matrices H(2, 2 t−1 ) over F 2 , with t ≥ 3, have ranks r ∈ {t + 1, . . . , n/2}, and a construction of binary Hadamard codes of length n = 2 t for each one of these values was given. In [17], it was shown that if there exists a binary Hadamard code of length 4s, s = 1 odd, which always has rank n − 1 [1], then there exist binary Hadamard codes of length n = 2 t s for all t ≥ 3, with rank r for all r ∈ {4s + t − 3, . . . , n/2}.
In this section, we give an upper bound for the rank proving that any GH matrix H(q, λ) over F q with q > 2 is self-orthogonal, except q = 3 and gcd(λ, 3) = 1. Moreover, for some particular cases, we specify lower and upper bounds on the rank, once the dimension of the kernel is given. Finally, GH codes having all different ranks between these bounds are constructed for some of these cases.
For vectors over F q , q = p e and p prime, we have the Euclidean inner product. Namely [v, w] = n i=1 v i w i for any v, w ∈ F n q . If C is a code over F q of length n, then we define the Euclidean orthogonal code as C ⊥ = {v : [v, w] = 0 for all w ∈ C}. Note that C ⊥ is always linear over F q whether C is or not.
In fact, if C is a nonlinear code, then C ⊥ = C ⊥ . Moreover, we say that C is Euclidean self-orthogonal Proof: The sum of the elements of F q , q = p e and p prime, is 0. Indeed, the elements of the finite field F q are the roots of the polynomial x q − x and the sum of all these roots is the coefficient of x q−1 , which is zero (except for q = 2). Then, since each row vector v in H has all the elements in F q repeated λ times, we have, for q = 2, that [1, v] = λ0 = 0 in F q for all rows v in H. When q = 2, since λ is always even, we also obtain [1, v Let H(q, λ) be a normalized GH matrix over F q . Then (1, 0, . . . , 0)

Example 4.5:
The unique normalized GH matrix S 3 = H(3, 1) over F 3 , given by the multiplicative table of F 3 , has rank(C H ) = 2. Consider the normalized GH matrix H(3, 2) over F 3 , given by (6). It is easy to verify that there is an unique normalized GH matrix H(3, 2) over F 3 , up to equivalence. In this case, rank(F H ) = 4, so rank(C H ) = 5.
There is also an unique normalized GH matrix H(3, 4) over F 3 , up to equivalence [4], which has rank(C H ) =

11.
Note that the GH matrices from the previous two examples generate codes that are not self-orthogonal.
However, there are many others GH matrices such that they do lead to self-orthogonal codes. For example, it is known that the Hadamard matrices H(2, 2µ) over F 2 generate self-orthogonal codes when µ is even [1]. Moreover, in [8], it is shown by computer that the code generated by any GH matrix H(4, 4) over What we do next is to show that any GH matrix H(q, λ) over F q , with q > 3, or q = 3 and gcd(3, λ) = 1, generates a self-orthogonal code.

Lemma 4.7:
Let p be an odd prime. If p e > 3, then x∈F p e x 2 ≡ 0 (mod 2p). If p e = 3, then x∈F3 x 2 ≡ 2 (mod 3). Proof: For p e = 3 the result is straightforward. For p e > 3, let a ∈ F p e such that a 2 = 0, 1. As long as p e > 3 this is easily done. Then This gives that x∈F p e x 2 = 0 in F p e . Now split the nonzero elements of F p e into two disjoint sets A and B such that x ∈ A if and only if −x ∈ B. Since p = 2, the elements a and −a are always distinct. Then x∈A x 2 = x∈B x 2 and x∈F p e x 2 = x∈A x 2 + x∈B x 2 . This gives that 2 x∈A x 2 = 0 and so x∈A x 2 = 0 in F p e . Then we have that  We can now prove our desired result. Then, we have For p e = 3 and λ a multiple of 3 we have Proof: First note that when q = 3 and h = 1, the GH matrix H(3, 1) is unique up to equivalence, and generates a linear code C H , so r = k = h + 1 = 2.
For all other cases, we can use the following argument. We know that K(C H ) is the largest linear subspace in C H such that C H can be written as the union of cosets of K(C H ). Since there are q h+1−k cosets in C H , and r is maximum when each coset contributes an independent vector, we have that r ≤ k + q h+1−k − 1. This same argument was used in [16], [17] for binary Hadamard codes and in [20]  having rank(C H ) ∈ {3, 4, 5, 6, 7, 8} [8]. Moreover, the number of such GH matrices with respect to the pair (rank(C H ), ker(C H )) is given by Table II. From this table, it is easy to see that the bounds on rank(C H ), once ker(C H ) is given, satisfy Proposition 4.12.
Corollary 4.14: Let H(q, q h−1 ) be a GH matrix over F q with q > 2 and h ≥ 1. If C H is self-dual, then q is even and ker(C H ) = 1.
Proof: If C H is self-dual, then rank(C H ) = n/2. Since n/2 must be an integer, q must be even. Therefore, the result follows from Proposition 4.12.  Proof: We will see that the corresponding GH matrices H(q, q h−1 ) can be generated by using a switching construction. Let S h be the Sylvester GH matrix H(q, q h−1 ). We can assume without loss of generality that Note that all n = q h coordinates are naturally divided into q k−1 groups of size q h−k+1 , which will be referred to as blocks, such that the columns of K in a block coincide.
The rows of S h can be partitioned into q h−k+1 cosets of K. We can take any coset K + x 1 ⊂ S h such that x 1 ∈ S h \K and construct a matrix H as H = S h \(K + x 1 ) ∪ (K + x 1 + e 1 ), where e 1 is the vector of length n = q h with ones in the positions given by the second block and zeros elsewhere.
Clearly, rank(F H ) = h + 1 and K ⊆ K(F H ). Moreover, it is easy to prove that K = K(F H ). Therefore, Again, it is clear that rank(C H ) = h + 1 + s and ker(C H ) = k. To prove that H is a GH matrix, we can use the same argument as in the proof of Proposition 3.4.

V. Conclusions
We have established lower and upper bounds for the dimension of the kernel and rank of codes constructed from GH matrices over F q . For some cases, we proved that these bounds are tight, by constructing GH matrices for each possible rank, once the dimension of the kernel is given. Further research on this topic would include giving the construction of a GH matrix H(q, λ) over F q for each possible pair (rank(C H ), ker(C H )) or providing similar results for the parameters p-rank and p-kernel of these codes. Another direction of future research could be to focus on the rank and kernel of F p -additive GH codes, which are the ones having the p-rank equal to the p-kernel, or in a more general way, study K-additive GH codes, where K is a subfield of F q . July 1, 2015 DRAFT