1 Introduction

Quantum error-correcting codes (QCs for short) originated from the pioneering work of Shor [1] and Steane [2] to protect quantum information from decoherence and quantum noise. Since then, the theory of QCs has been extensively studied in the literature (see [3,4,5,6,7,8,9,10], for instance). The most widely investigated subclass of codes is quantum stabilizer codes since they are associated with a group-theoretical structure. Their construction can be reduced to find classical self-orthogonal error-correcting codes over the finite field \(\mathbb {F}_{q}\) or \(\mathbb {F}_{q^{2}}\) with certain inner product [3, 4, 6,7,8,9].

From now on, we assume q is a prime power and \(\gcd (n, q)=1\) in the rest of this paper. Let \(\mathbb {F}_{q^{2}}\) be a finite field with \(q^{2}\) elements and \(\mathbb {F}_{q^{2}}^{*}=\mathbb {F}_{q^{2}}\backslash \{0\}\). For each \(\alpha \in \mathbb {F}_{q^{2}}\), the conjugation of \(\alpha \) is denoted by \(\overline{\alpha }=\alpha ^{q}\). Given two vectors \(\mathbf {x}=(x_{1},x_{2},\ldots ,x_{n})\) and \(\mathbf {y}=(y_{1},y_{2},\ldots ,y_{n})\in \mathbb {F}_{q^{2}}^{n}\), their Hermitian inner product is defined by

$$\begin{aligned} (\mathbf {x},\mathbf {y})_{h}=\sum \overline{x_{i}}y_{i} =\overline{x_{1}}y_{1}+\overline{x_{2}}y_{2}+\cdots +\overline{x_{n}}y_{n}. \end{aligned}$$

For a linear code \(\mathcal {C}\) over \(\mathbb {F}_{q^{2}}\) of length n, the Hermitian dual code of \(\mathcal {C}\) is denoted as \(\mathcal {C}^{\bot _{h}}\), where \(\mathcal {C}^{\bot _{h}}\) is defined by

$$\begin{aligned} \mathcal {C}^{\bot _{h}}=\{x\in \mathbb {F}_{q^{2}}^{n} | (x,y)_{h}=0, \forall y\in \mathcal {C}\}. \end{aligned}$$

If \(\mathcal {C}^{\bot _{h}} \subseteq \mathcal {C}\), then \(\mathcal {C}\) is called a Hermitian dual-containing code, and \(\mathcal {C}^{\bot _{h}}\) is called a Hermitian self-orthogonal code.

One of the most frequently used construction methods is the following Hermitian Construction.

Theorem 1

([3, 6, 8] Hermitian Construction) If \(\mathcal {C}=[n,k,d]_{q^{2}}\) is a classical linear code over \(\mathbb {F}_{q^{2}}\) such that \(\mathcal {C}^{\bot _{h}}\subseteq \mathcal {C}\), then there exists a q-ary \([[n,2k-n,\ge d]]_{q}\) quantum code, where \(\mathcal {C}^{\bot _{h}}\) is the Hermitian dual code of \(\mathcal {C}\).

To obtain q-ary QCs by Theorem 1, one only needs to find linear codes \(\mathcal {C}\) over \(\mathbb {F}_{q^{2}}\) such that \(\mathcal {C}^{\bot _{h}} \subseteq \mathcal {C}\). From this idea, many Hermitian dual-containing constacyclic codes (including cyclic codes and negacyclic codes) have been applied to construct QCs with good parameters in recent years [11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]. In [11, 12], Aly et al. studied Hermitian dual-containing conditions of BCH codes and constructed many q-ary quantum BCH codes in general. More recently, Yuan et al. [23] have constructed QCs from constacyclic BCH codes of length \(n=\frac{q^{2m}-1}{q+1}\). Zhu et al. [24] obtained QCs from negacyclic BCH codes of length \(n=\frac{q^{2m}-1}{q-1}\). In [25], some quantum BCH codes with \(n=r\frac{q^{2m}-1}{q^2-1}\) and \(r|(q^2-1)\) were obtained.

This article is dedicated to Hermitian dual-containing condition of non-narrow-sense constacyclic codes (including cyclic codes and negacyclic codes) with lengths \(n=\frac{q+1}{r}(q^2+1)\) and \(n=\frac{q-1}{b}(q^2+1)\) and aims at constructing new quantum constacyclic BCH codes with good parameters from such codes. Most of the newly obtained codes have better parameters than QCs available in [12, 23,24,25] for the case \(m=2\) and quantum twisted codes (QTCs) listed in code tables of [33]. Moreover, some of our QCs have larger designed distances than the known ones in [12, 23,24,25].

The paper is organized as follows. In Sect. 2, some basic concepts on \(q^{2}\)-cyclotomic cosets and \(\eta \)-constacyclic codes are reviewed. In Sects. 3 and 4, new constructions of QCs with lengths \(n=\frac{q+1}{r}(q^2+1)\) and \(n=\frac{q-1}{b}(q^2+1)\) are presented, respectively. In Sect. 5, code comparisons are provided and the final remarks are drawn.

2 Preliminaries

In this section, we introduce some basic notions and results regarding Hermitian dual-containing codes, \(\eta \)-constacyclic codes and cyclotomic cosets for the purpose of this paper. For more details, see [28,29,30,31].

2.1 Review of constacyclic codes

