1 Introduction

Codes over finite rings are a topic of much research in algebraic coding theory for over two decades [1, 3,4,5,6, 9, 10, 12, 14, 15, 17, 20, 21]. Among all finite rings, the ring \(\mathbb {Z}_4\) of integers modulo 4 has a special place in coding theory. In addition to the original discovery in [10] that showed that certain binary non-linear codes can be obtained as Gray images of \(\mathbb {Z}_4\)-linear codes, codes over \(\mathbb {Z}_4\) are known to be related to lattices [19], combinatorial designs [7], and low correlation sequences [18]. As a result of increased research activity on codes over \(\mathbb {Z}_4\), a database of \(\mathbb {Z}_4\)-codes was introduced in [2], which is available online [8]. The database is updated as researchers discover new codes with better parameters. When a new code is added to the database, the previous codes are not removed. Several recent papers contributed new codes to the database such as [14, 20].

More recently, the rings of order 16 that are extensions of \(\mathbb {Z}_4\) have received special attention. The interest in these rings increased after the introduction of linear and cyclic codes over the ring \(\mathbb {Z}_{4}+u\mathbb {Z}_{4},\) \(u^{2}=0\) in [20, 21]. In [1], Ashraf and Mohammed studied \((1+2u)\)-constacyclic codes over this ring.

In [3], cyclic, quasi cyclic (QC), and constacyclic codes over \(\mathbb {Z}_{4}+w\mathbb {Z}_{4}\), \(w^{2}=2\) have been studied. Two Gray maps are defined and Gray images of codes over this ring have been described. Moreover, new linear codes over \(\mathbb {Z}_4\) are obtained using these Gray maps.

Due to the increased interest in codes over rings of order 16, these rings are classified in [11]. One of the special properties of rings of order 16 is the fact that the smallest local, finite, Frobenius, commutative, non-chain ring has order 16 [11]. In this work, we consider one of the rings of order 16, \(\mathbb {Z}_{4}\left[ u\right] /\left\langle u^{2}-1\right\rangle \) which can also be described as \(R=\mathbb {Z}_4+u\mathbb {Z}_4\) with \(u^2=1\). This ring is isomorphic to the ring \(\mathbb {Z}_{4}\left[ u\right] /\left\langle u^{2}+2u\right\rangle \) via \(u\longmapsto u+1.\)

In [14], Ozen et al. studied cyclic codes and \(\left( 2+u\right) \)-constacyclic codes over R. They determined the form of generators of cyclic codes over this ring. They proved that the \(\mathbb {Z}_4\)-image of a \(\left( 2+u\right) \)-constacyclic code of odd length over R is a cyclic code over \(\mathbb {Z}_4\). They presented many examples of good codes over \(\mathbb {Z}_4\) obtained as images of cyclic codes over R.

In [17], Shi et al. defined a new Gray map from \(\mathbb {Z}_{4}+u\mathbb {Z}_{4}\) to \(\mathbb {Z}_{4}^{2}\) and studied \(( 1+2u)\)-constacyclic codes over R. They investigated properties of \(\left( 1+2u\right) \)-constacyclic codes over R. They proved that the Gray images of \((1+2u)\)-constacyclic codes of length n over R are cyclic codes of length 2n over \(\mathbb {Z}_4\). They presented many examples of \(( 1+2u)\)-constacyclic codes R whose \(\mathbb {Z}_4\)-images have good parameters.

Inspired by these works, we introduce two new Gray maps from R to \(\mathbb {Z}_4^3\). We are particularly interested in finding new codes with better parameters than the currently best known linear codes over \(\mathbb {Z}_4\). In fact, this was our main purpose and motivation for this work. We have been able to obtain such codes using each map. Moreover, we give a description of Gray images of cyclic and constacyclic codes over R.

2 Preliminaries

