MDS and near-MDS self-dual codes over large prime fields

In this paper, we are interested in the construction of maximum 
distance separable (MDS) self-dual codes over large prime fields that arise from 
the solutions of systems of diophantine equations. Using this method we con- 
struct many self-dualMDS (or near-MDS) codes of lengths up to 16 over various 
prime fields $GF(p)$, where $p$ = 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 53, 61, 73, 
89, 97, 101, 109, 113, 137, 149, 157, 173, 181, 193 and 197. In addition, a number 
of optimal codes are presented for many lengths up to 40 over small prime fields 
$GF(p)$. Furthermore, our results on the minimum weight of self-dual codes over 
prime fields give a better bound than the Pless-Pierce bound obtained from a 
modified Gilbert-Varshamov bound.


Introduction
A linear [n, k] code C over GF (p) is a k-dimensional vector subspace of GF (p) n , where GF (p) is the Galois field with p elements. In this paper, we consider the case where p is a prime. The elements of C are called codewords and the (Hamming) weight wt(x) of a codeword x is the number of non-zero coordinates in x. The minimum weight of C is defined as min{wt(x) | 0 = x ∈ C}. An [n, k, d] code is an [n, k] code with minimum weight d. A matrix whose rows generate the code C is called a generator matrix of C. The dual code C ⊥ of C is defined as C ⊥ = {x ∈ GF (p) n | x·y = 0 for all y ∈ C}. C is self-dual if C = C ⊥ . For p ≡ 1 (mod 4), a selfdual [n, n/2] code over GF (p) exists if and only if n is even, and for p ≡ 3 (mod 4), a self-dual [n, n/2] code over GF (p) exists if and only if n ≡ 0 (mod 4) [32]. We say that self-dual codes with the largest minimum weight among self-dual codes of that length are optimal. Bounds on the minimum distance of linear codes can be found in [8] and [21].
Self-dual codes are important because many of the best codes available are of this type since they have good minimum weight properties and some of their applications can be found in the areas of combinatorics, communications, design, group and number theory. By the Gleason-Pierce theorem [39], there are divisible self-dual codes over GF (p) for p = 2, 3 and 4. Hence much work has been done concerning self-dual codes over these fields. For example, self-dual codes of small lengths over GF (2), GF (3) and GF (4) have been classified (cf. [37,), in order to determine which codes exist and which weight enumerators are possible. In addition, much is known about the largest minimum weights for self-dual codes over these fields (cf. [37, Tables X, XII, XIII and XIV]). Moreover by applying the Assmus Mattson theorem [4] for extremal self-dual codes over GF (2), GF (3) or GF (4), t-designs can be formed from these codes [34]. Conversely, self-dual codes over larger fields have not been widely studied [37].
A [n, k, n − k + 1] p linear code over GF (p), is called maximum distance separable (MDS) if it satisfies the equality in the Singleton bound, d ≤ n−k+1 [38]. Maximum distance separable codes (MDS codes) are at the heart of combinatorics and finite geometries. In their book [32] Mac Williams and Sloane describe MDS codes as "one of the most fascinating chapters in all of coding theory". These codes can be linear or non-linear. In this paper, we shall focus on the linear case. MDS codes have been considered for their purely combinatorial properties. For example, they are related to the existence of some combinatorial objects called mutually orthogonal Latin squares and orthogonal arrays [32], and to the existence of geometric objects called n-arcs [32]. One of the main problems of coding theory is determining the maximum length of an MDS code. The following is a famous conjecture. Main Conjecture on MDS codes. For a non-trivial [n, k, n − k + 1] MDS code over GF (q) we have that n ≤ q + 2 if q is even and k = 3 or k = q − 1, and n ≤ q + 1 otherwise.
The previous conjecture has not been proven in general. It has been shown that it holds in a number of cases, for example for codes over GF (q) with q ≤ 27, and for codes with dimension k ≤ 5 (for references see [26,32] and the papers [10,11]). In their paper [9] Bruen, Thas, and Blokhuis show it to hold at least asymptotically. A survey on the main conjecture for MDS codes is given in [25]. The existence and possible structure of long MDS codes was a central theme in the address of J.A. Thas to the International Congress of Mathematicians in 1998 [40]. Towards this direction, Alderson gave in [1] an extendability condition on the length of MDS codes for even q. Recently, improvements to the main results available concerning MDS extensions of linear MDS codes have appeared in [2].
The Singleton defect of an [n, k, d] code C defined as s(C) = n − k + 1 − d measures how far C is away from being MDS. A code C with Singleton defect s(C) = 1, that is a [n, k, n − k] code is called almost MDS (AMDS for short) [6].
An [n, k, n − k] AMDS code for which the dual code is also an AMDS code, that is s(C) = s(C ⊥ ) = 1 is called a near-MDS code (NMDS for short) [12].
The importance of NMDS codes is that there exist NMDS codes which are considerably longer than the longest possible MDS codes for a given size of the code and the alphabet. Also, these codes have good error detecting capabilities [13] and can sometimes produce t-designs [12]. NMDS codes of maximal length over GF (q), 8 ≤ q ≤ 11 have been found in [33]. Now we consider the weight enumerators of self-dual codes over GF (p).
Theorem 1 (MacWilliams, Mallows and Sloane [31]). The weight enumerator of a self-dual code over GF (p) is an element of Hence we have a trivial upper bound d ≤ n/2 + 1 which coincides with the Singleton bound for an [n, n/2, d] code. However, the weight enumerator W p (n) of a self-dual [n, n/2, n/2 + 1] code over GF (p) is uniquely determined.
Recently, some authors (for instance [17] and [28]) have constructed MDS selfdual codes over large finite fields GF (p) for small lengths. In particular, MDS selfdual codes of lengths 4, 8, 12 for p = 31 and MDS self-dual codes of lengths 2n ≤ 14 for p = 37 are constructed in [17] and MDS self-dual codes of lengths 2n ≤ 10 for p = 41 are constructed in [28]. MDS self-dual codes for lengths 8, 10, 12 and 16 for several finite fields have been constructed via orthogonal designs and generalized orthogonal designs in [24]. A construction of MDS self-dual codes over Galois rings has appeared in [29], whereas MDS and NMDS self-dual codes of lengths up to 12 have been found.
In this paper, we give an efficient construction method for self-dual codes over large prime fields GF (p) based on solutions of systems of diophantine equations. Using this method we construct many self-dual MDS and NMDS codes of lengths up to 16 over various prime fields GF (p), where p = 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 53, 61, 73, 89, 97, 101, 109, 113, 137, 149, 157, 173, 181, 193 and 197. Furthermore, we present a theoretical result pertaining to the systems of diophantine equations which exemplifies a connection of the solvability of these systems with quadratic residues. Finally, we improve the Pless-Pierce bound obtained from a modified Gilbert-Varshamov bound on the minimum weight of self-dual codes over prime fields.

Self-dual codes via solutions of diophantine equations
Self-dual codes via solutions of systems of diophantine equations have been constructed in [17,18,20]. We recall these methods in this section, and refine them under an appropriate algebraic formalism. We shall give a method for the construction of self-dual codes with generator matrix G, an n × 2n matrix, of the form G = [cI n M ] using one, two or four circulant matrices with a system of diophantine equations.
In order to present this method for constructing suitable circulant or block circulant matrices M of order n with elements from GF (p) satisfying M M T = −cI n for some c ≡ 0 (mod p), c ∈ GF (p) we shall need some basic definitions from design theory. A matrix M over GF (p) satisfying M M T = −c 2 I n for a non-zero element c is called an orthogonal design over GF (p) [15].
. . , a jn }, j = 1, . . . , l}, be a set of l sequences of length n. The non-periodic autocorrelation function, over GF (p), N A (s) (abbreviated as NPAF) of the above sequences is defined as a ji a j,i+s   (mod p), s = 0, 1, . . . , n − 1 and the periodic autocorrelation function, over GF (p), P A (s) (abbreviated as PAF) is defined, reducing i + s modulo n, as It is easy to show that P A (s) = P A (n − s) and thus we only have to check For the results of this paper PAF is sufficient, in general. However NPAF sequences imply PAF sequences exist, the NPAF sequence being padded at the end with sufficient zeros to make longer lengths. Hence NPAF can give more general results. A circulant matrix E of order n with first row e 11 , e 12 , . . . , e 1n will be denoted by E = circ(e 11 , e 12 , . . . , e 1n ). . To find such matrices we have to solve the system of diophantine equations arising from relation (2). Define the system of algebraic equations S 1 (n,p,c) over GF (p) for the one circulant construction as follows: The system S 1 (n,p,c) has n unknowns and [n/2] + 1 equations. In detail, S 1 (n,p,c) is defined as: where i + s is taken modulo n, when needed.
Now we present a theoretical result pertaining to the systems S 1 (n,p,1) which exemplifies a connection of the solvability of these systems with quadratic residues. and since (2, p) = 1, we can discard the factor of 2.
The Jacobi-Trudi formula e 2 = 1 2 (p 2 1 − p 2 ) (where p 1 , p 2 are power-sums in the n variables m 1 , . . . , m n ) then implies that p 2 1 − p 2 ≡ 0 (mod p) and using the first equation of S 1 (n,p,1) , this becomes The above congruence has a solution if and only if (p − 1) ≡ 0 (mod 4), i.e. −1 is a quadratic residue of primes of the form 4k + 1 and a quadratic non-residue of primes of the form 4k + 3, see [27] for instance.
In some cases, it seems that it is possible to establish a formula for the number of solutions of a S 1 (n,p,1) system, for a specific n and for all primes p. We mention one such case in the following remark for n = 4: Remark 1. The sequence of the (nonzero) numbers of solutions of S 1 (4,p,1) is given by: |S (4,p,1) | = 4 2 · a n where a n is the sequence A005098 of Sloane Remark 2. We note that although we have not proved the above statement, it predicts exactly the computational results obtained for all odd primes 1 (mod 4), s.t. p ≤ 541.

