1 Introduction

Quantum error-correcting (QEC) codes were introduced to overcome decoherence during quantum communications and quantum computations. A q-ary QEC code of length n and size K is a K-dimensional subspace of a \(q^n\)-dimensional Hilbert space \(({\mathbb {C}}^q)^{\otimes n}.\) If a QEC code has minimum distance d, then it can detect up to d quantum errors and correct up to \(\lfloor \frac{d-1}{2}\rfloor \) quantum errors. Let \(k=\text {log}_qK\). We use \([[n,k,d]]_q\) to denote a q-ary QEC code of length n with size \(q^k\) and minimum distance d. It is well-known that the construction of QEC codes can be reduced to that of classical linear codes with certain dual-containing properties [2]. However, the dual-containing constraint forms an obstacle in the construction of QEC codes. In 2006, a significant breakthrough was made by Brun et al. [1], in which a more general framework named entanglement-assisted stabilizer formalism was introduced. The related codes are called entanglement-assisted quantum error-correcting (EAQEC) codes which can be possibly constructed from any classical codes by relaxing the duality condition and utilizing pre-shared entanglement between the sender and the receiver. After that, many families of EAQEC codes with good parameters have been constructed from classical linear codes. (See, for example, [7, 8, 10, 16,17,18, 22,23,24, 40, 43, 44] and the relevant references therein).

Let q be a prime power. A q-ary EAQEC code, 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. Actually, if \(c=0\), it is the standard \([[n,k,d]]_q\) QEC code. Hence, QEC codes can be seen as a special case of EAQEC codes. In this paper, we regard QEC codes as EAQEC codes. Similar to classical codes, the parameters of EAQEC codes are mutually restricted, and there is a so-called entanglement-assisted (EA) quantum Singleton bound for EAQEC codes.

Theorem 1.1

(EA-quantum Singleton bound)[1, 22, 42] For any \([[n,k,d;c]]_q\) EAQEC code with \(d \le \frac{n+2}{2}\), its parameters satisfy

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

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

An EAQEC code achieving this bound is called an EAQMDS code. If \(c=0\), it is the quantum Singleton bound and a code achieving such bound is called a quantum MDS code. Recently, for \(d > \frac{n+2}{2}\), Grassl [12] gave some examples of EAQEC codes beating such bound. As we know, EAQEC codes can be constructed from any classical codes without dual-containing condition. However, it is still hard to construct such codes, since it is difficult to determine the number of maximally entangled states during the construction. In 2018, a relationship between the number of maximally entangled states required to construct an EAQEC code from a classical code and the hull of classical code was obtained in [15], and some EAQEC codes with flexible parameters were also constructed. After that, many families of EAQMDS codes were constructed via the computation of the hull dimension of linear codes such as generalized Reed-Solomon codes and Goppa codes [3, 8, 11, 14, 25, 33, 34].

In 2014, Lu et al. [29] utilized the decomposition of the defining set of cyclic codes to determine the number of maximally entangled states, which transmitted the determination of c into determining a subset of the defining set of the underlying codes, and they also constructed some EAQMDS codes with large minimum distance. Later, Lu et al. [30] and Chen et al. [4] generalized the concept of the decomposition of the defining set of cyclic codes to that of constacyclic codes, respectively, and some new EAQMDS codes were also constructed. Since then, many families of EAQMDS codes with lengths divide \(q^2\pm 1\) have been constructed via the decomposition of the defining set of constacyclic codes (including cyclic codes and negacyclic codes) due to their excellent algebraic structure. (See [4,5,6, 19, 21, 26, 28, 30,31,32, 36,37,39, 41, 42] and the relevant references therein).

Actually, EAQEC codes can be directly derived from QEC codes. Lai and Brun [23] first showed that any (nondegenerate) standard [[nkd]] stabilizer code can be transformed into an \([[n-c,k,d;c]]\) EAQEC code, where \(0\le c\le n-k\), and the obtained EAQEC codes are equivalent to standard stabilizer codes. Furthermore, the decoding techniques of standard stabilizer codes are also suitable for EAQEC codes. Recently, Galindo et al [10] generalized [23] to arbitrary finite fields, and some new EAQEC codes were constructed through QEC codes by considering the symplectic, Hermitian and Euclidean duality, respectively. Very recently, Grassl, Huber and Winter [13] showed that any pure QEC code yields an EAQEC code with the same distance and dimension, but of shorter block length, i.e. if there is a pure QEC code with parameters \([[n,k,d]]_q\), then an EAQEC code with parameters \([[n-c,k,d;c]]_q\) exists for all \(c<d\).

In this paper, based on the decomposition of the defining set of negacyclic codes, we construct some families of EAQMDS codes with parameters \([[\frac{{{q^2} - 1}}{a},\frac{{{q^2} - 1}}{a} - 2d + 2+c,d;c]]_q\) by exploiting less pre-shared maximally entangled states c, where qlm are in the following cases:

  1. (1)

    q is a prime power with the form \(q = am \pm l\), \(a = {l^2} - 1\), l is an odd integer, and m is a positive integer;

  2. (2)

    q is a prime power with the form \(q = am \pm l\), \(a = \frac{{l^2} - 1}{2}\), \(l \equiv 1 \mod 4\) or \(l \equiv 3 \mod 4\), and m is a positive integer.

In Table 1, we list the concrete parameters of the EAQMDS codes constructed in this paper.

Table 1 New EAQMDS codes

The paper is organized as follows. In Sect. 2, some notations and basic results of negacyclic codes and EAQEC codes are presented. In Sects. 3 and 4, some new families of EAQMDS codes with small pre-shared entangled states are derived from negacyclic codes. The conclusion is given in Sect. 5.

2 Preliminaries

Let q be a prime power and \({\mathbb {F}}_{q^2}\) be the Galois field with \(q^2\) elements. A \(q^2\)-ary linear code \({\mathcal {C}}\) of length n with dimension k and minimum distance d, denoted by \([n,k,d]_{q^2}\), is a linear subspace of \({\mathbb {F}}_{q^2}^n\). The parameters of \({\mathcal {C}}\) satisfy the well-known Singleton bound: \(d\le n-k+1\), and the code \({\mathcal {C}}\) with \(d = n-k+1\) is called a maximum distance separable (MDS) code.

Given two vectors \({{\textbf {x}}}=(x_0,x_1,\ldots ,x_{n-1})\) and \({{\textbf {y}}}=(y_0,y_1,\ldots ,y_{n-1}) \in {\mathbb {F}}_{q^2}^n\), their Hermitian inner product is defined as

$$\begin{aligned} ({{\textbf {x}}},{{\textbf {y}}})_h:=x_0y_0^q+x_1y_1^q+\cdots +x_{n-1}y_{n-1}^q. \end{aligned}$$

The vectors \({{\textbf {x}}}\) and \({{\textbf {y}}}\) are orthogonal with respect to the Hermitian inner product if \(({{\textbf {x}}},{{\textbf {y}}})_h=0\). For a \(q^2\)-ary linear code \({\mathcal {C}}\) of length n, the Hermitian dual code of \({\mathcal {C}}\) is defined as

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

If \({\mathcal {C}}^{\perp _h}\subseteq {\mathcal {C}}\), then \({\mathcal {C}}\) is said to be Hermitian dual-containing, and \( {\mathcal {C}}\) is said to be Hermitian self-dual if \({\mathcal {C}} = {\mathcal {C}}^{\perp _h}\).

A \(q^2\)-ary linear code of length n is called negacyclic if it is invariant under the negacyclic shift of \({\mathbb {F}}_{q^2}^n\), i.e.

$$\begin{aligned} (c_0,c_1,\ldots ,c_{n-1}) \mapsto (-c_{n-1},c_0,\ldots ,c_{n-2}). \end{aligned}$$

For a negacyclic code \({\mathcal {C}}\), each codeword \({{\textbf {c}}}=(c_0,c_1,\ldots ,c_{n-1})\) is customarily identified with its polynomial representation \(c(x): = {c_0} + {c_1}x + \cdots + {c_{n - 1}}{x^{n - 1}}\), and the code \({\mathcal {C}}\) is in turn identified with the set of all polynomial representations of its codewords. Then we can see that xc(x) corresponds to a negacyclic shift of c(x) in the quotient ring \({\mathcal {R}}:={\mathbb {F}}_{q^2}[x]/\langle x^n+1\rangle \). It is well-known that a linear code \({\mathcal {C}}\) over \({\mathbb {F}}_{q^2}\) is negacyclic if and only if \({\mathcal {C}}\) is an ideal of the ring \({\mathcal {R}}\). In fact, every ideal of \({\mathbb {F}}_{q^2}[x]/\langle x^n+1\rangle \) is a principal ideal, so each negacyclic code \({\mathcal {C}}\) can be generated by a monic divisor g(x) of \(x^n+1\), which has the minimal degree in \({\mathcal {C}}\).

Suppose that \(\gcd (n,q)=1\). Let \(\beta \in {\mathbb {F}}_{q^{2m}}\) be a primitive 2n-th root of unity and \(\xi ={\beta ^2}\), where m is the multiplicative order of \({q^2}\) modulo 2n, i.e. \(m=\text {ord}_{2n}({q^2})\). It follows that \(\xi \) is a primitive n-th root of unity. Hence, the roots of \(x^n+1\) are \(\beta ^{1+2j}\), where \(0\le j\le n-1\). Let \({\mathbb {Z}}_{2n}=\{0,1,\ldots ,2n-1\}\) and \(\Omega \) be the set of the elements with the form \(1+2j\) in \({\mathbb {Z}}_{2n}\). For any \(s\in {\mathbb {Z}}_{2n}\), the \(q^2\)-cyclotomic coset modulo 2n constains s is given by

$$\begin{aligned} C_s=\{s,sq^2,sq^4,\ldots ,sq^{2(m_s-1)}\}, \end{aligned}$$

where \(m_s\) is the smallest positive integer such that \(sq^{2m_s}\equiv s\ \text {mod}\ 2n\), and it is also called the size of \(C_s\), i.e. \(|C_s|=m_s\). For a negacyclic code \({\mathcal {C}}=\langle g(x)\rangle \) of length n over \({\mathbb {F}}_{q^2}\), its defining set is the set \(T=\{s\in \Omega ~| g(\beta ^s)=0\}\). It is easy to see that the set T is a union of some \(q^2\)-cyclotomic cosets modulo 2n and \(\dim {\mathcal {C}}=n- \left| T \right| \). The minimum distance of \({\mathcal {C}}\) also has the following well-known bound.

Lemma 2.1

[20, 35](BCH bound for negacyclic codes ) Let \({\mathcal {C}}\) be a \(q^2\)-ary negacyclic code of length n. If the generator polynomial g(x) of \({\mathcal {C}}\) has the elements \(\{\beta ^{1+2i} |~ b \le i \le b+\delta - 2\}\) as its roots, where \(\beta \) is a primitive 2n-th root of unity, then the minimum distance of \({\mathcal {C}}\) is at least \(\delta \).

Let \({\mathcal {C}}\) be a negacyclic code with defining set \({ \cup _{s \in \Omega }}{C_s}\). Denoting \(T^{-q} = \{2n - qs|s \in T\}\), then we can deduce that the defining set of \({\mathcal {C}}^{\perp _h}\) is \({T^{ \perp _h}} = {Z_n}\backslash {T^{ - q}}\). A cyclotomic coset \(C_s\) is skew-symmetric if \(2n-qs \mod 2n \in C_s\) and otherwise it is skew-asymmetric. If skew-asymmetric cosets \(C_s\) and \(C_{2n-qs}\) come in pair, then we use \((C_s,C_{2n-qs})\) to denote such a pair. Based on these definitions, we have the following result.

Lemma 2.2

[27] If \({\mathcal {C}}\) is a negacyclic code of length n over \({\mathbb {F}}_{q^2}\) with defining set T, then \({{\mathcal {C}}^{ \bot _ h}} \subseteq {\mathcal {C}} \) if and only if one of the following holds:

  1. (1)

    \(T \cap {T^{ - q}} = \emptyset \), where \(T^{-q} = \{2n - qs|s \in T\}\).

  2. (2)

    If \({i,j,k} \in T\), then \(C_i\) is not a skew-symmetric coset and \((C_j,C_k)\) is not a skew-asymmetric cosets pair.

According to Lemma 2.2, \({\mathcal {C}}^{\perp _h} \subseteq {\mathcal {C}} \) can be obtained by the relationship of its cyclotomic coset \(C_s\). Assume that \({\mathcal {C}}\) is a \(q^2\)-ary negacyclic code of length n with defining set T. Let \(T_{ss} = T \cap T^{-q}\) and \(T_{sas} = T\backslash T_{ss}\), where \(T^{-q} = \{2n - qs|s \in T\}\). Then, \(T = T_{ss} \cup T_{sas}\) is called a decomposition of the defining set of \({\mathcal {C}}\). Especially, \(T_{ss}\) and \(T_{sas}\) can be characterized by the following method.

Lemma 2.3

[30] Let \({\mathcal {C}}\) be a negacyclic code of length n over \({\mathbb {F}}_{q^2}\), and \(T = T_{ss} \cup T_{sas}\) be the decomposition of T.

  1. (1)

    If \(i,j \in T_{sas}\), then \(C_i\) is a skew-asymmetric coset, and \(C_i\) and \(C_j\) cannot form a skew-asymmetric cosets pair.

  2. (2)

    If \(i \in T_{ss}\), then either \(C_i\) is a skew-symmetric coset, or \(C_i\) is a skew-asymmetric coset and there is a \(j \in T\) such that \(C_i\) and \(C_j\) form a skew-asymmetric cosets pair.

Lemma 2.4

[30] Let \({\mathcal {C}}\) be a negacyclic code of length n over \({\mathbb {F}}_{q^2}\), where \(\gcd (n, q) = 1\). Suppose that T is the defining set of \({\mathcal {C}}\) and \(T = T_{ss} \cup T_{sas}\) is a decomposition of T. Then, the number of maximally entangled states required is \(c = |T_{ss}|\).

According to [30], one can construct EAQEC codes from negacyclic codes by decomposing its defining set in the following theorem.

Theorem 2.1

Let \({\mathcal {C}}\) be an \([n,k,d]_{q^2}\) negacyclic code with defining set T, and the decomposition of T be \(T=T_{ss} \cup T_{sas}\). Then there exists an EAQEC code with parameters \([[n,n-2\left| T \right| +\left| T_{ss} \right| ,d;\left| T_{ss} \right| ]]_q\).