In [4, 14, 17], the authors considered the finite commutative ring \(R=\mathbb {Z}_4+u\mathbb {Z}_4\), where \(u^2=1\). Clearly, \(R\cong Z_{4}\left[ u\right] /\left\langle u^{2}-1\right\rangle \). Its units are given by \(\{1,3,u,3u,2+u,1+2u,3+2u,2+3u\}.\) There are 7 ideals in this ring of characteristic 4 given by \(\{\left\langle 0\right\rangle ,\left\langle 2u\right\rangle ,\left\langle 1+u\right\rangle , \left\langle 3+3u\right\rangle ,\left\langle 2+2u\right\rangle ,\left\langle 2u,1+u\right\rangle ,R\}\). It is a local ring with the maximal ideal \(\left\langle 2u,1+u\right\rangle \).

In [14, 17], constacyclic codes over R and their Gray images are studied for the constants \(2+u\) and \(1+2u\). In this paper, we consider constacyclic codes for the units \(3+2u\) and \(2+3u\), and their Gray images under the new maps we introduced. Whereas the Gray maps on this ring considered in earlier works double the code length, our Gray maps triple it. Hence, we are able to find codes with new parameters not obtained in previous works.

A code of length n over R is a subset of \(R^{n}\). C is a linear code if C is a R-submodule of \(R^{n}\). Let \(\lambda \) be a unit in R. A linear code C over R of length n is called \(\lambda \)-constacyclic if it is invariant under the constacyclic shift operator \(\varrho \left( r_{0},r_{1},\ldots ,r_{n-1}\right) =(\lambda r_{n-1},r_{0},\ldots ,r_{n-2}),\) where \(\left( r_{0},r_{1},\ldots ,r_{n-1}\right) \in C\). The cyclic codes are a special case of constacyclic codes with \(\lambda =1.\) If \(\sigma \) is the cyclic shift operator, that is \(\sigma \left( r_{0},r_{1},\ldots ,r_{n-1}\right) =(r_{n-1},r_{0},\ldots ,r_{n-2})\), then C is said to be cyclic if \(\sigma \left( C\right) =C,\) and C is said to be \(\lambda \)-constacyclic if \(\varrho \left( C\right) =C\).

As usual, a \(\lambda \)-constacyclic code of length n over R can be identified as an ideal of the quotient ring \(R\left[ x\right] /\left\langle x^{n}-\lambda \right\rangle \) via the R-module isomorphism.

$$\begin{aligned}&\psi \; :\;R^{n}\longrightarrow R\left[ x\right] /\left\langle x^{n}-\lambda \right\rangle \\&\quad (a_{0},\ldots ,a_{n-1}) \longmapsto a_{0}+a_{1}x+a_{2}x^{2}+\ldots +a_{n-1}x^{n-1}\big (\ mod \left\langle x^{n}-\lambda \right\rangle \big ) \end{aligned}$$

Hence, we use polynomial and vector representations of codes interchangeably.

Next, we define two Gray maps from R to \(\mathbb {Z}_4^3\). The Gray map on R used in previous works doubles the length of a code. Our Gray maps triple the code length, hence we obtain codes of different lengths over \(\mathbb {Z}_4\) from a given code over R. Our first Gray map is

$$\begin{aligned}&\phi _1 \;:\;R\longrightarrow \mathbb {Z}_4^{3} \\&\quad a+ub \longmapsto (b,2a+3b,a+3b) \end{aligned}$$

This map is extended component-wise to

$$\begin{aligned}&\phi _1 \;:\;R^{n}\longrightarrow \mathbb {Z}_4^{3n} \\&\alpha =(\alpha _{0},\ldots ,\alpha _{n-1})\longmapsto \phi (\alpha )\\&\quad =(b_{0},\ldots ,b_{n-1},2a_{0}+3b_{0},\ldots ,2a_{n-1}+3b_{n-1}, a_{0}+3b_{0},\ldots ,a_{n-1}+3b_{n-1}) \end{aligned}$$

where \(\alpha _{i}=a_{i}+ub_{i},\) where \(i=0,1,\ldots ,n-1\). \(\phi _1\) is a \(\mathbb {Z}_4\)-module isomorphism.

We define another Gray map as follows,

$$\begin{aligned}&\phi _{2} \;:\; R\longrightarrow \mathbb {Z}_4^{3} \\&\quad a+ub \longmapsto (a,2a+3b,3a+3b) \end{aligned}$$

