1 Introduction

Quantum error-correcting codes (QECCs) play an important role in protecting quantum data transmitted over noisy quantum communication channels. The construction of new QECCs is a hot topic in recent decades [1, 9, 12, 14, 15, 21]. The quantum BCH codes were studied in many literatures [1, 14, 21]. In 2013, Kai et al. constructed some new quantum MDS codes from negacyclic codes. Recently, La Guardia constructed some new quantum codes from cyclic codes. After that, Gao et al. construct some new quantum codes from a special class of negacyclic codes. And they only consider the Pauli errors. However, this error model is not the only one of importance.

Scholars paid little attention to another type of significance error misalignment, which respect to the block structure of a qubit stream in quantum information processing. Where the information receiver or processing device misidentifies the boundary of an information block, the catastrophic failure can be brought. As the special QECCs, quantum synchronizable codes (QSCs) correct the effects of both quantum noise on qubits and misalignment in block synchronization [7]. The method of constructing the binary QSCs is to find out a pair of cyclic codes with special containing properties [7]. Fujiwara et al. improved the original construction method by widening the range of tolerable magnitude of misalignment and presented more examples of quantum synchronizable codes [6]. After that, there are many good QSCs from BCH codes, punctured Reed-Muller codes, certain finite geometric codes and quadratic or duadic codes [5, 6, 23]. Xie and Luo generalized the constructing of the binary QSCs to the q-ary QSCs [16, 22]. Xie et el. presented a general construction of QSCs from q-ary cyclic codes and derived the distance bound of the resulting QSCs of Calderbank-Shor-Steane (CSS) structure [22]. Luo and Ma constructed a new family of QSCs from repeated-root cyclic codes of lengths ps and lps over \(\mathbb {F}_{q}\) and proved that the QSCs with those lengths from the repeated-root cyclic codes can in general correct more Pauli errors than narrow-sense BCH codes of close lengths [16]. Li et al. utilized the cyclotomic classes of order four to obtain some cyclic codes with dual-containing properties and constructed two classes of QSCs [18]. Inspired by current work, we consider QECCs and QSCs from the cyclic codes, which are obtained by the cyclotomic classes of order r for any positive even integer.

In this paper, we give some results and properties of cyclic codes and the cyclotomic classes of order r in Section 2. In Section 3, we construct some dual-containing cyclic codes over \(\mathbb {F}_{q}\). We also obtain the bound of minimum distance of those cyclic codes and some optimal or almost optimal cyclic codes. Hence, we construct many optimal or almost optimal LCP of codes. In Section 4, we construct some new QECCs with cyclic codes obtained. We also construct some QSCs whose synchronization capabilities attain the upper bound. We conclude the paper in Section 5.

We will compare some of the codes obtained in this paper with the known literatures and the tables of best known linear codes (referred to as the Database later) maintained by Markus Grassl at http://www.codetables.de. The examples in this paper are computed by Magma.

2 Auxiliary Results

In this section, we give some simple introductions to cyclic codes. Furthermore, we present the definition and the properties of cyclotomy of order r.

Throughout this paper, let \(\mathbb {F}_{q}\) be a finite field, where q is an odd prime power. An [n, k] linear code C over \(\mathbb {F}_{q}\) is a k-dimensional linear subspace of \(\mathbb {F}_{q}^{n}\). The (Euclidean) dual code of C, denoted by C, is defined by

$$C^{\perp}=\{ \mathbf{u}\in\mathbb{F}_{q}^{n}~|~\mathbf{u}\cdot \mathbf{c}=0~\forall~\mathbf{c}\in C\},$$

where uc denotes the standard inner product.

An [n, k] linear code C over \(\mathbb {F}_{q}\) is called a cyclic code if it is invariant under cyclic-shift on \(\mathbb {F}_{q}\), (c0,c1,⋯ ,cn− 1)↦(cn− 1,c0,⋯ ,cn− 2). By identifying a codeword with its polynomial representation in \(\mathbb {F}_{q}[x]/\langle x^{n}-1\rangle \), a linear code of length n over \(\mathbb {F}_{q}\) is cyclic if and only if the corresponding set in \(\mathbb {F}_{q}[x]/\langle x^{n}-1\rangle \) is just an ideal in \(\mathbb {F}_{q}[x]/\langle x^{n}-1\rangle \). Since \(\mathbb {F}_{q}[x]/\langle x^{n}-1\rangle \) is a principal ring. Then there is a monic polynomial g(x) of minimal degree in C such that C = 〈g(x)〉, where g(x)| (xn − 1). Furthermore, dim(C) = ndegg(x). Let h(x) = (xn − 1)/g(x), h(x) is called the check polynomial of C. We have C = 〈h(x)〉, where \(h(x)^{\ast }=h(0)^{-1}x^{\deg (h(x))}h(\frac {1}{x})\) is the reciprocal polynomial of h(x).