Diophantine equations and two block circulant construction. Let
M be a 2n×2n matrix constructed from two circulant matrices say A 1 = circ(a 11 , a 12 , . . . , a 1n ) and A 2 = circ(a 21 , a 22 , . . . , a 2n ) of order n in the form with elements from GF (p) satisfying M M T = f I 2n where f ≡ −c 2 (mod p), and c is nonzero element of GF (p). To find such matrices we have again to solve the system of diophantine equations arising from relation (2). Define the system of algebraic equations S 2 (n,p,c) over GF (p) for the two block circulant construction as follows: The system S 2 (n,p,c) has 2n unknowns and [n/2] + 1 equations. In detail, S 2 (n,p,c) is defined as: a ji a j,i+s  A 1 = circ(a 11 , a 12 , a 13 ) and A 2 = circ(a 21 , a 22 , a 23 ). We built up a system of diophantine equations as it is shown in method 2.2 for c = 1 and p = 41.

Results
In this section, we summarize the results we have obtained from our computational search. We have constructed over 3 million self-dual codes using the methods described in sections 2.1, 2.2 and 2.3. We have used Magma, a computer algebra system for symbolic computation developed at the University of Sydney, to compute the minimum distance of the aforementioned self-dual codes [7,22]. The generator matrices and the corresponding weight enumerators for the following MDS (or near-MDS) self-dual codes can be retrieved through Prof. C. Koukouvinos webpage http://www.math.ntua.gr/~ckoukouv.
We give a similar lemma for near-MDS self dual codes, for the cases we have not found MDS self-dual codes.