For any vector \((c_{0},c_{1},\ldots ,c_{n-1})\in \mathbb {F}_{q^{2}}^{n}\) and \(\eta \in \mathbb {F}_{q^{2}}^{*}\), an \(\eta \)-constacyclic shift \(\tau _{\eta }\) on \(\mathbb {F}_{q^{2}}^{n}\) is \(\tau _{\eta }(c_{0}, c_{1}, \ldots , c_{n-1})=(\eta c_{n-1}, c_{0},\ldots , c_{n-2}).\) A \(q^{2}\)-ary linear code \(\mathcal {C}\) of length n is called \(\eta \)-constacyclic code if it is invariant under the \(\eta \)-constacyclic shift \(\tau _{\eta }\) on \(\mathbb {F}_{q^{2}}^{n}\). When \(\eta =1\), \(\eta \)-constacyclic codes are cyclic codes, and when \(\eta =-1\), \(\eta \)-constacyclic codes are negacyclic codes. For an \(\eta \)-constacyclic code \(\mathcal {C}\), each code word \(c = (c_{0}, c_{1}, \ldots , c_{n-1})\) is customarily represented in its polynomial form: \(c(x) = c_{0} + c_{1}x + \cdots + c_{n-1}x^{n-1}\). Then, \(\mathcal {C}\) is in turn identified with the set of all polynomial representations of its code words. From [16, 17, 27, 28], one can know that a linear code \(\mathcal {C}\) of length n over \(\mathbb {F}_{q^{2}}\) is \(\eta \)-constacyclic if and only if \(\mathcal {C}\) is an ideal of the quotient ring \(\mathcal {R}_{n}=\mathbb {F}_{q}[x]/(x^{n}-\eta )\), and xc(x) corresponds to an \(\eta \)-constacyclic shift of c(x) in \(\mathcal {R}_{n}\). It follows that \(\mathcal {C}\) is generated by a monic factor of \((x^{n}-\eta )\), i.e., \(\mathcal {C}=\langle g(x) \rangle \) and \(g(x)|(x^{n}-\eta )\). g(x) is called the generator polynomial of \(\mathcal {C}\). The dimension of \(\mathcal {C}\) is \(n-k\), where \(k=\deg (g(x))\). It can be verified that the Hermitian dual \(\mathcal {C} ^{\perp _{h}}\) of an \(\eta \)-constacyclic code \(\mathcal {C}\) over \(\mathbb {F}_{q^{2}}\) is an \(\bar{\eta }^{-1}\)-constacyclic code [16, 17].

Let \(\omega \) be a primitive element of \(\mathbb {F}_{q^{2}}\), take \(\eta =\omega ^{\upsilon (q-1)}\) for some \(\upsilon \in \{0,1,\ldots ,q\}\). In this case, we have \(\eta \bar{\eta }=1\), so the Hermitian dual \(\mathcal {C} ^{\perp _{h}}\) of \(\mathcal {C}\) is also an \(\eta \)-constacyclic code. In particular, if \(\upsilon =0\), the class of \(\eta \)-constacyclic codes is cyclic codes; if q is an odd prime power and \(\upsilon =(q+1)/2\), the class of \(\eta \)-constacyclic codes is negacyclic codes. Since \(\eta ^{q+1}=1\), the order r of \(\eta \) in \(\mathbb {F}_{q^{2}}^{*}\) is equal to \(\frac{q+1}{gcd(\upsilon ,q+1)}\). Let \(\zeta \) be a primitive rn-th root of unity in some extension field of \(\mathbb {F}_{q^{2}}\) such that \(\zeta ^{n}=\eta \). Let \(\xi =\zeta ^{r}\). Then, \(\xi \) is a primitive n-th root of unity. It follows that the roots of \(x^{n}-\eta \) are \(\zeta \xi ^{j}=\zeta ^{1+jr}\) for \(0\le j\le n-1\). Set \(\varOmega = \varOmega _{r,n}=\{1+jr|0\le j\le n-1\}\). The defining set T of a constacyclic code \(\mathcal {C}=\langle g(x) \rangle \) of length n is the set \(T=\{j\in \varOmega \mid \zeta ^{j}\hbox { is a root of g(x)}\}\). For each \(i\in \varOmega \), let \(C_{i}\) be the \(q^{2}\)-cyclotomic coset modulo rn containing i and be denoted by

$$\begin{aligned}C_{i}=\{{i,iq^{2},i(q^{2})^{2},\ldots ,i(q^{2})^{e-1}}\} \bmod rn,\end{aligned}$$

where e is the smallest positive integer such that \(i(q^{2})^{e}\equiv i\bmod rn\). It is easy to see that the defining set T is a union of some \(q^{2}\)-cyclotomic cosets modulo rn (see [17, 28]).

Let \(\delta \) be an integer with \(2\le \delta \le n\), an \(\eta \)-constacyclic BCH (CBCH, for short) code \(\mathcal {C}\) of length n with designed distance \(\delta \) is an \(\eta \)-constacyclic code with defining set

$$\begin{aligned}T=\bigcup \limits _{i=0}^{\delta -2} C_{b+ir},\end{aligned}$$

where \(C_{b+ir}\) is the \(q^{2}\)-cyclotomic coset modulo rn containing \(b+ir\). When \(b=1\), \(\mathcal {C}\) is called a narrow-sense CBCH code, otherwise, a non-narrow-sense CBCH code.

According to the following BCH bound for \(\eta \)-constacyclic codes (see [27, 28]), a CBCH code \(\mathcal {C}\) of designed distance \(\delta \) has minimum distance at least \(\delta \).

Lemma 1

(The BCH bound for \(\eta \)-constacyclic codes) Let \(\mathcal {C}\) be a \(q^{2}\)-ary \(\eta \)-constacyclic code of length n with generator polynomial g(x). If g(x) has its elements \(\{\beta ^{1+ri}|0\le i \le \delta -2\}\) as the roots, where \(\beta \) is a primitive rn-th root of unity, then the minimum distance of code \(\mathcal {C}\) is at least \(\delta \).

2.2 Description of Hermitian dual-containing conditions by cyclotomic cosets

It is well known that there is a close relationship between cyclotomic cosets and cyclic codes; see [29,30,31,32]. The definitions of symmetric coset and asymmetric coset pairs for 2-cyclotomic cosets were first given in [32] to characterize binary self-dual cyclic codes and were generalized further in [14, 15] to characterize \(q^{2}\)-ary Hermitian self-orthogonal cyclic codes. Now we give the skew symmetric property of cyclotomic cosets. For each \(i \in \varOmega \), let \(C_{i}\) be the \(q^{2}\)-cyclotomic coset modulo rn containing i.