This map is extended component-wise to

$$\begin{aligned}&\phi _{2} \;:\; R^{n}\longrightarrow \mathbb {Z}_4^{3n} \\&\alpha =(\alpha _{0},\ldots ,\alpha _{n-1})\longmapsto \phi _{2}(\alpha )\\&\quad =(a_{0},\ldots ,a_{n-1},2a_{0}+3b_{0},\ldots ,2a_{n-1}+3b_{n-1}, 3a_{0}+3b_{0},\ldots ,3a_{n-1}+3b_{n-1}) \end{aligned}$$

where \(\alpha _{i}=a_{i}+ub_{i},\) where \(i=0,1,\ldots ,n-1\). \(\phi _{2}\) is a \(\mathbb {Z}_4\)-module isomorphism.

The polynomial correspondence of the Gray maps can be described as

$$\begin{aligned}&\varPhi \;:\;R\left[ x\right] /\left\langle x^{n}-\lambda \right\rangle \longrightarrow \mathbb {Z}_4\left[ x\right] /\left\langle x^{3n}-1\right\rangle \\&a(x)+ub(x) \longmapsto \varPhi (a(x)+ub(x))=b(x)+x^{n}(2a(x)+3b(x))+x^{2n}(a(x)+3b(x)) \\&\quad (\varPhi (a(x)+ub(x)) = a(x)+x^{n}(2a(x)+3b(x))+x^{2n}(3a(x)+3b(x))) \end{aligned}$$