Especially, if \(|T_{ss}|=0\), then there exists a QEC code with parameters \([[n, 2k-n,\ge d]]_q\). If \({\mathcal {C}}\) is a negacyclic code with defining set \(T=\cup _{j=a}^sC_{1+2j}\), where \(s\ge a\), then T can be also denoted as \(T(\delta )=\cup _{j=a}^{a+\delta -2}C_{1+2j}\), where \(\delta =s-a+2\). According to Theorem 2.1, there exists an EAQEC code with parameters \([[n,n-2\left| T(\delta ) \right| +\left| T_{ss}(\delta ) \right| ,d \ge \delta ;\left| T_{ss}(\delta ) \right| ]]_q\). In the following two sections, we will discuss how to determine \(|T_{ss}(\delta )|\) and construct EAQMDS codes from negacyclic codes of length \(n = \frac{{{q^2} - 1}}{a}\) with \(a = {l^2} - 1\) and \(a=\frac{l^2-1}{2}\).

3 New EAQMDS codes of length \(n = \frac{{{q^2} - 1}}{a}\) with \(a = {l^2} - 1\)

In this section, we will construct some new classes of q-ary EAQMDS codes of length \(n = \frac{{{q^2} - 1}}{a}\) by negacyclic codes, where \(q = am \pm l\), \(a = {l^2} - 1\) and l is a positive odd integer. Since \({q^2} \equiv 1\bmod 2n\), the \(q^2\)-cyclotomic coset \({C_x}\) modulo 2n is \({C_x} = \{ x\} \) for each odd x in the range \(1\le x\le 2n\).

3.1 The case \(q=am+l\)

In this subsection, we assume that q is an odd prime power of the form \(q = am + l\), where \(a = {l^2} - 1\), and l is a positive odd integer. We will construct some new q-ary EAQMDS codes of length \(n = \frac{{{q^2} - 1}}{a}\) from negacyclic codes. We first give a useful lemma in the following which will play an important role in our construction.

Lemma 3.1

Let \(n = \frac{{{q^2} - 1}}{a}\), where q is an odd prime power of the form \(q = am + l\), \(a = {l^2} - 1\), and l is a positive odd integer. If \({\mathcal {C}}\) is a \(q^2\)-ary negacyclic code of length n with defining set

$$\begin{aligned} T = \bigcup _{j = \frac{{l + 5}}{2}m + 1}^s{C_{1 + 2j}},\quad \frac{l+5}{2}m+1 \le s \le \frac{3l + 3}{2}m, \end{aligned}$$

then \({\mathcal {C}}^{\bot _h}\subseteq {\mathcal {C}}\).

Proof

According to Lemma 2.2, one obtains that \({\mathcal {C}}^{\bot _h}\subseteq {\mathcal {C}}\) if and only if there is no skew-symmetric cyclotomic coset and any two cyclotomic cosets do not form a skew-asymmetric pair in the defining set T.

Dividing \(I_0 = [(l+5)m+3,(3l + 3)m + 1]\) into the following l parts

$$\begin{aligned}&{I_{0,i}} = \left[ 2im + 3,2(i + 1)m + 1\right] , \quad \frac{l+5}{2} \le i \le \frac{{3l - 1}}{2},\\&\left\{ (3l+1)m+3\right\} ,\quad \\&I_{0,\frac{3l+1}{2}}=[(3l+1)m+5,(3l+3)m+1]. \end{aligned}$$

Suppose that there exist odd integers \(x,y\in I_0\), such that \({C_x} = - q{C_y}\), that is \(x +qy\equiv 0\bmod 2n.\)

Since

$$\begin{aligned} a = {l^2} - 1,\quad q = am + l = ({l^2} - 1)m + l,\quad n = \frac{{{q^2} - 1}}{a} = ({l^2} - 1){m^2} + 2ml + 1. \end{aligned}$$

Then, if \(x,y \in {I_{0,i}}\), then \(2in< 2i({l^2} - 1){m^2}+2iml+2im+3({l^2}-1)m + 3l+3 \le x + qy \le 2(i + 1)({l^2} - 1){m^2}+2(i+1)ml+2(i+1)m + (l^2-1)m+l + 1 < 2(i + 1)n\), a contradiction.

If \(x,y \in I_{0,\frac{3l+1}{2}}\), then\( (3l+1)n<(3l+1)({l^2}-1){m^2}+(3l+1)ml+(3l+1)m+5({l^2}-1)m+5l+5\le x+qy \le (3l+3)({l^2}-1){m^2}+(3l+3)ml+(3l+3)m+({l^2}-1)m+l+1<(3l+3)n \), a contradiction.

If \(x \in {I_{0,j}}\), \(y \in {I_{0,i}}\), and \(j < i\), then \(0< 2(i + 1)ml + 2 + 2i - ({l^2} - 1)m - l \le 2n - qy(\bmod \ 2n) \le 2n + 2iml + 2i - 3({l^2} - 1)m - 3l < 2n\) and \(2n - qy(\bmod \ 2n) > x\), a contradiction.

Finally, note that \(-q[(3l+1)m+3] \equiv (l+3)m+1 \bmod 2n\), and \((l+3)m+1 \notin T = \cup _{j = \frac{{l + 5}}{2}m + 1}^s{C_{1 + 2j}}\), where \( \frac{l+5}{2}m+1 \le s \le \frac{3l + 3}{2}m\).

Therefore, we can deduce that \(x+qy\not \equiv 0 \bmod 2n\) for any odd integers \(x,y\in I_{0}\). Hence, \({\mathcal {C}}^{\bot _h}\subseteq {\mathcal {C}}\) holds. \(\square \)

Lemma 3.2

