     # On the classification of linear complementary dual codes

We give a complete classification of binary linear complementary dual codes of lengths up to 13 and ternary linear complementary dual codes of lengths up to 10.

04/15/2020

### Classification of optimal quaternary Hermitian LCD codes of dimension 2

Hermitian linear complementary dual codes are linear codes which interse...
02/20/2018

### Binary linear complementary dual codes

Linear complementary dual codes (or codes with complementary duals) are ...
01/21/2022

### Classification and count of binary linear complementary dual group codes

We establish a complete classification of binary group codes with comple...
04/15/2021

### On the existence of quaternary Hermitian LCD codes with Hermitian dual distance 1

For k ≥ 2 and a positive integer d_0, we show that if there exists no qu...
02/06/2022

### Galois LCD codes over mixed alphabets

We study (Galois) linear complementary dual codes over mixed alphabets a...
07/05/2022

### Additive complementary dual codes over _4

A linear code is linear complementary dual (LCD) if it meets its dual tr...
12/03/2020

### Optimal Ternary Linear Complementary Dual Codes

Linear complementary dual (LCD) codes introduced by Massey are the codes...

## 1 Introduction

Let denote the finite field of order , where is a prime power. An code over is a

-dimensional vector subspace of

. A code over is called binary and a code over is called ternary. The parameters and are called the length and dimension of , respectively. Two codes and over are equivalent, denoted , if there is an monomial matrix over with .

The dual code of an code over is defined as where is the standard inner product. A code is called linear complementary dual (or a linear code with complementary dual) if , where denotes the zero vector of length . We say that such a code is LCD for short. LCD codes were introduced by Massey  and gave an optimum linear coding solution for the two user binary adder channel. Recently, much work has been done concerning LCD codes for both theoretical and practical reasons (see , , ,  and the references therein). In particular, we emphasize the recent work by Carlet, Mesnager, Tang, Qi and Pellikaan . It has been shown in  that any code over is equivalent to some LCD code for . This motivates us to study binary LCD codes and ternary LCD codes. In addition, recently, Carlet, Mesnager, Tang and Qi  have established the mass formulas. This motivates us to start a classification of binary LCD codes and ternary LCD codes. The aim of this note is to give a complete classification of binary linear complementary dual codes of lengths up to and ternary linear complementary dual codes of lengths up to .

The note is organized as follows. In Section 2, definitions, notations and basic results are given. We give some observation on the classification of binary LCD codes and ternary LCD codes with . Section 2 also presents the mass formulas given in  for binary LCD codes and ternary LCD codes. The mass formulas are an important role in the classification of binary LCD codes and ternary LCD codes. In Section 3, we give a complete classification of binary LCD codes and ternary LCD codes for . In Section 4, we give a complete classification of binary LCD codes of lengths up to . In Section 5, we give a complete classification of ternary LCD codes of lengths up to .

## 2 Preliminaries

### 2.1 Definitions, notations and basic results

Let be an code over . The weight of a vector is the number of non-zero components of . A vector of is called a codeword of . The minimum non-zero weight of all codewords in is called the minimum weight of and an code with minimum weight is called an code. The weight enumerator of is given by , where is the number of codewords of weight in . An automorphism of is an monomial matrix over with . The set consisting of all automorphisms of is called the automorphism group of and it is denoted by . A generator matrix of is a matrix whose rows are a set of basis vectors of . A parity-check matrix of is a generator matrix of .

Throughout this note, we use the following notations. Let denote the zero vector of length and let denote the all-one vector of length . Let

denote the identity matrix of order

and let denote the transpose of a matrix .

The following characterization is due to Massey .

###### Proposition 1.

Let be a code over . Let and be a generator matrix and a parity-check matrix of , respectively. Then the following properties are equivalent:

• is LCD,

• is LCD,

• is nonsingular,

• is nonsingular.

The following proposition is trivial.

###### Proposition 2.

Suppose that is an LCD code over and . If is equivalent to , then is also LCD.

Throughout this note, we use the following notations. Let denote the set of all inequivalent binary LCD codes. Let denote the set of all inequivalent binary LCD codes. Let denote the set of all inequivalent ternary LCD codes. Let denote the set of all inequivalent ternary LCD codes.

### 2.2 LCD codes C with d(C⊥)=1

