1 Introduction

Codes over rings were introduced in early seventies. These studies received a great attention after a breakthrough paper by Hammons et al. (1994), where certain good non-linear binary codes were obtained as images of some linear codes over \({\mathbb {Z}}_4\) under a map, called the Gray map. Since then, several families of codes have been studied over various finite ring structures. Most of these studies are concentrated over finite chain rings (Cao 2013; Dinh and López-permouth 2004). Recently, researchers also studied linear codes over finite non-chain rings. Unlike chain rings, the algebraic structure of non-chain rings do not possess any common pattern, and linear codes over these rings do not have any compact form. Zhu et al. (2010) constructed some binary optimal codes as Gray images of cyclic codes over the non-chain ring \({\mathbb {F}}_2+v{\mathbb {F}}_2, v^2=v\). Generalizing these results, Bayram and Siap (2014), have studied cyclic and constacyclic codes over \({\mathbb {Z}}_p[v]/\left\langle v^p -v \right\rangle \). Some lower and upper bounds on the covering radius of repetition codes, simplex codes and MacDonald codes with Chinese Euclidean distance over the finite non-chain ring \({\mathbb {F}}_2+v{\mathbb {F}}_2\) with \(v^2=v\) are determined in Gao et al. (2018). Further, Wang and Gao (2019) have studied MacDonald codes over the finite non-chain ring \({\mathbb {F}}_p+v{\mathbb {F}}_p+v^2{\mathbb {F}}_2\) and their applications in constructing secret sharing schemes and associations schemes, where p is a prime and \(v^3=v\).

Many good quantum error correcting codes and DNA codes are constructed from cyclic codes over finite non-chain rings (Ashraf and Mohammad 2016; Dinh et al. 2019, 2018; Shi and Lu 2019).

More recently, linear codes are also studied over mixed alphabets. Borges et al. (2009) have studied \({\mathbb {Z}}_2{\mathbb {Z}}_4\)-additive codes. Wherein, the set of coordinates is partitioned into two parts such that the projections of a \({\mathbb {Z}}_2{\mathbb {Z}}_4\)-additive code on these coordinates are a binary code and a quaternary code. These additive codes were later generalized to \({\mathbb {Z}}_{p^r}{\mathbb {Z}}_{p^s}\)-additive codes (Aydogdu and Siap 2014). In Borges and Fernàndez-Còrdoba (2017), Borges et al. have studied the algebraic structure of \({\mathbb {Z}}_2\)-double cyclic codes as \({\mathbb {Z}}_2[x]\)-submodules of \(\frac{{\mathbb {Z}}_2[x]}{\langle x^r-1\rangle }\times \frac{{\mathbb {Z}}_2[x]}{\langle x^s-1\rangle }\). In this study, the authors have determined the generating polynomials of \({\mathbb {Z}}_2\)-double cyclic codes and their duals. Similarly, the structure of \({\mathbb {Z}}_4\)-double cyclic codes and \({\mathbb {Z}}_2+u{\mathbb {Z}}_2+u^2{\mathbb {Z}}_2\)-double cyclic codes have been studied in Gao et al. (2016) and Yao et al. (2015), respectively. Gao et al. (2016), determined the generator polynomials of duals of free \({\mathbb {Z}}_4\)-double cyclic codes, and obtained some optimal or suboptimal non-linear binary codes from these family of codes. Diao et al. (2019) have studied the structure of \({\mathbb {Z}}_p{\mathbb {Z}}_p[v]\)-additive cyclic codes and constructed some good quantum codes as their Gray images. A double cyclic code is in fact a generalized quasi-cyclic (GQC) code of index two. Siap and Kulhan (2005) introduced GQC codes over finite fields, and the study has been extended to various finite rings (Bhaintwal and Wasan 2009; Cao 2011; Esmaeili and Yari 2009). Generalizing these concepts further, Aydin and Halilović (2017) have studied Multi-twisted codes, a generalization of quasi-twisted codes. Gao et al. (2016), have studied the structural properties skew GQC codes over finite fields by giving Chinese Reminder Theorem in the skew polynomial ring \({\mathbb {F}}_q[x,\sigma ]\), which leads to a canonical decomposition of skew GQC codes. Similarly, by using the Chinese Remainder Theorem, structural properties and decompositions of GQC codes with arbitrary lengths over the ring \({\mathbb {F}}_q+u{\mathbb {F}}_q\), where \(u^2=0, q=p^n\), n a positive integer and p a prime number, are investigated in Gao et al. (2014). Motivated by these studies, in this paper we introduce and study the algebraic structure of double cyclic codes over the ring \(\mathrm {R}={\mathbb {F}}_4+v{\mathbb {F}}_4,\ v^2=v\). We determine the generating polynomials of \(\mathrm {R}\)-double cyclic codes and their duals. We also investigate some algebraic properties of double constacyclic codes and their duals over \(\mathrm {R}\).

The paper is organized as follows. In Sect. 2, we give some basic definitions and recall some structural properties of cyclic codes over \(\mathrm {R}\). In Sect. 3, we present the generator polynomials of \({\mathbb {F}}_4\)-double cyclic codes, and study \(\mathrm {R}\)-double cyclic codes as direct sum of \({\mathbb {F}}_4\)-double cyclic codes. We determine the general form of the generator polynomials of \(\mathrm {R}\)-double cyclic codes and their duals. We give a mass formula to enumerate \(\mathrm {R}\)-double cyclic codes of length \((2^{e_1}, 2^{e_2})\), where \(e_1\) and \(e_2\) are positive integers. In Sect. 4, we determine the structural properties of \(\mathrm {R}\)-double constacyclic codes.

2 Preliminaries

Let \({\mathbb {F}}_4=\{0,1,w,1+w\}\) be the finite field with four elements, where \(w^2=1+w\). Throughout this paper, \(\mathrm {R}\) denote the commutative ring \({\mathbb {F}}_4+v{\mathbb {F}}_4=\{a+vb \mid a,b \in {\mathbb {F}}_4\}\) with \(v^2=v\). \(\mathrm {R}\) is a finite non-chain ring with sixteen elements and of characteristic two. The unit elements in \(\mathrm {R}\) are \(\{ 1, w, w + 1, v +w, 1 + v + w, 1 +vw, 1 + v + vw, 1 + w + vw, v + w + vw \}\), while the non-units are \(\{0,v, vw,1+v, v+vw, w+vw, 1+v+w+vw \}\). Further, \(\mathrm {R}\) is a semi-local Frobenius ring with two maximal ideals \(\langle v \rangle \) and \(\langle 1+v \rangle \). From the Chinese Remainder Theorem, any element \(a+vb\) in \(\mathrm {R}\) can uniquely be expressed as \(a+vb=(1+v)a+v(a+b)\). More information about the ring can be found in Bayram et al. (2016).

A linear code \(\mathrm {C}\) of length n over \(\mathrm {R}\) is an \(\mathrm {R}\)-submodule of \(\mathrm {R}^n\). The dual code \(\mathrm {C}^\bot \) of \(\mathrm {C}\) is defined as \(\mathrm {C}^\bot =\{y\in \mathrm {R}^n \mid c\cdot y=0,\ \forall c\in \mathrm {C}\}\), where \(c\cdot y\) is the standard Euclidean inner product of c and y in \(\mathrm {R}^n\). A code \(\mathrm {C}\) is self-orthogonal if \(\mathrm {C}\subseteq \mathrm {C}^\bot \), and self-dual if \(\mathrm {C}=\mathrm {C}^\bot \).

The Hamming weight \(w_H(c)\) of any \(c\in {\mathbb {F}}_4^n\) is the number of non-zero coordinates in c. The Hamming distance between any two elements \(c_1\) and \(c_2\) in \({\mathbb {F}}_4^n\) is defined as \(d_H(c_1,c_2)=w_H(c_1-c_2)\). The minimum Hamming distance of a linear code \(\mathrm {C}\), denoted by \(d_H(\mathrm {C})\), is the minimum of the Hamming weights of non-zero codewords in \(\mathrm {C}\).

Now, recall the definition of the Gray map which was defined in Gursoy et al. (2014) as follows:

$$\begin{aligned}&\phi : \mathrm {R}\rightarrow {\mathbb {F}}_4^2 \\&\phi (a+vb)=(a+b,a), \end{aligned}$$

where \(a,b \in {\mathbb {F}}_4\). This map can be extended naturally to the case over \(\mathrm {R}^n\).

The Lee weight of any \(c\in \mathrm {R}^n\) is the Hamming weight of its Gray image, i.e., \(w_L(c)=w_H(\phi (c))\). The Lee distance between xy in \(\mathrm {R}\) is defined by \(d_L(x-y)=w_L(x-y)\). The minimum Lee distance between distinct pairs of codewords of a linear code \(\mathrm {C}\) over \(\mathrm {R}\) is called the minimum distance of \(\mathrm {C}\) and denoted by \(d_L(C)\) or shortly \(d_L\). Further, it is easy to check that \(\phi \) is a linear isometry from \((\mathrm {R}^n,\ d_L)\) to \(({\mathbb {F}}_4^{2n},\ d_H)\). Therefore, if \(\mathrm {C}\) is a linear code of length n over \(\mathrm {R}\) with \(4^k\) codewords and minimum Lee distance d, then \(\phi (\mathrm {C})\) is a [2nkd]-linear code over \({\mathbb {F}}_4\) (Gursoy et al. 2014).

Recall that, for any two sets A and B, the operations \(\oplus \) and \(\otimes \) are defined as \(A\oplus B=\{a+b \ \mid \ a\in A,\ b\in B \}\), \(A\otimes B=\{ (a,b) \ \mid \ a\in A,\ b\in B \}\). Also note that, for any linear code \(\mathrm {C}\) of length n over \(\mathrm {R}\) the two sets \(\mathrm {C}_1=\{x\in {\mathbb {F}}_4^n \ \mid \ x+vy \in \mathrm {C}\ \text{ for } \text{ some }\ y\in {\mathbb {F}}_4^n\}\) and \(\mathrm {C}_2=\{x+y\in {\mathbb {F}}_4^n \ \mid \ x+vy \in \mathrm {C}\}\) are linear codes of length n over \({\mathbb {F}}_4\).

Following these notations, the following theorem gives the structure of linear codes over \(\mathrm {R}\) and their Gray images. The results follows directly from Gursoy et al. (2014) for \(q=2^2\).

Theorem 1

Gursoy et al. (2014) Let \(\mathrm {C}\) be a linear code of length n over the ring \(\mathrm {R}\). Then \(\mathrm {C}\) can be uniquely expressed as \(\mathrm {C}=(1+v)\mathrm {C}_1\oplus v\mathrm {C}_2\), where \(\mathrm {C}_1=\{x\in {\mathbb {F}}_4^n \ \mid \ x+vy \in \mathrm {C}\ \text{ for } \text{ some }\ y\in {\mathbb {F}}_4^n\}\) and \(\mathrm {C}_2=\{x+y\in {\mathbb {F}}_4^n \ \mid \ x+vy \in \mathrm {C}\}\). Further, if \(\mathrm {C}_1\) and \(\mathrm {C}_2\) are linear codes over \({\mathbb {F}}_4\) with dimensions \(k_1,k_2\) and minimum Hamming distances \(d_H(\mathrm {C}_1),d_H(\mathrm {C}_2)\), respectively, then \(\phi (\mathrm {C})\) is a \([2n, k_1+k_2,\ \mathrm {min}\{d_H(\mathrm {C}_1), d_H(\mathrm {C}_2)\}]\)-linear code over \({\mathbb {F}}_4\). Also, the dual code of \(\mathrm {C}\) is \(\mathrm {C}^\bot =(1+v)\mathrm {C}_1^\bot \oplus v\mathrm {C}_2^\bot \).

