1 Introduction

In [17], it was shown that many interesting binary linear and nonlinear codes were in fact the images under a Gray map of codes over the ring \({\mathbb {Z}}_4.\) This important discovery caused an enormous amount of activity in studying codes in this ambient space and linear codes over \({\mathbb {Z}}_4\) has become one of the most widely studied areas of algebraic coding theory. More precisely, \({\mathbb {Z}}_4\) modules are studied together with the following Gray map \(\psi \) from \({\mathbb {Z}}_4\) onto \({\mathbb {F}}_2^2\), defined by \(0\mapsto 00\), \(1\mapsto 01\), \(2\mapsto 11\) and \(3\mapsto 10\), to obtain good binary codes. As a consequence of these discoveries, codes over rings have become a widely studied branch of coding theory.

We begin with the necessary definitions for codes over rings. Let A be a commutative finite ring with identity \(1\ne 0\), and let \(A^{\times }\) be the multiplicative group of invertible elements of A. A code over A of length N is a nonempty subset \(\mathcal{C}\) of \(A^N\). The code \(\mathcal{C}\) is said to be linear if \(\mathcal{C}\) is an A-submodule of \(A^N\). Specifically, \(\mathcal{C}\) is called a \({\mathbb {Z}}_4\)-linear code when \(A={\mathbb {Z}}_4\). All quaternary codes, i.e., codes over \({\mathbb Z}_4\), in this paper are assumed to be linear. The ambient space \(A^N\) is equipped with the usual Euclidian inner product, i.e., \([a,b]=\sum _{j=0}^{N-1}a_jb_j\), where \(a=(a_0,a_1,\ldots ,a_{N-1}), b=(b_0,b_1,\ldots ,b_{N-1})\in A^N\), and the dual code is defined by \(\mathcal{C}^{\bot }=\{a\in A^N\mid [a,b]=0, \forall b\in \mathcal{C}\}\). If \(\mathcal{C}=\mathcal{C}^{\bot }\), \(\mathcal{C}\) is called a self-dual code over A. Self-dual codes are an important and widely studied family of codes. As an example of the importance of quaternary self-dual codes, see [19], where the authors find extremal unimodular lattices of length 72 using self-dual quaternary codes. For an encyclopedic description of self-dual codes, see [23].

Cyclic codes are one of the most studied families of codes. One important reason for this is that they have a canonical representation in polynomial rings. This representation allows for a classification of these and a description of their structure. We define a code \(\mathcal{C}\) to be cyclic if \((c_{N-1}, c_0,c_1,\ldots , c_{N-2})\in \mathcal{C}\) for all \((c_0,c_1,\ldots , c_{N-1})\in \mathcal{C}\). We use the natural connection of cyclic codes to polynomial rings, where the vector \(c=(c_0,c_1,\ldots , c_{N-1})\) is viewed as a polynomial \(c(x)=\sum _{j=0}^{N-1}c_jx^j\). Under this association, the cyclic code \(\mathcal{C}\) is an ideal in the polynomial residue ring \(A[x]/\langle x^N-1\rangle \) since addition and multiplication of a scalar from A follows from the code being linear and multiplication by x corresponds to the cyclic shift. If \(\sigma \) is the cyclic shift operator, then a code \(\mathcal{C}\) is said to be quasicyclic of indexk if k is the smallest integer with \(\sigma ^k(\mathcal{C}) = \mathcal{C}.\)

Let \({\mathcal {C}}\) be a nonzero \({\mathbb {Z}}_4\)-linear code of length N. Then \({\mathcal {C}}\) has a generator matrix of the form:

$$\begin{aligned} G_{{\mathcal {C}}}=\left( \begin{array}{ccc}I_{k_0} &{} A &{} B\\ 0 &{} 2I_{k_1} &{} 2C\end{array}\right) U, \end{aligned}$$

where U is a suitable \(N\times N\) permutation matrix, \(I_{k_0}\) and \(I_{k_1}\) denote the \(k_0\times k_0\) and \(k_1\times k_1\) identity matrices, respectively, A and C are \({\mathbb {Z}}_2\)-matrices, and B is a \({\mathbb {Z}}_4\)-matrix. Then \({\mathcal {C}}\) is an abelian group of type \(4^{k_0}2^{k_1}\) and contains \(2^{2k_0+k_2}\) codewords (cf. Wan [25, Proposition 1.1]).

Cyclic codes over \({\mathbb {Z}}_4\) of length n were first studied in [4] as a projection of codes over the p-adics. A more detailed study appeared in [21], where specific polynomial representations of cyclic codes were given. In [22], Pless et al. characterized nontrivial cyclic self-dual codes over \({\mathbb {Z}}_4\) of certain length n by describing generators of such codes. In particular, all examples of nontrivial cyclic self-dual codes over \({\mathbb {Z}}_4\) up to length 39 were given. For example, there is only 1 nontrivial cyclic self-dual code over \({\mathbb {Z}}_4\) of length 23.

In [12], Dougherty and Fernandez studied the ranks and kernels of cyclic codes over \({\mathbb {Z}}_4\) of odd length. In [20], Jitman and Sangwisut studied the hulls of cyclic codes over \({\mathbb {Z}}_4\) of length n, and a characterization for hulls was established in terms of the generators viewed as ideals in the quotient ring \({\mathbb {Z}}_4[x]/\langle x^n-1\rangle \). In [16], Gao et al. investigated double cyclic codes over \({\mathbb {Z}}_4\), i.e., \({\mathbb {Z}}_4[x]\)-submodules of \({\mathbb {Z}}_4[x]/\langle x^r-1\rangle \times {\mathbb {Z}}_4[x]/\langle x^s-1\rangle \), where both r and s are odd positive integers. Some optimal or suboptimal nonlinear binary codes were obtained from this family of codes.

In general, cyclic codes were studied where the length was relatively prime to the characteristic of the ring since this simplified the algebra significantly. Later cyclic codes where the length was not relatively prime to 4 were studied. The first step was done by Abualrub and Oehmke in [1], where they determined the generators for cyclic codes over \({\mathbb {Z}}_4\) for lengths of the form \(2^k\). Later, Blackford in [3] and [2] gave a description for cyclic codes over \({\mathbb {Z}}_4\) of length 2n in terms of the discrete Fourier transform and by the following ring isomorphism:

$$\begin{aligned} \frac{{\mathbb {Z}}_4[x]}{\langle x^{2n}-1\rangle }\cong \frac{{\mathcal {R}}[x]}{\langle x^n-u\rangle } \cong \frac{{\mathcal {R}}[x]}{\langle g_1(x)\rangle }\times \cdots \times \frac{{\mathcal {R}}[x]}{\langle g_r(x)\rangle }, \end{aligned}$$

where

$$\begin{aligned} {\mathcal {R}}:=\frac{{\mathbb {Z}}_4[u]}{\langle u^{2}-1\rangle }=\{a+bu\mid a,b\in {\mathbb {Z}}_4\} \ (u^2=1) \end{aligned}$$

and \(x^n-u = g_1(x) g_2(x) \ldots g_r(x)\) and \(g_1(x),g_2(x), \ldots , g_r(x)\) are monic, basic irreducible and pairwise coprime polynomials in \({\mathcal {R}}[x]\) (see [3, p. 29]). Using this foundation, generator polynomials, parity check matrices, and dual codes over \({\mathbb {Z}}_4\) of length 2n were given in [3].

Completing the remaining cases, as a generalization and further development of [3] and [2], Dougherty and Ling in [13] determined the structure of cyclic codes over \({\mathbb {Z}}_4\) for arbitrary even length in terms of the discrete Fourier transform.

It is not easy to explicitly give all distinct cyclic codes over \({\mathbb {Z}}_4\) of length 2n (resp. \(2^kn\)) nor to explicitly give all self-dual cyclic codes by use of expressions for cyclic codes given in [3] (resp. [13]). As an example, see Sect. 2.4 “Examples” in [3, pp. 38–39].

To be precise, there are some mistakes in the description of self-dual cyclic codes over \({\mathbb {Z}}_4\) of length 2n in [13]. We shall explain what these are presently.

Proposition 5.8 of [13] (see p. 151) states: “The number of self-dual cyclic codes over \({\mathbb {Z}}_4\) of length \(2^kn\) is given by \(\prod _{\alpha \in \widetilde{{\mathcal {J}}}}M_\alpha \prod _{\alpha \in K}N_\alpha \).”

For any integer \(\alpha \), \(0\le \alpha \le n-1\), let \(J_\alpha ^{(2)}\) be the 2-cyclotomic coset modulo n containing \(\alpha \), i.e., \(J_\alpha ^{(2)}=\{2^j\alpha \mid j=0,1,\ldots ,m_\alpha -1\}\) (mod n), where \(m_\alpha =|J_\alpha ^{(2)}|\). In [13, Proposition 5.8], \(\widetilde{{\mathcal {J}}}\cup K\) is a complete set of 2-cyclotomic coset representatives modulo n, satisfying the following conditions:

  1. (1)

    \(0\in \widetilde{{\mathcal {J}}}\), and \(J_{n-\alpha }^{(2)}=J_{\alpha }^{(2)}\) for all \(0\ne \alpha \in \widetilde{{\mathcal {J}}}\);

  2. (2)

    \(J_{\alpha }^{(2)}\cap J_{n-\alpha }^{(2)}=\emptyset \) for all \(\alpha \in K\).

When \(k=1\), \(N_\alpha =5+2^{m_\alpha }\) ([13, p. 140] or [3, Corollary 1]) for all \(\alpha \in \widetilde{{\mathcal {J}}}\cup K\), and \(M_\alpha =1\) [13, Corollary 5.7(i)] for all \(\alpha \in K\). In this case, [13] claimed the following:

  1. (1)

    The number of self-dual cyclic codes over\({\mathbb {Z}}_4\)of length 2nis given by

    $$\begin{aligned} \prod _{\alpha \in K}(5+2^{m_\alpha }). \end{aligned}$$
  2. (2)

    If there existsesuch that\(-1\equiv 2^e \ \mathrm{mod} \ n\), then there is only one cyclic self-dual code over\({\mathbb {Z}}_4\)of length 2nwherenis odd, namely\(2({\mathbb {Z}}_4)^{2n}\) [13, Corollary 5.9].

Both of these statements require correction. The first statement is missing a term (which proves to be quite important). In Theorem 3 in this paper, we prove the following correction:

\(\bullet \) The number of self-dual cyclic codes over \({\mathbb {Z}}_4\) of length 2n is given by

$$\begin{aligned} \prod _{0\ne \alpha \in \widetilde{{\mathcal {J}}}}(1+2^{{m_\alpha }/{2}})\prod _{\alpha \in K}(5+2^{m_\alpha }). \end{aligned}$$

We can compare these two results. As \(-1\equiv 2\) (mod 3), \(-1\equiv 2^2\) (mod 5), \(-1\equiv 2^3\) (mod 9), \(-1\equiv 2^4\) (mod 17), \(-1\equiv 2^5\) (mod 33), \(-1\equiv 2^5\) (mod 11), \(-1\equiv 2^6\) (mod 13) and \(-1\equiv 2^7\) (mod 43), the results in [13] would imply that there is only one cyclic self-dual code over \({\mathbb {Z}}_4\) of length 2n for \(n=3, 5, 9, 11, 13, 17, 33, 43\). However, the number \({\mathcal {N}}\) of cyclic self-dual code over \({\mathbb {Z}}_4\) with length 2n for \(n=3, 5, 9, 11, 13, 17, 33, 43\) is given by the following table.

n

\({\mathcal {N}}\)

n

\({\mathcal {N}}\)

n

\({\mathcal {N}}\)

n

\({\mathcal {N}}\)

3

3

9

27

13

65

33

107811

5

5

11

33

17

289

43

2146689

As an initial improvement for the partial results in [13], Cao et al. presented a clearer concatenated structure for every cyclic code over \({\mathbb {Z}}_4\) of length 4n using the following ring isomorphism (see [8, Theorem 2.6]):

$$\begin{aligned} \frac{{\mathbb {Z}}_4[x]}{\langle x^{4n}-1\rangle } \cong \frac{{\mathcal {A}}[x]}{\langle x^{4}-y\rangle }\cong \frac{R_1[x]}{\langle x^{4}-y\rangle }\times \cdots \times \frac{R_r[x]}{\langle x^{4}-y\rangle } \end{aligned}$$

and ideals of each ring \(\frac{R_i[x]}{\langle x^{4}-y\rangle }\) (see [8, Theorem 3.3]), where

$$\begin{aligned} {\mathcal {A}}:=\frac{{\mathbb {Z}}_4[y]}{\langle y^{n}-1\rangle }=\left\{ \sum _{j=0}^{n-1} a_jy^j\mid a_0,a_1,\ldots ,a_{n-1}\in {\mathbb {Z}}_4\right\} \ (y^n=1), \end{aligned}$$

\(R_i=\frac{{\mathbb {Z}}_4[y]}{\langle f_i(y)\rangle }\), \(1\le i\le r\), and \(f_1(y),\ldots , f_r(y)\) are monic, basic irreducible and pairwise coprime polynomials in \({\mathbb {Z}}_4[y]\) satisfying \(y^n-1=f_1(y)\ldots f_r(y)\). It can still be difficult to construct cyclic codes over \({\mathbb {Z}}_4\) of length 4n by use of the representation given in [8], as the expression for ideals of each ring \( \frac{R_i[x]}{\langle x^{4}-y\rangle }\) is still complicated. Therefore, it is necessary to adopt a new approach for representing all distinct cyclic codes over \({\mathbb {Z}}_4\) of even length. It is then possible to determine which codes among them are self-dual.

Throughout the rest of this paper, we let n be an positive odd integer. Then, cyclic codes over \({\mathbb {Z}}_{4}\) of length 2n are viewed as ideals in the polynomial ring \({\mathbb {Z}}_{4}[x]/\langle x^{2n}-1\rangle \), using the canonical representation. In this paper, we give another description for ideals of \({\mathbb {Z}}_{4}[x]/\langle x^{2n}-1\rangle \) by the using the following ring isomorphism:

$$\begin{aligned} \frac{{\mathbb {Z}}_{4}[x]}{\langle x^{2n}-1\rangle } \cong \frac{{\mathbb {Z}}_{4}[x]}{\langle f_1(x^2)\rangle }\times \cdots \times \frac{{\mathbb {Z}}_{4}[x]}{\langle f_r(x^2)\rangle }, \end{aligned}$$

and by examining the ideals in each ring \(\frac{{\mathbb {Z}}_{4}[x]}{\langle f_i(x^2)\rangle }\), where \(f_1(x),\ldots , f_r(x)\) are monic, basic irreducible and pairwise coprime polynomials in \({\mathbb {Z}}_{4}[x]\) satisfying \(x^n-1=f_1(x)\ldots f_r(x)\).

Recall the following easy proposition.

Proposition 1

Let \(\mathcal{C}\) be a quaternary cyclic code of length 2n. Then \(\psi (\mathcal{C})\) is a binary (not necessarily linear) quasicyclic code of length 4n and index 2, where \(\psi : {{\mathbb {Z}}}_4^{2n} \rightarrow {{\mathbb {F}}}_2^{4n}\) is the Gray map.

Proof

Follows from a straightforward computation. \(\square \)

We organize the paper as follows. In Sect. 2, we give a new representation and an efficient encoder for each cyclic code over \({\mathbb {Z}}_4\) of length 2n (Theorem 2.1). In Sect. 3, we introduce necessary notation needed in this paper and give a proof for Theorem 1. In Sect. 4, we present the dual code for each of these cyclic codes. In Sect. 5, we list all distinct self-dual cyclic codes over \({\mathbb {Z}}_4\) of length 2n and count the number of these codes. In Sect. 6, we list all 315 self-dual cyclic codes over \({\mathbb {Z}}_4\) of length 30 explicitly. Among these codes, we obtain 24 new and good cyclic self-dual \({\mathbb {Z}}_4\)-codes \({\mathcal {C}}\) with parameters \((30,|{\mathcal {C}}|=2^{30},d_H=6,d_L=12)\) and \((30,|{\mathcal {C}}|=2^{30},d_H=5,d_L=10)\), where \(d_H\) and \(d_L\) are the minimum Hamming distance and the minimum Lee distance of the code \({\mathcal {C}}\), respectively. In Sect. 7, we study the lifts of cyclic codes and an isomorphism on the set of cyclic codes.

