Further Results on the Classification of MDS Codes

A $q$-ary maximum distance separable (MDS) code $C$ with length $n$, dimension $k$ over an alphabet $\mathcal{A}$ of size $q$ is a set of $q^k$ codewords that are elements of $\mathcal{A}^n$, such that the Hamming distance between two distinct codewords in $C$ is at least $n-k+1$. Sets of mutually orthogonal Latin squares of orders $q\leq 9$, corresponding to two-dimensional \mbox{$q$-}ary MDS codes, and $q$-ary one-error-correcting MDS codes for $q\leq 8$ have been classified in earlier studies. These results are used here to complete the classification of all $7$-ary and $8$-ary MDS codes with $d\geq 3$ using a computer search.


Introduction
A q-ary code C of length n, and size M is a set of M elements, called codewords, of A n , where A is an alphabet of size q. The minimum distance d of a code is the smallest Hamming distance between any two distinct codewords. A code with these parameters is called an (n, M, d) q code. If A is a finite field and C is a vector subspace, then C is called linear. A code that is not linear is called nonlinear. Codes that can be either linear or nonlinear are called unrestricted.
In the unrestricted case, two codes are called equivalent if one can be obtained from the other by a permutation of coordinates followed by permutations of symbols at each coordinate separately. These operations preserve the Hamming distances between codewords. We say that an (n, M, d) q code is unique if all codes with the same parameters are equivalent.
An upper bound for the size of an (n, M, d) q code is the Singleton bound, Codes meeting this bound are called maximum distance separable (MDS), and k = n−d+1 is called the dimension of the MDS code. A q-ary MDS code with length n and dimension k is called an (n, k) q MDS code. MDS codes have the property that, given any k coordinates, each k-tuple of symbols from A occurs in the given coordinates in exactly one codeword. It has been conjectured (the MDS conjecture) that an MDS code with parameters n, k, and prime power q with 1 < k < n − 1 exists if and only if n ≤ q + 1, with the exception that when q is a power of two, MDS codes with n = q + 2, and k = 3 or k = q − 1 exist [21]. The conjecture has been proved for linear codes when q is a prime by Ball [4] and when q is a power of a prime p and k < 2p − 2 by Ball and De Beule [5]. MDS codes with d = 1 or k = 1 are unique and they are called trivial ; the first contains the whole space A n and the latter is a repetition code. The case k = 2 corresponds to sets of mutually orthogonal Latin squares, which have been classified for q ≤ 9 [7]. MDS codes with d = 2, dimension k and alphabet size q correspond to k-dimensional Latin hypercubes of order q. For q = 2, 3, they are trivially unique. Potapov and Krotov [20] give a recursive formula for the number of (k + 1, k) 4 MDS codes but do not classify them up to equivalence. With small k and q, (k + 1, k) q MDS codes have been classified by McKay and Wanless [16].
For q = 2, nontrivial MDS codes with d > 2 do not exist. For q = 3, the only nontrivial MDS code with d > 2 is the unique (4, 2) 3 MDS code. Alderson [1] showed that the (6, 3) 4 and the (5, 3) 4 MDS codes are unique. The nonexistence of pairs of mutually orthogonal Latin squares of order 6 implies the nonexistence of nontrivial 6-ary MDS codes with d ≥ 3. For q = 5, 7 all MDS codes with d ≥ 3, except the (4, 2) 7 codes, are equivalent to linear codes [10]. For q = 5, they are unique, which follows from the uniqueness in terms of the notion of equivalence of linear codes [6]. For q = 7, 8, the MDS codes with d = 3 were classified in [10,11]. For q = 7, some classification results exist for codes with d > 3 in terms of different notions of equivalence for linear codes; see for example [9].
In this work, we classify all 7-ary 8-ary MDS codes with n > 3, d > 3 by a computer search to finish the classification of all 7-ary and 8-ary MDS codes with d ≥ 3. In Section 2, we discuss basic properties of MDS codes and computational tools used in this work. Section 3 explains the computer search used, and the results are given in Section 4. Finally, in Section 5, we discuss the case d = 2 corresponding to Latin hypercubes for small q.

