1 Introduction

Quantum information can protect messages between sender and receiver avoiding decoherence by encoding it into quantum error-correcting codes. Entanglement-assisted quantum error-correcting codes (EAQEC codes for short) are crucial to quantum information theory (see [1,2,3,4, 12]). Recently, construction of good quantum codes via classical codes is a hot topic for quantum information and quantum computing (see [16, 17, 20, 22, 24]). EAQEC codes use preexisting entanglement between the sender and the receiver to improve information rate. Many researchers have been devoted to obtaining EAQEC codes via classical liner codes, such as negacyclic codes and generalized Reed–Solomon codes. It has been shown that EAQEC codes have some advantages over standard stabilizer codes. For example, only a dual-containing classical linear quaternary code can be transformed into a standard stabilizer code, but any classical linear quaternary code can be transformed into an EAQEC code. Some of them can be summarized as follows.

In [13, 23], some new EAQEC codes with good parameters via cyclic and constacyclic codes are constructed. In [5], new decomposition of negacyclic codes are proposed, by which four new classes of EAQEC codes have been constructed. In [7], Fan et al. constructed some classes of EAQMDS codes based on classical maximum distance separable (MDS for short) codes by exploiting one or more pre-shared maximally entangled states. In [22], Qian and Zhang constructed some new classes of MDS linear complementary dual (LCD) codes with respect to Hermitian inner product. As applications, they have constructed new families of EAQMDS codes. In [9], Guenda et al. showed that the number of shared pairs required to construct an EAQEC code is related to the hull of classical codes. Using this fact, they put forward new methods to construct EAQEC codes requiring desirable amounts of entanglements. The EA-\(Singleton\;bound\) for an \([[n,k,d;c]]_{q}\) EAQEC code is

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

A q-ary EAQEC code attaining this bound is said to be an EAQMDS code. In this paper, we will construct EAQMDS codes via cyclic codes by improving the method introduced in [23].

Our main contribution is the construction of EAQMDS codes with parameters

  1. (1)

    \({\Big [\Big [n,n-4qm+4m^2+3,2m(q-1);(2m-1)^{2}\Big ]\Big ]_{q}}\) where \(1\le m \le \lfloor \frac{q+1}{4t}\rfloor ,\; n=\frac{q^2-1}{t} \quad {\text {and}}\quad t\mid q^2-1.\) (Theorem 3.1)

  2. (2)

    \({\Big [\Big [n,n-4mq+4q+4m^2-8m+3,2(m-1)q+2;4(m-1)^2+1\Big ]Big]_{q}}\) where \(2\le m \le \lfloor \frac{q+1}{4t}\rfloor ,\;n=\frac{q^2+1}{t}\quad {\text {and}} \quad t\mid q^2+1.\) (Theorem 3.2)

We will present some known results of EAQMDS codes, which are depicted in Table 1.

Table 1 Some known constructions on EAQMDS codes with parameters \([[n,k,d;c]]_q\) (q is an odd prime power)

This paper is organized as follows: In Sect. 2, we will introduce some basic acknowledge and useful results on cyclic codes and EAQEC codes. In Sect. 3, we will present our main results on the constructions of new EAQMDS codes. In Sect. 4, we will make a conclusion.

2 Preliminaries

2.1 Cyclic code

In this section, we introduce some basic notations and useful results on linear codes and cyclic codes. Let \(\mathbb {F}_{q}\) be the \(finite \;field\) of cardinality q, where q is an odd prime power. An \([n,k,d]_{q}\) code is an \(\mathbb {F}_{q}\)-linear subspace of \(\mathbb {F}^{n}_{q}\) with dimension k and minimum distance d. The \( Singleton\; bound\) states that

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

The code attaining the Singleton bound is called MDS code. When \(d=n-k\), the code is called almost MDS. Let \({\mathbf {u}}=(u_{0},\ldots ,u_{n-1})\) and \({\mathbf {v}}=(v_{0},\ldots ,v_{n-1})\) be two vectors in \( \mathbb {F}_{q^2}^{n}.\) The \( Hermitian\; inner\; product\) is defined by

$$\begin{aligned} \langle {\mathbf {u}},{\mathbf {v}} \rangle _{H}=u_{0}v_{0}^{q}+u_{1}v_{1}^{q}+\cdots +u_{n-1}v_{n-1}^{q}. \end{aligned}$$

The \(Hermitian\; dual\) of an \(\mathbb {F}_{q^2}\)-linear code \(\mathcal {C}\) of length n is defined as

