1 Introduction

The class of quantum error-correcting codes provides an effective coding framework for guarding quantum information just as classical error-correcting codes guard classical information. After the discovery by Shor and Steane [29, 30], quantum error-correcting codes have undergone tremendous development. Many well-parameterized quantum error-correcting codes have been constructed by the aid of classical error-correcting codes. Among the known construction methods, the most common construction method is through using classical linear codes and satisfying certain dual-containing requirement. However, it is difficult to find the class of dual-containing codes. The dual-containing constraint has become a serious obstacle to the evolution of quantum coding theory. In 2006, Brun et al. made a great breakthrough in quantum error-correction by proposing entanglement-assisted quantum error-correcting (EAQEC) codes [2]. They found that classical linear binary codes, which are not self-orthogonal, can be applied to construct quantum codes if the sender and receiver share the entanglement bits beforehand. This discovery has inspired researchers to concentrate on the construction of EAQEC codes.

Let q be a prime power. An \([[n,k,d;c]]_{q}\) code \(\mathcal {C}\) is a q-ary EAQEC code of length n, which encodes k logical qudits into n physical qudits and corrects quantum errors up to \(\lfloor \frac{d-1}{2}\rfloor \) by utilizing c pairs of maximally entangled states. Here, d is the minimum distance of the code. If \(c=0\), then an EAQEC code is a standard \([[n,k,d]]_{q}\) quantum code. The parameters of an \([[n,k,d;c]]_{q}\) EAQEC code are mutually restricted and meet the following entanglement-assisted quantum Singleton bound.

Lemma 1

[2, 11, 14] For an \([[n,k,d;c]]_{q}\) EAQEC code, if \(d\le \frac{n+2}{2}\), then

$$\begin{aligned} n+c+2-k\ge 2d, \end{aligned}$$

where \(1\le c\le n-1\).

An \([[n,k,d;c]]_{q}\) EAQEC code that attains the entanglement-assisted quantum Singleton bound is called an entanglement-assisted quantum maximum-distance-separable (EAQMDS) code. Since entanglement can improve the error-correcting performance of quantum codes [15], it is more desirable that we can construct EAQMDS codes for large distance. Recently, many researchers found an amount of EAQMDS codes from constacyclic codes, generalized Reed-Solomon (GRS) codes and linear complement dual (LCD) codes, see Refs. [4, 6,7,8,9,10, 25]. Since cyclic codes have a good algebraic structure, they are the preferred objects for constructing EAQMDS codes. However, it is a hard problem to fix on the number of maximally entangled states. In [21], the concept of the decomposition of defining set of a cyclic BCH code was introduced to solve the problem of computing the number c and construct some good EAQEC codes. After that, more and more scholars have extended this approach to general constacyclic codes, so as to result in the construction of many new EAQMDS codes. In particular, EAQMDS codes with length dividing \(q^{2}+1\) or \(q^{2}-1\) were massively obtained [3, 5, 6, 17,18,19, 25, 28, 31, 33].

Generally, as entanglement bits are more used, it would be more difficult to find the parameters of EAQEC codes. Recently, in [7, 27, 28, 33], several families of EAQMDS codes with variable parameters were derived from constacyclic codes, GRS codes, and extended GRS codes. In these works, the formula of the relation between the minimum distance d and the number c of maximally entangled states was explicitly described and the change rules of the parameters of EAQMDS codes were revealed. Motivated by the above ideas, we construct two new families of q-ary EAQMDS codes from cyclic codes with minimum distance not less than q. Specific parameters are as follows.

  • Length \(n=\frac{q^{2}-1}{3}\) with \(3\mid (q+1)\) and \(1\le t\le \lceil \frac{q-8}{6}\rceil \).

(i):

\([[n,n-2d+3t^{2}+2,d;3t^{2}]]_{q}\), where \(tq\le d\le t(q-1)+\frac{q+1}{3}\).

(ii):

\([[n,n-2d+3t^{2}+2t+2,d;3t^{2}+2t]]_{q}\), \(tq+\frac{q+1}{3}\le d\le t(q-1)+\frac{2q-1}{3}\).

(iii):

\([[n,n-2d+3t^{2}+4t+4,d;3t^{2}+4t+2]]_{q}\), where \(tq+\frac{2(q+1)}{3}\le d\le (t+1)(q-1)\).

  • Length \(n=\frac{q^{2}-1}{5}\) with \(5\mid (q+1)\) and \(1\le t\le \lceil \frac{q-14}{10}\rceil \).

(i):

\([[n,n-2d+5t^{2}+2,d;5t^{2}]]_{q}\), where \(tq\le d\le t(q-1)+\frac{q+1}{5}\).

(ii):

\([[n,n-2d+5t^{2}+2t+2,d;5t^{2}+2t]]_{q}\), where \(tq+\frac{q+1}{5}\le d\le t(q-1)+\frac{2q+2}{5}\).

(iii):

\([[n,n-2d+5t^{2}+4t+2,d;5t^{2}+4t]]_{q}\), where \(tq+\frac{2q+2}{5}\le d\le t(q-1)+\frac{3q-2}{5}\).

(iv):

\([[n,n-2d+5t^{2}+6t+4,d;5t^{2}+6t+2]]_{q}\), where \(tq+\frac{3q+3}{5}\le d\le t(q-1)+\frac{4q-1}{5}\).

(v):

\([[n,n-2d+5t^{2}+8t+6,d;5t^{2}+8t+4]]_{q}\), where \(tq+\frac{4q+4}{5}\le d\le (t+1)(q-1)\).

Compared with the known constructions in Refs. [16, 18, 22, 27], our constructions produce EAQMDS codes processing minimum distance not less than the size q of the finite field, which indicates our codes can correct more quantum errors. Meanwhile, we describe the exact relation between the minimum distance d and the maximally entangled state c by introducing the variable t. In addition, our constructions place the size q on a general case, not only take an odd prime power.

The material is organized as below. In Section 2, we review some basic concepts on cyclic codes, cyclotomic cosets, and EAQMDS codes. In Section 3, two classes of EAQMDS codes are gained from cyclic codes. In Section 4, detailed comparison and discussion are made.

2 Preliminaries

We recall some basic results on cyclic code, defining set of cyclic code and EAQECCs. For more details, please refer to Refs. [1, 12, 13, 23]. Let q be any prime power and \(\mathbb {F}_{q^{2}}\) be the finite field with \(q^{2}\) elements. For any element \(\beta \in \mathbb {F}_{q^{2}}\), \(\bar{\beta }=\beta ^{q}\) is the conjugation of \(\beta \). Given two vectors \(\textbf{u}=(u_{0},u_{1},\ldots ,u_{n-1})\) and \(\textbf{v}=(v_{0},v_{1},\ldots ,v_{n-1})\in \mathbb {F}_{q^{2}}^{n}\), define their Hermitian inner product by

$$\begin{aligned} \langle \textbf{u},\textbf{v}\rangle _{h}=u_{0}\bar{v}_{0}+u_{1}\bar{v}_{1}+\cdots +u_{n-1}\bar{v}_{n-1}. \end{aligned}$$

An [nkd] linear code \(\mathcal {C}\) over \(\mathbb {F}_{q^{2}}\) is a subspace of \(\mathbb {F}_{q^{2}}^{n}\) with dimension k. Define the Hermitian dual code of \(\mathcal {C}\) as

$$\begin{aligned} \mathcal {C}^{\perp _{h}}=\{\textbf{u}\in \mathbb {F}_{q^{2}}^{n}\mid \langle \textbf{u},\textbf{v}\rangle _{h}=0,\ \forall \ \textbf{v}\in \mathcal {C}\}. \end{aligned}$$

