This is the submitted version of the article: Dougherty, Steven T.; Fernández-Córdoba, Cristina; Ten-Valls, Roger; [et al.]. «Quaternary group ring codes : ranks, kernels and self-dual codes». Advances in Mathematics of Communications, Vol. 14, issue 2 (May 2020), p. 319-332. 14 pàg. DOI 10.3934/amc.2020023 This version is available at https://ddd.uab.cat/record/239907 under the terms of the license Advances in Mathematics of Communications Web site: http://www.aimSciences.org Volume X, No. 0X, 200X, X–XX QUATERNARY GROUP RING CODES: RANKS, KERNELS AND SELF-DUAL CODES Steven T. Dougherty Department of Mathematics University of Scranton Scranton, PA 18510, USA Cristina Fernández-Córdoba Department of Information and Communications Engineering Universitat Autònoma de Barcelona 08193-Bellaterra, Spain Roger Ten-Valls Department of Information and Communications Engineering Universitat Autònoma de Barcelona 08193-Bellaterra, Spain Bahattin Yildiz Department of Department of Mathematics and Statistics Northern Arizona University Flagstaff, AZ 86001, USA (Communicated by Aim Sciences) Abstract. We study G-codes over the ring Z4 , which are codes that are held invariant by the action of an arbitrary group G. We view these codes as ideals in a group ring and we study the rank and kernel of these codes. We use the rank and kernel to study the image of these codes under the Gray map. We study the specific case when the group is the dihedral group and the dicyclic group. Finally, we study quaternary self-dual dihedral and dicyclic codes, tabulating the many good self-dual quaternary codes obtained via these constructions, including the octacode. Codes over Z4 have received an enormous amount of attention ever since the landmark paper [13]. The major importance of these codes is that they are equipped with a Gray map to the binary Hamming space. This Gray map allows for many interesting non-linear binary codes to be viewed as images of linear quaternary codes under this map. This connection makes it important to understand families of quaternary codes and what their images are in the binary Hamming space. Two of the most important and useful tools to study quaternary codes are the rank and kernel of the code. In this paper, we shall examine both the rank and kernel of a large family of quaternary codes and use these to examine their image under the Gray map. Cyclic codes are one of the most important families of codes. They are charac- terized by the fact that the code is held invariant by the action of the cyclic group. 2000 Mathematics Subject Classification: Primary: 16S34; Secondary: 94B15. Key words and phrases: Group Ring Codes, Quaternary Codes, Dicyclic, Dihedral, Rank, Kernel, self-dual Codes. This work has been partially supported by the Spanish MINECO under Grant TIN2016-77918- P (AEI/FEDER, UE). 1 c 200X AIMS-SDU 2 S.T. Dougherty, C. Fernández-Córdoba, R. Ten-Valls, B. Yildiz Moreover, cyclic codes have a canonical characterization as ideals in a polynomial ring which enables a classification of cyclic codes. We generalize this definition to G-codes, which are codes that are held invariant by the action of an arbitrary finite group G. When the group is specified we use the name of the group. For example, we can talk about cyclic codes, dihedral codes, or dicyclic codes. We then show how these codes can be described in terms of certain skew polynomial rings. Codes as ideals in group algebras were first studied by Jesse MacWilliams in [15] and [16]. In these early works the alphabet was always the binary alphabet. Our goal is to study the alphabet Z4 and use non-abelian groups as well. We begin with the standard definitions. For a complete description of codes over rings and for any undefined terms see [4]. A code over the ring Z4 of length n is a subset of Zn4 and a binary code of length n is a subset of Fn2 . For the ring Z4 we say the code is linear if it is a submodule of Zn4 and for F2 we say it is linear if it is a sub-vector space of P Fn2 . n We attach the usual inner-product to Z4 , namely [v, w] = vi wi and we define the orthogonal to a code C in Zn4 as C ⊥ = {v |v ∈ Zn4 , [v, w] = 0 ∀w ∈ C}. If C ⊆ C ⊥ , we say that C is self-orthogonal and if C = C ⊥ we say that C is self-dual. Denote by φ the standard Gray map φ : Z4 → F22 that is defined by 0 → 00, 1 → 01, 2 → 11, 3 → 10, see [13] for a complete description of this map. We extend this map to Zn4 → F2n 2 by applying it coordinatewise. If C is a quaternary code, then φ(C) is a binary code that is not linear in general. This map has been generalized to numerous rings. For the widest generalization see [7]. We now give the standard definition of the kernel and the rank of a binary code and relate this code to its quaternary preimage. Let C be a binary, not necessarily linear code. First, we say that a linear subcode Ci of C is a maximal linear code in C if for any linear code Di satisfying Ci ⊆ Di ⊆ C we have Ci = Di . Define the kernel of C to be (1) ker(C) = {v ∈ Fn2 | v + C = C}. If C is a quaternary code then its kernel is defined to be (2) K(C) = {v ∈ C | φ(v) ∈ ker(φ(C))}. Note that ker(C) must be a linear code and, in fact, it can be characterized as the intersection of all maximal linear codes in C. Moreover, the code C can be seen as the union of the cosets of ker(C) in C. See [9] for a complete description of these results. Denote by hCi the linear binary code generated by the vectors in C. We say that the rank of C is (3) rank(C) = dim(hCi). For a quaternary code C we shall also say that rank(C) = rank(φ(C)). Then define the quaternary preimage of hφ(C)i as R(C), that is, (4) φ(R(C)) = hφ(C)i. We have the following lemma which appears in [9]. Lemma 1. Let C be quaternary linear code. Then, R(C) and K(C) are quaternary linear codes satisfying K(C) ⊆ C ⊆ R(C). Advances in Mathematics of Communications Volume X, No. X (200X), X–XX Quaternary group ring codes: Ranks, Kernels and Self-dual codes 3 For vectors v, w ∈ Zn4 , define the operation v ∗ w = (v1 w1 , v2 w2 , . . . , vn wn ). In [13], it is proved that φ(v + w) = φ(v) + φ(w) + φ(2v ∗ w). The following lemma follows from the last property and can be found in [9]. Lemma 2. Let C be a quaternary linear code. 1. The code φ(C) is linear if and only if 2v ∗ w ∈ C for all w ∈ C. 2. The kernel of C is K(C) = {v ∈ C | 2v ∗ w ∈ C, ∀w ∈ C}. 3. The code R(C) is R(C) = hC, 2v ∗ w | v, w ∈ Ci. 1. G-codes over Z4 We now give the standard definition of group rings and show how to construct codes as ideals in these group rings. Let G = {g1 , g2 , . . . , gn } be a group of order n and denote by eG the identity element in G. If G is non-abelian then one must distinguish between left and right ideals. We shall assume throughout that we are always dealing with left ideals and multiply by group elements on the left. Similar results can be obtained for right ideals. For abelian groups, the left and right ideals coincide. We define the group ring (5) Z4 G = {v1 g1 + · · · + vn gn | vi ∈ Z4 , gi ∈ G, 1 ≤ i ≤ n} , where the addition in Z4 G is done by coordinate addition, namely Xn n X n X (6) αi gi + βi gi = (αi + βi )gi , i=1 i=1 i=1 and the product in Z4 G is given by n ! n  X X X (7) αi gi  βj gj  = αi βj gi gj . i=1 j=1 i,j Note that the coefficient of gi in the product is X αj βk . gj gk =gi We shall consider linear codes over Z4 that are ideals in the group ring Z4 G. First, define the one-to-one map I : Zn4 → Z4 G given by I(v1 , v2 , . . . , vn ) = v1 g1 + v2 g2 + · · · + vn gn . If g ∈ G, v ∈ Zn4 , and I(v) = v = v1 g1 + v2 g2 + · · · + vn gn ∈ Z4 G, then g(v) is the vector I −1 (gv), where gv = v1 gg1 + v2 gg2 + · · · + vn ggn . If C is a code over Z4 then I(C) = {I(v) | v ∈ C}. If C is linear, then I(C) is also linear. Note that for g ∈ G, v ∈ Zn4 and λ ∈ Z4 , we have that λg(v) = g(λv). Then, we have I(C) is an ideal in Z4 G if, for g ∈ G and v ∈ I(C), gv ∈ I(C). If I(C) is an ideal in Z4 G, then we say that C is a G-code over Z4 . Let Sn be the symmetric group of permutations on the set {1, . . . , n}. Recall the standard definition of an automorphism group of a code C of length n. Namely, let C be a code and let τ ∈ Sn , with τ acting on the coordinates of C. Then we define (8) Aut(C) = {τ ∈ Sn | τ (C) = C}. Advances in Mathematics of Communications Volume X, No. X (200X), X–XX 4 S.T. Dougherty, C. Fernández-Córdoba, R. Ten-Valls, B. Yildiz The following lemma is immediate. Lemma 3. Let C be a linear code over Z4 . If C is a G-code, then Aut(C) must contain the group G. In many respects, this lemma is the key motivation for studying codes as ideals in a group ring. That is, we wish to find codes that are held invariant by the actions of some group. We now give a construction of a code from an element of the group ring. This construction was given for codes over rings in [8] and for codes over fields in [14]. It was used in [12] to construct self-dual codes. Let v = v1 g1 + · · · + vn gn ∈ Z4 G. Notice that the elements g1−1 , g2−1 , . . . , gn−1 are simply the elements of the group G in some order. Then, define the matrix σ(v) ∈ Mn (Z4 ) to be  −1 −1    I (g1 v) v1,1 . . . v1,n ..   .. .. ..  , (9) σ(v) =  = .  . . .  I −1 (gn−1 v) vn,1 ... vn,n where vi,j = vk , for k satisfying gi−1 gj = gk . For a given element v ∈ Z4 G, define C(v) as the quaternary code with generator matrix σ(v). It is immediate that if v has weight 0 then C(I(v)) = {0} and if w has Lee weight 1, then C(I(w)) = Zn4 . Lemma 4. Let g ∈ G. If v, w ∈ Z4 G with gv = w then C(v) = C(w). Proof. The matrix σ(gv) = σ(w) is the matrix σ(v) with the rows permuted. Hence they generate the same code. Let G be a group. We say that G is the internal semi-direct product of its subgroups H and N if N is a normal subgroup of G, H ∩ N = {eG } and G = N H. It is denoted G = H n N . Let H and N be groups and let τ : H → Aut(N ) be an homomorphism. The external semi-direct product of H and N is G = H nτ N defined by G = {(h, n) | h ∈ H, n ∈ N } hτ with the group operation (h1 , n1 )(h2 , n2 ) = (h1 h2 , n1 2 n2 ). In both cases, we will refer to G as the semi-direct product a H and N , and it will be denoted by G = H n N even though in some cases it depends on the action τ. 1.1. Some families of G-codes. We shall define the groups that we use in this paper. The first group is the cyclic group Ct , which is defined as (10) Ct = ha | at = 1i. Codes that are ideals in F2 Ct are one of the most widely studied families of codes. The second group is the dihedral group D2t (see [10], [11]). The dihedral group is defined as (11) D2t = ha, b | bt = 1, a2 = 1, aba−1 = b−1 i. By considering the action τ : C2 → Ct given by τ (y)(x) = x−1 , we have D2t = Ct n C2 [20]. Note that the notation for the dihedral group is not the same in all texts, as some might refer to this group as Dt . This group can be seen as the group of symmetries of a regular t sided figure in a Euclidean plane. The element b corresponds to rotating Advances in Mathematics of Communications Volume X, No. X (200X), X–XX Quaternary group ring codes: Ranks, Kernels and Self-dual codes 5 the object 2πt radians with respect to its center and the element a corresponds to flipping the object over. The third group is also a generalization of the cyclic group, namely the dicyclic group. The dicyclic group is defined as (12) Dic4t = ha, b | a2t = 1, b2 = at , bab−1 = a−1 i. We note that both D2t and Dic4t are non-abelian groups for t ≥ 3, while the cyclic group is abelian. 1.1.1. Cyclic codes. One of the most studied families of codes are cyclic codes. Initially, the cyclic codes were studied over a finite field. Cyclic codes may also be studied as ideals in the group algebra of a cyclic group (see [11]). In [13] cyclic codes over Z4 were introduced and, since then, cyclic codes have been studied over different rings. Cyclic codes, by definition, are invariant under the action of Cn , and therefore have Cn as a subgroup of their automorphism groups. This can also be seen by considering cyclic codes over Z4 as ideals in Z4 Cn . If C is a cyclic code of length n then Aut(C) must contain Cn as a subgroup. One of the most important aspects of cyclic codes is that they can be understood by studying ideals in a polynomial ring. Specifically, cyclic codes of length n over a ring R are ideals in R[x]/hxn − 1i. This is easily generalized to constacyclic codes by studying ideals in R[x]/hxn − λi, with λ a unit in the ring R. If we define S = Z4 [x]/hxn − 1i, then S is the ambient space where cyclic codes reside. Cyclic codes can be considered as ideals in the polynomial ring S. The following Theorem gives the generator polynomials of cyclic codes over Z4 . Theorem 1 ([19]). Let C be a cyclic code of odd length. Then, there are unique monic polynomials f (x), g(x) and h(x) such that C = hf (x)h(x) + 2f (x)i, with f (x)g(x)h(x) = xn − 1, and |C| = 4deg(g(x)) 2deg(h(x)) . Let v = v1 g1 + · · · + vn gn ∈ Z4 Cn . Then, we can consider the polynomial v(x) = v1 + v2 x + · · · + vn xn−1 . Then, the code over Z4 generated by σ(v) is the code generated by the polynomial v(x). 1.1.2. Dihedral Codes. We shall now examine the specific case when the group G is the dihedral group. A circulant matrix with elements from the ring R is of the form:   a1 a2 a3 . . . an  an a1 a2 . . . an−1     an−1 an a1 . . . an−2  (13) circ(a1 , a2 , . . . , an ) =    .. .. .. .. ..   . . . . .  a2 a3 a4 . . . a1 A reverse circulant matrix with elements from the ring R is of the form:   a1 a2 a3 . . . an  a2 a3 a4 . . . a1    (14) rcirc(a1 , a2 , . . . , an ) =  a3 a4 a5 . . . a2     .. .. .. .. ..   . . . . .  an a1 a2 ... an−1 Advances in Mathematics of Communications Volume X, No. X (200X), X–XX 6 S.T. Dougherty, C. Fernández-Córdoba, R. Ten-Valls, B. Yildiz Recall that D2t = ha, b | a2 = bt = 1, ab = b−1 ai. Take an ordering P of the elements for the map σ as 1, b, b2 , . . . , bt−1 , a, ab, ab2 , . . . , abt−1 . Let v = αai ,bj ai bj . In this case, the matrix σ(v) is of the form:   A B (15) , B A with A a circulant matrix, A = circ(α1 αb αb2 , . . . , αbt−1 ), and B a reverse circulant matrix, B = rcirc(αa , αab , αab2 , . . . , αabt−1 ). We can now give a description of dihedral codes in terms of a skew polynomial ring, specifically as an Ore extension of the polynomial ring corresponding to cyclic codes [17]. Let S = Z4 [x]/hxn − 1i and τ ∈ Sn be a Z4 -automorphism of S defined by τ (x) = x−1 . We note that τ is of order 2. Let Rn = S[y; τ ]/hy 2 − 1i, noting that y 2 − 1 is central in S[y; τ ]. This ring is a non-commutative ring with |Rn | = 42n . We can now make a correspondence in a canonical way between elements in the group ring and polynomials in the skew polynomial ring. For an element in Z4 D2n define X  X (16) ψ αij bi aj = αij xi y j . Theorem 2. Let C be a left dihedral code in Z4 D2n then ψ(C) is a left ideal in Rn . Proof. It is immediate that since C is closed under addition and multiplication we have that ψ(C) is closed under addition and multiplication. Then we note that multiplication by x on the left corresponds to multiplication by the group element b and multiplication by y on the left corresponds to multiplication by a on the left. Moreover, yx = x−1 y and so yxy −1 = x−1 . Therefore, since C is a left ideal in Z4 D2n , ψ(C) is a left ideal in Rn . Example 1. Let p(x) be a divisor of xn − 1. Then ψ −1 (Z4 (p(x))) is a left dihedral code of length 2n. Note that if C is a Z4 -dihedral code, then C is the semi-direct product of Z4 -cyclic codes [20]. In fact, any ideal in Rn = S[y; τ ] is of the form I1 + yI2 with Ii an ideal in S, which gives that the ideal is the semi-direct product of cyclic codes. 1.1.3. Dicyclic codes. Recall that the dicyclic group is defined as Dic4t = ha, b | a2t = 1, b2 = at , bab−1 = a−1 i. P2t Let v = i=1 αi ai−1 + αi+2t bai−1 . In this case, the matrix σ(v) is of the form:   A B (17) , C A with A = circ(α1 , α2 , . . . , α2t ), B = rcirc(α1+2t , α2+2t , . . . , α4t ) and C = rcirc(α1+3t , α2+3t , . . . , α4t , α1+2t , α2+2t , . . . , α3t ). We can now give a similar description of dicyclic codes as ideal in a skew poly- nomial ring. Let T = Z4 [x]/hx2n − 1i. We note that this is the ambient space for cyclic codes of length 2n. Let τ be a Z4 -automorphism of S defined by τ (x) = x−1 . Let An = T [y; τ ]/hy 2 − xn i, noting that y 2 − xn is central in T [y; τ ]. The ring An is a non-commutative ring with |An | = 44n . Advances in Mathematics of Communications Volume X, No. X (200X), X–XX Quaternary group ring codes: Ranks, Kernels and Self-dual codes 7 We can now make a correspondence in a canonical way between elements in the group ring and polynomials in the skew polynomial ring. For an element in Z4 Dic4n define X  X (18) µ αij ai bj = αij ai bj . Theorem 3. Let C be a left dicyclic code in Z4 Dic4n . Then µ(C) is a left ideal in An . Proof. Since C is closed under addition and multiplication, so is µ(C). Then we note that multiplication by x on the left corresponds to multiplication by the group element s and multiplication by y on the left corresponds to multiplication by b on the left. Moreover, yx = x−1 y and so yxy −1 = x−1 . Therefore, since C is a left ideal in Z4 Dic4n , µ(C) is a left ideal in An . 1.2. Quasi G-codes. As we have seen in Lemma 3, if C is a G-code, then Aut(C) contains the group G. For example, if C is a Cn -code, then Aut(C) contains Cn . It may of course contain other elements, specifically it is possible that Cn 6= Aut(C). The image of the cyclic code under the Gray map is a quasi-cyclic code. We shall now generalize this notion. If D is a code in Rsn with the coordinates partitioned into n sets of size s, where each set is assigned an element of G and the code is held invariant by the action of multiplying the coordinate set marker by every element of G, then the code D is called a quasi-group code of index s. The word group can be replaced by the specific group in question. For example, it might be a quasi-cyclic code or a quasi-dihedral code. Theorem 4. If C is an ideal in Z4 G where G is a finite group of order N , then φ(C) is a (possibly non-linear) quasi-group code of index 2 and length 2N . Proof. The length of the image is immediate from the definition of φ. Then since gv ∈ C, for all g ∈ G, we have that G acts on pairs of coordinates and gives a quasi-group code of index 2. Just as it is possible that G is not the full automorphism group of a G-code, it is also possible that a code may be a quasi-G code for different groups with possibly different partitions of the coordinates. Lemma 5. Let C1 and C2 be two G-codes over Z4 , then C1 ⊕ C2 is a G-code. Proof. Let v ∈ C1 , w ∈ C2 , α, β ∈ Z4 . Then gαv + gβw ∈ C1 ⊕ C2 and then g(αv + βw) ∈ C1 ⊕ C2 . Therefore, C1 ⊕ C2 is a G-code. Let C and D be linear codes over Z4 . We define C ∗ D as {u ∗ v | u ∈ C, v ∈ D}. Theorem 5. Let C1 and C2 be binary G-codes of length n. Then C = C1 ⊕ 2C2 is a quaternary G code. Moreover, if C1 ∗ C1 ⊆ C2 then the image under the Gray map is a linear quasi-G code of length 2n. Proof. It is well known, see [18] that if C1 ∗C1 ⊂ C2 then the code has a linear binary image. By the previous lemma, the code C is a quaternary G code since both C1 and C2 are held invariant by the action of G. Therefore the Gray image is a binary linear quasi-G code. This theorem shows that given binary G codes of length n we can construct binary quasi-G codes of length 2n by using quaternary codes. Advances in Mathematics of Communications Volume X, No. X (200X), X–XX 8 S.T. Dougherty, C. Fernández-Córdoba, R. Ten-Valls, B. Yildiz 2. Rank and Kernel We shall now examine the rank and kernel of G codes, viewed as an ideal in a group ring. When the size of the kernel of a code is the minimal size, we say that the kernel is a minimum. In the case the size of the kernel is the maximal, then we say that it is a maximum. The result is a broad generalization of the fact that the kernel of a cyclic code is cyclic, which can be found in [6]. Theorem 6. Let C be a linear code over Z4 . If C is a G-code, then K(C) is a G-code. Proof. Since K(C) is linear, all we need to show is that, for all g ∈ G, v ∈ I(K(C)), gv ∈ I(K(C)). We have v = I −1 (v) ∈ K(C). Then, we have to show that g(v) ∈ K(C); that is, by Lemma 2, 2g(v) ∗ w ∈ C for all w ∈ C. For w ∈ C, 2g(v) ∗ w = g(2v) ∗ w = g(2v ∗ g −1 w). Since v ∈ K(C), g −1 w ∈ C and I(C) is an ideal, we have 2v ∗ g −1 w ∈ C. Therefore I(K(C)) is an ideal of Z4 G. Similarly, the next result is a broad generalization of the fact that R(C) is cyclic when C is cyclic which can also be found in [6]. Theorem 7. Let C be a linear code over Z4 . If C is a G-code, then R(C) is a G-code. Proof. Since R(C) is linear, we only have to check that, for x ∈ I(R(C)) and g ∈ G, we have gx ∈ I(R(C)). If x = I −1 (x), then we have to check that g(x) ∈ R(C). By Lemma 2, that R(C) = hC, 2v∗w | v, w ∈ Ci. If x ∈ R(C), then x = u+2v∗w, for some u, v, w ∈ C. Since I(C) is an ideal, g(u), g(v), g(w) ∈ C. Then g(x) = g(u) + 2g(v) ∗ g(w) ∈ R(C) and so I(R(C)) is an ideal of Z4 G. Hence, for a G-code C over Z4 , we have (19) I(K(C)) ⊆ I(C) ⊆ I(R(C)). We summarize the relations between the codes in the following diagram. I φ Z4 G Zn4 F2n 2 I(R(C)) R(C) hφ(C)i I(C) (C) φ(C) I(K(C)) K(C) Ker(φ(C)) Theorem 8. Let C be a G-code over Z4 . Then K(C) is the intersection of all maximal G-codes Ci ⊆ C satisfying that φ(Ci ) is linear. Advances in Mathematics of Communications Volume X, No. X (200X), X–XX Quaternary group ring codes: Ranks, Kernels and Self-dual codes 9 Proof. We know that K(C) is the intersection of all maximal codes Ci ⊆ C such that φ(Ci ) is linear and, by Theorem 6, K(C) is a G-code. Let Ci ⊆ C be a maximal linear code over Z4 . We have K(C) ⊆ Ci . Since K(C) is a G-code, there exists a code Ci0 that is a G-code with K(C) ⊆ Ci0 ⊆ Ci . Hence, if K(C) is the intersection of such Ci , then K(C) is also contained in the intersection of such Ci0 which gives the result. Theorem 9. Let v ∈ Z4 G and C(v) be a G-code. Then C(2v) ⊆ K(C(v)). Proof. If w ∈ C(2v) then w ∈ C(v) and w has order 2, so 2w ∗ u = 0 ∈ C(v), for all u ∈ C(v), which implies w ∈ K(C(v)). Therefore, the minimal kernel for any code C(v) is C(2v) and we have C(2v) = K(C(v)) = C(v), for all v. Note that if v is of additive order 2 in Z4 G, then C(2v) = {0}. However, in this case, we have that φ(C(v)) is linear as it is shown in the following proposition. Proposition 1. Let v ∈ Z4 G and C(v) be a G-code. If v ∈ K(C(v)), then K(C(v)) = C(v). Pn Pn Proof. Let u ∈ C(v); that is, u = i=1 λi gi v, or u = i=1 λi gi (v), for λi ∈ Z4 . For Pn Pn all w ∈ C(v), we have that 2u∗w = 2( i=1 gi (v))∗w = i=1 gi (2v∗gi−1 (w)) ∈ C(v) because v ∈ K(C(v)) and, therefore, u ∈ K(C(v)). Corollary 1. Let v ∈ Z4 G and C(v) be a G-code. If v has additive order 2 in Z4 G then K(C(v)) = C(v). Proof. If v has additive order 2, then for all u ∈ C(v), 2v ∗ u = 0 ∈ C(v) and v ∈ K(C). Therefore, the results follows by Proposition 1. It is proven in [8] that if I(C) is an ideal in Z4 G then I(C ⊥ ) is an ideal in Z4 G. The following gives an example where the kernel of a group code over Z4 is a minimum for all groups G. Specifically, where K(C(v)) = C(2v). Theorem 10. Let v = 1eG − h for some h ∈ G − {eG }, where eG is the identity element of the group G. Then |C(v)| = 4n−2 , C(v) = h1 n2 i⊥ × h1 n2 i⊥ , where K(C(v)) = 2(C(v)) = C(2v) and R(C(v)) = hC(v), (2, 0, 0, . . . , 0), (0 n2 , 2, 0, 0, . . . , 0)i. Proof. It is immediate that |C(v)| = 4n−2 , by examining the generator matrix σ(v) and seeing the code as h1 n2 i⊥ × h1 n2 i⊥ . Then for every gv there exists g 0 v where 2(gv) ∗ (g 0 v) = (0, 0, . . . , 0, 2, 0, . . . , 0) which is not in C(v). It follows that the kernel is a minimum. It is a simple conse- quence that R(C) is hC(v), (2, 0, 0, . . . , 0), (0 n2 , 2, 0, 0, . . . , 0)i. Namely, we have ad- joined 2gv ∗ (g 0 v) and that gives us the rank. Advances in Mathematics of Communications Volume X, No. X (200X), X–XX 10 S.T. Dougherty, C. Fernández-Córdoba, R. Ten-Valls, B. Yildiz 2.1. Rank and kernel of I(C) for some families of codes. Recall that the minimal kernel of a code C(v) is given when K(C(v)) = C(2v) and the maximal when K(C(v)) = C(v). In this section we will see that there exist G-codes with both minimal and maximal kernel when G is Cn , D2n and Dic4t . The rank and kernel of cyclic codes over Z4 were studied in [6]. In that paper, it was shown that there exist cyclic codes over Z4 with the minimal and maximal kernels. We give just some example. Example 2. Consider the cyclic code of length n generated by the polynomial x−1, that is, the ideal C1 = hx − 1i in Z4 [x]/hxn − 1i. Theorem 10 gives that for this code K(C1 ) is a minimum. The code C2 = h2(x − 1)i has K(C2 ) = C and hence the kernel is a maximum. In fact, in Theorem 17 in [6], if C = hf (x)h(x) + 2f (x)i is a quaternary cyclic code of odd length n = p2 and xn − 1 = (x − 1)a(x)b(x) with a(x) and b(x) irreducible polynomials over Z4 , then for h(x) = 1 and f (x) = a(x), we have K(C) = h1 + x + · · · + xn−1 + 2a(x)i. Moreover, if f (x) = b(x) then K(C) = C. P Theorem 11. Let G be the dihedral group D2t . Let v = αi gi , with αi = 0 if gi = abs . Then C(v) = C1 × C2 , with C1 and C2 cyclic codes, and (20) K(C) = K(C1 ) × K(C2 ) and (21) R(C) = R(C1 ) × R(C2 ). Proof. If αi = 0, when gi = bs a, then the generator matrix σ(v) is of the form   A 0 (22) 0 A with A generating a cyclic code. The result follows. Example 3. Consider the dihedral group D2t . Let v = 1−b, then Theorem 10 gives K(C(v)) = C(2v), hence it is a minimum. As in the previous example, if v = 2 − 2b, then K(C(v)) = C(v) and hence it is a maximum. Let C1 and C2 be quaternary cyclic codes of odd length n = p2 and xn − 1 = (x − 1)ab with a and b irreducible polynomials over Z4 . Let C1 = C2 = hb, 2bgi. Let C be the dihedral code C = C1 × C2 as given in Theorem 11. By Theorem 11, we have K(C) = C and the kernel is a maximum. Theorem 10 has already given examples of dihedral codes with minimum kernel. Therefore we have the following. Theorem 12. There exists dihedral codes with minimal kernel and with maximal kernel. Example 4. For length 4, (here the dihedral group is really the Klein 4 group), it is a simple computation to see that, for all v, we have K(v) = C(v) = R(v). We can now mimic the technique used in Theorem 11 to get a similar result for dicyclic codes. P Theorem 13. Let G be the dicyclic group Dic4t . Let v = αi gi , with αi+2t = 0 for i ∈ {1, . . . , 2t}. Then C(v) = C1 × C2 , where C1 and C2 are cyclic codes and (23) K(C) = K(C1 ) × K(C2 ) Advances in Mathematics of Communications Volume X, No. X (200X), X–XX Quaternary group ring codes: Ranks, Kernels and Self-dual codes 11 and (24) R(C) = R(C1 ) × R(C2 ). Proof. If αi = 0, when i > 2t, then the generator matrix σ(v) is of the form   A 0 (25) 0 A with A generating a cyclic code. The result follows. Again using Theorem 17 in [6], we can let C1 and C2 be quaternary cyclic codes of odd length n = p2 and xn − 1 = (x − 1)a(x)b(x) where a(x) and b(x) are irreducible polynomials. Let C1 = C2 = hb(x), 2b(x)g(x)i. Let C be the dicyclic code C = C1 ×C2 as given in Theorem 13. Hence, by Theorem 13, we have that K(C) = C and the kernel is a maximum. Theorem 10 has already given examples of dicyclic codes with minimum kernel. Therefore we have the following. Theorem 14. There exists dicyclic codes with minimal kernel and with maximal kernel. 3. Self-dual codes We will discuss self-dual dihedral and dicyclic codes over Z4 in this section. Self-dual codes over the ring Z4 were first studied in [3]. Self-dual codes are an important class of codes as they are related to many other structures such as lattices, designs, etc. In particular, self-dual codes over Z4 have been used to construct even unimodular lattices in [1]. Many of the construction methods in the literature for self-dual codes use genera- tor matrices of the form [In |A], with A a special type of matrix, such as a circulant or bordered circulant matrix. However, self-dual codes obtained from these con- structions all fall into the category of free self-dual codes. It is well known from [3] that free self-dual codes over Z4 exist only for lengths that are multiples of 8. Thus, following these constructions would restrict the lengths of the self-dual codes that we can obtain quite considerably. The dihedral and dicyclic matrix structures that we have discussed above suggest an alternative way of constructing self-dual codes over Z4 , through which we could obtain self-dual codes of different lengths. It is well known that self-dual codes over Z4 exist for all lengths, see [3] or [5]. However, we are concerned with self-dual codes that are also group codes. Therefore, we are only concerned with lengths that are the order of a finite group. So for example, dihedral codes only exist for even lengths and dicylic codes only exist for lengths a multiple of 4. The following existence theorem shows that if the length is appropriate then there is a self-dual Z4 group code of that length. Theorem 15. For any positive integer n, there exists a self-dual Z4 G-codes for all finite groups G with |G| = n. Proof. Let C be the code of length 1 generated by 2, namely C = {0, 2}. This code is a self-dual code of length 1. Let C be a linear code over Z4 and let Cn = {(c, . . . , c) : c ∈ C} be the n-fold direct product of C. Since the direct product of quaternary self-dual codes is self-dual we have that Cn is a quaternary self-dual code of length n, see [5] for details. Advances in Mathematics of Communications Volume X, No. X (200X), X–XX 12 S.T. Dougherty, C. Fernández-Córdoba, R. Ten-Valls, B. Yildiz If τ is any permutation of the coordinates of C we have τ (C) = C. Therefore C is held invariant by the action of any group. Therefore, C is a self-dual G code of length n for any group G of order n. Naturally, the minimum Lee distance of all the self-dual codes that are generated by Theorem 15 is 2, which is, in general, not of interest for longer lengths. Cyclic self-dual codes over Z4 have been studied in [18]. Now we will study self- dual dihedral and dicyclic codes. For the rest of the section, the computer searches have been done by using the computer algebra system Magma [2]. 3.1. Self-dual dihedral codes. We begin with a theorem which follows natu- rally from the fact that the dihedral code is the semi-direct product of Z4 -cyclic codes as it was mentioned in Section 1.1.2. Theorem 16. Let C and D be self-dual cyclic codes of length n. Then C n D is a self-dual Dihedral code of length 2n. Proof. We have that C n D is a dihedral code. Then if v1 , w1 ∈ C and v2 , w2 ∈ D then [v1 n w1 , v2 n w2 ] = [v1 , w1 ] + [v2 , w2 ] = 0 + 0 = 0. Therefore, the code is self-dual. We ran some computer searches for all dihedral self-dual Z4 -codes of lengths 4, 6, 8, 10 and 12. The results we obtained are of interest. Table 1. (Extremal) Dihedral Self-dual Codes of length 4 First Row of A First row of B Min Lee Weight Lee Weight Distribution (1,1) (1,3) 4 1 + 14z 4 + z 8 (1,1) (3,1) 4 1 + 14z 4 + z 8 (1,3) (1,1) 4 1 + 14z 4 + z 8 (1,3) (3,3) 4 1 + 14z 4 + z 8 (3,1) (1,1) 4 1 + 14z 4 + z 8 (3,1) (3,3) 4 1 + 14z 4 + z 8 (1,3) (1,3) 4 1 + 14z 4 + z 8 (3,3) (3,1) 4 1 + 14z 4 + z 8 Remark 1. Note that the Lee weight distribution of all the self-dual codes obtained in Table 1 is the same as the Hamming weight distribution of the extended binary Hamming code, which is an extremal Type II code of length 8. In fact, it turns out that the Gray image of all the codes in Table 1 are linear over the binary field, and moreover they are all self-dual. So, the Gray maps of codes in Table 1 are precisely the extended binary Hamming code of length 8. Remark 2. We obtained many self-dual dihedral codes of length 8 and minimum Lee distance 4. We just put a few of them in Table 2, which represent the typical case. Unlike the case of length 4, we obtained both Type I and Type II weight enumerators for extremal binary self-dual codes of length 16. Indeed, upon checking the Gray images, we see that the Gray images of all the self-dual dihedral codes of length 8 and minimum Lee distance 4 are (linear) extremal binary self-dual codes of length 16, with some being Type I and some Type II. Advances in Mathematics of Communications Volume X, No. X (200X), X–XX Quaternary group ring codes: Ranks, Kernels and Self-dual codes 13 Table 2. (Extremal) Dihedral Self-dual Codes of length 8 First Row of A First row of B Min Lee Weight Lee Weight Distribution (0,0,2,2) (1,1,3,1) 4 1 + 28z 4 + 198z 8 + . . . (0,0,0,0) (1,3,1,1) 4 1 + 28z 4 + 198z 8 + . . . (0,0,0,2) (3,1,3,1) 4 1 + 12z 4 + 64z 6 + 102z 8 + . . . (0,0,2,0) (1,1,3,3) 4 1 + 12z 4 + 64z 6 + 102z 8 + . . . Upon running an exhaustive search over all dihedral self-dual codes of length 6 and 10 we found that the highest minimum Lee distance is 2 and when we ran the search over all dihedral self-dual codes of length 12, the highest minimum Lee distance that we obtained turned out to be 4. 3.2. Self-dual dicyclic codes. We first recall that, because of their structure, dicyclic codes have to be of lengths 4k for k ∈ Z+ . Thus, we searched over all self-dual dicyclic Z4 -codes of lengths 4, 8 and 12. Out of the many self-dual codes of best parameters that we obtained, we put a sample in the following table: Table 3. Best Dicyclic Self-dual Codes of lengths 4, 8 and 12 n 1st row of A 1st row of B 1st row of C Min Lee Weight Gray Image Linear 4 (1,3) (3,3) (3,3) 4 Yes 8 (0,0,0,2) (3,3,3,3) (3,3,3,3) 4 Yes 8 (0,0,1,1) (0,0,1,3) (1,3,0,0) 4 No 8 (0,0,1,1) (0,1,1,2) (1,2,0,1) 6∗ No 12 (0,0,0,0,0,0) (0,1,3,0,1,1) (0,1,1,0,1,3) 4 Yes Remark 3. In Table 3, the code marked with ∗ is the well-known octacode, which is a self-dual code of length 8, whose binary image is a non-linear code of length 16, size 28 and minimum distance 6. This is better than the best known binary linear code of the same length and dimension, as the minimum distance of a binary linear code of length 16 and dimension 8 can be at most 5. Thus we have obtained the octacode from the dicyclic construction. Remark 4. An exhaustive search reveals that all the dicylic self-dual codes of lengths 4 and 12 have 4 as the highest minimum Lee distance and all such examples have linear Gray map images. 4. Conclusion As a broad generalization of cyclic codes we have studied G-codes over the ring Z4 , which are codes held invariant by the action of a finite group G. As an analogue to the results for cyclic codes, we have shown that the quaternary kernel and rank of a G-code is itself a G-code. We have found bounds for the size of the kernel and gave examples of minimal and maximal kernels for G-codes. Examining the image of G-codes under the canonical Gray map, we have shown how to construct binary quasi-G codes. Finally, we have studied self-dual G-codes and given examples for the dihedral and dicyclic groups, in particular we have been able to obtain the octacode from the dicyclic construction. Advances in Mathematics of Communications Volume X, No. X (200X), X–XX 14 S.T. Dougherty, C. Fernández-Córdoba, R. Ten-Valls, B. Yildiz We believe quaternary G-codes are a deep topic that would warrant further studies. As possible directions for future research, we can suggest different groups than dicyclic and dihedral groups, or a search for self-dual codes of higher lengths. Different rings than Z4 can also be considered within the same context. References [1] E. Bannai, S.T. Dougherty, M. Harada and M. Oura, “Type II codes, even unimodular lattices, and invariant rings”, IEEE Trans. Inform. Theory, Vol. 45, No. 4, pp. 1194–1205, 1999. [2] W. Bosma, J.J. Cannon, C. Fieker, A. Steel: Handbook of Magma functions, Edition 2.22 5669 pages (2016). http://magma.maths.usyd.edu.au/magma/. [3] J. H. Conway and N. J. A. Sloane, “Self-dual codes over the integers modulo 4”, J. Combin. Theory Ser. A, Vol. 62, No. 1, pp. 30–45, 1993. [4] S.T. Dougherty, “Algebraic Coding Theory Over Finite Commutative Rings”, SpringerBriefs in Mathematics. Springer, Cham, 2017, ISBN: 978-3-319-59805-5; 978-3-319-59806-2. [5] S.T. Dougherty and C. Fernández-Córdoba, “Codes over Z2k , Gray maps and Self-Dual Codes”, Adv. in Math. of Commun., Vol. 5, No. 4, pp. 571–588, 2011. [6] S.T. Dougherty and C. Fernández-Córdoba, “Kernels and Ranks of Cyclic and Negacyclic Quaternary Codes”, Des. Codes Cryptogr., Vol. 81, No. 2, pp. 347–364, 2016. [7] S.T. Dougherty, C. Fernández-Córdoba and R. Ten-Valls, “Quasi-Cyclic Codes as Cyclic Codes over a Family of Local Rings”, Finite Fields Appl., Vol. 40, pp. 138–149, 2016. [8] S.T. Dougherty, J. Gildea, R. Taylor and A. Tylshchak, “Group Rings, G-Codes and Con- structions of Self-Dual and Formally Self-Dual Codes”, Des. Codes Cryptogr., Online: 10.1007/s10623-017-0440-7. [9] C. Fernández-Córdoba, J. Pujol and M. Villanueva, “On rank and kernel of Z4 -linear codes”, Lecture Notes in Computer Science, No. 5228, pp. 46–55, 2008. [10] R. A. Ferraz, F.S. Dutra, C. Polcino Milies, “Semisimple group codes and dihedral codes”, Algebra Discrete Math, Vol. 3, pp. 28–48, 2009. [11] M. Guerreiro, “Group algebras and coding theory”, So Paulo Journal of Mathematical Sci- ences, Vol. 10, pp.346–371, 2016. [12] J. Gildea, A. Kaya, R. Taylor and B. Yildiz, “Constructions for self-dual codes induced from group rings”, Finite Fields Appl., Vol. 51, pp. 71–92, 2018. [13] A. R. Hammons, P. V. Kumar, A. R. Calderbank, N. J. A. Sloane and P. Solé, “The Z4 - linearity of Kerdock, Preparata, Goethals, and related codes”, IEEE Trans. Inform. Theory, Vol. 40, No. 2, pp. 301–319, 1994. [14] T. Hurley, “Group Rings and Rings of Matrices”, Int. Jour. Pure and Appl. Math, Vol. 31, No. 3, pp. 319–335, 2006. [15] F.J. MacWilliams, “Binary codes which are ideals in the group algebra of an Abelian group”, Bell System Tech. J., Vol. 49, pp. 987–1011, 1970. [16] F. J. MacWilliams, “Codes and ideals in group algebras”, Combinatorial Mathematics and its Applications (Proc. Conf., Univ. North Carolina, Chapel Hill, N.C., 1967) pp. 317–328, Univ. North Carolina Press, Chapel Hill, N.C., 1969. [17] O. Ore, “Theory of non-commutative polynomials”, Annals of Mathematics, Vol. 34, No. 3, pp. 480-508, 1933. [18] V. Pless, P. Solé and Z. Qian, “Cyclic self-dual Z4 -codes, with an appendix by Pieter Moree”, Finite Fields Appl., Vol. 3, No. 1, pp. 48–69, 1997. [19] V. Pless and Z. Qian, “Cyclic codes and quadratic residue codes over Z4 ”, IEEE Trans. Inform. Theory, Vol. 42, No. 5, pp. 1594–1600, 1996. [20] D. J. S. Robinson, “A course in the Theory of Groups”, Graduate Texts in Mathematics Vol. 80, Springer-Verlag, 1993. Advances in Mathematics of Communications Volume X, No. X (200X), X–XX