$$\begin{aligned} \mathcal {C}^{\perp _{ H}}=\{{\mathbf {u}}\in F_{q^2}^{n} \mid \langle {\mathbf {u}},{\mathbf {v}} \rangle _{H}=0 \quad \text {for all}\quad {\mathbf {v}}\in \mathcal {C}\}. \end{aligned}$$

The code \(\mathcal {C}\) is \(Hermitian\; self\)-orthogonal if \(\mathcal {C} \subseteq \mathcal {C}^{\perp _{ H}}\), and is \(Hermitian\; self\)-dual if \(\mathcal {C}= \mathcal {C}^{\perp _{ H}}\).

For \( \gcd (n,q)=1\), the \(q^2\)-\(cyclotomic\,\; coset\) of i modulo n is defined by

$$\begin{aligned} C_{i}=\{iq^{2j}(\text {mod}\, \,n )\mid j\in \mathbb {Z\}}. \end{aligned}$$

A linear code \(\mathcal {C}\) over \(\mathbb {F}_{q^2}\) is a \(cyclic \,\;code\) if for every codeword \((c_{1},c_{2},\ldots ,c_{n})\in \mathcal {C}\), its cyclic shift \((c_{n},c_{1},\ldots ,c_{n-1})\) is also a codeword in \(\mathcal {C}\). The cyclic code \(\mathcal {C}\) can be generated by a polynomial g(x),  where \(g(x)\mid x^n-1.\) The \(defining\,\; set\) of \(\mathcal {C}\) is given by \(T=\{0\le i \le n-1\mid g(\alpha ^{i})=0\},\) where \(\alpha \) is an n-th root of unity in some extension field of \(\mathbb {F}_{q^{2}} .\) It is easy to see that the defining set T is a union of some \(q^2\)-cyclotomic cosets. Then, the following property is given in [10, 19].

Proposition 2.1

(BCH bound) Let \(\delta \) be a positive integer with \(2\le \delta \le n.\) Assume that \(\mathcal {C}\) is a cyclic code of length n with defining set T. If T contains \(\delta -1\) consecutive elements \( \alpha ^{b},\alpha ^{b+1},\ldots ,\alpha ^{b+\delta -2}\), then minimum distance of \(\mathcal {C}\) is at least \(\delta \).

2.2 EAQEC code

In this section, we introduce some notations and useful results on EAQEC codes. For more details, see [7, 8, 11, 14, 21].

A q-ary \([[n,k,d;c]]_{q}\)EAQEC code \(\mathcal {C}\) has length n and can encode k logical qubits with minimum distance d. Here, c is the copies of maximally entangled Bell states. The code \(\mathcal {C}\) can correct up to at least \([\frac{d-1}{2}]\) quantum errors.

Recently, researchers proved that EAQEC code can be constructed from any classical linear code over \(\mathbb {F}_{q} \). The remaining problem is to calculate c. In [15], a new approach to determine c is proposed by Li et al.

Proposition 2.2

([15]) Let \(\mathcal {C}\) be an \([n,k,d]_{q^2}\) cyclic code with defining set T. Assume the decomposition of T is \(T=T_{ss}\bigcup T_{as}\), where \(T_{ss}=-qT\bigcap T\) and \(T_{as}=T\backslash T_{ss}\).

  1. (1)

    Let \(\mathcal {C}_{1}\) and \(\mathcal {C}_{2}\) be cyclic codes with defining set \(T_{ss}\) and \(T_{as}\), respectively. Then, \(\mathcal {C}_{1}^{\perp _{H}}\bigcap \mathcal {C}_{1}=\{0\}\) and \(\mathcal {C}_{2}^{\perp _{ H}}\subseteq \mathcal {C}_{2}.\)

  2. (2)

    There exists an \( [[n,n-2|T|+|T_{ss}|,d;|T_{ss}|]]_{q} \) EAQEC code.

3 New EAQMDS codes

3.1 Length \(n\mid q^2-1\)

In this subsection, we apply cyclic codes of length \(n\mid q^2-1\) to construct a new family of EAQMDS codes with length \(n\mid q^2-1\), where \(q\ge 3\) is an odd prime power. Firstly, the \(q^2\)-ary cyclotomic coset modulo n are singletons: \(C_{i}=\{ i\;(\text {mod} \;n)\}\). The following two lemmas will be used in our constructions.

Lemma 3.1