If \(\mathcal {C}\) is contained in \(\mathcal {C}^{\perp _{h}}\), then \(\mathcal {C}\) is said to be Hermitian self-orthogonal. Particularly, if \(\mathcal {C}=\mathcal {C}^{\perp h}\), then \(\mathcal {C}\) is said to be Hermitian self-dual. A subspace \(\mathcal {C}\subseteq \mathbb {F}_{q^{2}}^{n}\) is a cyclic code if \((c_{0},c_{1},\ldots ,c_{n-1})\in \mathcal {C}\), then \((c_{n-1},c_{0},\ldots ,c_{n-2})\in \mathcal {C}\). Any codeword \((c_{0},c_{1},\ldots ,c_{n-1})\in \mathcal {C}\) can be written as a polynomial \(c(x)=c_{0}+c_{1}x+\cdots +c_{n-1}x^{n-1}\) in the quotient ring \(\mathbb {F}_{q^{2}}[x]/\langle x^{n}-1\rangle \). This means that \(\mathcal {C}\) is a cyclic code is equivalent to the set of polynomial representations of the codewords of \(\mathcal {C}\) forms an ideal of \(\mathbb {F}_{q^{2}}[x]/\langle x^{n}-1\rangle \). Because every ideal of \(\mathbb {F}_{q^{2}}[x]/\langle x^{n}-1\rangle \) is a principal ideal, \(\mathcal {C}\) can be generated by a monic polynomial \(g(x)\mid (x^{n}-1)\) with the least degree. That is, \(\mathcal {C}=\langle g(x)\rangle \subseteq \mathbb {F}_{q^{2}}[x]/\langle x^{n}-1\rangle \), where g(x) is referred to as the generator polynomial of \(\mathcal {C}\) and \(h(x)=(x^{n}-1)/g(x)\) is referred to as the check polynomial of \(\mathcal {C}\). Assume that \(\gcd (n,q)=1\). Let \(\alpha \) be a primitive n-th root of unity in some extension field of \(\mathbb {F}_{q^{2}}\). Denote \(\mathbb {Z}_{n}=\{0,1,\ldots ,n-1\}\). Define the defining set of \(\mathcal {C}=\langle g(x)\rangle \) by

$$\begin{aligned} T=\{i\in \mathbb {Z}_{n}\mid g(\alpha ^{i})=0\}. \end{aligned}$$

It is well known that there is a close connection between cyclic codes and cyclotomic cosets. Define the \(q^{2}\)-cyclotomic coset modulo n containing the integer i by

$$\begin{aligned} C_{i}=\{i,iq^{2},iq^{4},\ldots ,iq^{2(m-1)}\}(\bmod \ n), \end{aligned}$$

where m is the smallest positive integer such that \(iq^{2m}\equiv i(\bmod \ n)\). Notice that the defining set T forms the union of some \(q^{2}\)-cyclotomic cosets. It follows that \(\mathcal {C}\) has dimension \(k=n-\mid T\mid \). The following lemma is a known fact on the minimum distance of cyclic codes.

Lemma 2

(The BCH bound for cyclic codes) [2, 11, 32] Suppose that \(\mathcal {C}\) is a cyclic code of length n with defining set T, which contains \(\delta \) consecutive elements, where \(1\le \delta \le n-1\). Then \(d(\mathcal {C})\ge \delta +1\).

To explore the characters of cyclotomic cosets, we follow some notations from the literature [21]. A \(q^{2}\)-cyclotomic coset \(C_{i}\) modulo n is said to be skew asymmetric if \(C_{i}\ne C_{-qi}\); otherwise it is said to be skew symmetric. If \(C_{i}\) is a skew asymmetric coset, then \((C_{i}, C_{-qi})\) forms a skew asymmetric pair. By using any linear code \(\mathcal {C}\) over \(\mathbb {F}_{q^{2}}\), we can construct an EAQEC code. However, there exists a barrier to calculate the parameter c. In [21], the idea of the decomposition of defining set of a cyclic code was proposed. For any cyclic code over \(\mathbb {F}_{q^{2}}\) of length n with defining set T, \(T\bigcap -qT\) contains all the skew symmetric cosets and skew asymmetric pairs [22]. Moreover, the cyclotomic cosets \(T\setminus (T\bigcap -qT)\) are all skew asymmetric.

Definition 1

[21] Suppose that \(\mathcal {C}\) is a cyclic code over \(\mathbb {F}_{q^{2}}\) of length n with defining set T. Write \({T_{1}=T\bigcap -qT}\) and \({T_{2}=T\setminus T_{1}}\), where \(-qT=\{-qx(\bmod \ n)\ \mid \ x\in T\}\). The intersection \({T=T_{1}\bigcup T_{2}}\) is called the decomposition of T.

The following lemma provides an effective method for determining the number c of maximally entangled states.

Lemma 3

[22] Let \(\mathcal {C}\) be a \([n,k,d]_{q^{2}}\) cyclic code over \(\mathbb {F}_{q^{2}}\) with defining set T. If \({T=T_{1}\bigcup T_{2}}\), then there exists an EAQEC code with parameters \(\left[ \left[ n,n-2\mid T\mid +\mid {T_{1}}\mid ,d;\mid {T_{1}}\mid \right] \right] _{q}\).

Let q be arbitrary prime power. Let \(n=\frac{q^{2}-1}{r}\) with \({r\mid (q+1)}\). In the next two sections, we will construct some EAQMDS codes from cyclic codes with length \(n=\frac{q^{2}-1}{r}\), for \(r=3, 5\). In order to calculate \(\mid {T_{1}}\mid \), we need to find skew symmetric cosets \(C_{i}\) and skew asymmetric pairs \((C_{i},C_{j})\). From \(C_{j}=-qC_{i}\), we can obtain \(C_{i}=-qC_{j}\) since \(q^{2}\equiv 1(\bmod \ n)\). Thus, we only consider the case when \(j\le i\).

Lemma 4

Assume that \(n=\frac{q^{2}-1}{r}\), where r is odd with \(r\mid (q+1)\) and \(r'=\frac{q+1}{r}\). Then \(C_{i}\) is skew symmetric if and only if \(i=\frac{\ell (q-1)}{2}\), where \(\ell \) is even and \(2\le \ell \le 2(r'-1)\).

Proof

Suppose that \(C_{j}=-qC_{i}\), for \(i,j\in \mathbb {Z}_{n}\). Then,

$$\begin{aligned} iq+j\equiv 0(\bmod \ n).\end{aligned}$$
(1)