Let be an code over . Define the following code:

 C∗={(x1,x2,…,xn,0)∣(x1,x2,…,xn)∈C}. (1)

Let be an code over with . It is easy to see that there is an code over with . It is trivial that is LCD if and only if is LCD. In this way, every LCD code over with is constructed from some LCD code over . In addition, two LCD codes over with are equivalent if and only if two LCD codes over are equivalent. Hence, all LCD codes over with , which must be checked to achieve a complete classification, can be obtained from all inequivalent LCD codes over . Therefore, we have the following:

###### Proposition 3.

Let denote the set of all inequivalent binary LCD codes with . Let denote the set of all inequivalent ternary LCD codes with .

• There is a set of all inequivalent binary LCD codes such that .

• There is a set of all inequivalent ternary LCD codes such that .

### 2.3 Mass formulas

It is trivial that and are the unique LCD code over and the unique LCD code over , respectively. From now on, we assume that

 1≤k≤n−1

for an LCD code over .

Let denote the set of all inequivalent binary LCD codes. Using the Gaussian binomial coefficients, the following values

 T2(n,k)=∑B∈Bn,kn!|Aut(B)| (2)

were determined theoretically in [3, Corollary 4.8], without finding the set , as follows:

 T2(n,k)=⎧⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪⎨⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪⎩2nk−k2+n−12[n2−1k−12]4 if n is even and k is odd,2(n−k)(k+1)2[n−12k−12]4%if$n$and$k$areodd,2k(n−k+1)2[n−12k2]4 if% n is odd and k is even,2k(n−k)2(2n−k[n2−1k2−1]4+[n2−1k2]4) if n and k are even,

where

 [nk]q=(qn−1)(qn−1−1)⋯(qn−k+1−1)(q−1)(q2−1)⋯(qk−1) if k≠0,

and . The value is the number of the distinct binary LCD codes.

Let denote the set of all inequivalent ternary LCD codes. Similar to the above, the following values

 T3(n,k)=∑C∈Cn,k2nn!|Aut(C)| (3)

were determined theoretically in [3, Corollary 5.9], without finding the set , as follows:

 T3(n,k)=⎧⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪⎨⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪⎩3nk−k2−123n2−1[n2−1k−12]9 if n≡0(mod4) and k is % odd,3nk−k2−123n2+1[n2−1k−12]9 if n≡2(mod4) and k is odd,3(k+1)(n−k)2[n−12k−12]9%if$n$isoddand$k$isodd,3k(n−k+1)2[n−12k2]9 if% n is odd and k is even,3k(n−k)2[n2k2]9 if n% is even and k is even.

The value is the number of the distinct ternary LCD codes. The equations (2) and (3) are called the mass formulas.

## 3 Classification for dimensions 1 and n−1

In this section, we give a complete classification of binary LCD codes and ternary LCD codes for .

###### Proposition 4.

Let denote the set of all inequivalent binary LCD codes. Let denote the set of all inequivalent binary LCD codes.

###### Proof.

By considering a permutation of the coordinates, we may assume without loss of generality that a binary code has generator matrix of the form , where . We denote the code by . It is trivial that is LCD if and only if is even. If , then it is trivial that and are equivalent. If , then and are inequivalent since has weight enumerator . Hence, and are inequivalent if and only if . The first two parts (i) and (ii) follow.

If is odd, then is the unique binary LCD code. If is even and , then is a binary LCD code. The last part (iii) follows from (ii). ∎

We give a complete classification of ternary LCD codes for .

###### Proposition 5.

Let denote the set of all inequivalent ternary LCD codes. Let denote the set of all inequivalent ternary LCD codes.

###### Proof.

By considering equivalent codes, we may assume without loss of generality that a ternary code has generator matrix of the form , where . We denote this code by . It is trivial that is LCD if and only if . If , then it is trivial that and are equivalent. If , then and are inequivalent since has weight enumerator . Hence, and are inequivalent if and only if . The first two parts (i) and (ii) follow.

If , then is the unique ternary LCD code. If and , then is a ternary LCD code. The last part (iii) follows from (ii). ∎

## 4 Classification of binary LCD codes of lengths up to 13

In this section, we give a complete classification of binary LCD codes of lengths up to . It is sufficient to consider , since the dual code of a binary LCD code is also LCD.