Theorem 2

Gursoy et al. (2014) Let \(\mathrm {C}=(1+v)\mathrm {C}_1\oplus v\mathrm {C}_2\) be a linear code over \(\mathrm {R}\), and \(G_1\) and \(G_2\) be the generator matrices of \({\mathbb {F}}_4\)-linear codes \(\mathrm {C}_1\) and \(\mathrm {C}_2\), respectively. Then the generator matrix of \(\mathrm {C}\) is \(\left( \begin{array}{c} (1+v)G_1 \\ vG_2\end{array} \right) \).

Theorem 3

Let \(\mathrm {C}=(1+v)\mathrm {C}_1\oplus v\mathrm {C}_2\) be a linear code of length n over \(\mathrm {R}\) and \(G_1,\ G_2\) be the generator matrices of \({\mathbb {F}}_4\)-linear codes \(\mathrm {C}_1\) and \(\mathrm {C}_2\), respectively. Then, the generator matrix of \(\phi (\mathrm {C})\) is \(\left( \begin{array}{cc} G_1 &{} 0\\ 0 &{} G_2\end{array} \right) \).

Proof

The proof follows from the definition of the Gray map \(\phi \) and Theorm 2. \(\square \)

Let \(\sigma \) be the cyclic shift operator on \(\mathrm {R}^n\) such that, \(\sigma (c_0,c_1,\ldots ,c_{n-1})=(c_{n-1},c_0,\ldots ,c_{n-2})\). A linear code \(\mathrm {C}\) of length n over \(\mathrm {R}\) is called a cyclic code if \(\sigma (\mathrm {C})=\mathrm {C}\). Let \(\mathrm {R}_n\) denote the quotient ring \(\mathrm {R}[x]/ \langle x^n-1\rangle \). Identifying each n-tuple \((c_0,c_1,\ldots ,c_{n-1})\in \mathrm {R}^n\) with the polynomial \(c_0+c_1x+\cdots + c_{n-1} x^{n-1}\in \mathrm {R}_n\), we see that \(\mathrm {C}\) is a cyclic code of length n over \(\mathrm {R}\) if and only if \(\mathrm {C}\) is an ideal of \(\mathrm {R}_n\). Further, \(\mathrm {C}\) is a \(\lambda \)-constacyclic code if \((\lambda c_{n-1}, c_0, \ldots , c_{n-2})\in \mathrm {C}\) whenever \((c_0,c_1,\ldots ,c_{n-1})\in \mathrm {C}\), where \(\lambda \) is a unit in \(\mathrm {R}\). Also, \(\mathrm {C}\) is a \(\lambda \)-constacyclic code if and only if \(\mathrm {C}\) is an ideal of \(\frac{\mathrm {R}[x]}{\langle x^n-\lambda \rangle }\) (Gao et al. 2017).

Theorem 4

Gursoy et al. (2014) Let \(\mathrm {C}=(1+v)\mathrm {C}_1\oplus v\mathrm {C}_2\) be a linear code of length n over \(\mathrm {R}\). Then \(\mathrm {C}\) is a cyclic code over \(\mathrm {R}\) if and only if \(\mathrm {C}_1\) and \(\mathrm {C}_2\) are cyclic codes over \({\mathbb {F}}_4\). Further, if \(\mathrm {C}_1=\langle g_1(x)\rangle \) and \(\mathrm {C}_2=\langle g_2(x)\rangle \), then \(\mathrm {C}=\langle (1+v)g_1(x)+vg_2(x)\rangle \).

The following result characterizes the generator polynomials of a cyclic code over \(\mathrm {R}\):

Theorem 5

Let \(\mathrm {C}\) be a cyclic code in \(\mathrm {R}_n\).

  1. 1.

    If the least degree polynomial in \(\mathrm {C}\) is monic, then \(\mathrm {C}=\langle g(x)\rangle \), where \(g(x)\in {\mathbb {F}}_4[x]/\left\langle x^n-1 \right\rangle \) such that \(g(x)|(x^n-1)\).

  2. 2.

    If \(\mathrm {C}\) has no monic polynomial of least degree, then \(\mathrm {C}=\langle vf_1(x)\rangle \) or \(\mathrm {C}=\langle (1+v)f_1(x)\rangle \) or \(\mathrm {C}=\langle vf_1(x),(1+v)f_2(x)\rangle \), where \(f_1(x), f_2(x) \in {\mathbb {F}}_4[x]/\left\langle x^n-1 \right\rangle \).

  3. 3.

    If \(\mathrm {C}\) contain some monic polynomials and least degree polynomials that are non-monic, then \(\mathrm {C}=\langle g(x),vf_1(x)\rangle \) or \(\mathrm {C}=\langle g(x),(1+v)f_2(x)\rangle \) or \(\mathrm {C}=\langle vf_1(x),(1+v)f_2(x)\rangle \), where \(f_1(x), f_2(x) \in {\mathbb {F}}_4[x]/\left\langle x^n-1 \right\rangle \) and g(x) is the monic polynomial of least degree in \(\mathrm {C}\).

In the examples given below, the parameters marked with ‘\(*\)’ denote an optimal code according to Grassl (2020).

Example 1

Let \(\mathrm {C}=\langle x+1\rangle \) be a cyclic code of length 3 over \(\mathrm {R}\). Clearly, \(\mathrm {C}\) is a free cyclic code with parameters [3, 2, 2]. Also, it is easy to see that \(\mathrm {C}_1=\langle x+1\rangle \) and \(\mathrm {C}_2=\langle x+1\rangle \). As \(\mathrm {C}_1\) and \(\mathrm {C}_2\) are cyclic codes over \({\mathbb {F}}_4\) with parameters \([3,2,2]^*\) and \([3,2,2]^*\), respectively, we have \(\phi (\mathrm {C})\) a \([6,4,2]^*\)-quasi-cyclic code of index two over \({\mathbb {F}}_4\).

Example 2

Let \(n=4\) and \(\mathrm {C}=(1+v)\mathrm {C}_1\oplus v\mathrm {C}_2\) be a cyclic code of length n over \(\mathrm {R}\), where \(\mathrm {C}_1=\langle x+1\rangle \) and \(\mathrm {C}_2=\langle x+1\rangle \). As \(\mathrm {C}_1\) and \(\mathrm {C}_2\) are cyclic codes of length 4 over \({\mathbb {F}}_4\) with parameters \([4,3,2]^*\) and \([4,3,2]^*\), respectively, \(\phi (\mathrm {C})\) is a \([8,6,2]^*\)-linear code over \({\mathbb {F}}_4\).

3 Double cyclic codes over \(\mathrm {R}\)

In this section, we study some the structural properties of \(\mathrm {R}\)-double cyclic codes and their duals by determining their generator polynomials. Also, we give a complete classification of \(\mathrm {R}\)-double cyclic codes of length \((2^{e_1},2^{e_2})\). We enumerate such codes by giving mass formula. It may be noted here that \(\mathrm {R}\)-double cyclic codes are in fact generalized quasi-cyclic codes of index two over \(\mathrm {R}\). Also, it is obvious to see that an \(\mathrm {R}\)-double cyclic code of length (rs) is a cyclic code over \(\mathrm {R}\) of length r or s whenever \(s=0\) or \(r=0\), respectively.

Let r and s be two non-negative integers and \(n=r+s\). The n coordinates of each n-tuple in \(\mathrm {R}^n\) can be partitioned into two sets of sizes r and s. Then, \(\mathrm {R}^n\) can be treated as an \(\mathrm {R}\)-submodule of \(\mathrm {R}^r\times \mathrm {R}^s\), and any linear code \(\mathrm {C}\) of length n over \(\mathrm {R}\) is an \(\mathrm {R}\)-submodule of \(\mathrm {R}^r\times \mathrm {R}^s\).

For any element \(c=(c_{10},c_{11},\ldots ,c_{1\ r-1} \mid c_{20},c_{21},\ldots ,c_{2\ s-1})\) in \(\mathrm {R}^r \times \mathrm {R}^s\), we define the double cyclic shift of c as follows:

$$\begin{aligned} \tau (c)=(c_{1\ r-1}, c_{10},\ldots ,c_{1\ r-2} \mid c_{2\ s-1},c_{20},\ldots ,c_{2\ s-2}). \end{aligned}$$

Definition 1

A linear code \(\mathrm {C}\) of length \(n=r+s\) over \(\mathrm {R}\) is called an \(\mathrm {R}\)-double cyclic code of length (rs) if \(\tau (c) \in \mathrm {C}\) whenever \(c\in \mathrm {C}\).

Now, we identify each \((c_{10},c_{11},\ldots ,c_{1\ r-1} \mid c_{20},c_{21},\ldots ,c_{2\ s-1}) \in \mathrm {R}^r \times \mathrm {R}^s\) with a pair of polynomials \((c_{10}+c_{11}x+\cdots +c_{1\ r-1} x^{r-1} \mid c_{20}+c_{21}x+\cdots +c_{2\ s-1}x^{s-1})\) in \(\mathrm {R}_{r,s}[x] = \frac{\mathrm {R}[x]}{\langle x^r-1\rangle }\times \frac{\mathrm {R}[x]}{\langle x^s-1\rangle }\). Clearly, this correspondence is one-to-one. Further, for any \(f(x) =\sum f_i x^i \in \mathrm {R}[x]\) and \( (c_1(x)\mid c_2(x)) \in \mathrm {R}_{r,s}[x]\), we define the product \(f(x) \cdot (c_1(x)\mid c_2(x)) = (f(x)c_1(x)\mid f(x)c_2(x))\). We can see that \(\mathrm {R}_{r,s}[x]\) is an \(\mathrm {R}[x]\)-module with respect to this product. Also, the product \(x \cdot (c_1(x)\mid c_2(x))=(xc_1(x)\mid xc_2(x)) \) represents the double cyclic shift of \((c_1(x)\mid c_2(x))\) in \(\mathrm {R}_{r,s}[x]\).

Theorem 6

A code \(\mathrm {C}\) is an \(\mathrm {R}\)-double cyclic of length (rs) if and only if \(\mathrm {C}\) is an \(\mathrm {R}[x]\)-submodule of \(\mathrm {R}_{r,s}[x]\).

Theorem 7

Let \(\mathrm {C}\) be an \(\mathrm {R}\)-double cyclic codes of length (rs). Then

$$\begin{aligned} \mathrm {C}=\langle ((1+v)b_1(x)+vb_2(x) \mid 0),((1+v)l_1(x)+vl_2(x)\mid (1+v)a_1(x)+va_2(x) )\rangle , \end{aligned}$$

where \(a_1(x), a_2(x), b_1(x)\) and \(b_2(x)\) are monic polynomials such that \(a_1(x)|(x^s-1)\), \(a_2(x)|(x^s-1)\), \(b_1(x)|(x^r-1)\) and \(b_2(x)|(x^r-1)\).

Proof