In the rest of the paper \(\lambda \) will denote either the constant \(3+2u\) or \(2+3u\), unless otherwise stated. We note that \(\displaystyle {\lambda ^{n}={\left\{ \begin{array}{ll} \lambda , \qquad \text { if } n \text { is odd.}\\ 1, \qquad \text { if } n \text { is even.}\end{array}\right. }}\)

Definition 1

Let \(a\in \mathbb {Z}_4^{3n}\) with \(a=\left( a^{\left( 0\right) }\left| a^{\left( 1\right) }\right| a^{\left( 2\right) }\right) ,\) \(a^{\left( i\right) }\in \mathbb {Z}_4^{n}\) for \(i=0,1,2.\) Let \(\varphi \) be a map from \( \mathbb {Z}_4^{3n}\) to \(\mathbb {Z}_4^{3n}\) given by \(\varphi \left( a\right) =\left( \sigma \left( a^{\left( 0\right) }\right) \left| \sigma \left( a^{\left( 1\right) }\right) \right| \sigma \left( a^{\left( 2\right) }\right) \right) \) where \(\sigma \) is the cyclic shift from \(\mathbb {Z}_4^{n}\) to \(\mathbb {Z}_4^{n}\) given by \(\sigma \left( a^{\left( i\right) }\right) =(a^{_{(i,n-1)}},a^{_{(i,0)}},\ldots ,a^{_{(i,n-2)}})\) for every \(a^{\left( i\right) }=(a^{(_{^{i,0}})},\ldots ,a^{(_{i,n-1})})\) where \(a^{_{(i,j)}}\in \mathbb {Z}_4\), \(j=0,1,\ldots ,n-1.\) A code of length 3n over \(\mathbb {Z}_4\) is said to be quasi cyclic (QC) code of index 3 if \(\varphi \left( C\right) =C\).

3 The Gray images of some constacyclic codes over R

Proposition 1

Let \(\varrho \) be the \((3+2u)\)-constacyclic shift on \(R^{n}\), let \(\phi _1 \) be the Gray map from \(R^{n}\) to \(\mathbb {Z}_4^{3n}\), and \(\varphi \) be the map defined above.Then we have \(\phi \varrho =\psi \varphi \phi _1 \), where the permutation \(\psi \) of \(\mathbb {Z}_4^{3n}\) is defined by \(\psi (x_{1},x_{2},\ldots ,x_{n},x_{n+1},\ldots ,x_{2n},x_{2n+1},\ldots ,x_{3n})=(x_{\zeta (1)},x_{\zeta (2)},\ldots ,x_{\zeta (3n)})\) with the permutation \(\zeta =\left( 1,n+1\right) \) of \(\{1,2,\ldots ,3n\}.\)

Proof

Let \(r=(r_{0},\ldots ,r_{n-1})\in R^{n}\), where \(r_{i}=a_{i}+ub_{i},i=0,1,\ldots ,n-1.\) Then we have

$$\begin{aligned} \varrho (r)= & {} ((3+2u)r_{n-1},r_{0},\ldots ,r_{n-2}) \\= & {} ((3a_{n-1}+2b_{n-1})+u(3b_{n-1}+2a_{n-1}), a_{0}+ub_{0},\ldots ,a_{n-2}+ub_{n-2}) \end{aligned}$$

By applying the Gray map \(\phi _1\), we have

$$\begin{aligned} \phi _1(\varrho (r))= & {} (2a_{n-1}+3b_{n-1},b_{0},\ldots ,b_{n-2},b_{n-1}, 2a_{0}+3b_{0},\ldots ,2a_{n-2}+3b_{n-2},\\&a_{n-1}+3b_{n-1},a_{0}+3b_{0},\ldots ,a_{n-2}+3b_{n-2}) \end{aligned}$$

On the other hand,

$$\begin{aligned} \varphi (\phi _1(r))= & {} (b_{n-1},b_{0},\ldots ,b_{n-2},2a_{n-1}+3b_{n-1}, 2a_{0}+3b_{0},\ldots ,2a_{n-2}+3b_{n-2},\\&a_{n-1}+3b_{n-1},a_{0}+3b_{0},\ldots ,a_{n-2}+3b_{n-2}) \end{aligned}$$

Finally, applying the permutation \(\psi \) to \(\varphi (\phi _1(r))\) we obtain \(\phi _1 \varrho =\psi \varphi \phi _1\). \(\square \)

Theorem 1

The \(\phi _1\)-image of a \((3+2u)\)-constacyclic code over R of length n is permutation equivalent to a QC code of index 3 over \(\mathbb {Z}_4\) of length 3n.

Proof

Let C be a \((3+2u)\)-constacyclic code over R. Then \(\varrho \left( C\right) =C\). Applying \(\phi _1\), we have \(\phi _1\left( \varrho \left( C\right) \right) =\phi _1\left( C\right) .\) By Proposition 2, we get \(\phi _1\left( \varrho \left( C\right) \right) =\psi (\varphi \left( \phi _1 \left( C\right) \right) )=\phi _1 \left( C\right) \). Therefore, \(\phi _1 \left( C\right) \) is permutation equivalent to a QC code of index 3 over \(\mathbb {Z}_4\) with length 3n. \(\square \)

We also have similar results for the map \(\phi _2\) with a different shift constant. The proofs of the following proposition and the theorem are very similar to the corresponding results for \(\phi _1\), hence they are omitted here.

Proposition 2

Let \(\varrho \) be the \((2+3u)\)-constacyclic shift of \(R^{n}\), \(\phi _2\) and \(\varphi \) be defined as in the previous section. Then we have \(\phi _{2}\varrho =\psi \varphi \phi _{2}\), where the permutation \(\psi \) of \(\mathbb {Z}_4^{3n}\) is defined by \(\psi (x_{1},x_{2},\ldots ,x_{n},x_{n+1},\ldots ,x_{2n},x_{2n+1},\ldots ,x_{3n})=(x_{\zeta (1)},x_{\zeta (2)},\ldots ,x_{\zeta (3n)})\) with the permutation \(\zeta =\left( 1,n+1\right) \) of \(\{1,2,\ldots ,3n\}.\)

Theorem 2

The Gray image of a \((2+3u)\)-constacyclic codes over R of length n is permutation equivalent to a QC code of index 3 over \(\mathbb {Z}_4\) with length 3n.

We note that for odd lengths, cyclic codes and constacyclic codes are equivalent.

Proposition 3

Let n be an odd integer and let \(\lambda \) be one of the units of R specified above. Then

$$\begin{aligned}&\varPsi \;:\;R\left[ x\right] /\left\langle x^{n}-1\right\rangle \longrightarrow R\left[ x\right] /\left\langle x^{n}-\lambda \right\rangle \\&\quad c(x) \longmapsto \varPsi (c(x))=c(\lambda x) \end{aligned}$$

is a ring isomorphism.

Proof

The proof similar to the proof Proposition 3.6 in [17]. \(\square \)

It follows that for an odd length n there is a one-to-one correspondence between cyclic codes and constacyclic codes. Next two corollaries formally state this fact.

Corollary 1

Let n be an odd integer and let \(\lambda \in R\). Then I is an ideal of \(R\left[ x\right] /\left\langle x^{n}-1\right\rangle \) if and only if \(\varPsi (I)\) is an ideal of \(R\left[ x \right] /\left\langle x^{n}-\lambda \right\rangle \). Hence there is a one-to-one correspondence between the ideals of \(R\left[ x\right] /\left\langle x^{n}-1\right\rangle \) and the ideals of \(R\left[ x\right] /\left\langle x^{n}-\lambda \right\rangle \) such that the cyclic code I is equivalent to the constacyclic code \(\varPsi (I)\).

Corollary 2

Let \(\overline{\zeta }\) be the map from \(R^{n}\) to \(R^{n}\) defined as

$$\begin{aligned}&\overline{\zeta } \;:\;R^{n}\longrightarrow R^{n} \\&\quad z =(z_{0},\ldots ,z_{n-1})\longmapsto (z_{0},\lambda z_{1},\lambda ^{2}z_{2},\ldots ,\lambda ^{n-1}z_{n-1}) \end{aligned}$$

C is a cyclic code over R of odd length n if and only if \(\overline{\zeta }(C)\) is a \(\lambda \)-constacyclic code of length n over R.

As in [17], we characterize \(\lambda \)-constacyclic codes over R of odd length as follows.

Theorem 3

Let n be an odd number and C be a \(\lambda \)-constacyclic code of length n over R. Then C is an ideal in \(R\left[ x\right] /\left\langle x^{n}-\lambda \right\rangle \) generated by

$$\begin{aligned} C=\left\langle t_{1}(\widetilde{x})(p_{1}(\widetilde{x} )+2)+(1+u)t_{2}(x)(p_{2}(\widetilde{x})+2),(1+u)t_{3}(\widetilde{x})(p_{3}(\widetilde{x})+2)\right\rangle \end{aligned}$$

where \(\widetilde{x}=\lambda x,t_{i}(x),p_{i}(x),g_{i}(x)\) are monic pairwise coprime polynomials in \(\mathbb {Z}_4[x]\) such that \(x^{n}-1=t_{i}(x)p_{i}(x)g_{i}(x),\) where \(i=1,2,3\).

By using a special generator polynomial of a cyclic code and by the relationship between cyclic codes and \(\lambda \)-constacyclic codes given in Proposition 3, we can express a generator of a \(\lambda \)-constacyclic code C as

$$\begin{aligned} C=\left\langle g_{1}(\widetilde{x}),ug_{2}(\widetilde{x})\right\rangle \end{aligned}$$

where \(\widetilde{x}=\lambda x\) as in [17].

Proposition 4

Let \(\overline{\zeta }\) be defined as above. Then \(\phi _1 \overline{\zeta } =\varPi \phi _1 \) (and \(\phi _{2}\overline{\zeta }=\varPi \phi _{2}\)) where the permutation \(\varPi \) of \(\mathbb {Z}_4^{3n}\) is defined by

$$\begin{aligned} \varPi (x_{1},x_{2},\ldots ,x_{n},x_{n+1},\ldots ,x_{2n},x_{2n+1},\ldots ,x_{3n})=(x_{\tau (1)},x_{\tau (2)},\ldots ,x_{\tau (3n)}) \end{aligned}$$

with the permutation \(\tau =(2,n+2)(4,n+4)\ldots (n-1,2n-1)\) of \(\{1,2,\ldots ,3n\}.\)

Table 1 Representations of the elements of R
Table 2 New linear codes over \(\mathbb {Z}_4\) obtained from constacyclic codes over R

Proof

Let \(r=(r_{0},\ldots ,r_{n-1})\in R^{n}\), where \(r_{i}=a_{i}+ub_{i},i=0,1,\ldots ,n-1\). Since \(\overline{\zeta }(r)=(r_{0},(3+2u)r_{1},(3+2u)^{2}r_{2},\ldots ,(3+2u)^{n-1}r_{n-1})=(r_{0},(3+2u)r_{1},r_{2},(3+2u)r_{3},\ldots ,,(3+2u)r_{n-2},r_{n-1})\), we have \(\phi _1(\overline{\zeta }(r))=(b_{0},2a_{1}+3b_{1},b_{2},\ldots ,b_{n-1},2a_{0}+3b_{0},b_{1},\ldots ,a_{0}+3b_{0},a_{1}+3b_{1},\ldots ,a_{n-1}+3b_{n-1})\).

On the other hand, \(\phi _1(r)=(b_{0},\ldots ,b_{n-1},2a_{0}+3b_{0},\ldots ,2a_{n-1}+3b_{n-1},a_{0}+3b_{0},\ldots ,a_{n-1}+3b_{n-1}) \). By applying \(\varPi \), we have \(\phi _1\overline{\zeta }=\varPi \phi _1\). Similarly, we have \(\phi _{2}\overline{\zeta }=\varPi \phi _{2}.\) \(\square \)

Corollary 3

Let n be an odd integer. If \(\varGamma \) is the Gray image (under \(\phi _1\) or \(\phi _2\)) of a linear cyclic code over R, then \(\varGamma \) is permutation equivalent to a QC code over \(\mathbb {Z}_4\) of index 3 of length 3n, via the permutation \(\varPi \) defined above.

Proof

Let \(\varGamma \) be such that \(\varGamma =\phi _1(D)\) ( or \(\varGamma =\phi _{2}(D)\)), where D is a linear cyclic code over R. From Proposition 10, \(\phi _1 (\overline{\zeta }(D))=\varPi (\phi _1(D))=\varPi (\varGamma )\) (and \(\phi _2(\overline{\zeta } (D))=\varPi (\phi _2(D))=\varPi (\varGamma )\)). We know that \(\overline{\zeta }(D)\) is a linear \(\lambda \)-constacyclic code C. So \(\phi _1(\overline{\zeta }(D))=\phi _1(C)\) ( and \(\phi _{2}(\overline{\zeta }(D))=\phi _{2}(C)\)). By Proposition 4, \(\phi _1(C)\) (and \(\phi _2(C)\)) is permutation equivalent to a QC code of index 3 over \(\mathbb {Z}_4\) with length 3n. \(\square \)

4 Computational results

Finding new linear codes over \(\mathbb {Z}_4\) was our main motivation for this work. We conducted a computer search to look for new linear codes over \(\mathbb {Z}_4\) by generating constacyclic codes over R (for the two values of \(\lambda \) discussed in this paper) and computing their \(\mathbb {Z}_4\)-images using each of the Gray map we introduced. We have been able to find 15 new linear codes over \(\mathbb {Z}_4\) with better parameters than the currently best-known codes in the database [8]. We present the details of these codes in Table 2 below. The generator polynomial g(x) of each code is a monic divisor of \(x^n-\lambda \) for \(\lambda = 2+3u \text { or } 3+2u\). For the sake of saving space, we use a compact representation of the polynomials where coefficients are listed in descending order and elements of R are encoded according to Table 1 below. Each element of R is encoded by a single character in the set \(\{0,1,3,4,5,6,7,8,9, \mathrm{A}, \mathrm{B}, \mathrm{C}, \mathrm{D}, \mathrm{E}, \mathrm{F}\}\). Thus the generator polynomial in the third row of Table 2, for example, is \(x^5+(2+u)x^4+2x^3+(2+3u)x^2+2x+u+2\). For the last entry in the same table, we gave an alternative description of the generator polynomial because it has a large degree. We only computed the Lee weights of the codes over \(\mathbb {Z}_4\).