The q-cyclotomic coset containing j modulo n is defined by \(C_{j} = \{q^{i} j~ \text {mod}~ n \}\subset \mathbb {Z}_{n}\), where gcd(n, q) = 1. As we all known that \(m_{j}(x)={\Pi }_{i\in C_{j}}(x-\xi ^{i})\) is the minimal polynomial of ξj over \(\mathbb {F}_{q}\), where ξ is a primitive n-th root of unity in some extension field of \(\mathbb {F}_{q}\). Let Γ(q, n) be the set of all the coset representatives. Then we have

$$ x^{n}-1=\prod\limits_{j\in{\Gamma}_{(q,n)}}m_{j}(x), $$

There is a pair of cyclic codes (\(C,C^{\prime }\)) with generator polynomials g(x) and \(g^{\prime }(x)\), respectively. The cyclic codes C and \(C^{\prime }\) have parameters [n, k]q and \([n,k^{\prime } ]_{q}\), where \(k < k^{\prime }\), respectively. Then, \(C^{\prime }\) is said to be C-containing if \(C\subseteq C^{\prime }\). Specially, we called \(C^{\prime }\) dual-containing if \(C=C^{\prime \perp }\). Furthermore, assume that \(C^{\prime }\) is C-containing, we have that the generator polynomial \(g^{\prime }(x)\) is a factor of every codeword of C. i.e., for any c(x) ∈ C, there must exists a polynomial fc(x) such that \(c(x) = f_{c} (x)g^{\prime } (x)\) in \(\mathbb {F}_{q} [x]\). Let \(f(x) =g (x)/g^{\prime } (x)\). We have that \(f(x) \in \mathbb {F}_{q} [x]\) has degree \(k^{\prime } - k\) and f(0)≠ 0. What’s more, the cardinality of the set {xa(modf(x))|aN} is called the order of the polynomial f(x), where N is the set of positive integers.

Let n = rf + 1 be an odd prime, where f is a positive integer and r is a positive even integer. Let α be a generator of \(\mathbb {F}_{n}^{\ast }\). We consider cyclotomic classes \(D_{i,\alpha }^{(r,n)}\) of order r, which are defined as follows

$$D_{i,\alpha}^{(r,n)}=\alpha^{i}(\alpha^{r}),~~0\leq i< r,$$

where (αr) denotes the multiplication subgroup of \(\mathbb {F}_{n}^{\ast }\) generated by αr. Clearly, we have \(f=|D_{i,\alpha }^{(r,n)}|\) for 0 ≤ ir, where |A| denotes the cardinality of set A. Obviously, the \(D_{i,\alpha }^{(r,n)}\) for 0 ≤ i < r forms a partition of \(\mathbb {F}_{n}^{\ast }\). Next we show that this partition is unconcerned with the selection of generator of \(\mathbb {F}_{n}^{\ast }\).

Proposition 2.1

Let symbols be the same as before. Letαand β be distinct primitive elements of\(\mathbb {F}_{n}\)and denote the cyclotomic classes\(D_{i,\alpha }^{(r,n)}\)and\(D_{j,\upbeta }^{(r,n)}\), respectively. For anyone 0 ≤ j < r, there exists unique integerj (0 ≤ i < r) such that

$$D_{i,\alpha}^{(r,n)}= D_{j,\upbeta}^{(r,n)}.$$

Proof

There exists an integer s such that β = αs since α and β are distinct primitive elements of \(\mathbb {F}_{n}\), where 0 ≤ s < n and gcd(s, n − 1) = 1. Then we have \(D_{j,\upbeta }^{(r,n)}=\{{\upbeta }^{rk+j}=\alpha ^{srk+sj}|~0\leq k<f\}\). For any \(b={\upbeta }^{rk+j}=\alpha ^{srk+sj}\in D_{j,\upbeta }^{(r,n)}\). If 0 ≤ sj < r, let i = sj, then \(b\in D_{i,\alpha }^{(r,n)}\). If sjr, by the division algorithm, there exist integers 0 ≤ b < f and 0 ≤ c < r such that sj = br + c. Let i = c, then \(b\in D_{i,\alpha }^{(r,n)}\). Then we have \( D_{j,\upbeta }^{(r,n)}\subseteq D_{i,\alpha }^{(r,n)}\). Note that \(|D_{i,\alpha }^{(r,n)}|=| D_{j,\upbeta }^{(r,n)}|\). Then we have the desired conclusion immediately. □

