Algebraic structures of MRD Codes

Based on results in finite geometry we prove the existence of MRD codes in (F_q)_(n,n) with minimum distance n which are essentially different from Gabidulin codes. The construction results from algebraic structures which are closely related to those of finite fields. Some of the results may be known to experts, but to our knowledge have never been pointed out explicitly in the literature.


Introduction
Let F q denote a finite field with q elements and let V = (F q ) m,n be the F q -vector space of matrices over F q of type (m, n).On V we define the so-called rank metric distance by d(A, B) = rank(A − B) for A, B ∈ V .Clearly, the distance d is a translation invariant metric on V .A subset C ⊆ V endowed with the metric d is called a rank metric code with minimum distance d(C) = min {d(A, B) | A = B ∈ V }.For m ≥ n, an MRD (maximum rank distance) code C ⊆ V satisfies the following two conditions: (i) |C| = q km and (ii) d(C) = n − k + 1.Note that an MRD code is a rank metric code which is maximal in size given the minimum distance, or in other words it achieves the Singleton bound for the rank metric distance (see [5,8]).
Delsarte was the first who proved in [5] the existence of linear MRD codes for all q, m, n and 1 ≤ k ≤ n.His construction (in the notation of Gabidulin [8]) runs as follows: Let a 1 , . . ., a n ∈ F q m be linearly independent over F q and let C be the F q m -linear code defined by the generator matrix . . .a n a q 1 . . .a q n . . . . . . . . .
, where 1 ≤ k ≤ n.Each code word c ∈ C is a vector in (F q m ) n .If we choose a fixed basis of F q m over F q then c may be regarded as a matrix in V = (F q ) m,n .Thus we obtain an F q -linear code C in V .The code C, which is usually called a Gabidulin code (although first discovered by Delsarte), is an F q -linear MRD code of size q km with minimum distance d = n − k + 1.At this point we may naturally ask: Is there any other MRD code which is essentially different from a Gabidulin code, i.e., which does not allow an isometry to a Gabidulin code.
Definition 1. a) A bijective map ϕ : (F q ) m,n −→ (F q ) m,n is called an isometry if ϕ preserves the rank metric distance, i.e., d(A, B) = d(ϕ(A), ϕ(B)) for all A, B ∈ (F q ) m,n .b) Two codes C and C ′ in (F q ) m,n are equivalent if there exists an isometry ϕ with ϕ(C) = C ′ .If one of the codes is additively closed resp.an F q -vector space, we require in addition that ϕ is additive resp.F q -linear.
In odd characteristic, already in the 1950s of the last century L.-K.Hua has classified all bijective maps ϕ from (F q ) m,n onto itself such that ϕ and ϕ −1 preserve the distance between adjacent matrices, i.e., between all pairs of matrices A, B with rank(A − B) = 1 [11].In even characteristic, this has been done by Z.-X.Wan in the 1960s [24].For isometries the result can be stated as follows (see Theorem 3.4 in [25]): where σ is an automorphism of the field F q acting on the entries of A, or, but only in case m = n, ϕ(A) = X(A t ) σ Y + Z for all A ∈ (F q ) n,n where A t denotes the transpose of A. If ϕ is additive, then obviously Z = 0.In addition σ = id in case ϕ is F q -linear.
In the recent paper [18] Morrison has rediscovered Hua's result in case that ϕ is linear resp.semi-linear.Applications of MRD-Codes to random matrices over finite fields are discussed in [26].
If we specialize the Gabidulin construction to k = 1 and m = n, then a Gabidulin code G is a linear code of dimension n such that A − B is always regular for A = B in G.In particular, all 0 = A ∈ G are regular since the zero matrix is in G.If G is defined by (a 1 , . . ., a n ) ∈ F n q n and we choose a 1 , . . ., a n as an where S denotes the group generated by a Singer cycle S in GL(n, q) which is the matrix defining the multiplication by a primitive element in F q n with respect to the basis B. Finally, observe that S ∪ {0} is isomorphic to the field F q n where the addition and multiplication are the standard ones in the ring of square matrices.In this special case we may already ask whether there are linear MRD codes which are not isomorphic to finite fields.
In what follows we do not insist that everything is new.Many facts may have been proved earlier or are at least folklore in the community of specialists on finite quasifields/semifields/division algebras.However the link between rank metric codes with special parameters and quasifields/semifields/division algebras does not seem to have been pointed out in the existing literature so far.