Let q be an odd prime power, \(t\mid q^2-1\) and \(n=\frac{q^2-1}{t}.\) Then,

$$\begin{aligned} -qC_{aq+b}=C_{-bq-a} \end{aligned}$$

where \(-\lfloor \frac{q-1}{2t}\rfloor \le a,b\le \lfloor \frac{q-1}{2t}\rfloor ,\) with \((a,b)\ne (-\lfloor \frac{q-1}{2t}\rfloor ,-\lfloor \frac{q-1}{2t}\rfloor ).\)

Proof

Note that \(|aq+b|\le \lfloor \frac{q^2-1}{2t}\rfloor \) and \(aq+b\ne -\lfloor \frac{q^2-1}{2t}\rfloor .\) Hence, all of \(aq+b\) are distinct. A straightforward calculation shows

$$\begin{aligned} -q(aq+b)&=-aq^2-bq\\&=-a(q^2-1)-a-bq\\&\equiv -bq-a \pmod {n}, \end{aligned}$$

which implies \(-qC_{aq+b}=C_{-bq-a}\). \(\square \)

Lemma 3.2

Let m be a positive integer with \(1\le m \le \lfloor \frac{q+1}{4t}\rfloor \) and \(n\mid q^2-1\) where q is an odd prime power. Decompose

$$\begin{aligned} T_{0}=\bigcup \limits _{-m\le i \le m-1,i\ne 0} A_{i} \end{aligned}$$

where