From Proposition 2.1, we always let \(D_{i}^{(r,n)}\) denote \(D_{i,\alpha }^{(r,n)}\) for any α, which is a generator of \(\mathbb {F}_{n}^{\ast }\). In the sequel, we always let nr + 1 (mod 2r) and \(q\in D_{0}^{(r,n)}\). We define s = ordn(q) and \(\xi ={\upbeta }^{(q^{s}-1)/n}\), where β is a generator of \(\mathbb {F}_{q^{s}}^{\ast }\). Thus, ξ is a n-th primitive root of unity in \(\mathbb {F}_{q^{s}}\). Next we define \(d_{i}(x)={\prod }_{i\in D_{i}^{(r,n)}}(x-\xi ^{i})\). Note that Di are unions of q-cyclotomic cosets for \(q\in D_{0}^{(r,n)}\), then \(d_{i}(x)\in \mathbb {F}_{q}[x]\). In fact, we have

$$ x^{n}-1=(x-1){\prod}_{i=0}^{r-1}d_{i}(x). $$
(1)

Keep the notations as above, we can obtain the following useful lemma immediately.

Lemma 2.2

Let symbols be the same as before. We have

$$D_{i}^{(r,n)}=-D_{i+\frac{r}{2}}^{(r,n)},~~~i=0,1,\cdots,\frac{r-2}{2}.$$

Proof

Since n = r + 1 (mod 2r), put n = 2rk + r + 1, we have − 1 ≡ α(n− 1)/2αrk+r/2 (mod n), where α is a generator of \(\mathbb {F}_{n}^{\ast }\). For any element \(d\in D_{i+\frac {r}{2}}^{(r,n)}\), \(d=\alpha ^{rk_{0}+i+r/2}\) for some integer k0, where 0 ≤ k0f − 1. Note that \(-d=\alpha ^{(k+k_{0}+1)r+i}\in D_{i}^{(r,n)}\). Then we have \(-D_{i+\frac {r}{2}}^{(r,n)}\subseteq D_{i}^{(r,n)}\). What’s more, we know that \(|-D_{i+\frac {r}{2}}^{(r,n)}|=f=|D_{i}^{(r,n)}|\). This completes the proof. □

From Lemma 2.2, we assume that \(\mathbb {Z}_{r}=\{0,1,\cdots ,r-1\}\) and \(A\subseteq \mathbb {Z}_{r}\), define

$$-A=\{a+\frac{r}{2}~(\text{mod}~r)|~a\in A\}.$$

Remark 1

From the range of values of length n in this paper, the length n ≡ 5 (mod 8) in [18] is a special case when r = 4. However, we can obtain more general lengths.

3 Construction of Cyclic Codes

In this section, we utilize the cyclotomic classes of order r to construct dual-containing cyclic codes, where r is a positive even integer. Suppose Z(i, r) = {i, i + 1,⋯ ,i + r/2 − 1} (mod r) for any 0 ≤ ir − 1. Let C(i, S) be the cyclic code with generator polynomial \(g_{iS}(x)={\prod }_{j\in S}d_{j}(x)\), where \(S\subseteq Z_{(i,r)}\). From the definition of C(i, S), we have that \(C_{(i,S_{1})}\subseteq C_{(i,S_{2})}\) if \(S_{2}\subseteq S_{1}\). Let \(\overline {C}_{(i,S)}\) be the cyclic codes with generator polynomial \(\overline {g}_{iS}(x)={\prod }_{j\in \mathbb {Z}_{r}\setminus (-S)}d_{j}(x)\).

Lemma 3.1

Let the symbols be the same as before, C(i, S)and\(\overline {C}_{(i,S)}\)be defined above. Then we have

$$(1)~C_{(i,S)}^{\perp}=\overline{C}_{(i,S)};~~(2)~C_{(i,S)}^{\perp}\subset C_{(i,S)}.$$