On the structure of MRD codes with k = 1 and n = m
In this section we connect MRD codes in case k = 1 and m = n with well-known objects in finite geometry.Recall that an MRD code C in (F q ) n,n of minimum distance n is a maximal set of matrices such that det(A − B) = 0 for all A = B in C. Replacing C by the translate C − B = {A − B | A ∈ C} for some fixed B ∈ C we may assume that the zero matrix is an element of C. Hence all matrices in C different from zero are invertible.Replacing C by B −1 C for some B = 0 in C we may further assume that the identity matrix I is an element in C.So far we have changed C by a rank metric distance preserving isometry which is not linear if 0 ∈ C.
Furthermore, since |C| = q n and det A = 0 for all 0 = A ∈ C we see that C \ {0} acts regularly on the non-zero vectors of W = F n q , i.e.C \ {0} acts transitively without fixed points on the non-zero vectors of W .In particular, if we fix a vector 0 = w 0 ∈ W , then for any w ∈ W there exists exactly one A(w) ∈ C such that w 0 A(w) = w.In the following we always take w 0 = e 1 = (1, 0, . . ., 0).Thus the first row of A(w) is equal to w.In particular, we may write where A(0) = 0 and A(e 1 ) = I.The latter follows by the fact that there is a w ∈ W with A(w) = I and det(A(e 1 )−A(w)) = 0 since the first row of A(e 1 ) and A(w) = I coincide.
In finite geometry, such a system of linear maps is called a spreadset in W (see [6,10]), or a spreadset over F q .Note that conversely a spreadset in (F q ) n,n defines an MRD code C in (F q ) n,n with minimum distance n.Spreadsets in W give rise to a multiplication • on W defined by (2) w • w ′ = wA(w ′ ) for w, w ′ ∈ W .With this multiplication and the standard vector addition W carries the structure of a quasifield ([6], section 5.1) which is defined as follows.
Definition 2. a) A set Q with two operations +, • : Q× Q −→ Q is called a (right) quasifield if the following holds.
(i) (Q, +) is an abelian group with neutral element 0 which satisfies 0 the kernel of the quasifield Q. c) A quasifield Q which satisfies also the left distributivity law is called a semifield S. If S is not a field, we say that S is a proper semifield.d) A quasifield with associative multiplication is called a nearfield.In particular, the non-zero elements of a nearfield form a group with respect to •. Definition 3. Let S be a semifield.a) The left, middle and right nucleus of S are defined as follows: Note that the left nucleus of S is just the kernel of S considered as a quasifield.b) The center Z(S) of S is the set For applications in coding theory we may assume and will do so for the rest of this paper that the quasifields, semifields resp.nearfields are always finite.
To continue we recall the following well-known facts which are easy to see.