We describe how to complete a classification of binary LCD codes of lengths up to . Every binary LCD code is equivalent to a binary code with generator matrix of the form , where is a matrix. The set of matrices was constructed, row by row. Permuting the rows and columns of gives rise to different generator matrices which generate equivalent binary codes. Here, we consider some natural (lexicographical) order on the set of vectors of length . We consider only matrices , satisfying the condition , where is the -th row of . It is obvious that all binary codes, which must be checked to achieve a complete classification, can be obtained. By this method, we found all distinct binary LCD codes, which must be checked to achieve a complete classification for . By determining the equivalence or inequivalence for a given pair of binary codes, we obtained the set of all inequivalent binary LCD codes. The mass formula (2) shows that there is no other binary LCD code. This computation was performed in Magma 

. In principle, such a computation can be done by classifying binary LCD codes by the

Magma function IsIsomorphic, then their automorphism groups can be calculated by AutomorphismGroup.

For and , the mass formula (2) was used to complete the classification, due to the computational complexity. Let denote the set of all inequivalent binary LCD codes with . By Proposition 3, there is a set of all inequivalent binary LCD codes such that , where the construction of is listed in (1). Note that is constructed by considering the dual codes of the all inequivalent binary LCD codes for the case . Hence, it is sufficient to find all binary LCD codes with , which must be checked further for equivalences. For these lengths, the set of matrices was constructed, column by column. Here, we consider some natural (lexicographical) order on the set of non-zero vectors of length . We consider only matrices , satisfying the condition , where is the -th column of . In this way, by adding new binary LCD codes, we continued to construct the set of inequivalent binary LCD codes until reaches the value . When reaches the value , the classification was completed and was obtained.

As a check, in order to verify that contains no pair of equivalent binary LCD codes and that , we employed the package GUAVA  of GAP . This calculation was done by using the functions IsEquivalent and AutomorphismGroup.

In order to illustrate our approach, we consider the case as an example. Let be the binary LCD codes with generator matrices , where are listed in Table 1. We verified that these binary codes are inequivalent. Indeed, the binary codes have weight enumerators , where

 W1=1+3y2+y3+3y5,W2=1+3y2+3y3+y5,W3=1+y2+3y3+2y4+y5,W4=1+3y+3y2+y3,W5=1+y+3y2+3y3,W6=1+y+y2+y3+2y4+2y5,W7=1+2y+y2+y3+2y4+y5,W8=1+y+y2+3y3+2y4.

This shows also that these binary codes are inequivalent. Since

 |Aut(B6,3,i)|=36,12,4,36,12,12,12,4 (i=1,2,…,8),

we have

 8∑i=16!|Aut(B6,3,i)|=640=T2(6,3).

The mass formula (2) shows that there is no other binary LCD code.

For and , we list in Table 6 the numbers of all inequivalent binary LCD codes and and the numbers of all inequivalent binary LCD codes. We also list the numbers of the dual codes of the inequivalent binary LCD codes. All binary codes in the table can be obtained electronically from http://www.math.is.tohoku.ac.jp/~mharada/LCD2/.

The smallest possible automorphism group of a binary LCD code is the trivial group (of order ). It is obvious that the unique binary LCD code has trivial automorphism group. We list in Table 2 the smallest value among the orders of the automorphism groups of binary LCD codes of lengths up to . From the table, we have the following:

###### Proposition 6.

The smallest length for which there is a binary LCD code of length with trivial automorphism group is .

We remark that the total number of inequivalent binary LCD codes for and is , of which have trivial automorphism groups. The codes have parameters . As an example, we give a binary LCD code with trivial automorphism group. The code has generator matrix , where

 M12=⎛⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜⎝101011010110110100110001001101000011⎞⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟⎠.

Since the smallest possible automorphism group of a binary LCD code is the group of order , there are at least inequivalent binary LCD codes. From

 t2(14,1)=1,t2(14,2)=1,t2(14,3)=1,t2(14,4)=18, t2(14,5)=574,t2(14,6)=4659,t2(14,7)=9282,

we have

 13∑k=1t2(14,k)=19790.

Hence, there are at least inequivalent binary LCD codes of length . Of course, many binary LCD codes have substantial automorphism groups. Thus, the above might be a poor lower bound. Indeed, there are inequivalent binary LCD codes of length , although we have

 12∑k=1t2(13,k)=2572.