Proof

By Lemma 2.2, we know that \(d_{i}(x)^{\ast }=d_{i+\frac {r}{2}}(x)\) for any 0 ≤ ir − 1. Since \(C_{(i,S)}=\langle g_{iS}(x)\rangle =\langle {\prod }_{j\in S}d_{j}(x)\rangle \), where \(S\subseteq Z_{(i,r)}\). It is clear that \(C_{(i,S)}^{\perp }=\langle h(x)^{\ast }\rangle =\langle {\prod }_{j\in \mathbb {Z}_{r}\setminus (-S)}d_{j}(x)\rangle \), where h(x) = (xn − 1)/giS(x). We have the desired conclusions immediately. □

Theorem 3.2

LetdiSdenote the minimum distance of the cyclic codeC(i, S)andnbe the length ofC(i, S). Then we have following conclusions

  1. (1)

    If\(|S|=\frac {r}{2}\), \(d_{iS}^{2}-d_{iS}+1\geq n\);

  2. (2)

    Otherwise, \(d_{iS}^{2}-d_{iS}+1\geq d_{S}\). wheredSis the minimum distance of cyclic code with generator polynomial\({\prod }_{j\in S\cup (-S)}d_{j}(x)\).

Proof

  1. (1)

    Let \(|S|=\frac {r}{2}\) and a(x) be a codeword of C(i, S) with weight diS. From Lemma 2.2, we have a(x− 1) is a codeword of \(C_{(i+\frac {r}{2},S)}\). It is clear that a(x)a(x− 1) is a codeword of \(C_{(i,S)}\bigcap C_{(i+\frac {r}{2},S)}\) with generator polynomial

    $$\prod\limits_{j\in S\cup (-S)}d_{j}(x)=\prod\limits_{j\in \mathbb{Z}_{r}}d_{j}(x)=\frac{x^{n}-1}{x-1}=\sum\limits_{k=0}^{n-1}x^{k}.$$

    Then we have that the weight of a(x)a(x− 1) is n. From above all, we have \(d_{iS}^{2}-d_{iS}+1\geq n\).

  2. (2)

    Let \(|S|\neq \frac {r}{2}\) and b(x) be a codeword of C(i, S) with weight diS. Similar to (1), we obtain that b(x)b(x− 1) is a codeword of \(C_{(i,S)}\bigcap C_{(i+\frac {r}{2},S)}\) with generator polynomial

    $$\prod\limits_{j\in S\cup (-S)}d_{j}(x).$$

    Then we have that the weight of b(x)b(x− 1) is at least dS. For the above reasons, we have \(d_{iS}^{2}-d_{iS}+1\geq d_{S}\). This completes the proof.

Example 3.3

We let (r, n, q) = (2,7,2) and S = {i}. Clearly, \(q\in D_{0}^{(r,n)}\). For any 0 ≤ i ≤ 1, The cyclic code C(i, S) has parameters [7,4,3] and \(C_{(i,S)}^{\perp }\) has parameters [7,3,4], which are both optimal and satisfy the bound of Theorem 3.2.

Example 3.4

We let (r, n, q) = (6,19,7) and S = {i, i + 1}. Clearly, \(q\in D_{0}^{(r,n)}\). For any 0 ≤ i ≤ 5, The cyclic code C(i, S) has parameters [19,13,5] and \(C_{(i,S)}^{\perp }\) has parameters [19,6,12], which are both optimal and satisfy the bound of Theorem 3.2 .

Next we give more good dual-containing cyclic codes C(i, S) in Table 1. The all results of Table 1 are obtained by the algebra system Magma.

Table 1 Dual-containing cyclic codes C(i, S)

It is well known that linear complementary pairs (LCP) of codes are good candidates against side-channel attacks (SCA) and fault injection attacks (FIA). The reader can refer to [2, 3, 11] for more information. From Theorems II.1 and II.4 of [2], we have following lemma immediately.

Lemma 3.5

Let gcd(n, q)= 1, for cyclic codesC = 〈g(x)〉 andD = 〈u(x)〉 with lengthnover\(\mathbb {F}_{q}\), we have following sentences hold.

  1. 1).

    The (C, D) is LCP if and only ifu(x) = (xn − 1)/g(x).

  2. 2).

    DandCare equivalent if (C, D) is LCP.

From Table 1, many cyclic codes and their dual codes are both optimal or almost optimal. Then we can construct many optimal or almost optimal LCP of codes by Lemma 3.5.