then S is a division algebra over its center Z(S).
Now let Q be a finite quasifield and let K be a subfield of Ker Q.According to Lemma 1 we have dim K Q = n for some n ∈ N.For a ∈ Q we consider the map is an MRD code in (K) n,n with minimum distance n.Note that C is uniquely determined by Q and the chosen subfield K of Ker Q up to conjugation in GL(n, K).We will always choose the identity e ∈ Q as the first basis vector in a basis of Q over K, hence e = e 1 = (1, 0, . . ., 0).Therefore, the first row in R(a) is equal to a as a vector.
Conversely, let C = {A(w) | w ∈ W } be an MRD code in (K) n,n with minimum distance n as in (1) and let W = W carry the structure of a quasifield defined as in (2).We shall prove that K ∼ = Ke 1 is contained in Ker W. To see that note that (ke 1 )A(w) + (ke 1 )A(w ′ ) = (ke 1 )(A(w) + A(w ′ )) = (ke 1 )A(w + w ′ ) for w, w ′ ∈ W and k ∈ K. Thus which proves the claim.Thus we have proved the following which is essentially already stated in [1,3].
Theorem 2. MRD codes in (K) n,n (containing the zero and identity matrix) with minimum distance n correspond (in the above sense) to finite quasifields If we require that the codes are closed under addition, hence form abelian groups (since they are finite), we get the following.Theorem 3. Additively closed MRD codes in (K) n,n (containing the identity matrix) with minimum distance n correspond (in the above sense) to finite semifields S with K ≤ Ker S and dim K S = n.
Proof.Suppose that S is a finite semifield with K ≤ Ker S and dim Conversely, suppose that Q is a finite quasifield and or in other words, R is additive.Thus The fact that K ≤ Ker S and dim K S = n follows from Theorem 2.
In order to understand linearity of MRD codes over some field F q we need the following result.
Proposition 1.Let S be a finite semifield and K a subfield of S. The following two conditions are equivalent: (1) S is a division algebra over K.
(2) K is a subfield of Z(S).
(by ( 4)) for all k ∈ K and all a, b ∈ S, hence K ⊆ N m .Furthermore, for all k ∈ K and all x, a ∈ S, hence to for all k ∈ K and all x, a ∈ S. The latter means exactly that S is a division algebra over K and the condition K ≤ Z(S) follows by Lemma 1.
According to the above theorems, division algebras, semifields, nearfields or even quasifields deliver new methods to construct MRD codes which are different from Gabidulin codes.Remember that for a Gabidulin code in (F q ) n,n with minimum distance n the corresponding quasifield is a field.

Isotopy and equivalence
As stated in Theorem 4, K-linear MRD codes in (K) n,n with minimum distance n correspond to finite division algebras D over K ≤ Z(D) with dim K D = n.Since non-isomorphic division algebras may lead to equivalent codes we need the following definition.
Definition 4. Let Q and Q ′ be finite quasifields which are left vector spaces over the same field Note that the above definition is not standard.Usually isotopy is only defined over the prime field.Our definition is motivated by Theorem 5 below which states a very precise and nice connection between isotopy classes of division algebras over K and equivalence classes of their corresponding codes.

Example 1.
a) There exist exactly 23 non-isomorphic proper semifields of order 16 which crumble away into two isotopy classes over F 2 (see [15], section 6.2). b) Using MAGMA [2] we computed exactly three equivalence classes of MRD codes in (F 2 ) 4,4 with minimum distance 4. One of these classes represents a Gabidulin code which is associated to the finite field F 16 .The other two classes are represented as follows (without the zero matrix): Code 2: The Codes 2 and 3 correspond naturally to the two non-isotopic semifields of order 16 as the next result shows.Thus these matrices can be obtained easily from the known semifields.
Over the prime field the next result is stated explicitly in ( [17], Proposition 2.1).The reader may also compare Section 1.2 and 1.3 of [16] with the following statement.
Theorem 5. Let C, C ′ ⊆ (K) n,n be K-linear MRD codes with minimum distance n and corresponding division algebras D and D ′ .In particular K ≤ Z(D) and K ≤ Z(D ′ ).Then C and C ′ are linearly equivalent if and only if D ′ is isotopic to D or its transpose D t over K.
Furthermore, if D is the corresponding division algebra where D = W as a Kvector space, then the multiplication on D is given by The transpose D t of D is defined by D t = W as a K-vector space but with multiplication w 1 • w 2 = w 1 A(w 2 ) t .We use the same notation for the second code but with a ′ everywhere.
We first suppose that C and C ′ are equivalent and prove that the corresponding semifields are isotopic over K. Thus by assumption there exist X, Y ∈ GL(n, K) Suppose that ( * ) holds true.This means that for each w ∈ W there exists exactly one w ∈ W such that Let F : W −→ W denote the map wF = w.For w 1 , w 2 ∈ W we obtain Since Y −1 and X are K-linear it remains to show that F is K-linear as well.First note that A(k for k i ∈ F q and w i ∈ W since the first row of A(w) is equal to w and C is a K-vector space.The same holds for A ′ .From this we obtain Applying the inverse of A ′ we get which proves that F is K-linear.Thus the division algebras D and D ′ are isotopic over K.In case ( * * ) the proof runs similar.Now suppose that the corresponding division algebras are isotopic over K. Thus there are K-linear isomorphisms F, G, H : for all w i ∈ W .This implies A(w)H = F A ′ (wG) for w ∈ W or for all w ∈ W . Thus This shows that C and C ′ are equivalent.The case that D is isotopic to the transpose of D ′ is done similarly.
Remark 2. a) The second part of the proof of Theorem 5 shows that an isotopy between two quasifields always leads to equivalent codes.b) One of the anonymous referees of this paper informed us that Proposition 2.1 and Theorem 2.2 of [17] prove the following.Let S and S ′ be finite semifields with corresponding (additively closed) MRD codes C, C ′ ⊆ (K) n,n .Then C and C ′ are equivalent (in the sense of Theorem [11] including automorphisms of K) if and only if S and S ′ are isotopic over the prime field of K.