Consider the map \( \pi : \mathrm {C}\rightarrow {\mathrm {R}[x]}/{\langle x^s-1\rangle }\) such that \(\pi (c_1(x)\mid c_2(x))=c_2(x)\). Since \({\mathrm {R}[x]}/{\langle x^s-1\rangle }\) and \(\mathrm {C}\) are \(\mathrm {R}[x]\) submodules \(\mathrm {R}_{r,s}\), the map \(\phi \) is an \(\mathrm {R}[x]\)-modular homomorphism with kernel \(ker_{\mathrm {C}}(\pi )=\{(f(x) \mid 0)\in \mathrm {C}\mid f(x)\in \mathrm {R}[x]/\langle x^r-1\rangle \}\). Define a set \({K=\{f(x) \in \mathrm {R}[x] \mid (f(x) \mid 0)\in \mathrm {C}\}}\). Clearly, K is an ideal of \(\frac{\mathrm {R}[x]}{\langle x^r-1\rangle }\). On the other hand, the homomorphic image of \(\mathrm {C}\) under \(\pi \) is an ideal of \(\frac{\mathrm {R}[x]}{\langle x^s-1\rangle }\). As cyclic codes over \(\mathrm {R}\) are principally generated (Bayram et al. 2016), we have \(K=\langle (1+v)b_1(x)+vb_2(x)\rangle \) and \(\pi (\mathrm {C})=\langle (1+v)a_1(x)+va_2(x)\rangle \), where \(a_i(x)\) and \(b_i(x)\) are monic polynomials in \({\mathbb {F}}_4[x]\) such that \(a_i(x)|(x^s-1)\) and \(b_i(x)|(x^r-1)\), \(i=1,2\). Thus, \(ker_{\mathrm {C}}(\pi )=\langle ((1+v)b_1(x)+vb_2(x) \mid 0)\rangle \) and \(\mathrm {C}=\langle ((1+v)b_1(x)+vb_2(x) \mid 0),((1+v)l_1(x)+vl_2(x)\mid (1+v)a_1(x)+va_2(x) )\rangle \) for some \((1+v)l_1(x)+vl_2(x)\in \mathrm {R}[x]\). \(\square \)

Let \(\mathrm {C}\) be an \(\mathrm {R}\)-double cyclic code of length (rs). Define \(\mathrm {C}_1=\{x\in {\mathbb {F}}_4^r \times {\mathbb {F}}_4^s \mid x+vy \in \mathrm {C} \text{ for } \text{ some } y\in {\mathbb {F}}_4^r \times {\mathbb {F}}_4^s \}\) and \(\mathrm {C}_2= \{ x+y \in {\mathbb {F}}_4^r \times {\mathbb {F}}_4^s \mid x+vy \in \mathrm {C}\}\). Then it is easy to prove that \(\mathrm {C}_1\) and \(\mathrm {C}_2\) are \({\mathbb {F}}_4\)-double cyclic codes of length (rs). In Sect. 3.2, we see that an \(\mathrm {R}\)-double cyclic code is completely determined by the constituent \({\mathbb {F}}_4\)-double cyclic codes. Thus, we first present the structural properties of \({\mathbb {F}}_4\)-double cyclic codes and then we use these results further to describe the structure of \(\mathrm {R}\)-double cyclic codes.

3.1 \({\mathbb {F}}_4\)-double cyclic codes

A linear code \(\mathrm {C}\) of length \(r+s\) over \({\mathbb {F}}_4\) is an \({\mathbb {F}}_4\)-double cyclic code of length (rs) if it is closed with respect to the double cyclic shift operator \(\tau \). An \({\mathbb {F}}_4\)-double cyclic code of length (rs) is an \({\mathbb {F}}_4[x]\)-submodule of \(\frac{{\mathbb {F}}_4[x]}{\langle x^r-1\rangle } \times \frac{{\mathbb {F}}_4[x]}{\langle x^s-1\rangle }\). We see that the structure of \({\mathbb {F}}_4\)-double cyclic codes is similar to that of \({\mathbb {Z}}_2\)-double cyclic codes, defined in Borges and Fernàndez-Còrdoba (2017). We omit the proofs of the results in the present setting as they are straightforward generalization of the study on \({\mathbb {Z}}_2\)-double cyclic codes Borges and Fernàndez-Còrdoba (2017).

Theorem 8

Let \(\mathrm {C}\) be an \({\mathbb {F}}_4\)-double cyclic code of length (rs). Then \(\mathrm {C}=\langle (b(x)\mid 0),(l (x)\mid a(x) )\rangle \), where \(l(x) \in {\mathbb {F}}_4[x]\), \(b(x)|(x^r-1)\) and \(a(x)|(x^s-1)\). Moreover,

  1. 1.

    \(\mathrm {deg}(l(x))< \mathrm {deg}(b(x))\);

  2. 2.

    b(x) divides \(l(x)\frac{x^s-1}{a(x)}\);

  3. 3.

    If \(\mathrm {deg}(b(x))=t_1\) and \(\mathrm {deg}(a(x))=t_2\), then \(\mathrm {C}\) is spanned by \(S_1\cup S_2\), where \(S_1=\bigcup \limits _{i=0}^{r-t_1-1}x^i(b(x) \mid 0)\) and \(S_2=\bigcup \limits _{i=0}^{s-t_2-1}x^i(l(x) \mid a(x))\). Further, \(|\mathrm {C}|=4^{r+s-t_1-t_2}\).

The following result provides the structure of dual code of an \({\mathbb {F}}_4\)-double cyclic code. Note that \(f^*(x)\) is the reciprocal polynomial of f(x).

Theorem 9

Let \(\mathrm {C}\) be an \({\mathbb {F}}_4\)-double cyclic code. Then the dual code of \(\mathrm {C}\) is also an \({\mathbb {F}}_4\)-double cyclic code.

Theorem 10

Let \(\mathrm {C}\) be an \({\mathbb {F}}_4\)-double cyclic code of length (rs) and \(\mathrm {C}^\bot =\langle ({\hat{b}}(x)\mid 0),\ ({\hat{l}}(x) \mid {\hat{a}}(x)) \rangle \) be the dual code of \(\mathrm {C}\). Then

  1. 1.

    \({\hat{b}}(x)=\frac{x^r-1}{gcd(b(x),l(x))^*}\),

  2. 2.

    \({\hat{a}}(x)=\frac{(x^s-1)gcd(b(x),l(x))^*}{a^*(x)b^*(x)}\) and

  3. 3.

    \({\hat{l}}(x)=\frac{x^r-1}{b^*(x)}\lambda (x)\), where \(\lambda (x)=\left[ \frac{l^*(x)}{gcd(b(x),l(x))^*}\right] ^{-1}x^{m-deg(a(x))+deg(l(x))} \left( mod \quad \frac{b^*(x)}{gcd(b(x),l(x))^*} \right) \), \(m=lcm\{r,s\}\).

An \({\mathbb {F}}_4\)-double cyclic code \(\mathrm {C}\) of length (rs) is separable if \(\mathrm {C}= \mathrm {C}_r \times \mathrm {C}_s\), where \(\mathrm {C}_r\) and \(\mathrm {C}_s\) are the projections of \(\mathrm {C}\) on r coordinates and s coordinates, respectively. A separable \({\mathbb {F}}_4\)-double cyclic code is of the form, \(\mathrm {C}=\langle (b(x)\mid 0),(0 \mid a(x) )\rangle \), where \(b(x)|(x^r-1)\) and \(a(x)|(x^s-1)\). The dual code of a separable \({\mathbb {F}}_4\)-double cyclic code \(\mathrm {C}\) is \(\mathrm {C}^\bot =\left\langle \left( \frac{x^r-1}{b''(x)}\ \Big | \ 0 \right) ,\ \left( 0 \ \Big | \ \frac{x^r-1}{a''(x)}\right) \right\rangle \).

Theorem 11

An \({\mathbb {F}}_4\)-double cyclic code of the form \(\mathrm {C}=\langle (1 \mid 0),(l (x)\mid a(x) )\rangle \) is separable.

Proof

The result follows as \((0 \mid a(x)) = l(x)\dot{(}1 \mid 0)-(l(x) \mid a(x))\in \mathrm {C}\). \(\square \)

Example 3