There is a pair of cyclic codes \((C,C^{\prime }\)) with containing property \(C\subset C^{\prime }\). We call cyclic code \(C^{\prime }\) the augmented cyclic code of C. It is equivalent to \(g^{\prime }(x)|g(x)\) if C = 〈g(x)〉 and \(C=\langle g^{\prime }(x)\rangle \).

Theorem 3.6

Letnbe an odd prime andnr + 1 (mod 2r). Letxn − 1 be factored as (1) over\(\mathbb {F}_{q}\)and the cardinality ofC1be. Then we have the each factordi(x) of xn − 1 can be factored into\(e=\frac {n-1}{r\ell }\)irreducible polynomials of the same degreeas follows

$$d_{i}(x)=\prod\limits_{j\in T_{i}}m_{j}(x),$$

whereTiis some proper subset of\(\mathbb {Z}_{n}\)and |Ti| = efor 0 ≤ ir − 1.

Proof

Since |C1| = and n is an odd prime, we have |Cj| = for any \(j\in \mathbb {Z}_{n}^{\ast }\), which implies that each polynomial mj(x) has degree for any \(j\in \mathbb {Z}_{n}^{\ast }\). Furthermore, \(q\in D_{0}^{(r,n)}\), we have that \(D_{i}^{(r,n)}=\bigcup _{j\in T_{i}}C_{j}\), where Ti is some proper subset of \(\mathbb {Z}_{n}\) and \(|T_{i}|=e=\frac {n-1}{r\ell }\). □

Let C be an augmented cyclic code of C(i, S). From the proof of Lemma 3.1 and Theorem 3.6, we suppose that the generator polynomial g(x) of C is a factor of giS(x). Note that C is a dual-containing cyclic code. Then we have following lemma immediately.

Lemma 3.7

Let the symbols be the same as before, C(i, S)andTibe defined above. For any 0 ≤ ir − 1 and\(S\subseteq Z_{(i,r)}\), then we haveC(i, S)Cifg(x) has following form

$$g(x)= g_{iS}(x)/\prod\limits_{k\in B}m_{k}(x),$$

whereBis some proper subset of\(\bigcup _{k\in S}T_{k}\).

Obviously, the cyclic codes C are also dual-containing, i.e., \(C^{\perp }\subseteq C\).

4 QECCs and QSCs from Cyclotomic Codes

In this section, utilizing the optimal or almost optimal dual-containing cyclotomic codes obtained in Section 3, we construct some new QECCs and some QSCs with good parameters.

4.1 New QECCs from Cyclotomic Codes

In this subsection, firstly, we introduce the basic concept and results of QECCs. Secondly, we construct some new QECCs with the dual-containing cyclic codes obtained in Section 3.

A q-ary QECC \(\mathbb {Q}\) of length n is a K-dimensional subspace of the qn-dimensional Hilbert space \((\mathbb {C}^{q})^{\otimes n}\), where ⊗n denotes the tensor product of vector spaces. If K = qk, a q-ary QECC of length n and minimum distance d denote by [[n, k, d]]q. For a QECC with parameter [[n, k, d]]q, the Quantum Singleton Bound (QSB) asserts that k + 2dn + 2. If the equality holds then the code is called a maximum distance separable (MDS) code. For more details on QECCs, the reader can refer to [13,14,15, 20]. The following lemma give the classical construction method of QECCs in [1, 17].

Lemma 4.1

  1. 1).

    (Calderbank-Shor-Steane (CSS) Construction) If there exists a classical linear [n, k, d]qcodeCsuch that\(C^{\perp } \subseteq C\), then there exists an [[n,2kn,≥ d]]qstabilizer quantum code that is pure tod.

  2. 2).

    (Steane’s Construction) If there exists a classical linear [n, k, d]qcodeCwhich contains its Euclidean dualCand which can be enlarged to an linear code\(C^{\prime }=[n,k^{\prime },d^{\prime }]_{q}\), where\(k^{\prime }-k\geq 2\), then there exists an\([[n,k+k^{\prime } -n, \geq \min \limits ~ \{d,\big \lceil \frac {q+1}qd^{\prime }\big \rceil \}]]_{q}\)stabilizer quantum code.