Symmetric MRD codes
Let E = F q n and let K = F q ≤ E. On E the standard non-degenerate symmetric K-bilinear form • , • is defined by x, y = tr E/K (xy) for x, y ∈ E where tr denotes the trace of E over K.If a is running over all non-trivial elements of E we get non-degenerate symmetric K-bilinear forms of E by x, y a = ax, y .
Taking the corresponding Gram matrices together with the zero matrix we obtain a linear MRD code in (F q ) n,n with minimum distance n consisting of symmetric matrices.This code is equivalent to a Gabidulin code which can be seen as follows.We fix a basis x 1 , . . ., x n of E over K. Let y i = Bx i for i = 1, . . ., n be the dual basis.Then the Gram matrices with respect to the basis x 1 , . . ., x n are of the form A t B −1 where A runs through a Singer subgroup of GL(n, q).
According to [9], the symmetry can be used to correct (symmetric) errors beyond the bound ⌊ d−1 2 ⌋.Definition 5. Let K be a finite field.We call a code C ⊆ (K) n,n symmetric if all matrices A in C are symmetric, i.e., A = A t for all A ∈ C.
for all a, x, y ∈ Q.
Lemma 2. Let Q be a finite quasifield over K ≤ Ker Q and let • , • be an invariant non-degenerate symmetric K-bilinear form on Q.For a ∈ Q we define the form • , • a by x , y a = x • a , y for x, y ∈ Q.Then, for all 0 = a ∈ Q, the form • , • a is K-bilinear, non-degenerate and symmetric.
Proof.One easily checks that • , Let G denote the Gram matrix of • , • with respect to the basis as R(a) is taken where x • a = xR(a).Then • , • a has the Gram matrix R(a) t G which is regular for a = 0. Thus • , • a is non-degenerate for all 0 = a ∈ Q.
Finally, the symmetry follows by x , y a = x • a , y for all x, y, a ∈ Q.
Conversely suppose that the equivalence class of C contains a symmetric code.Thus we may assume that there are regular matrices X and Y such that {XR(a)Y | a ∈ Q} consists of symmetric matrices.(The second type of equivalence in Theorem 1 leads to the same just by taking transpose matrices.)Since R(e) is the identity matrix we have (XY • be the standard symmetric non-degenerate bilinear form on the K-vector space Q.Thus the non-degenerate bilinear form • , • Z defined by Remark 3. a) In finite geometry Theorem 6 can be stated as follows [14]: The translation plane associated to a quasifield Q is symplectic if and only if Q admits a non-degenerate invariant symmetric bilinear form.b) According to ([14], Theorem 4.2), Q admits a non-degenerate invariant symmetric bilinear form over Ker Q if and only if the additive group generated by {(xy)z − x(zy) | x, y, z ∈ Q} is a proper subgroup of (Q, +).c) Symmetric MRD codes have been explicitly constructed by Kai-Uwe Schmidt in [22].

