1 Introduction

Over recent decades, the quantum information science has developed very rapidly. Quantum error-correcting (QEC) codes were introduced in order to minimize the decoherence phenomenon over the quantum information channel. After Calderbank et al. [3] gave a connection between classical linear error-correcting codes and QEC codes, the research of QEC codes has made rapidly progress. By utilizing self-orthogonal classical error-correcting codes, a number of QEC codes with favorable parameters have been derived (see [13, 20,21,22, 25, 26, 41] and the relevant references therein). Nevertheless, the self-orthogonality condition forms an obstacle to the construction of QEC codes. Later, a breakthrough had been made by Brun et al. [2], where entanglement-assisted (EA) stabilizer formalism was proposed, which utilizes pre-shared entanglement among the sender as well as the receiver to construct QEC codes. The associated codes are known as entanglement-assisted quantum error-correcting (EAQEC) codes that may be constructed from arbitrary classical linear error-correcting codes without the self-orthogonality constraint. After that, numerous researchers have been working on constructing EAQEC codes with good parameters via classical linear error-correcting codes (see [9, 11, 15, 17, 38] and the references therein).

Suppose that q is a prime power, an \([[n,k,d;c]]_q\) EAQEC code can correct at most \(\lfloor \frac{d-1}{2}\rfloor \) errors by encoding k information qudits into n channel qudits with the assistance of c copies of maximally entangled states. In particular, if \(c=0\), it is the so-called standard \([[n,k,d]]_q\) QEC code. Analogous to the quantum Singleton bound for the parameters of QEC codes, the more general entanglement-assisted (EA)-quantum Singleton bound for the parameters of EAQEC codes is available to us in the following.

Theorem 1.1

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

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

where \(0\le c \le n-1\). Furthermore, it is indeed the quantum Singleton bound if \(c=0\).

Specifically, an EAQEC code is called an EAQMDS code if it exactly satisfy this bound. Recently, by using constacyclic codes (including cyclic codes and negacyclic codes), generalized Reed–Solomon(GRS) codes as well as extended GRS codes, numerous EAQMDS codes have been constructed in a variety of ways. In [7], due to classical MDS codes of a certain code length, Fan et al. derived several classes of EAQMDS codes with a small number of pre-shared maximally entangled states. Subsequently, Lu et al. [28] determined the number of maximally entangled states via the decomposition of the defining set of BCH codes and many EAQMDS codes with larger minimum distances were constructed. This approach was extended to constacyclic codes by Lu et al. [29] and Chen et al. [4], respectively, and several new classes of EAQMDS codes were derived. Thereafter, by using the decomposition of the defining set of constacyclic codes, many classes of EAQMDS codes of lengths dividing \(q^2\pm 1\) have been derived (see [5, 6, 16, 19, 27, 30, 34, 36, 37, 40, 42] and the relevant references therein). At the same time, due to the excellent algebraic structure of the GRS codes, a significant number of EAQMDS codes were also constructed from GRS codes. In [11], Guenda et al. developed a relationship between the hull of the classical linear error-correcting codes and the number of maximally entangled states which is needed to construct EAQEC codes. Additionally, by studying the hull of the GRS codes, they also derived some new EAQMDS codes. Inspired by the ideas of [11], many classes of MDS codes with hulls of arbitrary dimensions were studied by Luo et al. [32] via GRS codes, and new classes of EAQMDS codes were obtained. Besides, a number of other EAQMDS codes were derived via GRS codes as well as extended GRS codes (see [8, 14, 24, 31, 35, 39]).

Notably, the lengths of most EAQMDS codes mentioned above are divisors of \(q^2\pm 1\). Therefore, scholars are also committed to construct EAQMDS codes of lengths not dividing \(q^2 \pm 1\). Guo et al. [12] extended the lengths of EAQMDS codes by adding 1 to the lengths in [14], so the lengths may not divide \(q^2\pm 1\). Jin et al. [18] derived several new classes of EAQMDS codes from GRS codes over finite fields of odd characteristic q, whose lengths may not be divisors of \(q^2\pm 1\) and can reach \((q+1)(q-3)\). Very recently, Wang and Li [44] constructed two classes of EAQMDS codes of the lengths that are sums of two divisors of \(q^2-1\) from GRS codes.

Going on the line of the above work, we construct three classes of EAQMDS codes with parameters \([[n, n-2d+c+2, d; c]]_q\) based on GRS codes as follows:

  1. (1)

    \(n=\frac{b({q^2}-1)}{a}+\frac{{q^2}-1}{a}\), \(a\vert (q+1)\), \(a+b \equiv 1\ (\textrm{mod}\ 2)\), \(2\le d\le \frac{a+b+1}{2}\cdot \frac{q+1}{a}\) and \(c=b+1\).

  2. (2)

    \(n=\frac{b({q^2}-1)}{a}+\frac{{q^2}-1}{a}\), \(a\vert (q+1)\), \(a+b \equiv 0\ (\textrm{mod}\ 2)\), \(2\le d\le \frac{a+b+2}{2}\cdot \frac{q+1}{a}-1\) and \(c=b+1\).

  3. (3)

    \(n=\frac{b({q^2}-1)}{a}\), \(a\vert (q-1)\), \((a,b)\ne (q-1,q-1)\), \(2\le d\le \frac{b(q-1)}{a}+1\) and \(c=b\).

Compared to standard QEC codes, the EAQEC codes enhance communication capabilities at the expense of pre-shared entanglement. In this paper, it is worth noting that some of the lengths of EAQMDS codes are the sum of two divisors of \(q^2-1\), which implies that the lengths of our codes might not be divisors of \(q^2-1\). Some of the lengths are new and have never been covered by the lengths available in the literature. This extends the length of the EAQMDS codes. Also, compared with known EAQMDS codes, our codes have larger minimum distances, which enhance the error-correction capability. The paper is structured as follows. Some basic concepts and results about GRS codes and EAQEC codes are reviewed in Sect. 2. In Sect. 3, three new classes of EAQMDS codes are obtained from GRS codes. Section 4 gives a conclusion.

2 Preliminaries

Let \(\mathbb {F}_{q^2}\) be the finite field with \(q^2\) elements, where q is a prime power. A \(q^2\)-ary linear code \(\mathcal {C}\) is denoted by \([n,k,d]_{q^2}\) if its length is n, its dimension is k and its minimum distance is d, which is a linear subspace of \(\mathbb {F}^n_{q^2}\). Moreover, the minimum distance d of the code \(\mathcal {C}\) must satisfy the following well-known bound.

Theorem 2.1

[33] (Singleton bound) An [nkd] linear code \(\mathcal {C}\) over \(\mathbb {F}_{q^2}\) must satisfy

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

A linear code is called an maximum-distance-separable (MDS) code if the equality holds.

For any two vectors \({\textbf {x}}=(x_0,x_1,\ldots ,x_{n-1})\) and \({\textbf {y}}=(y_0,y_1,\ldots ,y_{n-1})\) belong to \(\mathbb {F}_{q^2}^n\), their Euclidean and Hermitian inner product are defined as

$$\begin{aligned} \langle {\textbf {x}},{\textbf {y}}\rangle _E=x_0y_0+x_1y_1+\cdots +x_{n-1}y_{n-1}, \end{aligned}$$

and

$$\begin{aligned} \langle {\textbf {x}},{\textbf {y}}\rangle _H=x_0y_0^q+x_1y_1^q+\cdots +x_{n-1}y_{n-1}^q, \end{aligned}$$

respectively. The Euclidean dual code and the Hermitian dual code of a linear code \(\mathcal {C} \) with parameters \([n,k,d]_{q^2}\) is respectively defined by

$$\begin{aligned}{} & {} \mathcal {C}^{\bot _E}=\{{\textbf {x}}\in \mathbb {F}_{q^2}^n\vert \langle {\textbf {x}},{\textbf {y}}\rangle _E=0, \forall \ {\textbf {y}}\in \mathcal {C}\},\\{} & {} \mathcal {C}^{\bot _H}=\{{\textbf {x}}\in \mathbb {F}_{q^2}^n\vert \langle {\textbf {x}},{\textbf {y}}\rangle _H=0, \forall \ {\textbf {y}}\in \mathcal {C}\}. \end{aligned}$$

The code \(\mathcal {C}\) is said to be Euclidean (Hermitian) self-orthogonal if \(\mathcal {C}\subseteq \mathcal {C}^{\bot _E}\) ( \(\mathcal {C}\subseteq \mathcal {C}^{\bot _H}\)).

Let \({\textbf {a}}=(\alpha _1, \alpha _2, \ldots , \alpha _n) \in \mathbb {F}_{q^2}^n\) and \({\textbf {v}}=(v_1, v_2, \ldots , v_n) \in (\mathbb {F}^*_{q^2})^n\), where \(\alpha _1, \alpha _2, \ldots , \alpha _n\) are n distinct elements of \(\mathbb {F}_{q^2}\) and \(v_1, v_2, \ldots , v_n\) are n nonzero elements of \(\mathbb {F}_{q^2}\) (\(v_i\) can be the same). For each integer k with \(1\le k\le n\), let

$$\begin{aligned} \mathbb {F}_{q^2}^n[x]_k=\{f(x)\in \mathbb {F}_{q^2}^n[x] \vert deg(f(x))\le k-1 \}. \end{aligned}$$

Then, the GRS code of length n and dimension k is defined as:

$$\begin{aligned} GRS_k({\textbf {a}},{\textbf {v}})=\{v_1f(\alpha _1), v_2f(\alpha _2), \ldots , v_nf(\alpha _n) \vert for \ all \ f(x)\in \mathbb {F}_{q^2}^n[x]_k\}. \end{aligned}$$

As everyone knows, the GRS code is exactly an MDS code with parameters \([n,k,n-k+1]\) over \(\mathbb {F}_{q^2}\), and it has a generator matrix shown below.

