On the classification of $\mathbb{Z}_4$-codes

In this note, we study the classification of $\mathbb{Z}_4$-codes. For some special cases $(k_1,k_2)$, by hand, we give a classification of $\mathbb{Z}_4$-codes of length $n$ and type $4^{k_1}2^{k_2}$ satisfying a certain condition. Our exhaustive computer search completes the classification of $\mathbb{Z}_4$-codes of lengths up to $7$.


Introduction
Let Z 4 (= {0, 1, 2, 3}) denote the ring of integers modulo 4. A Z 4 -code C of length n is a Z 4 -submodule of Z n 4 .Over the past decade codes over finite rings have gained in importance for both practical and theoretical reasons.In particular, there has been interest in Z 4 -codes.For example, a simple relationship between the best known nonlinear binary codes such as the Kerdock, Preparata, Goethals codes, which contain more codewords than any known linear codes with the same minimum distance and Z 4 -codes was discovered by Hammons, Kumar, Calderbank, Sloane and Solé [5].
The Hamming weight wt H (x), Lee weight wt L (x) and Euclidean weight wt E (x) of a codeword x of a Z 4 -code C are defined as n 1 (x) + n 2 (x) + n 3 (x), n 1 (x)+2n 2 (x)+n 3 (x) and n 1 (x)+4n 2 (x)+n 3 (x), respectively, where n i (x) is the number of components of x which are equal to i.The minimum Hamming weight d H (C), minimum Lee weight d L (C) and minimum Euclidean weight d E (C) of C is the smallest Hamming, Lee and Euclidean weight among all non-zero codewords of C, respectively.A Z 4 -code C of length n and type 4 k 1 2 k 2 is called Hamming-optimal, Lee-optimal and Euclidean-optimal if C has the largest minimum Hamming weight, the largest minimum Lee weight and the largest minimum Euclidean weight among all Z 4 -codes of length n and type 4 k 1 2 k 2 , respectively.
Two Z 4 -codes C and C ′ are equivalent, denoted C ∼ = C ′ , if C can be obtained from C ′ by permuting the coordinates and (if necessary) changing the signs of certain coordinates.It is a fundamental problem to classify Z 4codes for modest lengths, up to equivalence.Concerning self-dual Z 4 -codes, the classification is known for lengths up to 19 (see [6]).Beyond self-dual Z 4codes, only a few results on the classification of Z 4 -codes are known [3] and [4] (see also [7]).More precisely, a classification of optimal Z 4 -codes C of length n ≤ 8 with |C| = 2 n was done in [4], noting that the definition of optimal Z 4 -codes is slightly different from the above definition.A classification of Z 4codes which are Hamming-optimal, Lee-optimal and Euclidean-optimal was presented in [3] for lengths up to 7. In this note, we study the classification of Z 4 -codes.
This note is organized as follows.In Section 2, some preliminaries are given.In Section 3, the notion of trivial extensions is introduced.We show that it is sufficient to consider only inequivalent Z 4 -codes of length n and type 4 k 1 2 k 2 , none of which is equivalent to the trivial extension of a Z 4 -code of length n − 1, in order to complete the classification of Z 4 -codes of length n and type 4 k 1 2 k 2 (Proposition 3.2).In Section 4, for some special cases (k 1 , k 2 ), by hand, we give a classification of Z 4 -codes of length n and type 4 k 1 2 k 2 , none of which is equivalent to the trivial extension of a Z 4 -code of length n − 1.In Section 5, we describe a computer-aided classification method of Z 4 -codes.In Section 6, our exhaustive computer search completes the classification of Z 4 -codes of lengths n ≤ 7, none of which is equivalent to the trivial extension of a Z 4 -code of length n − 1, by the method given in Section 5. Along with Proposition 3.2, we complete the classification of all Z 4 -codes of lengths up to 7. All computer calculations in this note were done by Magma [1].

