1 Introduction

Quantum error correcting codes (QECCs) play an important role in quantum computing and quantum communications [3, 27]. Usually, we use \([[n, k, d]]_q\) to denote a q-ary quantum error correcting code (QECC), whose length is n with dimension k and minimum distance d. It can detect up to \(d-1\) quantum errors and correct up to \(\lfloor \frac{d-1}{2}\rfloor \) quantum errors. Similar to the Singleton bound of classical linear codes, there exist quantum Singleton bound \(k\le n-2d+2\). If \(k=n-2d+2\), the QECC is called a quantum maximum-distance separable (QMDS) code. In addition, one of the central topics in quantum coding theory is to construct quantum codes with good parameters, especially QMDS codes. After Calderbank et al. [2] found that QECCs could be constructed from classical self-orthogonal codes with certain inner product, many good works about QECCs and QMDS codes were published [4, 13, 15, 17, 22, 30].

The CSS construction and Hermitian construction are two famous construction methods for QECCs. However, they both require classical codes to be dual-containing or self-orthogonal in most cases, which is not easy to satisfy. This limitation condition form a gap between classical linear codes and QECCs. In 2006, Brun et al. [1] proposed the concept of EAQECCs and solved this problem successfully. They proved that one can construct EAQECCs from arbitrary classical codes if the sender and receiver shared entanglement in advance.

Let q be a prime power. A q-ary EAQECC, denoted by \([[n, k, d; c]]_q\), encodes k information qudits into n channel qudits with the help of c pairs of maximally entangled states and can correct up to \(\lfloor \frac{d-1}{2} \rfloor \) errors, where d is the minimum distance of the code. Similar to QECCs, there exists entanglement-assisted quantum Singleton bound in the following proposition. It’s worth pointing out that Grassl et al. [10] gave a proof of entanglement-assisted quantum Singleton bound for arbitrary q. Therefore, we have the following results for any q.

Proposition 1.1

[1, 9] Assume that \({\mathcal {C}}\) is an entanglement-assisted quantum code with parameters \([[n, k, d; c]]_q\). If \(d\le (n+2)/2 \), then \({\mathcal {C}}\) satisfies the entanglement-assisted Singleton bound

$$\begin{aligned} n+c-k\ge 2(d-1). \end{aligned}$$

If \({\mathcal {C}}\) satisfies the equality \(n+c-k= 2(d-1)\) for \(d\le (n+2)/2\), then it is called an EAQMDS code.

Although it is possible to construct EAQECCs from any classical linear codes in theory, it is not easy to calculate the number of entangled states c. This problem gets solved after Li \({ et~al.}\) proposed the concept of decomposing the defining set [17]. Besides, they used this method to construct some EAQECCs with good parameters [14]. After that, this concept is generated to more general cases, from cyclic codes to negacyclic codes and constacyclic codes [5, 6]. As EAQMDS codes is an important class of quantum codes, a great deal of efforts have been down to construct new EAQMDS codes in recent years. Many new EAQMDS codes with a small number of entangled states c are obtained [7, 11, 12, 16, 18,19,20, 23, 24].

Actually, if we want to correct more quantum errors, the EAQECCs we constructed need to have larger minimum distance. Moreover, the larger the minimum distance of EAQECCs are, the more the entangled states c will be employed. However, it is not an easy task to analyze the accurate parameters if the value of entangled states c is too large or flexible. Recently, some scholars have obtained great progress. Luo et al. obtained several new infinite families of EAQECCs with flexible parameters by using generalized Reed–Solomon codes and extended generalized Reed–Solomon codes [20]. Galindo et al. constructed EAQECCs from Reed-Solomon codes and BCH codes, which gave a completely general formula for c [8]. In [25], Qian and Zhang constructed some new EAQMDS codes with length \(n = q^2+1\) and some new entanglement-assisted quantum almost MDS codes. Besides, Wang et al. got series of EAQECCs with flexible parameters of length \(n = q^2+1\) by using constacyclic codes [28].

Based on the previous work, this paper dedicates to study cyclic codes to construct EAQECCs of lengths \(n=(q^2+1)/a\), \(n=q^2+1\) and \(n=(q^2+1)/2\) with flexible parameters naturally, where \(a=m^2+1\) (\(m\ge 1\) is odd). More precisely, six classes of q-ary EAQECCs are constructed with parameters as follows. Especially, they are EAQMDS codes when \(d\le (n+2)/2\).

The first construction generates four families of EAQECCs of length \(n=(q^2+1)/a\) with the following parameters:

  1. (1)

    \([[n, n-4\alpha (q-m-a\alpha )-4mk, 2(\alpha q+mk)+1; 4\alpha (a\alpha +m)]]_q,\) where \(q=2ak+m\) \((k\ge 1)\) is an odd prime power and \(1\le \alpha \le k\).

  2. (2)

    \([[n, n-4\alpha (q-a-m-a\alpha )-4(a+m)k-(a+2m), 2[\alpha q +(a+m)k+(a+2m)/2]+1; 4\alpha (a\alpha +a+m)+a+2m]]_q,\) where \(q=2ak+a+m\) \((k\ge 1)\) is an odd prime power and \(1\le \alpha \le k\).

  3. (3)

    \([[n, n-4\alpha (q-a+m-a\alpha )-4(a-m)k-(a-2m), 2[\alpha q +(a-m)k+(a-2m)/2]+1; 4\alpha (a\alpha +a-m)+a-2m]]_q\), where \(q=2ak+a-m\) \((k\ge 1)\) is an odd prime power and \(1\le \alpha \le k\).

  4. (4)

    \([[n, n-4\alpha [q-(2a-m)-a\alpha ]-4(2a-m)k-4(a-m), 2[\alpha q+(2a-m)k+2(a-m)]+1; 4\alpha (a\alpha +2a-m)+4(a-m)]]_q,\) where \(q=2ak+2a-m\) \((k\ge 1)\) is an odd prime power and \(1\le \alpha \le k\).