$$\begin{aligned} G_k = \begin{pmatrix} v_1 &{} v_2 &{} \cdots &{} v_n \\ v_1\alpha _1 &{} v_2\alpha _2 &{} \cdots &{} v_n\alpha _n \\ \vdots &{} \vdots &{} \ddots &{} \vdots \\ v_1\alpha _1^{k-1} &{} v_2\alpha _2 ^{k-1} &{} \cdots &{} v_n\alpha _n^{k-1} \\ \end{pmatrix}. \end{aligned}$$

The following famous result illustrates the dual code of a GRS code.

Theorem 2.2

[33] The dual code of \(GRS_k({\textbf {a}},{\textbf {v}})\) is \(GRS_{n-k}({\textbf {a}},{\textbf {v}}^{'})\) for a vector \({\textbf {v}}^{'}=\{v_1^{'},v_2^{'},\ldots ,v_n^{'}\}\), such that \(v_i^{'}\ne 0\) for any \(1\le i\le n\).

Remark 2.1

According to Theorem 2.2, the dual code of an \([n,k,n-k+1]_{q^2}\) \(GRS_k({\textbf {a}},{\textbf {v}})\) is still an \([n,n-k,k+1]_{q^2}\) GRS code. Additionally, the parity-check matrix of \(GRS_{n-k}({\textbf {a}},{\textbf {v}}^{'})\) is the generator matrix of \(GRS_k({\textbf {a}},{\textbf {v}})\).

For any \(\eta \in \mathbb {F}_{q^2}\), the conjugate of \(\eta \) is defined as \(\overline{\eta }=\eta ^q \). Let \(A=(a_{ij})_{m \times n}\) be an \(m \times n\) matrix over \(\mathbb {F}_{q^2}\) and define the conjugate of A by \(\overline{A}=(\overline{a_{ij}})_{m \times n}\). Suppose that \(A^\dagger \) is the conjugate transpose of A, where \(A^\dagger = (\overline{A})^T\) and \(A^T\) denotes the transpose of A.

Finally, we give a method to construct EAQEC codes using classical linear error-correcting codes under the Hermitian case.

Theorem 2.3

[2, 43] Let \(\mathcal {C}\) be an \([n,k,d]_{q^2}\) classical linear error-correcting code, whose parity-check matrix is H and \(H^\dagger \) is the conjugate transpose of H; then, one can get an \([[n,2k-n+c,d;c]]_q\) EAQEC code, where \(c=rank(HH^\dagger )\).

3 New EAQMDS codes from GRS codes

In this section, assume that q is a prime power. We will derive three classes of q-ary EAQMDS codes by utilizing GRS codes over \(\mathbb {F}_{q^2}\). Let \(\xi \) be a fixed primitive element of \(\mathbb {F}_{q^2}\). Suppose that \(t=\frac{q^2-1}{a}\), where \(a\vert (q+1)\) or \(a \vert (q-1)\). Let \(\beta =\xi ^a\), then \(\text {ord}(\beta )=t\).

3.1 New EAQMDS codes of length \(n=\frac{b({q^2}-1)}{a}+\frac{{q^2}-1}{a}\) with \(a\vert (q+1)\)

In this subsection, we will obtain new q-ary EAQMDS codes of length \(n=\frac{b({q^2}-1)}{a}+\frac{{q^2}-1}{a}\) with \(a\vert (q+1)\) from GRS codes. In the following, we will consider GRS codes of length n by splitting \(a+b\) into two cases, i.e., \(a+b\equiv 1\ (\textrm{mod}\ 2)\) and \(a+b\equiv 0\ (\textrm{mod}\ 2)\).

3.1.1 The case \(a+b\equiv 1\ (\textrm{mod}\ 2)\)

To begin with, we give some significant lemmas that will take on essential roles in our constructions.

Lemma 3.1

Suppose that \(a+b\equiv 1\ (\textrm{mod}\ 2)\) and \(m=\frac{a-b+1}{2}\). If \(b\le min\{a-3,q-3\}\), then there exists a vector \(\varvec{\rho }=(\rho _0,\rho _1,\ldots , \rho _{b})\in (\mathbb {F}^*_q)^{b+1}\) such that the following sums

$$\begin{aligned} \sum _{l=0}^{b}\rho _l,\ \sum _{l = 0}^{b}\xi ^{mlt}\rho _l,\ \sum _{l = 0}^{b}\xi ^{(m+1)lt}\rho _l,\ \ldots ,\ \sum _{l=0}^{b} \xi ^{(m+b-1)lt}\rho _l \end{aligned}$$

are all nonzeros.

Proof

We have to proof that there exists a vector \(\varvec{\varphi }=(\varphi _0,\varphi _1,\ldots ,\varphi _{b})\in (\mathbb {F}^*_q)^{b+1} \) such that the group of equations below has a nonzero solution \(\varvec{\rho } =(\rho _0,\rho _1,\ldots , \rho _{b})\in (\mathbb {F}^*_q)^{b+1}\).

$$\begin{aligned} \left\{ \begin{array}{l} \sum _{l=0}^{b}\rho _l=\varphi _0,\\ \\ \sum _{l=0}^{b}\xi ^{mlt}\rho _l=\varphi _1,\\ \\ \sum _{l=0}^{b}\xi ^{(m+1)lt}\rho _l=\varphi _2,\\ \\ \ldots \\ \\ \sum _{l = 0}^{b}\xi ^{(m+b-1)lt}\rho _l=\varphi _{b}. \end{array} \right. \end{aligned}$$
(3.1)

Let \(\zeta =\xi ^t\). Denote

$$\begin{aligned} A=\begin{pmatrix} 1 &{} 1 &{} \cdots &{} 1 \\ 1 &{} \zeta ^m &{} \cdots &{} \zeta ^{bm} \\ 1 &{} \zeta ^{m+1} &{} \cdots &{} \zeta ^{b(m+1)}\\ \vdots &{} \vdots &{} \ddots &{} \vdots \\ 1 &{} \zeta ^{m+b-1} &{} \cdots &{} \zeta ^{b(m+b-1)} \end{pmatrix}. \end{aligned}$$

The system of Eq. (3.1) could be characterized by the matrix form

$$\begin{aligned} A\varvec{\rho }^T=(\varphi _0,\varphi _1,\ldots ,\varphi _{b})^T=\varvec{\varphi }^T. \end{aligned}$$

It can be easily derived that \(\text {det}(A)\ne 0\) due to the fact that A is a Vandermonde matrix and \(1, \zeta ^m, \zeta ^{m+1}\), \(\ldots \), \(\zeta ^{m+b-1}\) are all different because of \(\zeta \) is a primitive a-th root of unity. Hence, for a fixed vector \(\varvec{\varphi }\), the system of Eq. (3.1) has a sole solution \(\varvec{\rho }=(\rho _0,\rho _1,\ldots , \rho _{b})\in (\mathbb {F}_q)^{b+1}\). Next, we will proof that the system of Eq. (3.1) has a nonzero solution.

Let \(\phi _0=(1,1,\ldots ,1)\), \(\phi _i=(1,\xi ^{t(m+i-1)},\ldots , \xi ^{tb(m+i-1)})\), for \(i=1,\ldots ,b\). Then, the system of Eq. (3.1) is changed to

$$\begin{aligned} \left\{ \begin{array}{c} \phi _0\varvec{\rho }^T =\varphi _0, \\ \phi _1\varvec{\rho }^T =\varphi _1,\\ \phi _2\varvec{\rho }^T =\varphi _2,\\ \vdots \\ \phi _{b}\varvec{\rho }^T =\varphi _{b}. \end{array} \right. \end{aligned}$$
(3.2)

It can be trivially verified that \(\phi ^q_i=\phi _{b+1-i}\), for \(i=1,\ldots , b\). Hence, by taking the q-th powers of all the equations in (3.2), one can get

$$\begin{aligned} \left\{ \begin{array}{c} \phi _0\varvec{\rho }^T =\varphi _0, \\ \phi _{b}\varvec{\rho }^T =\varphi _1,\\ \phi _{b-1}\varvec{\rho }^T =\varphi _2,\\ \vdots \\ \phi _{2}\varvec{\rho }^T =\varphi _{b-1},\\ \phi _{1}\varvec{\rho }^T =\varphi _{b}. \end{array} \right. \end{aligned}$$
(3.3)

Let

$$\begin{aligned} \lambda =\left\{ \begin{array}{l} \xi ^{q+1}, q\ is\ a\ power\ of\ 2,\\ \xi ^\frac{q+1}{2}, q\ is\ an\ odd\ prime\ power. \end{array} \right. \end{aligned}$$

It is easy to proof that \(\lambda ^q=-\lambda \). We now divide b into two cases as follows:

(1) If b is odd, then it can be easily proved that the system of Eq. (3.2) is equivalent to the system of Eq. (3.4) according to (3.3).

$$\begin{aligned} \left\{ \begin{array}{c} \phi _0\varvec{\rho }^T=\varphi _0, \\ \\ (\phi _1+\phi _{b})\varvec{\rho }^T=2\varphi _1,\\ \\ \vdots \\ \\ (\phi _{\frac{b-1}{2}}+\phi _{\frac{b+3}{2}})\varvec{\rho }^T=2\varphi _{\frac{b-1}{2}},\\ \\ \phi _{\frac{b+1}{2}}\varvec{\rho }^T=\varphi _{\frac{b+1}{2}},\\ \\ \frac{\phi _1-\phi _{b}}{\lambda }\varvec{\rho }^T=0,\\ \\ \vdots \\ \frac{\phi _{\frac{b-1}{2}}-\phi _{\frac{b+3}{2}}}{\lambda }\varvec{\rho }^T =0. \end{array} \right. \end{aligned}$$
(3.4)

Denote

$$\begin{aligned} B=\begin{pmatrix} \phi _0 \\ \phi _1+\phi _{b} \\ \vdots \\ \phi _{\frac{b-1}{2}}+\phi _{\frac{b+3}{2}} \\ \phi _{\frac{b+1}{2}}\\ \frac{\phi _1-\phi _{b}}{\lambda } \\ \vdots \\ \frac{\phi _{\frac{b-1}{2}}-\phi _{\frac{b+3}{2}}}{\lambda } \end{pmatrix}. \end{aligned}$$

Obviously, each element of the matrix B belongs to \(\mathbb {F}_q\), then the system of Eq. (3.4) is represented as \(B\varvec{\rho }^T=(\varphi _0, 2\varphi _1, \ldots , 2\varphi _{\frac{b-1}{2}},\varphi _{\frac{b+1}{2}}, 0, \ldots , 0)^T\). Suppose that

$$\begin{aligned} U=\{\varvec{\rho }\in \mathbb {F}^b_q \vert B\varvec{\rho }^T=(\varphi _0, 2\varphi _1, \ldots , 2\varphi _{\frac{b-1}{2}},\varphi _{\frac{b+1}{2}}, 0, \ldots , 0)^T\}. \end{aligned}$$

For any given nonzero elements \(\varphi _0,\varphi _1, \ldots , \varphi _{\frac{b+1}{2}},\) the system of Eq. (3.4) in U has a sole solution.

When \(\varphi _0,\varphi _1,\ldots ,\varphi _{\frac{b+1}{2}}\) take all nonzero elements over \(\mathbb {F}_q\), respectively, then one obtains

$$\begin{aligned} \vert U \vert =(q-1)^{\frac{b+3}{2}}. \end{aligned}$$

Let

$$\begin{aligned} U_i=\{\varvec{\rho }\in \mathbb {F}^b_q \vert \rho _i=0,B\varvec{\rho }^T=(\varphi _0, 2\varphi _1, \ldots , 2\varphi _{\frac{b-1}{2}}, \varphi _{\frac{b+1}{2}}, 0, \ldots , 0)^T \}, \end{aligned}$$

where \(i=0, 1,\ldots ,b\), and

$$\begin{aligned} S=\{\varvec{\rho }\in (\mathbb {F}^*_q)^b \vert B\varvec{\rho }^T =(\varphi _0, 2\varphi _1, \ldots , 2\varphi _{\frac{b-1}{2}}, \varphi _{\frac{b+1}{2}}, 0, \ldots , 0)^T\}. \end{aligned}$$

If \(\rho _i=0\), then \(\varphi _0, 2\varphi _1, \ldots , 2\varphi _{\frac{b-1}{2}}, \varphi _{\frac{b+1}{2}} \) must meet a linear equation with nonzero coefficients. So

$$\begin{aligned} \vert U_i \vert =(q-1)^{\frac{b+1}{2}}. \end{aligned}$$

Accordingly, \(S=U\setminus (U_0\cup U_1\cup \cdots \cup U_{b})\). Hence, \(\vert S\vert = \vert U \vert -\sum _{i=0}^{b} \vert U_i \vert +\chi \) due to the inclusion-exclusion principle, where \(\chi \ge 0\). So

$$\begin{aligned} \vert S\vert =(q-1)^{\frac{b+3}{2}}-(b+1)(q-1)^{\frac{b+1}{2}}+\chi . \end{aligned}$$

It is obvious that \(\vert S\vert >0\) because of \(b\le q-3\).

(2) If b is even, then the system of Eq. (3.2) is an equivalence of the following system of Eq. (3.5). The remainder of the proof quite comparable to the case b is odd and we omit it here.

$$\begin{aligned} \left\{ \begin{array}{c} \phi _0\varvec{\rho }^T =\varphi _0, \\ \\ (\phi _1+\phi _{b})\varvec{\rho }^T=2\varphi _1,\\ \\ \vdots \\ \\ (\phi _{\frac{b}{2}}+\phi _{\frac{b+2}{2}})\varvec{\rho }^T =2\varphi _{\frac{b}{2}},\\ \\ \frac{\phi _1-\phi _{b}}{\lambda }\varvec{\rho }^T =0,\\ \\ \vdots \\ \frac{\phi _{\frac{b}{2}}-\phi _{\frac{b+2}{2}}}{\lambda }\varvec{\rho }^T =0. \end{array} \right. \end{aligned}$$
(3.5)

Therefore, there exists a vector \(\varvec{\rho }=(\rho _0,\rho _1,\ldots , \rho _{b})\in (\mathbb {F}^*_q)^{b+1}\) such that

$$\begin{aligned} \sum _{l = 0}^{b} \rho _l,\ \sum _{l = 0}^{b} \xi ^{mlt}\rho _l,\ \sum _{l = 0}^{b} \xi ^{(m+1)lt}\rho _l,\ \ldots ,\ \sum _{l = 0}^{b} \xi ^{(m+b-1)lt}\rho _l \end{aligned}$$

are all nonzeros.

Lemma 3.2

Let \(a+b \equiv 1 \ (\textrm{mod}\ 2)\) and \(b\le a-3\). If \(0\le i,j\le \frac{a+b+1}{2}\cdot \frac{q+1}{a}-2\) with \((i,j)\ne (0,0)\), then \(t \vert (qi+j)\) if and only if \(qi+j=\upsilon t\) with \(\frac{a-b+1}{2}\le \upsilon \le \frac{a+b-1}{2}\).

Proof

As \(0\le i,j\le \frac{a+b+1}{2}\cdot \frac{q+1}{a}-2\) with \((i,j)\ne (0,0)\), then \(0\le i,j \le q-1-\frac{q+1}{a}\) and \(0<qi+j\le q^2-1-\frac{(q+1)^2}{a}\). If \(t \vert (qi+j)\), then an integer \(\upsilon \) exists such that \(qi+j=\upsilon t\) with \(0<\upsilon <a-1\). Also, we have

$$\begin{aligned} qi+j=q[\frac{\upsilon (q+1)}{a}-1]+[q-\frac{\upsilon (q+1)}{a}]. \end{aligned}$$

Then,

$$\begin{aligned} i=\frac{\upsilon (q+1)}{a}-1,\ j=q-\frac{\upsilon (q+1)}{a}. \end{aligned}$$

Since \(0\le i,j\le \frac{a+b+1}{2}\cdot \frac{q+1}{a}-2\), one can get

$$\begin{aligned} \frac{a-b-1}{2}+\frac{a}{q+1}\le \upsilon \le \frac{a+b+1}{2}-\frac{a}{q+1}, \end{aligned}$$

which implies that \(\frac{a-b+1}{2}\le \upsilon \le \frac{a+b-1}{2}\). Therefore, \(t\vert (qi+j)\) if and only if \(qi+j=\upsilon t\) with \(\frac{a-b+1}{2}\le \upsilon \le \frac{a+b-1}{2}\).

Lemma 3.3

Let \(n=\frac{b(q^2-1)}{a}+\frac{q^2-1}{a}\), and \(b\le min\{a-3,q-3\}\). Assume that \(\varvec{\tau } =(1,\beta ,\beta ^2,\ldots ,\beta ^{t-1})\in \mathbb {F}_{q^2}^t\) and \({\textbf {a}}=(\varvec{\tau }, \xi \varvec{\tau }, \xi ^2\varvec{\tau }, \ldots , \xi ^{b}\varvec{\tau })\in \mathbb {F}_{q^2}^n\). Let

$$\begin{aligned} {\textbf {v}}=(v_0, v_0, \ldots , v_0, \ldots , v_{b}, v_{b}, \ldots , v_{b})_{(1\times (b+1)t)}\in (\mathbb {F}^*_{q^2})^n, \end{aligned}$$

where \(v_l^{q+1}=\rho _l\) with \(0\le l\le {b}\), and \(\varvec{\rho } =(\rho _0,\rho _1,\ldots , \rho _{b})\in (\mathbb {F}^*_q)^{b+1}\) is a vector satisfy Lemma 3.1. Then, \(\langle {\textbf {a}}^{qi+j}, {\textbf {v}}^{q+1} \rangle _E \ne 0\) if and only if \((i,j)=(0,0)\) or \(qi+j=\upsilon t\) with \(\frac{a-b+1}{2}\le \upsilon \le \frac{a+b-1}{2}\), where \(0\le i,j\le \frac{a+b+1}{2}\cdot \frac{q+1}{a}-2\).

Proof

If \((i,j)=(0,0)\), it follows from Lemma 3.1 that

$$\begin{aligned} \langle {\textbf {a}}^{qi+j}, {\textbf {v}}^{q+1} \rangle _E=\langle {\textbf {a}}^0, {\textbf {v}}^{q+1} \rangle _E=t(v^{q+1}_0+\cdots +v^{q+1}_{b})=t(\rho _0+\cdots +\rho _{b})\ne 0. \end{aligned}$$

If \((i,j)\ne (0,0)\), then

$$\begin{aligned} \langle {\textbf {a}}^{qi+j}, {\textbf {v}}^{q+1} \rangle _E=\sum _{l = 0}^{b}\xi ^{(qi+j)l}v_l^{q+1}\sum _{s=0}^{t-1}\beta ^{s(qi+j)}. \end{aligned}$$

Notably,

$$\begin{aligned} \sum _{s=0}^{t-1}\beta ^{s(qi+j)}=\left\{ \begin{array}{l} 0, t \not \mid (qi+j),\\ t, t \mid (qi+j). \end{array} \right. \end{aligned}$$

Based on Lemma 3.2, \(\sum _{s=0}^{t-1}\beta ^{s(qi+j)}=t\) if and only if \(qi+j=\upsilon t\) with \(\frac{a-b+1}{2}\le \upsilon \le \frac{a+b-1}{2}\), then by Lemma 3.1, one can get \(\langle {\textbf {a}}^{qi+j}, {\textbf {v}}^{q+1} \rangle _E=t\sum _{l = 0}^{b}\xi ^{\upsilon tl}v_l^{q+1}=t\sum _{l = 0}^{b}\xi ^{\upsilon tl}\rho _l \ne 0.\) The result holds.

Theorem 3.1

Let \(n=\frac{b(q^2-1)}{a}+\frac{q^2-1}{a}\), where q is a prime power, \(b\le min\{a-3,q-3\}\), \(a\vert (q+1)\) and \(a+b\equiv 1\ (\textrm{mod}\ 2) \), then one can get an EAQMDS code with parameters \([[n, n-2d+c+2, d; c]]_q\), where \(2\le d\le \frac{a+b+1}{2}\cdot \frac{q+1}{a}\) and \(c=b+1\).

Proof

Assume that there exists a GRS code, denoted as \(GRS_k({\textbf {a}},{\textbf {v}})\), associated with vectors a and v, where a and v are given in Lemma 3.3. One can get \(GRS_k({\textbf {a}},{\textbf {v}})\) has a generator matrix as below.

$$\begin{aligned} G_k = \begin{pmatrix} v_0 &{} v_0 &{} \cdots &{} v_0 &{} \cdots &{} v_{b} &{} \cdots &{} v_{b} \\ v_0 &{} v_0\beta &{} \cdots &{} v_0\beta ^{t-1} &{} \cdots &{} v_{b}\xi ^{b} &{} \cdots &{} v_{b}(\xi ^{b}\beta ^{t-1}) \\ v_0 &{} v_0\beta ^2 &{} \cdots &{} v_0(\beta ^{t-1})^2 &{} \cdots &{} v_{b}(\xi ^{b})^2 &{} \cdots &{} v_{b}(\xi ^{b}\beta ^{t-1})^2 \\ \ldots &{} \ldots &{} \ldots &{} \ldots &{} \ldots &{} \ldots &{} \ldots &{} \ldots \\ v_0 &{} v_0\beta ^{k-1} &{} \cdots &{} v_0(\beta ^{t-1})^{k-1} &{} \cdots &{} v_{b}(\xi ^{b})^{k-1} &{} \cdots &{} v_{b}(\xi ^{b}\beta ^{t-1})^{k-1} \end{pmatrix}. \end{aligned}$$

According to Theorem 2.2, there exists a \(GRS_{n-k}({\textbf {a}},{\textbf {v}}^{'})\) with parameters \([n,n-k,k+1]\), whose parity-check matrix is \(G_k\). By calculation, one can get

$$\begin{aligned} G_kG^\dagger _k = \begin{pmatrix} \sigma _{0,0} &{} \sigma _{1,0} &{} \cdots &{} \sigma _{k-1,0} \\ \sigma _{0,1} &{} \sigma _{1,1} &{} \cdots &{} \sigma _{k-1,1} \\ \sigma _{0,2} &{} \sigma _{1,2} &{} \cdots &{} \sigma _{k-1,2} \\ \ldots &{} \ldots &{} \ldots &{} \ldots \\ \sigma _{0,k-1} &{} \sigma _{1,k-1} &{} \cdots &{} \sigma _{k-1,k-1} \end{pmatrix}, \end{aligned}$$

where \(\sigma _{i,j}=\langle {\textbf {a}}^{qi+j}, {\textbf {v}}^{q+1} \rangle _E\).

Based on Lemma 3.3, \(\sigma _{i,j}\ne 0\) if and only if \((i,j)=(0,0)\) or \(qi+j=\upsilon t\) with \(\frac{a-b+1}{2}\le \upsilon \le \frac{a+b-1}{2}\).

If there exist \(i_1=i_2=i\) such that \(qi+j_1=\upsilon _1 t\) and \(qi+j_2=\upsilon _2 t\), where \(j_1\ne j_2\), then \(j_1-j_2=(\upsilon _1-\upsilon _2)t\). In fact, \(\vert j_1-j_2\vert < q-1\). However, \(\vert (\upsilon _1-\upsilon _2)t\vert =\vert (\upsilon _1-\upsilon _2)\frac{q+1}{a}(q-1) \vert \ge q-1\). So \(\sigma _{i,j}\ne 0\) cannot appear in the same row of the matrix.

If there exist \(j_1=j_2=j\) such that \(qi_1+j=\upsilon _1 t\) and \(qi_2+j=\upsilon _2 t\), where \(i_1\ne i_2\), then \(q(i_1-i_2)=(\upsilon _1-\upsilon _2)t=(\upsilon _1-\upsilon _2)\frac{q^2-1}{a}\). Therefore, \(q \vert (\upsilon _1-\upsilon _2) \), which contradicts to the fact that \(\vert \upsilon _1-\upsilon _2\vert \le b-1 <q \). So \(\sigma _{i,j}\ne 0\) cannot appear in the same column of the matrix.

Hence, for \(0\le i,j\le \frac{a+b+1}{2}\cdot \frac{q+1}{a}-2\), \(\sigma _{i,j}\ne 0\) cannot occur in the same row and column of the matrix. Consequently, \(rank(G_kG_k^\dagger )=b+1\). According to Theorem 2.3, the EAQMDS codes are derived.

Remark 3.1

Taking \(b=0\) in Theorem 3.1, then a must be odd. Let \(a=2\ell +1\) (\(\ell \ge 1\)), then one can get EAQMDS codes with the following parameters:

  • \([[\frac{q^2-1}{2\ell +1},\frac{q^2-1}{2\ell +1}-2d+3,d;1]]_q\), where \(2\le d\le \frac{\ell +1}{2\ell +1}(q+1)\).

Actually, EAQMDS codes with the same length had also been constructed in [7] and [24]. Taking \(n=\frac{q^2-1}{2\ell +1}\) in Theorem 3 of [7] and \(c=1\) in Theorem 3.7 of [24], we can derive the following two subclasses of EAQMDS codes:

  • \([[\frac{q^2-1}{2\ell +1},\frac{q^2-1}{2\ell +1}-2d+3,d;1]]_q,\) where \(2\le d \le 2(\frac{q+1}{2\ell +1}-1)\).

  • \([[\frac{q^2-1}{2\ell +1},\frac{q^2-1}{2\ell +1}-2d+3,d;1]]_q,\) where \(\frac{q+1}{2\ell +1}+2\le d \le \frac{\ell +1}{2\ell +1}(q+1)\).

By comparing our results with the same length as in [7], due to \(\frac{\ell +1}{2\ell +1}(q+1)>2(\frac{q+1}{2\ell +1}-1)\), one can see that the minimum distance of our EAQMDS code is larger than theirs. While comparing our results with [24], one can easily see that our codes have the same largest minimum distance as theirs within such case, but the minimum distance d has a wider value range.

Remark 3.2

Let \(a\equiv 2\ (\textrm{mod}\ 4) \) and \(b=\frac{a}{2}\), then \(a+b\equiv 1\ (\textrm{mod}\ 2)\). According to Theorem 3.1, EAQMDS codes can be obtained with the following parameters:

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

In fact, EAQMDS codes of length \(n=\frac{q^2-1}{2}+\frac{q^2-1}{a}\) had already been studied in [44], but the value of c in [44] is incorrect. It should be \(\frac{a}{2}+1( \frac{b}{2}+1\) for their length). Besides, it can be easily seen that our EAQMDS codes coincide with theirs. Therefore, the result of ours is a generalization of theirs.

Remark 3.3

Let \(a\equiv 0\ (\textrm{mod}\ 4) \) and \(b=\frac{a}{2}+1\), then \(a+b\equiv 1\ (\textrm{mod}\ 2)\). Due to Theorem 3.1, one can get EAQMDS codes with parameters as follows:

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

EAQMDS codes of length \(n=\frac{q^2-1}{2}+\frac{2(q^2-1)}{a}\) had been studied in [44], but the c in [44] is different from ours.

Example 3.1

We show some of the new EAQMDS codes of length \(n = \frac{b({q^2}-1)}{a}+\frac{{q^2}-1}{a}\) with \(a+b\equiv 1\ (\textrm{mod}\ 2)\) obtained from Theorem 3.1 whose lengths are not divisors of \(q^2- 1\) in Table 1,

Table 1 New EAQMDS codes of length \(n=\frac{b({q^2}-1)}{a}+\frac{{q^2}-1}{a}\) with \(a+b\equiv 1\ (\textrm{mod}\ 2) \)

3.1.2 The case \(a+b\equiv 0\ (\textrm{mod}\ 2)\)

Likewise, we will first give some useful lemmas that will serve essential roles in the construction.

Lemma 3.4

Suppose that \(a+b \equiv 0\ (\textrm{mod}\ 2)\) and \(m=\frac{a-b}{2}\). If \(b\le min\{a-4, q-3\}\), then there exists a vector \(\varvec{\rho }=(\rho _0,\rho _1,\ldots , \rho _{b})\in (\mathbb {F}^*_q)^{b+1}\) such that the following sums

$$\begin{aligned} \sum _{l=0}^{b} \xi ^{(mt-q-1)l}\rho _l,\ \sum _{l=0}^{b} \xi ^{[(m+1)t-q-1]l}\rho _l,\ \sum _{l=0}^{b} \xi ^{[(m+2)t-q-1]l}\rho _l, \ldots ,\ \sum _{l=0}^{b} \xi ^{[(m+b)t-q-1]l}\rho _l \end{aligned}$$

are all nonzeros.

Proof

We have to proof that there exists a vector \(\varvec{\varphi }=(\varphi _1,\ldots ,\varphi _{b+1})\in (\mathbb {F}^*_q)^{b+1}\) such that the group of equations below has a nonzero solution \(\varvec{\rho }=(\rho _0,\rho _1,\ldots , \rho _{b})\in (\mathbb {F}^*_q)^{b+1}\).

$$\begin{aligned} \left\{ \begin{array}{l} \sum _{l = 0}^{b} \xi ^{(mt-q-1)l}\rho _l=\varphi _1,\\ \\ \sum _{l = 0}^{b} \xi ^{[(m+1)t-q-1]l}\rho _l=\varphi _2,\\ \\ \sum _{l = 0}^{b} \xi ^{[(m+2)t-q-1]l}\rho _l=\varphi _3,\\ \\ \ldots \\ \\ \sum _{l = 0}^{b} \xi ^{[(m+b)t-q-1]l}\rho _l=\varphi _{b+1}. \end{array} \right. \end{aligned}$$
(3.6)

Let \(\zeta =\xi ^{mt-q-1}\). Denote

$$\begin{aligned} A = \begin{pmatrix} 1 &{} \quad \zeta &{}\quad \cdots &{}\quad \zeta ^b \\ 1 &{}\quad \zeta \xi ^{t} &{}\quad \cdots &{}\quad \zeta ^b \xi ^{bt}\\ 1 &{} \quad \zeta \xi ^{2t} &{}\quad \cdots &{}\quad \zeta ^b \xi ^{b(2t)}\\ \vdots &{} \quad \vdots &{} \quad \ddots &{}\quad \vdots \\ 1 &{}\quad \zeta \xi ^{bt} &{}\quad \cdots &{}\quad \zeta ^b \xi ^{b(bt)} \end{pmatrix}. \end{aligned}$$

The system of Eq. (3.6) could be characterized by the matrix form

$$\begin{aligned} A\varvec{\rho }^T=(\varphi _1,\varphi _2,\ldots ,\varphi _{b+1})^T=\varvec{\varphi }^T. \end{aligned}$$

It is easy to show that \(\text {det}(A)\ne 0\) due to the fact that A is a Vandermonde matrix and \(\zeta , \zeta \xi ^{t}, \zeta \xi ^{2t}, \ldots \), \(\zeta \xi ^{bt}\) are all different. Hence, for a fixed vector \(\varvec{\varphi }\), the system of Eq. (3.6) has a unique solution \(\varvec{\rho }=(\rho _0,\rho _1,\ldots , \rho _{b})\in (\mathbb {F}_q)^{b+1}\). Next, we will proof that the system of Eq. (3.6) has a nonzero solution.

Let \(\varvec{\phi }_i=(1,\xi ^{(m+i-1)t-q-1},\ldots , \xi ^{[(m+i-1)t-q-1]b})\), for \(i=1,\ldots , b+1\). Then, the system of Eq. (3.6) is becoming

$$\begin{aligned} \left\{ \begin{array}{c} \phi _1\varvec{\rho }^T=\varphi _1,\\ \phi _2\varvec{\rho }^T=\varphi _2,\\ \phi _3\varvec{\rho }^T=\varphi _3,\\ \vdots \\ \phi _{b+1}\varvec{\rho }^T=\varphi _{b+1}. \end{array} \right. \end{aligned}$$
(3.7)

It can be trivially verified that \(\phi ^q_i=\phi _{b+2-i}\), for \(i=1,\ldots , b+1\). Hence, by taking the q-th powers of all the equations in (3.7), one can get

$$\begin{aligned} \left\{ \begin{array}{c} \phi _{b+1}\varvec{\rho }^T =\varphi _1,\\ \phi _{b}\varvec{\rho }^T =\varphi _2,\\ \phi _{b-1}\varvec{\rho }^T =\varphi _3,\\ \vdots \\ \phi _{2}\varvec{\rho }^T =\varphi _{b},\\ \phi _{1}\varvec{\rho }^T =\varphi _{b+1}. \end{array} \right. \end{aligned}$$
(3.8)

Let

$$\begin{aligned} \lambda =\left\{ \begin{array}{l} \xi ^{q+1}, q\ is\ a\ power\ of\ 2,\\ \xi ^\frac{q+1}{2}, q\ is\ an\ odd\ prime\ power. \end{array} \right. \end{aligned}$$

It is easy to prove that \(\lambda ^q=-\lambda \). We now divide b into two cases as follows:

(1) If b is odd, then it is easy to get that the system of Eq. (3.7) is equivalent to the system of Eq. (3.9) according to (3.8).

$$\begin{aligned} \left\{ \begin{array}{c} (\phi _1+\phi _{b+1})\varvec{\rho }^T =2\varphi _1,\\ \\ \vdots \\ \\ (\phi _{\frac{b+1}{2}}+\phi _{\frac{b+3}{2}})\varvec{\rho }^T =2\varphi _{\frac{b+1}{2}},\\ \\ \frac{\phi _1-\phi _{b+1}}{\lambda }\varvec{\rho }^T =0,\\ \\ \vdots \\ \frac{\phi _{\frac{b+1}{2}}-\phi _{\frac{b+3}{2}}}{\lambda }\varvec{\rho }^T =0. \end{array} \right. \end{aligned}$$
(3.9)

Denote

$$\begin{aligned} B= \begin{pmatrix} \phi _1+\phi _{b+1} \\ \vdots \\ \phi _{\frac{b+1}{2}}+\phi _{\frac{b+3}{2}}\\ \frac{\phi _1-\phi _{b+1}}{\lambda } \\ \vdots \\ \frac{\phi _{\frac{b+1}{2}}-\phi _{\frac{b+3}{2}}}{\lambda } \end{pmatrix}. \end{aligned}$$

It can be easily derived that each element of the matrix B belongs to \(\mathbb {F}_q\), then the system of Eq. (3.9) may be represented as \(B\varvec{\rho }^T=(2\varphi _1, \ldots , 2\varphi _{\frac{b+1}{2}}, 0, \ldots , 0)^T\). Suppose that

$$\begin{aligned} U=\{\varvec{\rho }\in \mathbb {F}^{b+1}_q \vert B\varvec{\rho }^T=(2\varphi _1, \ldots , 2\varphi _{\frac{b+1}{2}}, 0, \ldots , 0)^T\}. \end{aligned}$$

For any provided nonzero elements \(\varphi _1, \ldots , \varphi _{\frac{b+1}{2}},\) the system of Eq. (3.9) in U has a sole solution. When \(\varphi _1, \ldots , \varphi _{\frac{b+1}{2}}\) take all nonzero elements over \(\mathbb {F}_q\), respectively, then one obtains

$$\begin{aligned} \vert U \vert =(q-1)^{\frac{b+1}{2}}. \end{aligned}$$

Suppose that

$$\begin{aligned} U_i=\{\varvec{\rho }\in \mathbb {F}^{b+1}_q \vert \rho _i=0,B\varvec{\rho }^T =(2\varphi _1, \ldots , 2\varphi _{\frac{b+1}{2}}, 0, \ldots , 0)^T \}, \end{aligned}$$

where \(i=0, 1, \ldots ,b\), and

$$\begin{aligned} S=\{\varvec{\rho }\in (\mathbb {F}^*_q)^{b+1} \vert B\varvec{\rho }^T =(2\varphi _1, \ldots , 2\varphi _{\frac{b+1}{2}}, 0, \ldots , 0)^T\}. \end{aligned}$$

If \(\rho _i=0\), then \( 2\varphi _1, \ldots , 2\varphi _{\frac{b+1}{2}}\) must meet a linear equation with nonzero coefficients. So

$$\begin{aligned} \vert U_i \vert =(q-1)^{\frac{b-1}{2}}. \end{aligned}$$

Consequently, \(S=U\setminus (U_0\cup U_1\cup \cdots \cup U_{b-1})\). Hence, we have \(\vert S\vert = \vert U \vert -\sum _{i = 0}^{b} \vert U_i \vert +\chi \) by the inclusion–exclusion principle, where \(\chi \ge 0\). So

$$\begin{aligned} \vert S\vert =(q-1)^{\frac{b+1}{2}}-(b+1)(q-1)^{\frac{b-1}{2}}+\chi . \end{aligned}$$

It is obvious that \(\vert S\vert >0\) because of \(b\le q-3\).

(2) If b is even, then the system of Eq. (3.7) is equivalent to the following system of Eq. (3.10). The remainder of the proof quite comparable to the case b is odd and we omit it here.

$$\begin{aligned} \left\{ \begin{array}{c} \phi _0\varvec{\rho }^T=\varphi _0, \\ \\ (\phi _1+\phi _{b-1})\varvec{\rho }^T=2\varphi _1,\\ \\ \vdots \\ \\ (\phi _{\frac{b-2}{2}}+\phi _{\frac{b+2}{2}})\varvec{\rho }^T=2\varphi _{\frac{b-2}{2}},\\ \\ \phi _{\frac{b}{2}}\varvec{\rho }^T=\varphi _{\frac{b}{2}}, \\ \\ \frac{\phi _1-\phi _{b-1}}{\lambda }\varvec{\rho }^T=0,\\ \\ \vdots \\ \frac{\phi _{\frac{b-2}{2}}-\phi _{\frac{b+2}{2}}}{\lambda }\varvec{\rho }^T=0. \end{array} \right. \end{aligned}$$
(3.10)

Therefore, there exists a vector \(\varvec{\rho }=(\rho _0,\rho _1,\ldots , \rho _{b})\in (\mathbb {F}^*_q)^{b+1}\) such that

$$\begin{aligned} \sum _{l=0}^{b} \xi ^{(mt-q-1)l}\rho _l,\ \sum _{l=0}^{b} \xi ^{[(m+1)t-q-1]l}\rho _l,\ \sum _{l=0}^{b} \xi ^{[(m+2)t-q-1]l}\rho _l, \ldots ,\ \sum _{l=0}^{b} \xi ^{[(m+b)t-q-1]l}\rho _l \end{aligned}$$

are all nonzeros.

Lemma 3.5

Let \(a+b \equiv 0 \ (\textrm{mod}\ 2)\) and \(b\le a-4\). If \(0\le i,j\le \frac{a+b+2}{2}\cdot \frac{q+1}{a}-3\) with \((i,j)\ne (0,0)\), then \(t \vert (qi+j+q+1)\) if and only if \(qi+j+q+1=\upsilon t\) with \(\frac{a-b}{2}\le \upsilon \le \frac{a+b}{2}\).

Proof

As \(0\le i,j\le \frac{a+b+2}{2}\cdot \frac{q+1}{a}-3\) with \((i,j)\ne (0,0)\), one can obtain that \(0\le i,j\le q-2-\frac{q+1}{a}\) and \(0<qi+j+q+1\le q^2-1-\frac{(q+1)^2}{a}\). If \(t \vert (qi+j+q+1)\), then an integer \(\upsilon \) exists such that \(qi+j+q+1=\upsilon t\) with \(0<\upsilon <a-1\). In addition, we have

$$\begin{aligned} qi+j+q+1=q[\frac{\upsilon (q+1)}{a}-1]+[q-\frac{\upsilon (q+1)}{a}]. \end{aligned}$$

Then,

$$\begin{aligned} i=\frac{\upsilon (q+1)}{a}-2,\ j=q-\frac{\upsilon (q+1)}{a}-1. \end{aligned}$$

Due to \(0\le i,j\le \frac{a+b+2}{2}\cdot \frac{q+1}{a}-3\), we have

$$\begin{aligned} \frac{a-b-2}{2}+\frac{q+1}{a} \le \upsilon \le \frac{a+b+2}{2}-\frac{q+1}{a}, \end{aligned}$$

which indicates that \(\frac{a-b}{2}\le \upsilon \le \frac{a+b}{2}\). Therefore, \(t\vert (qi+j+q+1)\) if and only if \(qi+j+q+1=\upsilon t\) with \(\frac{a-b}{2}\le \upsilon \le \frac{a+b}{2}\).

Lemma 3.6

Let \(n=\frac{b(q^2-1)}{a}+\frac{q^2-1}{a}\), and \(b\le min\{a-4,q-3\}\). Assume that \(\varvec{\tau }=(1,\beta ,\beta ^2,\ldots , \beta ^{t-1})\in \mathbb {F}_{q^2}^t\) and \({\textbf {a}}=(\varvec{\tau }, \xi \varvec{\tau }, \xi ^2\varvec{\tau }, \ldots , \xi ^{b}\varvec{\tau })\in \mathbb {F}_{q^2}^n\). Let

$$\begin{aligned} {\textbf {v}}=(v_0, v_0\beta , \ldots , v_0\beta ^{t-1}, \ldots , v_{b}, v_{b}\beta , \ldots , v_{b}\beta ^{t-1})_{(1\times (b+1)t)}\in (\mathbb {F}^*_{q^2})^n, \end{aligned}$$

where \(v_l^{q+1}=\rho _l\) with \(0\le l\le {b}\), and \(\varvec{\rho }=(\rho _0,\rho _1,\ldots , \rho _{b})\in (\mathbb {F}^*_q)^{b+1}\) is a vector satisfy Lemma 3.4. Then, \(\langle {\textbf {a}}^{qi+j}, {\textbf {v}}^{q+1} \rangle _E \ne 0\) if and only if \(qi+j+q+1=\upsilon t\) with \(\frac{a-b}{2}\le \upsilon \le \frac{a+b}{2}\), where \(0\le i,j\le \frac{a+b+2}{2}\cdot \frac{q+1}{a}-3\).

Proof

If \((i,j)=(0,0)\), then

$$\begin{aligned} \langle {\textbf {a}}^{qi+j}, {\textbf {v}}^{q+1} \rangle _E=\langle {\textbf {a}}^0, {\textbf {v}}^{q+1} \rangle _E=\sum _{l=0}^{b}v_l^{q+1}\sum _{s=0}^{t-1}\beta ^{s(q+1)}. \end{aligned}$$

Note that \(t\not \mid (q+1)\), then \(\sum _{s=0}^{t-1}\beta ^{s(q+1)}=0\). Therefore, \(\langle {\textbf {a}}^{qi+j}, {\textbf {v}}^{q+1} \rangle _E=0\).

If \((i,j)\ne (0,0)\), then

$$\begin{aligned} \langle {\textbf {a}}^{qi+j}, {\textbf {v}}^{q+1} \rangle _E=\sum _{l = 0}^{b}\xi ^{(qi+j)l}v_l^{q+1}\sum _{s=0}^{t-1}\beta ^{s(qi+j+q+1)}. \end{aligned}$$

Note that

$$\begin{aligned} \sum _{s=0}^{t-1}\beta ^{s(qi+j+q+1)}=\left\{ \begin{array}{l} 0, t \not \mid (qi+j+q+1),\\ t, t \mid (qi+j+q+1). \end{array} \right. \end{aligned}$$

According to Lemma 3.5, \(\sum _{s=0}^{t-1}\beta ^{s(qi+j+q+1)}=t\) if and only if \(qi+j+q+1=\upsilon t\) with \(\frac{a-b}{2}\le \upsilon \le \frac{a+b}{2}\), then by Lemma 3.4, one can get \(\langle {\textbf {a}}^{qi+j}, {\textbf {v}}^{q+1} \rangle _E=t\sum _{l = 0}^{b}\xi ^{(\upsilon t-q-1)l}v_l^{q+1}=t\sum _{l=0}^{b}\xi ^{(\upsilon t-q-1)l}\rho _l \ne 0.\)

Theorem 3.2

Let \(n=\frac{b(q^2-1)}{a}+\frac{q^2-1}{a}\), where q is a prime power, \(b\le min\{a-4,q-3\}\), \(a\vert (q+1)\) and \(a+b\equiv 0\ (\textrm{mod}\ 2)\). Then, one can get an EAQMDS code with parameters \([[n, n-2d+c+2, d; c]]_q\), where \(2\le d\le \frac{a+b+2}{2}\cdot \frac{q+1}{a}-1\) and \(c=b+1\).

Proof

Suppose that there exists a GRS code, denoted as \(GRS_k({\textbf {a}},{\textbf {v}})\), associated with vectors a and v, where a and v are given in Lemma 3.6. One can get \(GRS_k({\textbf {a}},{\textbf {v}})\) has a generator matrix as below.

$$\begin{aligned} G_k=\begin{pmatrix} v_0 &{} v_0\beta &{} \cdots &{} v_0\beta ^{t-1} &{} \cdots &{} v_{b} &{} \cdots &{} v_{b}\beta ^{t-1} \\ v_0 &{} v_0\beta ^2 &{} \cdots &{} v_0(\beta ^{t-1})^2 &{} \cdots &{} v_{b}\xi ^{b} &{} \cdots &{} v_{b}\xi ^{b}(\beta ^{t-1})^2 \\ \ldots &{} \ldots &{} \ldots &{} \ldots &{} \ldots &{} \ldots &{} \ldots &{} \ldots \\ v_0 &{} v_0\beta ^{k-1} &{} \cdots &{} v_0(\beta ^{t-1})^{k-1} &{} \cdots &{} v_{b}(\xi ^{b})^{k-2} &{} \cdots &{} v_{b}(\xi ^{b})^{k-2}(\beta ^{t-1})^{k-1}\\ v_0 &{} v_0\beta ^{k} &{} \cdots &{} v_0(\beta ^{t-1})^{k} &{} \cdots &{} v_{b}(\xi ^{b})^{k-1} &{} \cdots &{} v_{b}(\xi ^{b})^{k-1}(\beta ^{t-1})^{k} \end{pmatrix}. \end{aligned}$$

According to Theorem 2.2, there exists a \(GRS_{n-k}({\textbf {a}},{\textbf {v}}^{'})\) with parameters \([n,n-k,k+1]\), whose parity-check matrix is \(G_k\). By calculation, one can obtain that

$$\begin{aligned} G_kG^\dagger _k=\begin{pmatrix} \sigma _{0,0} &{} \sigma _{1,0} &{} \cdots &{} \sigma _{k-1,0} \\ \sigma _{0,1} &{} \sigma _{1,1} &{} \cdots &{} \sigma _{k-1,1} \\ \sigma _{0,2} &{} \sigma _{1,2} &{} \cdots &{} \sigma _{k-1,2} \\ \ldots &{} \ldots &{} \ldots &{} \ldots \\ \sigma _{0,k-1} &{} \sigma _{1,k-1} &{} \cdots &{} \sigma _{k-1,k-1} \end{pmatrix}. \end{aligned}$$

where \(\sigma _{i,j}=\langle {\textbf {a}}^{qi+j}, {\textbf {v}}^{q+1} \rangle _E\).

According to Lemma 3.6, \(\sigma _{i,j}\ne 0\) if and only if \(qi+j+q+1=\upsilon t\) with \(\frac{a-b}{2}\le \upsilon \le \frac{a+b}{2}\).

If there exist \(i_1=i_2=i\) such that \(qi+j_1+q+1=\upsilon _1 t\) and \(qi+j_2+q+1=\upsilon _2 t\), where \(j_1\ne j_2\), then \(j_1-j_2=(\upsilon _1-\upsilon _2)t\). In fact, \(\vert j_1-j_2\vert < q-1\). However, \(\vert (\upsilon _1-\upsilon _2)t\vert =\vert (\upsilon _1-\upsilon _2)\frac{q+1}{a}(q-1) \vert \ge q-1\). It is a contradiction. So \(\sigma _{i,j}\ne 0\) cannot appear in the same row of the matrix.

If there exist \(j_1=j_2=j\) such that \(qi_1+j+q+1=\upsilon _1 t\) and \(qi_2+j+q+1=\upsilon _2 t\), where \(i_1\ne i_2\), then \(q(i_1-i_2)=(\upsilon _1-\upsilon _2)t=(\upsilon _1-\upsilon _2)\frac{q^2-1}{a}\). Therefore, \(q \vert (\upsilon _1-\upsilon _2)\), which contradicts to the fact that \(\vert \upsilon _1-\upsilon _2\vert \le b <q \). So \(\sigma _{i,j}\ne 0\) cannot appear in the same column of the matrix.

Hence, for \(0\le i,j\le \frac{a+b+2}{2}\cdot \frac{q+1}{a}-3\), \(\sigma _{i,j}\ne 0\) cannot occur in the same row and column of the matrix. Consequently, \(rank(G_kG_k^\dagger )=b+1\). According to Theorem 2.2, the EAQMDS codes are derived.

Remark 3.4

Taking \(b=0\) in Theorem 3.2, then a must be even. Let \(a=2\ell \) (\(\ell \ge 2\)), then one can get EAQMDS codes with the following parameters:

  • \([[\frac{q^2-1}{2\ell },\frac{q^2-1}{2\ell }-2d+3,d;1]]_q\), where \(2\le d\le \frac{\ell +1}{2\ell }(q+1)-1\).

In fact, EAQMDS codes with the same length had also been constructed in [7] and [24]. Taking \(n=\frac{q^2-1}{2\ell }\) in Theorem 3 of [7] and \(c=1\) in Theorem 3.3 of [24], we can derive two subclasses of EAQMDS codes as follows:

  • \([[\frac{q^2-1}{2\ell },\frac{q^2-1}{2\ell }-2d+3,d;1]]_q,\) where \(2\le d \le \frac{q+1}{\ell }-2\).

  • \([[\frac{q^2-1}{2\ell },\frac{q^2-1}{2\ell }-2d+3,d;1]]_q,\) where \(\frac{q+1}{2\ell }+2\le d \le \frac{\ell +1}{2\ell }(q+1)\).

Comparing our results of the same length as in [7], one can see that the minimum distance of our EAQMDS codes is larger than theirs because of \(\frac{q+1}{2} \ge \frac{q+1}{\ell }-2\) when \(\ell \ge 2\). Comparing our results with [24], it can be easily seen that the largest minimum distance of ours is one less than theirs, but the minimum distance d has a wider value range.

By taking \(a=q+1\) in Theorems 3.1 and 3.2, respectively, the following corollary is clearly established.

Corollary 3.1

Let q be a prime power, and \(b^{'}\le q-2\), then one can get a \([[b^{'}(q-1),b^{'}(q-1)-2d+2+c,d;c]]_q\) EAQMDS code, where \(2\le d\le \lfloor \frac{q+b^{'}+1}{2}\rfloor \) and \(c=b^{'}\).

Remark 3.5

Quantum MDS codes of the length in Corollary 3.1 had been constructed in Theorem 5 of [13]. Compared with it, the minimum distance of our EAQMDS code is much larger than that of the quantum MDS code of the same length in [13] (see Table 2).

Table 2 A comparison between quantum MDS codes and EAQMDS codes

Example 3.2

We show some of the new EAQMDS codes of length \(n=\frac{b({q^2}-1)}{a}+\frac{{q^2}-1}{a}\) with \(a+b\equiv 0\ (\textrm{mod}\ 2)\) obtained from Theorem 3.2 whose lengths are not divisors of \(q^2-1\) in Table 3.

Table 3 New EAQMDS codes of length \(n = \frac{b({q^2} - 1)}{a}+\frac{{q^2} - 1}{a}\) with \(a+b\equiv 0\ (\textrm{mod}\ 2) \)

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

In this subsection, some new q-ary EAQMDS codes of length \(n=\frac{b({q^2}-1)}{a}\) with \(a\vert (q-1)\) are obtained from GRS codes. We begin with some useful lemmas that will play major roles in our constructions.

Lemma 3.7

Suppose that \(a\vert (q-1)\) and \(b\le a\). If \((a,b)\ne (q-1,q-1)\), then there exists a vector \(\varvec{\rho }=(\rho _0,\rho _1,\ldots , \rho _{b-1})\in (\mathbb {F}^*_q)^{b}\) such that the following sums

$$\begin{aligned} \sum _{l=0}^{b-1}\rho _l,\ \sum _{l = 0}^{b-1}\xi ^{lt}\rho _l,\ \sum _{l = 0}^{b-1}\xi ^{2lt}\rho _l,\ \ldots ,\ \sum _{l=0}^{b-1} \xi ^{(b-1)lt}\rho _l \end{aligned}$$

are all nonzeros.

Proof

We have to proof that there exists a vector \(\varvec{\varphi }=(\varphi _0,\varphi _1,\ldots ,\varphi _{b-1})\in (\mathbb {F}^*_q)^{b}\) such that the group of equations below has a nonzero solution \(\varvec{\rho }=(\rho _0,\rho _1,\ldots , \rho _{b-1})\in (\mathbb {F}^*_q)^{b}\).

$$\begin{aligned} \left\{ \begin{array}{l} \sum _{l=0}^{b-1}\rho _l=\varphi _0,\\ \\ \sum _{l=0}^{b-1}\xi ^{lt}\rho _l=\varphi _1,\\ \\ \sum _{l=0}^{b-1}\xi ^{2lt}\rho _l=\varphi _2,\\ \\ \ldots \\ \\ \sum _{l = 0}^{b-1}\xi ^{(b-1)lt}\rho _l=\varphi _{b-1}. \end{array} \right. \end{aligned}$$
(3.11)

Let \(\zeta =\xi ^t\). Denote

$$\begin{aligned} A=\begin{pmatrix} 1 &{} 1 &{} \cdots &{} 1 \\ 1 &{} \zeta &{} \cdots &{} \zeta ^{b-1} \\ 1 &{} \zeta ^{2} &{} \cdots &{} \zeta ^{2(b-1)}\\ \vdots &{} \vdots &{} \ddots &{} \vdots \\ 1 &{} \zeta ^{b-1} &{} \cdots &{} \zeta ^{(b-1)(b-1)} \end{pmatrix}. \end{aligned}$$

The system of Eq. (3.11) could be characterized by the matrix form

$$\begin{aligned} A\varvec{\rho }^T=(\varphi _0,\varphi _1,\ldots ,\varphi _{b-1})^T=\varvec{\varphi }^T. \end{aligned}$$

It is easy to show that \(\text {det}(A)\ne 0\) because of A is a Vandermonde matrix and \(1, \zeta , \zeta ^{2}\), \(\ldots \), \(\zeta ^{b-1}\) are all different. Hence, for a fixed vector \(\varvec{\varphi }\), the system of Eq. (3.11) has a sole solution \(\varvec{\rho }=(\rho _0,\rho _1,\ldots , \rho _{b-1})\in (\mathbb {F}_q)^{b}\). Since \((a,b)\ne (q-1,q-1)\) and \(\zeta \) is a primitive a-th root of unity, then there must exist a \(\zeta ^{'}\in \mathbb {F}^*_q\) such that \(\zeta ^{'}\notin \{ 1, \zeta , \zeta ^{2}\), \(\ldots \), \(\zeta ^{b-1}\}\). Therefore, we can take \(\varphi _0=1\), \(\varphi _1=\zeta ^{'}\), \(\varphi _2=(\zeta ^{'})^2\), \(\ldots \), \(\varphi _{b-1}=(\zeta ^{'})^{b-1}\). According to the Cramer’s rule, we can get

$$\begin{aligned} \rho _0=\frac{|A_0|}{|A|}, \rho _1=\frac{|A_1|}{|A|}, \ldots , \rho _{b-1}=\frac{|A_{b-1}|}{|A|}, \end{aligned}$$

where

$$\begin{aligned} |A_0|= \left| \begin{array}{ccccc} 1 &{} 1 &{} \cdots &{} 1 \\ \zeta ^{'} &{} \zeta &{} \cdots &{} \zeta ^{b-1} \\ (\zeta ^{'})^2 &{} \zeta ^{2} &{} \cdots &{} \zeta ^{2(b-1)} \\ \cdots &{} \vdots &{} \cdots &{} \vdots \\ (\zeta ^{'})^{b-1}&{} \zeta ^{b-1} &{} \cdots &{} \zeta ^{(b-1)(b-1)}\\ \end{array} \right| , \ldots , |A_{b-1}|= \left| \begin{array}{ccccc} 1 &{} 1 &{} \cdots &{} 1 \\ 1 &{} \zeta &{} \cdots &{} \zeta ^{'} \\ 1 &{} \zeta ^{2} &{} \cdots &{} (\zeta ^{'})^2\\ \cdots &{} \vdots &{} \cdots &{} \cdots \\ 1 &{} \zeta ^{b-1} &{} \cdots &{}(\zeta ^{'})^{b-1}\\ \end{array} \right| . \end{aligned}$$

Since \(A_0,A_1,\ldots ,A_{b-1}\) are all Vandermonde matrixes and \(1, \zeta ^1, \zeta ^{2}\), \(\ldots \), \(\zeta ^{b-1}, \zeta ^{'} \) are different over \(\mathbb {F}^*_q\). Hence, \(|A_0|,|A_1|,\ldots ,|A_{b-1}|\) are all nonzeros, which implies that \(\rho _0,\rho _1,\ldots , \rho _{b-1}\) are all nonzeros.

Therefore, there exists a vector \(\varvec{\rho }=(\rho _0,\rho _1,\ldots , \rho _{b-1})\in (\mathbb {F}^*_q)^{b}\) such that

$$\begin{aligned} \sum _{l=0}^{b-1}\rho _l,\ \sum _{l = 0}^{b-1}\xi ^{lt}\rho _l,\ \sum _{l = 0}^{b-1}\xi ^{2lt}\rho _l,\ \ldots ,\ \sum _{l=0}^{b-1} \xi ^{(b-1)lt}\rho _l \end{aligned}$$

are all nonzeros.

Lemma 3.8

Let \(a\vert (q-1)\) and \(b\le a\). If \(0\le i,j\le \frac{b(q-1)}{a}-1\), then \(t \vert (qi+j)\) if and only if \(qi+j=\upsilon t\) with \(0\le \upsilon \le b-1\).

Proof

Since \(0\le i,j\le \frac{b(q-1)}{a}-1\), one can obtain that \(0\le i,j \le q-2\) and \(0\le qi+j< q^2-1\). If \(t \vert (qi+j)\), then an integer \(\upsilon \) exists such that \(qi+j=\upsilon t\) with \(0\le \upsilon <a\). Additionally,

$$\begin{aligned} qi+j=q[\frac{\upsilon (q-1)}{a}]+[\frac{\upsilon (q-1)}{a}]. \end{aligned}$$

Then,

$$\begin{aligned} i=\frac{\upsilon (q-1)}{a},\ j=\frac{\upsilon (q-1)}{a}. \end{aligned}$$

Since \(0\le i,j\le \frac{b(q-1)}{a}-1\), we have

$$\begin{aligned} 0\le \upsilon \le b-\frac{a}{q-1}, \end{aligned}$$

which implies that \(0\le \upsilon \le b-1\). Therefore, \(t\vert (qi+j)\) if and only if \(qi+j=\upsilon t\) with \(0\le \upsilon \le b-1\).

Lemma 3.9

Let \(n=\frac{b(q^2-1)}{a}\), where \(a\vert (q-1)\), \(b\le a\) and \((a,b)\ne (q-1,q-1)\). Assume that \(\varvec{\tau } =(1,\beta ,\beta ^2,\ldots ,\beta ^{t-1})\in \mathbb {F}_{q^2}^t\) and \({\textbf {a}}=(\varvec{\tau }, \xi \varvec{\tau }, \xi ^2\varvec{\tau }, \ldots , \xi ^{b-1}\varvec{\tau })\in \mathbb {F}_{q^2}^n\). Let

$$\begin{aligned} {\textbf {v}}=(v_0, v_0, \ldots , v_0, \ldots , v_{b-1}, v_{b-1}, \ldots , v_{b-1})_{(1\times bt)}\in (\mathbb {F}^*_{q^2})^n, \end{aligned}$$

where \(v_l^{q+1}=\rho _l\) with \(0\le l\le {b-1}\), and \(\varvec{\rho } =(\rho _0,\rho _1,\ldots , \rho _{b-1})\in (\mathbb {F}^*_q)^{b}\) is a vector satisfy Lemma 3.7. Then, \(\langle {\textbf {a}}^{qi+j}, {\textbf {v}}^{q+1} \rangle _E \ne 0\) if and only if \(qi+j=\upsilon t\) with \(0\le \upsilon \le b-1\), where \(0\le i,j\le \frac{b(q-1)}{a}-1\).

Proof

From the definitions of \({\textbf {a}}\) and \({\textbf {v}}\), we can get

$$\begin{aligned} \langle {\textbf {a}}^{qi+j}, {\textbf {v}}^{q+1} \rangle _E=\sum _{l = 0}^{b-1}\xi ^{(qi+j)l}v_l^{q+1}\sum _{s=0}^{t-1}\beta ^{s(qi+j)}. \end{aligned}$$

Notably,

$$\begin{aligned} \sum _{s=0}^{t-1}\beta ^{s(qi+j)}=\left\{ \begin{array}{l} 0, t \not \mid (qi+j),\\ t, t \mid (qi+j). \end{array} \right. \end{aligned}$$

From Lemma 3.8, \(\sum _{s=0}^{t-1}\beta ^{s(qi+j)}=t\) if and only if \(qi+j=\upsilon t\) with \(0\le \upsilon \le b-1\), then by Lemma 3.7, one can get \(\langle {\textbf {a}}^{qi+j}, {\textbf {v}}^{q+1} \rangle _E=t\sum _{l = 0}^{b-1}\xi ^{\upsilon tl}v_l^{q+1}=t\sum _{l = 0}^{b-1}\xi ^{\upsilon tl}\rho _l \ne 0.\) The result holds.

Theorem 3.3

Let \(n=\frac{b(q^2-1)}{a}\), where q is a prime power, \(b\le a\), \(a\vert (q-1)\) and \((a,b)\ne (q-1,q-1)\), then one can get an EAQMDS code with parameters \([[n, n-2d+c+2, d; c]]_q\), where \(2\le d\le \frac{b(q-1)}{a}+1\) and \(c=b\).

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

Proof

Suppose that there exists a GRS code, denoted as \(GRS_k({\textbf {a}},{\textbf {v}})\), associated with vectors a and v, where a and v are given in Lemma 3.9. One can get \(GRS_k({\textbf {a}},{\textbf {v}})\) has a generator matrix as below.

$$\begin{aligned} G_k = \begin{pmatrix} v_0 &{} v_0 &{} \cdots &{} v_0 &{} \cdots &{} v_{b-1} &{} \cdots &{} v_{b-1} \\ v_0 &{} v_0\beta &{} \cdots &{} v_0\beta ^{t-1} &{} \cdots &{} v_{b-1}\xi ^{b-1} &{} \cdots &{} v_{b-1}(\xi ^{b-1}\beta ^{t-1}) \\ v_0 &{} v_0\beta ^2 &{} \cdots &{} v_0(\beta ^{t-1})^2 &{} \cdots &{} v_{b-1}(\xi ^{b-1})^2 &{} \cdots &{} v_{b-1}(\xi ^{b-1}\beta ^{t-1})^2 \\ \ldots &{} \ldots &{} \ldots &{} \ldots &{} \ldots &{} \ldots &{} \ldots &{} \ldots \\ v_0 &{} v_0\beta ^{k-1} &{} \cdots &{} v_0(\beta ^{t-1})^{k-1} &{} \cdots &{} v_{b-1}(\xi ^{b-1})^{k-1} &{} \cdots &{} v_{b-1}(\xi ^{b-1}\beta ^{t-1})^{k-1} \end{pmatrix}. \end{aligned}$$

According to Theorem 2.2, there must exist a \(GRS_{n-k}({\textbf {a}},{\textbf {v}}^{'})\) with parameters \([n,n-k,k+1]\), whose parity-check matrix is \(G_k\). By calculation, one can get

$$\begin{aligned} G_kG^\dagger _k = \begin{pmatrix} \sigma _{0,0} &{} \sigma _{1,0} &{} \cdots &{} \sigma _{k-1,0} \\ \sigma _{0,1} &{} \sigma _{1,1} &{} \cdots &{} \sigma _{k-1,1} \\ \sigma _{0,2} &{} \sigma _{1,2} &{} \cdots &{} \sigma _{k-1,2} \\ \ldots &{} \ldots &{} \ldots &{} \ldots \\ \sigma _{0,k-1} &{} \sigma _{1,k-1} &{} \cdots &{} \sigma _{k-1,k-1} \end{pmatrix}. \end{aligned}$$

where \(\sigma _{i,j}=\langle {\textbf {a}}^{qi+j}, {\textbf {v}}^{q+1} \rangle _E\).

Table 5 Some known EAQMDS codes of lengths not divide \(q^2-1\)

From Lemma 3.9, \(\sigma _{i,j}\ne 0\) if and only if \(qi+j=\upsilon t\) with \(0\le \upsilon \le b-1\).

If there exist \(i_1=i_2=i\) such that \(qi+j_1=\upsilon _1 t\) and \(qi+j_2=\upsilon _2 t\), where \(j_1\ne j_2\), then \(j_1-j_2=(\upsilon _1-\upsilon _2)t\). In fact, \(\vert j_1-j_2\vert < q-1\). However, \(\vert (\upsilon _1-\upsilon _2)t\vert =\vert (\upsilon _1-\upsilon _2)\frac{q-1}{a}(q+1) \vert \ge q+1\). So \(\sigma _{i,j}\ne 0\) cannot appear in the same row of the matrix.

If there exist \(j_1=j_2=j\) such that \(qi_1+j=\upsilon _1 t\) and \(qi_2+j=\upsilon _2 t\), where \(i_1\ne i_2\), then \(q(i_1-i_2)=(\upsilon _1-\upsilon _2)t=(\upsilon _1-\upsilon _2)\frac{q^2-1}{a}\). Therefore, \(q \vert (\upsilon _1-\upsilon _2) \), which contradicts to the fact that \(\vert \upsilon _1-\upsilon _2\vert \le b-1 <q \). So \(\sigma _{i,j}\ne 0\) cannot appear in the same column of the matrix.

Hence, for \(0\le i,j\le \frac{b(q-1)}{a}-1\), \(\sigma _{i,j}\ne 0\) cannot occur in the same row and column of the matrix. Consequently, \(rank(G_kG_k^\dagger )=b\). According to Theorem 2.3, the EAQMDS codes are derived.

Remark 3.6

EAQMDS codes with the following parameters had been constructed in [24]:

  • \([[b\frac{q^2-1}{2a},b\frac{q^2-1}{2a}-2d+c+2,d;c]]_q\), where \(2a|(q+1)\), \(2\le b\le 2a\), \(1\le c\le 2a-1\), and \(cm+2\le d\le (a+\lceil \frac{c}{2}\rceil )m\).

  • \([[b\frac{q^2-1}{2a+1},b\frac{q^2-1}{2a+1}-2d+c+2,d;c]]_q\), where \((2a+1)|(q+1)\), \(2\le b\le 2a\), \(1\le c\le 2a\), and \(cm+2\le d\le (a+1+\lceil \frac{c}{2}\rceil )m\).

It is easy to see that their code lengths are different from ours due to the fact that our a is a divisor of \(q-1\).

Example 3.3

We show some of the new EAQMDS codes of length \(n=\frac{b({q^2}-1)}{a}\) with \(a\vert (q-1)\) derived from Theorem 3.3 whose lengths are not divisors of \(q^2-1\) in Table 4.

4 Conclusion

Let \(n=\frac{b({q^2}-1)}{a}+\frac{{q^2}-1}{a}\) and \(n=\frac{b({q^2}-1)}{a}\). Three classes of EAQMDS codes of length n were derived from GRS codes in this paper. Taking different values of a and b, some lengths of our results are divisors of \(q^2-1\). Compared with the known results, they have much larger minimum distances. Furthermore, as the lengths of our EAQMDS codes in this paper can be viewed as the sum of two divisors of \(q^2-1\), so they are probably not divisors of \(q^2-1\). Some known EAQMDS codes of lengths not be the divisors of \(q^2- 1\) are listed in Table 5. Compared with them, our lengths are new and not covered by them.