Clearly, our main goal is to obtain optimal or the almost optimal codes C such that \(C^{\perp } \subseteq C\). From Section 3, we know that the cyclic codes C(i, S) are always dual-containing. Then they are good source to construct QECCs by 1) of Lemma 4.1. Furthermore, we have that \(C_{(i,S_{1})}\subseteq C_{(i,S_{2})}\) if \(S_{2}\subseteq S_{1}\). Then we also can construct many QECCs by 2) of Lemma 4.1. Next we give some examples to illustrate the QECCs are new.

Example 4.2

Let (r, n, q) = (2,11,5) and S = {i}, we have that \(q\in D_{0}^{(2,11)}\). Let C(i, S) = 〈di(x)〉 with parameters [11,6,5]. We get a QECC with parameters [[11,1,≥ 5]]5. This QECC has the same length and dimension [[11,1,≥ 4]]5 appeared in [15].

Example 4.3

Let (r, n, q) = (12,61,9), S1 = {i, i + 1} and S2 = {i}, we have that \(q\in D_{0}^{(12,61)}\). Let \(C_{(i,S_{1})}=\langle d_{i}(x)d_{i+1}(x)\rangle \) with parameters [61,56,4] and \(C_{(i,S_{2})}=\langle d_{i}(x)\rangle \) with parameters [61,51,6]. We get a QECC with parameters [[61,46,≥ 5]]9. This QECC has the same minimum distance [[64,48,≥ 5]]5 appeared in [19]. However, our QECC has larger code rate.

Next we give more new QECCs in Table 2. Our QECCs have the larger minimum distance with the same code rate or the larger code rate with the same minimum distance than know ones.

Table 2 New QECCs

Note that some QECCs have parameters satisfying n + 2 − 2dk ≤ 2 in Table 2. The QECCs with parameters [[11,1,≥ 5]]3 and [[73,52,≥ 7]]8 in Table 2 have same parameters in recent literature, but we use different classical codes.

4.2 QSCs from Cyclotomic Codes

In this subsection, we give the basic concept and results of QSCs. Furthermore, from the cyclic codes obtained in Section 3 and their augmented cyclic codes, we get a class of QSCs .

A (cl,cr)-[[n, k]] is a quantum stabilizer code that corrects not only bit errors and phase errors but also misalignment to the left by cl qubits and to the right by cr qubits for nonnegative integers cl and cr. The desired QSCs not only seamlessly achieve quantum error correction and synchronization recovery, but also correct linear combinations of I, X, Z, and Y that act on physical qubits. As we all know, the QSCs have been proved to be well apply in the quantum domain. They allow to extract the information about the magnitude and direction of misalignment and simultaneously correcting the Pauli errors on qubits, with nondisturbing measurement involved. For more details of QSCs, we can refer to articles [5, 16, 23].

The general method of constructing QSCs directly exploits classical codes with special containing properties over finite fields. We give the following lemma that can be found in [16].

Lemma 4.4

Let D1 = 〈g1(x)〉 be a dual-containing [n, k1,d1]q cyclic code and D2 = 〈g2(x)〉 be a D1-containing [n, k2,d2]q cyclic code with k2 > k1 i.e., \(D_{1}^{\perp }\subseteq D_{1}\subseteq D_{2}\). Define the polynomial f(x) of degree k2k1 to be the quotient of g1(x) divided by g2(x). Then for any pair of non-negative integers (cl,cr) such that cl + cr < ord(f(x)), there exists an (cl,cr)-[[n + cl + cr,2k1n]]q QSC that corrects at least up to \(\lfloor \frac {d_{1}-1}{2}\rfloor \) bit errors and at least up to \(\lfloor \frac {d_{2}-1}{2}\rfloor \) phase errors.

The resulting 2(nk2) Pauli operators on n qubits form stabilizer generators \(S_{D_{2}}\) of the Pauli group on n qubits that fixes a subspace of dimension \(q^{k_{2}}\). Let \(S_{D_{2}}^{Z}\) denote the set of the Pauli operators on n qubits in \(S_{D_{2}}\), which include Z s and I s. Let \(S_{D_{2}}\) be an encoder CSS code with parameters [[n,2k2n]]. Let \(R = \{r_{i} (x)|0 < i \leq q^{2k_{2}- n}\}\) be a system of representatives of the cosets \(D_{2}/D_{2}^{\perp }\). For any (2k2n)-qubit state |ψ〉, we encode the state |ψ〉 into n-qubit state \(|\psi \rangle _{enc}={\sum }_{i}\alpha _{i} |\nu _{i}\rangle \), where each νi is an n-dimensional vector with the orthogonal basis being \(\{|D_{2}^{\perp } + r_{i}(x)| r_{i}(x) \in R\}\). Let Ug denote the unitary operator that adds the coefficient vector g2 of the generator polynomial g2(x). Then we have \(U_{g}|\psi \rangle _{enc} ={\sum }_{i} \alpha _{i} |\nu _{i} +g_{2}\rangle \).