MDS codes
The operations maintaining equivalence of unrestricted codes form a group of order (q!) n n!, denoted by G n , that acts on A n . The stabilizer of a code C under this action is called the automorphism group of the code, Aut(C).
Let C be an (n, k) q MDS code. For a symbol i ∈ A, we denote by C i the (n − 1, k − 1) q MDS code obtained by removing the last coordinate and retaining the codewords that have symbol i in that coordinate, Removing a symbol at a given position of each codeword of C yields an (n − 1, k) q MDS code C ′ . This operation is called puncturing. We say that C is an extension of C ′ . An (n, k) q MDS code C is extendable if there exists an extension of C that is an (n + 1, k) q MDS code. There is a one-toone correspondence between extensions of C (up to the position of the new coordinate) and labeled partitions of C into (n, k −1) q MDS codes: i∈A C i i, where C i i denotes the code obtained by adding the symbol i at the end of each codeword in C i , is an extension of C if and only if the sets C i form a partition of C into (n, k − 1) q MDS codes.
It is known that if a linear code is extendable, it has an extension that is linear [2]. For fixed q and d and sufficiently large n, an extension of a linear MDS code is necessarily equivalent to a linear MDS code [3]. However, very little is known about extending nonlinear codes.

Tools
We reduce the problem of detecting code equivalence to the graph isomorphism problem and use the software nauty [15] for solving the instances. For an (n, M, d) q code C, we define a colored graph as follows: The graph contains n copies of K q , the complete graph of order q, named Γ 1 , Γ 2 , . . . , Γ n , colored with color 1. For each i, the vertices in Γ i correspond to the elements in A. For each codeword c ∈ C, there is an additional vertex, colored with color 2, which is adjacent to the vertex corresponding to the symbol c i in Γ i for each i ∈ {1, 2, . . . , n}. A graph isomorphism preserving the coloring permutes the copies of K q and the vertices in each of them separately, corresponding to a permutation of coordinates and permutations of symbols in each coordinate separately in the code, respectively. Two codes are equivalent if and only if their corresponding graphs are isomorphic. Further, the automorphism group of a code corresponds to the automorphism group of the graph. The software nauty can be used to find the automorphism group of a graph and all isomorphisms between two graphs. For large graphs, we use nauty in the sparse mode with the random Schreier algorithm enabled.
For a finite set X and a family S of subsets of X, an exact cover is a subset S ′ of S that partitions X. We use the library libexact [8] for finding all exact covers, given X and S.
Finally, we use cliquer [17] to find all cliques of given size in a graph.

Generation
Given a set C of equivalence class representatives of (n, k) q MDS codes, every (n + 1, k) q MDS code is equivalent to a code that is an extension of a code in C. This reduces the problem of generating equivalence class representatives of (n + 1, k) q MDS codes to the problem of finding all partitions of all codes in C into (n, k − 1) q MDS codes. For k = 2, this is precisely the method of extending a set of MOLS with a new Latin square by partitioning the Latin squares in the set into common transversals, used for example in [7,13,14,19]; for discussion of this and similar problems, see for example [18]. Consider a partition of an (n, k) q MDS code C into (n, k − 1) q MDS codes Finding all possible partitions of C into (n, k − 1) q MDS codes can now be reduced to finding all possible partitions {C i j } i∈A of C j for each j and combining those partitions in all possible ways. Instead of solving the reduced problem using recursion, our method for finding the partitions of (n, k) q MDS codes uses the results from finding the partitions of (n−1, k −1) q MDS codes. In this work, we generate all q-ary MDS codes with k ≥ 3, d ≥ 4 starting from the MDS codes with k = 2, their partitions, and the codes with d = 3.

Algorithm
As an initial step, we find all partitions of the equivalence class representatives of (n, 2) q MDS codes into (n, 1) q MDS codes in the following way. Let C n be the set of representatives of (n, 2) q MDS codes. For a given n, we loop over allĈ ∈ C n+1 and over all n + 1 punctured codes C ′ ofĈ. Now,Ĉ is an extension of C ′ so it induces a partition of C ′ into (n, 1) q MDS codes. We find the equivalence class representativeĈ ′ ∈ C n for whichĈ ′ ∼ = C ′ and find all g ∈ G n for which gC ′ =Ĉ ′ . Considering how the codewords are mapped by g, we get partitions ofĈ ′ into (n, 1) q MDS codes. All partitions of each element in C n are obtained in this way, as every such partition corresponds to an (n + 1, 2) q MDS code C that is equivalent to someĈ ∈ C n+1 .
The algorithm for finding all partitions of an (n, k) q MDS code C into (n, k − 1) q MDS codes consists of three parts.
1. For each j ∈ A, find all (n − 1, k − 2) q MDS codes that occur as a part in a partition of C j into (n − 1, k − 2) q MDS codes. Because C j ∼ =Ĉ, whereĈ is a representative whose partitions into (n − 1, k − 2) q MDS codes are known, this can be solved by finding a g ∈ G n for which C j = gĈ and applying g directly to each partition ofĈ. Denote the set of (n − 1, k − 2) q MDS codes found in this step by S j .
2. Find all subsets D of C that are (n, k − 1) q MDS codes for which D j ∈ S j for each j. This is done by finding all q-cliques in the q-partite graph where, for each j, each element of S j corresponds to a vertex in the jth part, and between two vertices in different parts there is an edge if the minimum distance between them is at least n − k + 1.
3. Find all partitions of C into (n, k − 1) q MDS codes. This is done by solving an exact cover problem, where q sets are selected from the family created in the previous phase such that each codeword in C is covered exactly once.
We run the algorithm for one representative C from each equivalence class of (n, k) q MDS codes, and finally perform isomorph rejection for all (n+1, k) q MDS codes corresponding to the obtained partitions.