Finite nearfields
Finite nearfields have been classified by Zassenhaus (see [27], or section 5.5.2 in [6]).These are the regular quasifields, usually denoted by N (n, q), and seven exceptional cases.The quasifields N (n, q) exist for all q and n, provided all prime divisors of n divide q − 1 and 4 | n in case q ≡ 3 (mod 4).Note that N (n, q) is not a field if n > 1, and N (1, q) = F q .Moreover, the center of N (n, q) is F q .If C is the MRD code corresponding to N (n, q) for n > 1 then C * = C \ {0} is a nonabelian group of order q n − 1 whereas in the class of Gabidulin codes this group is cyclic of order q n − 1.We demonstrate one of the exceptional cases in the next example.The only semifield of order 27 has the Frobenius map x → x 3 in F 27 as a semifield automorphism and we may use the Gabidulin construction over the semifield to get a rank metric code C ′ .However, up to equivalence we do not get the above code since C ′ contains matrices of rank 1.Note that the rank distribution of C and the corresponding Gabidulin code coincide, consistently with Theorem 5.6 of [5].There are exactly 338 matrices of rank 2 and 390 of rank 3. Furthermore, if we consider the matrices of C as vectors in F 3 27 we obtain an MDS code which is not linear over F 27 in contrast to the corresponding Gabidulin code.
According to Delsarte [5] the duals of the codes G and C are again MRD codes, where the duality is defined by A, B = tr(AB t ) for A, B ∈ (F 3 ) 3,3 .We would like to mention here that both G and C are the duals of the codes arising from the two semifields of order 27.
Proof.b) =⇒ a): This follows from Lemma 1. a) =⇒ b): Since S is a division algebra over K, we have(3) (k • a) • b = k • (a • b) = a • (k • b) for all k ∈ Kand all a, b ∈ S. The first equality implies K ≤ N l (S).Plugging b = e into the equality (k•a)•b = a • (k • b) we get (4) k • a = a • k for all k ∈ K and a ∈ S. Hence K ⊆ {x ∈ S | x • a = a • x for all a ∈ S}.It remains to show that K ⊆ N m ∩ N r .In order to see that note that )) for all k ∈ K and all a, b ∈ S, hence K ⊆ N r .Theorem 4. K-linear MRD codes in (K) n,n (containing the identity matrix) with minimum distance n correspond to finite division algebras D over K where K ≤ Z(D) and dim K D = n.Proof.Let S be a finite semifield with K ≤ Ker S and dim K S = n.Let R : S → (K) n,n be defined as above; i.e. xR(a) = x•a for x, a ∈ S and let C = {R(a) | a ∈ S} be the MRD code corresponding to S. Clearly, if R is K-linear, i.e.R(k•a) = kR(a) for k ∈ K and a ∈ S, then C = {R(a) | a ∈ S} is a K-vector space.Conversely, if C is a K-vector space, then R(k • a) = kR(a) for k ∈ K and a ∈ S since the first row of R(k • a) and kR(a) coincide.The condition kR(a) = R(k • a) for all k ∈ K and all a ∈ S is equivalent to

Theorem 6 .
Let Q be a finite quasifield over the field K ≤ Ker Q and let C = {R(a) | a ∈ Q} be the corresponding MRD code in (K) n,n .Then Q admits an invariant non-degenerate symmetric K-bilinear form if and only if the equivalence class of C contains a symmetric code.Proof.Suppose that Q admits an invariant non-degenerate symmetric K-bilinear form • , • .According to Lemma 2 the K-bilinear forms • , • a are non-degenerate and symmetric for a = 0 with Gram matrices R(a) t G. Furthermore for a = b in Q, the difference of the corresponding Gram matrices

Example 2 . 3 . 6 .Example 3 .
Let Q be the subgroup of GL(2,11) generated by A = 0 One easily checks that Q ∼ = SL(2,5).Furthermore Q acts regularly on the non-zero vectors of V(2,11).Thus C = Q ∪ {0} is an MRD code in (F 11 ) 2,2 .The orders of elements of Q are 1, 2, 3, 4, 5, 6 and 10.Since E + A has order 40, the rank metric code C is not additively closed.MRD codes with k > 1 and n = m Using Magma we see that (F 3 ) 3,3 contains two equivalence classes of linear MRD codes with minimum distance d = n − k + 1 = 2.One of them represents the Gabidulin code G and has the following matrices as a basis.The other class contains a code C which has the following basis.