2 Representation and encoding for cyclic codes over \({\mathbb {Z}}_4\) of length 2n

In this section, we give a new representation and an efficient encoder for each cyclic code over \({\mathbb {Z}}_4\) of length 2n.

In this paper, we will regard the binary field \({\mathbb {F}}_2={\mathbb {Z}}_2=\{0,1\}\) as a subset of the ring \({\mathbb {Z}}_4=\{0,1,2,3\}\), even though \({\mathbb {F}}_2\) is not a subring of \({\mathbb {Z}}_4\). Using this, any element a of \({\mathbb {Z}}_4\) has a unique 2-expansion, namely \(a=a_0+2a_1,\) where \( a_0,a_1\in {\mathbb {F}}_2.\) We define the following projection to the binary field \({\overline{a}}=a_0=a \pmod {2}.\) Then \(^{-}:{\mathbb {Z}}_4 \rightarrow {\mathbb {F}}_2\) is a surjective ring homomorphism. The map extends naturally to \({\mathbb {Z}}_4[y]\) by applying it to the coefficients of the polynomial. Let y be an indeterminate over \({\mathbb {Z}}_4\) and \({\mathbb {F}}_2\). Define

$$\begin{aligned} {\overline{f}}(y)=\overline{f(y)}=\sum _{i=0}^d{\overline{b}}_iy^i, \ \forall f(y)=\sum _{i=0}^db_iy^i\in {\mathbb {Z}}_4[y]. \end{aligned}$$

The map \(^{-}\) is a surjective ring homomorphism from \({\mathbb {Z}}_4[y]\) onto \({\mathbb {F}}_2[y]\).

Recall that a monic polynomial \(f(y)\in {\mathbb {Z}}_4[y]\) of positive degree is defined to be basic irreducible if \({\overline{f}}(y)\) is an irreducible polynomial in \({\mathbb {F}}_2[y]\) (cf. Wan [26, Sect. 13.4]).

Throughout this paper, we assume the following factorization of \(y^n-1\):

$$\begin{aligned} y^n-1=f_1(y)f_2(y)\ldots f_r(y), \end{aligned}$$
(1)

where \(f_1(y),f_2(y),\ldots , f_r(y)\) are pairwise coprime monic basic irreducible polynomials in \({\mathbb {Z}}_4[y]\) with degree \(\mathrm{deg}(f_i(y))=m_i\) for all \(i=1,\ldots ,r\). Additionally, we will adopt the following notation.

  1. (1)

    The ring \({\mathcal {A}}=\frac{{\mathbb {Z}}_4[x]}{\langle x^{2n}-1\rangle }=\{\sum _{j=0}^{2n-1}a_jx^j\mid a_j\in {\mathbb {Z}}_4, \ j=0,1,\ldots , 2n-1\}\) where the arithmetic is done modulo \(x^{2n}-1\). Cyclic codes over \({\mathbb {Z}}_4\) of length 2n are viewed as ideals of the ring \({\mathcal {A}}\).

  2. (2)

    The ring \({\mathcal {K}}_i=\frac{{\mathbb {Z}}_4[x]}{\langle f_i(x^2)\rangle }=\{\sum _{j=0}^{2m_i-1}a_jx^j\mid a_j\in {\mathbb {Z}}_4, \ j=0,1,\ldots , 2m_i-1\}\) where the arithmetic is done modulo \(f_i(x^2)\). We regard \({\mathcal {K}}_i\) as a subset of the ring \({\mathcal {A}}\).

  3. (3)

    The set \(\mathcal{T}_i=\{\sum _{j=0}^{m_i-1}t_jx^j\mid t_j\in \{0,1\}, \ j=0, \ldots , m_i-1\}\). Then \(|\mathcal{T}_i|=2^{m_i}\). We regard \({\mathcal {T}}_i\) as a subset of the ring \({\mathcal {K}}_i\). Hereafter, the set \({\mathcal {T}}_i\) will appear frequently in the succeeding results.

  4. (4)

    Denote by \(F_i(y)=\frac{y^n-1}{f_i(y)}\in {\mathbb {Z}}_4[y]\). Since \(\gcd ({\overline{F}}_i(y), {\overline{f}}_i(y))=1\), we see that \(F_i(y)\) and \(f_i(y)\) are coprime in \({\mathbb {Z}}_4[y]\) (cf. [26, Lemma 13.5]). Hence there are polynomials \(u_i(y), v_i(y)\in {\mathbb {Z}}_4[y]\) such that

    $$\begin{aligned} u_i(y)F_i(y)+v_i(y)f_i(y)=1, \end{aligned}$$
    (2)

    and \(\mathrm{deg}(u_i(y))<\mathrm{deg}(f_i(y))=m_i\). Then define \(\theta _i(x)\in {\mathcal {A}}\) by the following equation

    $$\begin{aligned} \theta _i(x)\equiv u_i(x^2)F_i(x^2)=1-v_i(x^2)f_i(x^2) \ (\mathrm{mod} \ x^{2n}-1). \end{aligned}$$
    (3)
  5. (5)

    There is a unique element \(w_{i}(x)\) in \(\mathcal{T}_i\) such that \(f_i(x)^2=2{\overline{f}}_i(x)w_{i}(x)\) in the ring \(\mathcal{K}_i\) and \(w_{i}(x)\ne 0\) (see Lemma 5 of this paper).

For any ideal \(C_i\) in the ring \(\mathcal{K}_i={\mathbb {Z}}_4[x]/\langle f_i(x^2)\rangle \), recall that the annihilating ideal of \(C_i\) is defined as \(\mathrm{Ann}(C_i)=\{\alpha \in \mathcal{K}_i\mid \alpha \beta =0, \forall \beta \in C_i \}\).

The following theorem will give a description of all distinct ideals in \({\mathcal {A}}\).

Theorem 1

Every cyclic code \({\mathcal {C}}\) over \({\mathbb {Z}}_4\) of length 2n is a unique direct sum of its subcodes:

$$\begin{aligned} \mathcal{C}=\bigoplus _{i=1}^r\mathcal{C}_i=\sum _{i=1}^r\mathcal{C}_i =\{\xi _1(x)+\cdots +\xi _r(x)\mid \xi _i(x)\in \mathcal{C}_i, \ i=1,\ldots ,r\}, \end{aligned}$$

where

$$\begin{aligned} \mathcal{C}_i=\theta _i(x)C_i=\{\theta _i(x)b(x)\mid b(x)\in C_i \} \pmod {x^{2n}-1} \end{aligned}$$

is a subcode of \({\mathcal {C}}\) for all i, \(1\le i\le r\), and \(C_i\) is an ideal of \(\mathcal{K}_i\) listed by the following table.

Case

\(C_i\)

type of \({\mathcal {C}}_i\)

\(|{\mathcal {C}}_i|\)

\(\mathrm{Ann}(C_i)\)

1.

\(\langle 0\rangle \)

\(4^02^0\)

1

\(\langle 1\rangle \)

2.

\(\langle 1\rangle \)

\(4^{2m_i}2^0\)

\(2^{4m_i}\)

\(\langle 0\rangle \)

3.

\(\langle 2\rangle \)

\(4^02^{2m_i}\)

\(2^{2m_i}\)

\(\langle 2\rangle \)

4.

\(\langle 2{\overline{f}}_i(x)\rangle \)

\(4^02^{m_i}\)

\(2^{m_i}\)

\(\langle f_i(x),2\rangle \)

5.

\(\langle f_i(x),2\rangle \)

\(4^{m_i}2^{m_i}\)

\(2^{3m_i}\)

\(\langle 2{\overline{f}}_i(x)\rangle \)

6.

\(\langle f_i(x)+2h(x)\rangle \)

\(4^{m_i}2^0\)

\(2^{2m_i}\)

\(\langle f_i(x)+2(w_i(x)+h(x))\rangle \)

where \(h(x)\in {\mathcal {T}}_i\). Then the number of ideals in \({\mathcal {K}}_i\) is \(5+2^{m_i}\).

An encoder for each subcode \({\mathcal {C}}_i\), is given by the following:

  1. Case 1.

    \({\mathcal {C}}_i=\{0\}\).

  2. Case 2.

    \({\mathcal {C}}_i=\{\sum _{j=0}^{2m_i-1}a_jx^j\theta _i(x)\mid a_j\in {\mathbb {Z}}_4, \ j=0,1,\ldots ,2m_i-1\}\).

  3. Case 3.

    \({\mathcal {C}}_i=\{\sum _{t=0}^{2m_i-1}2b_tx^t\theta _i(x)\mid b_t\in \{0,1\}, \ t=0,1,\ldots ,2m_i-1\}\).

  4. Case 4.

    \({\mathcal {C}}_i=\{\sum _{t=0}^{m_i-1}2b_tx^t{\overline{f}}_i(x)\theta _i(x)\mid b_t\in \{0,1\}, \ t=0,1,\ldots ,m_i-1\}\).

  5. Case 5.

    \({\mathcal {C}}_i =\{\sum _{j=0}^{m_i-1}a_jx^jf_i(x)\theta _i(x) +\sum _{t=0}^{m_i-1}2b_tx^t\theta _i(x) \mid a_j\in {\mathbb {Z}}_4, \ b_t\in \{0,1\}, \ j=0,1,\ldots , m_i-1 \ \mathrm{and} \ t=0,1,\ldots , m_i-1\}\).

  6. Case 6.

    \({\mathcal {C}}_i=\{\sum _{j=0}^{m_i-1}a_jx^j\left( f_i(x)+2h(x)\right) \theta _i(x)\mid a_j\in {\mathbb {Z}}_4, \ j=0,1,2,\ldots \), \(m_i-1\}.\)

Let\(4^{k_{0,i}}2^{k_{1,i}}\)be the type of the subcode\({\mathcal {C}}_i\)given above for all\(1\le i\le r\). Then\({\mathcal {C}}\)is of type

$$\begin{aligned} 4^{\sum _{i=1}^rk_{0,i}}2^{\sum _{i=1}^rk_{1,i}}. \end{aligned}$$

Hence the number of codewords in \(\mathcal{C}\) is \(\prod _{i=1}^r|{\mathcal {C}}_i|=2^{2\sum _{i=1}^rk_{0,i}+\sum _{i=1}^rk_{1,i}}\) and the minimum Hamming distance (Lee distance and Euclidean distance) of \(\mathcal{C}\) satisfies

$$\begin{aligned} d_{\mathrm{min}}(\mathcal{C})\le \mathrm{min}\{d_{\mathrm{min}}(\theta _i(x)C_i)\mid i=1,\ldots ,r \}. \end{aligned}$$

Moreover, the number of all cyclic codes \({\mathcal {C}}\) over \({\mathbb {Z}}_4\) of length 2n is equal to \(\prod _{i=1}^r(5+2^{m_i})\).

Using the notation of Theorem 1, \(\mathcal{C}=\bigoplus _{j=1}^r\theta _j(x)C_j\) is called the canonical form decomposition of the cyclic code \({\mathcal {C}}\) over \({\mathbb {Z}}_{4}\) of length 2n.

Remark 1

For each integer i, \(1\le i\le r\), by Theorem 1, we know that \({\mathcal {K}}_i=\frac{{\mathbb {Z}}_{4}[x]}{\langle f_i(x^2)\rangle }\) is a local ring with unique maximal ideal \(\langle f_i(x),2\rangle \) and a non-principal ideal ring with \(5+2^{m_i}\) ideals. However, \(\frac{{\mathbb {Z}}_{4}[x]}{\langle f_i(-x^2)\rangle }\) is a finite chain ring with unique maximal ideal \(\langle f_i(x)\rangle \) and a principal ideal ring with 5 ideals (cf. [7, Theorem 3.2]).

3 Proof of Theorem 1

In this section, we give a complete proof of Theorem 1.

First, by substituting \(x^2\) for y in Eqs. (1) and (2) in Sect. 2, we obtain

$$\begin{aligned} x^{2n}-1=f_1(x^2)f_2(x^2)\ldots f_r(x^2) \ \mathrm{and} \ u_i(x^2)F_i(x^2)+v_i(x^2)f_i(x^2)=1 \end{aligned}$$
(4)

in \({\mathbb {Z}}_4[x]\) respectively, where \(F_i(x^2)=\frac{x^{2n}-1}{f_i(x^2)}\in {\mathbb {Z}}_4[x]\). From this, by Eq. (3) in Sect. 2 and the Chinese Remainder Theorem for commutative rings, one can easily verify the following conclusions. Here we omit the proofs.

Lemma 1

Let \({\mathcal {A}}=\frac{{\mathbb {Z}}_4[x]}{\langle x^{2n}-1\rangle }\) and \({\mathcal {K}}_i=\frac{{\mathbb {Z}}_4[x]}{\langle f_i(x^2)\rangle }\).

  1. (i)

    In the ring \(\mathcal{A}\), we have \(\theta _1(x)+\cdots +\theta _r(x)=1\), \(\theta _i(x)^2=\theta _i(x)\) and \(\theta _i(x)\theta _j(x)=0\) for all \(1\le i\ne j\le r\).

  2. (ii)

    We have that \(\mathcal{A}=\mathcal{A}_1+\cdots +\mathcal{A}_{r}\), where \(\mathcal{A}_i=\mathcal{A}\theta _i(x)\) is the ideal of \(\mathcal{A}\) generated by \(\theta _i(x)\), and \(\mathcal{A}_i\) is a commutative ring with \(\theta _i(x)\) as its multiplicative identity for all \(i=1,\ldots , r\). Moreover, \(\mathcal{A}\) is a direct sum of rings \(\mathcal{A}_1, \ldots , \mathcal{A}_{r}\) with \(\mathcal{A}_i\mathcal{A}_j=\{0\}\) for all \(i\ne j\).

  3. (iii)

    For each integer i, \(1\le i\le r\), the map \(\phi _i\) defined by

    $$\begin{aligned} \phi _i: a(x)\mapsto \theta _i(x)a(x) \ \pmod {x^{2n}-1}, \ \forall a(x)\in \mathcal{K}_i. \end{aligned}$$

    is a ring isomorphism from \(\mathcal{K}_i\) onto \(\mathcal{A}_i\).

  4. (iv)

    Define a map \(\phi \) by the rule: for any \(a_i(x)\in \mathcal{K}_i\), \(1\le i\le r\), let

    $$\begin{aligned} \phi (a_1(x),\ldots ,a_r(x))=\sum _{i=1}^r\phi _i(a_i(x))=\sum _{i=1}^r\theta _i(x)a_i(x) \ (\mathrm{mod} \ x^{2n}-1). \end{aligned}$$

    Then \(\phi \) is a ring isomorphism from \(\mathcal{K}_1\times \cdots \times \mathcal{K}_r\) onto \(\mathcal{A}\).

We now present a canonical form decomposition for any cyclic code over \({\mathbb {Z}}_4\) of length 2n, i.e., any ideal of the ring \(\mathcal{A}={\mathbb {Z}}_4[x]/\langle x^{2n}-1\rangle \).

Proposition 2

Let \(\mathcal{C}\subseteq \mathcal{A}\). Then \(\mathcal{C}\) is a cyclic code over \({\mathbb {Z}}_4\) of length 2n if and only if for each integer i, \(1\le i\le r\), there is a unique ideal \(C_i\) of the ring \(\mathcal{K}_i\) such that \(\mathcal{C}=\bigoplus _{i=1}^r\mathcal{C}_i=\sum _{i=1}^r\mathcal{C}_i\), where

$$\begin{aligned} \mathcal{C}_i=\theta _i(x)C_i=\{\theta _i(x)c_i(x) \mid c_i(x)\in C_i\} \pmod {x^{2n}-1}. \end{aligned}$$

Moreover, the number of codewords in \({\mathcal {C}}\) is equal to \(|{\mathcal {C}}|=\prod _{i=1}^r|C_i|\).

Proof