Let \(r=s=5\) and \(\mathrm {C}=\langle (b(x) \mid 0), (l(x) \mid a(x)\rangle \), where \(b(x)=x^4+x^3+x^2+x+1, l(x)=x^2+x\) and \(a(x)=x+1\). Then \(\mathrm {C}\) is an \({\mathbb {F}}_4\)-double cyclic code of length (5, 5) with parameters \([10,5,4]^*\).

Example 4

Let \(r=s=6\) and \(\mathrm {C}=\langle (b(x) \mid 0), (l(x) \mid a(x)\rangle \), where \(b(x)= x^4 + x^3 + x + 1, l(x)= x + 1\) and \(a(x)=x+1\). Then \(\mathrm {C}\) is an \({\mathbb {F}}_4\)-double cyclic code of length (6, 6) with parameters \([12, 7, 4]^*\).

Example 5

Let \(r=2\) and \(s=4\) and \(\mathrm {C}=\langle (b(x) \mid 0), (l(x) \mid a(x)\rangle \), where \(b(x)=x^2+1, l(x)=x+1\) and \(a(x)=x^2+1\). Then \(\mathrm {C}\) is an \({\mathbb {F}}_4\)-double cyclic code of length (2, 4) with parameters \([6,2,4]^*\). Also, from Theorem 10, we have \({\hat{b}}(x)=\frac{x^2-1}{gcd(x^2+1,x+1)^*}=x+1\), \({\hat{a}}(x)=\frac{(x^4-1)gcd(x^2+1,x+1)^*}{(x^2+1)^*(x^2+1)^*}=x+1\) and \({\hat{l}}(x)=\frac{x^2-1}{(x^2+1)^*}\lambda (x)=\lambda (x)\) with \(\lambda (x)=x^{4-2+1}\left( \frac{x+1}{x+1}\right) ^{-1} \left( mod \quad \frac{x^2+1}{(x+1)^*} \right) =1\). Therefore, \(\mathrm {C}^\bot =\langle (x+1 \mid 0), (1 \mid x+1)\rangle \). Further, \(\mathrm {C}^\bot \) is an \({\mathbb {F}}_4\)-double cyclic code with parameters \([6,4,2]^*\).

3.2 \(\mathrm {R}\)-Double cyclic codes and their duals

In this subsection, we continue and study \(\mathrm {R}\)-double cyclic codes and their duals as direct sum of \({\mathbb {F}}_4\)-double cyclic codes. Let \(\mathrm {C}\) be an \(\mathrm {R}\)-double cyclic code and \(\mathrm {C}_1\), \(\mathrm {C}_2\) be the corresponding \({\mathbb {F}}_4\)-linear codes as defined in Sect. 2. The following result shows that \(\mathrm {C}\) is determined completely by the \({\mathbb {F}}_4\)-double cyclic codes \(\mathrm {C}_1\) and \(\mathrm {C}_2\):

Theorem 12

Let \(\mathrm {C}=(1+v)\mathrm {C}_1 \oplus v \mathrm {C}_2\) be a linear code of length \(r+s\) over \(\mathrm {R}\). Then \(\mathrm {C}\) is an \(\mathrm {R}\)-double cyclic code of length (rs) if and only if \(\mathrm {C}_1\) and \(\mathrm {C}_2\) are \({\mathbb {F}}_4\)-double cyclic codes of length (rs).

Proof

Let \(x=(a_{1},a_{2},\ldots ,a_{r} \mid b_{1},b_{2},\ldots ,b_{s} )\in \mathrm {C}_1\). Then \(x+vy\in \mathrm {C}\) for some \(y=(a_{1}^\prime ,a_{2}^\prime ,\ldots ,a_{r}^\prime \mid b_{1}^\prime ,b_{2}^\prime ,\ldots ,b_{s}^\prime )\in {\mathbb {F}}_4^r \times {\mathbb {F}}_4^s\). If \(\mathrm {C}\) is an \(\mathrm {R}\)-double cyclic code, then \(\tau (x+vy)=(a_{r}+va_{r}^\prime , a_{1}+va_{1}^\prime ,\ldots ,a_{r-1}+va_{r-1}^\prime \mid b_{s}+vb_{s}^\prime ,b_{1}+vb_{1}^\prime ,\ldots ,b_{s-1}+vb_{s-1}^\prime )\in \mathrm {C}\). This implies that \((a_{r},a_{1}, \ldots ,a_{r-1} \mid b_{s},b_{1}, \ldots ,b_{s-1} )\in \mathrm {C}_1\) and, therefore, \(\mathrm {C}_1\) is an \({\mathbb {F}}_4\)-double cyclic code. Similarly we can show that \(\mathrm {C}_2\) is an \({\mathbb {F}}_4\)-double cyclic code. Conversely, assume \(\mathrm {C}_1\) and \(\mathrm {C}_2\) are \({\mathbb {F}}_4\)-double cyclic codes. Then for any \(x+vy\in \mathrm {C}\), we have \(\tau (x)\in \mathrm {C}_1\) and \(\tau (x+y)\in \mathrm {C}_2\). This implies that \((1+v)\tau (x)+v\tau (x+y)=\tau (x+vy)\in \mathrm {C}\), from the unique representation of \(\mathrm {C}\). Therefore \(\mathrm {C}\) is an \(\mathrm {R}\)-double cyclic code. Hence the result. \(\square \)

Remark 1

For any \(k(x)\in \mathrm {R}[x]\), there exist some \(r(x), r^\prime (x)\in {\mathbb {F}}_4[x]\) such that \((1+v)k(x)=(1+v)r(x)\) and \(vk(x)=vr^\prime (x)\).

The following theorem gives the form of generators of an \(\mathrm {R}\)-double cyclic code of length (rs):

Theorem 13

Let \(\mathrm {C}_1=\langle (b_1(x)\mid 0),(l_1(x)\mid a_1(x))\rangle \) and \(\mathrm {C}_2=\langle (b_2(x)\mid 0),(l_2(x)\mid a_2(x))\rangle \) be two \({\mathbb {F}}_4\)-double cyclic codes of length (rs) as defined in Theorem 8. If \(\mathrm {C}=(1+v)\mathrm {C}_1 \oplus v \mathrm {C}_2\) is an \(\mathrm {R}\)-double cyclic code of length (rs), then \(\mathrm {C}=\langle ((1+v)b_1(x)\mid 0),((1+v)l_1(x)\mid (1+v)a_1(x)),(v b_2(x)\mid 0),(v l_2(x)\mid v a_2(x))\rangle \).

Proof

From the unique representation of \(\mathrm {C}\) as \(\mathrm {C}=(1+v)\mathrm {C}_1 \oplus v \mathrm {C}_2\), we have \(\mathrm {C}\subseteq \langle (1+v)(b_1(x)\mid 0),(1+v)(l_1(x)\mid a_1(x)),v(b_2(x)\mid 0),v(l_2(x)\mid a_2(x))\rangle \). Conversely, let \(c(x)\in \langle ((1+v)b_1(x)\mid 0),((1+v)l_1(x)\mid (1+v)a_1(x)),(vb_2(x)\mid 0),(vl_2(x)\mid va_2(x))\rangle \). Then \(c(x)=(1+v)k_1(x)(b_1(x)\mid 0)+(1+v)k_2(x)(l_1(x)\mid a_1(x))+vk_3(x)(b_2(x)\mid 0)+vk_4(x)(l_2(x)\mid a_2(x))\) for some \(k_1(x),k_2(x),k_3(x)\) and \(k_4(x)\) in \(\mathrm {R}[x]\). But from Remark 1, there exist \(r_1(x),r_2(x),r_3(x)\) and \(r_4(x)\) in \({\mathbb {F}}_4[x]\) such that \(c(x)=(1+v)[r_1(x)(b_1(x)\mid 0)+r_2(x)(l_1(x)\mid a_1(x))]+v[r_3(x)(b_2(x)\mid 0)+r_4(x)(l_2(x)\mid a_2(x))]\in c(x)\in \mathrm {C}\). Therefore \(\langle (1+v)(b_1(x)\mid 0),(1+v)(l_1(x)\mid a_1(x)),v(b_2(x)\mid 0),v(l_2(x)\mid a_2(x))\rangle \subseteq \mathrm {C}\). \(\square \)

Theorem 14

Let \(\mathrm {C}_1=\langle (b_1(x)\mid 0),(l_1(x)\mid a_1(x))\rangle \) and \(\mathrm {C}_2=\langle (b_2(x)\mid 0),(l_2(x)\mid a_2(x))\rangle \) be two \({\mathbb {F}}_4\)-double cyclic codes of length (rs) as defined in Theorem 8. If \(\mathrm {C}=(1+v)\mathrm {C}_1 \oplus v \mathrm {C}_2\) is an \(\mathrm {R}\)-double cyclic code of length (rs), then \(\mathrm {C}=\langle ((1+v)b_1(x)+vb_2(x)\mid 0),((1+v)l_1(x)+vl_2(x)\mid (1+v)a_1(x)+va_2(x))\rangle \).

Proof

From Theorem 13, we have \(\mathrm {C}=\langle (1+v)(b_1(x)\mid 0),(1+v)(l_1(x)\mid a_1(x)),v(b_2(x)\mid 0),v(l_2(x)\mid a_2(x))\rangle \). Clearly \(\langle ((1+v)b_1(x)+vb_2(x)\mid 0),((1+v)l_1(x)+vl_2(x)\mid (1+v)a_1(x)+va_2(x))\rangle \subseteq \mathrm {C}\). On the other hand, let \(c(x)\in \langle (1+v)(b_1(x)\mid 0),(1+v)(l_1(x)\mid a_1(x)),v(b_2(x)\mid 0),v(l_2(x)\mid a_2(x))\rangle \). Then, there exist \(r_1(x),r_2(x),r_3(x)\) and \(r_4(x)\) in \(\mathrm {R}[x]\) such that

$$\begin{aligned} c(x)&= r_1(x)[(1+v)(b_1(x)\mid 0)]+r_2(x)[(1+v)(l_1(x)\mid a_1(x))]\\&\quad +r_3(x)[v(b_2(x)\mid 0)]+r_4(x)[v(l_2(x)\mid a_2(x))]\\&=r_1(x)[(1+v)((1+v)b_1(x)+vb_2(x)\mid 0)]+r_2(x)[(1+v)((1+v)l_1(x)\\&\quad +vl_2(x)\mid (1+v)a_1(x)+va_2(x))] \\&\quad +r_3(x)[v((1+v)b_1(x)+vb_2(x)\mid 0)]+r_4(x)[v((1+v)l_1(x)\\&\quad +vl_2(x)\mid (1+v)a_1(x)+va_2(x))]\\&= ((1+v)b_1(x)+vb_2(x)\mid 0)[(1+v)r_1(x)+vr_3(x)]\\&\quad +((1+v)l_1(x)+vl_2(x)\mid (1+v)a_1(x)+va_2(x))\\&\qquad [(1+v)r_2(x)+vr_4(x)]. \end{aligned}$$

Therefore \(c(x)\in \langle (1+v)(b_1(x)\mid 0),(1+v)(l_1(x)\mid a_1(x)),v(b_2(x)\mid 0),v(l_2(x)\mid a_2(x))\rangle \). The result follows. \(\square \)

Recall, the definitions of \(\pi (\mathrm {C})\), \(\mathrm {ker}_{\pi }(\mathrm {C})\) and K. In the following theorem we give the form of generator polynomials of an \(\mathrm {R}\)-double cyclic code when \(\pi (\mathrm {C})\) and K has no monic polynomials of least degree.

Theorem 15

Let \(\mathrm {C}\) be an \(\mathrm {R}\)-double cyclic code of length (rs) such that \(\pi (\mathrm {C})=\langle va(x)\rangle \) and \(\mathrm {Ker}(\pi )_\mathrm {C}=\langle (vb(x)\mid 0)\rangle \), where \(a(x),b(x)\in \mathrm {R}[x]\). Then \(\mathrm {C}=\langle (vb(x)\mid 0), (vl(x) \mid va(x))\rangle \) for some \(l(x)\in {\mathbb {F}}_4[x]\). Similarly, when \(\pi (\mathrm {C})=\langle (1+v)a(x)\rangle \) and \(\mathrm {Ker}(\pi )_\mathrm {C}=\langle ((1+v)b(x)\mid 0)\rangle \), then \(\mathrm {C}=\langle ((1+v)b(x)\mid 0), ((1+v)l(x) \mid (1+v)a(x))\rangle \).

Proof

Suppose \(\mathrm {C}\) is an \(\mathrm {R}\)-double cyclic code with \(\pi (\mathrm {C})=\langle va(x)\rangle \) and \(\mathrm {Ker}(\pi )_\mathrm {C}=\langle (vb(x)\mid 0)\rangle \). Then \(\mathrm {C}=\langle (vb(x)\mid 0), ((1+v)l^\prime +vl(x) \mid va(x))\rangle \). Clearly, \((1+v) ((1+v)l^\prime +vl(x) \mid va(x))= ((1+v)l^\prime \mid 0)\in \mathrm {C}\) and hence \((1+v)l^\prime \in K\). As K contains no polynomial with leading coefficient as \((1+v)\), we get \(l^\prime =0\). Therefore \(\mathrm {C}=\langle (vb(x)\mid 0), (vl(x) \mid va(x))\rangle \). Second part of the theorem can be proved similarly. \(\square \)

Theorem 16

Let \(\mathrm {C}\) be an \(\mathrm {R}\)-double cyclic code of length (rs). Then \(\mathrm {C}\) is one of the following form:

  1. 1.

    \(\mathrm {C}=\left\langle ((1+v)b_1(x)+vb_2(x) \mid 0)\right\rangle \), where \(b_1(x)|(x^r-1)\) and \(b_2(x)|(x^r-1)\);

  2. 2.

    \(\mathrm {C}=\left\langle (l(x)\mid (1+v)a_1(x)+va_2(x) ) \right\rangle \), where \(b_1(x)|(x^r-1)\), \(b_2(x)|(x^r-1)\), and \((x^r-1)\) divides \( \frac{x^s-1}{(1+v)a_1(x)+va_2(x)}l(x)\);

  3. 3.

    \(\mathrm {C}=\left\langle ((1+v)b_1(x)+vb_2(x) \mid 0),((1+v)l_1(x)+vl_2(x)\mid (1+v)a_1(x)+va_2(x) ) \right\rangle \), where \(b_i(x)\big | (x^r-1)\), \(a_i(x)\big | (x^s-1)\), \(i=1,2\), and \(((1+v)b_1(x)+vb_2(x))\) divides \(\frac{x^s-1}{(1+v)a_1(x)+va_2(x)}((1+v)l_1(x)+vl_2(x))\).

Now, we give a minimal spanning set of an \(\mathrm {R}\)-double cyclic code \(\mathrm {C}\) of length (rs) in \(\mathrm {R}_{r,s}[x]\) as an \(\mathrm {R}\)-module. Recall that the minimal spanning set of an \({\mathbb {F}}_4\)-double cyclic code \(\mathrm {C}=\langle (b(x) \mid 0), (l(x) \mid a(x))\rangle \) of length (rs) is \(S=S_1 \cup S_2\), where \(S_1=\cup _{i=0}^{r-\deg (b(x))-1}(b(x) \mid 0)\) and \(S_2=\cup _{j=0}^{s-\deg (a(x))-1}(l(x) \mid a(x))\) (Borges and Fernàndez-Còrdoba (2017), Proposition 3).

Theorem 17

Let \(\mathrm {C}=\left\langle ((1+v)b_1(x)+vb_2(x) \mid 0),((1+v)l_1(x)+vl_2(x)\mid (1+v)a_1(x)+va_2(x) ) \right\rangle \) be an \(\mathrm {R}\)-double cyclic code of length (rs). Let

$$\begin{aligned} S_{11}&= \bigcup _{i_1=0}^{r-\deg (b_1(x))-1} ((1+v)b_1(x) \mid 0)&S_{12}&= \bigcup _{j_1=0}^{s-\deg (a_1(x))-1} ((1+v)l_1(x) \mid (1+v)a_1(x)) \\ S_{21}&= \bigcup _{i_2=0}^{r-\deg (b_2(x))-1} (vb_2(x) \mid 0)&S_{22}&= \bigcup _{j_2=0}^{s-\deg (a_2(x))-1} (vl_2(x) \mid va_2(x)). \\ \end{aligned}$$

Then, \(S=S_{11}\cup S_{12} \cup S_{21} \cup S_{22}\) forms a minimal spanning set for \(\mathrm {C}\) as an \(\mathrm {R}\)-module. Moreover,

\(|\mathrm {C}|=4^{2r+2s-\deg (a_1(x))-\deg (b_1(x))-\deg (a_2(x))-\deg (b_2(x))}\).

Proof

Clearly, \(\text{ span }(S) \subseteq \mathrm {C}\). Let \(c=((1+v)f_1(x)+vf_2(x) \mid (1+v)g_1(x)+vg_2(x))\in \mathrm {C}\). Then from the definitions of \(\mathrm {C}_1\) and \(\mathrm {C}_2\), we have \((f_1(x) \mid g_1(x))\in \mathrm {C}_1\) and \((f_2(x) \mid g_2(x))\in \mathrm {C}_2\). This implies \(((1+v)f_1(x) \mid (1+v)g_1(x)) \in \text{ span }\left( S_{11}\cup S_{12}\right) \) and \((vf_2(x) \mid v g_2(x)) \in \text{ span }\left( S_{21}\cup S_{22}\right) \). Thus \(c\in \text{ span }(S)\), and \(\mathrm {C}\subseteq \text{ span }(S)\). Therefore S is a minimal spanning set of \(\mathrm {C}\). \(\square \)

In the following result, we show that the dual of an \(\mathrm {R}\)-double cyclic codes is also an \(\mathrm {R}\)-double cyclic code.

Theorem 18

If \(\mathrm {C}\) is an \(\mathrm {R}\)-double cyclic code of length (rs), then the dual \(\mathrm {C}^\bot \) of \(\mathrm {C}\) is also an \(\mathrm {R}\)-double cyclic code of length (rs).

Proof

Let \(y=(y_{1,0},y_{1,1},\ldots , y_{1,r-1} \mid y_{2,0},y_{2,1},\ldots , y_{2,s-1})\in \mathrm {C}\) and \(x=(x_{1,0},x_{1,1},\ldots , x_{1,r-1} \mid x_{2,0},x_{2,1},\ldots x_{2,s-1})\in \mathrm {C}^\bot \). Since \(\mathrm {C}\) is invariant under \(\tau \), we have \(\tau ^{m-1}(y)\in \mathrm {C}\), where \(m=\mathrm {lcm}(r,s)\). Therefore

$$\begin{aligned} 0&=x\cdot \sigma ^{m-1}(y)=(x_{1,0}y_{1,1}+\cdots +x_{1,r-2}y_{1,r-1}+x_{1,r-1}y_{1,0})+ (x_{2,0}y_{2,1}+\cdots + x_{2,s-1}y_{2,0})\\&=(x_{1,r-1}y_{1,0}+x_{1,0}y_{1,1}+\cdots +x_{1,r-2}x_{1,r-1})+ (x_{2,s-1}y_{2,0}+\cdots + x_{2,s-2}y_{2,s-1})\\&=\tau (x) \cdot y. \end{aligned}$$

As y is an arbitrary element of \(\mathrm {C}\), the result follows. \(\square \)

Now, we give the generators of the dual code of an \(\mathrm {R}\)-double cyclic code.

Theorem 19

Let \(\mathrm {C}=(1+v)\mathrm {C}_1+v\mathrm {C}_2\) be an \(\mathrm {R}\)-double cyclic code of length (rs), and \(\mathrm {C}_1^\bot =\langle ({\hat{b}}_1(x) \mid 0),({\hat{l}}_1(x) \mid {\hat{a}}_1(x))\rangle \) and \(\mathrm {C}_2^\bot =\langle ({\hat{b}}_2(x) \mid 0),({\hat{l}}_2(x) \mid {\hat{a}}_2(x))\rangle \) be the dual codes of \(\mathrm {C}_1=\langle ({b}_1(x) \mid 0),({l}_1(x) \mid {a}_1(x))\rangle \) and \(\mathrm {C}_2=\langle ( {b}_2(x) \mid 0),( {l}_2(x) \mid {a}_2(x))\rangle \), respectively. Then \(\mathrm {C}^\bot =\langle ((1+v){\hat{b}}_1(x)+v{\hat{b}}_2(x)\mid 0),((1+v){\hat{l}}_1(x)+v{\hat{l}}_2(x)\mid (1+v){\hat{a}}_1(x)+v{\hat{a}}_2(x))\rangle \).

Proof

The result follows directly from the fact that \(\mathrm {C}^\bot =(1+v)\mathrm {C}_1^\bot +v\mathrm {C}_2^\bot \) and Theorem 14. \(\square \)

Corollary 1

An \(\mathrm {R}\)-double cyclic code \(\mathrm {C}=(1+v)\mathrm {C}_1+v\mathrm {C}_2\) is self-dual if and only if \(\mathrm {C}_1\) and \(\mathrm {C}_2\) are self-dual double cyclic codes over \({\mathbb {F}}_4\).

The following result gives the cardinality of an \(\mathrm {R}\)-double cyclic code and its dual code.

Theorem 20

Let \(\mathrm {C}=(1+v)\mathrm {C}_1\oplus v\mathrm {C}_2\) be an \(\mathrm {R}\)-double cyclic code and as defined in Theorem 14. Then \(|\mathrm {C}|=4^{2(r+s)-\mathrm {deg}(a_1)-\mathrm {deg}(a_2)-\mathrm {deg}(b_1)-\mathrm {deg}(b_2)}\) and \(|\mathrm {C}^\bot |=4^{\mathrm {deg}(a_1)+\mathrm {deg}(a_2)+\mathrm {deg}(b_1)+\mathrm {deg}(b_2)}\).

Proof

The proof follows as \(|\mathrm {C}|=|\mathrm {C}_1| \cdot |\mathrm {C}_2|\) and \(|\mathrm {C}^\bot |=|\mathrm {C}_1^\bot | \cdot |\mathrm {C}_2^\bot |\). \(\square \)

The following theorem gives the structure of the Gray image of an \(\mathrm {R}\)-double cyclic code.

Theorem 21

Let \(\mathrm {C}=(1+v)\mathrm {C}_1+v\mathrm {C}_2\) be an \(\mathrm {R}\)-double cyclic code of length (rs), where \(\mathrm {C}_1\) and \(\mathrm {C}_2\) are \({\mathbb {F}}_4\)-double cyclic codes of length (rs) as defined in Theorem 8. Then the Gray image of \(\mathrm {C}\) under \(\phi \) is a generalized quasi cyclic code of length (rsrs) over \({\mathbb {F}}_4\). In particular if \(r=s\), then \(\phi (\mathrm {C})\) is a 4-quasi cyclic code of length 4r over \({\mathbb {F}}_4\).

Proof

The result follows as \(\mathrm {C}_1\) and \(\mathrm {C}_2\) are \({\mathbb {F}}_4\)-double cyclic codes (quasi cyclic codes of index 2) and \(\phi (\mathrm {C})=\mathrm {C}_1 \times \mathrm {C}_2\). \(\square \)

An \(\mathrm {R}\)-double cyclic code is separable if \(\mathrm {C}=\mathrm {C}_r \times \mathrm {C}_s\). It is easy to prove that \(\mathrm {C}=(1+v)\mathrm {C}_1+v\mathrm {C}_2\) is sparable \(\mathrm {R}\)-double cyclic code if and only if \(\mathrm {C}_1\) and \(\mathrm {C}_2\) are separable \({\mathbb {F}}_4\)-double cyclic codes. Further, the dual of an \(\mathrm {R}\)-separable code is also separable.

Theorem 22

Let \(\mathrm {C}^\bot \) be the dual code of a separable \(\mathrm {R}\)-double cyclic code \(\mathrm {C}=\langle ((1+v)b_1(x)+vb_2(x)\mid 0),( 0 \mid (1+v)a_1(x)+va_2(x))\rangle \). Then \(\mathrm {C}^\bot = \left\langle \left( (1+v)\frac{x^r-1}{b_1^*(x)} + v \frac{x^r-1}{b_2^*(x)} \ \Big | \ 0 \right) , \left( 0 \ \big | \ (1+v)\frac{x^r-1}{a_1^*(x)} + v \frac{x^r-1}{a_2^*(x)} \right) \right\rangle \).

Example 6

Let \(\mathrm {C}=\langle ((1+v)(x^4+x^3+x^2+1)\mid 0), (vx^4+vx^3+vx^2+x \mid vx^3 +x+1)\rangle \) be an \(\mathrm {R}\)-double cyclic code of length (7, 14). Then, \(\mathrm {C}_1=\langle (x^4+x^3+x^2+1 \mid 0),( x \mid x+1 ) \rangle \) and \(\mathrm {C}_2=\langle ( x^4+x^3+x^2+x \mid x^3+x+1 )\rangle \). The \({\mathbb {F}}_4\)-double cyclic codes \(\mathrm {C}_1\) and \(\mathrm {C}_2\) are of length (7, 14) with parameters [21, 16, 3] and [21, 11, 6], respectively. Further, from Theorem 8, we see \(\mathrm {C}_1^\bot =\langle (x^3 + x + 1\mid x^9 + x^8 + x^6 + x^5 + x^4 + x^3 + 1) \rangle \) and \(\mathrm {C}_2^\bot =\langle (x^6 + x^5 + x^4 + x^3 + x^2 + x + 1 \mid 0), (x^4 + x^3 + 1 \mid x^5 + x^2 + x + 1)\rangle \). Therefore \(\mathrm {C}^\bot =\langle ( v(x^6 + x^5 + x^4 + x^3 + x^2 + x + 1 )\mid 0 ), ( vx^4+x^3+(1+v)x +1 \mid (1+v)x^9+ (1+v)x^8+ (1+v)x^6+x^5+ (1+v)x^4+ (1+v)x^3+vx^2+vx +1 )\rangle \). As \(\mathrm {C}_1^\bot \) and \(\mathrm {C}_1^\bot \) are \({\mathbb {F}}_4\)-double cyclic codes with parameters \([ 21, 5, 10 ]^*\) and \([ 21, 10,7 ]^*\), respectively, we have \(\phi (\mathrm {C}^\bot )\) a generalized quasi-cyclic code of index four with parameters [42, 15, 7] over \({\mathbb {F}}_4\).

Example 7

Let \(\mathrm {C}_1=\langle (w x +1 \mid 0), ( x+1 \mid 1)\rangle \) and \(\mathrm {C}_2=\langle ( wx +1 \mid 0), ( x+1 \mid x+1 )\rangle \) be two \({\mathbb {F}}_4\)-double cyclic codes of length (6, 6). We see \(\mathrm {C}_1\) and \(\mathrm {C}_2\) are optimal \({\mathbb {F}}_4\)-codes with parameters \([12,11,2]^*\) and \([12,10,2]^*\), respectively. From Theorem 14, \(\mathrm {C}=(1+v)\mathrm {C}_1 \oplus v\mathrm {C}_2=\langle ((1+v)(wx+1)+v(x+1) \mid 0),(x+1 \mid 1+vx )\rangle \), an \(\mathrm {R}\)-double cyclic code of length (6, 6). The Gray image of \(\mathrm {C}\) is a quasi-cyclic code of index 4 with parameters \([24,21,2]^*\) over \({\mathbb {F}}_4\).

Example 8

Let \(\mathrm {C}=\langle (x+1 \mid 0),(0 \mid x+1)\rangle \) be a separable \(\mathrm {R}\)-double cyclic code of length (10, 10). Then \(\mathrm {C}_1=\mathrm {C}_2=\langle (x+1 \mid 0),(0 \mid x+1)\rangle \), a separable \({\mathbb {F}}_4\)-double cyclic code with parameters \([20,18,2]^*_4\). The Gray image of \(\mathrm {C}\) under \(\phi \) is a quasi-cyclic code of index 4 and length 40 with parameters \([40,36,2]_4\). Also, \(\mathrm {C}^\bot =\langle (x^9+x^8+x^7+x^6+x^5+x^4+x^3+x^2+x+1 \mid 0), (0 \mid x^9+x^8+x^7+x^6+x^5+x^4+x^3+x^2+x+1) \rangle \).

3.3 Enumeration of \(\mathrm {R}\)-double cyclic codes

In this section, we give the complete classification of \(\mathrm {R}\)-double cyclic codes of length \((2^{e_1},2^{e_2})\), where \(e_1\) and \(e_2\) are non-negative integers. We give a mass formula that enumerate these family of codes for given values of \(e_1\) and \(e_2\). For that we first recall the structure of cyclic codes over \({\mathbb {F}}_4 \) of length \(n=2^e\).

Let \(\mathrm {R}^\prime _n\) denote the quotient ring \({{\mathbb {F}}_4[x]}/{\langle x^n-1\rangle }\), where \(n=2^e\). As \((x+1)\) is a nilpotent element of nilpotency \(2^{e}\) Dinh and López-permouth (2004), each polynomial in \(\mathrm {R}^\prime _n\) can be written as \(\sum \limits _{i=0}^{2n-1}a_i(x+1)^i,\ a_i\in {\mathbb {F}}_4\), and such an element is a unit in \(\mathrm {R}^\prime _n\) if and only if \(a_0\ne 0\). From this we see that \(\mathrm {R}_n\) is a finite chain ring and any ideal of \(\mathrm {R}^\prime _n\) is of the form \(\langle (x+1)^i\rangle ,\ 0\le i\le n\)Dinh and López-permouth (2004). Therefore, if \(\mathrm {C}\) is an \({\mathbb {F}}_4\)-double cyclic code of length \((2^{e_1},2^{e_2})\), then \(\mathrm {C}=\langle ((x+1)^{i_1}\mid 0),((x+1)^t h(x)\mid (x+1)^{i_2})\rangle \), where h(x) is zero or unit in \({{\mathbb {F}}_4[x]}/{\langle x^{2^{e_1}}-1\rangle }\). Summarizing this discussion, the following theorem present the complete module structure of \({\mathbb {F}}_4\)-double cyclic codes of length \((2^{e_1},2^{e_2})\). Throughout this section we let \(r=2^{e_1}\) and \(s=2^{e_2}\), where \(e_1, e_2\) are non-negative integers.

Lemma 1

Let \(\mathrm {C}\) be an \({\mathbb {F}}_4\)-double cyclic code of length (rs). Then \(\mathrm {C}\) is one of the following:

  • Type 1: \(\mathrm {C}=\langle ((x+1)^{i_1}\mid 0)\rangle ,\ 0\le i_1 \le r\);

  • Type 2: \(\mathrm {C}=\langle ((x+1)^th(x) \mid (x+1)^{i_2})\rangle \), where \( 0\le i_2 \le s-1\) and h(x) is either zero or a unit in \({{\mathbb {F}}_4[x]}/{\langle x^r-1\rangle }\) such that \(t+\deg (h(x))<r\);

  • Type 3: \(\mathrm {C}=\langle ((x+1)^{i_1}\mid 0),((x+1)^th(x) \mid (x+1)^{i_2})\rangle \), where \( 0\le i_1 \le r-1,\ 0\le i_2 \le s-1\) and h(x) is either zero or a unit in \({{\mathbb {F}}_4[x]}/{\langle x^r-1\rangle }\) such that \(t+\deg (h(x))<i\).

Remark 2

The \({\mathbb {F}}_4\)-double cyclic codes of length (rs) of Type 2 are in fact \(\mathrm {C}=\langle (x^r-1 \mid 0), ((x+1)^th(x) \mid (x+1)^{i_2})\rangle \), \( 0\le i_2 \le s-1\).

Lemma 2

Let \(r=2^{e_1}\) and \( s=2^{e_2}\), \(e_1>0,\ e_2>0\). Then, the number of \({\mathbb {F}}_4\)-double cyclic codes of length (rs) is

$$\begin{aligned} {\mathcal {N}} = {\left\{ \begin{array}{ll} r4^s-s4^s+\frac{5}{3}4^s-\frac{1}{2}s^2+rs+\frac{3}{2}s-\frac{5}{3} &{} \text{ if }\ r\ge s \\ s4^r-r4^r+\frac{5}{3}4^s-\frac{1}{2}r^2+rs+\frac{3}{2}r-\frac{5}{3} &{} \text{ if }\ r < s . \end{array}\right. } \end{aligned}$$

Proof

We enumerate \({\mathbb {F}}_4\)-double cyclic codes separately in each case as given in Lemma1. Let \({\mathcal {N}}_i\) be the number of \({\mathbb {F}}_4\)-double cyclic codes of Type i.

\(Type\ 1:\) The number of \({\mathbb {F}}_4\)-double cyclic codes of Type \(\langle ((x+1)^{i_1}\mid 0)\rangle ,\ 0\le i_1 \le r\) is \({\mathcal {N}}_1 = r+1\).

\(Type\ 2:\) We enumerate the number of \({\mathbb {F}}_4\)-double cyclic codes of Type 2 in two cases. When h(x) is zero, there are \({\mathcal {N}}_{21}=s\) number of cyclic codes of Type \(\langle (0 \mid (x+1)^{i_2})\rangle ,\ 0\le i_2 \le s-1\). When, \(h(x)\ne 0\), the number of \({\mathbb {F}}_4\)-double cyclic codes of type \(\langle ((x+1)^th(x) \mid (x+1)^{i_2})\rangle ,\ 0\le i_2 \le s-1\) is as follows:

$$\begin{aligned} {\mathcal {N}}_{22}&= {\left\{ \begin{array}{ll} \sum \limits _{t=0}^{s-1} 3 \cdot 4^t &{} \text{ if }\ r\ge s \\ (s-r+1)\left[ 3 \cdot 4^{r-1} \right] + \sum \limits _{t=1}^{r-1} 3 \cdot 4^{r-t-1} &{} \text{ if }\ r< s . \end{array}\right. } \\&= {\left\{ \begin{array}{ll} 4^s -1 &{} \text{ if }\ r\ge s \\ 4^r + 3s4^{r-1}-3r4^{r-1} -1 &{} \text{ if }\ r < s . \end{array}\right. } \end{aligned}$$

\(Type\ 3:\) Again, we enumerate the number of \({\mathbb {F}}_4\)-double cyclic codes of Type 3 in two cases. When \(h(x)=0\), the \({\mathbb {F}}_4\)-double cyclic codes are of the form \(\mathrm {C}=\langle ((x+1)^{i_1}\mid 0),(0 \mid (x+1)^{i_2})\rangle \), where \(0\le i_1 \le r-1,\ 0\le i_2 \le s-1\). Clearly, these are separable \({\mathbb {F}}_4\)-double cyclic codes. Thus, the number of separable \({\mathbb {F}}_4\)-double cyclic codes of length (r,s) is \({\mathcal {N}}_{31}=r\cdot s\).

Let \(h(x)\ne 0\) and \(\mathrm {C}=\langle ((x+1)^{i_1}\mid 0),((x+1)^th(x) \mid (x+1)^{i_2})\rangle \). Then it is easy to see that \((x+1)^{i_1}\) divides \((x+1)^{s-i_2}\left( (x+1)^t h(x)\right) \) (see Lemma 8). As h(x) a unit element in \({\mathbb {F}}_4[x]/\langle x^r-1 \rangle \), we thus have \(s-i_2+t\ge i_1\). So the number of \({\mathbb {F}}_4\)-double cyclic codes of the form \(\mathrm {C}=\langle ((x+1)^{i_1}\mid 0),((x+1)^t h(x) \mid (x+1)^{i_2})\rangle ,\ 0\le i_1 \le r-1,\ 0\le i_2 \le s-1\) is

$$\begin{aligned} {\mathcal {N}}_{32}&= {\left\{ \begin{array}{ll} (r-s)\sum \limits _{t=0}^{s-1} 3 \cdot 4^t + \sum \limits _{i=1}^{s-1}\left[ (s-i)3 \cdot 4^{i-1} + \sum \limits _{t=0}^{i-1} 3 \cdot 4^t \right] &{} \text{ if }\ r\ge s \\ \sum \limits _{i=1}^{r-1}\left[ (s-i)3 \cdot 4^{i-1} + \sum \limits _{t=0}^{i-1} 3 \cdot 4^t \right] &{} \text{ if }\ r< s . \end{array}\right. }\\&= {\left\{ \begin{array}{ll} r4^s-s4^s+\frac{2}{3}4^s-\frac{1}{2}s^2-r+ \frac{1}{2}s-\frac{5}{3} &{} \text{ if }\ r\ge s \\ s4^{r-1}-r4^{r-1}+\frac{2}{3}4^r-s+\frac{1}{2}r-\frac{1}{2}r^2-\frac{5}{3} &{} \text{ if }\ r < s . \end{array}\right. } \end{aligned}$$

Therefore, the total number of \({\mathbb {F}}_4\)-double cyclic codes length (rs) is

$$\begin{aligned} {\mathcal {N}} = {\left\{ \begin{array}{ll} r4^s-s4^s+\frac{5}{3}4^s-\frac{1}{2}s^2+rs+\frac{3}{2}s-\frac{5}{3} &{} \text{ if }\ r\ge s \\ s4^r-r4^r+\frac{5}{3}4^s-\frac{1}{2}r^2+rs+\frac{3}{2}r-\frac{5}{3} &{} \text{ if }\ r < s . \end{array}\right. } \end{aligned}$$

\(\square \)

Theorem 23

The number of \(\mathrm {R}\)-double cyclic codes of length (rs), where \(r=2^{e_1},\ s=2^{e_2}\), is

$$\begin{aligned} {\mathcal {N}} = {\left\{ \begin{array}{ll} \left( r4^s-s4^s+\frac{5}{3}4^s-\frac{1}{2}s^2+rs+\frac{3}{2}s-\frac{5}{3}\right) ^2 &{} \text{ if }\ r\ge s \\ \left( s4^r-r4^r+\frac{5}{3}4^s-\frac{1}{2}r^2+rs+\frac{3}{2}r-\frac{5}{3}\right) ^2 &{} \text{ if }\ r < s . \end{array}\right. } \end{aligned}$$

Proof

The proof follows from Lemma 2, and the fact that the size of an \(\mathrm {R}\)-double cyclic code \(\mathrm {C}=(1+v)\mathrm {C}_1 \oplus v\mathrm {C}_2\) of length (rs) is \(|\mathrm {C}|= |\mathrm {C}_1| \times |\mathrm {C}_2|\), where \(\mathrm {C}_1\) and \(\mathrm {C}_2\) are \({\mathbb {F}}_4\)-double cyclic codes of length (rs). \(\square \)

Example 9

Let \(r=s=2\) and \({\mathcal {N}}_i\) be the number of \({\mathbb {F}}_4\)-double cyclic codes of \(Type\ i\). Then the \({\mathbb {F}}_4\)-double cyclic codes of length (2, 2) as follows:

Type

codes

\({\mathcal {N}}_i\)

Type 1

\(\langle (1 \mid 0)\rangle ,\ \langle (x+1 \mid 0)\rangle \) and \(\langle (0 \mid 0)\rangle \)

\({\mathcal {N}}_1=3\)

Type 2 when \(h(x)=0\)

\(\langle (0 \mid x+1)\rangle \) and \(\langle (0 \mid 1)\rangle \)

\({\mathcal {N}}_{21}=2\)

Type 2 when \(h(x)\ne 0\)

\(\begin{array}{ll} \langle (x+1 \mid x+1)\rangle ,\ \langle (wx+w \mid x+1)\rangle ,\ \langle (w^2x+w^2 \mid x+1 )\rangle ,\ \langle (x+1 \mid 1)\rangle , \\ \langle (x+w \mid 1)\rangle ,\ \langle (x+w^2 \mid 1)\rangle ,\ \langle (wx+1 \mid 1)\rangle ,\ \langle (wx+w \mid 1)\rangle ,\ \langle (wx+w^2 \mid 1)\rangle , \\ \langle (w^2x+1 \mid 1)\rangle ,\ \langle (w^2x+w \mid 1)\rangle ,\ \langle (w^2x+w^2 \mid 1)\rangle ,\ \langle (1 \mid 1)\rangle ,\ \langle (w \mid 1)\rangle \hbox {and} \langle (w^2 \mid 1)\rangle \end{array}\)

\({\mathcal {N}}_{22}=15\)

Type 3 when \(h(x)=0\)

\(\begin{array}{ll} \langle (1 \mid 0),(0 \mid 1)\rangle ,\ \langle (x+1 \mid 0),(0 \mid 1)\rangle , \\ \langle (1 \mid 0),(0 \mid x+1)\rangle ,\ \langle (x+1 \mid 0),(0 \mid x+1)\rangle \end{array}\)

\({\mathcal {N}}_{31}=4\)

Type 3 when \(h(x)\ne 0\)

\(\begin{array}{ll} \langle (x+1 \mid 0),(1 \mid 1)\rangle ,\ \langle (x+1 \mid 0),(w \mid 1)\rangle ,\ \langle (x+1 \mid 0),(w^2 \mid 1)\rangle \\ \langle (x+1 \mid 0),(1 \mid x+1)\rangle ,\ \langle (x+1 \mid 0),(w \mid x+1)\rangle ,\ \langle (x+1 \mid 0),(w^2 \mid x+1)\rangle \end{array}\)

\({\mathcal {N}}_{32}=6\)

Therefore, the total number of \({\mathbb {F}}_4\)-double cyclic codes of length (2, 2) is \(3+2+15+4+6=30\). Further, from Theorem 20, the total number of \(\mathrm {R}\)-double cyclic codes of length (2, 2) is 900.

Theorem 24

Let \(\mathrm {C}=\langle ((x+1)^{i_1}\mid 0),((x+1)^t h(x) \mid (x+1)^{i_2})\rangle \) be an \(\mathrm {R}\)-double cyclic code of length (rs), where \(r=2^{e_1}, s=2^{e_2}\) and h(x) is either zero or a unit over \({\mathbb {F}}_4\). Then \(\mathrm {C}^\perp =\langle ((x+1)^{r-t}\mid 0),((x+1)^{r-i_1}\delta \mid (x+1)^{s+t-i_1-i_2})\rangle \), where \(\delta =[h]^{-1}x^{m-i_2+t+\mathrm {deg}(h)}\ \ (\mathrm {mod}\ \ (x+1)^{i_1-t})\).

Example 10

Let \(r=4,s=8\), and \(\mathrm {C}=\langle ((x+1)^4 \mid 0), (x^2+x \mid (x+1)^5 )\rangle \) be an \(\mathrm {R}\)-double cyclic code of length (4, 8). Following the notations in Theorem 24, we have \(i_1=4, i_2=5, t=1\) and \(h(x)=x=(x+1)+1\). Clearly, \(\delta = x^2+x+1\), and the dual code \(\mathrm {C}^\bot \) of \(\mathrm {C}\) is \(\mathrm {C}^\bot =\langle ((x+1)^3 \mid 0), (x^2+x+1 \mid 1\rangle \).

4 \(\mathrm {R}\)-Double constacyclic codes

Constacyclic codes constitutes an important generalization of cyclic codes. These codes are important because of simplified algebraic structure and practical usage. In this section, we define an R-double constacyclic code of length (rs). We characterize these codes with their Gray images. These codes are multi-twisted cyclic codes (generalization of quasi-twisted cyclic codes) of index two over \(\mathrm {R}\). Recently, Aydin and Halilović (2017) introduced these family of codes over finite fields and presented few construction methods. Recall, an \((\alpha , \beta )\)-double constacyclic code of length (rs) over \({\mathbb {F}}_q\) is an \({\mathbb {F}}_4[x]\)-submodule of \(\frac{{\mathbb {F}}_4[x]}{\langle x^r-\alpha \rangle }\times \frac{{\mathbb {F}}_4[x]}{\langle x^s-\beta \rangle }\), where \(\alpha , \beta \) are units in \({\mathbb {F}}_4\) Aydin and Halilović (2017).

The following Table1 gives some examples of \({\mathbb {F}}_4\)-double constacyclic codes, which have the best known minimum distance.

Table 1 Some good \({\mathbb {F}}_4\)-double constacyclic codes

Now, we extend the definition of double constacyclic codes over finite fields given in Aydin and Halilović (2017) and define an \(\mathrm {R}\)-double constacyclic codes.

Definition 2

Let \(\lambda _1\) and \(\lambda _2\) be two unit elements in \(\mathrm {R}\) and \(c=(c_0,c_1,\ldots ,c_{r-1} \mid c^\prime _0,c^\prime _1,\ldots ,c^\prime _{s-1})\in \mathrm {R}^r \times \mathrm {R}^s\). Then the double constacyclic shift \(\sigma _{\lambda _1\lambda _2}\) of c is defined by

$$\begin{aligned} \sigma _{\lambda _1\lambda _2}(c)=(\lambda _1 c_{r-1},c_0,\ldots ,c_{r-2} \mid \lambda _2 c^\prime _{s-1},c^\prime _0,\ldots ,c^\prime _{s-2}). \end{aligned}$$

A linear code \(\mathrm {C}\) of length \(r+s\) over \(\mathrm {R}\) is called a \((\lambda _1, \lambda _2 )\)-double constacyclic code of length (rs) if it is invariant under the double constacyclic shift operator \(\sigma _{\lambda _1\lambda _2}\). Under polynomial representation, we can easily see that \(\mathrm {C}\) is a \((\lambda _1, \lambda _2 )\)-double constacyclic code of length (rs) over \(\mathrm {R}\) if and only if \(\mathrm {C}\) is an \(\mathrm {R}[x]\)-submodule of \(\frac{\mathrm {R}[x]}{\langle x^r-\lambda _1\rangle }\times \frac{\mathrm {R}[x]}{\langle x^s-\lambda _2\rangle }\). As a special case, if we take \(\lambda _1= \lambda _2=1\), then \(\mathrm {C}\) an \(\mathrm {R}\)-double cyclic code. Note that, when \(\lambda _1=\lambda _2=\lambda \), we call \(\mathrm {C}\) a \(\lambda \)-double constacyclic code over \(\mathrm {R}\).

Let \(\pi _i: {\mathbb {F}}_4 \times {\mathbb {F}}_4 \rightarrow {\mathbb {F}}_4\) be a projection map such that \(\pi _i(a_1 \mid a_2)=a_i\), \(i=1,2\). Also let

\(L_n=\left[ \frac{{\mathbb {F}}_4[x]}{\langle x^r-\pi _1(\phi (\lambda _1))\rangle }\times \frac{{\mathbb {F}}_4[x]}{\langle x^s-\pi _1(\phi (\lambda _2))\rangle } \right] \times \left[ \frac{{\mathbb {F}}_4[x]}{\langle x^r-\pi _2(\phi (\lambda _1))\rangle }\times \frac{{\mathbb {F}}_4[x]}{\langle x^s-\pi _2(\phi (\lambda _2))\rangle } \right] \), where \(\phi (\lambda _1)\) and \(\phi (\lambda _2 )\) are Gray images of \(\lambda _1\) and \(\lambda _2\). Now, we extend the Gray map \(\phi \) to \(\Phi \) as follows:

$$\begin{aligned}&\Phi : \frac{\mathrm {R}[x]}{\langle x^r-\lambda _1\rangle }\times \frac{\mathrm {R}[x]}{\langle x^s-\lambda _2\rangle } \rightarrow L_n\\&\text{ such } \text{ that }\\&\phi \left( \sum \limits _{i=0}^r a_ix^i \ \bigg \vert \ \sum \limits _{j=0}^s b_ix^j \right) \mapsto \left( \sum \limits _{i=0}^r \pi _1(\phi (a_i))x^i,\ \sum \limits _{i=0}^r \pi _2(\phi (a_i))x^i,\ \sum \limits _{j=0}^s \pi _1(\phi (b_j))x^j,\ \sum \limits _{j=0}^s \pi _2(\phi (b_j))x^j \right) . \end{aligned}$$

Clearly, \(\phi \) is a modular isomorphism, and, therefore, \( \frac{\mathrm {R}[x]}{\langle x^r-\lambda _1\rangle }\times \frac{\mathrm {R}[x]}{\langle x^s-\lambda _2\rangle } \cong \left[ \frac{{\mathbb {F}}_4[x]}{\langle x^r-\pi _1(\phi (\lambda _1))\rangle }\times \frac{{\mathbb {F}}_4[x]}{\langle x^s-\pi _1(\phi (\lambda _2))\rangle } \right] \times \left[ \frac{{\mathbb {F}}_4[x]}{\langle x^r-\pi _2(\phi (\lambda _1))\rangle } \right. \left. \times \frac{{\mathbb {F}}_4[x]}{\langle x^s-\pi _2(\phi (\lambda _2))\rangle } \right] \). With this we have the following result:

Theorem 25

Let \(\mathrm {C}=(1+v)\mathrm {C}_1+v\mathrm {C}_2\) be a linear code of length \(r+s\) over \(\mathrm {R}\), and \(\lambda _1\), \(\lambda _2\) be two unit elements in \(\mathrm {R}\). Then \(\mathrm {C}\) is a \((\lambda _1,\lambda _2)\)-constacyclic code of length (rs) over \(\mathrm {R}\) if and only if \(\mathrm {C}_1\) is a \((\pi _2(\phi (\lambda _1)),\pi _2(\phi (\lambda _2)))\)-double constacyclic code and \(\mathrm {C}_2\) is a \((\pi _1(\phi (\lambda _1)),\pi _1(\phi (\lambda _2)))\)-double constacyclic code of length (rs) over \({\mathbb {F}}_4\).

Proof

Let \(\lambda _1=\lambda _{11}+v\lambda _{12}\) and \(\lambda _2=\lambda _{21}+v\lambda _{22}\) be two unit elements in \(\mathrm {R}\). Let \(c=(c_0,c_1,\ldots ,c_{r-1} \mid c^\prime _0,c^\prime _1,\ldots ,c^\prime _{s-1})\in \mathrm {C}\), where \(c_i=(1+v)x_i+vy_i\), \(c^\prime _j=(1+v)x^\prime _j+v y^\prime _j\) for \(0\le i \le r-1\) and \(0\le j\le s-1\). Then we have

$$\begin{aligned} \sigma _{\lambda _1\lambda _2}(c)&= \left( \lambda _1 c_{r-1},c_0,\ldots ,c_{r-2} \ \Big |\ \lambda _2 c^\prime _{s-1},c^\prime _0,\ldots ,c^\prime _{s-2} \right) \\&= \left( [\lambda _{11}+v\lambda _{12}] [(1+v)x_{r-1}+vy_{r-1}],(1+v)x_0+vy_0,\ldots ,\right. \\&\quad \left. (1+v)x_{r-2}+vy_{r-2} \ \Big |\ [\lambda _{21}+v\lambda _{22}] [(1+v)x^\prime _{s-1}+vy^\prime _{s-1}], \right. \\&\qquad \left. (1+v)x^\prime _0+vy^\prime _0, \ldots ,(1+v)x^\prime _{s-2}+vy^\prime _{s-2}\right) \\&= \left( [(1+v)\lambda _{11}+v(\lambda _{11}+\lambda _{12})] [(1+v)x_{r-1}+vy_{r-1}],(1+v)x_0+vy_0,\ldots ,(1+v)x_{r-2}+vy_{r-2} \ \Big |\ \right. \\&\qquad \left. [(1+v)\lambda _{21}+v(\lambda _{21}+\lambda _{22})] [(1+v)x^\prime _{s-1}+vy^\prime _{s-1}], (1+v)x^\prime _0+vy^\prime _0, \ldots ,(1+v)x^\prime _{s-2}+vy^\prime _{s-2}\right) \\&= (1+v)\left( \lambda _{11}x_{r-1},x_0,\ldots ,x_{r-2} \ \Big |\ \lambda _{21}x^\prime _{s-1},x^\prime _0,\ldots ,x^\prime _{s-2}\right) \\&\qquad + v\left( (\lambda _{21}+\lambda _{22})y_{r-1},y_0,\ldots ,y_{r-2} \ \Big |\ \lambda _{22}y^\prime _{s-1},y^\prime _0,\ldots ,y^\prime _{s-2}\right) \\&= (1+v)\left( \pi _2(\phi (\lambda _1))x_{r-1},x_0,\ldots ,x_{r-2} \ \Big |\ \pi _2(\phi (\lambda _2))x^\prime _{s-1},x^\prime _0,\ldots ,x^\prime _{s-2}\right) +\\&v\left( \pi _1(\phi (\lambda _1))y_{r-1},y_0,\ldots ,y_{r-2} \ \Big |\ \pi _1(\phi (\lambda _2))y^\prime _{s-1},y^\prime _0,\ldots ,y^\prime _{s-2}\right) . \end{aligned}$$

Suppose \(\mathrm {C}_1\) is a \((\pi _2(\phi (\lambda _1)),\pi _2(\phi (\lambda _2)))\)-double constacyclic code and \(\mathrm {C}_2\) is a \((\pi _1(\phi (\lambda _1)),\pi _1(\phi (\lambda _2)))\)-double constacyclic code of length (rs) over \({\mathbb {F}}_4\). Then for any \(c=(c_0,c_1,\ldots ,c_{r-1} \mid c^\prime _0,c^\prime _1,\ldots ,c^\prime _{s-1})\in \mathrm {C}\), where \(c_i=(1+v)x_i+vy_i\), \(c^\prime _j=x^\prime _j+vy^\prime _j\) for \(0\le r-1\) and \(0\le j\le s-1\), we have \(x=( x_{0},x_1,\ldots ,x_{r-1} \mid x^\prime _{0},x^\prime _1,\ldots ,x^\prime _{s-1}) \in \mathrm {C}_1\) and \(y= (y_{0},y_1,\cdots ,y_{r-1} \mid y^\prime _{0},y^\prime _1,\ldots ,y^\prime _{s-1})\in \mathrm {C}_2\). This implies \(\sigma _{\pi _2(\phi (\lambda _1)),\pi _2(\phi (\lambda _2))}(x)\in \mathrm {C}_1\) and \(\sigma _{\pi _1(\phi (\lambda _1)),\pi _1(\phi (\lambda _2))}(y)\in \mathrm {C}_2\). This further implies that \((1+v)\sigma _{\pi _2(\phi (\lambda _1)),\pi _2(\phi (\lambda _2))}(x)+v\sigma _{\pi _1(\phi (\lambda _1)),\pi _1(\phi (\lambda _2))}(y)=\sigma _{\lambda _1\lambda _2}(c)\in \mathrm {C}\). As x and y are arbitrary elements in \(\mathrm {C}_1\) and \(\mathrm {C}_2\), respectively, \(\mathrm {C}\) is a \((\lambda _1,\lambda _2)\)-constacyclic code of length (rs) over \(\mathrm {R}\). Similarly we can prove the sufficient part of the theorem. \(\square \)

The Table 2 below lists the relation between a \((\lambda _1,\lambda _2)\)- double constacyclic code \(\mathrm {C}\) over R and the \({\mathbb {F}}_4\)-double constacyclic codes \(\mathrm {C}_1\) and \(\mathrm {C}_2\).

Table 2 The relation between a \((\lambda _1,\lambda _2)\)- double constacyclic code \(\mathrm {C}\) and the codes \(\mathrm {C}_1\) and \(\mathrm {C}_2\)

The following result characterizes the dual of a double constacyclic code over \({\mathbb {F}}_4\):

Lemma 3

Let \(\alpha , \beta \) be two unit elements in \({\mathbb {F}}_4\) and \(\mathrm {C}\) be an \((\alpha ,\beta )\)-double constacyclic code of length (rs) over \({\mathbb {F}}_4\). Then \(\mathrm {C}^\bot \) is an \((\alpha ^{-1}, \beta ^{-1})\)-double constacyclic code of length (rs) over \({\mathbb {F}}_4\).

Proof

Let \(m=\mathrm {lcm}\{r,s \}\). We note that for any \(a=(a_{11},a_{12},\ldots ,a_{1\ r} \mid a_{21},a_{22},\ldots ,a_{2\ s})\), we have \(\sigma _{\alpha ,\beta }^{m-1}(a)=( \alpha ^{\frac{m}{s}}a_{12},\ldots ,\alpha ^{\frac{m}{s}}a_{1\ r}, \alpha ^{\frac{m}{s}-1} a_{11} \mid \beta ^{\frac{m}{r}}a_{22},\ldots ,\beta ^{\frac{m}{r}} a_{2\ s},\beta ^{\frac{m}{r}-1}a_{21} )\). Also, as multiplicative order of each non-zero element in \({\mathbb {F}}_4\) is 3, we have \(\sigma _{\alpha ,\beta }^{3m}(a)=a\). Let \(a=(a_{11},a_{12},\ldots ,a_{1\ r} \mid a_{21},a_{22},\ldots ,a_{2\ s})\in \mathrm {C}\) and \(b=(b_{11},b_{12},\ldots ,b_{1\ r} \mid b_{21},b_{22},\ldots ,b_{2\ s})\in \mathrm {C}^\bot \). Then

$$\begin{aligned} \sigma _{\alpha ,\beta }^{3m-1}(a)\cdot b&= \left( a_{12}b_{11}+\cdots +a_{1\ r}b_{1\ r-1}+\alpha ^{3\frac{m}{s}-1} a_{11} b_{1\ r} \right) \\&\quad + \left( a_{22}b_{21}+\cdots + a_{2\ s}b_{2\ s-1}+\beta ^{3\frac{m}{r}-1}a_{21}b_{2\ s-1} \right) \\&= \left( a_{12}b_{11}+\cdots +a_{1\ r}b_{1\ r-1}+\alpha ^{3\frac{m}{s}-1}[\alpha .\alpha ^{-1}] a_{11} b_{1\ r}\right) \\&\quad + \left( a_{22}b_{21}+\cdots + a_{2\ s}b_{2\ s-1}+\beta ^{3\frac{m}{r}-1}[\beta .\beta ^{-1}]a_{21}b_{2\ s-1}\right) \\&= \left( a_{12}b_{11}+\cdots +a_{1\ r}b_{1\ r-1}+[\alpha ^{-1}] a_{11} b_{1\ r} \right) \\&\quad + \left( a_{22}b_{21}+\cdots + a_{2\ s}b_{2\ s-1}+[\beta ^{-1}]a_{21}b_{2\ s-1} \right) \\&= \left( a_{11} [\alpha ^{-1}b_{1\ r}] + a_{12}b_{11}+\cdots +a_{1\ r}b_{1\ r-1} + a_{21} [\beta ^{-1} b_{2\ s-1}] \right) \\&\quad + \left( a_{22}b_{21}+\cdots + a_{2\ s}b_{2\ s-1} \right) \\&= a \cdot \sigma _{\alpha ^{-1},\beta ^{-1}} (b). \end{aligned}$$

Since \( \sigma _{\alpha ,\beta }^{3m-1}(a)\in \mathrm {C}\), \(\sigma _{\alpha ,\beta }^{m-1}(a)\cdot b=0\). This implies that \(a \cdot \sigma _{\alpha ^{-1},\beta ^{-1}} (b)=0\). Therefore, \(\sigma _{\alpha ^{-1},\beta ^{-1}} (b)\in C^\bot \). As b is an arbitrary element in \(\mathrm {C}^\bot \), we have \(\mathrm {C}^\bot \) an \((\alpha ^{-1}, \beta ^{-1})\)-double constacyclic code over \({\mathbb {F}}_4\). \(\square \)

Theorem 26

Let \(\lambda _1=(1+v)\lambda _{11}+v\lambda _{12}, \lambda _2=(1+v)\lambda _{21}+v\lambda _{22}\) be two unit elements in \(\mathrm {R}\) and \(\mathrm {C}=(1+v)\mathrm {C}_1\oplus v\mathrm {C}_2\) be a \((\lambda _1,\lambda _2)\)-double constacyclic code of length (rs) over \(\mathrm {R}\). Then \(\mathrm {C}^\bot \) is a \(((1+v)\lambda _{11}^{-1}+v\lambda _{12}^{-1}, (1+v)\lambda _{21}^{-1}+v\lambda _{22}^{-1})\)-double constacyclic code of length (rs) over \(\mathrm {R}\).

Proof

The result follows from Lemma 3 and Theorem 25. \(\square \)

It is easy to see that the Gray image of an \(\mathrm {R}\)-double constacyclic code of length (rs) is a generalized quasi-twisted code of length (rsrs) over \({\mathbb {F}}_4\). The following Table3 gives some examples of \(\mathrm {R}\)-double constacyclic codes whose Gray images are optimal \({\mathbb {F}}_4\)-codes:

Table 3 Some good \(\mathrm {R}\)-double constacyclic codes

5 Conclusion

In this paper, we have studied generalized quasi-cyclic codes over \(\mathrm {R}\) of index 2 as \(\mathrm {R}\)-double cyclic codes of length (rs). We determined the generators of \(\mathrm {R}\)-double cyclic codes and their duals for arbitrary values of r and s. A mass formula to enumerate \(\mathrm {R}\)-double cyclic codes of length \((2^{e_1},2^{e_2})\), \(e_1,e_2>0\) is presented. Some structural properties of \(\mathrm {R}\)-double constacyclic codes, and \(\mathrm {R}\)-skew double cyclic codes are also studied. Finding generator polynomials of double constacycilc codes, skew double constacyclic codes, and their dual codes over \(\mathrm {R}\) are a future interesting problems.