Through a unitary transformation using \(S_{D_{2}}^{Z}\), we can obtain the error syndrome for the window in the same way as when detecting errors with the CSS code defined by \(S_{D_{2}}\) as follows \(E|\psi \rangle _{enc} |0\rangle ^{\otimes n-k_{2}} \rightarrow E|\psi \rangle _{enc} |\chi \rangle \), where |χ〉 is the (nk2)-qubit syndrome by \(S_{D_{2}}^{Z}\) and E is the n-fold tensor product of linear combinations of the Pauli matrices. If E introduced at most \(\lfloor \frac {d_{2} -1}{2}\rfloor \) bit errors on qubits, these quantum errors are detected and then corrected by applying the X operators accordingly. We can refer to [5, 6, 16] for more information of encoding and decoding.

From Section 3, we obtain some cyclic codes C(i, S) and C in Lemma 3.7 with the same length that satisfies C(i, S)C. These cyclic codes is a good source to construct QSCs. Put C(i, S) = D1 and C = D2, then we can get positive dimension QSCs if \(k_{2}> k_{1}>\lceil \frac {n}2\rceil \) by Lemma 4.4.

From Lemma 4.4, for a QSC, there are four important parameters ar, al, d1 and d2, which determine the performance of a QSC. It is clear that the order of the polynomial f(x) is n for f(x)|(xn − 1) and n is an odd prime, where the polynomial f(x) is defined in Lemma 4.4. And we know that the upper bound of the tolerable magnitude of the QSCs are its length n.

From Table 1, It is known that the cyclic codes obtained are usually optimal or almost optimal. Then we can construct many QSCs, which possess good error-correcting capability toward bit error and phase error. What’s more, the synchronization capability of those QSCs attain the upper bound. Next we give following theorems.

Theorem 4.5

Letnbe an odd prime withnr + 1 (mod 2r), whereris a positive even integer. We always assume that\(q\in D_{0}^{(r,n)}\), s = |S| andis the order ofqmodulon. Then for any nonnagetive integercrandclsuch thatcr + cl < n, the following sentences are hold.

  1. (1)

    Ifs = 1 and\(e=\frac {n-1}{r\ell }\geq 2\), there exists a QSC with parameters\((c_{r},c_{l})-[[n+c_{r}+c_{l},\frac {(r-2)n+2}{r}+2p\ell ]]_{q}\), where\(0\leq p\leq e-2=\frac {n-2r\ell -1}{r\ell }\).

  2. (2)

    Ifs > 1, there exists a QSC with parameters\((c_{r},c_{l})-[[n+c_{r}+c_{l},\frac {(r-2s)n+2s}{r}+2p\ell ]]_{q}\), where\(0\leq p\leq es-2=\frac {s(n-1)-2r\ell }{r\ell }\).

Proof

(1) If s = 1, we have that the generator giS(x) of C(i, S) has more than one irreducible factor if and only if \(e=\frac {n-1}{r\ell }\geq 2\). From Lemma 3.7, the C = 〈g(x)〉 and \(g(x)=g_{iS}(x)/{\prod }_{k\in B}m_{k}(x)\), where B is some proper subset of Ti. Let p be the cardinality of B, where \(0\leq p \leq e-2=\frac {n-2r\ell -1}{r\ell }\). Then the cyclic code C has parameters \([n, \frac {(r-1)n+1}{r}+p\ell ]\). Let \(C^{\prime }=\langle g^{\prime }(x)\rangle \) and \(g^{\prime }(x)=g_{iS}(x)/{\prod }_{k\in B^{\prime }}m_{k}(x)\), where \(B\subset B^{\prime }\subset T_{i}\). It is clear that \(C\subset C^{\prime }\). By using the pair cyclic codes \((C,C^{\prime })\) and Lemma 4.4, there exists a QSC with parameters \((c_{r},c_{l})-[[n+c_{r}+c_{l},\frac {(r-2)n+2}{r}+2p\ell ]]\), where \(0\leq p \leq e-2=\frac {n-2r\ell -1}{r\ell }\) and cr and cl are arbitrary integers such that cr + cl < n.