We continued the above process and completed a classification of binary LCD codes for small dimensions. More precisely, we give a classification of binary LCD codes for and binary LCD codes for . In order to save space, we only list in Table 3 the numbers of all inequivalent binary LCD codes for and , respectively.

We end this section with giving the following remark.

###### Remark 7.

It is a fundamental problem to determine the largest minimum weight among all binary LCD codes. For , the values were determined in . For and , the values were determined in . Also, a classification of binary LCD codes having the minimum weight was given in  for .

## 5 Classification of ternary LCD codes of lengths up to 10

By an approach is similar to that used in the previous section, we completed a classification of ternary LCD codes for . For , we found all distinct ternary LCD codes, which must be checked to achieve a complete classification. By determining the equivalence or inequivalence for a given pair of ternary codes, we obtained the set . The mass formula (3) shows that there is no other ternary LCD code. For and , the mass formula (3) was used to complete the classification, due to the computational complexity. For ternary LCD codes, the following method was employed. To test equivalence of ternary codes by a program in the language C, we used the algorithm given in [9, Section 7.3.3] as follows. For a ternary code , define the digraph with vertex set and arc set . Then, two ternary codes and are equivalent if and only if and are isomorphic. We used nauty  for digraph isomorphism testing. The automorphism group is isomorphic to the automorphism group of . This calculation was also done by using nauty .

As a check, in order to verify that contains no pair of equivalent ternary LCD codes and that , we employed the following method obtained by applying the method given in [10, Section 2]. Let be a ternary code. We expand each codeword of into a binary vector of length by mapping the elements and of to the binary vectors and , respectively. If there is a positive integer such that the codewords of weight generate , then we have an binary matrix composed of the binary vectors obtained from the codewords of weight in . If there is no positive integer such that the codewords of weight generate , then by considering all codewords of , we have a binary matrix . Then, from , we have an incidence structure having points. This calculation was done by using the Magma function IncidenceStructure. If and are equivalent ternary codes, then and are isomorphic. By the Magma function IsIsomorphic, we verified that all incidence structures are non-isomorphic. The automorphism group is isomorphic to the stabilizer of inside of the automorphism group of the incidence structure . This calculation was done by using the Magma functions AutomorphismGroup and Stabilizer.

We list in Table 4 the numbers of the inequivalent ternary LCD codes and the numbers of the inequivalent ternary LCD codes for and . We also list the numbers of the dual codes of the inequivalent ternary LCD codes. All ternary codes in the table can be obtained electronically from http://www.math.is.tohoku.ac.jp/~mharada/LCD3/.

The smallest possible automorphism group of a ternary LCD code is the group of order . We list in Table 5 the smallest value among the orders of the automorphism groups of ternary LCD codes for . From the table, we have the following:

###### Proposition 8.

The smallest length for which there is a ternary LCD code of length with automorphism group of order is .

We remark that the total number of inequivalent ternary LCD codes for and is , one of which has automorphism group of order . The code has parameters . As an example, we give a ternary LCD code with automorphism group of order . The code has generator matrix , where

 M8=⎛⎜ ⎜ ⎜⎝2001221211001012⎞⎟ ⎟ ⎟⎠.

Since the smallest possible automorphism group of a ternary LCD code is the group of order , there are at least inequivalent ternary LCD codes. From

 t3(11,1)=1,t3(11,2)=1,t3(11,3)=4, t3(11,4)=319,t3(11,5)=2869,

we have

 10∑k=1t3(11,k)=6388.

Hence, there are at least inequivalent ternary LCD codes of length . Of course, many ternary LCD codes have substantial automorphism groups. Thus, the above might be a poor lower bound. Indeed, there are inequivalent ternary LCD codes of length , although we have

 9∑k=1t3(10,k)=447.

Similar to Remark 7, we end this section with giving the following remark.

###### Remark 9.

Let and denote the largest minimum weight among all ternary LCD codes and among all ternary codes, respectively. Suppose that and . From Table 4, we have

 d3(n,k)={dall3(n,k)−1 if (n,k)∈S,dall3(n,k) otherwise,

where

 S={(4,2),(7,2),(8,2),(8,3),(9,3),(9,4),(9,5),(10,4),(10,5),(10,6)}.

Note that the values can be found in .

Acknowledgment. This work was supported by JSPS KAKENHI Grant Number 15H03633.