The second construction generates two families of EAQECCs with the following parameters:

  1. (1)

    \([[n, n-4t-2+c, 2t+2; c]]_q\), where \(n=q^2+1\), q be an odd prime power, \(0\le t = (q-1)a+b< s \), \(0 \le a \le (q-1)/2\), \(0 \le b \le q-1\) and

    $$\begin{aligned} c=|Z_1|=\left\{ \begin{array}{ll} 1+4[f(a-1)+b], &{}\quad 1 \le b < 2a.\\ 1+4f(a), &{}\quad 2a \le b \le q-1. \end{array} \right. \end{aligned}$$

    where \(f(a)=a(a+1).\) Besides, if \(t=s,\) we have \(c=n\).

  2. (2)

    \([[n, n-4t-2+c, 2t+2; c]]_q\), where \(n=(q^2+1)/2\), \(q\equiv 1\) mod 2 be an odd prime power, \(0\le t =(q-1)a/2+b\le s \), \(0 \le a \le (q-1)/2\), \(0 \le b \le (q-1)/2\),

    $$\begin{aligned} c=|Z_1|=\left\{ \begin{array}{ll} 1+4[f(a-1)+b], &{}\quad 1 \le b < a.\\ 1+4f(a), &{}\quad a \le b \le (q-1)/2. \end{array} \right. \end{aligned}$$

    where \(f(a)=a(a+1)/2.\)

The main organization of this paper is as follows. In Sect. 2, some basic background and results about cyclic codes and EAQECCs are reviewed. In Sect. 3, we construct six classes of EAQECCs and EAQMDS codes with lengths \(n=(q^2+1)/a\), \(n=q^2+1\) and \(n=(q^2+1)/2\), where \(a=m^2+1\) (\(m\ge 1\) is odd). Sect. 4 concludes the paper.

2 Preliminaries

In this section, we will review some relevant concepts and basic theory on cyclic codes and EAQECCs.

Let \({\mathbb {F}}_{q^2}\) be the finite field with \(q^2\) elements since finite fields are unique up to isomorphism. Additionally, k and n are positive integers. Let \({\mathcal {C}}\) be a \(q^2\)-ary [nkd] linear code of length n with dimension k and minimum distance d, which is a k-dimensional linear subspace of \({\mathbb {F}}_{q^2}^n\). Then \({\mathcal {C}}\) satisfies the following Singleton bound:

$$\begin{aligned} n-k \ge d-1. \end{aligned}$$

When the equality \(n-k=d-1\) holds, then \({\mathcal {C}}\) is called an maximal distance separable (MDS) code. Let vectors \(\mathbf{x } = (x_0,x_1,\ldots ,x_{n-1})\) and \(\mathbf{y } = (y_0,y_1,\ldots ,y_{n-1})\in {\mathbb {F}}_{q^2}^n\), their Hermitian inner product is defined as

$$\begin{aligned} \langle \mathbf{x },\mathbf{y } \rangle _h=\sum _{i=0}^{n-1} {x_i}^qy_i={x_0}^qy_0+{x_1}^qy_1+\cdots +{x_{n-1}}^qy_{n-1}. \end{aligned}$$

The Hermitian dual code of \({\mathcal {C}}\) is defined as

$$\begin{aligned} {\mathcal {C}}^{\perp _h}=\{\mathbf{x } \in {\mathbb {F}}_{q^2}^n~|~\langle \mathbf{x },\mathbf{y } \rangle _h=0~\mathrm{for all}~\mathbf{y }\in {\mathcal {C}}\}. \end{aligned}$$

If \({\mathcal {C}}\subseteq {\mathcal {C}}^{\perp _h}\), then \({\mathcal {C}}\) is called a Hermitian self-orthogonal code. If \({\mathcal {C}}^{\perp _h}\subseteq {\mathcal {C}}\), then \({\mathcal {C}}\) is called a Hermitian dual-containing code.

Let \({\mathcal {C}}\) be a linear code over \({\mathbb {F}}_{q^2}^n\) with length n and \(\mathrm{gcd}(q,n)=1\). If for any codeword \((c_0,c_1,\ldots ,c_{n-1})\in {\mathcal {C}}\) implies its cyclic shift \((c_{n-1},c_0,\ldots ,c_{n-2})\in {\mathcal {C}}\), then \({\mathcal {C}}\) is said to be a cyclic code. For a cyclic code \({\mathcal {C}}\), each codeword \(c=(c_0,c_1,\ldots ,c_{n-1})\) is identified with its polynomial form \(c(x)=c_0+c_1x+\dots +c_{n-1}x^{n-1}\) and cyclic code \({\mathcal {C}}\) of length n is an ideal of \({\mathbb {F}}_{q^2}[x]/\langle x^n-1 \rangle \). Thus, \({\mathcal {C}}\) can be generated by a monic polynomial factor of \(x^n-1\), i.e. \({\mathcal {C}}=\langle g(x) \rangle \) and \(g(x)|(x^n-1)\). Then g(x) is called the generator polynomial of \({\mathcal {C}}\) and the dimension of \({\mathcal {C}}\) is \(n-deg(g(x))\).

Let \(\lambda \) denote a primitive n-th root of unity in some extension field of \({\mathbb {F}}_{q^2}\). Hence, \( x^n-1=\prod _{i=0}^{n-1}(x-\lambda ^i)\). The defining set of cyclic code \({\mathcal {C}}=\langle g(x)\rangle \) of length n is the set \(Z=\{0\le i\le n-1~|~g(\lambda ^i)=0\}\). For \( 0\le i \le n-1\), the \(q^2\)-cyclotomic coset modulo n containing i is defined by the set

$$\begin{aligned} C_i=\{i, iq^2,iq^4,\ldots ,iq^{2(m_i-1)} \}, \end{aligned}$$

where \(m_i\) is the smallest positive integer such that \(iq^{2m_i}\equiv i~mod~n\). Each \(C_i\) corresponds to an irreducible divisor of \(x^n-1\) over \({\mathbb {F}}_{q^2}\). Let \({\mathcal {C}}\) be an [nkd] cyclic code over \({\mathbb {F}}_{q^2}\) with defining set Z. Obviously, Z must be a union of some \(q^2\)-cyclotomic cosets modulo n and \(dim({\mathcal {C}})=n-|Z|\).

For \( 0\le b+\delta -2 \le n-1 \), if \({\mathcal {C}}\) has defining set \(Z_\delta =C_b\cup C_{b+1}\cup \cdots \cup C_{b+\delta -2}\), then it is called cyclic BCH code with designed distance \(\delta \). The well-known BCH bound theorem gives a lower bound for the minimum distance of BCH codes.

Proposition 2.1

[21] (BCH Bound for Cyclic Codes) Let \({\mathcal {C}}\) be a \(q^2\)-ary cyclic code of length n with defining set Z. If Z contains \(d-1\) consecutive elements, then the minimum distance of \({\mathcal {C}}\) is at least d.

Let the conjugation transpose of an \(m\times n\) matrix \(H=(x_{i,j})\) in \({\mathbb {F}}_{q^2}\) is an \(n \times m\) matrix \(H^\dag =({x_{j,i}^q})\). According to literatures [4, 29], EAQECCs can be constructed from arbitrary classical linear codes over \({\mathbb {F}}_{q^2}\), which is given by the following proposition.

Proposition 2.2

[29] If \({\mathcal {C}}\) is an \([n,k,d]_{q^2}\) classical code and H is its parity check matrix over \({\mathbb {F}}_{q^2}\), then there exist entanglement-assisted quantum codes with parameters \([[n,2k-n+c, d; c]]_q\), where \(c = rank(HH^\dag )\).

Because it is not easy to determine the number of entangled states c by computing the rank of \(HH^\dag \), there are scholars put forward the concept of decomposing the defining set of \({\mathcal {C}}\) as follows.

Definition 2.3

Let \({\mathcal {C}}\) be a \(q^2\)-ary cyclic code of length n with defining set Z. Assume that \(Z_1 = Z \cap (-qZ)\) and \(Z_2 = Z\backslash Z_1\), where \(-qZ = \{n - qx~|~x \in Z\}\). Then, \(Z = Z_1 \cup Z_2\) is called a decomposition of the defining set of \({\mathcal {C}}\).

After decomposing the defining set of \({\mathcal {C}}\), there is the following lemma which give a relative easy method to calculate the number of entangled states c.

Lemma 2.4

Let \({\mathcal {C}}\) be a cyclic code with length n over \({\mathbb {F}}_{q^2}\), where \(\gcd (n, q) = 1\). Suppose that Z is the defining set of the cyclic code \({\mathcal {C}}\) and \(Z = Z_1 \cup Z_2\) is a decomposition of Z. Then, the number of entangled states required is \(c = |Z_1|\).

3 Construction of EAQECCs

3.1 EAQECCs with length \(n=(q^2+1)/a\)

In this section, we devote to derive four new classes of EAQECCs from cyclic codes over \({\mathbb {F}}_{q^2}\). Let q be an odd prime power with \(a|(q^2+1)\), where a is even. In this case, we always assume \(n=(q^2+1)/a\), where \(a=m^2+1\) (\(m\ge 1\) is odd), and we consider cyclic codes of length n over \({\mathbb {F}}_{q^2}\). Firstly, we recall the following lemma which is given in [26].

Lemma 3.1

Let \(n=(q^2+1)/a\), where \(a=m^2+1\) (m is odd), then all cyclotomic cosets modulo n containing i are as follows:

$$\begin{aligned} C_i=\{i,-i\}=\{i,n-i\}, \end{aligned}$$

for \(1\le i\le n-1\).

Next, we give a useful lemma which will be used in later constructions.

Lemma 3.2

Let \(n=(q^2+1)/a,~a=m^2+1 ~(m\ge 1~is~odd)\) and \(s=(n-1)/2\), q be an odd prime power with the form \(a|(q\pm m)\). Let \(0\le l\le (m-3)/2 \), when \(m\ge 3\) and \(l=0\), when \(m=1\). Then we have the following results in four cases bellow:

$$\begin{aligned} -qC_{uq+v}={C_{vq-u}}. \end{aligned}$$
  1. (1)

    When \(a|(q-m)\) and \(q=2ak+m\), then \(1\le v\le mk \), if \(0\le u \le k\), or \(mk+1\le v\le 2mk \), \(2(m+1)k+l(2mk+1)+2\le v\le (3m+1)k+l(2mk+1)+1\), \(q-l(2mk+1)-(m+1)k \le v\le q-l(2mk+1)-(2k+1)\), if \( 0\le u \le k-1\).

  2. (2)

    When \(a|(q-m)\) and \(q=2ak+a+m\), then \(1\le v\le (2k+1)m \), \(l(2mk+m+1)+(m+1)(2k+1)+2\le v\le l(2mk+m+1)+(2k+1)(3m+1)/2+1\), if \(0\le u \le k\), or \(q-l(2mk+m+1)-(2k+1)(m+1)/2\le v\le q-l(2mk+m+1)-2(k+1)\), if \( 0\le u \le k-1\).

  3. (3)

    When \(a|(q+m)\) and \(q=2ak+a-m\), then \(l(2mk+m-1)+2k+1\le v\le l(2mk+m-1)+(2k+1)(m+1)/2-1\), if \(0\le u \le k\), or \(q-l(2mk+m-1)-(2k+1)(3m+1)/2+2\le v\le q-l(2mk+m-1)-(m+1)(2k+1)+1\), if \( 0\le u \le k-1\).

  4. (4)

    When \(a|(q+m)\) and \(q=2ak+2a-m\), then \(l[2m(k+1)-1]+2k+2\le v\le [2m(k+1)-1]l+m(k+1)+k \), \(q-l[2m(k+1)-1]-3m(k+1)-k+1 \le v \le q-l[2m(k+1)-1]-(2m+1)(k+1)-k\), \(q-2m(k+1)+1\le v\le q-m(k+1)\) if \(0\le u \le k\), or \(q-m(k+1)+1\le v\le q \) if \( 0\le u \le k-1\).

Proof

(1) Note that \(C_{uq+v}=\{uq+v,-(uq+v)\}\) for \(0\le v\le mk \), if \(0\le u \le k\), or \(mk+1\le v\le 2mk \), \(2(m+1)k+l(2mk+1)+2\le v\le (3m+1)k+l(2mk+1)+1\), \(q-l(2mk+1)-(m+1)k \le v\le q-l(2mk+1)-(2k+1)\), if \( 0\le u \le k-1\), where \(0\le l\le (m-3)/2\), when \(m\ge 3\) and \(l=0\), when \(m=1\).

Since \(-q\cdot (-(uq+v))=uq^2+vq=u(q^2+1)+vq-u\equiv vq-u~ mod~n\). This gives that \(-qC_{uq+v}={C_{vq-u}}\).

The proofs of (2), (3) and (4) are similar to case (1), so we omit it here. \(\square \)

From Lemma 3.2, we can also obtain \(-qC_{jq-t}={C_{tq+j}}\) in each case. The details are as follows:

(1) When \(a|(q-m)\) and \(q=2ak+m\), let \(0\le l\le (m-3)/2\), if \(m\ge 3\) and \(l=0\), if \(m=1\), then \(-qC_{j q-t}={C_{tq+j}}\), \(0\le j\le mk\), if \(0\le t \le k\), or \(mk+1\le j\le 2mk\), \(2(m+1)k+l(2mk+1)+2\le j\le (3m+1)k+l(2mk+1)+1\), \(q-l(2mk+1)-(m+1)k \le j\le q-l(2mk+1)-(2k+1)\), if \(0\le t \le k-1\).

In the case (2), (3) and (4), we have similar results.

Based on the discussions above, we can give the first construction as follows.

Case I \(~~~~{\mathbf{q}}=\mathbf{2ak}+\mathbf{m} \)

In order to obtain the number of entangled states c, we give the following lemma for preparation.

Lemma 3.3

Let \(n=(q^2+1)/a,~a=m^2+1 ~(m\ge 1~is~odd)\), \(s=(n-1)/2\) and \(q=2ak+m~(k\ge 1)\) be an odd prime power. For a positive integer \(1\le \alpha \le k\), let

$$\begin{aligned}&T_{1}= \bigcup _{\begin{array}{c} s+(m+t)k+h+\alpha \le v \le s+ (m+t+2)k+(h-1)-\alpha ,\\ if~ v\le s+mk,~0 \le u\le \alpha ,~else~ 0 \le u\le \alpha -1\\ -m\le t\le (2m-1)m~and~t~is~odd \end{array}}C_{uq+v} \\&when~ -m\le t \le -1,~h=1. \\&when~ 1\le t\le 2m-1,~h=2. \\&when~ 2m+1 \le t \le 4m-1,~h=3. \\&\dots \dots \\&when~ 2(m-1)m+1 \le t \le (2m-1)m,~h=m+1. \end{aligned}$$

Then \(T_1\cap -qT_1=\emptyset \).

The proof of Lemma 3.3 is very complicated and is placed in Appendix. We give the following two examples to illustrate this lemma.

Example 3.1

Let \(m=1\). Then \(a=m^2+1=2\) and \(q=2ak+m=4k +1.\) Let \(1\le \alpha \le k =3.\) We have \(q=13\). Then \(n=(q^2+1)/2=85,~s=(n-1)/2=42\) and \(\alpha =1, 2, 3\) respectively.

(1) Let \(\alpha =1\). According to Lemma 3.3, we can obtain

$$\begin{aligned} \begin{aligned} T_{1}=&\bigcup _{\begin{array}{c} 44\le v \le 45,\\ ~0\le u\le 1 \end{array}}C_{(uq+v)} \cup \bigcup _{\begin{array}{c} 46\le v \le 47 \end{array}}C_{v} \cup \bigcup _{\begin{array}{c} 51\le v \le 54 \end{array}}C_{v}. \end{aligned} \end{aligned}$$

It is easy to check that \(T_1\cap -qT_1=\emptyset \).

(2) Let \(\alpha =2\). According to Lemma 3.3, we can obtain

$$\begin{aligned} \begin{aligned} T_{1}=&\bigcup _{\begin{array}{c} 0\le u\le 2 \end{array}}C_{uq+45} \cup \bigcup _{\begin{array}{c} 0\le u\le 1 \end{array}}C_{uq+46} \cup \bigcup _{\begin{array}{c} 52\le u\le 53,\\ ~0\le u\le 1 \end{array}}C_{uq+v} \cup \bigcup _{\begin{array}{c} 0\le u\le 1 \end{array}}C_{uq+68} \end{aligned} \end{aligned}$$

It is easy to check that \(T_1\cap -qT_1=\emptyset \).

(3) Let \(\alpha =3\). According to Lemma 3.3, we can obtain \(T_{1}=\emptyset \) and hence \(T_1\cap -qT_1=\emptyset \).

Example 3.2

Let \(m=1\). Then \(a=m^2+1=2\) and \(q=2ak+m=4k +1.\) Let \(1\le \alpha \le k =4.\) We have \(q=17\). Then \(n=(q^2+1)/2=145,~s=(n-1)/2=72\) and \(\alpha =1, 2,3,4\) respectively.

(1) Let \(\alpha =1\). According to Lemma 3.3, we can obtain

$$\begin{aligned} \begin{aligned} T_{1}=&\bigcup _{\begin{array}{c} 74\le v \le 76,\\ ~0\le u\le 1 \end{array}}C_{(uq+v)} \cup \bigcup _{\begin{array}{c} 77\le v \le 79 \end{array}}C_{v} \cup \bigcup _{\begin{array}{c} 83\le v \le 88 \end{array}}C_{v}. \end{aligned} \end{aligned}$$

It is easy to check that \(T_1\cap -qT_1=\emptyset \).

(2) Let \(\alpha =2\). According to Lemma 3.3, we can obtain

$$\begin{aligned} \begin{aligned} T_{1}=&\bigcup _{\begin{array}{c} 75\le v \le 76,\\ ~0\le u\le 2 \end{array}}C_{(uq+v)} \cup \bigcup _{\begin{array}{c} 77\le v \le 78,\\ ~0\le u\le 1 \end{array}}C_{uq+v} \cup \bigcup _{\begin{array}{c} 84\le v \le 87,\\ ~0\le u\le 1 \end{array}}C_{uq+v}. \end{aligned} \end{aligned}$$

It is easy to check that \(T_1\cap -qT_1=\emptyset \).

(3) Let \(\alpha =3\). According to Lemma 3.3, we can obtain

$$\begin{aligned} \begin{aligned} T_{1}=&\bigcup _{\begin{array}{c} 0\le u\le 3 \end{array}}C_{(uq+76)} \cup \bigcup _{\begin{array}{c} 0\le u\le 2 \end{array}}C_{uq+77} \cup \bigcup _{\begin{array}{c} 85\le v \le 86,\\ ~0\le u\le 2 \end{array}}C_{uq+v}. \end{aligned} \end{aligned}$$

It is easy to check that \(T_1\cap -qT_1=\emptyset \).

(4) Let \(\alpha =4\). According to Lemma 3.3, we can obtain \(T_{1}=\emptyset \) and hence \(T_1\cap -qT_1=\emptyset \).

Based on Lemma 3.3, we can determine the number of entangled states c in the following theorem.

Theorem 3.4

Let \(n=(q^2+1)/a\), \(a=m^2+1\) \((m\ge 1~is~odd)\), \(s=(n-1)/2\) and \(q=2ak+m\) \((k\ge 1)\) be an odd prime power. For a positive integer \(\alpha \) with \(1\le \alpha \le k\), let \({\mathcal {C}}\) be a cyclic code with defining set Z given as follows

$$\begin{aligned} Z=C_{s+1}\cup C_{s+2}\cup \dots \cup C_{s+(\alpha q+mk)}. \end{aligned}$$

Then \(|Z_{1}|=4\alpha (a\alpha +m)\).

Proof

Let

$$\begin{aligned}&T_{1}= \bigcup _{\begin{array}{c} s+(m+t)k+h+\alpha \le v \le s+ (m+t+2)k+(h-1)-\alpha ,\\ if~ v\le s+mk,~0 \le u\le \alpha ,~else~ 0 \le u\le \alpha -1\\ -m\le t\le (2m-1)m~and~t~is~odd \end{array}}C_{uq+v} \\&when~ -m\le t \le -1,~h=1. \\&when~ 1\le t\le 2m-1,~h=2. \\&when~ 2m+1 \le t \le 4m-1,~h=3. \\&\dots \dots \\&when~ (2m-2)m+1 \le t \le (2m-1)m,~h=m+1. \end{aligned}$$

and

$$\begin{aligned} \begin{aligned} T_1'~~~~&=~~~~~~\bigcup _{\begin{array}{c} s+1\le v \le s+\alpha ,~0\le u\le \alpha \end{array}}C_{uq+v} ~~~~~~~\cup ~~~~~~~~~~\bigcup _{\begin{array}{c} s+2tk+1-\alpha \le v \le s+2tk+\alpha ,\\ 1\le t\le \frac{m-1}{2},~0\le u\le \alpha \end{array}}C_{uq+v}\\&~\cup \bigcup _{\begin{array}{c} s+2tk+\frac{f+3}{2}-\alpha \le v \le s+2tk+\frac{f+1}{2}+\alpha ,\\ \frac{fm+3}{2}\le t \le \frac{(f+2)m-1}{2},\\ 1\le f\le 2m-1~is~odd,~0\le u\le \alpha -1 \end{array}}C_{uq+v} ~\cup ~~~~~~\bigcup _{\begin{array}{c} s+2tk+m+1-\alpha \le v \le s+2tk+m+\alpha ,\\ \frac{(2m-1)m+3}{2}\le t \le m^2,~0\le u\le \alpha -1 \end{array}}C_{uq+v}\\&\cup ~~~~~~\bigcup _{\begin{array}{c} s+2ak+m+1-\alpha \le v \le s+q,\\ 0\le u\le \alpha -1 \end{array}}C_{uq+v} ~~~~~~\cup \bigcup _{\begin{array}{c} s+(gm+1)k+\frac{g+1}{2}-\alpha \le v \le s+(gm+1)k+\frac{g+1}{2}+\alpha ,\\ 1\le g \le 2m-1~is~odd,~0\le u\le \alpha -1 \end{array}}C_{uq+v}. \end{aligned} \end{aligned}$$

From Lemma 3.2, we have

$$\begin{aligned} \begin{aligned} -qT_1'~~~&=~~~~~~~\bigcup _{\begin{array}{c} s+1\le v \le s+\alpha ,~0\le u\le \alpha \end{array}}C_{vq-u} ~~~~~~~\cup ~~~~~~~~~\bigcup _{\begin{array}{c} s+2tk+1-\alpha \le v \le s+2tk+\alpha ,\\ 1\le t\le \frac{m-1}{2},~0\le u\le \alpha \end{array}}C_{vq-u}\\&\cup ~\bigcup _{\begin{array}{c} s+2tk+\frac{f+3}{2}-\alpha \le v \le s+2tk+\frac{f+1}{2}+\alpha ,\\ \frac{fm+3}{2}\le t \le \frac{(f+2)m-1}{2},\\ 1\le f\le 2m-1~is~odd,~0\le u\le \alpha -1 \end{array}}C_{vq-u} \cup ~~~~~~\bigcup _{\begin{array}{c} s+2tk+m+1-\alpha \le v \le s+2tk+m+\alpha ,\\ \frac{(2m-1)m+3}{2}\le t \le m^2,~0\le u\le \alpha -1 \end{array}}C_{vq-u}\\&\cup ~~~~~~\bigcup _{\begin{array}{c} s+2ak+m+1-\alpha \le v \le s+q,\\ 0\le u\le \alpha -1 \end{array}}C_{vq-u} ~~~~~\cup \bigcup _{\begin{array}{c} s+(gm+1)k+\frac{g+1}{2}-\alpha \le v \le s+(gm+1)k+\frac{g+1}{2}+\alpha ,\\ 1\le g \le 2m-1~is~odd,~0\le u\le \alpha -1 \end{array}}C_{vq-u}. \end{aligned} \end{aligned}$$

It is easy to check that \(-qT_1'=T_1'\). From the definitions of Z, \(T_1\) and \(T_1'\), we have \(Z=T_1\cup T_1'\). Then from the definition of \(Z_{1}\),

$$\begin{aligned} \begin{aligned} Z_{1}=Z\cap (-qZ)&=(T_1\cup T_1')\cap (-qT_1\cup -qT_1')\\&=(T_1\cap -qT_1)\cup (T_1\cap -qT_1')\cup (T_1'\cap -qT_1)\cup (T_1'\cap -qT_1')\\&=T_1'. \end{aligned} \end{aligned}$$

Therefore, \(|Z_{1}|=|T_1'|=4\alpha (a\alpha +m)\). \(\square \)

From Lemmas 3.23.3 and Theorem 3.4 above, we can obtain the first construction of EAQECCs in the following theorem.

Theorem 3.5

Let \(n=(q^2+1)/a\), \(a=m^2+1\) \((m\ge 1~is~odd)\), \(s=(n-1)/2\) and \(q=2ak+m\) \((k\ge 1)\) be an odd prime power. There exist EAQECCs with parameters

$$\begin{aligned}{}[[n, n-4\alpha (q-m-a\alpha )-4mk, 2(\alpha q+mk)+1; 4\alpha (a\alpha +m)]]_q, \end{aligned}$$

where \(1\le \alpha \le k\). Moreover, they are EAQMDS codes if \(d\le (n+2)/2\).

Proof

For a positive integer \(1\le \alpha \le k\). Suppose that \({\mathcal {C}}\) is a cyclic code of length \(n=(q^2+1)/a,~a=m^2+1\) (\(m\ge 1\) is odd) and \(s=(n-1)/2\) with defining set

$$\begin{aligned} Z=C_{s+1}\cup C_{s+2}\cup \dots \cup C_{s+(\alpha q+mk)}. \end{aligned}$$

Then the dimension of \({\mathcal {C}}\) is \(n-2(\alpha q+mk)\). Note that cyclic code \({\mathcal {C}}\) have \(2(\alpha q+mk)\) consecutive roots. By Proposition 2.1, the minimum distance of \({\mathcal {C}}\) is at least \(2(\alpha q+mk)+1\). From the Singleton bound, \({\mathcal {C}}\) is an MDS code with parameters \([[n,n-2(\alpha q+mk), 2(\alpha q+mk)+1]]_{q^2}\). Then by Theorem 3.4, we have \(|Z_{1}|=|T_1'|=4\alpha (a\alpha +m)\). From Proposition 2.2 and Lemma 2.4, there are EAQECCs with parameters

$$\begin{aligned}{}[[n, n-4\alpha (q-m-a\alpha )-4mk, 2(\alpha q+mk)+1; 4\alpha (a\alpha +m)]]_q. \end{aligned}$$

It is easy to check that

$$\begin{aligned} n-k+c+2=4(\alpha q+mk)+2=2d. \end{aligned}$$

By Proposition 1.1, it implies that the EAQECCs we constructed are EAQMDS codes when \(d\le (n+2)/2\). \(\square \)

Example 3.3

Let \(m=1\). Then \(a=m^2+1=2\) and \(q=2ak+m=4k +1.\) Let \(1\le \alpha \le k =3.\) We have \(q=13\). Then \(n=(q^2+1)/2=85,~s=(n-1)/2=42\) and \(\alpha =1, 2, 3\) respectively. According to Theorem 3.5, we can obtain EAQECCs:

$$\begin{aligned}{}[[85,33,33;12]]_{13}, [[85,9,59;40]]_{13}, [[85,1,85;84]]_{13}. \end{aligned}$$

Especially, they are EAQMDS codes when \(d\le 43\).

Example 3.4

Let \(m=1\). Then \(a=m^2+1=2\) and \(q=2ak+m=4k +1.\) Let \(1\le \alpha \le k =4.\) We have \(q=17\). Then \(n=(q^2+1)/2=145,~s=(n-1)/2=72\) and \(\alpha =1, 2,3,4\) respectively. According to Theorem 3.5, we can obtain the following EAQECCs:

$$\begin{aligned}{}[[145,73,43;12]]_{17},~~[[145,33,77;40]]_{17},~~[[145,9,111;84]]_{17},~[[145,1,145;144]]_{17}. \end{aligned}$$

Especially, they are EAQMDS codes when \(d\le 73\).

Case II \(~~~~{\mathbf{q= 2ak +a+m}}\)

As for the case that \(n=(q^2+1)/a,~a=m^2+1\) (\(m\ge 1\) is odd) and \(q=2ak+a+m\) \((k\ge 1)\) is an odd prime power, we can produce the following EAQECCs. The proofs are similar to that in the Case I, so we omit it here.

Lemma 3.6

Let \(n=(q^2+1)/a\)\(a=m^2+1\) \((m\ge 1~is~odd)\), \(s=(n-1)/2\) and \(q=2ak+a+m~(k\ge 1)\) be an odd prime power. For a positive integer \(1\le \alpha \le k\), let

$$\begin{aligned} \begin{aligned} T_{1}= \bigcup _{\begin{array}{c} s+t(2k+1)+(h+1)+\alpha \le v \le s+ (t+1)(2k+1)+(h-1)-\alpha ,\\ if~ v\le s+(a+m)k+\frac{a+2m}{2},~0 \le u\le \alpha ,~else~ 0 \le u\le \alpha -1\\ (h-1)m+\gamma _1\le t\le hm-\gamma _2,~1\le h\le m \end{array}}C_{uq+v}\\ when~ 1\le h \le (m-1)/2, \gamma _1=0, \gamma _2=1;\\ when~h = (m+1)/2, \gamma _1=0, \gamma _2=0;\\ when~ (m+1)/2+1 \le h \le m, \gamma _1=1, \gamma _2=0.\\ \end{aligned} \end{aligned}$$

Then \(T_1\cap -qT_1=\emptyset \).

Theorem 3.7

Let \(n=(q^2+1)/a\)\(a=m^2+1\) \((m\ge 1~is~odd)\), \(s=(n-1)/2\) and \(q=2ak+a+m~(k\ge 1)\) be an odd prime power. For a positive integer m with \(1\le \alpha \le k\), let \({\mathcal {C}}\) be a cyclic code with defining set Z given as follows

$$\begin{aligned} Z=C_{s+1}\cup C_{s+2}\cup \dots \cup C_{s+[\alpha q +(a+m)k+\frac{a+2m}{2}]}. \end{aligned}$$

Then \(|Z_{1}|=4\alpha (a\alpha +a+m)+a+2m\).

Theorem 3.8

Let \(n=(q^2+1)/a1\)\(a=m^2+1\) \((m\ge 1~is~odd)\), \(s=(n-1)/2\) and \(q=2ak+a+m~(k\ge 1)\) be an odd prime power. There exist EAQECCs with parameters

$$\begin{aligned}&[[n, n-4\alpha (q-a-m-a\alpha )-4(a+m)k-(a+2m), \\&2[\alpha q +(a+m)k+(a+2m)/2]+1; 4\alpha (a\alpha +a+m)+a+2m]]_q. \end{aligned}$$

where \(1\le \alpha \le k\). Moreover, they are EAQMDS codes if \(d\le (n+2)/2\).

Case III \(~~~~{\mathbf{q=2ak+a-m}}\)

we also have similar results for \(n=(q^2+1)/a,~a=m^2+1\) (\(m\ge 1\) is odd) and \(q=2ak+a-m\) \((k\ge 1)\) is an odd prime power, we can produce the following EAQECCs. These results are given in the following lemma and theorems. Because the proofs of them are similar to that in Lemma 3.3 and Theorems 3.4, 3.5, we omit it here.

Lemma 3.9

Let \(n=(q^2+1)/a\)\(a=m^2+1\) \((m\ge 1~is~odd)\), \(s=(n-1)/2\) and \(q=2ak+a-m~(k\ge 1)\) be an odd prime power. For a positive integer \(1\le \alpha \le k\), let

$$\begin{aligned}&T_{1}= \bigcup _{\begin{array}{c} s+t(2k+1)+(2-h)+\alpha \le v \le s+t(2k+1)+2k-(1-h)-\alpha ,\\ if~ v\le s+(a-m)k+\frac{a-2m}{2},~0 \le u\le \alpha ,~else~ 0 \le u\le \alpha -1\\ (h-1)m+\gamma _1\le t\le hm-\gamma _2,~1\le h\le m \end{array}}C_{uq+v} \\&when~ 1\le h \le (m-1)/2,~\gamma _1=0,~\gamma _2=1; \\&when~ h = (m+1)/2,~\gamma _1=0,~\gamma _2=0; \\&when~ (m+1)/2+1 \le h \le m,~\gamma _1=1,~\gamma _2=0. \end{aligned}$$

Then \(T_1\cap -qT_1=\emptyset \).

Theorem 3.10

Let \(n=(q^2+1)/a\), \(a=m^2+1\) \((m\ge 1~is~odd)\), \(s=(n-1)/2\) and \(q=2ak+a-m~(k\ge 1)\) be an odd prime power. For a positive integer m with \(1\le \alpha \le k\), let \({\mathcal {C}}\) be a cyclic code with defining set Z given as follows

$$\begin{aligned} Z=C_{s+1}\cup C_{s+2}\cup \dots \cup C_{s+[\alpha q +(a-m)k+\frac{a-2m}{2}]}. \end{aligned}$$

Then \(|Z_{1}|=4\alpha (a\alpha +a-m)+a-2m\).

Theorem 3.11

Let \(n=(q^2+1)/a\), \(a=m^2+1\) \((m\ge 1~is~odd)\), \(s=(n-1)/2\) and \(q=2ak+a-m~(k\ge 1)\) be an odd prime power. There exist EAQECCs with parameters

$$\begin{aligned}&[[n, n-4\alpha (q-a+m-a\alpha )-4(a-m)k-(a-2m), \\&2[\alpha q +(a-m)k+(a-2m)/2]+1; 4\alpha (a\alpha +a-m)+a-2m]]_q. \end{aligned}$$

where \(1\le \alpha \le k\). Moreover, they are EAQMDS codes if \(d\le (n+2)/2\).

Case IV \({\mathbf{q=2ak+2a-m}}\)

Similarly, for the case that \(n=(q^2+1)/a\)\(a=m^2+1\) (\(m\ge 1\) is odd) and \(q=2ak+2a-m\) \((k\ge 1)\) is an odd prime power, there exist EAQECCs as follows. The results are given in the following lemma and theorems. The proofs are similar to that in the Case I, so we omit it here for simplification.

Lemma 3.12

Let \(n=(q^2+1)/a\)\(a=m^2+1\) \((m\ge 1~is~odd)\), \(s=(n-1)/2\) and \(q=2ak+2a-m~(k\ge 1)\) be an odd prime power. For a positive integer \(1\le \alpha \le k\), let

$$\begin{aligned}&T_{1}= \bigcup _{\begin{array}{c} s+(m+t)(k+1)+h+\alpha \le v \le s+ (m+t+2)(k+1)+(h-3)-\alpha ,\\ if~ v\le s+(2a-m)k+2(a-m),~0 \le u\le \alpha ,~else~ 0 \le u\le \alpha -1\\ -m\le t\le (2m-1)m~and~t~is~odd \end{array}}C_{uq+v} \\&when~ -m\le t \le -1,~h=2. \\&when~ 1\le t\le 2m-1,~h=1. \\&when~ 2m+1 \le t \le 4m-1,~h=0. \\&\dots \dots \\&when~ (2m-2)m+1 \le t \le (2m-1)m,~h=2-m. \end{aligned}$$

Then \(T_1\cap -qT_1=\emptyset \).

Theorem 3.13

Let \(n=(q^2+1)/a\), \(a=m^2+1\) \((m\ge 1~is~odd)\), \(s=(n-1)/2\) and \(q=2ak+2a-m\) \((k\ge 1)\) be an odd prime power. For a positive integer m with \(1\le \alpha \le k\), let \({\mathcal {C}}\) be a cyclic code with defining set Z given as follows

$$\begin{aligned} Z=C_{s+1}\cup C_{s+2}\cup \dots \cup C_{s+[\alpha q+(2a-m)k+2(a-m)]}. \end{aligned}$$

Then \(|Z_{1}|=4\alpha (a\alpha +2a-m)+4(a-m)\).

Table 1 Sample parameters of EAQECCs of Theorem 3.5
Table 2 Sample parameters of EAQECCs of Theorem 3.8
Table 3 Sample parameters of EAQECCs of Theorem 3.11

Theorem 3.14

Let \(n=(q^2+1)/a\), \(a=m^2+1\) \((m\ge 1~is~odd\)), \(s=(n-1)/2\) and \(q=2ak+2a-m\) \((k\ge 1)\) be an odd prime power. There exist EAQECCs with parameters

$$\begin{aligned}&[[n, n-4\alpha [q-(2a-m)-a\alpha ]-4(2a-m)k-4(a-m), \\&2[\alpha q+(2a-m)k+2(a-m)]+1; 4\alpha (a\alpha +2a-m)+4(a-m)]]_q, \end{aligned}$$

where \(1\le \alpha \le k\). Moreover, they are EAQMDS codes if \(d\le (n+2)/2\).

Table 4 Sample parameters of EAQECCs of Theorem 3.14

Remark

The required number of entangled states c of the EAQMDS codes obtained in the literatures (see for instance [5, 6, 14, 17]) is fixed. However, the EAQECCs and EAQMDS codes we constructed in Theorems 3.5, 3.8, 3.11 and 3.14 with flexible parameters. And we list the parameters of these codes in Tables 1, 2, 3 and 4.

3.2 EAQECCs with length \(n=q^2+1\) and \(n=(q^2+1)/2\)

In this section, we devote to derive two new classes of EAQECCs from cyclic codes over \({\mathbb {F}}_{q^2}\). We consider cyclic codes of lengths \(n=q^2+1\) and \(n=(q^2+1)/2\) over \({\mathbb {F}}_{q^2}\) by using another method to select defining sets.

Obviously, when \(n=q^2+1\), the \(q^2-\) ary cyclotomic cosets modulo n are:

$$\begin{aligned} C_0=\{0\},C_i=\{i,-i\}=\{i,n-i\},C_{n/2}=\{n/2\} \end{aligned}$$

for \(1\le i\le n-1\).

As for the case of \(n=(q^2+1)/2\), the \(q^2-\) ary cyclotomic cosets modulo n are given in the Lemma 3.1, where \(m=1\).

Theorem 3.15

Let \(n=q^2+1\), \(s=n/2\) and q be an odd prime power. Assume \(0\le t = (q-1)a+b< s \), \(0 \le a \le (q-1)/2\) and \(0 \le b \le q-1\). Let \({\mathcal {C}}\) be a cyclic code with defining set Z given as follows

$$\begin{aligned} Z=C_{0}\cup C_{1}\cup \dots \cup C_{t}. \end{aligned}$$

Then

$$\begin{aligned} c=|Z_1|=\left\{ \begin{array}{ll} 1+4[f(a-1)+b], &{} 1 \le b < 2a.\\ 1+4f(a), &{}2a \le b \le q-1. \end{array} \right. \end{aligned}$$

where \(f(a)=a(a+1).\) Besides, if \(t=s,\) we have \(c=n\).

Proof

Let the defining set of \({\mathcal {C}}\) is \(Z=C_{0}\cup C_{1}\cup \dots \cup C_{t},\) where \(0\le t = (q-1)a+b< s \), \(0 \le a \le (q-1)/2\) and \(0 \le b \le q-1\). Then we have the following results:

(1) when \(1 \le b < 2a\), we have

$$\begin{aligned} \begin{array}{ll} Z_1&{}=Z\cap -qZ\\ \\ &{}=(C_{0}\cup C_{1}\cup \dots \cup C_{t}) \cap -q(C_{0}\cup C_{1}\cup \dots \cup C_{t})\\ \\ &{}=C_0\cup \bigcup _{\begin{array}{c} i=1 \end{array}}^{\begin{array}{c} a-1 \end{array}}\bigcup _{\begin{array}{c} j=1 \end{array}}^{\begin{array}{c} 2i \end{array}}(C_{i(q-1)+j}\cup -qC_{i(q-1)+j}) \cup \bigcup _{\begin{array}{c} j=1 \end{array}}^{\begin{array}{c} b \end{array}}(C_{a(q-1)+j}\cup -qC_{a(q-1)+j}). \end{array} \end{aligned}$$

Therefore,

$$\begin{aligned} \begin{array}{ll} |Z_1|&{}=1+4[2+4+\dots + 2(a-1)+b]\\ &{}=1+4[f(a-1)+b], \end{array} \end{aligned}$$

where \(f(a)=a(a+1)\).

(2) when \(2a \le b \le q-1\), we have

$$\begin{aligned} \begin{array}{ll} Z_1&{}=Z\cap -qZ\\ \\ &{}=(C_{0}\cup C_{1}\cup \dots \cup C_{t}) \cap -q(C_{0}\cup C_{1}\cup \dots \cup C_{t})\\ \\ &{}=C_0\cup \bigcup _{\begin{array}{c} i=1 \end{array}}^{\begin{array}{c} a \end{array}}\bigcup _{\begin{array}{c} j=1 \end{array}}^{\begin{array}{c} 2i \end{array}}(C_{i(q-1)+j}\cup -qC_{i(q-1)+j}) \end{array} \end{aligned}$$

Therefore,

$$\begin{aligned} \begin{array}{ll} |Z_1|&{}=1+4(2+4+\dots + 2a)\\ &{}=1+4f(a), \end{array} \end{aligned}$$

where \(f(a)=a(a+1)\).

(3) when \(t=s\), we have

$$\begin{aligned} \begin{array}{ll} Z_1&{}=Z\cap -qZ\\ \\ &{}=(C_{0}\cup C_{1}\cup \dots \cup C_{s}) \cap -q(C_{0}\cup C_{1}\cup \dots \cup C_{s})\\ \\ &{}=C_{0}\cup C_{1}\cup \dots \cup C_{s}\\ \\ &{}=Z \end{array} \end{aligned}$$

Therefore, \(|Z_1|=|Z|=n\). Then the desired results follows. \(\square \)

Theorem 3.16

Let \(n=q^2+1\), \(s=n/2\) and q be an odd prime power. There exist EAQECCs with parameters

$$\begin{aligned}{}[[n, n-4t-2+c, 2t+2; c]]_q, \end{aligned}$$

where

$$\begin{aligned} c=|Z_1|=\left\{ \begin{array}{ll} 1+4[f(a-1)+b], &{}\quad 1 \le b < 2a.\\ 1+4f(a), &{}\quad 2a \le b \le q-1. \end{array} \right. \end{aligned}$$

\(f(a)=a(a+1)\), \(0\le t = (q-1)a+b< s \), \(0 \le a \le (q-1)/2\) and \(0 \le b \le q-1\). Besides, if \(t=s,\) then \(c=n\). Moreover, they are EAQMDS codes if \(d\le (n+2)/2\).

Proof

Suppose that \({\mathcal {C}}\) is a cyclic code of length \(n=q^2+1\) and \(s=n/2\) with defining set

$$\begin{aligned} Z=C_{0}\cup C_{1}\cup \dots \cup C_{t}. \end{aligned}$$

Then the dimension of \({\mathcal {C}}\) is \(n-2t-1\). Note that cyclic code \({\mathcal {C}}\) have \(2t+1\) consecutive roots. By Proposition 2.1, the minimum distance of \({\mathcal {C}}\) is at least \(2t+2\). From the Singleton bound, \({\mathcal {C}}\) is an MDS code with parameters \([[n,n-2t-1, 2t+2]]_{q^2}\). From Proposition 2.2 and Lemma 2.4, there are EAQECCs with parameters

$$\begin{aligned}{}[[n, n-4t-2+c, 2t+2;c]]_q. \end{aligned}$$

By Proposition 1.1, it implies that the EAQECCs we constructed are EAQMDS codes when \(d\le (n+2)/2\). \(\square \)

Example 3.5

Let \(q=11\). Then \(n=q^2+1=122\) and \(s=n/2=61\). According to Theorem 3.16, we can obtain the following EAQECCs:

$$\begin{aligned}{}[[61,59-4t+c,2t+2;c]]_{11}, \end{aligned}$$

where the value of c for different cases is listed in Table 5. Especially, they are EAQMDS codes when \(d\le 31\), i.e., \(t\le 14\).

Table 5 The value of c corresponds to the range of value of t

As for the case that \(n=(q^2+1)/2\), \(s=(n-1)/2\) and \(q\equiv 1\) mod 2 be an odd prime power, we can produce the following EAQECCs. The proofs are similar to that in the Case of \(n=q^2+1\), so we omit it here.

Theorem 3.17

Let \(n=(q^2+1)/2\), \(s=(n-1)/2\) and \(q\equiv 1\) mod 2 be an odd prime power. Assume \(0\le t =(q-1)a/2+b\le s \), \(0 \le a \le (q-1)/2\) and \(0 \le b \le (q-1)/2\), we have

$$\begin{aligned} c=|Z_1|=\left\{ \begin{array}{ll} 1+4[f(a-1)+b], &{}\quad 1 \le b < a.\\ 1+4f(a), &{}\quad a \le b \le (q-1)/2. \end{array} \right. \end{aligned}$$

where \(f(a)=a(a+1)/2.\)

Theorem 3.18

Let \(n=(q^2+1)/2\), \(s=(n-1)/2\) and \(q\equiv 1\) mod 2 be an odd prime power. There exist EAQECCs with parameters

$$\begin{aligned}{}[[n, n-4t-2+c, 2t+2; c]]_q, \end{aligned}$$

where

$$\begin{aligned} c=|Z_1|=\left\{ \begin{array}{ll} 1+4[f(a-1)+b], &{}\quad 1 \le b < a.\\ 1+4f(a), &{}\quad a \le b \le (q-1)/2. \end{array} \right. \end{aligned}$$

\(f(a)=a(a+1)/2\), \(0\le t =(q-1)a/2+b\le s \), \(0 \le a \le (q-1)/2\) and \(0 \le b \le (q-1)/2\). Moreover, they are EAQMDS codes if \(d\le (n+2)/2\).

Example 3.6

Let \(q=13\). Then \(n=(q^2+1)/2=85\) and \(s=(n-1)/2=42\). According to Theorem 3.18, we can obtain the following EAQECCs:

$$\begin{aligned}{}[[85,83-4t+c,2t+2;c]]_{13}, \end{aligned}$$

where the value of c for different cases is listed in Table 6. Especially, they are EAQMDS codes when \(d\le 43\), i.e., \(t\le 20\).

Table 6 The value of c corresponds to the range of value of t

4 Conclusion

In this paper, we have utilized decomposing the defining set of cyclic codes to extend the present results about EAQMDS codes and construct series of EAQECCs with good parameters of lengths \(n=(q^2+1)/a\), \(n=q^2+1\) and \(n=(q^2+1)/2\). Especially, they conclude all the length with the form \(n=(q^2+1)/a\), where \(a=m^2+1\) and \(m\ge 1\) is odd. Compared with known results, these EAQECCs have flexible parameters and much bigger minimum distance than the known quantum MDS codes and EAQECCs with the same length. Therefore, our EAQECCs can detect and correct more errors. The study of EAQECCs is an interesting problem in coding theory. We believe that it will have tremendous application in the future.