Let \(\mathcal{C}\) be a cyclic code over \({\mathbb {Z}}_4\) of length 2n. By Lemma 1(iv) and the properties of isomorphic rings, there is a unique ideal C of the direct product ring \(\mathcal{K}_1\times \cdots \times \mathcal{K}_r\) such that \(\mathcal{C}=\phi (C)\). Hence for each integer i, \(1\le i\le r\), there is a unique ideal \(C_i\) of \(\mathcal{K}_i\) such that \(C=C_1\times \cdots \times C_r\). This implies that

$$\begin{aligned} {\mathcal {C}}= & {} \{\phi (c_1(x),\ldots ,c_r(x))\mid c_i(x)\in C_i, \ i=1,\ldots ,r\}\\= & {} \sum _{i=1}^r\{\theta _i(x)c_i(x)\mid c_i(x)\in C_i\} \pmod {x^{2n}-1}. \end{aligned}$$

Then the conclusion follows from Lemma 1(i), \(\mathcal{C}_i=\theta _i(x)C_i\subseteq {\mathcal {A}}_i\) for all i and \(|{\mathcal {C}}|=|C|=|C_1\times \cdots \times C_r|=\prod _{i=1}^r|C_i|\). \(\square \)

In order to present all cyclic codes over \({\mathbb {Z}}_4\) of length 2n, it is sufficient, using Proposition 2, to determine all ideals of the ring \(\mathcal{K}_i={\mathbb {Z}}_4[x]/\langle f_i(x^2)\rangle \), where \(f_i(x)\) is a monic basic irreducible polynomial in \({\mathbb {Z}}_4[x]\) of degree \(m_i\) and \(f_i(x)\mid (x^n-1)\), \(1\le i\le r\).

Let i be a positive integer, \(1\le i\le r\). Since \(f_i(y)\) is a monic basic irreducible polynomial in \({\mathbb {Z}}_4[y]\) of degree \(m_i\) by the notation of Sect. 2, \({\overline{f}}_i(y)\) is an irreducible polynomial in \({\mathbb {F}}_2[y]\) of degree \(m_i\) and \(\overline{f_i(x^2)}={\overline{f}}_i(x)^2\) as polynomials in \({\mathbb {F}}_2[x]\). We will adopt the following notation from now on.

  1. (1)

    The ring \(\varGamma _i=\frac{{\mathbb {Z}}_4[y]}{\langle f_i(y)\rangle }=\{\sum _{j=0}^{m_i-1}a_jy^j\mid a_j\in {\mathbb {Z}}_4, \ j=0, \ldots , m_i-1\}\) where the arithmetic is done modulo \(f_i(y)\).

  2. (2)

    The ring \({\overline{\varGamma }}_i=\frac{{\mathbb {F}}_{2}[y]}{\langle {\overline{f}}_i(y)\rangle }=\{\sum _{j=0}^{m_i-1}b_jy^j\mid b_j\in {\mathbb {F}}_2, \ j=0, \ldots , m_i-1\}\) where the arithmetic is done modulo \({\overline{f}}_i(y)\).

  3. (3)

    The ring \(\overline{\mathcal{K}}_i=\frac{{\mathbb {F}}_2[x]}{\langle {\overline{f}}_i(x^2)\rangle } =\frac{{\mathbb {F}}_2[x]}{\langle {\overline{f}}_i(x)^2\rangle }=\{\sum _{j=0}^{2m_i-1}b_jx^j\mid b_j\in {\mathbb {F}}_2, \ j=0,1,2,\ldots \), \(2m_i-1\}\) where the arithmetic is done modulo \({\overline{f}}_i(x)^2\).

As we regard \({\mathbb {F}}_2\) as a subset of \({\mathbb {Z}}_4\), we will regard \({\overline{\varGamma }}_i\) as a subset of \(\varGamma _i\) even though \({\overline{\varGamma }}_i\) is not a subring of \(\varGamma _i\). Similarly, we will regard \(\overline{\mathcal{K}}_i\) as a subset of the ring \({\mathcal {K}}_i=\frac{{\mathbb {Z}}_4[x]}{\langle f_i(x^2)\rangle }\). If needed, the reader is referred back to this identification of \(\overline{\mathcal{K}}_i\) with a subset of \({\mathcal {K}}_i\).

We collect a few results from [26] and [5] which we will need and we state them as a lemma. The following conclusion depends on that \(f_i(x)\) is monic basic irreducible, \(f_i(x)|(x^n-1)\) in \({\mathbb {Z}}_4[x]\) and n is odd.

Lemma 2

  1. (i)

    [26, Theorems 14.1 and 14.8] The ring \(\varGamma _i\) is a Galois ring of characteristic 4 and cardinality \(4^{m_i}\) and \(\varGamma _i={\mathbb {Z}}_4[\zeta _i]\), where \(\zeta _i=y+\langle f_i(y)\rangle \in \varGamma _i\) satisfying \(f_i(\zeta _i)=0\), \(\zeta _i^{2^{m_i}-1}=1\) and \(\zeta _i^n=1\) in \(\varGamma _i\). Denote by \({\overline{\zeta }}_i=y+\langle {\overline{f}}_i(y)\rangle \in {\overline{\varGamma }}_i\). Then \({\overline{\varGamma }}_i={\mathbb {F}}_2[{\overline{\zeta }}_i]\), which is a finite field of cardinality \(2^{m_i}\), \({\overline{f}}_i(x)=\prod _{j=0}^{m_i-1}(x-{\overline{\zeta }}_i^{2^j})\) over \({\overline{\varGamma }}_i\). Moreover, the homomorphism \(^{-}\) from \({\mathbb {Z}}_4[y]\) onto \({\mathbb {F}}_2[y]\) induces a surjective ring homomorphism from \(\varGamma _i\) onto \({\overline{\varGamma }}_i\) by the rule that

    $$\begin{aligned} \xi \mapsto {\overline{\xi }}=\sum _{j=0}^{m_i-1}{\overline{a}}_j{\overline{\zeta }}_i^j, \ \forall \xi =\sum _{j=0}^{m_i-1}a_j\zeta _i^j\in \varGamma _i \ \mathrm{with} \ a_0,a_1,\ldots ,a_{m_i-1}\in {\mathbb {Z}}_4. \end{aligned}$$

    Every element \(\xi \) of \(\varGamma _i\) has a unique 2-expansion: \(\xi =b_0+2b_1, \ b_0,b_1\in {\overline{\varGamma }}_i.\) Hence \({\overline{\xi }}=b_0\) and that \(\xi \) is an invertible element of \(\varGamma _i\) if and only if \(b_0\ne 0\). Therefore, \(|\varGamma _i^{\times }|=(2^{m_i}-1)2^{m_i}\).

  2. (ii)

    (cf. [5, Lemma 2.3(ii)]) We have that \(f_i(x)=\prod _{j=0}^{m_i-1}(x-\zeta _i^{2^j})\) over \(\varGamma _i\).

Obviously, \(\overline{\mathcal{K}}_i\) is a ring but it is important to note that \(\overline{\mathcal{K}}_i\) is not a subring of \({\mathcal {K}}_i\). Our next lemma is a result from [6].

Lemma 3

(cf. [6, Lemma 3.7])

  1. (i)

    The ring \(\overline{\mathcal{K}}_i\) is a finite chain ring with maximal ideal \(\langle {\overline{f}}_i(x)\rangle ={\overline{f}}_i(x)\overline{\mathcal{K}}_i\). The nilpotency index of \({\overline{f}}_i(x)\) in \(\overline{\mathcal{K}}_i\) is 2, and \(\overline{\mathcal{K}}_i/\langle {\overline{f}}_i(x)\rangle \cong {\mathbb {F}}_2[x]/\langle {\overline{f}}_i(x)\rangle \). Therefore, all ideals of \(\overline{\mathcal{K}}_i\) are given by: \({\overline{f}}_i(x)^l\overline{\mathcal{K}}_i\), \(l=0,1,2.\)

  2. (ii)

    Every element \(\beta \) of \(\overline{\mathcal{K}}_i\) has a unique \({\overline{f}}_i(x)\)-expansion:

    $$\begin{aligned} \beta =t_0(x)+t_1(x){\overline{f}}_i(x), \ t_0(x),t_1(x)\in \mathcal{T}_i. \end{aligned}$$

    Then \(\beta \) is an invertible element of \(\overline{\mathcal{K}}_i\), i.e., \(\beta \in \overline{\mathcal{K}}_i^\times \) if and only if \(t_0(x)\ne 0\).

  3. (iii)

    We have \(|{\overline{f}}_i(x)^l\overline{\mathcal{K}}_i|=|{\mathbb {F}}_2[x]/\langle {\overline{f}}_i(x)\rangle |^{2-l} =2^{m_i(2-l)}\), for \(l=0,1,2\).

We require two additional lemmas before proceeding to the proof.

Lemma 4

Every element a(x) of the ring \(\mathcal{K}_i\) has a unique 2-expansion:

$$\begin{aligned} a(x)=a_0(x)+2a_1(x), \ a_0(x),a_1(x)\in \overline{\mathcal{K}}_i, \end{aligned}$$

where \(\overline{\mathcal{K}}_i\) is viewed as a subset of \({\mathcal {K}}_i\). Then \(a(x)\in \mathcal{K}_i^{\times }\) if and only if \(a_0(x)\in \overline{\mathcal{K}}_i^{\times }\).

Proof

Let \(a(x)=\sum _{j=0}^{2m_i-1}a_jx^j\in \mathcal{K}_i={\mathbb {Z}}_4[x]/\langle f_i(x^2)\rangle \), where \(a_j\in {\mathbb {Z}}_4\). Then each \(a_j\in {\mathbb {Z}}_4\) has a unique 2-expansion: \(a_j=a_{j,0}+2a_{j,1}\) where \(a_{j,0},a_{j,1}\in {\mathbb {F}}_2\). Let \(a_s(x)=\sum _{j=0}^{2m_i-1}a_{j,s}x^j\) for \(s=0,1\). Then \(a_0(x),a_1(x)\in \overline{\mathcal{K}}_i\) and a(x) is uniquely expressed as \(a(x)=a_0(x)+2a_1(x)\).

Now, let \(a(x)\in \mathcal{K}_i^{\times }\). Then there exists \(b(x)=b_0(x)+2b_1(x)\in \mathcal{K}_i^{\times }\), where \(b_0(x),b_1(x)\in \overline{\mathcal{K}}_i\), such that

$$\begin{aligned} a_0(x)b_0(x)+2(a_0(x)b_1(x)+a_1(x)b_0(x))=a(x)b(x)=1\text { in }\mathcal{K}_i. \end{aligned}$$

This implies \(a_0(x)b_0(x)=1\) in \(\overline{\mathcal{K}}_i\), and hence \(a_0(x)\in \overline{\mathcal{K}}_i^{\times }\).

Conversely, let \(a_0(x)\in \overline{\mathcal{K}}_i^{\times }\). Then there exist \(b_0(x),c(x)\in \overline{\mathcal{K}}_i\) such that \(a_0(x)b_0(x)=1+2c(x)\). We select \(b_1(x)=a_0(x)^{-1}(a_1(x)b_0(x)+c(x))\in \overline{\mathcal{K}}_i\) in which \(a_0(x)^{-1}\in {\mathcal{K}}_i\) being the inverse of \(a_0(x)\), and set \(b(x)=b_0(x)+2b_1(x)\in \mathcal{K}_i\). Then by \(a_0(x)b_1(x)=a_1(x)b_0(x)+c(x)\) (mod 2), we have