A cyclotomic coset \(C_{i}\) is called skew symmetric if \(-qi \bmod rn \in C_{i}\), and skew asymmetric, otherwise. Skew asymmetric cosets \(C_{i}\) and \(C_{-qi}\) come in pairs, and we use \((C_{i},C_{-qi})\) to denote such a skew asymmetric pair (SAP, for short). In [17], Kai et al. have shown that an \(\eta \)-constacyclic code \(\mathcal {C}\) with defining set T contains its Hermitian dual if and only if \(T \cap T^{-q}=\emptyset \), where \(T^{-q}=\{-qi \bmod rn \mid i\in T \}\). Using terminologies of skew symmetric coset and SAP, an equivalent statement can be given as in Lemma 2.2 of [14]. We list these two equivalent statements in the following lemma for later use.

Lemma 2

If \(\mathcal {C}\) is an \(\eta \)-constacyclic code of length n over \(\mathbb {F}_{q^{2}}\) with defining set T, then \(\mathcal {C} ^{\perp _{h}} \subseteq \mathcal {C}\) if and only if one of the following holds:

  1. 1.

    \(T \cap T^{-q}=\emptyset \), where \(T^{-q}=\{-qi \bmod rn \mid i\in T\}\).

  2. 2.

    For each \(i\in T\), \(C_{i}\) is a skew asymmetric coset; if \(j\in T\) and \(j\not \in C_{i}\), then \(C_{j}\) and \(C_{i}\) cannot form a skew asymmetric pair.

2.3 Notations and a preliminary result

Firstly, to simplify the following discussions, we give some notations here.

Notation: Denote the set \(\{ b,b+1,\ldots ,e\}\) by [be]. Given four integers srj and i, where \(j\le i\) and \(r|(q+1)\), we use \([j,i;r]_{s}\) to denote the following set

$$\begin{aligned}{}[j,i;r]_{s}=C_{s+jr}\cup C_{s+(j+1)r}\cup C_{s+(j+2)r}\cup \cdots \cup C_{s+ir}. \end{aligned}$$

Next, we give some results on skew asymmetric coset and SAP for our main work in the subsequent sections.

Lemma 3

Let \(\hbox {ord}_{rn}(q^2)=2\) and \(i, j\in \varOmega \). If \(i\ne j\), then the following hold:

  1. 1.

    The cardinality of \(C_{i}\) is at most 2.

  2. 2.

    \(C_{i}=C_{j}\) if and only if \(iq^{2}\equiv j\bmod rn\), which is equivalent to \(jq^{2}\equiv i\bmod rn\).

  3. 3.

    \(C_{i}\) is skew symmetric if and only if \(i(q+1) \equiv 0\bmod rn\).

  4. 4.

    (\(C_{i}\), \(C_{j}\)) is a SAP if and only if \(i+ jq \equiv 0\bmod rn\) or \(j + iq\equiv 0\bmod rn\).

Proof

1. Since \(\hbox {ord}_{rn}(q^2)=2\), from definition, one can easily know that \(|C_{i}|\) is at most 2.

2. By (1), we assume that \(C_{i}=\{i, iq^2\}\). When \(i\ne j\), it is obvious that \(C_{i}=C_{j}\Leftrightarrow iq^{2}\equiv j\bmod rn\). Since \(iq^{2}\cdot q^{2}=i(q^4-1+1)\equiv i\), we have

$$\begin{aligned} iq^{2}\equiv j\bmod rn \Leftrightarrow iq^{2}\cdot q^{2} \equiv i\equiv jq^{2} \bmod rn. \end{aligned}$$

3. Assume \(C_{i}=\{i, iq^2\}\). If \(C_{i}\) is skew symmetric, then \(-qi\equiv i\bmod rn\) or \(-qi\equiv iq^2\bmod rn\). It is obvious that \(-qi\equiv i\bmod rn \Leftrightarrow i(q+1) \equiv 0\bmod rn\). From gcd\((q,rn)=1\), one can deduce \(-qi\equiv iq^2\bmod rn \Leftrightarrow i(q+1) \equiv 0\bmod rn\). Hence, (3) holds.

4. By (1), put \(C_{i}=\{i, iq^2\}\). From definition, we know (\(C_{i}, C_{j}\)) is a SAP if and only if \(i\equiv -jq\bmod rn\) or \(i \equiv -jq^3\bmod rn\). Notice that \(i \equiv -jq^3\bmod rn \Leftrightarrow iq \equiv -jq^3\cdot q \equiv -j \bmod rn\). This completes the proof of (4). \(\square \)

3 Construction of new QCs of length \(n=\frac{q+1}{r}(q^2+1)\)