Preliminaries
Let C be a Z 4 -code of length n.It is known that C is permutation-equivalent to a Z 4 -code with generator matrix of the form: where I k denotes the identity matrix of order k, O denotes the zero matrix, A and D are (1, 0)-matrices, and B is a Z 4 -matrix of appropriate sizes.We say that C has type 4 k 1 2 k 2 (see [2] and [5]).
The dual code C ⊥ of C is defined as x • y = 0 for all y ∈ C}, where x • y is the standard inner product.The dual code C ⊥ of the Z 4 -code C with generator matrix (1) has the following generator matrix: where A T denotes the transposed matrix of A [2].This means that C ⊥ has type 4 n−k 1 −k 2 2 k 2 .Throughout this note, let N(n, k 1 , k 2 ) denote the number of inequivalent Z 4 -codes of length n and type 4 k 1 2 k 2 .Then it is trivial that For an element a ∈ Z 4 , we denote the binary element a (mod 2) by â.The residue code C (1) of a Z 4 -code C of length n is defined as the following binary code: If C is a Z 4 -code of length n and type 4 k 1 2 k 2 having generator matrix (1), then C (1) is a binary [n, k 1 ] code with the following generator matrix: where B = (b ij ) and A is regarded as a binary matrix.Note that equivalent Z 4 -codes have equivalent residue codes.
The Hamming, Lee and symmetrized weight enumerators of a Z 4 -code C of length n are defined as: respectively.Note that equivalent Z 4 -codes have identical Hamming, Lee, symmetrized weight enumerators.

Trivial extensions
In this section, we introduce the notion of trivial extensions.Some basic facts are given.
Let C be a Z 4 -code of length n.Define the Z 4 -code of length n + 1: We say that C is a trivial extension of C.
Lemma 3.1.Let C and C ′ be Z 4 -codes of length n.Suppose that D and Since the last coordinate of each codeword of C and C ′ is 0, there is a (1, −1, 0)-monomial matrix P of order n + 1 such that C = C ′ P , where none of which is equivalent to the trivial extension of a Z 4 -code of length n − 1.Then we have which are equivalent to the trivial extensions of some Z 4 -codes of length n−1.By Lemma 3.1, there is a one-to-one correspondence between Hence, it is sufficient to consider only inequivalent Z 4 -codes of length n and type 4 k 1 2 k 2 , none of which is equivalent to the trivial extension of a Z 4code of length n − 1, in order to complete the classification of Z 4 -codes of length n and type 4 k 1 2 k 2 .

Classification for special cases
In this section, for some special cases (k 1 , k 2 ), by hand, we give a classification of Z 4 -codes of length n and type 4 k 1 2 k 2 , none of which is equivalent to the trivial extension of a Z 4 -code of length n − 1.
Throughout this note, let N ′ (n, k 1 , k 2 ) denote the number of inequivalent Z 4 -codes of length n and type 4 k 1 2 k 2 , none of which is equivalent to the trivial extension of a Z 4 -code of length n − 1.
which is inequivalent to the trivial extension of a Z 4 -code of length n − 1.Then C n,0 , C 0,n and C 0,1 are equivalent to the Z 4 -codes with generator matrices Proof.Let C be a Z 4 -code of length n and type 4 n−1 2 1 , which is inequivalent to the trivial extension of a Z 4 -code of length n − 1.Then C has generator matrix of the form: , where a i ∈ {0, 1} (i = 1, 2, . . ., n − 1).The generator matrix of the dual code C ⊥ of the Z 4 -code C with generator matrix G is given by ).We may suppose without loss of generality that a i ≤ a i+1 (i = 1, 2, . . ., n − 2), where 0 < 1.Hence, Proof.Let C be a Z 4 -code of length n and type 4 1 2 n−1 , which is inequivalent to the trivial extension of a Z 4 -code of length n − 1.Then C has generator matrix of the form: , where a i ∈ {0, 1} (i = 1, 2, . . ., n − 1).We may suppose without loss of generality that a i ≤ a i+1 (i = 1, 2, . . ., n−2), where 0 < 1.Hence, N ′ (n, 1, n− 1) ≤ n.
Now consider the residue code C (1) of C. By an argument similar to the last part of the proof of the above proposition, N ′ (n, 1, 0) = n.