$$\begin{aligned} a(x)b(x)=1+2c(x)+2((a_0(x)b_1(x)+a_1(x)b_0(x))=1 \ \mathrm{in} \ {\mathcal{K}}_i. \end{aligned}$$

This implies that \(a(x)\in \mathcal{K}_i^{\times }\). \(\square \)

Let \(1\le i\le r\). As \(f_i(x)\in {\mathbb {Z}}_4[x]\), we have \({\overline{f}}_i(x)\in {\mathbb {Z}}_2[x]\) and hence \({\overline{f}}_i(x)^2={\overline{f}}_i(x^2)\) as polynomials in \({\mathbb {Z}}_2[x]\). This implies that \(f_i(x)^2-f_i(x^2)\equiv 0\) (mod 2). Therefore, 2 always divides \(f_i(x)^2-f_i(x^2)\) as polynomials in \({\mathbb {Z}}[x]\).

Lemma 5

Let \(1\le i\le r\), and \(f_i(x)\) be a monic basic irreducible divisor of \(x^n-1\) in \({\mathbb {Z}}_4[x]\) satisfying Eq. (1) with degree \(m_i\), where n is odd. Then

  1. (i)

    There is a polynomial \(g_i(x)\) in \({\mathbb {Z}}_4[x]\) has degree \(\mathrm{deg}(g_i(x))\le m_i-1\) and satisfies \(f_i(x)^2=f_i(x^2)+2f_i(x)g_i(x).\) Precisely, we have

    $$\begin{aligned} g_i(x)=\frac{f_i(x)^2-f_i(x^2)}{2f_i(x)} \ (\mathrm{mod} \ 4), \end{aligned}$$

    where we regard \(f_i(x)\in {\mathbb {Z}}[x]\) and do calculations in the ring \({\mathbb {Z}}[x]\).

  2. (ii)

    Let \(w_i(x)\in {\mathcal {T}}_i\) satisfy \(w_i(x)\equiv g_i(x) \pmod {2}\), i.e. \(w_i(x)={\overline{g}}_i(x)\). Then

    $$\begin{aligned} f_i(x)^2=2{\overline{f}}_i(x)w_{i}(x) \ \mathrm{in} \ {\mathcal {K}}_i \ \mathrm{and} \ w_{i}(x)\ne 0. \end{aligned}$$

Proof

(i) Since \(f_i(x)\) is monic basic irreducible, \(f_i(x)|(x^n-1)\) in \({\mathbb {Z}}_4[x]\) and n is odd, by Lemma 2 we have that \(\varGamma _i={\mathbb {Z}}_4[\zeta _i]\), where \(\zeta _i=y+\langle f_i(y)\rangle \in \varGamma _i\) satisfying \(\zeta _i^{2^{m_i}-1}=1\), i.e., \(\zeta _i^{2^{m_i}}=\zeta _i\), and \(f_i(x)=\prod _{k=0}^{m_i-1}(x-\zeta _i^{2^k})\) in \(\varGamma _i[x]\). From this, we deduce that

$$\begin{aligned} f_i(x^2)=\prod _{k=0}^{m_i-1}(x^2-\zeta _i^{2^k})=\prod _{k=0}^{m_i-1}(x^2-\zeta _i^{2^{k+1}}) =\prod _{k=0}^{m_i-1}\left( x^2-(\zeta _i^{2^k})^2\right) . \end{aligned}$$

Then since \(x^2-(\zeta _i^{2^j})^2=(x-\zeta _i^{2^j})(x+\zeta _i^{2^j})\) and \(4=0\) in \({\mathbb {Z}}_4\), we have

$$\begin{aligned} f_i(x)^2= & {} \prod _{k=0}^{m_i-1}(x-\zeta _i^{2^k})^2=\prod _{k=0}^{m_i-1}\left( x^2-2\zeta _i^{2^k}x+(\zeta _i^{2^k})^2\right) \\= & {} \prod _{k=0}^{m_i-1}\left( \left( x^2-(\zeta _i^{2^k})^2\right) -2\zeta _i^{2^k}(x-\zeta _i^{2^k})\right) \\= & {} \prod _{k=0}^{m_i-1}\left( x^2-(\zeta _i^{2^k})^2\right) -2\sum _{k=0}^{m_i-1}\zeta _i^{2^k}(x-\zeta _i^{2^k})\prod _{0\le j\le m_i-1, j\ne k}\left( x^2-(\zeta _i^{2^j})^2\right) \\= & {} f_i(x^2)+2f_i(x)g_i(x), \end{aligned}$$

where

$$\begin{aligned} g_i(x)=\sum _{k=0}^{m_i-1}\zeta _i^{2^k}\prod _{0\le j\le m_i-1, j\ne k}(x+\zeta _i^{2^j})\in \varGamma _i[x] \ \mathrm{with} \ \mathrm{deg}(g_i(x))\le m_i-1. \end{aligned}$$
(5)

This implies \(g_i(x)=\frac{f_i(x)^2-f_i(x^2)}{2f_i(x)}\) which is a polynomial. From these and by \(f_i(x), f_i(x)^2, f_i(x^2)\in {\mathbb {Z}}_4[x]\), we deduce that that \(g_i(x)\in {\mathbb {Z}}_4[x]\), since \({\mathbb {Z}}_4\) is a subring of \(\varGamma _i\).

(ii) As we viewed the finite field \({\mathbb {F}}_2\) as the subset \(\{0,1\}\subset {\mathbb {Z}}_4\), we have that \(w_i(x)={\overline{g}}_i(x)\in {\mathbb {F}}_2[x]\). Since \(f_i(x)^2=f_i(x^2)+2f_i(x)g_i(x)\) and \(4=0\) in \({\mathbb {Z}}_4\), it follows that \(f_i(x)^2\equiv 2{\overline{f}}_i(x){\overline{g}}_i(x)\) (mod \(f_i(x^2)\)). This implies

$$\begin{aligned} f_i(x)^2=2{\overline{f}}_i(x){\overline{g}}_i(x)=2{\overline{f}}_i(x)w_i(x) \ \mathrm{in} \ {\mathcal {K}}_i. \end{aligned}$$

By Eq. (5), we have

$$\begin{aligned} w_i(x)={\overline{g}}_i(x)=\sum _{k=0}^{m_i-1}{\overline{\zeta }}_i^{2^{k}}\prod _{0\le j\le m_i-1, j\ne k}(x-{\overline{\zeta }}_i^{2^j})\in {\mathbb {F}}_2[x], \end{aligned}$$

where \({\overline{\zeta }}_i\) is a root of the monic irreducible polynomial \({\overline{f}}_i(x)\) in the finite field \({\overline{\varGamma }}_i\) satisfying \({\overline{\zeta }}_i^{2^{m_i}-1}=1\) by Lemma 2(i). For any integer t, \(0\le t\le m_i-1\), we see that \(w_i({\overline{\zeta }}_i^{2^t})={\overline{\zeta }}_i^{2^{t}}\prod _{0\le j\le m_i-1, j\ne t}({\overline{\zeta }}_i^{2^{t}}-{\overline{\zeta }}_i^{2^j})\ne 0\), since \({\overline{\zeta }}_i, {\overline{\zeta }}_i^2,\ldots ,{\overline{\zeta }}_i^{2^{m_i-1}}\) are all distinct roots of \({\overline{f}}_i(x)\) in the finite field \({\overline{\varGamma }}_i\). From this, we deduce that \(w_i(x)\) and \({\overline{f}}_i(x)\) are coprime polynomials in \({\mathbb {F}}_2[x]\). This implies that \(w_i(x)\) is an invertible element of the finite field \(\frac{{\mathbb {F}}_2[x]}{\langle {\overline{f}}_i(x)\rangle }\). From this and since \(\mathrm{deg}(w_i(x))\le \mathrm{deg}(g_i(x))<m_i=\mathrm{deg}({\overline{f}}_i(x))\), we deduce that \(w_i(x)\ne 0\). \(\square \)

Remark 2

The proof the this lemma depends heavily on Lemma 2(ii). The premise condition of Lemma 2(ii) is that \(f_i(x)\) is monic basic irreducible, \(f_i(x)\) is a divisor of \(x^n-1\) in \({\mathbb {Z}}_4[x]\) and n is odd. If this prerequisite is not met, the conclusion does not necessarily hold. For example, let \(f(x)=x^3+x+1\in {\mathbb {Z}}_4[x]\). It is clear that f(x) is monic basic irreducible in \({\mathbb {Z}}_4[x]\). But

$$\begin{aligned} g(x)=\frac{(x^3+x+1)^2-(x^6+x^2+1)}{2(x^3+x+1)} =\frac{x^4+x^3+x}{x^3+x+1}\not \in {\mathbb {Z}}_4[x]. \end{aligned}$$

In fact, we notice that \(x^3+x+1\) is a divisor of \(x^{14}-1\) but it is not a divisor of \(x^{7}-1\) in \({\mathbb {Z}}_4[x]\). Hence there is no odd positive integer n such that \((x^3+x+1)\mid (x^n-1)\) in \({\mathbb {Z}}_4[x]\).

We can now state the proof of Theorem 1.

Proof

By Proposition 2, we need to first prove that all distinct ideals of the ring \(\mathcal{K}_i\) are given by the table in Theorem 1.

Let \(\tau \) be the surjective ring homomorphism from \(\mathcal{K}_i\) onto \(\overline{\mathcal{K}}_i\) induced by \(^{-}: {\mathbb {Z}}_4 \rightarrow {\mathbb {F}}_2\) in the natural way:

$$\begin{aligned} \tau : a(x)\mapsto \tau (a(x))=a_0(x)={\overline{a}}(x) \ (\mathrm{mod} \ {\overline{f}}_i(x^2)={\overline{f}}_i(x)^2), \end{aligned}$$

for all \(a(x)=a_0(x)+2a_1(x)\in \mathcal{K}_i\) with \(a_0(x),a_1(x)\in \overline{\mathcal{K}}_i\) (see Lemma 4).

Let C be an ideal of \(\mathcal{K}_i\), and denote by \(\tau |_C\) the restriction of \(\tau \) to the ideal C of \(\mathcal{K}_i\). Then \(\tau |_C\) is a surjective ring homomorphism from C onto \(\tau (C)=\{\tau (c(x))\mid c(x)\in C\}\). This implies \(\tau (C)\cong C/\mathrm{ker}(\tau |_C)\) where \(\mathrm{ker}(\tau |_C)=\{c(x)\in C\mid \tau (c(x))=0\}\) is the kernel of \(\tau |_C\). Therefore, \(|C|=|\tau (C)||\mathrm{ker}(\tau |_C)|\).

Let \((C:2)=\{a(x)\in \mathcal{K}_i\mid 2a(x)\in C\}\). Then (C : 2) is an ideal of \(\mathcal{K}_i\) satisfying \(C\subseteq (C:2)\). Since \(\tau \) is a surjective ring homomorphism, both \(\tau (C)\) and \(\tau (C:2)\) are ideals of \(\overline{\mathcal{K}}_i\). As \(\overline{\mathcal{K}}_i\) is a finite chain ring, by Lemma 3(i) there is a unique pair (ls) of integers, \(0\le s\le l\le 2\), such that

$$\begin{aligned} \tau (C)={\overline{f}}_i(x)^l\overline{\mathcal{K}}_i \ \mathrm{and} \ \tau (C:2)={\overline{f}}_i(x)^s\overline{\mathcal{K}}_i. \end{aligned}$$
(6)

By the definition of \(\tau \) and the fact that \(2\cdot 2=0\), we have

$$\begin{aligned} \mathrm{ker}(\tau |_C)= & {} \{2c_1(x)\in C\mid c_1(x)\in \overline{\mathcal{K}}_i\}\\= & {} \{2(c_1(x)+2b(x))\in C\mid c_1(x)+2b(x)\in \mathcal{K}_i, \ c_1(x),b(x)\in \overline{\mathcal{K}}_i\}\\= & {} 2(C:2)=2\tau (C:2). \end{aligned}$$

This implies that \(|\mathrm{ker}(\tau |_C)|=|\tau (C:2)|\). From this, by Eq. (6) and Lemma 3(iii), we deduce that

$$\begin{aligned} |C|=|\tau (C)||\tau (C:2)|=2^{m_i(2-l)}\cdot 2^{m_i(2-s)}=2^{m_i(4-(l+s))}. \end{aligned}$$
(7)

Then, since \(0\le s\le l\le 2\), we have the following six cases:

Case 1.\(s=l=2\).

By Eq. (7), we have \(|C|=1\), and hence \(C=\langle 0\rangle \).

Case 2.\(s=l=0\).

By Eq. (7), we have that \(|C|=2^{4m_i}=4^{2m_i}=|{\mathcal {K}}_i|\). Hence \(C={\mathcal {K}}_i=\langle 1\rangle \). Then, by the definition of \({\mathcal {K}}_i\) in Sect. 2, we have that \(C=\{\sum _{j=0}^{2m_i-1}a_jx^j\mid a_j\in {\mathbb {Z}}_4, \ j=0,1,\ldots , 2m_i-1\}\) and C is of type \(4^{2m_i}2^0\).

Case 3.\(l=2\) and \(s=0\).

In this case, \(\tau (C)={\overline{f}}_i(x)^2\overline{{\mathcal {K}}}_i=\{0\}\) and \(\tau (C:2)={\overline{f}}_i(x)^0\overline{{\mathcal {K}}}_i=\overline{{\mathcal {K}}}_i\) by Eq. (6). Then by Lemma 4 and the definition of \(\tau \), we see that \(C=2\overline{{\mathcal {K}}}_i=\langle 2\rangle \) and \(C=\{2\sum _{t=0}^{2m_i-1}b_tx^t\mid b_t\in \{0,1\}, \ t=0,1,\ldots ,2m_i-1\}\). Hence C is of type \(4^02^{2m_i}\) and \(|C|=2^{2m_i}\).

Case 4.\(l=2\) and \(s=1\).

In this case, \(\tau (C)=\{0\}\) and \(\tau (C:2)={\overline{f}}_i(x)^1\overline{{\mathcal {K}}}_i={\overline{f}}_i(x)\overline{{\mathcal {K}}}_i\) by Eq. (6). Then by Lemma 4 and the definition of \(\tau \), we have that \(C=2{\overline{f}}_i(x)\overline{{\mathcal {K}}}_i=\langle 2{\overline{f}}_i(x)\rangle \) and \(C=\{2\sum _{t=0}^{m_i-1}b_tx^t{\overline{f}}_i(x)\mid b_t\in \{0,1\}, \ t=0,1,2,\ldots \), \(2m_i-1\}\). Hence C is of type \(4^02^{m_i}\) and \(|C|=2^{m_i}\).

Case 5.\(l=1\) and \(s=0\).

In this case, \(\tau (C)={\overline{f}}_i(x)^1\overline{{\mathcal {K}}}_i={\overline{f}}_i(x)\overline{{\mathcal {K}}_i}\) and \(\tau (C:2)=\overline{{\mathcal {K}}}_i\) by Eq. (6). The latter implies \(2\in C\) and the former implies \(f_i(x)+2v(x)\in C\) for some \(v(x)\in {\mathcal {K}}_i\). From this, we deduce that \(f_i(x)=(f_i(x)+2v(x))-2\cdot v(x)\in C\). Hence \(\langle f_i(x), 2\rangle \subseteq C\).

Conversely, let \(c(x)\in C\). By \({\overline{c}}(x)\in \tau (C)={\overline{f}}_i(x)\overline{{\mathcal {K}}_i}\), there exist a(x), b(x) \(\in {\mathcal {K}}_i\) such that \(c(x)=a(x)f_i(x)+2b(x)=a(x)\cdot f_i(x)+2\cdot b(x)\in \langle f_i(x), 2\rangle \). Therefore, we have \(C=\langle f_i(x), 2\rangle \), and \(|C|=2^{3m_i}\) by Eq. (7).

By Lemma 5, we have that \(f_i(x)^2=2{\overline{f}}_i(x)w_i(x)\equiv 0\) (mod C). From this and since \(C=\langle f_i(x), 2\rangle =f_i(x){\mathcal {K}}_i+2\overline{{\mathcal {K}}}_i\), we deduce that

$$\begin{aligned} C =\Bigg \{\sum _{j=0}^{m_i-1}a_jx^jf_i(x)+2\sum _{t=0}^{m_i-1}b_tx^t\mid a_j\in {\mathbb {Z}}_4, \ b_t\in \{0,1\}, \ j,t=0,1,\ldots , m_i-1 \Bigg \}. \end{aligned}$$

Hence C is of type \(4^{m_i}2^{m_i}\).

Case 6.\(l=s=1\).

In this case, \(|C|=2^{2m_i}\) by Eq. (7). Then by Eq. (6), we have \(\tau (C)={\overline{f}}_i(x)\overline{{\mathcal {K}}}_i\) and \(\tau (C:2)={\overline{f}}_i(x)\overline{{\mathcal {K}}}_i\). The latter implies \(2{\overline{f}}_i(x)\in C\) and the former implies \(f_i(x)+2v(x)\in C\) for some \(v(x)\in {\mathcal {K}}_i\). By Lemma 4, there is a unique pair (a(x), b(x)) of elements in \(\overline{{\mathcal {K}}}_i\) such that \(v(x)=a(x)+2b(x)\). From this, we deduce that \(f_i(x)+2v(x)=f_i(x)+2(a(x)+2b(x))=f_i(x)+2a(x)\). As \(a(x)\in \overline{{\mathcal {K}}}_i\), by Lemma 3 (ii) there is a unique pair (h(x), q(x)) of elements in \({\mathcal {T}}_i\) such that \(a(x)=h(x)+q(x){\overline{f}}_i(x)\). Therefore,

$$\begin{aligned} f_i(x)+2h(x)=\left( f_i(x)+2(h(x)+q(x){\overline{f}}_i(x))\right) -q(x)\cdot 2{\overline{f}}_i(x)\in C. \end{aligned}$$

This implies that \(\langle f_i(x)+2h(x)\rangle \subseteq C\).

Conversely, let \(c(x)\in C\). Since \({\overline{c}}(x)\in \tau (C)={\overline{f}}_i(x)\overline{{\mathcal {K}}}_i\), there exist a(x), \(b(x)\in {\mathcal {K}}_i\) such that \(c(x)=a(x)f_i(x)+2b(x)=a(x)\cdot (f_i(x)+2h(x))+2d(x)\), where \(d(x)=b(x)-a(x)h(x)\in {\mathcal {K}}_i\) satisfying

$$\begin{aligned} 2d(x)=c(x)-a(x)\cdot (f_i(x)+2h(x))\in C, \end{aligned}$$

i.e., \(d(x)\in (C:2)\). This implies that \({\overline{d}}(x)\in \tau (C:2)={\overline{f}}_i(x)\overline{{\mathcal {K}}}_i\). Hence there exist \(u(x),v(x)\in {\mathcal {K}}_i\) such that \(d(x)=u(x)f_i(x)+2v(x)\). Therefore, we have

$$\begin{aligned} c(x)= & {} a(x)\cdot (f_i(x)+2h(x))+2(u(x)f_i(x)+2v(x))\\= & {} a(x)\cdot (f_i(x)+2h(x))+2{\overline{u}}(x)\cdot {\overline{f}}_i(x)\\= & {} a(x)\cdot (f_i(x)+2h(x))+2{\overline{u}}(x)\cdot \overline{(f_i(x)+2h(x))}\\= & {} a(x)\cdot (f_i(x)+2h(x))+2{\overline{u}}(x)\cdot (f_i(x)+2h(x))\\= & {} (a(x)+2{\overline{u}}(x))\cdot (f_i(x)+2h(x))\in \langle f_i(x)+2h(x)\rangle . \end{aligned}$$

It follows that \(C=\langle f_i(x)+2h(x)\rangle \), where \(h(x)\in {\mathcal {T}}_i\).

By \(2{\overline{f}}_i(x)\in C\) and Lemma 5, we have that \(f_i(x)^2=2{\overline{f}}_i(x)w_i(x)\equiv 0 \pmod {C}.\) From this, we deduce that

$$\begin{aligned} C= & {} (f_i(x)+2h(x)){\mathcal {K}}_i\\= & {} \left\{ \sum _{j=0}^{m_i-1}a_jx^j(f_i(x)+2h(x))\mid a_j\in {\mathbb {Z}}_4, \ j=0,1,\ldots ,m_i-1 \right\} . \end{aligned}$$

Hence C is of type \(4^{m_i}2^0.\)

As stated above, we conclude that all distinct ideals of \({\mathcal {K}}_i\) are given by the table in Theorem 1.

Now, let \(\mathcal{M}_i\) be the set of all ideals in \(\mathcal{K}_i\) listed in the table of Theorem 1 and \(C_i\in \mathcal{M}_i\). It is clear that \(\mathrm{Ann}(C_i)=D_i\), where \(D_i \in \mathcal{M}_i\) satisfies the following conditions:

$$\begin{aligned} C_i\cdot D_i =\{0\} \ \mathrm{and} \ |D_i|=\mathrm{Max}\{|J|\mid C_i\cdot J=\{0\}, \ J\in \mathcal{M}_i\}. \end{aligned}$$

Then the conclusion for each \(\mathrm{Ann}(C_i)\) follows from Lemma 5 and a direct calculation.

Finally, by Lemma 1(iii) we see that \(\phi _i|_{C_i}\) is an isomorphism of abelian groups from the ideal \(C_i\) of \(\mathcal{K}_i\) onto the subcode code \({\mathcal {C}}_i\) of \({\mathcal {C}}\). Then the conclusion for the type and an encoder of \({\mathcal {C}}_i\) follows immediately from the fact that \({\mathcal {C}}_i=\theta _i(x)C_i\). This concludes the proof of Theorem 1. \(\square \)

4 Dual codes of cyclic codes over \({\mathbb {Z}}_4\) of length 2n

In this section, we determine the dual code of each cyclic code over \({\mathbb {Z}}_4\) of length 2n.

For any \(a=(a_0,a_1,\ldots ,a_{2n-1})\in {\mathbb {Z}}_4^{2n}\), we will identify a with \(a(x)=\sum _{j=0}^{2n-1}a_jx^j\in {\mathcal {A}}={\mathbb {Z}}_4[x]/\langle x^{2n}-1\rangle \). In the ring \({\mathcal {A}}\), we have that \(x^{2n}=1\), and hence \(x^{-1}=x^{2n-1}\). Moreover, we have \(x^{2n}\equiv 1 \pmod {f_i(x^2)}\) since \(f_i(x^2)\) is a divisor of \(x^{2n}-1\) in \({\mathbb {Z}}_4[x]\). This implies that \(x^{2n}=1\) and \(x^{-1}=x^{2n-1}\) in the ring \({\mathcal {K}}_i={\mathbb {Z}}_4[x]/\langle f_i(x^2)\rangle \) for all i. Define

$$\begin{aligned} \mu (a(x))=a(x^{-1})=a_0+\sum _{j=1}^{2n-1}a_jx^{2n-j}, \ \forall a(x)\in {\mathcal {A}}. \end{aligned}$$

It is clear that \(\mu \) is a ring automorphism of \({\mathcal {A}}\) satisfying \(\mu ^{-1}=\mu \). Now, by a direct calculation we get the following lemma.

Lemma 6

Let \(a,b\in {\mathbb {Z}}_4^{2n}\) where \(b=(b_0,b_1,\ldots ,b_{2n-1})\). Then \([a,b]=0\) if \(a(x)\mu (b(x))=0\) in the ring \({\mathcal {A}}\) where \(b(x)=\sum _{j=0}^{2n-1}b_jx^j\).

For any polynomial \(f(y)=\sum _{j=0}^dc_jy^j\in {\mathbb {Z}}_4[y]\) of degree \(d\ge 1\), recall that the reciprocal polynomial of f(y) is defined as \({\widetilde{f}}(y)=\widetilde{f(y)}=y^df(\frac{1}{y})=\sum _{j=0}^dc_jy^{d-j}\), and f(y) is said to be self-reciprocal if \({\widetilde{f}}(y)=\delta f(y)\) for some \(\delta \in {\mathbb {Z}}_4^{\times }=\{1,-1\}\). It is known that \(\widetilde{{\widetilde{f}}(y)}=f(y)\) if \(f(0)\ne 0\), and \(\widetilde{f(y)g(y)}={\widetilde{f}}(y){\widetilde{g}}(y)\) for any monic polynomials \(f(y), g(y)\in {\mathbb {Z}}_4[y]\) with positive degrees satisfying \(f(0),g(0)\in {\mathbb {Z}}_4^{\times }\). Then by Eq. (1) in Sect. 2, we have

$$\begin{aligned} y^n-1=-(1-y^n)=-\widetilde{(y^n-1)}=-{\widetilde{f}}_1(y){\widetilde{f}}_2(y)\ldots {\widetilde{f}}_r(y). \end{aligned}$$

Since \(f_1(y),f_2(y),\ldots ,f_r(y)\) are pairwise coprime monic basic irreducible polynomials in \({\mathbb {Z}}_4[y]\), \({\widetilde{f}}_1(y),{\widetilde{f}}_2(y),\ldots , {\widetilde{f}}_r(y)\) are pairwise coprime basic irreducible polynomials in \({\mathbb {Z}}_4[y]\) as well. Hence, for each integer i, \(1\le i\le r\), there is a unique integer \(i^{\prime }\), \(1\le i^{\prime }\le r\), such that \({\widetilde{f}}_i(y)=\delta _if_{i^{\prime }}(y)\) where \(\delta _i\in \{1,-1\}\).

Assume that \(f_i(y)=\sum _{j=0}^{m_i}c_jy^j\) where \(c_j\in {\mathbb {Z}}_4\). Then \(\mathrm{deg}(f_i(x^2))=2\mathrm{deg}(f_i(y))=2m_i\) and

$$\begin{aligned} x^{2m_i}f_i(x^{-2})=(x^{2})^{m_i}\sum _{j=0}^{m_i}c_j(x^{2})^{-j}=\sum _{j=0}^{m_i}c_j(x^{2})^{m_i-j}={\widetilde{f}}_i(x^{2}) =\delta _if_{i^{\prime }}(x^{2}). \end{aligned}$$

Then by Eq. (3) in Sect. 2 and \(x^{2n}=1\) in \(\mathcal{A}\), we obtain

$$\begin{aligned} \mu (\theta _i(x))= & {} 1-x^{2n-2(\mathrm{deg}(v_i(y))+m_i)}(x^{2\mathrm{deg}(v_i(y))}v_i(x^{-2}))(x^{2m_i}f_i(x^{-2}))\\= & {} 1-x^{2n-2(\mathrm{deg}(v_i(y))+m_i)}{\widetilde{v}}_i(x^{2}){\widetilde{f}}_i(x^{2})\\= & {} 1-h_i(x)f_{i^{\prime }}(x^{2}), \end{aligned}$$

where \(h_i(x)=\delta _ix^{2n-2(\mathrm{deg}(v_i(y))+m_i)}{\widetilde{v}}_i(x^{2})\in \mathcal{A}\). Similarly, by Eq. (3), it follows that \(\mu (\theta _i(x))=g_i(x)F_{i^{\prime }}(x^{2})\) for some \(g_i(x)\in \mathcal{A}\). Then from these and Eq. (3), we deduce that \(\mu (\theta _i(x))=\theta _{i^{\prime }}(x)\).

As stated above, we see that, for each \(1\le i\le r\), there is a unique integer \(i^{\prime }\), \(1\le i^{\prime }\le r\), such that \(\mu (\theta _i(x))= \theta _{i^{\prime }}(x)\). We continue the use of \(\mu \) to denote this map \(i\mapsto i^{\prime }\); i.e., \(\mu (\theta _i(x))=\theta _{\mu (i)}(x)\).

Whether \(\mu \) denotes the automorphism of \(\mathcal{A}\) or this map on the set \(\{1,\ldots ,r\}\) is determined by the context.

Lemma 7

Using the notation above, we have the following conclusions.

  1. (i)

    The map \(\mu \) is a permutation on \(\{1,\ldots ,r\}\) satisfying \(\mu ^{-1}=\mu \).

  2. (ii)

    After a rearrangement of \(\theta _1(x),\ldots ,\theta _r(x)\), there are integers \(\lambda ,\epsilon \) such that \(\mu (i)=i\) for all \(i=1,\ldots ,\lambda \) and \(\mu (\lambda +j)=\lambda +\epsilon +j\) for all \(j=1,\ldots ,\epsilon \), where \(\lambda \ge 1, \epsilon \ge 0\) and \(\lambda +2\epsilon =r\).

  3. (iii)

    For each integer i, \(1\le i\le r\), there is a unique element \(\delta _i\in \{1,-1\}\) such that \({\widetilde{f}}_i(x)=\delta _i f_{\mu (i)}(x)\).

  4. (iv)

    For any integer i, \(1\le i\le r\), \(\mu (\theta _i(x))=\theta _{\mu (i)}(x)\) in the ring \(\mathcal{A}\), and \(\mu (\mathcal{A}_{i})=\mathcal{A}_{\mu (i)}\).

  5. (v)

    Let \(\mu |_{\mathcal{A}_{i}}: \mathcal{A}_{i}\rightarrow \mathcal{A}_{\mu (i)}\) be the restriction of \(\mu \) on \(\mathcal{A}_{i}\), and define

    $$\begin{aligned} \mu _i(c(x))=c(x^{-1})=c(x^{2n-1})\ \left( \mathrm{mod} \ f_{\mu (i)}(x^2)\right) , \ \forall c(x)\in \mathcal{K}_i. \end{aligned}$$

    Then \(\mu _i=\phi _{\mu (i)}^{-1}\mu |_{\mathcal{A}_i}\phi _i\), which is a ring isomorphism from \(\mathcal{K}_i\) onto \(\mathcal{K}_{\mu (i)}\). Moreover, we have \(\mu _i^{-1}=\mu _{\mu (i)}\) where \(\mu _{\mu (i)}: \mathcal{K}_{\mu (i)}\rightarrow \mathcal{K}_i\) is defined by \(\mu _{\mu (i)}(a(x))=a(x^{-1})=a(x^{2n-1}) \pmod { f_i(x^2)} \) for all \(a(x)\in \mathcal{K}_{\mu (i)}\).

Proof

Statements (i)–(iii) follow from the definition of the map \(\mu \).

(iv) Since \(\mu (\theta _i(x))=\theta _{\mu (i)}(x)\) and \(\mathcal{A}_i=\theta _i(x)\mathcal{A}\), it follows that \(\mu (\mathcal{A}_i)=\mu (\theta _i(x))\mu (\mathcal{A})=\theta _{\mu (i)}(x)\mathcal{A}=\mathcal{A}_{\mu (i)}\).

(v) Let \(c(x)\in \mathcal{K}_i\). By Lemma 1(iii) and \(\theta _{\mu (i)}(x)=\mu (\theta _i(x))=1-h_i(x)f_{i^{\prime }}(x^2) =1-h_i(x)f_{\mu (i)}(x^2)\), we have

$$\begin{aligned} \left( \phi _{\mu (i)}^{-1}\mu |_{\mathcal{A}_i}\phi _i\right) (c(x))= & {} (\phi _{\mu (i)}^{-1}\mu |_{\mathcal{A}_i}) \left( \theta _i(x)c(x)\right) =\phi _{\mu (i)}^{-1}\left( \mu (\theta _i(x))c(x^{-1})\right) \\= & {} \left( 1-h_i(x)f_{\mu (i)}(x^2)\right) c(x^{-1}) \ (\mathrm{mod} \ f_{\mu (i)}(x^2)) \\\equiv & {} c(x^{-1}) \ (\mathrm{mod} \ f_{\mu (i)}(x^2)). \end{aligned}$$

This implies \(\mu _i(c(x))=\left( \phi _{\mu (i)}^{-1}\mu |_{\mathcal{A}_i}\phi _i\right) (c(x))\) for all \(c(x)\in \mathcal{K}_i\). Hence \(\mu _i=\phi _{\mu (i)}^{-1}\mu |_{\mathcal{A}_i}\phi _i\), which is a ring isomorphism from \(\mathcal{K}_i\) onto \(\mathcal{K}_{\mu (i)}\) by (iv) and Lemma 1(iii).

Finally, \(\mu _i^{-1}=\mu _{\mu (i)}\) follows from the definition of \(\mu _i\) for any i. \(\square \)

Lemma 8

Let \(a(x)=\sum _{i=1}^r\theta _i(x)\xi _i, b(x)=\sum _{i=1}^r\theta _i(x)\eta _i\in \mathcal{A}\), where \(\xi _i, \eta _i\in \mathcal{K}_i\). Then \(a(x)\mu (b(x))=\sum _{i=1}^r\theta _i(x)(\xi _i\cdot \mu _i^{-1}(\eta _{\mu (i)}))\).

Proof

As \(\mu _i^{-1}(\eta _{\mu (i)})\in \mu _i^{-1}(\mathcal{K}_{\mu (i)})=\mathcal{K}_i\) by Lemma 7(v), it follows that \(\xi _i\cdot \mu _i^{-1}(\eta _{\mu (i)})\in \mathcal{K}_i\) for all i. If \(j\ne \mu (i)\), then \(i\ne \mu (j)\) by Lemma 7(i). This implies \(\theta _i(x)\theta _{\mu (j)}(x)=0\) in the ring \(\mathcal{A}\) by Lemma 1(i). Therefore,

$$\begin{aligned} a(x)\mu (b(x))= & {} \sum _{i,j=1}^r\theta _i(x)\xi _i\cdot \mu (\theta _j(x)\eta _j) =\sum _{i,j=1}^r\theta _i(x)\xi _i\cdot \mu (\theta _j(x))\mu _j(\eta _j)\\= & {} \sum _{i,j=1}^r\theta _i(x)\xi _i\cdot \theta _{\mu (j)}(x)\mu _j(\eta _j) =\sum _{i=1}^r\theta _i(x)\xi _i\cdot \theta _{i}(x)\mu _{\mu (i)}(\eta _{\mu (i)}). \end{aligned}$$

Hence \(a(x)\mu (b(x))=\sum _{i=1}^r\theta _i(x)(\xi _i\cdot \mu _i^{-1}(\eta _{\mu (i)}))\) by Lemma 1(i). \(\square \)

Now, we give the dual code of each cyclic code over \({\mathbb {Z}}_4\) of length 2n.

Theorem 2

Let \(\mathcal{C}\) be a cyclic code over \({\mathbb {Z}}_4\) of length 2n with canonical form decomposition \(\mathcal{C}=\bigoplus _{i=1}^r\theta _i(x)C_i\), where \(C_i\) is an ideal of \(\mathcal{K}_i\). Then the dual code of \(\mathcal{C}\) is given by \(\mathcal{C}^{\bot }=\bigoplus _{j=1}^r\theta _j(x)D_j,\) where, for \(j=\mu (i)\), \(D_j\) is an ideal of \(\mathcal{K}_j\) given by the following table.

Case

\(C_i\) (mod \(f_i(x^2)\))

\(D_{\mu (i)}\) (mod \(f_{\mu (i)}(x^2)\))

1.

\(\langle 0\rangle \)

\(\langle 1\rangle \)

2.

\(\langle 1\rangle \)

\(\langle 0\rangle \)

3.

\(\langle 2\rangle \)

\(\langle 2\rangle \)

4.

\(\langle 2{\overline{f}}_i(x)\rangle \)

\(\langle f_{\mu (i)}(x),2\rangle \)

5.

\(\langle f_i(x), 2\rangle \)

\(\langle 2{\overline{f}}_{\mu (i)}(x)\rangle \)

6.

\(\langle f_i(x)+2h(x)\rangle \)

\(\langle f_{\mu (i)}(x)+2x^{m_i}\left( w_i(x^{-1})+h(x^{-1})\right) \rangle \)

where\(h(x)\in {\mathcal {T}}_{i}\).

Proof

Let \(\mathcal{D}=\bigoplus _{i=1}^r\theta _{\mu (i)}(x)D_{\mu (i)}=\sum _{j=1}^r\theta _j(x)D_j\) (mod \(x^{2n}-1\)), where \(D_{\mu (i)}=\mu _i(\mathrm{Ann}(C_i))\) and \(\mathrm{Ann}(C_i)\) is given by Theorem 1 for all \(i=1,\ldots ,r\). Then \(\mathcal{D}\) is a cyclic code over \({\mathbb {Z}}_4\) of length 2n by Theorem 1, and satisfies

$$\begin{aligned} \mathcal{C}\cdot \mu (\mathcal{D})=\sum _{i=1}^r\theta _i(x)\left( C_i\cdot \mu _i^{-1}(D_{\mu (i)})\right) =\sum _{i=1}^r\theta _i(x)\left( C_i\cdot \mathrm{Ann}(C_i)\right) =\{0\} \end{aligned}$$

by Lemma 8. From this and by Lemma 6, we deduce that \(\mathcal{D}\subseteq \mathcal{C}^{\bot }\). On the other hand, by Theorem 1 we have \(|C_i||\mathrm{Ann}(C_i)|=2^{4m_i}\) for all \(i=1,\ldots ,r\). This implies

$$\begin{aligned} |\mathcal{C}||\mathcal{D}|=\left( \prod _{i=1}^r|C_i|\right) \left( \prod _{i=1}^r|D_{\mu (i)}|\right) =\prod _{i=1}^r\left( |C_i||\mathrm{Ann}(C_i)|\right) =2^{4\sum _{i=1}^rm_i}=|{\mathbb {Z}}_4|^{2n} \end{aligned}$$

by Theorem 1 and \(\sum _{i=1}^rm_i=n\). Then, from the theory of linear codes over \({\mathbb {Z}}_4\), we deduce that \(\mathcal{C}^{\bot }=\mathcal{D}\).

Finally, we give the precise expression of \(D_{\mu (i)}=\mu _i(\mathrm{Ann}(C_i))\), \(1\le i\le r\). Obviously, we only need to consider Cases 4–6 in the table of Theorem 1.

By \(x^{2n}=1\) in \(\mathcal{K}_i\), we see that \(x\in \mathcal{K}_i^{\times }\), for all \(i=1,2,...,r\). By Lemma 7(iii), we have \({\widetilde{f}}_i(x)=\delta _if_{\mu (i)}(x)\) where \(\delta _i\in \{1,-1\}\). Then, by the definition of \(\mu _i\), we have

$$\begin{aligned} \mu _i(f_i(x))=f_i(x^{-1}) =x^{-m_i}(x^{m_i}f_i(x^{-1}))=x^{-m_i}({\widetilde{f}}_i(x))=\delta _ix^{-m_i}f_{\mu (i)}(x). \end{aligned}$$

Case 4: As x is an invertible element of \(\mathcal{K}_{\mu (i)}\), we have

$$\begin{aligned} D_{\mu (i)}=\mu _i(\langle f_i(x), 2\rangle )=\langle \mu _i(f_i(x), \mu _i(2)\rangle =\langle \delta _{i}x^{-m_i}f_{\mu (i)}(x),2\rangle =\langle f_{\mu (i)}(x),2\rangle . \end{aligned}$$

Case 5: By \(2{\overline{f}}_i(x)=2f_i(x)\) in \({\mathcal {K}}_i\), we have

$$\begin{aligned} D_{\mu (i)}=\mu _i(\langle 2{\overline{f}}_i(x)\rangle )=\langle 2\mu _i(f_i(x))\rangle =\langle 2\delta _ix^{-m_i}f_{\mu (i)}(x)\rangle =\langle 2{\overline{f}}_{\mu (i)}(x)\rangle . \end{aligned}$$

Case 6: By \(2\delta _i^{-1}=2\), we have that

$$\begin{aligned} D_{\mu (i)}= & {} \mu _i(\langle f_i(x)+2(w_i(x)+h(x))\rangle )=\langle \mu _i(f_i(x)+2(w_i(x)+h(x)))\rangle \\= & {} \langle \delta _ix^{-m_i}f_{\mu (i)}(x)+2(w_i(x^{-1})+h(x^{-1}))\rangle \\= & {} \langle f_{\mu (i)}(x)+2x^{m_i}(w_i(x^{-1})+h(x^{-1}))\rangle \ (\mathrm{mod} \ f_{\mu (i)}(x^2)) \end{aligned}$$

in the ring \({\mathcal {K}}_{\mu (i)}\). \(\square \)

5 Self-dual cyclic codes over \({\mathbb {Z}}_4\) of length 2n

In this section, we list all distinct self-dual cyclic codes over \({\mathbb {Z}}_4\) of length 2n explicitly.

We assume \(f_1(x)=x-1\). Let i be a positive integer with \(2\le i\le \lambda \). Since n is odd, by Lemma 7(ii) and (iii) we know that \({\overline{f}}_i(x)\) is a self-reciprocal and irreducible polynomial in \({\mathbb {F}}_2[x]\). It is well known that the degree of \(m_i\) must be even and \(x^{-1}\equiv x^{2^{\frac{m_i}{2}}} \pmod {{\overline{f}}_i(x)}\). This implies that \(x^{2^{\frac{m_i}{2}}+1}\equiv 1 \pmod {{\overline{f}}_i(x)}\).

Lemma 9

Let \(2\le i\le \lambda \) and write \(m_i=2d_i\) where \(d_i\) is a positive integer. Let \({\overline{\varGamma }}_i={\mathbb {F}}_2[x]/\langle {\overline{f}}_i(x)\rangle \) as in Sect. 3 and set

$$\begin{aligned} {\mathcal {F}}_i=\{\xi \in {\overline{\varGamma }}_i \mid \xi ^{2^{d_i}}=\xi \}. \end{aligned}$$

Then we have the following conclusions.

  1. (i)

    We have that \({\overline{\varGamma }}_i\) is a finite field of cardinality \(2^{m_i}=(2^{d_i})^2\) and \(x^{-1}=x^{2^{\frac{m_i}{2}}}\) in \({\overline{\varGamma }}_i\).

  2. (ii)

    The field \({\mathcal {F}}_i\) is a subfield of \({\overline{\varGamma }}_i\) of cardinality \(2^{d_i}=2^{\frac{m_i}{2}}\).

  3. (iii)

    (cf. [26, Corollary 7.17]) Let \(\mathrm{Tr}_{{\overline{\varGamma }}_i/{\mathcal {F}}_i}\) be the trace function from \({\overline{\varGamma }}_i\) onto \({\mathcal {F}}_i\) defined by

    $$\begin{aligned} \mathrm{Tr}_{{\overline{\varGamma }}_i/{\mathcal {F}}_i}(\xi )=\xi +\xi ^{2^{d_i}}, \ \xi \in {\overline{\varGamma }}_i. \end{aligned}$$

    Then, for any \(\alpha \in {\mathcal {F}}_i\), the number of elements \(\xi \in {\overline{\varGamma }}_i\) such that \(\mathrm{Tr}_{{\overline{\varGamma }}_i/{\mathcal {F}}_i}(\xi )=\alpha \) is \(2^{\frac{m_i}{2}}\), i.e., \(|\mathrm{Tr}_{{\overline{\varGamma }}_i/{\mathcal {F}}_i}^{-1}(\alpha )|=2^{\frac{m_i}{2}}\).

  4. (iv)

    Let \(w_i(x)\) be given by Lemma 5. Then \(x^{m_i}w_i(x^{-1})=w_i(x)\) in \({\mathbb {F}}_2[x]\), and hence \(x^{\frac{m_i}{2}}w_i(x^{-1})\in {\mathcal {F}}_i\).

  5. (v)

    The set of solutions in \(\mathcal{T}_i =\{\sum _{j=0}^{m_i-1}a_jx^j\mid a_{j}\in \{0,1\}, j=0,1,2,\ldots \), \(m_i-1\}\) for the following congruence:

    $$\begin{aligned} h(x)\equiv x^{m_i}\left( w_{i}(x^{-1})+h(x^{-1})\right) \pmod { \langle {\overline{f}}_i(x),2\rangle } \end{aligned}$$
    (8)

    is given by

    $$\begin{aligned} {\mathcal {W}}_i=\left\{ x^{\frac{m_i}{2}}\xi (x) \ (\mathrm{mod} \ {\overline{f}}_i(x)) \mid \mathrm{Tr}_{{\overline{\varGamma }}_i/{\mathcal {F}}_i}(\xi (x))=x^{\frac{m_i}{2}}w_i(x^{-1}), \ \xi (x)\in {\overline{\varGamma }}_i\right\} , \end{aligned}$$

    i.e., \({\mathcal {W}}_i=x^{\frac{m_i}{2}}\mathrm{Tr}_{{\overline{\varGamma }}_i/{\mathcal {F}}_i}^{-1}(x^{\frac{m_i}{2}}w_i(x^{-1}))\), and hence \(|{\mathcal {W}}_i|=2^{\frac{m_i}{2}}\).

Proof

Statements (i) and (ii) follow from the classical theory of finite fields (cf. [26, Chap. 6]).

(iv) Using the notation in Sects. 2 and 3, we view \({\mathcal {T}}_i\) as the same as \({\overline{\varGamma }}_i\). As \(f_i(x)\) is self-reciprocal and \(w_i(x)\equiv \frac{f_i(x)^2-f_i(x^2)}{2f_i(x)} \mod \langle {\overline{f}}_i(x),2\rangle \), since \(f_i(x^{-1})=\delta _ix^{-m_i}f_i(x)\) and \(\delta _i\equiv 1\) (mod 2) we have that \(w_i(x^{-1})=x^{-m_i}w_i(x)\). This implies that

$$\begin{aligned} x^{m_i}w_i(x^{-1})=w_i(x) \ \mathrm{in} \ {\mathbb {F}}_2[x]. \end{aligned}$$

From this and by (i), we deduce that

$$\begin{aligned} (x^{\frac{m_i}{2}}w_i(x^{-1}))^{2^{d_i}}=x^{-\frac{m_i}{2}}w_i(x)=x^{\frac{m_i}{2}}w_i(x^{-1}) \ \mathrm{in} \ {\overline{\varGamma }}_i. \end{aligned}$$

We conclude that \(x^{\frac{m_i}{2}}w_i(x^{-1})\in {\mathcal {F}}_i\).

(v) As \(x\in {\overline{\varGamma }}_i^\times \), we can multiply both sides of Eq. (8) by \(x^{-\frac{m_i}{2}}\). Then Eq. (8) is equivalent to

$$\begin{aligned} x^{-\frac{m_i}{2}}h(x)+x^{\frac{m_i}{2}}h(x^{-1})=x^{\frac{m_i}{2}}w_i(x^{-1}) \ \mathrm{in} \ {\overline{\varGamma }}_i. \end{aligned}$$

Set \(\xi (x)=x^{-\frac{m_i}{2}}h(x)\in {\overline{\varGamma }}_i\). Then by (i) we have \(\xi (x)^{2^{d_i}}=(x^{-\frac{m_i}{2}}h(x))^{2^{d_i}} =x^{\frac{m_i}{2}}h(x^{-1})\). Hence Eq. (8) is equivalent to

$$\begin{aligned} \xi (x)+\xi (x)^{2^{d_i}}=x^{\frac{m_i}{2}}w_i(x^{-1}), \ \mathrm{i.e.,} \mathrm{Tr}_{{\overline{\varGamma }}_i/{\mathcal {F}}_i}(\xi (x))=x^{\frac{m_i}{2}}w_i(x^{-1})\in {\mathcal {F}}_i, \end{aligned}$$
(9)

and \(h(x)=x^{\frac{m_i}{2}}\xi (x) \pmod {{\overline{f}}_i(x)}\). Therefore, \({\mathcal {W}}_i\) is the set of all solutions in \({\mathcal {T}}_i\) for Eq. (8), and \(|{\mathcal {W}}_i|=|\mathrm{Tr}_{{\overline{\varGamma }}_i/{\mathcal {F}}_i}^{-1}(x^{\frac{m_i}{2}}w_i(x^{-1}))|=2^{\frac{m_i}{2}}\) by (iii). \(\square \)

Finally, by Proposition 2, Lemma 9, and Theorems 2 and 1 , we can list all distinct self-dual cyclic codes over \({\mathbb {Z}}_4\) of length 2n.

Theorem 3

Using the notation in Theorem 2, Lemma 7 (ii) and Lemma 9, let \(\mathcal{C}\) be a cyclic code over \({\mathbb {Z}}_4\) of length 2n with canonical form decomposition \(\mathcal{C}=\bigoplus _{i=1}^r\theta _i(x)C_i\), where \(C_i\) is an ideal of \(\mathcal{K}_i\). Then \(\mathcal{C}\) is self-dual if and only if, for each integer i, \(1\le i\le r\), \(C_i\) satisfies one of the following conditions:

  1. (i)

    \(C_1=\langle 2\rangle \).

  2. (ii)

    If \(2\le i\le \lambda \), \(C_i\) is given by one of the following \(1+2^{\frac{m_i}{2}}\) cases: \(C_i=\langle 2\rangle \), and \(C_i=\langle f_i(x)+2h(x)\rangle \) where \(h(x)\in \mathcal{W}_i\) arbitrary.

  3. (iii)

    If \(i=\lambda +j\) where \(1\le j\le \epsilon \), \((C_i,C_{i+\epsilon })\) is given by the following table.

\(C_i\) (mod \(f_i(x^2)\))

\(C_{i+\epsilon }\) (mod \(f_{i+\epsilon }(x^2)\))

\(\langle 0\rangle \)

\(\langle 1\rangle \)

\(\langle 1\rangle \)

\(\langle 0\rangle \)

\(\langle 2\rangle \)

\(\langle 2\rangle \)

\(\langle 2{\overline{f}}_i(x)\rangle \)

\(\langle f_{i+\epsilon }(x),2\rangle \)

\(\langle f_i(x), 2\rangle \)

\(\langle 2{\overline{f}}_{i+\epsilon }(x)\rangle \)

\(\langle f_i(x)+2h(x)\rangle \) \((h(x)\in \mathcal{T}_i)\)

\(\langle f_{i+\epsilon }(x)+2x^{m_i}(w_i(x^{-1})+h(x^{-1}))\rangle \)

Therefore, the number of self-dual cyclic codes over \({\mathbb {Z}}_4\) of length 2n is

$$\begin{aligned} \prod _{2\le i\le \lambda }(1+2^{\frac{m_i}{2}})\cdot \prod _{j=1}^\epsilon (5+2^{m_{\lambda +j}}). \end{aligned}$$

Proof

By Theorems 2 and 1, we see that \({\mathcal {C}}\) is self-dual if and only if the ideal \(C_i\) of \({\mathcal {K}}_i\) satisfies \(C_i=D_{i}\) for all \(i=1,\ldots ,r\), where \(D_i\) is listed in the table of Theorem 2. The latter is equivalent to the statement that \(C_i\) satisfies one of the following conditions for all \(i=1,\ldots ,r\).

  1. (i)

    Let \(i=1\). Then \(\mu (1)=1\), \(f_1(x)=x-1\) and \(m_i=1\). By Lemma 5, we have \(w_1(x)=1\), since \(w_1(x)\equiv \frac{f_1(x)^2-f_1(x^2)}{2f_1(x)}\equiv \frac{(x-1)^2-(x^2-1)}{2(x-1)}\equiv 1\) (mod \(\langle {\overline{f}}_1(x),2\rangle \)). Then from \({\mathcal {T}}_1=\{0,1\}\) and \(x\equiv 1 \pmod {{\overline{f}}_1(x)}\), we deduce that \(C_1=\langle 2\rangle \) is the only ideal of \({\mathcal {K}}_1\) that satisfies \(C_1=D_{1}=D_{\mu (1)}\).

  2. (ii)

    Let \(2\le i\le \lambda \). Then \(\mu (i)=i\). In this case, by Theorem 2, we see that \(C_i=D_i=D_{\mu (i)}\) if and only if \(C_i\) is given by one of the following two subcases: \(C_i=\langle 2\rangle \); \(C_i=\langle f_i(x)+2h(x)\rangle \), where \(h(x)\in {\mathcal {T}}_i\) satisfies Eq. (8), i.e., \(h(x)\in {\mathcal {W}}_i\) by Lemma 9(v).

  3. (iii)

    Let \(i=\lambda +j\) where \(1\le j\le \epsilon \). Then \(\mu (i)=i+\epsilon \) and \(\mu (i+\epsilon )=i\). Hence \(C_{i}=D_{i}\) if and only if \(C_{i+\epsilon }=C_{\mu (i)}=D_{\mu (i)}\), where \(D_{\mu (i)}\) is given by the table in Theorem 2.

By Lemma 9(v) and Theorem 1, we see that the number of self-dual cyclic codes over \({\mathbb {Z}}_4\) of length 2n is \(\prod _{2\le i\le \lambda }(1+2^{\frac{m_i}{2}})\cdot \prod _{j=1}^\epsilon (5+2^{m_{\lambda +j}}).\)\(\square \)

Finally, we consider how to calculate the number of self-dual cyclic codes over \({\mathbb {Z}}_4\) of length 2n from the odd positive integer n directly. Let \(J_1,J_2,\ldots ,J_r\) be all the distinct 2-cyclotomic cosets modulo n corresponding to the factorization \(x^n-1={\overline{f}}_1(x){\overline{f}}_2(x) \ldots {\overline{f}}_r(x)\). Then we have \(r=\lambda +2\epsilon \) and

  • \(J_1=\{0\}\), the set \(J_i\) satisfies \(J_i=-J_i \pmod {n}\) and \(|J_i|=m_i\) for all \(i=2,\ldots ,\lambda \);

  • \(J_{\lambda +j+\epsilon }=-J_{\lambda +j} \pmod {n}\) and \(|J_{\lambda +j}|=|J_{\lambda +j+\epsilon }|=m_{\lambda +j}\), for all \(j=1,\ldots ,\epsilon \).

Therefore, the number of self-dual cyclic codes over \({\mathbb {Z}}_4\) of length 2n can be calculated by the formula in Theorem 3 and the 2-cyclotomic cosets modulo n directly. As an example, we list the number \({\mathcal {N}}\) of self-dual cyclic codes over \({\mathbb {Z}}_4\) of length 2n, where n is odd and \(6 \le 2n \le 98\), in the following table.

2n

\({\mathcal {N}}\)

2n

\({\mathcal {N}}\)

6

\(3=1+2\)

54

\(13851=(1+2)(1+2^3)(1+2^9)\)

10

\(5=1+2^2\)

58

\(16385=1+2^{14}\)

14

\(13=5+2^3\)

62

\(50653=(5+2^5)^3\)

18

\(27=(1+2)(1+2^3)\)

66

\(107811=(1+2)(1+2^5)^3\)

22

\(33=1+2^5\)

70

\(266565=(1+2^2)(5+2^3)(5+2^{12})\)

26

\(65=1+2^6\)

74

\(262145=1+2^{18}\)

30

\(315=(1+2)(1+2^2)(5+2^4)\)

78

\(799695=(1+2)(1+2^6)(5+2^{12})\)

34

\(289=(1+2^4)^2\)

82

\(1050625=(1+2^{10})^2\)

38

\(513=1+2^9\)

86

\(2146689=(1+2^7)^3\)

42

\(2691=(1+2)(5+2^3)(5+2^6)\)

90

11626335

46

\(2053=5+2^{11}\)

94

\(8388613=5+2^{23}\)

50

\(5125=(1+2^2)(1+2^{10})\)

98

\(27263041=(5+2^3)(5+2^{21})\)

where \(11626335=(1+2)(1+2^2)(1+2^3)(5+2^4)(5+2^{12})\).

Let \(\mathcal{C}\) be a self-dual \({\mathbb {Z}}_4\)-code. The Gray image \(\psi (\mathcal{C})\) may or may not be self-dual, and the binary code \(\psi (\mathcal{C})\) is called formally self-dual (see p. 43 in Wan [25]). See [11] for a classification of those which are self-dual, for small lengths. Recall that a code is formally self-dual if the code and its dual code have the same weight enumerator.

Proposition 3

Let \(\mathcal{C}\) be a cyclic self-dual code over \({\mathbb {Z}}_4\). If \(\psi (\mathcal{C})\) is linear, then \(\psi (\mathcal{C})\) is a formally self-dual quasicyclic code of index 2.

Proof

It is proven in [11] that the image is formally-self dual when the preimage is linear and the fact that it is quasicyclic follows from Proposition 1. \(\square \)

It is possible for a quaternary cyclic self-dual code to produce a binary self-dual quasicyclic code, for example the code generated by \(2I_{2n}\) generates such a code.

6 Self-dual cyclic codes over \({\mathbb {Z}}_4\) of length 30, 6 and 10

In this section, we consider cyclic codes over \({\mathbb {Z}}_{4}\) of length 30, 6 and 10, respectively.

$$\begin{aligned} n=15 \end{aligned}$$

We have that \(y^{15}-1=f_1(y)f_2(y)f_3(y)f_4(y)f_5(y)\), where

$$\begin{aligned} \begin{array}{l} f_1(y)=y-1, \ f_2(y)=y^2+y+1, \ f_3(y)=y^4+y^3+y^2+y+1, \\ f_4(y)=y^4+2y^2+3y+1 \ { \text{ and } } \ f_5(y)=y^4+3y^3+2y^2+1={\widetilde{f}}_4(y). \end{array} \end{aligned}$$

Using the notation of Lemma 7 and Sect. 2, we have \(r=5\), \(\lambda =3\), \(\epsilon =1\), \(\delta _4=1\), \(m_1=1\), \(m_2=2\) and \(m_3=m_4=m_5=4\). Hence, there are \(\prod _{i=1}^5(5+2^{m_i})=(5+2)\cdot (5+2^2)\cdot (5+2^4)^3=583443\) distinct cyclic codes over \({\mathbb {Z}}_{4}\) of length 30 (cf. [3, Corollary 1] or [13, Theorem 2.6]).

For each \(i=1,2,3,4,5\), let \(F_i(y)=\frac{x^{15}-1}{f_i(y)}\) and find polynomials \(u_i(y),v_i(y)\)\(\in {\mathbb {Z}}_{4}[y]\) satisfying \(u_i(y)F_i(y)+v_i(y)f_i(y)=1\). Then set \(\varepsilon _i(y)=u_i(y)F_i(y)\) (mod \(y^{15}-1\)) and \(\theta _i(x)=\varepsilon _i(x^2)\in {\mathbb {Z}}_4[x]/\langle x^{30}-1\rangle \). Precisely, we have

$$\begin{aligned} \begin{array}{ll} \theta _1(x)= &{} 3\,{x}^{28}+3\,{x}^{26}+3\,{x}^{24}+3\,{x}^{22}+3\,{x}^{20}+3\,{x}^{18} +3\,{x}^{16}+3\,{x}^{14}+3\,{x}^{12} \\ &{} +\,3\,{x}^{10}+3\,{x}^{8}+3\,{x}^{6}+3\, {x}^{4}+3\,x^{2}+3, \\ \theta _2(x)= &{} {x}^{28}+{x}^{26}+2\,{x}^{24}+{x}^{22}+{x}^{20}+2\,{x}^{18}+{x}^{16}+{x} ^{14}+2\,{x}^{12}+{x}^{10}+{x}^{8} \\ &{} +\,2\,{x}^{6}+{x}^{4}+x^{2}+2, \\ \theta _3(x)= &{} {x}^{28}+{x}^{26}+{x}^{24}+{x}^{22}+{x}^{18}+{x}^{16}+{x}^{14}+{x}^{12}+{x }^{8}+{x}^{6}+{x}^{4}+x^{2}, \\ \theta _4(x)= &{} {x}^{24}+2\,{x}^{20}+{x}^{18}+3\,{x}^{16}+{x}^{12}+2\,{x}^{10}+3\,{x}^{8}+ {x}^{6}+3\,{x}^{4}+3\,x^{2}, \\ \theta _5(x)= &{} 3\,{x}^{28}+3\,{x}^{26}+{x}^{24}+3\,{x}^{22}+2\,{x}^{20}+{x}^{18}+3\,{x }^{14}+{x}^{12}+2\,{x}^{10}+{x}^{6}. \end{array} \end{aligned}$$

Using the notation in Sect. 2, we have

$$\begin{aligned} {\mathcal {K}}_1= & {} \frac{{\mathbb {Z}}_{4}[x]}{\langle f_1(x^2)\rangle }=\frac{{\mathbb {Z}}_{4}[x]}{\langle x^2-1\rangle }, {\mathcal {T}}_1=\{0,1\};\\ {\mathcal {K}}_2= & {} \frac{{\mathbb {Z}}_{4}[x]}{\langle f_2(x^2)\rangle } \text { and } {\mathcal {T}}_2=\{t_0+t_1x\mid t_0,t_1\in \{0,1\}\};\\ {\mathcal {K}}_i= & {} \frac{{\mathbb {Z}}_{4}[x]}{\langle f_i(x^2)\rangle } \text { and } {\mathcal {T}}_i=\{t_0+t_1x+t_2x^2+t_3x^3\mid t_0,t_1,t_2,t_3\in \{0,1\}\}, \text { for }i=3,4,5. \end{aligned}$$

By Lemma 5, we have

  • \(w_2(x)=x\), since

    $$\begin{aligned} w_2(x)\equiv & {} \frac{f_2(x)^2-f_2(x^2)}{2f_2(x)}\equiv \frac{(x^2+x+1)^2-(x^4+x^2+1)}{2(x^2+x+1)}\\\equiv & {} x \pmod {\langle {\overline{f}}_2(x),2\rangle }. \end{aligned}$$

    Using the notation in Lemma 9(v), we have \(x^{\frac{m_2}{2}}w_2(x^{-1})=1\), \({\overline{\varGamma }}_2={\mathbb {F}}_2[x]/\langle {\overline{f}}_2(x)\rangle =\{0,1,x,1+x\}\), \({\mathcal {F}}_2={\mathbb {F}}_2\) and \(\mathrm{Tr}_{{\overline{\varGamma }}_2/{\mathbb {F}}_2}^{-1}(1)=\{x,1+x\}\). Hence,

    $$\begin{aligned} {\mathcal {W}}_2=x^{\frac{m_2}{2}}\mathrm{Tr}_{{\overline{\varGamma }}_2/{\mathbb {F}}_2}^{-1}(x^{\frac{m_2}{2}}w_2(x^{-1})) =x\cdot \{x,1+x\}=\{1, 1+x\}. \end{aligned}$$
  • \(w_3(x)=x+x^3\), since

    $$\begin{aligned} w_3(x)\equiv & {} \frac{f_3(x)^2-f_3(x^2)}{2f_3(x)}\\\equiv & {} \frac{(x^4+x^3+x^2+x+1)^2-(x^8+x^6+x^4+x^2+1)}{2(x^4+x^3+x^2+x+1)}\\\equiv & {} x+x^3 \ (\mathrm{mod} \ \langle {\overline{f}}_3(x),2\rangle ). \end{aligned}$$

    Using the notation in Lemma 9(v), we have that \(x^{\frac{m_3}{2}}w_3(x^{-1})=x^2\cdot (x^{-1}+x^{-3})=x+x^{-1}=x+x^4\), \({\overline{\varGamma }}_3={\mathbb {F}}_2[x]/\langle {\overline{f}}_3(x)\rangle =\{a_0+a_1x+a_2x^2+a_3x^3\mid a_0,a_1,a_2,a_3\in {\mathbb {F}}_2\}\) (mod \(x^4+x^3+x^2+x+1\)), \({\mathcal {F}}_3=\{\xi \in {\overline{\varGamma }}_3\mid \xi ^4=\xi \}=\{0,1,x+x^4,x^2+x^3\}\), \(\mathrm{Tr}_{{\overline{\varGamma }}_3/{\mathcal {F}}_3}^{-1}(x+x^4)=\{x,1+x,x^4,1+x^4\}\) and

    $$\begin{aligned} {\mathcal {W}}_3=x^{\frac{m_3}{2}}\mathrm{Tr}_{{\overline{\varGamma }}_3/{\mathcal {F}}_3}^{-1}(x^{\frac{m_3}{2}}w_3(x^{-1})) =\{x,x+x^2,x^2+x^3,x^3\}. \end{aligned}$$
  • \(w_4(x)=x\), since

    $$\begin{aligned} w_4(x)\equiv & {} \frac{f_4(x)^2-f_4(x^2)}{2f_4(x)} \equiv \frac{(x^4+2x^2+3x+1)^2-(x^8+2x^4+3x^2+1)}{2(x^4+2x^2+3x+1)}\\\equiv & {} x \ (\mathrm{mod} \ \langle {\overline{f}}_4(x),2\rangle ). \end{aligned}$$

By Theorem 3, all the 315 distinct self-dual codes over \({\mathbb {Z}}_4\) of length 30 are listed by

$$\begin{aligned} {\mathcal {C}}=\theta _1(x)C_1\oplus \theta _2(x)C_2\oplus \theta _3(x)C_3\oplus \theta _4(x)C_4\oplus \theta _5(x)C_5, \end{aligned}$$

where \(C_i\) is an ideal of \({\mathcal {K}}_i\), \(1\le i\le 5\), given by the following:

  1. (1)

    \(C_1=\langle 2\rangle \);

  2. (2)

    \(C_2=\langle 2\rangle \), \(C_2=\langle f_2(x)+2h(x)\rangle \) where \(h(x)\in {\mathcal {W}}_2\) arbitrary;

  3. (3)

    \(C_3=\langle 2\rangle \), \(C_3=\langle f_3(x)+2h(x)\rangle \) where \(h(x)\in {\mathcal {W}}_3\) arbitrary;

  4. (4)

    \((C_4,C_5)\) is given by the following table.

\(C_4\) (mod \(f_4(x^2)\))

\(C_{5}\) (mod \(f_{5}(x^2)\))

\(C_4\) (mod \(f_4(x^2)\))

\(C_{5}\) (mod \(f_{5}(x^2)\))

\(\langle 0\rangle \)

\(\langle 1\rangle \)

\(\langle 2{\overline{f}}_4(x)\rangle \)

\(\langle f_{5}(x),2\rangle \)

\(\langle 1\rangle \)

\(\langle 0\rangle \)

\(\langle f_4(x), 2\rangle \)

\(\langle 2{\overline{f}}_{5}(x)\rangle \)

\(\langle 2\rangle \)

\(\langle 2\rangle \)

\(\langle f_4(x)+2h(x)\rangle \)

\(\langle f_{5}(x)+2{\widehat{h}}(x)\rangle \)

where \(h(x)=a+bx+cx^2+dx^3\) with \(a,b,c,d\in \{0,1\}\), and

$$\begin{aligned} {\widehat{h}}(x)= & {} a+dx+cx^2+(1+a+b)x^3 \\\equiv & {} x^{4}(w_4(x^{-1})+h(x^{-1})) \ (\mathrm{mod} \ \langle {\overline{f}}_5(x),2\rangle ). \end{aligned}$$

A generator matrix for each of the 315 self-dual codes over \({\mathbb {Z}}_4\) of length 30 is provided in the Appendix of this paper.

Recently, in [24, Tables 1, 2, 3] , some good cyclic codes over \({\mathbb {Z}}_4\) were obtained from \((1 +2u)\)-constacyclic codes over the ring \({\mathbb {Z}}_4[u]/\langle u^2-1\rangle \), and these codes have either the same parameters as the ones in [9] or they have better parameters. In [7], 36 new and good self-dual 2-quasi-twisted linear codes over \({\mathbb {Z}}_4\), with basic parameters \((28, 2^{28}, d_L=8, d_E=12)\) and of type \(4^72^{14}\) and basic parameters \((28, 2^{28}, d_L=6, d_E=12)\) and of type \(4^62^{16}\), which are Gray images of self-dual negacyclic codes over the ring \(\frac{{\mathbb {Z}}_4[v]}{\langle v^2+2v\rangle }\) of length 14, were obtained, where \(d_H,d_L\) and \(d_E\) is the minimum Hamming distance, Lee distance and Euclidean distance of a \({\mathbb {Z}}_4\)-code, respectively. Recently, in [18], binary extremal singly even self-dual [60, 30, 12]-codes and [60, 30, 10]-codes were constructed by a classification of four-circulant singly even self-dual [60, 30, d]-codes for \(d = 10\) and 12.

Among the above 315 self-dual codes over \({\mathbb {Z}}_4\) of length 30, we have the following 24 self-dual cyclic \({\mathbb {Z}}_4\)-codes which do not exist in [7, 20] and [24]:

  1. (1)

    16 codes with basic parameters \((30,|C|=2^{30},d_H=6, d_L=12)\) of type \(4^{14}2^2\) determined by

    $$\begin{aligned} \begin{array}{l} C_1=\langle 2\rangle , \quad C_2=\langle f_2(x)+2h(x)\rangle { \text{ where } } h(x)\in {\mathcal {W}}_2, \\ C_3=\langle f_3(x)+2h(x)\rangle { \text{ where } } h(x)\in {\mathcal {W}}_3, \\ (C_4,C_5)=(\langle 0\rangle ,\langle 1\rangle ) { \text{ or } } (C_4,C_5)=(\langle 1\rangle ,\langle 0\rangle ). \end{array} \end{aligned}$$

    From the above 16 codes and by the Gray map \(\psi \) from \({\mathbb {Z}}_4\) onto \({\mathbb {F}}_2^2\), defined by \(0\mapsto 00\), \(1\mapsto 01\), \(2\mapsto 11\) and \(3\mapsto 10\), we obtain 16 formally self-dual and 2-quasicyclic binary codes with basic parameters [60, 30, 12].

  2. (2)

    8 codes with basic parameters \((30,|C|=2^{30},d_H=5,d_L=10)\) of type \(4^{12}2^6\) determined by

    $$\begin{aligned} \begin{array}{l} C_1=\langle 2\rangle , \quad C_2=\langle 2\rangle , \quad C_3=\langle f_3(x)+2h(x)\rangle { \text{ where } } h(x)\in {\mathcal {W}}_3, \\ (C_4,C_5)=(\langle 0\rangle ,\langle 1\rangle ) { \text{ or } } (C_4,C_5)=(\langle 1\rangle ,\langle 0\rangle ). \end{array} \end{aligned}$$

    From the above 8 codes and by the Gray map \(\psi \) from \({\mathbb {Z}}_4\) onto \({\mathbb {F}}_2^2\), we obtain 8 formally self-dual and 2-quasicyclic binary codes with parameters [60, 30, 10].

$$\begin{aligned} n=6,10 \end{aligned}$$

On [13, p. 152], the authors concluded that “there is only one trivial self-dual cyclic code over \({\mathbb {Z}}_4\) of length 6 and 10, respectively.” In fact, there are 3 self-dual cyclic codes over \({\mathbb {Z}}_4\) of length 6 and there are 5 self-dual cyclic codes over \({\mathbb {Z}}_4\) of length 10.

  1. (1)

    All the 3 distinct self-dual cyclic codes over \({\mathbb {Z}}_4\) of length 6 are given by:

    $$\begin{aligned} {\mathcal {C}}=\theta _1(x)C_1\oplus \theta _2(x)C_2, \end{aligned}$$

    where

    $$\begin{aligned}&\theta _1(x)=3x^4+3x^2+3, C_1=\langle 2\rangle , \mathrm{\ and \ }\\&\theta _2(x)=x^4+x^2+2; C_2=\langle 2\rangle , \langle (x^2+x+1)+2\rangle , \langle (x^2+x+1)+2(1+x)\rangle . \end{aligned}$$

    Hence, the 2 nontrivial self-dual cyclic codes over \({\mathbb {Z}}_4\) of length 6 are generated by the following matrices, respectively:

    $$\begin{aligned} \left( \begin{array}{cccccc} 2 &{} 0 &{} 2 &{} 0 &{} 2 &{} 0 \\ 0 &{} 2 &{} 0 &{} 2 &{} 0 &{} 2 \\ 3 &{} 2 &{} 1 &{} 1 &{} 0 &{} 1 \\ 1 &{} 3 &{} 2 &{} 1 &{} 1 &{} 0 \end{array}\right) ,\ \left( \begin{array}{cccccc} 2 &{} 0 &{} 2 &{} 0 &{} 2 &{} 0 \\ 0 &{} 2 &{} 0 &{} 2 &{} 0 &{} 2 \\ 3 &{} 2 &{} 1 &{} 3 &{} 0 &{} 3 \\ 3 &{} 3 &{} 2 &{} 1 &{} 3 &{} 0 \end{array}\right) . \end{aligned}$$

    These 2 linear codes over \({\mathbb {Z}}_4\) are of type \(4^22^2\).

  2. (2)

    All the 5 distinct self-dual cyclic codes over \({\mathbb {Z}}_4\) of length 10 are given by:

    $$\begin{aligned} {\mathcal {C}}=\theta _1(x)C_1\oplus \theta _2(x)C_2, \end{aligned}$$

    where

    $$\begin{aligned} \theta _1(x)= & {} x^8+x^6+x^4+x^2+1; C_1=\langle 2\rangle .\\ \theta _2(x)= & {} 3x^8+3x^6+3x^4+3x^2; C_2=\langle 2\rangle , \langle (x^4+x^3+x^2+x+1)+2x\rangle , \\&\quad \langle (x^4+x^3+x^2+x+1)+2(x+x^2)\rangle , \langle (x^4+x^3+x^2+x+1)\\&\quad +2(x^2+x^3)\rangle , \langle (x^4+x^3+x^2+x+1)+2x^3\rangle . \end{aligned}$$

    Hence the 4 nontrivial self-dual cyclic codes over \({\mathbb {Z}}_4\) of length 6 are generated by the following matrices, respectively:

    $$\begin{aligned} \left( \begin{array}{cccccccccc} 2 &{} 0 &{} 2 &{} 0 &{} 2 &{} 0 &{} 2 &{} 0 &{} 2 &{} 0\\ 0 &{} 2 &{} 0 &{} 2 &{} 0 &{} 2 &{} 0 &{} 2 &{} 0 &{} 2\\ 2 &{} 3 &{} 2 &{} 1 &{} 2 &{} 0 &{} 1 &{} 0 &{} 1 &{} 0\\ 0 &{} 2 &{} 3 &{} 2 &{} 1 &{} 2 &{} 0 &{} 1 &{} 0 &{} 1\\ 1 &{} 0 &{} 2 &{} 3 &{} 2 &{} 1 &{} 2 &{} 0 &{} 1 &{} 0\\ 0 &{} 1 &{} 0 &{} 2 &{} 3 &{} 2 &{} 1 &{} 2 &{} 0 &{} 1 \end{array}\right) ,\ \left( \begin{array}{cccccccccc} 2 &{} 0 &{} 2 &{} 0 &{} 2 &{} 0 &{} 2 &{} 0 &{} 2 &{} 0\\ 0 &{} 2 &{} 0 &{} 2 &{} 0 &{} 2 &{} 0 &{} 2 &{} 0 &{} 2\\ 0 &{} 3 &{} 2 &{} 1 &{} 0 &{} 0 &{} 3 &{} 0 &{} 3 &{} 0\\ 0 &{} 0 &{} 3 &{} 2 &{} 1 &{} 0 &{} 0 &{} 3 &{} 0 &{} 3\\ 3 &{} 0 &{} 0 &{} 3 &{} 2 &{} 1 &{} 0 &{} 0 &{} 3 &{} 0\\ 0 &{} 3 &{} 0 &{} 0 &{} 3 &{} 2 &{} 1 &{} 0 &{} 0 &{} 3 \end{array}\right) , \\ \left( \begin{array}{cccccccccc} 2 &{} 0 &{} 2 &{} 0 &{} 2 &{} 0 &{} 2 &{} 0 &{} 2 &{} 0\\ 0 &{} 2 &{} 0 &{} 2 &{} 0 &{} 2 &{} 0 &{} 2 &{} 0 &{} 2\\ 0 &{} 1 &{} 2 &{} 3 &{} 0 &{} 0 &{} 3 &{} 0 &{} 3 &{} 0\\ 0 &{} 0 &{} 1 &{} 2 &{} 3 &{} 0 &{} 0 &{} 3 &{} 0 &{} 3\\ 3 &{} 0 &{} 0 &{} 1 &{} 2 &{} 3 &{} 0 &{} 0 &{} 3 &{} 0\\ 0 &{} 3 &{} 0 &{} 0 &{} 1 &{} 2 &{} 3 &{} 0 &{} 0 &{} 3 \end{array}\right) ,\ \left( \begin{array}{cccccccccc} 2 &{} 0 &{} 2 &{} 0 &{} 2 &{} 0 &{} 2 &{} 0 &{} 2 &{} 0\\ 0 &{} 2 &{} 0 &{} 2 &{} 0 &{} 2 &{} 0 &{} 2 &{} 0 &{} 2\\ 2 &{} 1 &{} 2 &{} 3 &{} 2 &{} 0 &{} 1 &{} 0 &{} 1 &{} 0\\ 0 &{} 2 &{} 1 &{} 2 &{} 3 &{} 2 &{} 0 &{} 1 &{} 0 &{} 1\\ 1 &{} 0 &{} 2 &{} 1 &{} 2 &{} 3 &{} 2 &{} 0 &{} 1 &{} 0\\ 0 &{} 1 &{} 0 &{} 2 &{} 1 &{} 2 &{} 3 &{} 2 &{} 0 &{} 1 \end{array}\right) . \end{aligned}$$

    These 4 linear codes over \({\mathbb {Z}}_4\) are of type \(4^42^2\).

7 An isomorphism and lifts of cyclic codes

In this section, we study an isomorphism on the family of cyclic codes and lifts of cyclic codes. Recall that a negacyclic code \({{\mathcal {C}}}\) satisfies \((c_0,c_1,\ldots ,c_{N-1}) \in \mathcal{C}\) implies \((-c_{N-1},c_0,c_1,\ldots ,c_{N-2}) \in \mathcal{C}.\) If N is odd, then the map \(\varPsi (c(x)) = c(-x)\) sends cyclic codes to negacyclic codes. Therefore a description of cyclic codes necessarily gives a description of all negacyclic codes. Moreover, the rank and kernel of the negacyclic code are also determined from the rank and kernel of the cyclic code, see [12] for a complete description. When N is even, this is not the case.

Theorem 4

The map \(\varPsi :{\mathbb {Z}}_4[x]/ \langle x^{2n}-1 \rangle \rightarrow {\mathbb {Z}}_4[x]/ \langle x^{2n}-1 \rangle \) sends cyclic codes to cyclic codes.

Proof

We note that \((-x)^{2n} - 1 = x^{2n}-1\). Take \((c_0,c_1,\ldots , c_{2n-1}) \in \varPsi (\mathcal{C})\). This implies that \((c_0,-c_1,c_2,-c_3 \ldots , -c_{2n-1}) \in \mathcal{C}\). Since \(\mathcal{C}\) is cyclic, we have that \({{\mathbf {v}}} = (-c_{2n-1},c_0,-c_1,\ldots ,c_{2n-2}) \in \mathcal{C}\), so \( - {\mathbf v} = (c_{2n-1}, - c_0, c_1,\ldots , - c_{2n-2}) \in \mathcal{C}\). It follows then that \((c_{2n-1},c_0,c_1, \ldots , c_{2n-2}) \in \varPsi (\mathcal{C})\). Therefore \(\varPsi (\mathcal{C})\) is cyclic. \(\square \)

It is possible for the map to fix codes, for example the cyclic code generated by \(2 I_{2n}\) is fixed by \(\varPsi .\)

Theorem 5

If \(\mathcal{C}\) is a self-dual cyclic code over \({\mathbb {Z}}_4\) then \(\varPsi (\mathcal{C})\) is a self-dual cyclic code.

Proof

If \((c_0,c_1,\ldots ,c_{2n-1}), (d_0,d_1,\ldots ,d_{2n-1}) \in \mathcal{C}\), then

$$\begin{aligned}{}[(c_0,c_1,\ldots ,c_{2n-1}), (d_0,d_1,\ldots ,d_{2n-1}) ]= \sum _{i=0}^{2n-1} c_i d_i = 0. \end{aligned}$$

Then \((c_0,-c_1,c_2,-c_3\ldots ,c_{2n-1}), (d_0,-d_1, d_2,-d_3,\ldots ,d_{2n-1}) \in \varPsi (\mathcal{C})\) and

$$\begin{aligned}{}[(c_0,-c_1,c_2,-c_3\ldots ,c_{2n-1}), (d_0,-d_1, d_2,-d_3,\ldots ,d_{2n-1})] = \sum _{i=0}^{2n-1} c_i d_i = 0. \end{aligned}$$

Therefore the code \(\varPsi ({{\mathcal {C}}})\) is self-orthogonal. Since the cardinality of \(\varPsi (\mathcal{C})\) is

$$\begin{aligned} |\varPsi (\mathcal{C})| = |C| = 4^n, \end{aligned}$$

the code is self-dual. \(\square \)

These results show that the map \(\varPsi \) sends cyclic codes to cyclic codes and self-dual cyclic codes to self-dual cyclic codes. We summarize this in the following corollary.

Corollary 1

If \(\langle c(x) \rangle \) is a cyclic code over \({\mathbb {Z}}_4\) of length 2n, then \(\langle c(-x) \rangle \) is a cyclic code of length 2n. If \(\langle c(x) \rangle \) is a self-dual cyclic code over \({\mathbb {Z}}_4\) of length 2n, then \(\langle c(-x) \rangle \) is a self-dual cyclic code of length 2n.

In [14], codes over local Frobenius rings of order 16 were studied. Cyclic codes over these rings were studied in [10] and [15]. Of these rings, seven are extensions of \({\mathbb {Z}}_4\). Namely, \({\mathbb {Z}}_4[z]/ \langle z^2-2\rangle \), \({\mathbb {Z}}_4[z]/ \langle z^2-2z-2 \rangle \) and \({\mathbb {Z}}_4[z]/ \langle z^3-2,2z \rangle \) are chain rings, and \({\mathbb {Z}}_4[z]/ \langle z^2\rangle \), \({\mathbb {Z}}_4[z]/ \langle z^2-2z \rangle \), \({\mathbb {Z}}_4[w,z]/ \langle w^2,wz-2,z^2,2w,2z \rangle \) and \({\mathbb {Z}}_4[w,z]/ \langle w^2-2, 2z-2,z^2,2w,2z \rangle \) are non-chain local rings. All of these rings have \({\mathbb {Z}}_4\) as a subring. For each of these rings, a Gray map \(\psi _R\) is defined from R to \({\mathbb {F}}_2^4.\) It is shown in [15] that the image of a cyclic code over R under \(\psi _R\) is a quasicyclic code of index 4.

If \(\mathcal{C}\) is a code over \({\mathbb {Z}}_4\), let \(L_R(\mathcal{C})\) be the lift of the code \(\mathcal{C}\) to R, i.e., \(L_R(\mathcal{C})\) is the R-module generated by \(\mathcal{C}\).

Lemma 10

Let R be a local Frobenius extension over \({\mathbb {Z}}_4\). If \(\mathcal{C}\) is a cyclic code over \({\mathbb {Z}}_4\), then \(L_R(\mathcal{C})\) is a cyclic code over R.

Proof

By definition of the lift, \(L_R(\mathcal{C})\) is linear over R. If \(\mathcal{C}\) is of length N, every \({{\mathbf {v}}} \in L_R(\mathcal{C})\) is of the form \({{\mathbf {v}}} = (v_0, v_1, \ldots , v_{N-1}) = \sum _{i=1}^t r_i (c_{i,0} , c_{i,1}, \ldots , c_{i, N-1})\), where \(r_i \in R\) and \((c_{i,0} , c_{i,1}, \ldots , c_{i, N-1}) \in \mathcal{C}\), for all \(1 \le i \le t\).

Since \(\mathcal{C}\) is cyclic, \((c_{i,N-1}, c_{i,0} , c_{i,1}, \ldots , c_{i, N-2}) \in \mathcal{C}\) for each \(1 \le i \le t\), so \( (v_{N-1}, v_0, v_1, \ldots , v_{N-2}) = \sum _{i=1}^t r_i (c_{i,N-1}, c_{i,0} , c_{i,1}, \ldots , c_{i, N-2}) \in L_R(\mathcal{C})\). Therefore, the code \(L_R(\mathcal{C})\) is a cyclic code. \(\square \)

Combining this lemma with the result from [15], we have the following result:

Theorem 6

Let R be a local Frobenius extension over \({\mathbb {Z}}_4\) and let \(\mathcal{C}\) be a cyclic code over \({\mathbb {Z}}_4\). Then \(\psi _R(L_R(\mathcal{C}))\) is a binary quasicyclic code of index 4.

8 Conclusions

We have presented a new representation for every cyclic code over \({\mathbb {Z}}_{4}\) of length 2n, where n is an odd positive integer. Using this representation, we have provided an efficient encoder for each code and determined its type explicitly. We then gave a precise description for the dual codes and the self-duality of cyclic codes over \({\mathbb {Z}}_{4}\) of length 2n. In particular, the number of self-dual cyclic codes over \({\mathbb {Z}}_{4}\) of length 2n can be obtained from 2-cyclotomic cosets modulo n directly, correcting mistakes in [3] and [13].

A natural extension of this work is to represent all distinct self-dual cyclic codes over \({\mathbb {Z}}_{4}\) of length \(2^kn\) precisely, for any integer \(k\ge 2\).