Consistency check
We check the consistency of each phase of the generation by double counting. The total number of (n + 1, k) q MDS codes is the sum of the sizes of the equivalence classes, where C n+1 is the obtained set of equivalence class representatives of (n+1, k) q MDS codes. On the other hand, the same count can be obtained as follows.
Let N(C) be the number of partitions of an (n, k) q MDS code C into (n, k−1) q MDS codes. The number of (n + 1, k) q MDS codes is where the first sum is taken over all (n, k) q MDS codes, C n is a set containing exactly one representative from each equivalence class of (n, k) q MDS codes, and N(Ĉ) is the number of partitions ofĈ obtained by the algorithm.

Results
The algorithm was run for q = 7 and q = 8, for each k = 3, 4, . . . , q − 1, and for each n starting from n = k + 2 and increasing n until no more codes were found. The numbers of inequivalent extendable codes are shown in Tables 1 and 3, for q = 7, 8, respectively, and the numbers of equivalence classes are shown in Tables 2 and 4. In the tables, the numbers marked with * are obtained in this work using the method described above. The previously known numbers are obtained from the classification of one-errorcorrecting MDS codes and sets of MOLS, and in addition for q = 7 the MDS conjecture gives an upper bound for n, and the nonexistence of (10, 3) 8 MDS codes follows form the nonexistence of (9, 2) 8 MDS codes. The computations lasted a few minutes for q = 7 and 21 hours for q = 8; 18 hours were needed for extending the (9, 7) 8 MDS codes. By comparing the equivalence class representatives with known linear codes, we see that all 8-ary MDS codes with d ≥ 5 or k ≥ 4, d = 4 are equivalent to a linear code.
We denote by N n the number of (n, n − 1) q MDS codes and by M n the number of equivalence classes of (n, n − 1) q MDS codes. Because each class contains at most |G n | = n!(q!) n elements, we get M n ≥ N n n!(q!) n . (1) For small values of n and q, we find lower bounds for N n and M n by the following construction. This construction resembles Construction X4 given in [12,Chapter 18.7]. We denote by CC ′ the direct sum of codes C and C ′ of lengths n and n ′ , respectively, Theorem 1. Let C and C ′ be (n 1 , n 1 − 1) q and (n 2 , n 2 − 1) q MDS codes, respectively. Then Proof. The code C ′′ contains qq n 1 −2 q n 2 −2 = q n 1 +n 2 −3 codewords of length n 1 + n 2 − 2. Because the minimum distance of each C i and C ′ i is 2, the minimum distance of each C i C ′ i is at least 2. For distinct i, j, any codeword in C i C ′ i differs from any codeword in C j C ′ j in at least one position in the first n 1 − 1 coordinates and in at least one position in the last n 2 − 1 coordinates. Therefore, C ′′ has minimum distance 2. 4 785 3 102 ≥ 1.4 × 10 13 ≥ 9.5 × 10 18 ≥ 6.9 × 10 35 7 ≥ 3.5 × 10 9 ≥ 1.5 × 10 3 ≥ 3.1 × 10 15 ≥ 3.3 × 10 24 ≥ 6.6 × 10 45 Table 5: Number of equivalence classes of (n, n − 1) q MDS codes Because the construction in Theorem 1 maps exactly q! pairs of (C, C ′ ) to the same code, this yields a lower bound for the number of (n, n − 1) q MDS codes, This lower bound along with the known numbers of (n, n − 1) q MDS codes and (1) allows us to find lower bounds for the number of equivalence classes of (n, n − 1) q MDS codes for small n. Table 5 lists the known numbers of equivalence classes of (n, n − 1) q MDS codes for 4 ≤ q ≤ 8 given in [16] and lower bounds obtained by (1) and (2) for small values of n. Since the lower bounds for the unknown values are rather large, except for a few entries, obtaining further classification results by explicitly constructing representatives from each equivalence class is not feasible in general.
Finally, we note that [20] gives a double exponential lower bound for N n when q ≥ 4: log 2 N n ≥    q 2 n−1 , for even q, , for odd q.
From (1), it follows that that the number of equivalence classes M n for q ≥ 4 also has a lower bound that is double exponential in n.