$$\begin{aligned} A_{i}= {\left\{ \begin{array}{ll} \{-mq+j \mid m+1\le j \le q-m\}, &{} {i=-m};\\ \{iq+j \mid m\le j \le q-m\}, &{} {-m+1 \le i \le m-2,\; i\ne 0};\\ \{mq+j \mid -q+m\le j \le -m-1\}, &{} {i=m-1}.\\ \end{array}\right. }. \end{aligned}$$

Then, \(-qT_{0}\bigcap T_{0}=\emptyset .\)

Proof

To show \(-qT_{0}\bigcap T_{0}=\emptyset ,\) it suffices to prove the following cases.

  • Case 1: \(-qA_i\bigcap A_{i'}=\emptyset \). On the contrary, suppose there exist \(j,j^{'}\) such that

    $$\begin{aligned} -q(iq+j)&=-iq^2-jq\;(\text {mod}\;n)\\&=-jq-i\;(\text {mod}\;n). \end{aligned}$$

    It is easy to verify that

    $$\begin{aligned} i^{'}=-j\quad \text {and} \quad j^{'}=-i. \end{aligned}$$

    It follows that \( -(q-m)\le i^{'}\le -m\; \text {and} \; -(m-2)\le j^{'}\le m-1\). Since \(-m+1\le i\le m-2\) and \(m\le j\le q-m\), which leads to a contradiction.

    Hence, \( -qA_{i} \bigcap A_{i^{'}}=\emptyset . \)

  • Case 2: \(-qA_i\bigcap A_{-m}=\emptyset \) and \(-qA_i\bigcap A_{m}=\emptyset \). On the contrary, suppose \(-qA_i\bigcap A_{-m}\ne \emptyset \), then there exist \(j,j^{'}\) such that

    $$\begin{aligned} -q(iq+j)&=-jq-i\;(\text {mod}\;n)\\&=-mq+j^{'}\;(\text {mod}\;n).\\ \end{aligned}$$

    where \(m\le j\le q-m \;\text {and}\; -q+m\le j^{'}\le -m-1\). As a consequence, \(-(m-2)\le -i\le m-1\) which is a contradiction.

    Assume \(-qA_i\bigcap A_{m}\ne \emptyset \), then there exist \(j,j^{''}\) such that

    $$\begin{aligned} -q(iq+j)&=-jq-i\;(\text {mod}\;n)\\&=mq+j^{''}\;(\text {mod}\;n)\\ \end{aligned}$$

    where \(m\le j\le q-m \;\text {and}\; m+1\le j^{''}\le q-m\). As a consequence, \(-(q-m)\le -j\le -m\). It is easy to verify \(-qA_i\bigcap A_{m}=\emptyset \).

  • Case 3: \(-qA_{-m}\bigcap A_{m}=\emptyset \) and \(-qA_m\bigcap A_{-m}=\emptyset \).

    On the contrary, suppose \(-qA_{-m}\bigcap A_{m}\ne \emptyset \), then there exist \(j,l^{'}\) such that

    $$\begin{aligned} -q(-mq+j)&=m(q^2-1)-jq+m\;(\text {mod}\;n)\\&=-jq+m\;(\text {mod}\;n)\\&=mq+l^{'}\;(\text {mod}\;n)\\ \end{aligned}$$

    where \(m+1\le j\le q-m\) and \(-(q-m)\le l^{'}\le -(m+1)\), which is a contradiction.

    Hence, \(-qA_{-m}\bigcap A_{m}=\emptyset \). Assume \(-qA_m\bigcap A_{-m}\le \emptyset \), then there exist \(j,l^{''}\) such that

    $$\begin{aligned} -q(mq+j)&=-m(q^2-1)-jq-m\;(\text {mod}\;n)\\&=-jq-m\;(\text {mod}\;n)\\&=-mq+l^{''}\;(\text {mod}\;n)\\ \end{aligned}$$

    where \(-(q-m)\le j\le -(m+1)\) and \(m+1\le l^{''}\le q-m\) which is a contradiction.

    Hence, \(-qA_{-m}\bigcap A_{m}=\emptyset \).

  • The remaining cases \(-qA_{-m}\bigcap A_{-m}=\emptyset \) and \(-qA_m\bigcap A_{m}=\emptyset \) can be proved in a similar way, and we omit the details.

Hence, we have \(-qT_{0}\bigcap T_{0}=\emptyset ,\) which completes the proof. \(\square \)

Now we will construct new EAQMDS codes with length \(n \mid q^2-1\).

Theorem 3.1

Let q be an odd prime power, \(t\mid q^2-1\) and \(n=\frac{q^2-1}{t}\). For any \(1\le m \le \lfloor \frac{q+1}{4t}\rfloor \), there exists EAQMDS code with parameters

$$\begin{aligned}{}[[n,n-4qm+4m^2+3,2m(q-1);(2m-1)^{2}]]_{q}. \end{aligned}$$

Proof

For \(1\le m \le \lfloor \frac{q+1}{4t}\rfloor ,\;\) assume that \(\mathcal {C}\) is a cyclic code of length \(n\mid q^2-1\) with defining set

$$\begin{aligned} T=\bigcup _{i=-mq+m+1}^{mq-m-1}C_{i} \end{aligned}$$

It is easy to check that \(\mathcal {C}\) has \(2qm-2m-1\) consecutive roots. Then, by Proposition 2.1, the minimum distance of \(\mathcal {C}\) is at least \(2qm-2m.\) It follows that \(\mathcal {C}\) is a cyclic code with parameters \([n,\;n-2qm+2m+1,\;2qm-2m]_{q^2}.\) In the following, we show that \(c=|T_{ss}|=(2m-1)^{2}\). Denote by

$$\begin{aligned} T_{0}=\bigcup _{i=-m,i\ne 0}^{m-1}A_{i}. \end{aligned}$$

According to Lemma 3.2, \(-qT_{0}\bigcap T_{0}=\emptyset .\) By Lemma 3.1,

$$\begin{aligned} \begin{array}{c} -q C_{1}= C_{-q},\;-q C_{q+1}= C_{-q-1},\ldots , -q C_{(m-1)q-1}=C_{q-(m-1)},\\ -q C_{2}= C_{-2q},\;-q C_{q+2}= C_{-2q-1},\ldots ,-q C_{(m-1)q-2}=C_{2q-(m-1)},\\ \vdots \\ -q C_{m-1}= C_{-(m-1)q},\;-q C_{q+(m-1)}\\ = C_{-(m-1)q-1},\ldots , -q C_{(m-1)q-(m-1)}= C_{(m-1)q-(m-1)}. \end{array} \end{aligned}$$

Obviously, \(-q C_{0}= C_{0}\) and it suffices to prove

$$\begin{aligned} T_{ss}=-qT \bigcap T=\bigcup _{-(m-1)\le a , b \le m-1} C_{aq+b}. \end{aligned}$$

For \( C_{aq+b}\subseteq T_{ss}\), there exist \(a^{'},b^{'}\) such that \(-qC_{aq+b}=C_{a^{'}q+b^{'}}\). The equality

$$\begin{aligned} -q(aq+b)\equiv a^{'}q+b^{'}\;(\text {mod}\;n) \end{aligned}$$

implies

$$\begin{aligned} a^{'}=-b,b^{'}=-a. \end{aligned}$$

Then, by Lemma 3.1, \(-qT_{ss}=T_{ss}\) and by Lemma 3.2\(-qT_{0}\bigcap T_{0}=\emptyset .\) By the standard counting arguments, \(\left| T_{ss}\right| =(2m-1)^{2}.\)

By Proposition 2.2, the EAQEC code with defining set T has parameters

$$\begin{aligned}{}[[n,n-4qm+4m^2+3,2m(q-1);(2m-1)^{2}]]_{q}. \end{aligned}$$

Also this code reaches the EA-Singleton bound,

$$\begin{aligned} n-k+c+2=4qm-4m=2d. \end{aligned}$$

Hence, the EAQMDS code with desired parameters is constructed. \(\square \)

Example 3.1

We list some new parameters of EAQMDS codes of Theorems 3.1 in Table 2.

Table 2 Some new parameters of EAQMDS codes

3.2 Length \(n|q^2+1\)

In this subsection, we try to construct some new EAQMDS codes with length \(n\;|\;q^2+1\). Here we assume n is even. Denote by \(t=\frac{q^2+1}{n}\)(it is an integer). The \(q^2\)-ary cyclotomic coset modulo n are

$$\begin{aligned} C_{0}=\{0\},\; C_{1}=\{1,\;n-1\},\; C_{2}=\{2,\;n-2\},\ldots , C_{\frac{n}{2}}=\left\{ \frac{n}{2}\right\} . \end{aligned}$$

The following two lemmas are similar to Lemmas 3.1 and 3.2.

Lemma 3.3

Let \(n=\frac{q^2+1}{t}\). Then,

$$\begin{aligned} -q C_{cq+d}= C_{dq-c}, \end{aligned}$$

where \(1\le c \le \lfloor \frac{q-1}{2t}\rfloor \) and \(0\le d \le \lfloor \frac{q-1}{2t}\rfloor \).

Proof

Note that \( C_{cq+d}=\{cq+d,\;-(cq+d)\}\; \text {with}\;\;cq+d\le \lfloor \frac{q^2-1}{2t}\rfloor \) for \(1\le c \le \lfloor \frac{q-1}{2t}\rfloor \) and \(0\le d \le \lfloor \frac{q-1}{2t}\rfloor \). A straightforward calculation shows

$$\begin{aligned} -q\cdot (-(cq+d))&=cq^2+dq\\&=c(q^2+1)-c+dq\\&\equiv dq-c\pmod {n}\\ \end{aligned}$$

which implies \(-q C_{cq+d}= C_{dq-c}\). \(\square \)

Lemma 3.4

Let \(n=\frac{q^2+1}{t}\), notations as in Lemma 3.3. For \(2\le m \le \lfloor \frac{q+1}{4t}\rfloor \), let

$$\begin{aligned} T_{1}=\bigcup _{0\le c\le m-2,\;m \le d\le \lfloor \frac{q-1}{2t}\rfloor } C_{cq+d}\bigcup _{1\le e\le m-1\le f\le \lfloor \frac{q-1}{2t}\rfloor } C_{eq-f}. \end{aligned}$$

Then, \(-qT_{1}\bigcap T_{1}=\emptyset \).

Proof

By Lemma 3.3,

$$\begin{aligned} -qT_{1}=\bigcup _{0\le c\le m-2,\;m \le d\le \lfloor \frac{q-1}{2t}\rfloor } C_{dq-c}\bigcup _{1\le e\le m-1\le f\le \lfloor \frac{q-1}{2t}\rfloor } C_{fq+e}. \end{aligned}$$

When \(m \le d\le \lfloor \frac{q-1}{2t}\rfloor \) and \(\;0\le c\le m-2\),

$$\begin{aligned} cq+d\le (m-2)q+\lfloor \frac{q-1}{2t}\rfloor \quad \text {and}\quad mq-m+2\le dq-c. \end{aligned}$$

Similarly,

$$\begin{aligned} eq-f\le (m-1)q+1-m\quad \text {and}\quad (m-1)q+1\le fq+e. \end{aligned}$$

It is easy to verify

$$\begin{aligned} cq+d\le dq-c,\;cq+d\le fq+e,\;eq-f\le dq-c,\;eq-f\le fq+e. \end{aligned}$$

Therefore, \(-qT_{1}\bigcap T_{1}=\emptyset \). \(\square \)

Theorem 3.2

Let \(n=\frac{q^2+1}{t}\). For any \(2\le m \le \lfloor \frac{q+1}{4t}\rfloor ,\) there exists an EAQMDS code with parameters

$$\begin{aligned} \left[ \left[ n,n-4mq+4q+4m^2-8m+3,2(m-1)q+2;4(m-1)^2+1\right] \right] _{q} \end{aligned}$$

Proof

For \(2\le m \le \lfloor \frac{q+1}{4t}\rfloor \), suppose \(\mathcal {C}\) is a cyclic code with length \(n=\frac{q^2+1}{t}\) and defining set \(T= C_{0}\bigcup C_{1}\bigcup C_{2}\bigcup \cdots \bigcup C_{(m-1)q}.\) It is easy to see that \(\mathcal {C}\) has \(2(m-1)q+1\) consecutive roots. Then, by Proposition 2.1, the minimum distance of \(\mathcal {C}\) is at least \(2(m-1)q+2.\) It follows that \(\mathcal {C}\) is a cyclic code with parameters \([n,\;n-2(m-1)q-1,\;2(m-1)q+1]_{q^2}.\) In the following, we show that \(\left| T_{ss}\right| =4(m-1)^{2}+1.\) Let

$$\begin{aligned} T_{1}=\bigcup _{0\le c\le m-2,\;m \le d\le \lfloor \frac{q-1}{2t}\rfloor } C_{cq+d}\bigcup _{1\le e\le m-1\le f\le \lfloor \frac{q-1}{2t}\rfloor } C_{eq-f}. \end{aligned}$$

According to Lemma 3.3,

$$\begin{aligned} \begin{array}{c} -q C_{1}= C_{q},\;-q C_{q+1}= C_{q-1},\ldots , -qC_{(m-2)q+1}= C_{q-(m-2)},\\ -q C_{2}= C_{2q},\;-q C_{q+2}= C_{2q-1},\ldots ,-q C_{(m-2)q+2}= C_{2q-(m-2)},\\ \vdots \\ -q C_{m-1}= C_{(m-1)q},\;-q C_{q+(m-1)}= C_{(m-1)q-1}\ldots ,\;-q C_{(m-2)q+(m-1)}= C_{(m-1)q-(m-2)}. \end{array} \end{aligned}$$

Obviously, \(-q C_{0}= C_{0}.\) It is easy to verify that \( T_{ss}=T\backslash T_{1}.\) Then, \(-qT_{ss}=T_{ss}\) and \(-qT_{1}\bigcap T_{1}=\emptyset .\) It is easy to see \(|T_{ss}|=4(m-1)^2+1.\) By Proposition 2.2, the EAQEC code with defining set T has parameters

$$\begin{aligned} \left[ \left[ n,n-4mq+4q+4m^2-8m+3,2(m-1)q+2;4(m-1)^2+1\right] \right] _{q} \end{aligned}$$

Also this code reaches the EA-Singleton bound,

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

Hence, the code \(\mathcal {C}\) is an EAQMDS code. \(\square \)

Example 3.2

We list some new parameters of EAQMDS codes of Theorems 3.2 in Table 3.

Table 3 Some new parameters of EAQMDS codes

Remark 3.1

From Examples 3.1 and 3.2, we can conclude that the required parameters of the EAQMDS codes constructed in Theorems 3.1 and 3.2 are more flexible than all codes listed in Table 1, since our results covers almost all possible factors of \(q^2\pm 1\). What’s more, the parameter c in our codes is unfixed. Compared to [23], we introduced a more general method (see Lemma 3.2) to find \(T_{as}\) and \(T_{ss}\); then, we solved the case length \(n\mid q^2-1\). Since the four parameters in our codes are flexible, it is easier to obtain a large number of EAQMDS codes from our constructions than those listed in Table 1. In [25], the authors constructed EAQMDS codes with length \(n=\frac{q-1}{a}(q+1)\). Since the length of their codes satisfies \(n\mid q-1\), our length can be a factor of \(q+1\). Then, we can construct some EAQMDS codes with new parameters that have never been reported. Besides, employing the EAQMDS codes obtained by Theorems 3.1 and 3.2, we can obtain EAQMDS codes with length different from \(q + 1\) and the required parameters can take all or almost all possible values. Some of them are listed in Table 2.

4 Conclusion

In this paper, we construct two new classes of EAQMDS codes with length \(n|q^2-1\) and \(n|q^2+1\) via classical cyclic codes. Our codes have more flexible parameters than known EAQEC codes. It may be possible to apply our methods to construct new EAQMDS codes via classical linear codes, such as generalized Reed–Solomon codes or constacyclic codes.