Classification method
In this section, we describe a computer-aided classification method of Z 4codes.We give some observations on generator matrices (1), in order to reduce the number of generator matrices of Z 4 -codes, which must be checked further for equivalences.
Define a lexicographical order on the vectors of Z n 4 as follows.For a = (a 1 , a 2 , . . .For T ⊂ M m×n (Z 4 ), define the following: Let C be a Z 4 -code of length n and type 4 k 1 2 k 2 , having generator matrix of the form (1). We denote the matrix of the form (1) by G(A, B, D).Then we consider the following sets of matrices: where ℓ = n − k 1 − k 2 and B is the set of all k 1 × ℓ (0, 2)-matrices and all k 1 × ℓ Z 4 -matrices B satisfying the condition that the i-th row of B contains entries only 0, 1, 2 for the smallest i ∈ {1, 2, . . ., k 1 } such that the i-th row of B contains entries except 0, 2.
Lemma 5.1.If G ∈ S, then there is a matrix G ′ ∈ T such that two Z 4 -codes with generator matrices G and G ′ are equivalent.
Proof.By considering permutations of rows and columns, one can obtain some generator matrix Lemma 5.2.If G ∈ T , then there is a matrix G ′ ∈ U such that two Z 4 -codes with generator matrices G and G ′ are equivalent.
Proof.By considering negations of some columns, one can obtain some generator matrix G(A, B ′ , D) ∈ T satisfying B ′ ∈ B from a generator matrix G(A, B, D) ∈ T .
Lemma 5.3.If G ∈ U, then there is a matrix G ′ ∈ V such that two Z 4 -codes with generator matrices G and G ′ are equivalent.
Proof.By considering permutations of columns of B 2D , one can obtain some generator matrix G(A, B ′ , D ′ ) ∈ U satisfying the following condition: from a generator matrix G(A, B, D) ∈ U.
By Lemmas 5.1, 5.2 and 5.3, we have the following: Proposition 5.4.Let C be a Z 4 -code of length n and type 4 k 1 2 k 2 , which is inequivalent to the trivial extension of a Z 4 -code of length n − 1 and type does not contain 0 T , where 0 is the zero-vector.
Proposition 5.4 substantially reduces the number of generator matrices of Z 4 -codes which must be checked further for equivalences.

Z 4 -codes of lengths up to 7
A computer-aided classification method of Z 4 -codes was given in the previous section.By the method, in this section, we complete the classification of Z 4codes of lengths n ≤ 7, none of which is equivalent to the trivial extension of a Z 4 -code of length n − 1, along with the results in Section 4.
We consider Z 4 -codes of length n and type 4 k 1 2 k 2 , none of which is equivalent to the trivial extension of a Z 4 -code of length n − 1, except in the case where the numbers N ′ (n, k 1 , k 2 ) were determined in Section 4. For a given set (n, k 1 , k 2 ), by exhaustive search, we found all distinct Z 4 -codes of length n and type 4 k 1 2 k 2 , satisfying the condition given in Proposition 5.4.Then the distinct codes can be divided into some classes by comparing the Hamming weight enumerators and the Lee weight enumerators.Of course, equivalent Z 4 -codes have identical Hamming weight enumerators and identical Lee weight enumerators.To test equivalence of two Z 4 -codes C and C ′ in each class, we determined whether there is a (1, −1, 0)-monomial matrix P such that C ′ = CP or not.Then we completed the classification of Z 4codes of length n and type 4 k 1 2 k 2 , none of which is equivalent to the trivial extension of a Z 4 -code of length n − 1 for n ≤ 7. The time required for the computer search of the above classification of Z 4 -codes of lengths up to 7, which corresponds to one core of an Intel Xeon W5590 3.33GHz processor, is approximately 1954 hours.The parameter (n, k 1 , k 2 ) = (7, 4, 0) took the longest time, which was approximately 733 hours.
To save space, we only list in Tables 1-7 the numbers N ′ (n, k 1 , k 2 ) for n = 1, 2, . . ., 7, respectively.Generator matrices can be obtained electronically from "http://yuki.cs.inf.shizuoka.ac.jp/Z4codes/".As a summary, we list the numbers N ′ (n) of inequivalent Z 4 -codes of lengths n ≤ 7, none of which is equivalent to the trivial extension of a Z 4code of length n − 1.We end this note with a certain remark.There is another approach to completing the classification of Z 4 -codes of length n.If a classification of Z 4 -codes of length n and type 4 k 1 2 k 2 is done for only k 1 ≤ n − k 1 − k 2 , then the remaining classification is obtained from the above classification by considering their dual codes (see (2)).In this note, we employed the approach given in Section 5, because (2) can be used as a check.