Notice that \((q-1)\mid n\). By operating both sides of (1) modulo \(q-1\), we get \(i+j\equiv 0(\bmod \ q-1)\). Hence, \(i+j=\ell (q-1)\), for some positive integer \(\ell \). We consider two cases.

  1. (i)

    q is even. \(C_{i}\) is skew symmetric if and only if \(i=j=\frac{\ell (q-1)}{2}\), where \(2\le \ell \le 2(r'-1)\) is even.

  2. (ii)

    q is odd. We first prove that \(C_{i}\) is a skew asymmetric coset if \(i=2s+1\in \mathbb {Z}_{n}\). Assume that \(C_{2s+1}=-qC_{2s+1}\). Then \((2s+1)(q+1)\equiv 0(\bmod \ n)\), equivalently, \((2s+1)r\equiv 0(\bmod \ q-1)\). It follows that \((q-1)\mid (2s+1)r\). Observe that \(q-1\) is even and \((2s+1)r\) is odd. This produces a contradiction. So, \(C_{2s+1}\) is skew asymmetric. It remains to find all skew symmetric cosets in \(C_{2s}\). Clearly, \(C_{2s}\) is skew symmetric if and only if \(C_{2s}=-qC_{2s}\). That is, \(2s(q+1)\equiv 0(\bmod \ n)\). Hence, \(2sr\equiv 0(\bmod \ q-1)\), equivalently, \((q-1)\mid 2sr\). Since \(\gcd (q-1,r)=1\), it must be \((q-1)\mid 2s\). Therefore, \(i=2s=h(q-1)\), where \(1\le h\le r'-1\). This means that \(i=\frac{\ell (q-1)}{2}\), where \(\ell =2h\) is even and \(2\le \ell \le 2(r'-1)\).

This completes the proof. \(\square \)

3 Construction of EAQMDS Codes of Length \(\frac{q^{2}-1}{3}\)

In this section, we assume that \(q\ge 11\) is a power of any prime. Let \(n=\frac{q^{2}-1}{3}\), where \(3\mid (q+1)\). We are going to seek EAQMDS codes with length n based on the structure of cyclic codes. We present the explicit expressions of the relation between the number c of entangled states and minimum distance d. Some properties about cyclotomic cosets are described as below.

Lemma 5

Assume that \(n=\frac{q^{2}-1}{3}\), where \(q\ge 11\) and \(3\mid (q+1)\). Let t be an integer with \(1\le t\le \lceil \frac{q-8}{6}\rceil \).

  1. (i)

    If \(tq-1\le \delta \le t(q-1)+\frac{q-2}{3}\) and \(1\le j<i\le \delta \), then \((C_{i},C_{j})\) is a skew asymmetric pair if and only if \(i=\frac{mq+m-3\ell }{3}\) and \(j=\frac{3\ell q-mq-m}{3}\), where \(1\le \ell \le 2t\) and \(\frac{3\ell }{2}< m\le \min \{3t,3\ell -1\}\).

  2. (ii)

    If \(tq+\frac{q-2}{3}\le \delta \le t(q-1)+\frac{2q-4}{3}\) and \(1\le j<i\le \delta \), then \((C_{i},C_{j})\) is a skew asymmetric pair if and only if \(i=\frac{mq+m-3\ell }{3}\) and \(j=\frac{3\ell q-mq-m}{3}\), where \(1\le \ell \le 2t+1\) and \(\frac{3\ell }{2} < m\le \min \{3t+1,3\ell -1\}\).

  3. (iii)

    If \(tq+\frac{2q-1}{3}\le \delta \le t(q-1)+q-2\) and \(1\le j<i\le \delta \), then \((C_{i},C_{j})\) is a skew asymmetric pair if and only if \(i=\frac{mq+m-3\ell }{3}\) and \(j=\frac{3\ell q-mq-m}{3}\), where \(1\le \ell \le 2t+1\) and \(\frac{3\ell }{2}< m\le \min \{3t+2,3\ell -1\}\).

Proof

We only show the result (i). The proofs of (ii) and (iii) are similar. We first consider the case when \(\delta =t(q-1)+\frac{q-2}{3}\).

Let i and j be integers with \(1\le j<i\le t(q-1)+\frac{q-2}{3}\). If \(C_{j}=-qC_{i}\), then

$$\begin{aligned} iq+j\equiv 0(\bmod \ n). \end{aligned}$$
(2)

Notice that \((q-1)\) is a divisor of n. Operating both sides of (2) modulo \(q-1\) gets \(i+j\equiv 0(\bmod \ q-1)\). Since \(2< i+j<2\delta \le 2t(q-1)+\frac{2(q-2)}{3}\), we have \(i+j=\ell (q-1)\), where \(1\le \ell \le 2t\). Then \(j=\ell (q-1)-i\). Putting it into (2) we obtain \(i+\ell \equiv 0(\bmod \ \frac{q+1}{3})\). Hence, \(i=\frac{mq+m-3\ell }{3}\) and \(j=\frac{3\ell q-mq-m}{3}\), for some positive integer m. We now determine the range of m. Since \(1\le j< i\) and \(i+j=\ell (q-1)\), it follows that \(\frac{\ell (q-1)}{2}< i\le \ell (q-1)-1\). From \(i>\frac{\ell (q-1)}{2}\), we obtain \(m>\frac{3\ell }{2}\). From \(2\le i\le \frac{(3t+1)q-3t-2}{3}\) and \(1\le \ell \le 2t\), we obtain \(m(q+1)-6t\le m(q+1)-3\ell \le 3t(q+1)+q-6t-2\) and \(m\le 3t\). Hence, \(\frac{3\ell }{2}< m\le 3t\). From \(i\le \ell (q-1)-1\), if \(m\ge 3\ell \), then \(i\ge \ell q\), which is a contradiction. So, it must be \(m\le 3\ell -1\), implying that \(i\le \ell q-\frac{q+1}{3}\). Notice that \(\ell \le 2t\le \lceil \frac{q-8}{3}\rceil \) and \(q\ge 11\). This means that the condition \(i\le \ell (q-1)-1\) is met. Hence, \(\frac{3\ell }{2}< m\le \min \{3t,3\ell -1\}.\)

Conversely, suppose \(i=\frac{mq+m-3\ell }{3}\) and \(j=\frac{3\ell q-mq-m}{3}\), where \(1\le \ell \le 2t\) and \(\frac{3\ell }{2}< m\le \min \{3t,3\ell -1\}\). It easy to compute that \(1\le j<i\) and \(iq+j=\frac{m(q^{2}-1)}{3}\equiv 0(\bmod \ n)\). Hence, \(C_{j}=-qC_{i}\), i.e., \((C_{i},C_{j})\) is a skew asymmetric pair.

Hence, we already show that the result (i) holds true for \(\delta =t(q-1)+\frac{q-2}{3}\). For a given integer t with \(1\le t\le \lceil \frac{q-8}{6}\rceil \), notice that when \(\ell =t+1\) and \(m=3t\), the integer \(i\in \mathbb {Z}_{n}\) such that \((C_{i},C_{j})\) is a skew asymmetric pair has the largest value \(tq-1\). Thus, the result (i) holds true for \(tq-1\le \delta \le t(q-1)+\frac{q-2}{3}\). \(\square \)

Lemma 6

Assume that \(n=\frac{q^{2}-1}{3}\), where \(q\ge 11\) and \(3\mid (q+1)\). Then \(C_{i}\) is skew symmetric if and only if \(i=\frac{mq+m-3\ell }{3}\) and \(m=\frac{3\ell }{2}\), where \(\ell \) is even and \(2\le \ell \le \frac{2(q-2)}{3}\).

Proof

The result can be easily obtained from Lemma 4. \(\square \)

Let \(T=\bigcup _{i=1}^{\delta } C_{i}\), where \(\delta \) is in one of the three ranges:

  • (R1) \(tq-1\le \delta \le t(q-1)+\frac{q-2}{3}\).

  • (R2) \(tq+\frac{q-2}{3}\le \delta \le t(q-1)+\frac{2q-4}{3}\).

  • (R3) \(tq+\frac{2q-1}{3}\le \delta \le t(q-1)+q-2\).

Next, we compute the cardinality of \({T_{1}}\) in the above three ranges, respectively. We first consider the range (R1). To facilitate our calculation, we introduce the following notations. For a given integer \(\ell \) with \(1\le \ell \le 2t\), let

$$\begin{aligned} \mathcal {L}^{(\ell )}_{m}= & {} \left\{ m~ \mid ~\frac{3\ell }{2}< m\le \min \{3t,3\ell -1\}\right\} ,\\ \mathcal {S}^{(\ell )}_{i}= & {} \left\{ i~ \mid ~i=\frac{mq+m-3\ell }{3},~\text {for}~\frac{3\ell }{2}< m\le \min \{3t,3\ell -1\}\right\} ,\\ \mathcal {T}^{(\ell )}_{j}= & {} \left\{ j~ \mid ~j=\frac{3\ell q-mq-m}{3},~\text {for}~\frac{3\ell }{2}< m\le \min \{3t,3\ell -1\}\right\} . \end{aligned}$$

Write \(N^{(\ell )}=\mid \mathcal {S}^{(\ell )}_{i}\cup \mathcal {T}^{(\ell )}_{j}\mid \).

Lemma 7

Assume that \(n=\frac{q^{2}-1}{3}\), where \(q\ge 11\) and \(3\mid (q+1)\). Let t be an integer with \(1\le t\le \lceil \frac{q-8}{6}\rceil \). If \(T=\bigcup _{i=1}^{\delta } C_{i}\), where \(tq-1\le \delta \le t(q-1)+\frac{q-2}{3}\), then \(\mid {T_{1}}\mid =3t^{2}\).

Proof

For a given integer t with \(1\le t\le \lceil \frac{q-8}{6}\rceil \), set \(\lambda = t(q-1)+\frac{q-2}{3}\) and \(T_{\lambda }=\bigcup _{i=1}^{\lambda } C_{i}\). By Lemma 5 (i), we only need to compute \(\mid T_{\lambda }\cap -qT_{\lambda }\mid \).

Let i and j be integers with \(1\le j\le i \le \lambda \). From Lemmas 5 (i) and 6, \(i=\frac{mq+m-3\ell }{3}\), where \(1\le \ell \le 2t\) and

$$\begin{aligned} \frac{3\ell }{2}\le m\le \min \{3t,3\ell -1\}. \end{aligned}$$
(3)

When \(1\le \ell \le t\), \(\min \{3t,3\ell -1\}=3\ell -1\); when \(t+1\le \ell \le 2t\), \(\min \{3t,3\ell -1\}=3t\). Note that \(1\le \ell \le 2t\). Denote \(T_{\ell }^{(o)}=\{1,3,\ldots ,2t-1\}\) and \(T_{\ell }^{(e)}=\{2,4,\ldots ,2t\}\). Let

$$\begin{aligned} T^{(o)}_{i}= & {} \left\{ i~ \mid ~i=\frac{mq+m-3\ell }{3},~\text {for}~\ell \in T_{\ell }^{(o)} \right\} ,\\ T^{(e)}_{i}= & {} \left\{ i~ \mid ~i=\frac{mq+m-3\ell }{3},~\text {for}~\ell \in T_{\ell }^{(e)} \right\} ,\\ T^{(o)}_{j}= & {} \left\{ j~ \mid ~j=\frac{3\ell q-mq-m}{3},~\text {for}~\ell \in T_{\ell }^{(o)} \right\} ,\\ T^{(e)}_{j}= & {} \left\{ j~ \mid ~j=\frac{3\ell q-mq-m}{3},~\text {for}~\ell \in T_{\ell }^{(e)} \right\} . \end{aligned}$$

Hence,

$$\begin{aligned} \mid {T_{1}}\mid =\mid T_{\lambda }\cap -qT_{\lambda }\mid =\mid T^{(o)}_{i}\cup T^{(o)}_{j}\mid +\mid T^{(e)}_{i}\cup T^{(e)}_{j}\mid . \end{aligned}$$

We now deal with the two cases where t is odd and even.

  • Case 1: t is odd. When \(\ell \) takes an odd integer with \(1\le \ell \le 2t\), then \(\frac{3\ell +1}{2} \le m\le \min \{3t,3\ell -1\}\). From Lemma 6, we have \(j<i\). If \(1\le \ell \le t\), then \(\mid \mathcal {L}^{(\ell )}_{m}\mid =3\ell -1-\frac{3\ell +1}{2}+1=\frac{3\ell -1}{2}\) and \(N^{(\ell )}=2\mid \mathcal {L}^{(\ell )}_{m}\mid =3\ell -1\). If \(t+1\le \ell \le 2t\), then \(\mid \mathcal {L}^{(\ell )}_{m}\mid =3t-\frac{3\ell +1}{2}+1=3t-\frac{3\ell }{2}+\frac{1}{2}\) and \(N^{(\ell )}=2\mid \mathcal {L}^{(\ell )}_{m}\mid =6t-3\ell +1\). We have

    $$\begin{aligned} N^{(1)}+N^{(3)}+\cdots +N^{(t)}=\frac{\left( N^{(1)}+N^{(t)}\right) \cdot \frac{t+1}{2}}{2}=\frac{3t^{2}+4t+1}{4} \end{aligned}$$

    and

    $$\begin{aligned} N^{(t+2)}+N^{(t+4)}+\cdots +N^{(2t-1)}=\frac{\left( N^{(t+2)}+N^{(2t-1)}\right) \cdot \frac{t-1}{2}}{2}=\frac{3t^{2}-4t+1}{4}. \end{aligned}$$

    Hence,

    $$\begin{aligned} \mid T^{(o)}_{i}\cup T^{(o)}_{j}\mid =\frac{3t^{2}+4t+1}{4}+\frac{3t^{2}-4t+1}{4}=\frac{3t^{2}+1}{2}. \end{aligned}$$

    When \(\ell \) takes an even integer with \(1\le \ell \le 2t\), then \(\frac{3\ell +1}{2} \le m\le \min \{3t,3\ell -1\}\). From Lemma 6, \(C_{i}\) is skew symmetric if and only if \(i=j\); if and only if \(m=\frac{3\ell }{2}\). When \(j<i\), \(\frac{3\ell +1}{2}\le m\le \min \{3t,3\ell -1\}\). If \(1\le \ell \le t\), then \(\mid \mathcal {L}^{(\ell )}_{m}\mid =3\ell -1-\frac{3\ell +2}{2}+1=\frac{3\ell -2}{2}\) and \(N^{(\ell )}=2\mid \mathcal {L}^{(\ell )}_{m}\mid +1=3\ell -1\). If \(t+1\le \ell \le 2t\), then \(\mid \mathcal {L}^{(\ell )}_{m}\mid =3t-\frac{3\ell +2}{2}+1=3t-\frac{3\ell }{2}\) and \(N^{(\ell )}=2\mid \mathcal {L}^{(\ell )}_{m}\mid +1=6t-3\ell +1\). We have

    $$\begin{aligned} N^{(2)}+N^{(4)}+\cdots +N^{(t-1)}=\frac{\left( N^{(2)}+N^{(t-1)}\right) \cdot \frac{t-1}{2}}{2}=\frac{3t^{2}-2t-1}{4} \end{aligned}$$

    and

    $$\begin{aligned} N^{(t+1)}+N^{(t+3)}+\cdots +N^{(2t)}=\frac{\left( N^{(t+1)}+N^{(2t)}\right) \cdot \frac{t+1}{2}}{2}=\frac{3t^{2}+2t-1}{4}. \end{aligned}$$

    Hence, \(\mid T^{(e)}_{i}\cup T^{(e)}_{j}\mid =\frac{3t^{2}-2t-1}{4}+\frac{3t^{2}+2t-1}{4}=\frac{3t^{2}-1}{2}.\) Thus, \(\mid {T_{1}}\mid =\frac{3t^{2}+1}{2}+\frac{3t^{2}-1}{2}=3t^{2}.\)

  • Case 2: t is even. When \(\ell \) takes an odd integer with \(1\le \ell \le 2t\), in the same way, we get

    $$\begin{aligned} N^{(1)}+N^{(3)}+\cdots +N^{(t-1)}=\frac{\left( N^{(1)}+N^{(t-1)}\right) \cdot \frac{t}{2}}{2}=\frac{3t^{2}-2t}{4} \end{aligned}$$

    and

    $$\begin{aligned} N^{(t+1)}+N^{(t+4)}+\cdots +N^{(2t-1)}=\frac{\left( N^{(t+1)}+N^{(2t-1)}\right) \cdot \frac{t}{2}}{2}=\frac{3t^{2}+2t}{4}. \end{aligned}$$

    Hence,

    $$\begin{aligned} \mid T^{(o)}_{i}\cup T^{(o)}_{j}\mid =\frac{3t^{2}-2t}{4}+\frac{3t^{2}+2t}{4}=\frac{3t^{2}}{2}. \end{aligned}$$

    When \(\ell \) takes an even integer with \(1\le \ell \le 2t\), in the same way, we have

    $$\begin{aligned} N^{(2)}+N^{(4)}+\cdots +N^{(t)}=\frac{\left( N^{(2)}+N^{(t)}\right) \cdot \frac{t}{2}}{2}=\frac{3t^{2}+4t}{4} \end{aligned}$$

    and

    $$\begin{aligned} N^{(t+2)}+N^{(t+4)}+\cdots +N^{(2t)}=\frac{\left( N^{(t+2)}+N^{(2t)}\right) \cdot \frac{t}{2}}{2}=\frac{3t^{2}-4t}{4}. \end{aligned}$$

    Hence, \(\mid T^{(e)}_{i}\cup T^{(e)}_{j}\mid =\frac{3t^{2}+4t}{4}+\frac{3t^{2}-4t}{4}=\frac{3t^{2}}{2}.\) Thus, \(\mid {T_{1}}\mid =\frac{3t^{2}}{2}+\frac{3t^{2}}{2}=3t^{2}.\)

This completes the proof. \(\square \)

For the ranges (R2) and (R3), we can compute the exact values of \(\mid {T_{1}}\mid \) by using an analogues technique as in the range (R1). The proofs are omitted here.

Lemma 8

Assume that \(n=\frac{q^{2}-1}{3}\), where \(q\ge 11\) and \(3\mid (q+1)\). Let t be an integer with \(1\le t\le \lceil \frac{q-8}{6}\rceil \).

  1. (i)

    If \(tq+\frac{q-2}{3}\le \delta \le t(q-1)+\frac{2q-4}{3}\), then \(\mid {T_{1}}\mid =3t^{2}+2t\).

  2. (ii)

    If \(tq+\frac{2q-1}{3}\le \delta \le t(q-1)+q-2\), then \(\mid {{T_{1}}}\mid =3t^{2}+4t+2\).

Let \(\mathcal {C}\) be a cyclic code in \(\mathbb {F}_{q^{2}}[x]/\langle x^{n}-1\rangle \) and have defining set \(T=\bigcup _{i=1}^{\delta } C_{i}\). Now, we can find EAQMDS codes with length \(n=\frac{q^{2}-1}{3}\) stemmed from the cyclic code \(\mathcal {C}\).

Theorem 1

Let \(q\ge 11\) be a power of any prime. Let \(n=\frac{q^{2}-1}{3}\) with \(3\mid (q+1)\). For any integer t with \(1\le t\le \lceil \frac{q-8}{6}\rceil \), q-ary EAQMDS codes with the following parameters can be constructed from \(\mathcal {C}\)

  1. (i)

    \([[n,n-2d+3t^{2}+2,d;3t^{2}]]_{q}\), where \(tq\le d\le t(q-1)+\frac{q+1}{3}\).

  2. (ii)

    \([[n,n-2d+3t^{2}+2t+2,d;3t^{2}+2t]]_{q}\), where \(tq+\frac{q+1}{3}\le d\le t(q-1)+\frac{2q-1}{3}\).

  3. (iii)

    \([[n,n-2d+3t^{2}+4t+4,d;3t^{2}+4t+2]]_{q}\), where \(tq+\frac{2(q+1)}{3}\le d\le (t+1)(q-1)\).

Proof

Fix an integer t with \(1\le t\le \lceil \frac{q-8}{6}\rceil \). Let \(\mathcal {C}\) be the cyclic code over \(\mathbb {F}_{q^{2}}\) of length \(n=\frac{q^{2}-1}{3}\) having defining set \(T=\bigcup _{i=1}^{\delta } C_{i}\), where \(tq-1\le \delta \le t(q-1)+\frac{q-2}{3}\). Notice that every cyclotomic coset \(C_{i}\) has only one element. So, \(\mid T\mid =\delta \) and \(\dim (\mathcal {C})=n-\delta \). Since the defining set of \(\mathcal {C}\) contains \(\delta \) consecutive integers, by Lemma 2, \(d(\mathcal {C})\ge \delta +1\). Hence, \(\mathcal {C}\) is an \([n,n-\delta ,\delta +1]\) MDS cyclic code over \(\mathbb {F}_{q^{2}}\). From Lemma 7, \(\mid {T_{1}}\mid =3t^{2}\). By Lemma 3, there exists an \([[n,n-2d+3t^{2}+2,d;3t^{2}]]_{q}\) EAQEC code, where \(tq\le d\le t(q-1)+\frac{q+1}{3}\). It is easy to check that its parameters attain the bound \(2d=n-k+c+2\), moreover, \(d\le \frac{n+2}{2}\). Thus, the resulting code is an EAQMDS code. This proves the result (i). Apply Lemma 8 to the cyclic codes \(\mathcal {C}\) with the ranges (R2) and (R3), respectively. Then we can get the latter two classes of EAQMDS codes in a similar way. \(\square \)

4 Construction of EAQMDS Codes of Length \(\frac{q^{2}-1}{5}\)

We are now ready to construct EAQMDS codes with \(n=\frac{q^{2}-1}{5}\). Assume that \(q\ge 19\) is a power of any prime power with \(5\mid (q+1)\).

Lemma 9

Assume that \(n=\frac{q^{2}-1}{5}\), where \(q\ge 19\) and \(5\mid (q+1)\). Let t be a positive integer with \(1\le t\le \lceil \frac{q-14}{10}\rceil \).

  1. (i)

    If \(tq-1\le \delta \le t(q-1)+\frac{q-4}{5}\) and \(1\le j<i\le \delta \), then \((C_{i},C_{j})\) is a skew asymmetric pair with \(1\le j<i\le \delta \) if and only if \(i=\frac{mq+m-5\ell }{5}\) and \(j=\frac{5\ell q-mq-m}{5}\), where \(1\le \ell \le 2t\) and \(\frac{5\ell }{2}< m\le \min \{5t,5\ell -1\}\).

  2. (ii)

    If \(tq+\frac{q-4}{5}\le \delta \le t(q-1)+\frac{2q-3}{5}\) and \(1\le j<i\le \delta \), then \((C_{i},C_{j})\) is a skew asymmetric pair with \(1\le j<i\le \delta \) if and only if \(i=\frac{mq+m-5\ell }{5}\) and \(j=\frac{5\ell q-mq-m}{5}\), where \(1\le \ell \le 2t\) and \(\frac{5\ell }{2} < m\le \min \{5t+1,5\ell -1\}\).

  3. (iii)

    If \(tq+\frac{2q-3}{5}\le \delta \le t(q-1)+\frac{3q-7}{5}\) and \(1\le j<i\le \delta \), then \((C_{i},C_{j})\) is a skew asymmetric pair with \(1\le j<i\le \delta \) if and only if \(i=\frac{mq+m-5\ell }{5}\) and \(j=\frac{5\ell q-mq-m}{5}\), where \(1\le \ell \le 2t+1\) and \(\frac{5\ell }{2} < m\le \min \{5t+2,5\ell -1\}\).

  4. (iv)

    If \(tq+\frac{3q-2}{5}\le \delta \le t(q-1)+\frac{4q-6}{5}\) and \(1\le j<i\le \delta \), then \((C_{i},C_{j})\) is a skew asymmetric pair with \(1\le j<i\le \delta \) if and only if \(i=\frac{mq+m-5\ell }{5}\) and \(j=\frac{5\ell q-mq-m}{5}\), where \(1\le \ell \le 2t+1\) and \(\frac{5\ell }{2} < m\le \min \{5t+3,5\ell -1\}\).

  5. (v)

    If \(tq+\frac{4q-1}{5}\le \delta \le t(q-1)+q-2\) and \(1\le j<i\le \delta \), then \((C_{i},C_{j})\) is a skew asymmetric pair with \(1\le j<i\le \delta \) if and only if \(i=\frac{mq+m-5\ell }{5}\) and \(j=\frac{5\ell q-mq-m}{5}\), where \(1\le \ell \le 2t+1\) and \(\frac{5\ell }{2} < m\le \min \{5t+4,5\ell -1\}\).

Proof

We only prove the part (iv). The others are similar. We first handle the case when \(\delta =t(q-1)+\frac{4q-6}{5}\).

Let i and j be integers with \(1\le j<i\le t(q-1)+\frac{4q-6}{5}\). If \(C_{j}=-qC_{i}\), then \(iq+j\equiv 0(\bmod \ n)\). By carrying on two sides modulo \(q-1\), we have \(i+j\equiv 0(\bmod \ q-1)\). Since \(2< i+j< (2t+1)(q-1)+\frac{3q-7}{5}\), it follows that \(i+j=\ell (q-1)\), where \(1\le \ell \le 2t+1\). Then \(j=\ell (q-1)-i\). Plugging it into \(iq+j\equiv 0(\bmod \ n)\), we have \(i+\ell \equiv 0(\bmod \ \frac{q+1}{5})\). So, i and j can be written in the form \(i=\frac{mq+m-5\ell }{5}\) and \(j=\frac{5\ell q-mq-m}{5}\), respectively. We now work out the range of m and \(\ell \).

Since \(1\le j< i\) and \(i+j=\ell (q-1)\), it follows that \(\frac{\ell (q-1)}{2} < i\le \ell (q-1)-1\). From \(i>\frac{\ell (q-1)}{2} \), we have \(m>\frac{5\ell }{2}\). From \(2\le i\le \frac{(5t+4)q-5t-6}{5}\) and \(1\le t\le 2t+1\), we get \(m(q+1)-5\ell \le (5t+3)(q+1)+q-10t-9\), which implies that \(m\le 5t+3\). Suppose \(m\ge 5\ell \), then \(i\ge \ell q\), which contradicts the condition \(i\le \ell (q-1)-1\). So, it must be \(m\le 5\ell -1\), which means \(i\le \ell q-\frac{q+1}{5}\). Since \(\ell \le 2t\le \lceil \frac{q-14}{5}\rceil \) and \(q\ge 19\), the condition \(i\le \ell (q-1)-1\) is met. Thus, \(\frac{5\ell }{2} < m\le \min \{5t+3,5\ell -1\}.\)

Conversely, suppose that \(i=\frac{mq+m-5\ell }{5}\) and \(j=\frac{5\ell q-mq-m}{5}\), where \(1\le \ell \le 2t+1\) and \(\frac{5\ell }{2} < m\le \min \{5t+3,5\ell -1\}\). It can be checked that \(1\le j<i\) and \(iq+j=\frac{m(q^{2}-1)}{5}\equiv 0(\bmod \ n)\). Hence, \(C_{j}=-qC_{i}\), i.e., \((C_{i},C_{j})\) is a skew asymmetric pair.

So far, we already show that the result (iv) holds true for \(\delta =t(q-1)+\frac{4q-6}{5}\). For a given integer t with \(1\le t\le \lceil \frac{q-14}{10}\rceil \), notice that when \(\ell =t+1\) and \(m=5t+3\), the integer \(i\in \mathbb {Z}_{n}\) such that \((C_{i},C_{j})\) is a skew asymmetric pair has the largest value \(tq+\frac{3q-2}{5}\). Thus, the result (iv) works for \(tq+\frac{3q-2}{5}\le \delta \le t(q-1)+\frac{4q-6}{5}\). \(\square \)

The following result is necessary to compute the number c of maximally entangled states, which can be directly derived from Lemma 4.

Lemma 10

Assume that \(n=\frac{q^{2}-1}{5}\), where \(q\ge 19\) and \(5\mid (q+1)\). Then \(C_{i}\) is skew symmetric if and only if \(i=\frac{mq+m-5\ell }{5}\) and \(m=\frac{5\ell }{2}\), where \(\ell \) is even and \(2\le \ell \le \frac{2(q-4)}{5}\).

Let \(T=\bigcup _{i=1}^{\delta } C_{i}\), where \(\delta \) is in one of the five ranges:

  • (R1) \(tq-1\le \delta \le t(q-1)+\frac{q-4}{5}\).

  • (R2) \(tq+\frac{q-4}{5}\le \delta \le t(q-1)+\frac{2q-3}{5}\).

  • (R3) \(tq+\frac{2q-3}{5}\le \delta \le t(q-1)+\frac{3q-7}{5}\).

  • (R4) \(tq+\frac{3q-2}{5}\le \delta \le t(q-1)+\frac{4q-6}{5}\).

  • (R5) \(tq+\frac{4q-1}{5}\le \delta \le t(q-1)+q-2\).

Next, we calculate the number of the elements in \({T_{1}}\) in the above five ranges, respectively. We first consider the range (R1). Similar to the case in Section 3, we define the following notations. For a fixed integer \(\ell \) with \(1\le \ell \le 2t\), let

$$\begin{aligned} \mathcal {L}^{(\ell )}_{m}= & {} \left\{ m~ \mid ~\frac{5\ell }{2}< m\le \min \{5t,5\ell -1\}\right\} ,\\ \mathcal {S}^{(\ell )}_{i}= & {} \left\{ i~ \mid ~i=\frac{mq+m-5\ell }{5},~\text {for}~\frac{5\ell }{2}< m\le \min \{5t,5\ell -1\}\right\} ,\\ \mathcal {T}^{(\ell )}_{j}= & {} \left\{ j~ \mid ~j=\frac{5\ell q-mq-m}{5},~\text {for}~\frac{5\ell }{2}< m\le \min \{5t,5\ell -1\}\right\} . \end{aligned}$$

Write \(N^{(\ell )}=\mid \mathcal {S}^{(\ell )}_{i}\cup \mathcal {T}^{(\ell )}_{j}\mid \).

Lemma 11

Let \(n=\frac{q^{2}-1}{5}\), where \(q\ge 19\) and \(5\mid (q+1)\). Assume that \(1\le t\le \lceil \frac{q-14}{10}\rceil \). If \(T=\bigcup _{i=1}^{\delta } C_{i}\), where \(tq-1\le \delta \le t(q-1)+\frac{q-4}{5}\), then \(\mid {T_{1}}\mid =5t^{2}\).

Proof

For a given integer t with \(1\le t\le \lceil \frac{q-14}{10}\rceil \), set \(\lambda = t(q-1)+\frac{q-4}{5}\) and \(T_{\lambda }=\bigcup _{i=1}^{\lambda } C_{i}\). By Lemma 9 (i), we only need to compute \(\mid T_{\lambda }\cap -qT_{\lambda }\mid \).

Let i and j be integers with \(1\le j\le i \le \lambda \). From Lemmas 9 (i) and 10, \(i=\frac{mq+m-5\ell }{5}\), where \(1\le \ell \le 2t\) and

$$\begin{aligned} \frac{5\ell }{2}\le m\le \min \{5t,5\ell -1\}. \end{aligned}$$
(4)

When \(1\le \ell \le t\), \(\min \{5t,5\ell -1\}=5\ell -1\); when \(t+1\le \ell \le 2t\), \(\min \{5t,5\ell -1\}=5t\). Note that \(1\le \ell \le 2t\). Denote \(T_{\ell }^{(o)}=\{1,3,\ldots ,2t-1\}\) and \(T_{\ell }^{(e)}=\{2,4,\ldots ,2t\}\). Let

$$\begin{aligned} T^{(o)}_{i}= & {} \left\{ i~ \mid ~i=\frac{mq+m-5\ell }{5},~\text {for}~\ell \in T_{\ell }^{(o)} \right\} ,\\ T^{(e)}_{i}= & {} \left\{ i~ \mid ~i=\frac{mq+m-5\ell }{5},~\text {for}~\ell \in T_{\ell }^{(e)} \right\} ,\\ T^{(o)}_{j}= & {} \left\{ j~ \mid ~j=\frac{5\ell q-mq-m}{5},~\text {for}~\ell \in T_{\ell }^{(o)} \right\} ,\\ T^{(e)}_{j}= & {} \left\{ j~ \mid ~j=\frac{5\ell q-mq-m}{5},~\text {for}~\ell \in T_{\ell }^{(e)} \right\} . \end{aligned}$$

Hence,

$$\begin{aligned} \mid {T_{1}}\mid =\mid T_{\lambda }\cap -qT_{\lambda }\mid =\mid T^{(o)}_{i}\cup T^{(o)}_{j}\mid +\mid T^{(e)}_{i}\cup T^{(e)}_{j}\mid . \end{aligned}$$

We now deal with the two cases where t is odd and even.

  • Case 1: t is odd. When \(\ell \) takes an odd integer with \(1\le \ell \le 2t\), then \(\frac{5\ell +1}{2} \le m\le \min \{5t,5\ell -1\}\). From Lemma 10, we have \(j<i\). If \(1\le \ell \le t\), then \(\mid \mathcal {L}^{(\ell )}_{m}\mid =5\ell -1-\frac{5\ell +1}{2}+1=\frac{5\ell -1}{2}\) and \(N^{(\ell )}=2\mid \mathcal {L}^{(\ell )}_{m}\mid =5\ell -1\). If \(t+1\le \ell \le 2t\), then \(\mid \mathcal {L}^{(\ell )}_{m}\mid =5t-\frac{5\ell +1}{2}+1=5t-\frac{5\ell }{2}+\frac{1}{2}\) and \(N^{(\ell )}=2\mid \mathcal {L}^{(\ell )}_{m}\mid =10t-5\ell +1\). Moreover,

    $$\begin{aligned} N^{(1)}+N^{(3)}+\cdots +N^{(t)}=\frac{\left( N^{(1)}+N^{(t)}\right) \cdot \frac{t+1}{2}}{2}=\frac{5t^{2}+8t+3}{4} \end{aligned}$$

    and

    $$\begin{aligned} N^{(t+2)}+N^{(t+4)}+\cdots +N^{(2t-1)}=\frac{\left( N^{(t+2)}+N^{(2t-1)}\right) \cdot \frac{t-1}{2}}{2}=\frac{5t^{2}-8t+3}{4}. \end{aligned}$$

    Hence,

    $$\begin{aligned} \mid T^{(o)}_{i}\cup T^{(o)}_{j}\mid =\frac{5t^{2}+8t+3}{4}+\frac{5t^{2}-8t+3}{4}=\frac{5t^{2}+3}{2}. \end{aligned}$$

    When \(\ell \) takes an even integer with \(1\le \ell \le 2t\), then \(\frac{5\ell +1}{2} \le m\le \min \{5t,5\ell -1\}\). From Lemma 10, \(C_{i}\) is skew symmetric, which is equivalent to \(i=j\) or \(m=\frac{5\ell }{2}\). When \(j<i\), \(\frac{5\ell +1}{2}\le m\le \min \{5t,5\ell -1\}\). If \(1\le \ell \le t\), then \(\mid \mathcal {L}^{(\ell )}_{m}\mid =3\ell -1-\frac{3\ell +2}{2}+1=\frac{3\ell -2}{2}\) and \(N^{(\ell )}=2\mid \mathcal {L}^{(\ell )}_{m}\mid +1=5\ell -1\). If \(t+1\le \ell \le 2t\), then \(\mid \mathcal {L}^{(\ell )}_{m}\mid =5t-\frac{5\ell +2}{2}+1=5t-\frac{5\ell }{2}\) and \(N^{(\ell )}=2\mid \mathcal {L}^{(\ell )}_{m}\mid +1=10t-5\ell +1\). Moreover,

    $$\begin{aligned} N^{(2)}+N^{(4)}+\cdots +N^{(t-1)}=\frac{\left( N^{(2)}+N^{(t-1)}\right) \cdot \frac{t-1}{2}}{2}=\frac{5t^{2}-2t-3}{4} \end{aligned}$$

    and

    $$\begin{aligned} N^{(t+1)}+N^{(t+3)}+\cdots +N^{(2t)}=\frac{\left( N^{(t+1)}+N^{(2t)}\right) \cdot \frac{t+1}{2}}{2}=\frac{5t^{2}+2t-3}{4}. \end{aligned}$$

    Hence, \(\mid T^{(e)}_{i}\cup T^{(e)}_{j}\mid =\frac{5t^{2}-2t-3}{4}+\frac{5t^{2}+2t-3}{4}=\frac{5t^{2}-3}{2}.\) Thus, \(\mid {T_{1}}\mid =\frac{5t^{2}+3}{2}+\frac{5t^{2}-3}{2}=5t^{2}.\)

  • Case 2: t is even. When \(\ell \) takes an odd integer with \(1\le \ell \le 2t\), in the same way, we have

    $$\begin{aligned} N^{(1)}+N^{(3)}+\cdots +N^{(t-1)}=\frac{\left( N^{(1)}+N^{(t-1)}\right) \cdot \frac{t}{2}}{2}=\frac{5t^{2}-2t}{4} \end{aligned}$$

    and

    $$\begin{aligned} N^{(t+1)}+N^{(t+4)}+\cdots +N^{(2t-1)}=\frac{\left( N^{(t+1)}+N^{(2t-1)}\right) \cdot \frac{t}{2}}{2}=\frac{5t^{2}+2t}{4}. \end{aligned}$$

    Hence,

    $$\begin{aligned} \mid T^{(o)}_{i}\cup T^{(o)}_{j}\mid =\frac{5t^{2}-2t}{4}+\frac{5t^{2}+2t}{4}=\frac{5t^{2}}{2}. \end{aligned}$$

    When \(\ell \) takes an even integer with \(1\le \ell \le 2t\), in the same way, we have

    $$\begin{aligned} N^{(2)}+N^{(4)}+\cdots +N^{(t)}=\frac{\left( N^{(2)}+N^{(t)}\right) \cdot \frac{t}{2}}{2}=\frac{5t^{2}+8t}{4} \end{aligned}$$

    and

    $$\begin{aligned} N^{(t+2)}+N^{(t+4)}+\cdots +N^{(2t)}=\frac{\left( N^{(t+2)}+N^{(2t)}\right) \cdot \frac{t}{2}}{2}=\frac{5t^{2}-8t}{4}. \end{aligned}$$

    Hence, \(\mid T^{(e)}_{i}\cup T^{(e)}_{j}\mid =\frac{5t^{2}+8t}{4}+\frac{5t^{2}-8t}{4}=\frac{5t^{2}}{2}.\) Thus, \(\mid {T_{1}}\mid =\frac{5t^{2}}{2}+\frac{5t^{2}}{2}=5t^{2}.\)

This completes the proof. \(\square \)

For the ranges (R2) to (R5), we can similarly compute the exact values of \(\mid {T_{1}}\mid \). The proofs are omitted here.

Lemma 12

Let \(n=\frac{q^{2}-1}{5}\), where \(q\ge 19\) and \(5\mid (q+1)\). Assume that \(1\le t\le \lceil \frac{q-14}{10}\rceil \).

  1. (i)

    If \(tq+\frac{q-4}{5}\le \delta \le t(q-1)+\frac{2q-3}{5}\), then \(\mid {T_{1}}\mid =5t^{2}+2t\).

  2. (ii)

    If \(tq+\frac{2q-3}{5}\le \delta \le t(q-1)+\frac{3q-7}{5}\), then \(\mid {T_{1}}\mid =5t^{2}+4t\).

  3. (iii)

    If \(tq+\frac{3q-2}{5}\le \delta \le t(q-1)+\frac{4q-6}{5}\), then \(\mid {T_{1}}\mid =5t^{2}+6t+2\).

  4. (iv)

    If \(tq+\frac{4q-1}{5}\le \delta \le t(q-1)+q-2\), then \(\mid {T_{1}}\mid =5t^{2}+8t+4\).

Let \(\mathcal {C}\) be a cyclic code in \(\mathbb {F}_{q^{2}}[x]/\langle x^{n}-1\rangle \) and have defining set \(T=\bigcup _{i=1}^{\delta } C_{i}\). Now, we construct EAQMDS codes with length \(n=\frac{q^{2}-1}{5}\) from the cyclic code \(\mathcal {C}\).

Theorem 2

Let \(q\ge 19\) be a power of any prime. Let \(n=\frac{q^{2}-1}{5}\) with \(5\mid (q+1)\). For an integer t with \(1\le t\le \lceil \frac{q-14}{10}\rceil \), q-ary EAQMDS codes with the following parameters can be constructed from \(\mathcal {C}\).

  1. (i)

    \([[n,n-2d+5t^{2}+2,d;5t^{2}]]_{q}\), where \(tq\le d\le t(q-1)+\frac{q+1}{5}\).

  2. (ii)

    \([[n,n-2d+5t^{2}+2t+2,d;5t^{2}+2t]]_{q}\), where \(tq+\frac{q+1}{5}\le d\le t(q-1)+\frac{2q+2}{5}\).

  3. (iii)

    \([[n,n-2d+5t^{2}+4t+2,d;5t^{2}+4t]]_{q}\), where \(tq+\frac{2q+2}{5}\le d\le t(q-1)+\frac{3q-2}{5}\).

  4. (iv)

    \([[n,n-2d+5t^{2}+6t+4,d;5t^{2}+6t+2]]_{q}\), where \(tq+\frac{3q+3}{5}\le d\le t(q-1)+\frac{4q-1}{5}\).

  5. (v)

    \([[n,n-2d+5t^{2}+8t+6,d;5t^{2}+8t+4]]_{q}\), where \(tq+\frac{4q+4}{5}\le d\le (t+1)(q-1)\).

Proof

For a fixed integer t with \(1\le t\le \lceil \frac{q-14}{10}\rceil \), suppose that \(\mathcal {C}\) is the cyclic code in \(\mathbb {F}_{q^{2}}[x]/\langle x^{n}-1\rangle \) with defining set \(T=\bigcup _{i=1}^{\delta } C_{i}\), where \(tq-1\le \delta \le t(q-1)+\frac{q-4}{5}\). Note that \(C_{i}\) contains only one element. This gives that \(\mid T\mid =\delta \) and \(\dim (\mathcal {C})=n-\delta \). From the BCH bound, \(d(\mathcal {C})\ge \delta +1\). Therefore, \(\mathcal {C}\) has parameters \([n,n-\delta ,\delta +1]\) and is a MDS code. From Lemma 11, \(\mid {T_{1}}\mid =5t^{2}\). By Lemma 3, an \([[n,n-2d+5t^{2}+2,d;5t^{2}]]_{q}\) EAQEC code can be obtained from \(\mathcal {C}\), where \(tq\le d\le t(q-1)+\frac{q+1}{5}\). It can be verified that its parameters meet the equality \(2d=n-k+c+2\). Moreover, \(d\le \frac{n+2}{2}\). Thus, the resulting EAQEC code is EAQMDS. This proves the result (i). By using Lemma 12 to the cyclic codes with the ranges (R2)-(R5) respectively, we can gained the latter four classes of EAQMDS codes in a similar way. \(\square \)

5 Comparison and Discussion

In this paper, by exploring cyclotomic cosets, we find new EAQMDS codes with length \(\frac{q^{2}-1}{r}\) in the cases when \(r=3\) and \(r=5\), where \(r\mid (q+1)\). We introduce the parameter t and describe the relation between the minimum distances d and the number c of maximally entangled states, where the range of t is determined by the field size q. This enables us to construct many EAQMDS codes with minimum distance not less than q and flexible parameters for pre-shared entangled states. Most of the previously known work on EAQMDS codes of length \(n=\frac{q^{2}-1}{r}\) only considered the case that q is an odd prime power [3, 6, 16,17,18,19]. The constructions in this paper place on the general case that q is any prime power. We list the resulting EAQMDS codes in Table 1. In the following, we compare our EAQMDS codes with those in the known literature.

Table 1 Parameters of the EAQMDS codes constructed in this paper
Table 2 Comparison with the EAQMDS codes constructed in Ref. [16]
Table 3 Some new EAQMDS codes and comparisons

In [16], by using cyclic code, Lu et al. found EAQMDS codes with even length and minimum distance greater than \(q+1\). We list and compare the parameters between the EAQMDS codes in [16] and the EAQMDS codes here in Table 2. It is easy to find that the parameters in [16] are a special case when \(t=1\). So, the EAQMDS codes here contain all the EAQMDS codes in [16]. In addition, the finite size q can take any even prime power. Thus, the EAQMDS codes here not only generalize the results in [16], but also resolve the case when q is an even prime power.

In [27], Pang et al. gained EAQMDS codes with parameters \([[\frac{q^{2}-1}{r},\frac{q^{2}-1}{r}-2d+2m+1,d;2m-1]]_{q}\), where \(r\mid (q+1)\), \(1\le m\le \frac{r-1}{2}\) and \(\frac{(r+2m-1)(q+1)}{2r}\le d\le \frac{(q-1)r+(2m+1)(q+1)}{2r}\). It is easy to see that the minimum distance of these codes is less than q. We list some EAQMDS codes when q is an even prime power in Table 3 and compare them with our parameters. It can be seen that the EAQMDS codes here have higher error-correcting capability.

In [33], Wang et al. constructed EAQEC codes of length \(n=\frac{q-1}{r}(q+1)\) with flexible the number of maximally entanglement bits, where q is any prime power. However, the construction was considered under the condition that \(r\mid (q-1)\). As \(\gcd (q-1,q+1)=1\) or 2, the code lengths are different from those of the EAQMDS codes here.

The construction here is through determining the number of cyclotomic cosets in \({T_{1}}\) associated with the defining set of a cyclic code over \(\mathbb {F}_{q^{2}}\). By introducing the variable t, the parameter t and c are linked in an expression. In addition, the construction allows the finite size q to take any prime power. Hence, our construction can produce many new EAQMDS codes with large minimum distance and changeable parameters. However, we only establish the connection among the minimum distance d, the number c of maximally entangled states and the variable t. It would be interesting to find the relation among d, c and r so as to construct more new EAQMDS codes.