In this section, let q be an odd prime power, \(r\mid (q+1)\) and \(1\le r\le \frac{q+1}{2}\). Then, \(q+1=r r'\), \(r'\ge 2\) and \(n=r'(q^2+1)\). It is easy to check \(s=\frac{q^{2}+1}{2}=1+r'\cdot \frac{q-1}{2}\cdot r\) \(\in \varOmega _{r,n}=\{1+jr|0\le j\le n-1\}\), and \( \frac{q^{2}-1}{2r}=r'\frac{q-1}{2}\). We can define a defining set \(T=[-\frac{q^{2}-1}{2r},\frac{q^{2}-1}{2r};r]_{s}=[-r'\frac{q-1}{2},r'\frac{q-1}{2};r]_{s} \subseteq \varOmega _{r,n}.\)

Lemma 4

Let \(q,r,r',n,s\) and T be given as above. If \(-\frac{q^{2}-1}{2r}\le i, j \le \frac{q^{2}-1}{2r}\) and \(i\ne j\), then the following hold:

  1. 1.

    \(C_{s}=\{s\}\) and each \(C_{s+ir}\) contains two elements if \(i\ne 0\).

  2. 2.

    \(C_{s+ir}=C_{s+jr}\) if and only if \(j=-i\) and \(i\equiv 0 \bmod r'\).

  3. 3.

    Each \(C_{s+ir}\) is skew asymmetric.

  4. 4.

    Any two \(C_{s+ir}\) and \(C_{s+jr}\) cannot form a SAP. Hence, the CBCH code with defining set T is a Hermitian dual-containing code.

Proof

1. If \(C_{x}=\{x\}\) and \(x\in T\), then \(xq^2 \equiv x\bmod rn\). Since \(rn=(q+1)(q^2+1)\) and \(\gcd (q-1,q^2+1)=2\), one can imply \(x(q^2-1) \equiv 0\bmod (q+1)(q^2+1)\) and \(x\equiv 0\bmod \frac{q^2+1}{2}\). From \(x=s+ri\) and \(-\frac{q^{2}-1}{2r}\le i \le \frac{q^{2}-1}{2r}\), we have \(x=s\) and \(C_{s+ir}\) contains two elements for \(-\frac{q^{2}-1}{2r}\le i\le \frac{q^{2}-1}{2r}\) and \(i\ne 0\).

2. According to Lemma 3, \(C_{s+ir}=C_{s+jr}\) if and only if \(s+ir\equiv (s+jr)q^2 \bmod rn\), which is equivalent to that \(i\equiv jq^2 \bmod n\). Since \(n=r'(q^{2}+1)\), we have \(i\equiv jq^2 \bmod n\Leftrightarrow j(q^{2}+1)-(i+j)\equiv 0 \bmod r'(q^{2}+1)\).

Let \(j=ar'+b\), where \(0\le b\le r'-1\) and ab are integers. Then, \(j(q^{2}+1)-(i+j)=ar'(q^{2}+1)+b(q^{2}+1)-(i+j) \equiv b(q^{2}+1)-(i+j) \bmod r'(q^{2}+1)\). From \(-\frac{q^{2}-1}{2r}\le i, j \le \frac{q^{2}-1}{2r}\), one can deduce \(-(q^{2}+1)<-\frac{q^{2}-1}{r}\le i+j\le \frac{q^{2}-1}{r}< q^{2}+1\) and \(-(q^{2}+1)< b(q^{2}+1)-(i+j)<r'(q^{2}+1)\). Thus, \(j(q^{2}+1)-(i+j)\equiv 0 \bmod r'(q^{2}+1)\) implies \(b=0\) and \(j=-i=-ar'\). Then, (2) holds.

3. Since \(1\le s+ir \le q^2\), we have \((s+ir)(q+1)\le (q+1)q^2<rn=(q+1)(q^2+1)\) and then \((s+ir)(q+1)\not \equiv 0 \bmod rn\). From Lemma 3, (3) holds.

4. From \(1\le s+ir, s+jr\le q^2\), one can infer that \((s+ir)+(s+jr)q\le (q+1)q^2<rn=(q+1)(q^2+1)\), and then, \((s+ir)+(s+jr)q\not \equiv 0 \bmod rn\). Also, we know that \((s+jr)+(s+ir)q\not \equiv 0 \bmod rn\). According to Lemma 3, (4) holds. \(\square \)

Now it is sufficient to construct new QCs and calculate their parameters.

Theorem 2

Let \(q,r,r', n,s\) and T be given as above. For \(2\le \delta \le \frac{q^{2}-1}{r}+2\), denote \(|T(\delta )|=2\lceil (\delta -2)(1-\frac{1}{2r'})\rceil +1\). Then, there are a Hermitian dual-containing CBCH code with parameters \([n,n-|T(\delta )|,\ge \delta ]_{q^{2}}\) and an \([[n,n-2|T(\delta )|,\ge \delta ]]_{q}\) QC.

Proof

Consider \(1\le i\le \frac{q^{2}-1}{2r}\). Suppose that \(\mathcal {C}\) is a CBCH code of designed distance \(\delta \) with defining set \(T(\delta )\subseteq T\), where \(T(\delta =2)=C_{s}\) and for \(\delta \ge 3\)

$$\begin{aligned} T(\delta )= \left\{ \begin{array}{lll} [-(i-1),i;r]_{s} &{}\text{ if } \delta =2i+1;\\ {[}-i,i;r]_{s} &{}\text{ if } \delta =2i+2. \end{array} \right. \end{aligned}$$

Since \(C_{s+ir}=C_{s+jr}\) if and only if \(j=-i\) and \(i\equiv 0 \bmod r'\), we get that there are

$$\begin{aligned} \delta -2-\left\lfloor \frac{\delta -2}{2r'}\right\rfloor +1=\left\lceil (\delta -2)(1-\frac{1}{2r'}) \right\rceil +1 \end{aligned}$$

disjoint cosets in \(T(\delta )\). Combining \(C_{s}=\{s\}\) and that the other cosets have cardinality 2, it can be derived that

$$\begin{aligned} |T(\delta )|=2\left\lceil (\delta -2)(1-\frac{1}{2r'}) \right\rceil +1. \end{aligned}$$

By Lemma 4, one can know that \(\mathcal {C}\) is a Hermitian dual-containing CBCH code with parameters \([n,n-|T(\delta )|,\ge \delta ]_{q^{2}}\).

By Theorem 1, using the underlying code \(\mathcal {C}\), one can then construct an \([[n,n-2|T(\delta )|,\delta ]]_{q}\) QC for \(2\le \delta \le \frac{q^{2}-1}{r}+2\). This completes the proof. \(\square \)

4 Construction of new QCs of length \(n=\frac{q-1}{b}(q^2+1)\)

In this section, the construction of QCs of length n will be given, where \(q-1=bb'\) and \(n=\frac{q-1}{b}(q^2+1)=b'(q^2+1)\). We give our discussion in three subsections according to different q.

4.1 \(q=4a+1\ge 5\)

In this subsection, we set \(q=4a+1\ge 5\) and \(2b\mid (q-1)\). Suppose \(s=\frac{a}{b}(q^{2}+1)=\frac{q-1}{2b}\cdot \frac{q^{2}+1}{2}=\frac{n}{4}\), then s is an integer.

We define \(T=[-\frac{(q-1)^{2}}{2b}, \frac{(q-1)^{2}}{2b};r=1]_{s}=[-\frac{(q-1)^{2}}{2b},\frac{(q-1)^{2}}{2b};1]_{\frac{n}{4}}\) and discuss cyclic codes of length n over \(\mathbb {F}_{q^{2}}\) with defining set T.

Lemma 5

Let \(q,b,b',n,s\) and T be given as above. If \(-\frac{(q-1)^{2}}{2b}\le i, j \le \frac{(q-1)^{2}}{2b}\) and \(i\ne j\), then

  1. 1.

    \(C_{s}=\{s\}\) and each \(C_{s+i}\) contains two elements for \(i\ne 0\).

  2. 2.

    \(C_{s+i}\) \(=C_{s+j}\) if and only if \(j=-i\) and \(i\equiv 0\bmod b'\).

  3. 3.

    Each \(C_{s+i}\) is skew asymmetric.

  4. 4.

    Any two \(C_{s+i}\) and \(C_{s+j}\) cannot form a SAP.

Hence, the BCH code with defining set T is a Hermitian dual-containing code.

Proof

1. By definition, for \(x\in T\), \(C_{x}=\{x\}\) if and only if \(xq^2 \equiv x\bmod n\Leftrightarrow xq^2 - x \equiv 0\bmod b'(q^2+1)\Leftrightarrow x(q+1)b\equiv 0\bmod (q^2+1)\). Notice that \(\gcd (q+1,q^2+1)=2\) and \((b,\frac{q^2+1}{2})=1\). It then follows that \(C_{x}=\{x\}\) if and only if \(x\equiv 0\bmod \frac{q^2+1}{2}\). From \(x\in T\), we have \(x=s\). By Lemma 3, we obtain that \(C_{s+i}\) contains two elements for \(i\ne 0\) and \(-\frac{(q-1)^{2}}{2b}\le i\le \frac{(q-1)^{2}}{2b}\).

2. By Lemma 3, \(C_{s+i}=C_{s+j}\) if and only if \(s+i\equiv (s+j)q^2 \bmod n\), which is equivalent to \(i\equiv jq^2 \bmod n\) according to \(s\equiv sq^2 \bmod n\). Note that \(n=b'(q^2+1)\). It is not difficult to derive that \(i\equiv jq^2 \bmod n\Leftrightarrow j(q^{2}+1)-(i+j)\equiv 0 \bmod b'(q^{2}+1)\). Similar to the proof of (2) in Lemma 4, the conclusion can be obtained.

3. Consider that \((s+i)(q+1)=s(q+1)+i(q+1)=\frac{n}{4}(4a+2)+i(q+1)\equiv \frac{n}{2}+i(q+1)\bmod n\). From \(-\frac{(q-1)^{2}}{2b}\le i \le \frac{(q-1)^{2}}{2b}\), it follows that \(|i(q+1)|\le \frac{(q-1)^{2}(q+1)}{2b}< \frac{(q^2+1)(q-1)}{2b}=\frac{n}{2}\). Thus, \(\frac{n}{2}+i(q+1)\not \equiv 0 \bmod n\). Combining Lemma 3, (3) is straightforward.

4. Notice that \(s+i+(s+j)q=s(q+1)+i+jq=\frac{n}{4}(4a+2)+i+jq\equiv \frac{n}{2}+i+jq\bmod n\). Since \(-\frac{(q-1)^{2}}{2b}\le i, j \le \frac{(q-1)^{2}}{2b}\), we have \(|i+jq|\le \frac{(q-1)^{2}(q+1)}{2b}< \frac{(q^2+1)(q-1)}{2b}=\frac{n}{2}\) and then \(\frac{n}{2}+i+jq\not \equiv 0 \bmod n\), i.e., \(s+i+(s+j)q\not \equiv 0 \bmod n\). Analogously, we could obtain \(s+j+(s+i)q\not \equiv 0 \bmod n\) as well. Hence, (4) holds. \(\square \)

Theorem 3

Let \(q,b,b', n,s\) and T be given as above. For \(2\le \delta \le \frac{(q-1)^{2}}{b}+2\), denote \(|T(\delta )|=2\lceil (\delta -2)(1-\frac{1}{2b'}) \rceil +1\). Then, there are a Hermitian dual-containing BCH code with parameters \([n,n-|T(\delta )|,\ge \delta ]_{q^{2}}\) and an \([[n,n-2|T(\delta )|,\ge \delta ]]_{q}\) QC.

Proof

Consider \(1\le i\le \frac{(q-1)^{2}}{2b}\). Suppose that \(\mathcal {C}\) is a BCH code of designed distance \(\delta \) with defining set \(T(\delta )\), where \(T(\delta =2)=C_{s}\) and

$$\begin{aligned} T(\delta )= \left\{ \begin{array}{lll} [-(i-1),i;1]_{s} &{}\quad \text{ if } \delta =2i+1;\\ {[}-i,i;1]_{s} &{}\quad \text{ if } \delta =2i+2. \end{array} \right. \end{aligned}$$

Then, the conclusion can be obtained with reference to the proof of Theorem 2. \(\square \)

4.2 \(q=4a+3\ge 7\)

In this subsection, let \(q=4a+3\ge 7\) be an odd prime power and \(b=1\) or 2. Set

$$\begin{aligned} r= \left\{ \begin{array}{lll} \frac{q+1}{2} &{}\quad \text{ if } b=1;\\ q+1 &{}\quad \text{ if } b=2. \end{array} \right. \end{aligned}$$

Hence, \(rn=\frac{r(q-1)}{b}(q^2+1)=\frac{(q^2-1)(q^2+1)}{2}\). Put \(s=((q+1)a+1)\frac{q^{2}+1}{2}=\frac{(q-1)^{2}}{4}\cdot \frac{q^{2}+1}{2}\). From \(s-1=((q+1)a+1)\frac{q^{2}+1}{2}-1=\frac{(q^{2}+1)(q+1)a}{2}+ \frac{q^{2}-1}{2}\), it follows that \(r|(s-1)\) and \(s\in \varOmega = \varOmega _{r,n}=\{1+jr|0\le j\le n-1\}\). Then, we shall define \(T=[-\frac{(q-1)^{2}}{2b},\frac{(q-1)^{2}}{2b};r]_{s} \subseteq \varOmega \).

Lemma 6

Let \(q,b,b',n,s\) and T be given as above. If \(-\frac{(q-1)^{2}}{2b}\le i, j \le \frac{(q-1)^{2}}{2b}\) and \(i\ne j\), then the following hold:

  1. 1.

    \(C_{s}=\{s\}\) and each \(C_{s+ir}\) contains two elements for \(i\ne 0\).

  2. 2.

    Any two \(C_{s+ir}=C_{s+jr}\) if and only if \(j=-i\) and \(i\equiv 0\bmod b'\).

  3. 3.

    Each \(C_{s+ir}\) is skew asymmetric.

  4. 4.

    Any two \(C_{s+ir}\) and \(C_{s+jr}\) cannot form a SAP.

Hence, the CBCH code with defining set T is a Hermitian dual-containing code.

Proof

1. By definition, for \(x\in T\), \(C_{x}=\{x\}\) if and only if \(xq^2 \equiv x\bmod rn=\frac{(q^2-1)(q^2+1)}{2}\), which is equivalent to that \(x\equiv 0\bmod \frac{q^2+1}{2}\). Thus, from \(x=s+ir\) and \(-\frac{(q-1)^{2}}{2b}\le i \le \frac{(q-1)^{2}}{2b}\), we obtain \(x=s\). Moreover, for \(-\frac{(q-1)^{2}}{2b}\le i\le \frac{(q-1)^{2}}{2b}\) and \(i\ne 0\), by Lemma 3, we obtain that \(C_{s+ir}\) contains two elements.

2. By Lemma 3, for \(i\ne j\), \(C_{s+ir}=C_{s+jr}\) if and only if \(s+ir\equiv (s+jr)q^2 \bmod rn=rb'(q^2+1)\). Note that \(s\equiv sq^2\bmod rn\). The above congruence is equivalent to \(i\equiv jq^2 \bmod b'(q^2+1)\). Similar to the proof of (2) in Lemma 4, the conclusion can be obtained as well.

3. Note that \((s+ir)(q+1)=s(q+1)+ir(q+1)=\frac{(q-1)^{2}}{4}\cdot \frac{q^{2}+1}{2}(q+1)+ir(q+1)\equiv \frac{rn}{2}+ir(q+1)\equiv 0\bmod rn=\frac{(q^2-1)(q^2+1)}{2}\Leftrightarrow \frac{n}{2}+i(q+1)\equiv 0\bmod n\). Analogous to the proof of (3) in Lemma 5, (3) follows.

4. Notice that \(s+ir+(s+jr)q=s(q+1)+ir+jqr=\frac{(q-1)^{2}}{4}\frac{q^{2}+1}{2}(q+1)+ir+jqr\equiv \frac{rn}{2}+ir+jqr\bmod rn=\frac{(q^2-1)(q^2+1)}{2}\).

Since \(\frac{rn}{2}+ir+jqr\equiv 0\bmod rn\Leftrightarrow \frac{n}{2}+i+jq\equiv 0\bmod n\), it is easy to deduce that (4) can be verified. \(\square \)

Theorem 4

Let \(q,b,b',n,s\) and T be given as above. For \(2\le \delta \le \frac{(q-1)^{2}}{b}+2\), denote \(|T(\delta )|=2\lceil (\delta -2)(1-\frac{1}{2b'}) \rceil +1\). Then, there are a Hermitian dual-containing CBCH code with parameters \([n,n-|T(\delta )|,\ge \delta ]_{q^{2}}\) and an \([[n,n-2|T(\delta )|,\ge \delta ]]_{q}\) QC.

Proof

Consider \(1\le i\le \frac{(q-1)^{2}}{2b}\). Suppose that \(\mathcal {C}\) is a CBCH code of designed distance \(\delta \) and defining set \(T(\delta )\), where \(T(\delta =2)=C_{s}\) and

$$\begin{aligned} T(\delta )= \left\{ \begin{array}{lll} [-(i-1),i;r]_{s} &{}\quad \text{ if } \delta =2i+1;\\ {[}-i,i;r]_{s} &{}\quad \text{ if } \delta =2i+2. \end{array} \right. \end{aligned}$$

Then, the conclusion can be obtained similar to the proof of Theorem 2. \(\square \)

4.3 \(q\ge 4\) is a power of 2

In this subsection, let \(q\ge 4\) be a power of 2 and \(1\le b\le \frac{q-1}{3}\), or \(b'\ge 3\). Put

$$\begin{aligned} s= \left\{ \begin{array}{lll} \frac{b'-1}{4}(q^{2}+1) &{}\quad \text{ if } b'\equiv 1\bmod 4\text{; }\\ \frac{3b'-1}{4}(q^{2}+1) &{}\quad \text{ if } b'\equiv 3\bmod 4\text{. } \end{array} \right. \end{aligned}$$

It is easy to see that s is an integer. Suppose that \(u_1=\frac{b'-1}{2}(q-1)=\frac{(q-1)^{2}}{2b}-\frac{q-1}{2}\), \(u_2=\frac{b'+1}{2}(q-1)=\frac{(q-1)^{2}}{2b}+\frac{q-1}{2}\). Define \(T=[-u_1,u_2;r=1]_{s}\). We analyze cyclic codes of length n with defining set T.

Lemma 7

Let \(q,b,b',n,s\) and T be given as above. If \(-u_1\le i, j \le u_2\) and \(i\ne j\), then

  1. 1.

    \(C_{s}=\{s\}\) and each \(C_{s+i}\) contains two elements for \(i\ne 0\).

  2. 2.

    Any two \(C_{s+i}\) \(=C_{s+j}\) if and only if \(j=-i\) and \(i\equiv 0\bmod b'\).

  3. 3.

    Each \(C_{s+i}\) is skew asymmetric.

  4. 4.

    Any two \(C_{s+i}\) and \(C_{s+j}\) cannot form a SAP.

Hence, the BCH code with defining set T is a Hermitian dual-containing code.

Proof

1. By definition, \(C_{x}=\{x\}\) if and only if \(xq^2 \equiv x\bmod n=b'(q^2+1)\). Notice \(xq^2 \equiv x \bmod b'(q^2+1)\Leftrightarrow xb(q+1)\equiv 0\bmod (q^2+1)\) and \((q+1,q^2+1)=1\), \((b,q^2+1)=1\). It follows that \(C_{x}=\{x\}\) if and only if \(x\equiv 0\bmod (q^2+1)\).

Clearly, from \(x\in T\), we obtain that \(x=s\) and \(C_{s+i}\) contains two elements for \(-u_1\le i\le u_2, i\ne 0\) by Lemma 3.

2. By Lemma 3, for \(i\ne j\), we have \(C_{s+i}=C_{s+j}\) if and only if \(s+i\equiv (s+j)q^2 \bmod n=b'(q^2+1)\), which implies that \(i\equiv jq^2 \bmod b'(q^2+1)\) since \(s\equiv sq^2\bmod n\). Similar to the proof of (2) in Lemma 4, the conclusion can be obtained.

3. For either \(b'\equiv 1\bmod 4\) or \(b'\equiv 3\bmod 4\), there holds \(n=b'(q^2+1)\). Then, one can infer that \((s+i)(q+1)=s(q+1)+i(q+1) \equiv \frac{n-q^2-1}{2}+i(q+1)\bmod n\). From \(-u_1\le i \le u_2\), it is easy to get that \(-\frac{n}{2}+\frac{q-1}{b}+\frac{q^2-1}{2}\le i(q+1)\le (\frac{(q-1)^{2}}{2b}+\frac{q-1}{2})(q+1)\le \frac{n}{2}-\frac{q-1}{b}+\frac{q^2-1}{2}\). It follows that \(\frac{q-1}{b}-1\le \frac{n-q^2-1}{2}+i(q+1)\le n-\frac{q-1}{b}+1\). Thus, \((s+i)(q+1)\equiv \frac{n-q^2-1}{2}+i(q+1)\not \equiv 0 \bmod n\). By Lemma 3, (3) holds.

4. Analogous to (3), we get that \(s+i+(s+j)q=s(q+1)+i+jq \equiv \frac{n-q^2-1}{2}+i+jq\bmod n\). Since \(-u_1\le i,j \le u_2\), we have \(-\frac{n}{2}+\frac{q-1}{b}+\frac{q^2-1}{2}\le i+jq\le (\frac{(q-1)^{2}}{2b}+\frac{q-1}{2})(q+1)\le \frac{n}{2}-\frac{q-1}{b}+\frac{q^2-1}{2}\). It follows that \(\frac{q-1}{b}-1\le \frac{n-q^2-1}{2}+i+jq\le n-\frac{q-1}{b}+1\). Clearly, \(\frac{n-q^2-1}{2}+i+jq\not \equiv 0 \bmod n\), which implies that \(s+i+(s+j)q\not \equiv 0\bmod n\). Similarly, we can obtain \(s+j+(s+i)q\not \equiv 0\bmod n\) holds as well. Combining Lemma 3, then (4) follows. \(\square \)

Theorem 5

Let \(q,b,b', n,s\) and T be given as above. For \(2\le \delta \le b'(q-1)+2=\frac{(q-1)^{2}}{b}+2\), denote

$$\begin{aligned} |T(\delta )|= \left\{ \begin{array}{lll} 2\left\lceil (\delta -2)(1-\frac{1}{2b'}) \right\rceil +1 &{}\text{ if } 2\le \delta \le (b'-1)(q-1)+2;\\ 2\left( \delta -2-\frac{q-1-b}{2}\right) +1 &{}\text{ if } (b'-1)(q-1)+3\le \delta \le b'(q-1)+2. \end{array} \right. \end{aligned}$$

Then, there are a Hermitian dual-containing BCH code with parameters \([n,n-|T(\delta )|,\ge \delta ]_{q^{2}}\) and an \([[n,n-2|T(\delta )|,\ge \delta ]]_{q}\) QC.

Proof

We could verify this conclusion by two steps. Suppose that \(\mathcal {C}\) is a BCH code of designed distance \(\delta \) and defining set \(T(\delta )\).

  1. 1.

    Consider \(2\le \delta \le (b'-1)(q-1)+2\) and \(1\le i\le \frac{b'-1}{2}(q-1)\). Set \(T(\delta =2)=C_{s}\) and

    $$\begin{aligned} T(\delta )= \left\{ \begin{array}{lll} [-(i-1),i;1]_{s} &{}\quad \text{ if } \delta =2i+1;\\ {[}-i,i;1]_{s} &{}\quad \text{ if } \delta =2i+2. \end{array} \right. \end{aligned}$$

    Similar to the proof of Theorem 2, we can derive that if \(2\le \delta \le (b'-1)(q-1)+2\), then \(|T(\delta )|=2\lceil (\delta -2)(1-\frac{1}{2b'}) \rceil +1\).

  2. 2.

    For \((b'-1)(q-1)+3\le \delta \le b'(q-1)+2\) and \(\frac{b'-1}{2}(q-1)+1\le i\le \frac{b'+1}{2}(q-1)\). Put \(T(\delta )=[-\frac{b'-1}{2}(q-1),i;1]_{s}\). It follows that \(\delta =\frac{b'-1}{2}(q-1)+i+2\). From (1–2) of Lemma 7, we can derive that there are

    $$\begin{aligned} (\delta -2-\frac{(b'-1)(q-1)}{2b'})+1=\delta -2-\frac{q-1-b}{2}+1 \end{aligned}$$

    disjoint cosets in \(T(\delta )\), of which \(\delta -2-\frac{q-1-b}{2}\) cosets have cardinality 2 besides \(C_{s}=\{s\}\). We naturally have

    $$\begin{aligned} |T(\delta )|=2(\delta -2-\frac{q-1-b}{2})+1. \end{aligned}$$

Thus, \(T(\delta )\) defines a Hermitian dual-containing BCH code with parameters \([n,n-|T(\delta )|,\ge \delta ]_{q^{2}}\), and this code gives an \([[n,n-2|T(\delta )|,\ge \delta ]]_{q}\) QC. \(\square \)

Table 1 Comparisons of quantum codes with \(n=\frac{q+1}{r}(q^2+1)\) over \(\mathbb {F}_q\)
Table 2 Comparisons of quantum codes with \(n=\frac{q-1}{b}(q^2+1)\) and \(r=1\) over \(\mathbb {F}_q\)
Table 3 Comparisons of quantum codes with \(n=\frac{q-1}{b}(q^2+1)\) over \(\mathbb {F}_q\) for \(q=7\)
Table 4 Comparisons of quantum codes with \(n=\frac{q-1}{b}(q^2+1)\) over \(\mathbb {F}_q\)
Table 5 General comparisons of quantum codes with \(n=\frac{q+1}{r}(q^2+1)\) over \(\mathbb {F}_q\) for \(q\ge 5\)
Table 6 General comparisons of quantum codes with \(n=\frac{q-1}{b}(q^2+1)\) over \(\mathbb {F}_q\) for \(q\ge 5\)
Table 7 Actual parameters of some quantum codes

5 Code comparisons and conclusion

In this paper, Hermitian dual-containing conditions of non-narrow-sense \(\eta \)-constacyclic codes of lengths \(n=\frac{q+1}{r}(q^2+1)\) and \(n=\frac{q-1}{b}(q^2+1)\) were deeply investigated. Consequently, applying underlying \(\eta \)-constacyclic codes, we have constructed two families of QCs with good parameters from the Hermitian construction. By comparison, it can be shown that the absolute majority of newly obtained QCs have better performance than the ones available in the literature. On the one hand, some of these QCs have better code rate than QCs obtained in Refs. [12, 23,24,25] and QTCs listed in the code tables given by Yves Edel [33]. On the other hand, some of our QCs have larger maximum designed distances. For clarity, the previous results and some code comparisons are shown below. The following are the known conclusions for the case \(m=2\) given in Refs. [12, 25].

Lemma 8

([12]; Theorem 21) Let \(m=\hbox {ord}_{n}(q^{2})=2\), where q is a power of a prime and \(2\le \delta \le \delta _{max}=\frac{n}{q^{2}+1}\), then there exists a quantum code with parameters \([[n,n-4\lfloor (\delta -1)(1-q^{-2})\rfloor ,\ge \delta ]]_{q}\).

Lemma 9

([25]; Theorem 9) Let \(q\ge 3\) be a prime power and n be an integer such that \(\gcd (n, q^{2})=1\). Assume that \(n=r(q^2+1)\), where \(r \mid (q^2-1), 1\le r \le \frac{q+1}{2}\). Then, there exists an \([[n, n-4r(q-1), d \ge r(q-1)+1]]_{q}\) quantum code.

Remark

Observe that our QCs have the same parameters with QTCs in [33] for \(n=(q+1)(q^2+1)\). Thus, we do not list them in the following tables although they are better than corresponding QCs in [12, 24].

Tables 1, 2, 3 and 4 provide some examples and list code comparisons between QCs in Theorems 234, 5 and QTCs in [33] as well as QCs in Refs. [12, 23,24,25], respectively. From these tables, it is easy to see that our QCs have better performance. Tables 5 and 6 list general code comparisons of lengths \(n=\frac{q+1}{r}(q^2+1)\) and \(n=\frac{q-1}{b}(q^2+1)\) for \(q\ge 5\).

These symbols \(k, k'\) and \(k''\) are denoted as the dimensions of QCs with given length and designed distance in corresponding references, respectively. Additionally, the QC marked with an asterisk “*” has the best parameters among the ones in every row. The symbol “−” implies that there is no QC with given length and designed distance. And “\(\diamondsuit \)” denotes new QCs from our construction.

Utilizing the computer algebra system MAGMA [34], we calculated actual parameters of QCs \([[20,k_{1},\ge \delta ]]_{3}\), \([[52,k_{2},\ge \delta ]]_{5}\), \([[51,k_{3},\ge \delta ]]_{4}\) presented above, for details see Table 7. From this table, one can see all the QCs are non-degenerate, and actual distances of almost all QCs are equal to their designed distances except for the \([[51,37,\ge 5]]_{4}\) code with actual distance 6.

Generally, it is a hard work to determine the minimum distances of these dual-containing codes, their dual codes and the actual parameters of QCs given in Theorems 23, 4 and 5. Yet, we conjecture that all the QCs given in these theorems are non-degenerate, and this is a problem that needs further study.