(2) If s > 1, we have that the generator giS(x) of C(i, S) always has more than one irreducible factor. From Lemma 3.7, the C = 〈g(x)〉 and \(g(x)=g_{iS}(x)/{\prod }_{k\in B}m_{k}(x)\), where B is some proper subset of \(\bigcup _{k\in S}T_{k}\). Let p be the cardinality of B, where \(0\leq p \leq es-2=\frac {s(n-1)-2r\ell }{r\ell }\). Then the cyclic code C has parameters \([n, \frac {(r-s)n+s}{r}+p\ell ]\). Let \(C^{\prime }=\langle g^{\prime }(x)\rangle \) and \(g^{\prime }(x)=g_{iS}(x)/{\prod }_{k\in B^{\prime }}m_{k}(x)\), where \(B\subset B^{\prime }\subset \bigcup _{k\in S}T_{k}\). It is clear that \(C\subset C^{\prime }\). By using the pair cyclic codes \((C,C^{\prime })\) and Lemma 4.4, there exists a QSC with parameters \((c_{r},c_{l})-[[n+c_{r}+c_{l},\frac {(r-2s)n+2s}{r}+2p\ell ]]\), where \(0\leq p \leq es-2=\frac {s(n-1)-2r\ell }{r\ell }\) and cr and cl are arbitrary integers such that cr + cl < n. This completes the proof. □

Remark 2

The QSCs constructed in Theorem 4.5 provide the highest possible tolerance against synchronization errors since ord(f(x)) = n.

Example 4.6

Let (r, n, q) = (2,19,7) and S = {i}, we have that \(q\in D_{0}^{(2,19)}\), e = = 3, T0 = {1,4,5} and T1 = {2,8,10}. Let C = 〈di(x)〉 with parameters [19,10,8] for i ∈{0,1}. Let \(C^{\prime }=\langle d_{i}(x)/m_{j}(x)\rangle \) with parameters [19,13,4] for jTi. Let \(C^{\prime \prime }=\langle d_{i}(x)/m_{j}(x)m_{k}(x)\rangle \) with parameters [19,16,3] for jkTi. It is clear that \(C\subset C^{\prime }\subset C^{\prime \prime }\). By the (1) of Theorem 4.5, for \((C, C^{\prime })\), we get a QSC with parameters (cr,cl) − [[19 + cr + cl,1]]7 that corrects at least up to 3 bit errors and at least up to 1 phase errors, where cr + cl < 19. Similarly, for \((C^{\prime }, C^{\prime \prime })\), we get a QSC with parameters (cr,cl) − [[19 + cr + cl,7]]7 that corrects at least up to 1 bit errors and at least up to 1 phase errors, where cr + cl < 19.

Example 4.7

Let (r, n, q) = (6,31,2), s1 = |S1| > 0 and s2 = |S2| > 0, we have that \(q\in D_{0}^{(3,19)}\) and e = 1. We obtain the pair of cyclic codes \(C_{(i,S_{1})}\) and \(C_{(i,S_{2})}\) for \(S_{1}\subseteq S_{2}\). It is clear that \(C_{(iS_{2})}\subset C_{(iS_{1})}\). By the (2) of Theorem 4.5, we get a QSC with parameters (cr,cl) − [[31 + cr + cl,31 − 10s2 + 10p]]2, where cr + cl < 31, 0 ≤ ps2 − 2 and 2 ≤ s2 ≤ 3. For example, let (s1,s2) = (1,2), then \(C_{(iS_{1})}\) and \(C_{(iS_{2})}\) have parameters [31,26,3] and [31,21,5], respectively. Then the QSC has parameters (cr,cl) − [[31 + cr + cl,11]]2 that corrects at least up to 2 bit errors and at least up to 1 phase errors, where cr + cl < 31.

5 Conclusion

In this paper, we obtained many optimal or almost optimal dual-containing cyclic codes from the cyclotomic classes of order r. Numerical data showed that in general the parameters of these codes seems good comparing with the Database. These cyclic codes is a great source to construct QECCs and QSCs. Furthermore, we constructed some new QECCs. And we obtained many QSCs with good error-correcting ability toward bit errors and phase errors. It is interesting problem to construct more good QECCs and QSCs in future.