Let \(n = \frac{{{q^2} - 1}}{a}\), where q is a positive odd prime power of the form \(q = am + l\), \(a = {l^2} - 1\), and l is a positive odd integer.

  1. (1)

    For \(1 \le i \le 2\), \(C_{(2i+1 +l + 2il)m+1+2i}\) is skew-symmetric, and

    $$\begin{aligned} \left( {C_{(3l + 5)m+3}}, {C_{(5l + 3)m+5}}\right) ,\quad \left( {C_{(7l + 1)m+7}},{C_{(l + 7)m+1}}\right) \end{aligned}$$

    are skew-asymmetric pairs.

  2. (2)
    $$\begin{aligned} |{T_{ss}}(\delta )| = \left\{ \begin{array}{l} 0, \quad 2 \le \delta \le (l-1)m+1;\\ 1, \quad (l-1)m + 2 \le \delta \le (2l - 1)m + 2;\\ 3,\quad (2l-1)m + 3 \le \delta \le 2lm + 2;\\ 4,\quad 2lm + 3 \le \delta \le (3l-2)m + 3. \end{array} \right. \end{aligned}$$

Proof

  1. (1)

    Since \( q[(2i+1 +l + 2il)m+1+2i] = (2i+1 +l + 2il)n-(2i+1+l+2il)ml-(2i+1 +l + 2il)+(1+2i)({l^2} - 1)m+(1+2i)l\), where \(1 \le i \le 2\). Then, we have

    $$\begin{aligned} -q[(2i+1 +l + 2il)m+1+2i] \equiv (2i+1 +l + 2il)m+1+2i \bmod 2n. \end{aligned}$$

    Hence, for \(1 \le i \le 2\), \(C_{(2i+1 +l + 2il)m+1+2i}\) is skew-symmetric. Similarly, \(q[ (3l + 5)m+3] = (3l + 5)n-(3l+5)ml-(3l+5)+3({l^2}-1)m+3l\), then

    $$\begin{aligned} -q[(3l + 5)m+3] \equiv (5l + 3)m + 5 \mod 2n, \end{aligned}$$

    and \(q[(7l + 1)m+7] = (7l + 1)n -(7l+1)ml-(7l+1)+7({l^2}-1)m+7l,\) then

    $$\begin{aligned} - q[(7l + 1)m+7] \equiv (l + 7)m + 1 \mod 2n. \end{aligned}$$

    Hence, \(\left( {C_{ (3l + 5)m+3}},{C_{(5l + 3)m+5}}\right) \) and \(\left( {C_{(7l + 1)m+7}},{C_{(l + 7)m+1}}\right) \) are skew-asymmetric pairs.

  2. (2)

    According to Lemma 3.1, if the defining set \(T= \cup _{j = \frac{{l + 5}}{2}m + 1}^s{C_{1 + 2j}}\), where \( \frac{l+5}{2}m+1 \le s \le \frac{3l + 3}{2}m\), then \({\mathcal {C}}^{\bot _h}\subseteq {\mathcal {C}}\). Hence, \(|{T_{ss}}(\delta )| = 0 \) for \(2 \le \delta \le (l - 1)m+1\). Now let

    $$\begin{aligned} I_1 = [(3l + 3)m + 5,(5l + 3)m + 3],\\ I_2 = [(5l + 3)m + 7,(5l + 5)m + 3], \\ I_3 = [(5l + 5)m + 7,(7l + 1)m + 5]. \end{aligned}$$

Suppose that \(T_1= \cup _{j = \frac{{l + 5}}{2}m + 1}^{\frac{3l + 3}{2}m+1}{C_{1 + 2j}}\). Let the defining set \(T= {\cup _{\frac{{3l + 3}}{2}m + 2}^{s}{C_{1+2j}}}\cup T_1\), where \(\frac{{3l + 3}}{2}m + 2 \le s \le \frac{{5l + 3}}{2}m + 1.\) If \(|{T_{ss}}(\delta )| = 1 \) holds for \((l - 1)m + 2 \le \delta \le (2l - 1)m + 2\), then according to Lemma 2.3, we only need to testify that for any odd integers \(x \in I_0 \cup I_1\) and \(y \in I_1\) such that \(x \not \equiv - qy\bmod 2n\).

To divide \(I_1\) into the following \(l+1\) parts

$$\begin{aligned}&{I_{1,i}} = [2im + 5,2(i + 1)m + 3],\frac{{3l + 3}}{2} \le i \le \frac{{5l - 3}}{2},\quad \\&\{(5l-1)m+5\}, \quad \\&{I_{1,\frac{5l-1}{2}}}=[(5l-1)m+7,(5l+1)m+3],\\&\{(5l+1)m+5\}, \quad \\&{I_{1,\frac{5l+1}{2}}}=[(5l+1)m+7,(5l+3)m+3]. \end{aligned}$$

If \(x,y \in {I_{1,i}}\), where \(\frac{{3l + 3}}{2} \le i \le \frac{{5l - 3}}{2}\), then \( 2in< 2i({l^2} - 1){m^2}+2iml+2im+5({l^2}-1)m + 5l + 5 \le x + qy \le 2(i + 1)({l^2} - 1){m^2} +2(i+1)ml+2(i+1)m+3({l^2}-1)m+ 3l + 3 < 2(i + 1)n.\)

If \(x,y \in {I_{1,\frac{5l-1}{2}}}\), then \( (5l-1)n< (5l-1)({l^2} - 1){m^2}+(5l-1)ml+(5l-1)m+7({l^2}-1)m + 7l + 7 \le x + qy \le (5l+1)({l^2} - 1){m^2} +(5l+1)ml+(5l+1)m+3({l^2}-1)m+ 3l + 3 <(5l+1)n.\)

If \(x,y \in {I_{1,\frac{5l+1}{2}}}\), then \( (5l+1)n< (5l+1)({l^2} - 1){m^2}+(5l+1)ml+(5l+1)m+7({l^2}-1)m + 7l + 7 \le x + qy \le (5l+3)({l^2} - 1){m^2} +(5l+3)ml+(5l+3)m+3({l^2}-1)m+ 3l + 3 <(5l+3)n.\)

If \(x \in {I_{1,j}} \cup I_0\), \(y \in {I_{1,i}}\), where \(\frac{{3l + 3}}{2} \le j<i \le \frac{{5l - 3}}{2}\), then \( 0< 2(i + 1)ml + 2(i + 1) - 3({l^2} - 1)m - 3l \le 2n - qy(\bmod \ 2n) \le 2n + 2iml + 2i - 5({l^2} - 1)m - 5l < 2n, \) and \(2n - qy(\bmod \ 2n) > x\).

If \(x \in I_0 \cup I_{1,i}\), \(y \in {I_{1,\frac{5l-1}{2}}}\), where \(\frac{{3l + 3}}{2} \le i \le \frac{{5l - 3}}{2}\), then \( 0< (5l+1)ml + (5l+1) - 3({l^2} - 1)m - 3l \le 2n - qy(\bmod \ 2n) \le 2n + (5l-1)ml + (5l-1) - 7({l^2} - 1)m - 7l < 2n, \) and \(2n - qy(\bmod \ 2n) > x\).

If \(x \in I_0 \cup I_{1,i}\), \(y \in {I_{1,\frac{5l+1}{2}}}\), where \(\frac{{3l + 3}}{2} \le i \le \frac{{5l - 1}}{2}\), then \( 0< (5l+3)ml + (5l+3) - 3({l^2} - 1)m - 3l \le 2n - qy(\bmod \ 2n) \le 2n + (5l+1)ml + (5l+1) - 7({l^2} - 1)m - 7l < 2n, \) and \(2n - qy(\bmod \ 2n) > x\).

Finally, note that

$$\begin{aligned} -q[(5l-1)m+5] \equiv (-l+5)m-1 \bmod \ 2n, \\ -q[(5l+1)m+5 ]\equiv (l+5)m+1 \bmod \ 2n, \end{aligned}$$

and \( (-l+5)m-1,(l+5)m+1 \notin T\).

In conclusion, we have \(x+qy\not \equiv 0 \bmod 2n\) for any odd integers \(x \in I_0 \cup I_1, y \in I_1\). Hence, there is no skew-symmetric cyclotomic coset and skew-asymmetric pair in the defining set T. Therefore,

$$\begin{aligned} T_{ss}=T \cap T^{-q}=C_{(3l+3)m+3}=\{(3l+3)m+3\}, \end{aligned}$$

which implies that \(|T_{ss}(\delta )|=1\).

The remaining cases can be proved similarly, so we omit it here for simplification. \(\square \)

Theorem 3.1

Let \(n = \frac{{{q^2} - 1}}{a}\), where q is an odd prime power of the form \(q = am + l\), \(a = {l^2} - 1\), and l is a positive odd integer. Then there exist q-ary EAQMDS codes with parameters as follows:

  1. (1)

    \([[\frac{{{q^2} - 1}}{a},\frac{{{q^2} - 1}}{a} - 2d + 3,d;1]]\), where \((l-1)m + 2 \le d \le (2l - 1)m + 2;\)

  2. (2)

    \([[\frac{{{q^2} - 1}}{a},\frac{{{q^2} - 1}}{a} - 2d + 5,d;3]]\), where \((2l-1)m + 3 \le d \le 2lm + 2\);

  3. (3)

    \([[\frac{{{q^2} - 1}}{a},\frac{{{q^2} - 1}}{a} - 2d + 6,d;4]]\), where \(2lm + 3 \le d \le (3l-2)m + 3\).

Proof

Let q be an odd prime power of the form \(q = am + l\), \(a = {l^2} - 1\). Consider the negacyclic code \({\mathcal {C}}\) of length \(n = \frac{{{q^2} - 1}}{a}\) over \({{\mathbb {F}}_{{q^2}}}\) with defining set

$$\begin{aligned} T= \bigcup _{j = \frac{{l + 5}}{2}m + 1}^s{C_{1 + 2j}}, \end{aligned}$$

where \( \frac{l+5}{2}m+1 \le s \le \frac{7l + 1}{2}m+2\).

According to Lemma 3.2, we have \(c = |T_{ss}(\delta )| = 1\) if \( \frac{3l+3}{2}m+1 \le s \le \frac{5l + 3}{2}m+1\), \(c = |T_{ss}(\delta )| = 3\) if \(\frac{{5l + 3}}{2}m + 2 \le s \le \frac{{5l + 5}}{2}m + 1\), and \(c = |T_{ss}(\delta )| = 4\) if \(\frac{{5l + 5}}{2}m + 2 \le s \le \frac{{7l + 1}}{2}m + 2\).

Since each \(q^2\)-cyclotomic coset \({C_x} = \{ x\} \) and x is an odd integer, then we can obtain that T consists of \(s-\frac{l+5}{2}m\) integers \(\{ (l+5)m+3,(l+5)m+5, \cdots ,2s+1\}, \) which implies that \({\mathcal {C}}\) has minimum distance at least \(s-\frac{l+5}{2}m+1\). Hence, \({\mathcal {C}}\) is a \(q^2\)-ary negacyclic code with parameters \([n,n - s+ \frac{l+5}{2}m, \ge s-\frac{l+5}{2}m+1 ]\).

Then the theorem is proved by using Theorem 2.1 and the EA-quantum Singleton bound. \(\square \)

Remark 3.1

For the proof of the cases \(|T_{ss}(\delta )|=1,3,4\), we give Lemma 3.1. Actually, similar to the proof of Lemma 3.1, one can see that if the defining set \(T= {\cup _{\frac{{3l + 3}}{2}m + 2}^{s}{C_{1+2j}}}\), where \(\frac{{3l + 3}}{2}m + 2 \le s \le \frac{{5l + 3}}{2}m+1.\) Then \({\mathcal {C}}^{\bot _h}\subseteq {\mathcal {C}}\), and there exists a q-ary quantum MDS code with parameters \([[\frac{{{q^2} - 1}}{a},\frac{{{q^2} - 1}}{a} - 2d + 2,d]]\), where \( 2 \le d \le lm + 1\).

Example 3.1

In Table 2, we list some new EAQMDS codes of length \(\frac{q^2-1}{a}\) obtained from Theorem 3.1, where q is an odd prime power of the form \(q = am + l\), \(a = {l^2} - 1\), and l is a positive odd integer.

Table 2 New EAQMDS codes of length \(n=\frac{q^{2}-1}{a}\) with \(\,a=l^2-1\)

3.2 The case \(q=am-l\)

In this subsection, we assume that q is an odd prime power of the form \(q = am - l\), where \(a = {l^2} - 1\), and l is a positive odd integer. We will construct some new q-ary EAQMDS codes of length \(n = \frac{{{q^2} - 1}}{a}\) from negacylic codes.

Lemma 3.3

Let \(n = \frac{{{q^2} - 1}}{a}\), where q is an odd prime power of the form \(q = am - l\), \(a = {l^2} - 1\), and l is a positive odd integer. If \({\mathcal {C}}\) is a \(q^2\)-ary negacyclic code of length n with defining set

$$\begin{aligned} T = \bigcup _{j = \frac{{l - 3}}{2}m}^s{C_{1 + 2j}},\quad \frac{{l - 3}}{2}m \le s \le \frac{{l - 1}}{2}m - 2, \end{aligned}$$

then \({\mathcal {C}}^{\bot _h}\subseteq {\mathcal {C}}\).

Proof

According to Lemma 2.2, one obtains that \({\mathcal {C}}^{\bot _h}\subseteq {\mathcal {C}}\) if and only if there is no skew-symmetric cyclotomic coset and any two cyclotomic cosets do not form a skew-asymmetric pair in the defining set T.

Suppose that there exist odd integers \(x,y \in I_0=\left[ {(l - 3)m + 1,(l - 1)m - 3} \right] \), such that \({C_x} = - q{C_y}\), that is \(x +qy\equiv 0\bmod 2n.\)

Since

$$\begin{aligned} q=am-l,\quad a=\frac{l^2-1}{2},\quad n = \frac{{{q^2} - 1}}{a} = ({l^2} - 1){m^2} - 2ml + 1. \end{aligned}$$

If \(x,y \in I_{0}\), then \((l - 3)n< (l - 3)({l^2} - 1){m^2} - (l - 3)ml + (l - 3)m + ({l^2} - 1)m - l + 1 \le x + qy \le (l - 1)({l^2} - 1){m^2} - (l - 1)ml + (l - 1)m - 3({l^2} - 1)m + 3l - 3 < (l - 1)n.\) Therefore, we have \(x+qy\not \equiv 0 \bmod 2n\) for any odd integers \(x,y\in I_{0}\), a contradiction.

Consequently, there is no skew-symmetric cyclotomic coset and skew-asymmetric pair in the defining set T,  which means that \({\mathcal {C}}^{\bot _h}\subseteq {\mathcal {C}}\) holds. \(\square \)

Lemma 3.4

Let \(n = \frac{{{q^2} - 1}}{a}\), where q is an odd prime power of the form \(q = am - l\), \(a = {l^2} - 1\), and l is a positive odd integer.

  1. (1)

    For \(0 \le i \le 3\), \({C_{(2i + 1)(l - 1)m - (2i + 1)}}\) is skew-symmetric, and \(( {C_{(5l - 3)m - 5}},{C_{(3l - 5)m - 3}})\) forms a skew-asymmetric pair.

  2. (2)
    $$\begin{aligned} \left| {{T_{ss}}(\delta )} \right| = \left\{ \begin{array}{l} 0, \quad 2 \le \delta \le m;\\ 1, \quad m + 1 \le \delta \le lm - 1;\\ 2, \quad lm \le \delta \le (2l - 1)m - 2;\\ 3, \quad (2l - 1)m - 1 \le \delta \le 2lm - 2;\\ 5, \quad 2lm - 1 \le \delta \le (3l - 2)m - 3. \end{array} \right. \end{aligned}$$

Proof

  1. (1)

    Since \( q[(2i + 1)(l - 1)m - (2i + 1)] = (2i + 1)(l - 1)n+(2i+1)(l-1)ml-(2i+1)(l-1)-(2i+1)({l^2} - 1)m+(2i+1)l,\) then

    $$\begin{aligned} -q[(2i + 1)(l - 1)m - (2i + 1)]\equiv (2i + 1)(l - 1)m - (2i + 1) \mod 2n. \end{aligned}$$

    Hence, for \(0 \le i \le 3\), \({C_{(2i + 1)(l - 1)m - (2i + 1)}}\) is skew-symmetric. Since \(q[(3l - 5)m - 3]= (3l - 5)n+(3l-5)ml-3({l^2} - 1)m+5,\) then

    $$\begin{aligned} - q[(3l - 5)m - 3] \equiv (5l - 3)m - 5 \mod 2n. \end{aligned}$$

    So \(( {C_{(5l - 3)m - 5}},{C_{(3l - 5)m - 3}})\) forms a skew-asymmetric pair.

  2. (2)

    According to Lemma 3.3, if the defining set \(T = \cup _{j = \frac{{l - 3}}{2}m}^s{C_{1 + 2j}}\), where \(\frac{{l - 3}}{2}m \le s \le \frac{{l - 1}}{2}m - 2\), then \({\mathcal {C}}^{\bot _h}\subseteq {\mathcal {C}}\). Hence, \(|{T_{ss}}(\delta )| =0\) for \(\mathrm{{2}} \le \delta \le m\). Now let

    $$\begin{aligned}&{I_0} = [(l - 3)m + 1,(l - 1)m - 3],\quad {I_1} = [(l - 1)m + 1,3(l - 1)m - 5],\\&{I_2} = [3(l - 1)m - 1,5(l - 1)m - 7],\quad {I_3} = [5(l - 1)m - 3,(5l - 3)m - 7] ,\\&{I_4} = [(5l - 3)m - 3,7(l - 1)m - 9]. \end{aligned}$$

Suppose that \(T_1= \cup _{j = \frac{{l - 3}}{2}m }^{\frac{l - 1}{2}m-1}{C_{1 + 2j}}\). Let the defining set \(T= {\cup _{\frac{{l - 1}}{2}m }^{s}{C_{1+2j}}}\cup T_1\), where \(\frac{{l - 1}}{2}m \le s \le \frac{{3l - 3}}{2}m - 3.\) If \(\left| {{T_{ss}}(\delta )} \right| =1\) holds for \(m + 1 \le \delta \le lm - 1\), then according to Lemma 2.3, we need to testify that for any odd integers \(x\in I_0 \cup I_1 \) and \(y\in I_1 \) such that \(x \not \equiv - qy\bmod 2n\).

Assume that there exist odd integers \(x \in I_0 \cup I_1\) and \(y \in I_1\) such that \(x \equiv - qy\bmod 2n\). Dividing \(I_1\) into the following \(l-1\) parts

$$\begin{aligned}&I_{1,\frac{l - 1}{2}} = [(l - 1)m + 1,(l + 1)m - 3],\quad \\&I_{1,i} = [2im - 1,2(i\mathrm{{ + }}1)m - 3],\quad \frac{{l + 1}}{2} \le i \le \frac{{3l - 7}}{2},\\&I_{1,\frac{3l - 5}{2}} = [(3l - 5)m - 1,(3l - 3)m - 5]. \end{aligned}$$

If \(x,y \in {I_{1,\frac{l - 1}{2}}}\), then \((l - 1)n< (l - 1)({l^2} - 1){m^2} - (l - 1)ml + (l - 1)m + ({l^2} - 1)m - l + 1 \le x + qy \le (l + 1)({l^2} - 1){m^2} - (l + 1)ml + (l + 1)m - 3({l^2} - 1)m + 3l - 3 < (l + 1)n\), a contradiction.

If \(x,y \in I_{1,i}\), where \(\frac{{l + 1}}{2} \le i \le \frac{{3l - 7}}{2}\), then \(2in< 2i({l^2} - 1){m^2} - 2iml + 2im - ({l^2} - 1)m + l - 1 \le x + qy \le 2(i + 1)({l^2} - 1){m^2} - 2(i + 1)ml + 2(i + 1)m - 3({l^2} - 1)m + 3l - 3 < 2(i + 1)n\), a contradiction.

If \(x,y \in {I_{1,\frac{3l - 5}{2}}}\), then \((3l - 5)n< (3l - 5)({l^2} - 1){m^2} - (3l - 5)ml + (3l - 5)m - ({l^2} - 1)m + l - 1 \le x + qy \le 3(l - 1)({l^2} - 1){m^2} - (3l - 3)ml + (3l - 3)m - 5({l^2} - 1)m + 5l - 5 < 3(l - 1)n\), a contradiction.

If \(x \in {I_0}\), \(y \in {I_{1,\frac{l - 1}{2}}}\), then \(0< (l + 1)(2l - 3)m - 2l + 1 \le 2n - qy \mod 2n \le 2n - (l - 1)(2l + 1)m + 2l - 1 < 2n\ \) and \(2n - qy \mod 2n > x\), a contradiction.

If \(x \in {I_0} \cup {I_{1,\frac{l - 1}{2}}}\), \(y \in {I_{1,i}}\), where \(\frac{{l + 1}}{2} \le i \le \frac{{3l - 7}}{2}\), then \(0< [3{l^2} - 2(i + 1)l - 3]m + 2(i + 1) - 3l \le 2n - qy\bmod 2n \le 2n - (2il - {l^2} + 1)m + 2i - l < 2n \) and \(2n - qy \mod 2n > x\), a contradiction.

If \(x \in {I_0} \cup I_{1,i} \), \(y \in {I_{1,\frac{3l - 5}{2}}}\), where \(\frac{{l - 1}}{2} \le i \le \frac{{3l - 7}}{2}\), then \(0< (l - 1)(2l + 5)m - 2l - 3 \le 2n - qy\bmod 2n \le 2n - (2{l^2} - 5l + 1)m + 2l - 5 < 2n \) and \(2n - qy \mod 2n > x\), a contradiction.

In conclusion, we have \(x+qy\not \equiv 0 \bmod 2n\) for any odd integers \(x \in I_0 \cup I_1,y \in I_1.\) Hence, we have

$$\begin{aligned} T_{ss}=T \cap T^{-q}=C_{(l-1)m-1}=\{(l-1)m-1\}, \end{aligned}$$

which implies that \(|T_{ss}(\delta )|=1\).

The other cases can be proved by using the same method, so we omit it here for simplification. \(\square \)

Theorem 3.2

Let \(n = \frac{{{q^2} - 1}}{a}\), where q is an odd prime power of the form \(q = am - l\), \(a = {l^2} - 1\), and l is a positive odd integer. Then there exist q-ary EAQMDS codes with parameters as follows:

  1. (1)

    \([[\frac{{{q^2} - 1}}{a},\frac{{{q^2} - 1}}{a} - 2d + 3,d;1]]\), where \(m + 1 \le d \le lm - 1\);

  2. (2)

    \([[\frac{{{q^2} - 1}}{a},\frac{{{q^2} - 1}}{a} - 2d + 4,d;2]]\), where \(lm \le d \le (2l - 1)m - 2\);

  3. (3)

    \([[\frac{{{q^2} - 1}}{a},\frac{{{q^2} - 1}}{a} - 2d + 5,d;3]]\), where \((2l - 1)m - 1 \le d \le 2lm - 2\);

  4. (4)

    \([[\frac{{{q^2} - 1}}{a},\frac{{{q^2} - 1}}{a} - 2d + 7,d;5]]\), where \(2lm - 1 \le d \le (3l - 2)m - 3\).

Proof

Let q be an odd prime power of the form \(q=am-l\), \(a = {l^2} - 1\). Consider the negacyclic code \({\mathcal {C}}\) of length \(n=\frac{q^2-1}{a}\) over \({\mathbb {F}}_{q^2}\) with the defining set

$$\begin{aligned} T = \bigcup _{j = \frac{{l - 3}}{2}m}^s{C_{1 + 2j}}, \end{aligned}$$

where \(\frac{{l - 3}}{2}m \le s \le \frac{{7(l-1)}}{2}m - 5\).

By Lemma 3.4, one obtains that \(c = |{T_{ss}(\delta )}| = 1\) if \( \frac{{l - 1}}{2}m-1 \le s \le \frac{{3(l-1)}}{2}m - 3\), \(c = |{T_{ss}(\delta )}| = 2\) if \(\frac{{3(l-1)}}{2}m - 2\le s \le \frac{{5(l-1)}}{2}m - 4\), \(c = |{T_{ss}(\delta )}| = 3\) if \(\frac{{5(l-1)}}{2}m - 3\le s \le \frac{{5l-3}}{2}m - 4\), and \(c = |{T_{ss}(\delta )}| = 5\) if \(\frac{{5l-3}}{2}m - 3\le s \le \frac{{7(l-1)}}{2}m - 5\).

Since every \(q^2\)–cyclotomic coset \(C_{x}=\{x\}\) and x is an odd integer, we can get that T consists of \(s-\frac{{l - 3}}{2}m+1\) integers \(\{ (l-3)m+1, (l-3)m+3, \cdots ,2s+1\},\) which implies that \({\mathcal {C}}\) has minimum distance at least \(s-\frac{{l - 3}}{2}m+2\). Hence, \({\mathcal {C}}\) is a \(q^2\)-ary negacyclic code with parameters \([n,n - s + \frac{{l - 3}}{2}m - 1, \ge s - \frac{{l - 3}}{2}m + 2 ]\).

Then the theorem can be obtained by using Theorem 2.1 and the EA-quantum Singleton bound.

\(\square \)

Remark 3.2

For the proof of the cases \(|T_{ss}(\delta )|=1,2,3,5\), we give Lemma 3.3. Actually, similar to the proof of Lemma 3.3, one can see that if the defining set \(T= {\cup _{\frac{{l - 1}}{2}m}^{s}{C_{1+2j}}}\), where \(\frac{{l - 1}}{2}m \le s \le \frac{{3l -3}}{2}m-3.\) Then \({\mathcal {C}}^{\bot _h}\subseteq {\mathcal {C}}\) and there exists a q-ary quantum MDS code with parameters \([[\frac{{{q^2} - 1}}{a},\frac{{{q^2} - 1}}{a} - 2d + 2,d]]\), where \( 2 \le d \le (l-1)m - 1\).

Example 3.2

In Table 3, we list some new EAQMDS codes of length \(\frac{q^2-1}{a}\) obtained from Theorem 3.2, where q is an odd prime power of the form \(q = am - l\), \(a = {l^2} - 1\), and l is a positive odd integer.

Table 3 New EAQMDS codes of length \(n=\frac{q^{2}-1}{a}\) with \( a=l^2-1\)

4 New EAQMDS codes of length \(n = \frac{{{q^2} - 1}}{a}\) with \(a=\frac{l^2-1}{2}\)

In this section, we will construct some new classes of EAQMDS codes of length \(n = \frac{{{q^2} - 1}}{a}\), where \(q = am \pm l\), \(a=\frac{l^2-1}{2}\) and l is an odd positive integer. As \(a=\frac{l^2-1}{2}\) should be an integer, then we can easily get \(l \equiv 1 \mod 4\) or \(l \equiv 3 \mod 4\). Since \({q^2} \equiv 1\bmod 2n\), then the \(q^2\)-cyclotomic coset \({C_x}\) modulo 2n is \({C_x} = \{ x\}\) for each odd x in the range \(1\le x\le 2n\).

4.1 The case \(q=am+l\)

In this subsection, we assume that q is an odd prime power of the form \(q=am+l\), where \(a=\frac{l^2-1}{2}\), \(l \equiv 1 \mod 4\) or \(l \equiv 3 \mod 4\), and l is a positive integer. We will construct some new classes of q-ary EAQMDS codes of length \(n=\frac{q^2-1}{a}\) from negacylic codes. We first consider the case \(l \equiv 1 \mod 4\) and a useful lemma is given in the following.

Lemma 4.1

Let \(n=\frac{q^2-1}{a}\), where q is an odd prime power of the form \(q=am+l\), \(a=\frac{l^2-1}{2}\), \(l \equiv 1 \mod 4\), and l is a positive integer. If \({\mathcal {C}}\) is a \(q^2\)-ary negacyclic code of length n with defining set

$$\begin{aligned} T=\bigcup _{j=\frac{l+7}{4}m+1}^{s}C_{1+2j},\quad \frac{l+7}{4}m+1\le s\le \frac{5l+3}{4}m+1, \end{aligned}$$

then \({\mathcal {C}}^{\bot _h}\subseteq {\mathcal {C}}\).

Proof

According to Lemma 2.2, one obtains that \({\mathcal {C}}^{\bot _h}\subseteq {\mathcal {C}}\) if and only if there is no skew-symmetric cyclotomic coset and any two cyclotomic cosets do not form a skew-asymmetric pair in the defining set T.

Dividing \(I_0=[\frac{l+7}{2}m+3,\frac{5l+3}{2}m+3]\) into the following l parts

$$\begin{aligned} {I_{0,i}} = [2im + 3,2(i + 1)m + 1], \left\{ \frac{{3l + 1}}{2}m + 3\right\} , {I_{0,j}} = [2jm + 5,2(j + 1)m + 3], \end{aligned}$$

where \(\frac{{l + 7}}{4} \le i \le \frac{{3l - 3}}{4}\), \(\frac{{3l + 1}}{4} \le j \le \frac{{5l - 1}}{4}\).

Suppose that there exist odd integers \(x,y\in I_0\) such that \({C_x} = - q{C_y}\), i.e. \(x+qy \equiv 0 \bmod 2n\). Since

$$\begin{aligned} l \equiv 1 \mod 4,\quad a = \frac{{{l^2} - 1}}{2}, \quad q = am + l,\quad n = \frac{{{q^2} - 1}}{a} = \frac{{{l^2} - 1}}{2}{m^2} + 2ml + 2. \end{aligned}$$

If \(x,y \in {I_{0,i}}\), where \(\frac{{l + 7}}{4} \le i \le \frac{{3l - 3}}{4}\), then \(2in< (2im + 3)(\frac{{{l^2} - 1}}{2}m + l + 1) \le x + qy \le [2(i + 1)m + 1](\frac{{{l^2} - 1}}{2}m + l + 1) < 2(i + 1)n.\)

If \(x,y \in {I_{0,j}}\), where \(\frac{{3l + 1}}{4} \le j \le \frac{{5l - 1}}{4}\), then \(2jn< (2jm + 5)(\frac{{{l^2} - 1}}{2}m + l + 1) \le x + qy \le [2(j + 1)m + 3](\frac{{{l^2} - 1}}{2}m + l + 1) < 2(j + 1)n\).

If \(x\in I_{0,k}\), \(y\in I_{0,i}\), where \(\frac{l+7}{4} \le k< i\le \frac{{3l - 3}}{4}\), then \(0< 2(i + 1)ml + 4i + 4 - \frac{{{l^2} - 1}}{2}m - l \le 2n - qy(\bmod \ 2n) \le 2n + 2iml + 4i - \frac{{3({l^2} - 1)}}{2}m - 3l < 2n\) and \(2n - qy(\bmod \ 2n) > x\).

If \(x\in I_{0,k}\), \(y\in I_{0,j}\), where \(\frac{l+7}{4} \le k< j,\frac{{3l + 1}}{4} \le j \le \frac{{5l - 1}}{4}\), then \(0< 2(i + 1)ml + 4i + 4 - \frac{{3({l^2} - 1)}}{2}m - 3l \le 2n - qy(\bmod \ 2n) \le 2n + 2iml + 4i - \frac{{5({l^2} - 1)}}{2}m - 5l < 2n\) and \(2n - qy(\bmod \ 2n) > x\).

Finally, note that

$$\begin{aligned} - q\left( 3 + \frac{{3l + 1}}{2}m\right) \equiv - \left( \frac{{{l^2} - 1}}{2}m + l\right) \left( 3 + \frac{{3l + 1}}{2}m\right) \equiv \frac{{l + 3}}{2}m + 1 \mod 2n, \end{aligned}$$

and \(\frac{{l + 3}}{2}m + 1 \notin T = \cup _{j = \frac{{l + 7}}{4}m + 1}^s{C_{1 + 2j}}\), where \(\frac{{l + 7}}{4}m + 1 \le s \le \frac{{5l + 3}}{4}m + 1\).

In conclusion, we can deduce that \(x+qy\not \equiv 0 \bmod 2n\) for any odd integers \(x,y\in I_{0}\), a contradiction. Then we have \({\mathcal {C}}^{\bot _h}\subseteq {\mathcal {C}}.\)

\(\square \)

Lemma 4.2

Let \(n=\frac{q^2-1}{a}\), where q is an odd prime power of the form \(q=am+l\), \(a=\frac{l^2-1}{2}\), \(l \equiv 1 \mod 4\), and l is a positive integer.

  1. (1)

    For \(2\le i \le 3\),

    $$\begin{aligned} \left( {C_{2i + 1 + \frac{{(2i + 1)l + 2i - 1}}{2}m}}, {C_{2i - 1 + \frac{{(2i - 1)l + 2i + 1}}{2}m}}\right) ,\quad \left( {C_{9 + \frac{{9l + 3}}{2}m}},{C_{3 + \frac{{3l + 9}}{2}m}}\right) \end{aligned}$$

    form skew-asymmetric pairs.

  2. (2)
    $$\begin{aligned}|{T_{ss}}(\delta )| = \left\{ \begin{array}{l} 0,\quad 2\le \delta \le (l - 1)m + 2;\\ 2,\quad (l - 1)m + 3 \le \delta \le \frac{{3l - 1}}{2}m + 3;\\ 4,\quad \frac{{3l - 1}}{2}m + 4 \le \delta \le (2l - 1)m + 4. \end{array} \right. \end{aligned}$$

Proof

  1. (1)

    Since \( q[\frac{{(2i + 1)l + 2i - 1}}{2}m + 2i + 1] =\frac{{(2i + 1)l + 2i - 1}}{2}n-\frac{{(2i + 1)l + 2i - 1}}{2}ml-(2i + 1)l -( 2i - 1) +\frac{(2i+1)({l^2-1})}{2}m+(2i+1)l\), where \(2\le i\le 3.\) Then, we have

    $$\begin{aligned} - q\left[ \frac{{(2i + 1)l + 2i - 1}}{2}m + 2i + 1\right] \equiv \frac{{(2i - 1)l + 2i + 1}}{2}m + 2i - 1 \mod 2n. \end{aligned}$$

    Hence, for \(2\le i \le 3\), \(({C_{2i + 1 + \frac{{(2i + 1)l + 2i - 1}}{2}m}}, {C_{2i - 1 + \frac{{(2i - 1)l + 2i + 1}}{2}m}})\) forms a skew-asymmetric pair. Similarly, \( q\left( \frac{{9l + 3}}{2}m + 9\right) =\frac{9l + 3}{2}n-\frac{9l + 3}{2}ml-(9l+3) +\frac{9({l^2} - 1)}{2}m+9l .\) Then, we have

    $$\begin{aligned} - q\left( \frac{{9l + 3}}{2}m + 9\right) \equiv \frac{{3l + 9}}{2}m + 3 \mod 2n. \end{aligned}$$

    Therefore, \(({C_{9 + \frac{{9l + 3}}{2}m}},{C_{3 + \frac{{3l + 9}}{2}m}})\) also forms a skew-asymmetric pair.

  2. (2)

    According to Lemma 4.1, if the defining set \(T = \cup _{j = \frac{{l + 7}}{4}m + 1}^s {C_{1 + 2j}}\), where \(\frac{{l + 7}}{4}m + 1 \le s \le \frac{{5l + 3}}{4}m + 1\), then \({\mathcal {C}}^{\bot _h}\subseteq {\mathcal {C}}\). So \(|T_{ss}(\delta )|=0\) for \(2\le \delta \le (l-1)m+2\). Let

    $$\begin{aligned} {I_1} = \left[ \frac{{5l + 3}}{2}m + 7,\frac{{7l + 5}}{2}m + 5\right] ,\quad {I_2} = \left[ \frac{{7l + 5}}{2}m + 9,\frac{{9l + 3}}{2}m + 7\right] . \end{aligned}$$

Assume that \({T_1} = \cup _{j = \frac{{l + 7}}{4}m + 1}^{\frac{{5l + 3}}{4}m + 2} {C_{1 + 2j}}\). Let the defining set \({T} = \cup _{j = \frac{{5l + 3}}{4}m + 3}^s {{C_{1 + 2j}}} \cup {T_1}\), where \(\frac{{5l + 3}}{4}m + 3 \le s \le \frac{{7l + 5}}{4}m + 2\). If \(|T_{ss}(\delta )|=2\) holds for \((l - 1)m + 3 \le \delta \le \frac{{3l - 1}}{2}m + 3\), then according to Lemma 2.3, we only need to prove that for any odd integers \(x \in {I_0} \cup {I_1}\) and \(y\in I_{1}\) such that \(x \not \equiv - qy\bmod 2n\).

Firstly dividing \({I_1}\) into the following \(\frac{l+3}{2}\) parts

$$\begin{aligned} {I_{1,i}} = \left[ 2im + 7,2(i + 1)m + 5\right] , \quad \left\{ \frac{{7l + 1}}{2}m + 7\right\} ,\quad I_{1,\frac{7l+1}{4}}= \left[ \frac{{7l + 1}}{2}m + 9,\frac{{7l + 5}}{2}m + 5\right] , \end{aligned}$$

where \(\frac{{5l + 3}}{4} \le i \le \frac{{7l - 3}}{4}\).

If \(x,y\in I_{1,i}\), where \(\frac{{5l + 3}}{4} \le i \le \frac{{7l - 3}}{4},\) then \(2in< (2im + 7)(\frac{{{l^2} - 1}}{2}m + l + 1) \le x + qy \le [2(i + 1)m + 5](\frac{{{l^2} - 1}}{2}m + l + 1) < 2(i + 1)n.\)

If \(x,y\in I_{1,\frac{7l+1}{4}}\), then \(\frac{{7l + 1}}{2}n< (\frac{{7l + 1}}{2}m + 9)(\frac{{{l^2} - 1}}{2}m + l + 1) \le x + qy \le (\frac{{7l + 5}}{2}m + 5)(\frac{{{l^2} - 1}}{2}m + l + 1) < \frac{{7l + 5}}{2}n.\)

If \(x \in I_0 \cup I_{1,j}\), \(y\in I_{1,i},\) where \(\frac{5l+3}{4} \le j<i \le \frac{7l-3}{4}\), then \(0< 2(i + 1)ml + 4i + 4 - \frac{{5({l^2} - 1)}}{2}m - 5l \le 2n - qy(\bmod \ 2n) \le 2n + 2iml + 4i - \frac{{7({l^2} - 1)}}{2}m - 7l < 2n\) and \(2n - qy(\bmod \ 2n) > x\).

If \(x \in {I_0} \cup I_{1,i}\), \(y\in I_{1,\frac{7l+1}{4}},\) where \(\frac{{5l + 3}}{4} \le i \le \frac{{7l - 3}}{4}\), then \(0< \frac{{7l + 5}}{2}ml + 7l + 5 - \frac{{5({l^2} - 1)}}{2}m - 5l \le 2n - qy(\bmod \ 2n) \le 2n + \frac{{7l + 1}}{2}ml + 7l + 1 - \frac{{9({l^2} - 1)}}{2}m - 9l < 2n\) and \(2n - qy(\bmod \ 2n) > x\).

Finally, note that

$$\begin{aligned} - q\left( 7 + \frac{{7l + 1}}{2}m\right) \equiv - \left( \frac{{{l^2} - 1}}{2}m + l\right) \left( 7 + \frac{{7l + 1}}{2}m\right) \equiv \frac{{l + 7}}{2}m + 1\mod 2n \end{aligned}$$

and \(\frac{{l + 7}}{2}m + 1 \notin {T} \).

In conclusion, we have \(x \not \equiv - qy\bmod 2n\) for any odd integers \(x \in {I_0} \cup {I_1}\) and \(y\in I_{1}\). Therefore, there is no skew-symmetric cyclotomic coset and skew-asymmetric pair in the defining set T. Besides,

$$\begin{aligned} {T_{ss}}=T \cap T^{-q} = {C_{5 + \frac{{5l + 3}}{2}m}} \cup {C_{3 + \frac{{3l + 5}}{2}}}, \end{aligned}$$

which implies that \(\left| T_{ss}(\delta ) \right| = 2\) for \((l - 1)m + 3 \le \delta \le \frac{{3l - 1}}{2}m + 3\).

The remaining case can be proved by using the same way, here we omit it.

\(\square \)

Theorem 4.1

Let \(n=\frac{q^2-1}{a}\), where q is an odd prime power of the form \(q=am+l\), \(a=\frac{l^2-1}{2}\), \(l \equiv 1 \mod 4\), and l is a positive integer. Then there exist EAQMDS codes with parameters as follows:

  1. (1)

    \([[\frac{{{q^2} - 1}}{a},\frac{{{q^2} - 1}}{a} - 2d + 4,d;2]]_q\), where \((l - 1)m + 3 \le d \le \frac{{3l - 1}}{2}m + 3\);

  2. (2)

    \([[\frac{{{q^2} - 1}}{a},\frac{{{q^2} - 1}}{a} - 2d + 6,d;4]]_q\), where \(\frac{{3l - 1}}{2}m + 4 \le d \le (2l - 1)m + 4\).

Proof

Let q be an odd prime power of the form \(q=am+l\), \(a=\frac{l^2-1}{2}\). Consider the negacyclic code \({\mathcal {C}}\) of length \(n=\frac{q^2-1}{a}\) over \({\mathbb {F}}_{q^2}\) with defining set \(T = \cup _{j = \frac{{l + 7}}{4}m + 1}^s{C_{1 + 2j}}\), where \(1 + \frac{{l + 7}}{4}m \le s \le \frac{{9l + 3}}{4}m + 3.\)

By Lemma 4.2, one obtains that \(c = |{T_{ss}(\delta )}| = 2\) if \(2 + \frac{{5l + 3}}{4}m \le s \le \frac{{7l + 5}}{4}m + 2\), and \(c = |{T_{ss}(\delta )}| = 4\) if \(3 + \frac{{7l + 5}}{4}m \le s \le \frac{{9l + 3}}{4}m + 3\).

Since every \(q^2\)-cyclotomic coset \(C_{x}=\{x\}\) and x is an odd integer, then we can obtain that T consists of \(s-\frac{{l + 7}}{4}m\) integers

$$\begin{aligned} \left\{ \frac{{l + 7}}{2}m + 3,\frac{{l + 7}}{2}m + 5, \cdots ,1 + 2s\right\} , \end{aligned}$$

which implies that \({\mathcal {C}}\) has minimum distance at least \(s -\frac{{l + 7}}{4}m + 1\). Hence, \({\mathcal {C}}\) is a \(q^2\)-ary negacyclic code with parameters \([n,n - s + \frac{{l + 7}}{4}m , \ge s - \frac{{l + 7}}{4}m + 1]\).

Therefore, the theorem holds by Theorem 2.1 and the EA-quantum Singleton bound.

\(\square \)

Remark 4.1

For the proof of the cases \(|T_{ss}(\delta )|=2,4\), we give Lemma 4.1. Actually, it is easy to see that if the defining set \(T= {\cup _{\frac{{l + 3}}{4}m + 1}^{s}{C_{1+2j}}}\), where \(\frac{{l + 3}}{4}m + 1 \le s \le \frac{{5l + 3}}{4}m+1.\) Then \({\mathcal {C}}^{\bot _h}\subseteq {\mathcal {C}}\) and there exists a q-ary quantum MDS code with parameters \([[\frac{{{q^2} - 1}}{a},\frac{{{q^2} - 1}}{a} - 2d + 2,d]]\), where \( 2 \le d \le lm + 2\).

Now we consider the case \(l \equiv 3 \mod 4\) and a useful lemma is given in the following.

Lemma 4.3

Let \(n=\frac{q^2-1}{a}\), where q is an odd prime power of the form \(q=am+l\), \(a=\frac{l^2-1}{2}\), \(l \equiv 3 \mod 4\), and l is a positive integer. If \({\mathcal {C}}\) is a \(q^2\)-ary negacyclic code of length n with defining set

$$\begin{aligned} T=\bigcup _{j=\frac{l+5}{4}m+1}^{s}C_{1+2j},\quad \frac{l+5}{4}m+1\le s\le \frac{3l+3}{4}m, \end{aligned}$$

then \({\mathcal {C}}^{\bot _h}\subseteq {\mathcal {C}}\).

Proof

According to Lemma 2.2, one obtains that \({\mathcal {C}}^{\bot _h}\subseteq {\mathcal {C}}\) if and only if there is no skew-symmetric cyclotomic coset and any two cyclotomic cosets do not form a skew-asymmetric pair in the defining set T.

Dividing \(I_0 = \left[ \frac{{l + 5}}{2}m + 3,\frac{{3l + 3}}{2}m + 1\right] \) into the following \(\frac{l-1}{2}\) parts

$$\begin{aligned} {I_{0,i}} = [2im + 3,2(i + 1)m + 1], \end{aligned}$$

where \(\frac{{l + 5}}{4} \le i \le \frac{{3l - 1}}{4}.\) Suppose that there exist odd integers \(x,y\in I_0\) such that \({C_x} = - q{C_y}\), i.e. \(x+ qy\equiv 0\bmod 2n\). Since

$$\begin{aligned} q=am+l,\quad a=\frac{l^2-1}{2},\quad l \equiv 3 \mod 4,\quad n = \frac{{{q^2} - 1}}{a} = \frac{{{l^2} - 1}}{2}{m^2} + 2ml + 2. \end{aligned}$$

If \(x,y \in I_{0,i}\), where \(\frac{{l + 5}}{4} \le i \le \frac{{3l - 1}}{4}\), then

$$\begin{aligned} 2in< (2im + 3)\left( \frac{{{l^2} - 1}}{2}m + l + 1\right) \le x + qy \le [2(i + 1)m + 1]\left( \frac{{{l^2} - 1}}{2}m + l + 1\right) < 2(i + 1)n, \end{aligned}$$

a contradiction.

If \(x \in {I_{0,j}},y \in {I_{0,i}}\), where \(j< i\), then

$$\begin{aligned}&0< 2(i + 1)ml + 4i + 4 - \frac{{{l^2} - 1}}{2}m - l \le 2n - qy(\bmod \ 2n)\\&\le 2n + 2iml + 4i - \frac{{3({l^2} - 1)}}{2}m - 3l < 2n, \end{aligned}$$

and \(2n - qy(\bmod \ 2n) > x\), a contradiction.

Consequently, there is no skew-symmetric cyclotomic coset and skew-asymmetric pair in the defining set T, which means that \({\mathcal {C}}^{\bot _h}\subseteq {\mathcal {C}}\) holds.

\(\square \)

Lemma 4.4

Let \(n=\frac{q^2-1}{a}\), where q is an odd prime power of the form \(q=am+l\), \(a=\frac{l^2-1}{2}\), \(l \equiv 3 \mod 4\), and l is a positive integer.

  1. (1)

    For \(1\le i \le 3\), \(C_{2i + 1 + \frac{{(2i + 1)l + 2i + 1}}{2}m}\) is skew-symmetric, and \(\left( {C_{7 + \frac{{7l + 3}}{2}m}},{C_{3 + \frac{{3l + 7}}{2}m}}\right) \) forms a skew-asymmetric pair.

  2. (2)
    $$\begin{aligned}|{T_{ss}}(\delta )| = \left\{ \begin{array}{l} 0,\quad 2\le \delta \le \frac{{(l - 1)}}{2}m + 1;\\ 1,\quad \frac{{l - 1}}{2}m + 2 \le \delta \le lm + 2;\\ 2,\quad lm + 3 \le \delta \le \frac{{3l - 1}}{2}m + 3;\\ 4,\quad \frac{{3l - 1}}{2}m + 4 \le \delta \le \frac{{3l\mathrm{{ + }}1}}{2}m + 3.\mathrm{{ }} \end{array} \right. \end{aligned}$$

Proof

  1. (1)

    Since \(q(\frac{{(2i + 1)l + 2i\mathrm{{ + }}1}}{2}m + 2i + 1) = \frac{(2i + 1)l + 2i + 1}{2}n-\frac{(2i + 1)l + 2i + 1}{2}ml-(2i+1)l-(2i+1)+\frac{(2i+1)({l^2} - 1)}{2}m+(2i+1)l\), where \(1\le i\le 3\). Then

    $$\begin{aligned} - q\left( \frac{{(2i + 1)l + 2i\mathrm{{ + }}1}}{2}m + 2i + 1\right) \equiv \frac{{(2i + 1)l + 2i + 1}}{2}m + 2i + 1 \mod 2n. \end{aligned}$$

    Hence, for \(1\le i \le 3\), \(C_{2i + 1 + \frac{{(2i + 1)l + 2i + 1}}{2}m}\) is skew-symmetric. Since \(q(\frac{{7l + 3}}{2}m + 7)=\frac{{7l + 3}}{2}n-\frac{{7l + 3}}{2}ml-(7l+3)+\frac{{7({l^2} - 1)}}{2}m+7l,\) then

    $$\begin{aligned} - q\left( \frac{{7l + 3}}{2}m + 7\right) \equiv \frac{{3l + 7}}{2}m + 3 \mod 2n. \end{aligned}$$

    Therefore, \(({C_{7 + \frac{{7l + 3}}{2}m}},{C_{3 + \frac{{3l + 7}}{2}m}})\) forms a skew-asymmetric pair.

  2. (2)

    According to Lemma 4.3, if the defining set \(T = \cup _{j = \frac{{l + 5}}{4}m + 1}^s {C_{1 + 2j}}\), where \(\frac{{l + 5}}{4}m + 1 \le s \le \frac{{3l + 3}}{4}m\), then \({\mathcal {C}}^{\bot _h}\subseteq {\mathcal {C}}\). So we have \(|{T_{ss}}(\delta )| = 0 \) for \(2\le \delta \le \frac{l-1}{2}m+1.\) Now let

    $$\begin{aligned} {I_1} = \left[ \frac{{3l + 3}}{2}m + 5,\frac{{5l + 5}}{2}m + 3\right] ,\\ {I_2} = \left[ \frac{{5l + 5}}{2}m + 7,\frac{{7l + 3}}{2}m + 5\right] ,\\ {I_3} = \left[ \frac{{7l + 3}}{2}m + 9,\frac{{7l + 7}}{2}m + 5\right] . \end{aligned}$$

Assume that \({T_1} = \cup _{j = \frac{{l + 5}}{4}m + 1}^{\frac{{3l + 3}}{4}m + 1} {C_{1 + 2j}}\). Let the defining set \({T} = \cup _{j = \frac{{3l + 3}}{4}m + 2}^s {{C_{1 + 2j}}} \cup {T_1}\), where \(\frac{{3l + 3}}{4}m + 2 \le s \le \frac{{5l + 5}}{4}m + 1\). If \(|{T_{ss}}(\delta )| = 1 \) holds for \(\frac{{l - 1}}{2}m + 2 \le \delta \le lm + 2\), then according to Lemma 2.3, we only need to demonstrate that for any odd integers \(x \in {I_0} \cup {I_1}\) and \(y\in I_{1}\) such that \(x \not \equiv - qy\bmod 2n\).

Dividing \({I_1}\) into the following \(\frac{l+3}{2}\) parts

$$\begin{aligned}&{I_{1,i}} = [2im + 5,2(i + 1)m + 3],\frac{{3l + 3}}{4} \le i \le \frac{{5l - 3}}{4},\\&\left\{ \frac{{5l + 1}}{2}m + 5\right\} ,\\&I_{1,\frac{5l+1}{4}}= \left[ \frac{{5l + 1}}{2}m + 7,\frac{{5l + 5}}{2}m + 3\right] . \end{aligned}$$

If \(x,y\in {I_{1,i}},\) where \(\frac{{3l + 3}}{4} \le i \le \frac{{5l - 3}}{4}\), then \(2in<i({l^2}-1){m^2}+2iml+2im+ \frac{{5({l^2}-1)}}{2}m + 5l+5 \le x + qy \le (i+1)({l^2}-1){m^2}+2(i+1)ml+2(i+1)m+\frac{3({l^2} - 1)}{2}m + 3l + 3< 2(i+1)n.\)

If \(x,y\in I_{1,\frac{5l+1}{4}}\), then \(\frac{{5l + 1}}{2}n< \frac{(5l + 1)({l^2}-1)}{4}{m^2} +\frac{5l+1}{2}ml+\frac{5l+1}{2}m+\frac{7({l^2}-1)}{2}m+7l+7 \le x + qy \le \frac{(5l + 5)({l^2}-1)}{4}{m^2} +\frac{5l+5}{2}ml+\frac{5l+5}{2}m+\frac{3({l^2}-1)}{2}m+3l+3 < \frac{{5l + 5}}{2}n.\)

If \(x\in I_0\cup I_{1,j}\), \(y\in I_{1,i}\), where \(\frac{3l+3}{4} \le j<i \le \frac{5l-3}{4}\), then \(0< 2(i + 1)ml + 4i + 4 - \frac{{3({l^2} - 1)}}{2}m - 3l \le 2n - qy(\bmod \ 2n) \le 2n + 2iml + 4i - \frac{{5({l^2} - 1)}}{2}m - 5l < 2n\) and \(2n - qy(\bmod \ 2n) > x\).

If \(x \in {I_0} \cup I_{1,i}\), \(y\in I_{1,\frac{5l+1}{4}},\) where \(\frac{{3l + 3}}{4} \le i \le \frac{{5l - 3}}{4}\), then \(0< \frac{{5l + 5}}{2}ml + 5l + 5 - \frac{{3({l^2} - 1)}}{2}m - 3l \le 2n - qy(\bmod \ 2n) \le 2n + \frac{{5l + 1}}{2}ml + 5l + 1 - \frac{{7({l^2} - 1)}}{2}m - 7l < 2n\) and \(2n - qy(\bmod \ 2n) > x\).

Finally, note that \( - q(\frac{{5l + 1}}{2}m+5) \equiv - (\frac{{{l^2} - 1}}{2}m + l)(5 + \frac{{5l + 1}}{2}m) \equiv \frac{{l + 5}}{2}m + 1\mod 2n\) and \(\frac{{l + 5}}{2}m + 1 \notin T\).

Consequently, we have \(x \not \equiv - qy\bmod 2n\) for any odd integers \(x \in {I_0} \cup {I_1}\) and \(y\in I_{1}\). Hence

$$\begin{aligned} {T_{ss}} =T \cap T^{-q}= C_{3 + \frac{{3l + 3}}{2}m}=\left\{ 3 + \frac{{3l + 3}}{2}m\right\} , \end{aligned}$$

which means that \(\left| {{T_{ss}(\delta )}} \right| = 1\) for \(\frac{{l - 1}}{2}m + 2 \le \delta \le lm + 2\).

The rest cases can be demonstrated in the same way, we omit them here. \(\square \)

Theorem 4.2

Let \(n=\frac{q^2-1}{a}\), where q is an odd prime power of the form \(q=am+l\), \(a=\frac{l^2-1}{2}\), \(l \equiv 3 \mod 4\), and l is a positive integer. Then there exist EAQMDS codes with parameters as follows:

  1. (1)

    \([[\frac{{{q^2} - 1}}{a},\frac{{{q^2} - 1}}{a} - 2d + 3,d;1]]_q\), where \(\frac{l - 1}{2}m + 2 \le d \le lm + 2\);

  2. (2)

    \([[\frac{{{q^2} - 1}}{a},\frac{{{q^2} -1}}{a} - 2d + 4,d;2]]_q\), where \(lm + 3 \le d \le \frac{{3l - 1}}{2}m + 3\);

  3. (3)

    \([[\frac{{{q^2} - 1}}{a},\frac{{{q^2} - 1}}{a} - 2d + 6,d;4]]_q\), where \(\frac{{3l - 1}}{2}m + 4 \le d \le \frac{{3l\mathrm{{ + }}1}}{2}m + 3\).

Proof

Let q be an odd prime power of the form \(q=am+l\), and \(a=\frac{l^2-1}{2}\). Consider the negacyclic code \({\mathcal {C}}\) of length \(n=\frac{q^2-1}{a}\) over \({\mathbb {F}}_{q^2}\) with defining set \(T = \cup _{j = \frac{{l + 5}}{4}m + 1}^s{C_{1 + 2j}}\), where \( \frac{{l + 5}}{4}m+1 \le s \le \frac{{7l + 7}}{4}m + 2.\)

By Lemma 4.4, one gets \(c = |{T_{ss}(\delta )}| = 1\) if \(1 + \frac{{3l + 3}}{4}m \le s \le \frac{{5l + 5}}{4}m + 1\), \(c = |{T_{ss}(\delta )}| = 2\) if \(2 + \frac{{5l + 5}}{4}m \le s \le \frac{{7l + 3}}{4}m + 2\), and \(c = |{T_{ss}(\delta )}| = 4\) if \(3 + \frac{{7l + 3}}{4}m \le s \le \frac{{7l + 7}}{4}m + 2\).

Since every \(q^2\)-cyclotomic coset \(C_{x}=\{x\}\) and x is an odd number, we can obtain that T consists of \(s - \frac{{l + 5}}{4}m\) integers

$$\begin{aligned} \left\{ \frac{{l + 5}}{2}m + 3,\frac{{l + 5}}{2}m + 5, \cdots ,1 + 2s\right\} . \end{aligned}$$

It implies that \({\mathcal {C}}\) has minimum distance at least \(s - \frac{{l + 5}}{4}m + 1\). Hence, \({\mathcal {C}}\) is a \(q^2\)-ary negacyclic code with parameters \([n,n - s +\frac{{l + 5}}{4}m, \ge s - \frac{{l + 5}}{4}m + 1]\).

Then the theorem is proved by using Theorem 2.1 and the EA-quantum Singleton bound.

\(\square \)

Remark 4.2

For the proof of the cases \(|T_{ss}(\delta )|=1,2,4\), we give Lemma 4.3. Actually, it is easy to demonstrate that if the defining set \(T= {\cup _{\frac{{3l + 3}}{4}m + 2}^{s}{C_{1+2j}}}\), where \(\frac{{3l + 3}}{4}m + 2 \le s \le \frac{{5l + 5}}{4}m+1.\) Then \({\mathcal {C}}^{\bot _h}\subseteq {\mathcal {C}}\) and there exists a q-ary quantum MDS code with parameters \([[\frac{{{q^2} - 1}}{a},\frac{{{q^2} - 1}}{a} - 2d + 2,d]]\), where \( 2 \le d \le \frac{l+1}{2}m + 1\).

Example 4.1

In Table 4, we list some new EAQMDS codes of length \(\frac{q^2-1}{a}\) obtained from Theorems 4.1 and 4.2, where q is an odd prime power of the form \(q = am + l\), \(a =\frac{{l^2} - 1}{2}\), and l is a positive odd integer.

Table 4 New EAQMDS codes of length \(n=\frac{q^{2}-1}{a}\) and \(a=\frac{l^2-1}{2}\)

4.2 The case \(q=am-l\)

In this subsection, we assume that q is an odd prime power of the form \(q=am-l\), where \(a=\frac{l^2-1}{2}\), \(l \equiv 1 \mod 4\) or \(l \equiv 3 \mod 4\), and l is a positive integer. We will construct some new classes of q-ary EAQMDS codes of length \(n=\frac{q^2-1}{a}\) from negacyclic codes. We first consider the case \(l \equiv 1 \mod 4\) and a useful lemma is given in the following.

Lemma 4.5

Let \(n=\frac{q^2-1}{a}\), where q is an odd prime power of the form \(q=am-l\), \(a=\frac{l^2-1}{2}\), \(l \equiv 1 \mod 4\), and l is a positive integer. If \({\mathcal {C}}\) is a \(q^2\)-ary negacyclic code of length n with defining set

$$\begin{aligned} T=\bigcup _{j=\frac{l-1}{4}m}^{s}C_{1+2j},\quad \frac{l-1}{4}m\le s\le \frac{3l-3}{4}m-3, \end{aligned}$$

then \({\mathcal {C}}^{\bot _h}\subseteq {\mathcal {C}}\).

Proof

According to Lemma 2.2, one gets that \({\mathcal {C}}^{\bot _h}\subseteq {\mathcal {C}}\) if and only if there is no skew-symmetric cyclotomic coset and any two cyclotomic cosets do not form a skew-asymmetric pair in the defining set T.

Dividing \(I_0=\left[ \frac{l-1}{2}m+1,\frac{3l-3}{2}m-5\right] \) into the following \(\frac{l-1}{2}\) parts

$$\begin{aligned}&I_{0,\frac{l-1}{4}} = \left[ \frac{{l - 1}}{2}m + 1,\frac{{l + 3}}{2}m - 3\right] ,\\&I_{0,i} = [2im - 1,2(i+1)m - 3], \\&I_{0,\frac{3l-7}{4}} = \left[ \frac{3l-7}{2}m - 1,\frac{{3l - 3}}{2}m - 5\right] , \end{aligned}$$

where \(\frac{l+3}{4} \le i \le \frac{3l-11}{4}\).

Suppose that there exist odd integers \(x,y\in I_0\) such that \({C_x} = - q{C_y}\), i.e. \(x+qy\equiv 0\bmod 2n\). Since

$$\begin{aligned} l\equiv 1 \mod 4,\quad a = \frac{{{l^2} - 1}}{2},\quad q = am - l,\quad n = \frac{{{q^2} - 1}}{a} = \frac{{{l^2} - 1}}{2}{m^2} - 4ml + 4. \end{aligned}$$

If \(x,y \in {I_{0,\frac{l-1}{4}}}\), then \(\frac{l-1}{2}n< (\frac{l-1}{2}m+1)(\frac{{{l^2} - 1}}{2}m - l + 1) \le x + qy \le (\frac{l+3}{2}m-3)(\frac{{{l^2} - 1}}{2}m - l + 1) < \frac{l+3}{2}n\), a contradiction.

If \(x,y \in {I_{0,i}}\), where \(\frac{{l + 3}}{4} \le i \le \frac{{3l - 11}}{4}\), then \(2in< (2im - 1)(\frac{{{l^2} - 1}}{2}m - l + 1) \le x + qy \le [2(i + 1)m - 3](\frac{{{l^2} - 1}}{2}m - l + 1) < 2(i + 1)n\), a contradiction.

If \(x,y \in {I_{0,\frac{3l-7}{4}}}\), then \(\frac{3l-7}{2}n< (\frac{3l-7}{2}m-1)(\frac{{{l^2} - 1}}{2}m - l + 1) \le x + qy \le (\frac{3l-3}{2}m-5)(\frac{{{l^2} - 1}}{2}m - l + 1) < \frac{3l-3}{2}n\), a contradiction.

If \(x \in {I_{0,j}}\), \(y \in {I_{0,i}}\), where \(\frac{l-1}{4} \le j<i \le \frac{{3l - 11}}{4}\), then \(0< -2(i+1)ml + 4(i+1) + \frac{{3({l^2} - 1)}}{2}m -3l \le 2n - qy(\bmod \ 2n) \le 2n - 2iml + 4i + \frac{{{l^2} - 1}}{2}m - l < 2n\) and \(2n - qy(\bmod \ 2n) > x\), a contradiction.

If \(x\in {I_{0,i}}\), \(y\in I_{0,\frac{3l-7}{4}}\), where \(\frac{l-1}{4} \le i \le \frac{{3l - 11}}{4}\), then \(0< (l^2-1)m-2l-3 \le 2n - qy(\bmod \ 2n) \le 2n -\frac{3l-7}{2}ml +2l -7+ \frac{{{l^2} - 1}}{2}m < 2n\) and \(2n - qy(\bmod \ 2n) > x\), a contradiction.

Finally, note that

$$\begin{aligned} - q\left( \frac{{3l - 3}}{2}m-3\right) \equiv \frac{{3l - 3}}{2}m - 3 \mod 2n, \end{aligned}$$

and \(\frac{{3l - 3}}{2}m - 3\notin T.\)

Therefore, we can deduce that \(x+qy\not \equiv 0 \bmod 2n\) for any odd integers \(x,y\in I_{0}\). Hence, \({\mathcal {C}}^{\bot _h}\subseteq {\mathcal {C}}\) holds.

\(\square \)

Lemma 4.6

Let \(n=\frac{q^2-1}{a}\), where q is an odd prime power of the form \(q=am-l\), \(a=\frac{l^2-1}{2}\), \(l \equiv 1 \mod 4\), and l is a positive integer.

  1. (1)

    For \(1\le i \le 3\), \(C_{(\frac{l - 1}{2}m-1)(2i + 1)}\) is skew-symmetric, and \((C_{\frac{7l-3}{2}m-7},C_{\frac{3l-7}{2}m-3})\) forms a skew-asymmetric pair.

  2. (2)
    $$\begin{aligned}|{T_{ss}}(\delta )| = \left\{ \begin{array}{l} 0,\quad 2\le \delta \le \frac{l - 1}{2}m- 1;\\ 1,\quad \frac{l - 1}{2}m \le \delta \le (l-1)m -2;\\ 2,\quad (l - 1)m - 1 \le \delta \le \frac{{3l - 3}}{2}m - 3;\\ 3,\quad \frac{{3l - 3}}{2}m - 2 \le \delta \le \frac{3l-1}{2}m-3. \end{array} \right. \end{aligned}$$

Proof

  1. (1)

    Since \(q(\frac{l - 1}{2}m-1)(2i + 1) =(2i+1)[\frac{l-1}{2}n+\frac{l-1}{2}ml-(l-1)-\frac{l^2-1}{2}m+l],\) where \(1 \le i \le 3\). Then

    $$\begin{aligned} -q(\frac{l - 1}{2}m-1)(2i + 1) \equiv (2i+1)(\frac{l - 1}{2}m-1) \mod 2n. \end{aligned}$$

    Hence, for \(1\le i \le 3\), \(C_{(\frac{l - 1}{2}m-1)(2i + 1)}\) is skew-symmetric. Since \(q(\frac{7l-3}{2}m-7)=\frac{7l-3}{2}n+\frac{7l-3}{2}ml+3-\frac{7(l^2-1)}{2}m\), then

    $$\begin{aligned} -q\left( \frac{7l-3}{2}m-7\right) \equiv \frac{3l-7}{2}m-3 \mod 2n \end{aligned}$$

    Hence, \((C_{\frac{7l-3}{2}m-7},C_{\frac{3l-7}{2}m-3})\) forms a skew-asymmetric pair.

  2. (2)

    According to Lemma 4.5, if the defining set \(T=\cup _{j=\frac{l-1}{4}m}^{s}C_{1+2j}\), where \(\frac{l-1}{4}m\le s\le \frac{3l-3}{4}m-3\), then \(|T_{ss}(\delta )|=0\) for \(2\le \delta \le \frac{l-1}{2}m-1\). Let

    $$\begin{aligned}&{I_1} = \left[ \frac{{3(l-1)}}{2}m - 1,\frac{{5(l-1)}}{2}m - 7\right] ,\\&{I_2} = \left[ \frac{{5(l-1)}}{2}m - 3,\frac{{7(l-1)}}{2}m - 9\right] ,\\&{I_3} = \left[ \frac{{7(l-1)}}{2}m - 5,\frac{{7l-3}}{2}m - 9\right] . \end{aligned}$$

Assume that \({T_1} = \cup _{j = \frac{{l-1}}{4}m}^{\frac{{3(l-1)}}{4}m - 2} {C_{1 + 2j}}\). Let the defining set \({T} = \cup _{j = \frac{{3(l-1)}}{4}m - 1}^s {{C_{1 + 2j}}} \cup {T_1}\), where \(\frac{{3(l-1)}}{4}m -1 \le s \le \frac{{5(l-1)}}{4}m - 4\). If \(|T_{ss}(\delta )|=1\) holds for \(\frac{l-1}{2}m \le \delta \le (l-1)m - 2\), then according to Lemma 2.3, we only need to prove that for any odd integers \(x \in {I_0} \cup {I_1}\) and \(y\in I_{1}\) such that \(x \not \equiv - qy\bmod 2n\).

Dividing \({I_1}\) into the following \(\frac{l-1}{2}\) parts

$$\begin{aligned}&I_{1,\frac{3l-3}{4}} = \left[ \frac{{3(l - 1)}}{2}m - 1,\frac{{3l + 1}}{2}m - 5\right] ,\\&I_{1,i} = \left[ 2im - 3,2(i+1)m - 5\right] , \\&I_{1,\frac{5l-9}{4}} = \left[ \frac{5l-9}{2}m - 3,\frac{{5l - 5}}{2}m - 7\right] , \end{aligned}$$

where \(\frac{3l+1}{4} \le i \le \frac{5l-13}{4}\).

If \(x,y \in {I_{1,\frac{3l-3}{4}}}\), then \(\frac{3(l-1)}{2}n< (\frac{3(l-1)}{2}m-1)(\frac{{{l^2} - 1}}{2}m - l + 1) \le x + qy \le (\frac{3l+1}{2}m-5)(\frac{{{l^2} - 1}}{2}m - l + 1) < \frac{3l-1}{2}n.\)

If \(x,y \in {I_{1,i}}\), where \(\frac{3l+1}{4} \le i \le \frac{5l-13}{4}\), then \(2in< (2im - 3)(\frac{{{l^2} - 1}}{2}m - l + 1) \le x + qy \le [2(i + 1)m - 5](\frac{{{l^2} - 1}}{2}m - l + 1) < 2(i + 1)n\).

If \(x,y \in {I_{1,\frac{5l-9}{4}}}\), then \(\frac{5l-9}{2}n< (\frac{5l-9}{2}m-3)(\frac{{{l^2} - 1}}{2}m - l + 1) \le x + qy \le (\frac{5l-5}{2}m-7)(\frac{{{l^2} - 1}}{2}m - l + 1) < \frac{5l-5}{2}n.\)

If \(x \in {I_0}\), \(y \in {I_{1,\frac{3l-3}{4}}}\), then \(0<-\frac{3l+1}{2}ml-2l+1+\frac{5(l^2-1)}{2}m \le 2n - qy(\bmod \ 2n) \le 2n - \frac{3l-3}{2}ml+\frac{l^2-1}{2}m+2l-3 < 2n\) and \(2n - qy(\bmod \ 2n) > x\).

If \(x \in I_0 \cup {I_{1,\frac{3l-3}{4}}}\), \(y \in {I_{1,i}}\), where \(\frac{3l+1}{4} \le i \le \frac{{5l - 13}}{4}\), then \(0< -2(i+1)ml + 4(i+1) + \frac{{5({l^2} - 1)}}{2}m -5l \le 2n - qy(\bmod \ 2n) \le 2n - 2iml + 4i + \frac{{3({l^2} - 1)}}{2}m - 3l < 2n\) and \(2n - qy(\bmod \ 2n) > x\).

If \(x\in I_0 \cup {I_{1,i}} \), \(y\in I_{1,\frac{5l-9}{4}}\), where \(\frac{3l-3}{4} \le i \le \frac{{5l - 13}}{4}\), then \(0< \frac{2l^2+5l-7}{2}m-2l-5 \le 2n - qy(\bmod \ 2n) \le 2n -\frac{5l-9}{2}ml +2l -9+ \frac{3({{l^2} - 1})}{2}m < 2n\) and \(2n - qy(\bmod \ 2n) > x\).

Consequently, we have \(x \not \equiv - qy\bmod 2n\) for any odd integers \(x \in {I_0} \cup {I_1}\) and \(y\in I_{1}\). Hence,

$$\begin{aligned} {T_{ss}} = T \cap T^{-q}={C_{\frac{{3l - 3}}{2}m-3}}=\left\{ \frac{{3l - 3}}{2}m-3\right\} , \end{aligned}$$

which means that \(\left| {{T_{ss}}}(\delta ) \right| = 1\) for \(\frac{l - 1}{2}m \le \delta \le (l-1)m -2\).

The remaining cases can be proved in the same way, we omit them here.

\(\square \)

Theorem 4.3

Let \(n=\frac{q^2-1}{a}\), where q is an odd prime power of the form \(q=am-l\), \(a=\frac{l^2-1}{2}\), \(l \equiv 1 \mod 4\), and l is a positive integer. Then there exist EAQMDS codes with parameters as follows:

  1. (1)

    \([[\frac{{{q^2} - 1}}{a},\frac{{{q^2} - 1}}{a} - 2d + 3,d;1]]_q\), where \(\frac{l - 1}{2}m \le d \le (l-1)m -2\);

  2. (2)

    \([[\frac{{{q^2} - 1}}{a},\frac{{{q^2} - 1}}{a} - 2d + 4,d;2]]_q\), where \((l - 1)m - 1 \le d \le \frac{{3l - 3}}{2}m - 3\);

  3. (3)

    \([[\frac{{{q^2} - 1}}{a},\frac{{{q^2} - 1}}{a} - 2d + 5,d;3]]_q\), where \(\frac{{3l - 3}}{2}m - 2 \le d \le \frac{3l-1}{2}m - 3\).

Proof

Let q be an odd prime power of the form \(q=am-l\), \(a=\frac{l^2-1}{2}\). Consider the negacyclic code \({\mathcal {C}}\) of length \(n=\frac{q^2-1}{a}\) over \({\mathbb {F}}_{q^2}\) with defining set \(T = \cup _{j = \frac{{l - 1}}{4}m }^s{C_{1 + 2j}}\), where \( \frac{{l - 1}}{4}m \le s \le \frac{{7l-3}}{4}m - 5.\)

By Lemma 4.6, one obtains that \(c = |{T_{ss}(\delta )}| = 1\) if \(\frac{{3(l-1)}}{4}m -2 \le s \le \frac{{5(l-1)}}{4}m - 4\), \(c = |{T_{ss}(\delta )}| = 2\) if \(\frac{{5(l-1)}}{4}m - 3 \le s \le \frac{{7(l-1)}}{4}m -5\), and \(c = |{T_{ss}(\delta )}| = 3\) if \(\frac{{7(l-1)}}{4}m -4 \le s \le \frac{{7l-3}}{4}m -5\).

Since every \(q^2\)–cyclotomic coset \(C_{x}=\{x\}\) and x is an odd number, we can obtain that T consists of \(s-\frac{{l -1}}{4}m+1\) integers

$$\begin{aligned} \left\{ \frac{{l - 1}}{2}m + 1,\frac{{l - 1}}{2}m + 3, \cdots ,1 + 2s \right\} . \end{aligned}$$

It implies that \({\mathcal {C}}\) has minimum distance at least \(s -\frac{{l - 1}}{4}m + 2\). Hence, \({\mathcal {C}}\) is a \(q^2\)-ary negacyclic code with parameters \([n,n - s + \frac{{l - 1}}{4}m-1 , \ge s - \frac{{l - 1}}{4}m + 2]\).

Then the theorem is proved by using Theorem 2.1 and the EA-quantum Singleton bound.

\(\square \)

Remark 4.3

According to Lemma 4.6 and Theorem 2.1, there exists a q-ary quantum MDS code with parameters \([[\frac{{{q^2} - 1}}{a},\frac{{{q^2} - 1}}{a} - 2d + 2,d]]\), where \( 2 \le d \le \frac{l - 1}{2}m- 1\).

Remark 4.4

Let \(l=5\) in Theorems 4.1 and 4.3, we obtain some EAQMDS codes of length \(\frac{q^2-1}{12}\), where \(q=12m\pm 5\). Actually, EAQMDS codes of length \(\frac{q^2-1}{12}\) under the case \(q=12m+5\) had been already studied in [30]. Later, [19] improved their results. It is easy to see that our results coincide with the results in [19] under the case \(q=12m+5\). However, our results are more general. We give Table 5 to indicate this comparison.

Table 5 List of comparisons for EAQMDS codes of length \(\frac{q^2-1}{12}\)

Now we consider the case \(l \equiv 3 \mod 4\) and a useful lemma is given in the following.

Lemma 4.7

Let \(n=\frac{q^2-1}{a}\), where q is an odd prime power of the form \(q=am-l\), \(a=\frac{l^2-1}{2}\), \(l \equiv 3 \mod 4\), and l is a positive integer. If \({\mathcal {C}}\) is a \(q^2\)-ary negacyclic code of length n with defining set

$$\begin{aligned} T=\bigcup _{j=\frac{l-3}{4}m}^{s}C_{1+2j},\quad \frac{l-3}{4}m\le s\le \frac{5l-3}{4}m-4, \end{aligned}$$

then \({\mathcal {C}}^{\bot _h}\subseteq {\mathcal {C}}\).

Proof

According to Lemma 2.2, one obtains that \({\mathcal {C}}^{\bot _h}\subseteq {\mathcal {C}}\) if and only if there is no skew-symmetric cyclotomic coset and any two cyclotomic cosets do not form a skew-asymmetric pair in the defining set T.

Suppose that there exist odd integers \(x,y \in I_0\), such that \({C_x} = - q{C_y}\), i.e. \(x + qy\equiv 0\bmod 2n\).

Dividing \(I_0 = \left[ \frac{{l - 3}}{2}m + 1,\frac{{5l - 3}}{2}m - 7\right] \) into the following l parts

$$\begin{aligned}&{I_{0,\frac{l-3}{4}}} = \left[ \frac{l-3}{2}m+1,\frac{l+1}{2}m-3\right] ,\\&{I_{0,i}}= [2im - 1,2(i + 1)m - 3],\\&{I_{0,\frac{3l-5}{4}}} = \left[ \frac{3l-5}{2}m-1,\frac{3l-1}{2}m-5\right] ,\\&{I_{0,j}}= [2jm - 3,2(j + 1)m - 5],\\&{I_{0,\frac{5l-7}{4}}} = \left[ \frac{5l-7}{2}m-3,\frac{5l-3}{2}m-7\right] , \end{aligned}$$

where \(\frac{{l + 1}}{4} \le i \le \frac{{3l - 9}}{4},\frac{{3l - 1}}{4} \le j \le \frac{{5l - 11}}{4}\). Since

$$\begin{aligned} q=am-l,\quad a=\frac{l^2-1}{2},\quad l \equiv 3 \mod 4,\quad n = \frac{{{q^2} - 1}}{a} = \frac{{{l^2} - 1}}{2}{m^2} - 2ml + 2. \end{aligned}$$

If \(x,y \in {I_{0,\frac{l-3}{4}}}\), then \(\frac{l-3}{2}n< (\frac{l-3}{2}m + 1)(\frac{{{l^2} - 1}}{2}m - l + 1) \le x + qy \le (\frac{l+1}{2}m-3)(\frac{{{l^2} - 1}}{2}m - l + 1) < \frac{l+1}{2}n,\) a contradiction.

If \(x,y \in {I_{0,i}}\), where \(\frac{{l + 1}}{4} \le i \le \frac{{3l - 9}}{4}\), then \(2in< (2im - 1)(\frac{{{l^2} - 1}}{2}m - l + 1) \le x + qy \le [2(i + 1)m -3](\frac{{{l^2} - 1}}{2}m - l + 1)< 2(i + 1)n,\) a contradiction.

If \(x,y \in {I_{0,\frac{3l-5}{4}}}\), then \(\frac{3l-5}{2}n< (\frac{3l-5}{2}m - 1)(\frac{{{l^2} - 1}}{2}m - l + 1) \le x + qy \le (\frac{3l-1}{2}m-5)(\frac{{{l^2} - 1}}{2}m - l + 1) < \frac{3l-1}{2}n,\) a contradiction.

If \(x,y \in {I_{0,j}}\), where \(\frac{{3l - 1}}{4} \le j \le \frac{{5l - 11}}{4}\), then \(2jn< (2jm - 3)(\frac{{{l^2} - 1}}{2}m - l + 1) \le x + qy \le [2(j + 1)m -5](\frac{{{l^2} - 1}}{2}m - l + 1) < 2(j + 1)n,\) a contradiction.

If \(x,y \in {I_{0,\frac{5l-7}{4}}}\), then \(\frac{5l-7}{2}n< (\frac{5l-7}{2}m - 3)(\frac{{{l^2} - 1}}{2}m - l + 1) \le x + qy \le (\frac{5l-3}{2}m-7)(\frac{{{l^2} - 1}}{2}m - l + 1) < \frac{5l-3}{2}n,\) a contradiction.

If \(x \in {I_{0,k}},y \in {I_{0,i}}\), where \(\frac{l-3}{4} \le k< i \le \frac{3l-9}{4}\), then \(0< -2(i + 1)ml + 4i + 4 +\frac{3({l^2} - 1)}{2}m - 3l \le 2n - qy(\bmod \ 2n) \le 2n - 2iml + 4i + \frac{{{l^2} - 1}}{2}m - l < 2n\) and \(2n - qy(\bmod \ 2n) > x\), a contradiction.

If \(x \in {I_{0,k}},y \in {I_{0,\frac{3l-5}{4}}}\), where \(\frac{l-3}{4} \le k\le \frac{3l-9}{4}\), then \(0< \frac{2l^2+l-5}{2}m-2l-1 \le 2n - qy(\bmod \ 2n) \le 2n-\frac{2l^2-5l+1}{2}m+2l-5 < 2n\) and \(2n - qy(\bmod \ 2n) > x\), a contradiction.

If \(x \in {I_{0,k}}, y \in {I_{0,j}}\), where \(\frac{l-3}{4}\le k<j, \frac{3l-1}{4}\le j \le \frac{5l-11}{4}\), then \(0< -2(j + 1)ml + 4j + 4 +\frac{5({l^2} - 1)}{2}m - 5l \le 2n - qy(\bmod \ 2n) \le 2n - 2jml + 4j + \frac{3({l^2} - 1)}{2}m - 3l < 2n\) and \(2n - qy(\bmod \ 2n) > x\), a contradiction.

If \(x \in {I_{0,k}},y \in {I_{0,\frac{5l-7}{4}}}\), where \(\frac{l-3}{4} \le k \le \frac{5l-11}{4}\), then \(0< \frac{2l^2+3l-7}{2}m-2l-3 \le 2n - qy(\bmod \ 2n) \le 2n-\frac{2l^2-7l+3}{2}m+2l-7 < 2n\) and \(2n - qy(\bmod \ 2n) > x\), a contradiction.

In conclusion, we can deduce that \(x+qy\not \equiv 0 \bmod 2n\) for any odd integers \(x,y\in I_{0}\). Hence, \({\mathcal {C}}^{\bot _h}\subseteq {\mathcal {C}}\) holds.

\(\square \)

Lemma 4.8

Let \(n=\frac{q^2-1}{a}\), where q is an odd prime power of the form \(q=am-l\), \(a=\frac{l^2-1}{2}\), \(l \equiv 3 \mod 4\), and l is a positive integer.

  1. (1)

    For \(1\le i \le 3\), \(({C_{\frac{{(2i + 1)l - 2i - 3}}{2}m - (2i+1)},C_{\frac{{(2i + 3)l - 2i - 1}}{2}m - (2i+3)}})\) forms a skew-asymmetric pair.

  2. (2)
    $$\begin{aligned}|{T_{ss}}(\delta )| = \left\{ \begin{array}{l} 0,\quad 2\le \delta \le lm - 2;\\ 2,\quad lm - 1 \le \delta \le \frac{{3l - 1}}{2}m - 3;\\ 4,\quad \frac{{3l - 1}}{2}m - 2 \le \delta \le (2l-1)m-4.\mathrm{{ }} \end{array} \right. \end{aligned}$$

Proof

  1. (1)

    Since \(q[\frac{(2i + 1)l - 2i - 3}{2}m - (2i+1)] = \frac{(2i + 1)l - 2i - 3}{2}n+\frac{(2i + 1)l - 2i - 3}{2}ml+(2i+3)-\frac{(2i+1)({l^2} - 1)}{2}m\), where \(1\le i\le 3\). Then

    $$\begin{aligned} - q\left[ \frac{{(2i + 1)l - 2i-3}}{2}m - (2i + 1)\right] \equiv \frac{{(2i + 3)l - 2i - 1}}{2}m - (2i+3) \mod 2n. \end{aligned}$$

    Hence, for \(1\le i \le 3\), \(({C_{\frac{{(2i + 1)l - 2i - 3}}{2}m - (2i+1)},C_{\frac{{(2i + 3)l - 2i - 1}}{2}m - (2i+3)}})\) forms a skew-asymmetric pair.

  2. (2)

    According to Lemma 4.7, if the defining set \(T = \cup _{j = \frac{{l - 3}}{4}m}^s {C_{1 + 2j}}\), where \(\frac{{l - 3}}{4}m \le s \le \frac{{5l - 3}}{4}m-4\), then \({\mathcal {C}}^{\bot _h}\subseteq {\mathcal {C}}\). Hence, \(|{T_{ss}}(\delta )| = 0 \) for \(2\le \delta \le lm-2.\) Let

    $$\begin{aligned} \quad {I_1} = \left[ \frac{{5l - 3}}{2}m - 3,\frac{{7l - 5}}{2}m - 9\right] , {I_2} =\left[ \frac{{7l - 5}}{2}m - 5,\frac{{9l - 7}}{2}m - 11\right] . \end{aligned}$$

Suppose that \({T_1} = \cup _{j = \frac{{l - 3}}{4}m }^{\frac{{5l - 3}}{4}m - 3} {C_{1 + 2j}}\). Let the defining set \({T} = \cup _{j = \frac{{5l - 3}}{4}m - 2}^s {{C_{1 + 2j}}} \cup {T_1}\), where \(\frac{{5l - 3}}{4}m - 2 \le s \le \frac{{7l - 5}}{4}m - 5\). If \(|{T_{ss}}(\delta )| = 2 \) holds for \(lm - 1 \le \delta \le \frac{3l-1}{2}m-3\), then according to Lemma 2.3, we only need to demonstrate that for any odd integers \(x \in {I_0} \cup {I_1}\) and \(y\in I_{1}\), \(x\not \equiv - qy\bmod 2n\).

Dividing \({I_1}\) into the following \(\frac{l-1}{2}\) parts

$$\begin{aligned} I_{1,\frac{5l-3}{4}}&= \left[ \frac{{5l - 3}}{2}m - 3,\frac{{5l + 1}}{2}m - 7\right] ,\\ I_{1,i}&=\left[ 2im-5,2(i+1)m-7\right] ,\\ I_{1,\frac{7l-9}{4}}&=\left[ \frac{7l-9}{2}m-5,\frac{7l-5}{2}m-9\right] , \end{aligned}$$

where \(\frac{5l+1}{4} \le i \le \frac{7l-13}{4}.\)

If \(x,y\in I_{1,\frac{5l-3}{4}}\), then \(\frac{{5l -3}}{2}n< (\frac{5l-3}{2}m-3)(\frac{l^2-1}{2}m-l+1) \le x + qy \le (\frac{5l+1}{2}m-7)(\frac{l^2-1}{2}m-l+1)< \frac{{5l + 1}}{2}n.\)

If \(x,y\in {I_{1,i}},\) where \(\frac{{5l + 1}}{4} \le i \le \frac{{7l - 13}}{4}\). Then \(2in<i({l^2}-1){m^2}-2iml+2im- \frac{{5({l^2}-1)}}{2}m + 5l-5 \le x + qy \le (i+1)({l^2}-1){m^2}-2(i+1)ml+2(i+1)m-\frac{7({l^2} - 1)}{2}m + 7l - 7< 2(i+1)n.\)

If \(x,y\in I_{1,\frac{7l-9}{4}}\), then \(\frac{{7l - 9}}{2}n<(\frac{7l-9}{2}m-5)(\frac{l^2-1}{2}m-l+1) \le x + qy \le (\frac{7l-5}{2}m-9)(\frac{l^2-1}{2}m-l+1)< \frac{{7l - 5}}{2}n.\)

If \(x\in I_{0}\), \(y\in I_{1,\frac{5l-3}{4}},\) then \(0< -\frac{5l+1}{2}ml-2l+1+\frac{7(l^2-1)}{2}m \le 2n - qy(\bmod \ 2n) \le 2n - \frac{5l-3}{2}ml+2l-3+\frac{3(l^2-1)}{2}m < 2n.\) and \(2n - qy(\bmod \ 2n) > x\).

If \(x\in I_{1,\frac{5l-3}{4}}\), \(y\in I_{1,i},\) where \(\frac{5l+1}{4} \le i \le \frac{7l-13}{4}\), then \(0< -2(i + 1)ml + 4i + 4 + \frac{{7({l^2} - 1)}}{2}m - 7l \le 2n - qy(\bmod \ 2n) \le 2n - 2iml + 4i + \frac{{5({l^2} - 1)}}{2}m - 5l < 2n.\) and \(2n - qy(\bmod \ 2n) > x\).

If \(x \in I_0 \cup I_{1,i} \), \(y\in I_{1,\frac{7l-9}{4}},\) where \(\frac{5l-3}{4} \le i \le \frac{7l-13}{4}\), then \(0< -\frac{{7l - 5}}{2}ml + 7l - 5 + \frac{{9({l^2} - 1)}}{2}m - 9l \le 2n - qy(\bmod \ 2n) \le 2n - \frac{{7l - 9}}{2}ml + 7l - 9 + \frac{{5({l^2} - 1)}}{2}m - 5l < 2n\) and \(2n - qy(\bmod \ 2n) > x\).

Consequently, we have \(x\not \equiv - qy\bmod 2n\) for any odd integers \(x \in {I_0} \cup {I_1}\) and \(y\in I_{1}\). Hence, we have

$$\begin{aligned} {T_{ss}}= T \cap T^{-q} = C_{\frac{{3l - 5}}{2}m-3} \cup C_{\frac{{5l - 3}}{2}m-5}, \end{aligned}$$

which implies that \(\left| {{T_{ss}}} (\delta )\right| = 2\) for \(lm - 1 \le \delta \le \frac{3l-1}{2}m-3\).

The remaining case can be proved in the same way, we omit it here.

\(\square \)

Table 6 List of comparisons for EAQMDS codes of length \(\frac{q^2-1}{4}\)
Table 7 New EAQMDS codes of length \(n=\frac{q^{2}-1}{a}\) with \(\,a=\frac{l^2-1}{2}\)

Theorem 4.4

Let \(n=\frac{q^2-1}{a}\), where q is an odd prime power of the form \(q=am-l\), \(a=\frac{l^2-1}{2}\), \(l \equiv 3 \mod 4\), and l is a positive integer. Then there exist EAQMDS codes with parameters as follows:

  1. (1)

    \([[\frac{{{q^2} - 1}}{a},\frac{{{q^2} -1}}{a} - 2d + 4,d;2]]_q\), where \(lm - 1 \le d \le \frac{{3l - 1}}{2}m - 3\);

  2. (2)

    \([[\frac{{{q^2} - 1}}{a},\frac{{{q^2} - 1}}{a} - 2d + 6,d;4]]_q\), where \(\frac{{3l - 1}}{2}m - 2 \le d \le (2l-1)m-4\).

Proof

Let q be an odd prime power of the form \(q=am-l\), \(a=\frac{l^2-1}{2}\). Consider the negacyclic code \({\mathcal {C}}\) of length \(n=\frac{q^2-1}{a}\) over \({\mathbb {F}}_{q^2}\) with defining set \(T = \cup _{j = \frac{{l - 3}}{4}m}^s{C_{1 + 2j}}\), where \( \frac{{l - 3}}{4}m \le s \le \frac{{9l - 7}}{4}m - 6.\)

By Lemma 4.8, we have \(c = |{T_{ss}(\delta )}| = 2\) if \(\frac{{5l - 3}}{4}m-3 \le s \le \frac{{7l - 5}}{4}m - 5\) and \(c = |{T_{ss}(\delta )}| = 4\) if \( \frac{{7l - 5}}{4}m -4\le s \le \frac{{9l - 7}}{4}m - 6\).

Since every \(q^2\)-cyclotomic coset \(C_{x}=\{x\}\) and x is an odd number, we can obtain that T consists of \(s - \frac{{l - 3}}{4}m+1\) integers

$$\begin{aligned} \left\{ \frac{{l - 3}}{2}m + 1,\frac{{l - 3}}{2}m + 3, \cdots ,1 + 2s\right\} . \end{aligned}$$

It implies that \({\mathcal {C}}\) has minimum distance at least \(s - \frac{{l - 3}}{4}m + 2\). Hence, \({\mathcal {C}}\) is a \(q^2\)-ary negacyclic code with parameters \([n,n - s +\frac{{l -3}}{4}m-1, \ge s - \frac{{l - 3}}{4}m + 2]\).

Then the theorem holds due to Theorem 2.1 and the EA-quantum Singleton bound.

\(\square \)

Remark 4.5

According to Lemma 4.8 and Theorem 2.1, there exists a q-ary quantum MDS code with parameters \([[\frac{{{q^2} - 1}}{a},\frac{{{q^2} - 1}}{a} - 2d + 2,d]]\) , where \( 2 \le d \le lm - 2\).

Remark 4.6

EAQMDS codes of length \(\frac{q^2-1}{4}\) under the case \(q=4m+3\) had been already studied in [28]. Later, [39] improved their results. Plugging \(l=3\) into Theorems 4.2 and 4.4, we also obtain some EAQMDS codes of length \(\frac{q^2-1}{4}\), where \(q=4m\pm 3\). One can see that our results sometimes are not as good as theirs under the case \(q=4m+3\). However, EAQMDS codes of length \(\frac{q^2-1}{4}\) are just a special case of our results. Hence, our results are more general. We give Table 6 to indicate this comparison.

Example 4.2

In Table 7, we list some new EAQMDS codes of length \(\frac{q^2-1}{a}\) obtained from Theorems 4.3 and 4.4, where q is an odd prime power of the form \(q = am - l\), \(a =\frac{{l^2} - 1}{2}\), and l is a positive odd integer.

5 Conclusion

In this paper, EAQMDS codes of length \(\frac{q^2-1}{a}\) with \(a=l^2-1\) and \(a=\frac{l^2-1}{2}\) have been constructed from negacyclic codes by exploiting less pre-shared maximally entangled states. Actually, EAQMDS codes of length \(\frac{q^2-1}{a}\) with a either divides \(q+1\) or divides \(q-1\) had been already constructed (See [9, 37] and the relevant references therein). However, our a either divides \(q+l\) or divides \(q-l\) and \(l>1\) is an odd integer. Hence, EAQMDS codes obtained in this paper are new in the sense that their parameters are not covered by the codes available in the literature, except EAQMDS codes of lengths \(\frac{q^2-1}{4}\) and \(\frac{q^2-1}{12}\) under some special cases.