3.4.
Optimal self-dual codes over small prime fields. A self-dual code C is called extremal or optimal if C has the largest possible minimum weight.
3.4.1. Extremal ternary self-dual codes from diophantine equations. The known bounds of d for p = 3 are given in [37] and [41]. In particular the following theorem is known.
We note that over GF (3) we have reconstructed all extremal (optimal) [n, n/2] ternary self-dual codes for lengths 12 ≤ n ≤ 40 through solutions of systems of diophantine equations. In particular we found the following codes.  Table 1. Extremal ternary self-dual codes of lengths 12 ≤ n ≤ 40 3.4.2. Optimal self-dual codes from diophantine equations over prime fields GF (5) and GF (7). Now we give results of [n, n/2] self-dual codes for other prime fields comparing them with the best available known bounds using the tables provided by Brouwer [8] and Grassl [21]. Bounds in these tables are given in a range of lower-upper bound, in the same form that can be found in [21]. Lower bounds are constructive while the upper bounds have been found via linear programming or by shortening and considering truncation to existing codes. Therefore, a code is considered to be optimal if it achieves the largest possible minimum weight among self-dual codes, i.e. it reaches the lower constructive bound of these tables.
NMDS or MDS codes of smaller lengths over larger prime fields are not listed in the following tables, since they have been given earlier. If a code is not listed in these tables it means that this was not a permissible value of the corresponding system of diophantine equations, thus we had no solutions for this case.
Notation. We denote with n the length of self-dual codes, while with d max (n) we denote the largest minimum weight we have found. The lower and upper bounds of the tables [8,21]  8 8-10 -9-10 24 9 9-10 10 10-11 Table 2. Optimal self-dual codes of lengths 20 ≤ n ≤ 24 We now give some self-dual codes of larger lengths over GF (5) with good minimum weight properties.  In this section, our results (appearing in bold faces) on the minimum weight of [n, n/2] optimal or MDS self-dual codes over prime fields give a better bound than the Pless-Pierce bound (appearing in the parenthesis) obtained from a modified Gilbert-Varshamov bound.  Table 4. Minimum weights of self-dual codes of lengths 14 ≤ n ≤ 34 over GF (5) n p = 7 16 7 (6) 20 9 (7) 24 10 (8) Table 5. Minimum weights of optimal self-dual codes of lengths n ≤ 24 over GF (7) n p = 41 12 7 (6) Table 6. Minimum weight of an [12,6] MDS code over GF (41)