1 Introduction

Quantum error-correcting codes (QECCs) are one of the necessary guarantees for the realization of quantum communication and quantum computer. The connections between quantum codes and classical codes were established by Calderbank et al. [1]. The establishment showed that QECCs can be constructed from self-orthogonal (or dual-containing) classical codes [2]. Since then, many classes of quantum codes have been constructed by using classical error-correcting codes. There are two main ways to construct quantum MDS codes, namely using constacyclic codes (see [3, 4]) and generalized Reed–Solomon codes (see [5,6,7,8]). However, the self-orthogonal condition forms a barrier in the development of quantum coding theory. To break through the barrier, Brun et al. proposed the entanglement-assisted (EA) stabilizer formalism in [9]. By using preshared entanglement between the sender and the receiver, they proved that arbitrary classical linear error-correcting codes can be used to construct entanglement-assisted quantum error-correcting codes (EAQECCs). Since then, many scholars have been interested in EAQECCs and have made good progress.

Let q be a prime power. A q-ary EAQECC can be denoted as \([[n,k,d;c]]_q\), which encodes k logical qubits into n physical qubits with help of c pairs of maximally entangled states, where d is the minimum distance of the code. In particular, if \(c=0\), the code is a QECC. It is similar to the classical error-correcting codes, a quantum code with minimum distance d can detect up to \(d-1\) quantum errors and correct up to \(\lfloor \frac{d-1}{2}\rfloor \) quantum errors. The singleton bound for an EAQECC is given in the following proposition:

Proposition 1

[10] An\([[n,k,d;c]]_q\) EAQECC satisfies \(n+c-k\ge 2(d-1)\), where \(0\le c \le n-1\) and \(d\le \frac{n+2}{2}\).

An EAQECC attaining the singleton bound is called an entanglement-assisted quantum MDS (EAQMDS for short) code. By using Reed–Solomon codes and constacyclic codes, Fan et al.[11] constructed five classes of EAQMDS codes with the help of a few shared entanglement states. Chen et al. obtained four classes of EAQMDS codes from negacyclic codes with the help of 4 or 5 shared entanglement states [12]. In [13], Chen et al. obtained four classes of EAQMDS codes from constacyclic codes of length \(n=\frac{q^2+1}{5}\). Subsequently, many researchers constructed many classes of EAQMDS codes with constacyclic codes [14,15,16,17,18,19]. In [20], Guenda et al. have shown that the number of shared pairs required to construct an EAQECC is related to the dimension of the hull of classical linear codes. Then, Luo et al. presented several infinite families of MDS codes with hulls of arbitrary dimensions by GRS codes and constructed several new infinite families of EAQMDS codes with flexible parameters [21]. Since then, many people have constructed many quantum codes by using GRS codes [22,23,24].

In this paper, we construct some classes of q-ary EAQMDS codes with parameters \([[n,n-2k+c,k+1;c]]_q\) and EAQECCs with parameters \([[n,c,n-k+1;n-2k+c]]_q\) from GRS codes. The specific values of nk and c can be found in Theorems 1, 2, 3, 4 and 5. Moreover, we also construct some classes of q-ary EAQMDS codes with parameters \([[n+1,n-2k+c+2,k+1;c+1]]_q\) and EAQECCs with parameters \([[n+1,c+1,n-k+2;n-2k+c+2]]_q\) from extended GRS codes. The specific values of nk and c can be found in Theorems 6, 7, 8, 9 and 10.

The paper is organized as follows. In Sect. 2, we recall the basic knowledge of linear codes, EAQECCs, GRS codes. In Sects. 3 and 4, we construct some classes of EAQMDS codes and EAQECCs from GRS codes. In Sect. 5, some classes of EAQMDS codes are constructed from extended GRS codes. Section 6 concludes this paper.

2 Preliminaries

Let \(\mathrm{GF}(q^2)\) be a finite field with \(q^2\) elements. Let \(\mathrm{GF}(q^2)^n\) be the n-dimensional vector space over \(\mathrm{GF}(q)\), where n is a positive integer. The Hamming weight of \({\varvec{x}}\in \mathrm{GF}(q^2)^n\) is the number of nonzero coordinates of \({\varvec{x}}\) and is denoted by \(\mathrm{wt}({\varvec{x}})\). The Hamming distance of two vectors \({\varvec{x}}\) and \({\varvec{y}}\) is the Hamming weight of the \({\varvec{x}}-{\varvec{y}}\), denoted by \(\mathrm{dist}({\varvec{x}},{\varvec{y}})\).

A \(q^2\)-ary code C of length n is a subset of \(\mathrm{GF}(q^2)^n\). The minimum distance of C, denoted by d(C), is defined by \(d(C)=\mathrm{min}\{\mathrm{dist}({\varvec{x}},{\varvec{y}})| {\varvec{x}}\ne {\varvec{y}}\in C \}\). The code C is called a \(q^2\)-ary linear code of length n, if C is a subspace of \(\mathrm{GF}(q^2)^n\). Clearly, the minimum Hamming distance of linear code C is equal to the minimum nonzero Hamming weight of all codewords in C. A \(q^2\)-ary linear code [nkd] is a k-dimensional subspace of \(\mathrm{GF}(q^2)^n\) and minimum distance d.

Let \({\varvec{x}}=(x_1,x_2,\dots ,x_n)\) and \({\varvec{y}}=(y_1,y_2,\dots ,y_n)\) be two vectors in \(\mathrm{GF}(q^2)^n\), the Euclidean inner product is defined as \(({\varvec{x}},{\varvec{y}})_E=\sum _{i=1}^{n}x_iy_i\), and the Hermitian inner product is defined as \(({\varvec{x}},{\varvec{y}})_H=\sum _{i=1}^nx_iy_i^q\). For a \(q^2\)-ary linear code C of length n, the Euclidean dual of C, denoted by \(C^{\bot _E}\), is defined by

$$\begin{aligned} \begin{aligned} C^{\bot _E}=\{{\varvec{x}}\in \mathrm{GF}(q^2)^n|({\varvec{x}},{\varvec{y}})_E=0,~\mathrm{for~all}~{\varvec{y}}\in C\}. \end{aligned} \end{aligned}$$

If \(C\subseteq C^{\perp _E}\), C is referred to as a Euclidean self-orthogonal code. Similarly, the Hermitian dual of C, denoted by \(C^{\bot _H}\), is defined by

$$\begin{aligned} \begin{aligned} C^{\bot _H}=\{{\varvec{x}}\in \mathrm{GF}(q^2)^n|({\varvec{x}},{\varvec{y}})_H=0,~\mathrm{for~all}~{\varvec{y}}\in C\}. \end{aligned} \end{aligned}$$

If \(C\subseteq C^{\perp _H}\), C is referred to as a Hermitian self-orthogonal code.

For a vector \({\varvec{x}}=(x_1,x_2,\dots ,x_n)\) in \(\mathrm{GF}(q^2)^n\), define \({\varvec{x}}^q=(x_1^q,x_2^q,\dots ,x_n^q)\). For a subset T of \(\mathrm{GF}(q^2)^n\), define the set \(T^q=\{{\varvec{x}}^q|{\varvec{x}}\in T\}\). It is easy to check that \(C^{\perp _H}=(C^q)^{\bot _E}\) for a \(q^2\)-ary linear code C of length n.

For a linear code C over \(F_{q^2}\), denoted by \(Hull_h(C)\) the Hermitian hull \(C\bigcap C^{\bot h}\) of C. Here are two propositions about Hermitian hull:

Proposition 2

[20] Let C be a classical \([n,k,d]_{q^2}\) code with parity check matrix H and generator matrix G. Then, \({rank}(HH^\dagger )\) and \({rank}(GG^\dagger )\) are independent of H and G so that \({rank}(HH^\dagger )=n-k-{dim}({Hull}h(C))=n-k-{dim}({Hull}h(C^{\bot _h}))\), and \({rank}(GG^\dagger )=k-{dim}({Hull}h(C))=k-{dim}({Hull}h(C^{\bot _h}))\).

Proposition 3

[20] Let C be a classical \([n,k,d]_{q^2}\) code and let \(C^{\perp h}\) be its Hermitian dual with parameters \([n,n-k,d^{\perp h}]_q\). Then, there exist \([[n,k- {dim}({Hull}h(C)),d;n-k-{dim}({Hull}h(C))]]_{q^2}\) and \([[n,n-k-{dim}({Hull}h(C)), d^\perp ;k-{dim}({Hull}h(C))]]_q\) EAQECCs. If C is MDS, then one of the two EAQECCs must be MDS.

Let kn be positive integers, and \(\mathrm{GF}(q^2)[x]_k\) be the set of polynomials whose degree is less than k over \(\mathrm{GF}(q^2)\). Select n distinct elements \(a_1,a_2,\cdots ,a_n\) of \(\mathrm{GF}(q^2)\) and n nonzero elements \(v_1,v_2,\cdots ,v_n\) of \(\mathrm{GF }(q^2)\). Let \({\varvec{a}}=(a_1,a_2,\dots ,a_n)\) and \({\varvec{v}}=(v_1,v_2,\dots ,v_n)\), then

$$\begin{aligned} \begin{aligned} {\mathcal {G}}{RS}_k({\varvec{a}},{\varvec{v}}):=\{(v_1f(a_1),\dots ,v_nf(a_n))|f(x)\in \mathrm{GF}(q^2)[x]_k\} \end{aligned} \end{aligned}$$

is called a GRS code. Clearly,

$$\begin{aligned} \begin{aligned} G_k({\varvec{a}},{\varvec{v}})= \begin{pmatrix} v_1a_1^0 &{} v_2a_2^0 &{} \cdots &{} v_na_n^0 \\ v_1a_1^1 &{} v_2a_2^1 &{} \cdots &{} v_na_n^1 \\ \vdots &{} \vdots &{} \cdots &{} \vdots \\ v_1a_1^{k-1} &{} v_2a_2^{k-1} &{} \cdots &{} v_na_n^{k-1} \end{pmatrix} \end{aligned} \end{aligned}$$

is a generator matrix of \({\mathcal {G}}RS_k({\varvec{a}},{\varvec{v}})\). It is well known that \({\mathcal {G}}RS_k({\varvec{a}},{\varvec{v}})\) is a \(q^2\)-ary \([n,k,n-k+1]\) MDS code.

Moreover, any GRS code of length n can be extended to a code of length \(n+1\) and such code is called an extended GRS code. The definition of extended GRS code of length n can be given by

$$\begin{aligned} \begin{aligned} {\mathcal {G}}RS_k({\varvec{a}},{\varvec{v}},\infty ):=\{(v_1f(a_1),\dots ,v_nf(a_n),f_{k-1})|f(x)\in \mathrm{GF}(q^2)[x]_k\} \end{aligned} \end{aligned}$$

where \(f_{k-1}\) is the coefficient of \(x^{k-1}\) in f(x) and \(k \le n + 1 \le q^2 + 1\). It is known that \({\mathcal {G}}RS_k({\varvec{a}},{\varvec{v}},\infty )\) has parameters \([n + 1, k, n + 2 - k]_{q^2}\) and a generator matrix \([G_k({\varvec{a}},{\varvec{v}})|{\varvec{u}}^T]\), where \({\varvec{u}}=(0,0,\dots ,0,1)\).

When all of the \(a_i\), \(i=1,2,\cdots ,n\), are nonzero, let \(C_{k,k_1}\) be a \(q^2\)-ary linear code of length n with generator matrix

$$\begin{aligned} \begin{aligned} G_{k,k_1}({\varvec{a}},{\varvec{v}})= \begin{pmatrix} v_1a_1^{k_1} &{} v_2a_2^{k_1} &{} \cdots &{} v_na_n^{k_1} \\ v_1a_1^{k_1+1} &{} v_2a_2^{k_1+1} &{} \cdots &{} v_na_n^{k_1+1} \\ \vdots &{} \vdots &{} \cdots &{} \vdots \\ v_1a_1^{k_1+k-1} &{} v_2a_2^{k_1+k-1} &{} \cdots &{} v_na_n^{k_1+k-1} \end{pmatrix}. \end{aligned} \end{aligned}$$

As \(a_1,a_2,\ldots , a_n\) are n distinct nonzero elements of \(\mathrm{GF}(q^2)\), put \(v_i' = v_ia_i^{k_1},i=1,2,\ldots ,n\), then \(C_{k,k_1}({\varvec{a}},{\varvec{v}})={\mathcal {G}}RS_k({\varvec{a}},{\varvec{v}}')\). Hence, \(C_{k,k_1}\) is an MDS code with parameters \([n,k,n-k+1]\).

Similarly, when all of the \(a_i,i=1,2,\ldots ,n\), are nonzero, let \(C_{k,k_1,\infty }\) be a \(q^2\)-ary linear code of length n with generator matrix \([G_{k,k_1}({\varvec{a}},{\varvec{v}})|{\varvec{u}}^T]\).

In the end of this section, we will give a useful lemma for the following construction.

Lemma 1

Let C be a GRS code \({\mathcal {G}}RS_k({\varvec{a}},{\varvec{v}})\) with generator matrix \(G_k({\varvec{a}},{\varvec{v}})=(\varvec{g_0},\varvec{g_1},\dots ,\varvec{g_{k-1}})^T\) and \({\hat{C}} \) be an extended GRS code \({\mathcal {G}}RS_k({\varvec{a}},{\varvec{v}},\infty )\) with generator matrix \({\hat{G}}_k({\varvec{a}},{\varvec{v}})=[G_{k}({\varvec{a}},{\varvec{v}})|{\varvec{u}}^T]\), where \(G_k({\varvec{a}},{\varvec{v}})\) and \({\varvec{u}}\) are defined as above. Then \(\mathrm{dim}(\mathrm{Hull}_h{{\hat{C}}})=\mathrm{dim}(\mathrm{Hull}_h{C})-1\) if \((\varvec{g_{i}},\varvec{g_{k-1}})_H=0\), where \(i=0,\dots ,k-1\).

Proof

From Proposition 2, we know \(\mathrm{dim}(\mathrm{Hull}h(C)=k-\mathrm{rank}(GG^\dagger ))\).

$$\begin{aligned} \text {Since } G_k({\varvec{a}},{\varvec{v}})G_k({\varvec{a}},{\varvec{v}})^\dagger= & {} \begin{pmatrix} \varvec{g_0g_0^\dag } &{}\varvec{ g_0g_1^\dag } &{} \cdots &{} \varvec{g_0g_{k-1}^\dag } \\ \varvec{g_1g_0^\dag } &{} \varvec{g_1g_1^\dag } &{} \cdots &{} \varvec{g_1g_{k-1}^\dag } \\ \vdots &{} \vdots &{} \cdots &{} \vdots \\ \varvec{ g_{k-1}g_0^\dag }&{} \varvec{g_{k-1}g_1^\dag }&{} \cdots &{} \varvec{g_{k-1}g_{k-1}^\dag } \\ \end{pmatrix},\\ {\hat{G}}_k({\varvec{a}},{\varvec{v}}){\hat{G}}_k({\varvec{a}},{\varvec{v}})^\dagger= & {} \begin{pmatrix} \varvec{g_0g_0^\dag }&{}\varvec{ g_0g_1^\dag } &{} \cdots &{} \varvec{g_0g_{k-1}^\dag }\\ \varvec{g_1g_0^\dag } &{} \varvec{g_1g_1^\dag }&{} \cdots &{} \varvec{g_1g_{k-1}^\dag } \\ \vdots &{} \vdots &{} \cdots &{} \vdots \\ \varvec{g_{k-1}g_0^\dag } &{} \varvec{g_{k-1}g_1^\dag } &{} \cdots &{} \varvec{g_{k-1}g_{k-1}^\dag }+1\\ \end{pmatrix}. \end{aligned}$$

It is easy to prove that \(\mathrm{rank}({\hat{G}}_k({\varvec{a}},{\varvec{v}}){\hat{G}}_k({\varvec{a}},{\varvec{v}})^\dagger )=G_k({\varvec{a}},{\varvec{v}})G_k({\varvec{a}},{\varvec{v}})^\dagger +1\). Then \(\mathrm{dim}(\mathrm{Hull}_h{{\hat{C}}})=\mathrm{dim}(\mathrm{Hull}_h{C})-1\). \(\square \)

3 The first construction

Throughout this section, let \(\omega \) be a primitive element of \(\mathrm{GF}(q^2)\) and \(\gamma =\omega ^h\), where h is an even integer such that \(\frac{2(q-1)}{h}=2\tau +1\) for some \(\tau \ge 1\). Let \(n'=\frac{q^2-1}{h}\), then \(\gamma \) is a primitive \(n'\)-th root of unity.

For our construction, we need the following lemmas.

Lemma 2

Let \(q, h, \tau \) and \(n'\) be defined as above. Suppose that \(0\le j,l\le q-2\), then \(jq+l+q+1 \equiv 0 ~(\mathrm{mod}~n')\) if and only if jl satisfy one of the following three conditions: \(j=l=\frac{s(q-1)}{h}-1\), where s is even and \(2\le s\le h\); \(j=\frac{(s-1)(q-1)}{h}+\tau -1,l=\frac{(s-1)(q-1)}{h}+\tau +\frac{q-1}{2}\) where s is odd and \(1\le s\le \frac{h}{2}-1\); or \(j=\frac{(s-1)(q-1)}{h}+\tau ,l=\frac{(s-1)(q-1)}{h}+\tau -\frac{q+1}{2}\) where s is odd and \(\frac{h}{2}+1\le s\le h-1\).

Proof

Suppose that \(jq+l+q+1 \equiv 0 ~(\text {mod}~n')\). Note that \(0\le j,l <q-2\), we have \(q+1\le jq+l+q+1< (q-1)(q+1)\), then there exists an integer s such that

$$\begin{aligned}\begin{aligned} jq+l=sn'-q-1, \end{aligned} \end{aligned}$$

where \(1\le s\le h\). If s is odd, then

$$\begin{aligned}\begin{aligned} jq+l&=\left[ \frac{(s-1)(q-1)}{h}-1 \right] q+\frac{(s-1)(q-1)}{h}+\frac{q^2-1}{h}-1 \\&=\left[ \frac{(s-1)(q-1)}{h}-1 \right] q+\frac{(s-1)(q-1)}{h}+\frac{2(q-1)}{h} \cdot \frac{q+1}{2}-1\\&= \left[ \frac{(s-1)(q-1)}{h}+\tau -1 \right] q+\frac{(s-1)(q-1)}{h}+\frac{q-1}{2}+\tau . \end{aligned}\end{aligned}$$

There are two cases.

  • Case 1 If \(1\le s\le \frac{h}{2}-1\), then

    $$\begin{aligned} \begin{aligned} \frac{q+1}{2}+\tau -1&\le \frac{(s-1)(q-1)}{h}+\frac{q-1}{2}+\tau \\&\le q-2-\tau . \end{aligned} \end{aligned}$$

    It follows that \(j=\frac{(s-1)(q-1)}{h}+\tau -1\) and \(l=\frac{(s-1)(q-1)}{h}+\tau +\frac{q-1}{2}\).

  • Case 2 If \(\frac{h}{2}+1\le s\le h-1\), then

    $$\begin{aligned} \begin{aligned} q+\tau -1&\le \frac{(s-1)(q-1)}{h}+\frac{q-1}{2}+\tau \\&\le q+\frac{q-1}{2}-\tau -2<2q. \end{aligned} \end{aligned}$$

    It follows that \(j=\frac{(s-1)(q-1)}{h}+\tau \) and \(l=\frac{(s-1)(q-1)}{h}+\tau -\frac{q+1}{2}\).

If s is even, then

$$\begin{aligned} \begin{aligned} jq+l=\left[ \frac{s(q-1)}{h}-1 \right] q+ \left[ \frac{s(q-1)}{h}-1 \right] . \end{aligned} \end{aligned}$$

Notice that \(2\le s\le h\), then we have

$$\begin{aligned} j=l=\frac{s(q-1)}{h}-1. \end{aligned}$$

\(\square \)

By using Lemma 2, we can obtain the GRS codes with the following parameters.

Lemma 3

Let \(q, h, \tau ,n' \) be defined as above, and \(n=n'(\frac{h}{4}+t),(1\le t\le \frac{h}{4})\). Then, there exist some GRS codes with following parameters:

  1. (1)

    Let \(t_0,k\) be integers, where \(0\le t_0 \le t-2(t\ge 2)\) and \(\frac{q-1}{2}+\tau +\frac{2t_0(q-1)}{h}\le k \le \frac{q-1}{2}+\tau + \frac{2(t_0+1)(q-1)}{h}-1\), the code C has parameters \([n,k,n-k+1]\) and \(Hull_h(C)\) has dimension \(k-2t_0-2\).

  2. (2)

    Let \(t_0,k\) be integers, where \(0\le t_0 \le \frac{h}{4}-t\) and \(\frac{q-1}{2}+\tau +\frac{2(t+t_0-1)(q-1)}{h}\le k \le \frac{q-1}{2}+2\tau + \frac{2(t_0+t-1)(q-1)}{h}-1 \), the code C has parameters \([n,k,n-k+1]\) and \(Hull_h(C)\) has dimension \(k-2t-3t_0\).

  3. (3)

    Let \(t_0,k\) be integers, where \(0\le t_0 \le \frac{h}{4}-t-1\) and \(\frac{q-1}{2}+2\tau +\frac{2(t+t_0-1)(q-1)}{h}\le k \le \frac{q-1}{2}+\tau + \frac{2(t_0+t)(q-1)}{h}-1 \), the code C has parameters \([n,k,n-k+1]\) and \(Hull_h(C)\) has dimension \(k-2t-3t_0-1\).

Proof

Let \(\gamma ,\omega \) be defined as above. Set

$$\begin{aligned}&{\varvec{a}}=(1,\gamma ,\dots ,\gamma ^{n'-1},\omega ,\omega \gamma ,\dots ,\omega \gamma ^{n'-1},\dots ,\omega ^{\frac{h}{4}+t},\omega ^{\frac{h}{4}+t}\gamma ,\dots ,\omega ^{\frac{h}{4}+t}\gamma ^{n'-1}),\\&{\varvec{v}}=(u_0,u_0\gamma ,\dots ,u_0\gamma ^{n'-1},u_1,u_1\gamma ,\dots ,u_1\gamma ^{n'-1},\dots ,u_{\frac{h}{4}+t},u_{\frac{h}{4}+t}\gamma ,\\&\qquad \dots ,u_{\frac{h}{4}+t}\gamma ^{n'-1}), \end{aligned}$$

where \(u_0,u_1,\dots ,u_{\frac{h}{4}+t-1}\) are \(\frac{h}{4}+t\) nonzero elements in \(\mathrm{GF}(q^2)\).

We will prove that there exist \(\frac{h}{4}+t\) nonzero elements \(u_0,u_1,\cdots ,u_{\frac{h}{4}+t}\) in \(\mathrm{GF}(q^2)\) such that \({\mathcal {G}}RS_k({\varvec{a}},{\varvec{v}})\) has parameters above. In fact,

$$\begin{aligned} \begin{aligned} ({\varvec{a}}^{qj+l},{\varvec{v}}^{q+1})_E=\sum _{i=0}^{\frac{h}{4}+t-1} \omega ^{i(qj+l)}u_i^{q+1}\sum _{r=0}^{n'-1} \gamma ^{r(qj+l+q+1)}. \end{aligned} \end{aligned}$$

Noticing that the order of \(\gamma \) is \(n'\), then

$$\begin{aligned} \begin{aligned} \sum _{r=0}^{n'-1} \gamma ^{r\ell }={\left\{ \begin{array}{ll} 0 &{}\quad \mathrm{~if~} n'\not \mid \ell ,\\ n'&{}\quad \mathrm{~if~} n' \mid \ell . \end{array}\right. } \end{aligned} \end{aligned}$$

It follows that \(({\varvec{a}}^{qj+l},{\varvec{v}}^{q+1})_E=0\) except for \(n' \mid (qj+l+q+1)\). Now we assume that \(0\le j,l\le k-1\) such that \(n'\mid (qj+l+q+1)\). From Lemma 2, if s is even and \(2\le s\le h\), then \(j=l=\frac{s(q-1)}{h}-1\); if s is odd and \(1\le s\le \frac{h}{2}-1\), then \(j=\frac{(s-1)(q-1)}{h}+\tau -1,l=\frac{(s-1)(q-1)}{h}+\tau +\frac{q-1}{2}\); if s is odd and \(\frac{h}{2}+1\le s\le h-1\), then \(j=\frac{(s-1)(q-1)}{h}+\tau ,l=\frac{(s-1)(q-1)}{h}+\tau -\frac{q+1}{2}\).

Then, we will prove that \(({\varvec{a}}^{qj+l},{\varvec{v}}^{q+1})_E=0\) for \(j=l=\frac{s(q-1)}{h}-1\), where s is even and \(1\le \frac{s}{2}\le \frac{h}{4}+t-1\). Then

$$\begin{aligned} \begin{aligned} ({\varvec{a}}^{qj+l},{\varvec{v}}^{q+1})_E=n'\sum _{i=0}^{\frac{h}{4}+t-1} \omega ^{i(q+1)[\frac{s}{2}\cdot \frac{2(q-1)}{h}-1]}u_i^{q+1}. \end{aligned} \end{aligned}$$

It suffices to prove that the system of \(\frac{h}{4}+t-1\) equations \(\sum _{i=0}^{\frac{h}{4}+t-1} \omega ^{2imn-i(q+1) }u_i^{q+1}=0\) for \(1\le m\le \frac{h}{4}+t-1\) has a solution in \((\mathrm{GF}(q^2)^*)^{\frac{h}{4}+1}\). Take \(y_i=(\omega ^{-i}u_i)^{(q+1)}\) for \(0\le i\le \frac{h}{4}+t-1\), then \(y_i\in \mathrm{GF}(q)^*\). It suffices to prove that the system of the equations

$$\begin{aligned} \begin{aligned} \begin{pmatrix} 1 &{} \beta &{} \cdots &{} \beta ^{\frac{h}{4}+t-1} \\ 1 &{} \beta ^{2} &{} \cdots &{} \beta ^{2\cdot \frac{h}{4}+t-1} \\ \vdots &{} \vdots &{} \cdots &{} \vdots \\ 1 &{} \beta ^{\frac{h}{4}+t-1} &{} \cdots &{} \beta ^{(\frac{h}{4}+t-1)\cdot (\frac{h}{4}+t-1)} \\ \end{pmatrix} \begin{pmatrix} y_0 \\ y_1 \\ \vdots \\ y_{\frac{h}{4}+t-1}\\ \end{pmatrix}=0 \end{aligned} \end{aligned}$$

has a solution in \((\mathrm{GF}(q)^*)^{\frac{h}{4}+t}\), where \(\beta =\omega ^{2n'}\).

Because of \(\mathrm{ord}(\beta )=\frac{h}{2}\), \(\mathrm{ord}(\beta )\) divides \(q-1\). Hence, \(\beta \in \mathrm{GF}(q)^*\). Put \(f(x)=\prod _{s=1}^{\frac{h}{4}+t-1}(x-\beta ^s)\), then \(f(x)\in \mathrm{GF}(q)[x]\) and \(f(x)\mid (x^\frac{h}{2}-1)\). Considering a q-ary cyclic code \({\mathcal {C}}\) of length \(\frac{h}{2}\) with generator polynomial f(x), it is easy for us to check that \({\mathcal {C}}\) is a \([\frac{h}{2},\frac{h}{4}-t+1,\frac{h}{4}+t]\) MDS code. Hence, all coefficients of \(f(x)=x^{\frac{h}{4}+t-1}+a_{\frac{h}{4}+t-2}x^{\frac{h}{4}+t-2}+\cdots +a_0\) are all nonzero. That means that the last system has a solution

$$\begin{aligned} \begin{aligned} (y_0,\dots ,y_{\frac{h}{4}+t-2},y_{\frac{h}{4}+t-1})=(a_0,\dots ,a_{\frac{h}{4}+t-2},1) \in (\mathrm{GF}(q)^*)^n. \end{aligned} \end{aligned}$$

For each \(0\le i\le \frac{h}{4}+t-2\), since \(a_i\in \mathrm{GF}(q)^*\), there exists \(b_i\in \mathrm{GF}(q^2)^*\) such that \(a_i=b_i^{q+1}\). Take

$$\begin{aligned} \begin{aligned} {\varvec{u}}=(u_0,u_1,\dots ,u_{\frac{h}{4}+t-1})=(b_0,\omega b_1,\dots ,\omega ^{\frac{h}{4}+t-2}b_{\frac{h}{4}+t-2},\omega ^{\frac{h}{4}+t-1}), \end{aligned} \end{aligned}$$

then \(({\varvec{a}}^{qj+l},{\varvec{v}}^{q+1})_E=0\) for \(j=l=\frac{s(q-1)}{h}-1\), where s is even and \(0<\frac{s}{2} < \frac{h}{4}+t\).

Let \(G = G_k({\varvec{a}},{\varvec{v}})=\begin{pmatrix} \varvec{g_0} \\ \varvec{g_1} \\ \vdots \\ \varvec{g_{k-1}}\end{pmatrix}\). Then \(GG^\dagger = \begin{pmatrix} \varvec{g_0g_0^\dag } &{} \varvec{g_0g_1^\dag } &{} \cdots &{} \varvec{g_0g_{k-1}^\dag } \\ \varvec{g_1g_0^\dag } &{} \varvec{g_1g_1^\dag } &{} \cdots &{} \varvec{g_1g_{k-1}^\dag } \\ \vdots &{} \vdots &{} \cdots &{} \vdots \\ \varvec{g_{k-1}g_0^\dag } &{} \varvec{g_{k-1}g_1^\dag } &{} \cdots &{} \varvec{g_{k-1}g_{k-1}^\dag } \\ \end{pmatrix}\).

In the first case: \(0\le t_0 \le t-2(t\ge 2)\) and \(\frac{q-1}{2}+\tau +\frac{2t_0(q-1)}{h}\le k \le \frac{q-1}{2}+\tau + \frac{2(t_0+1)(q-1)}{h}-1\). It is easy to prove that \(({\varvec{a}}^{qj+l},{\varvec{v}}^{q+1})_E \ne 0\) if and only if \(j=\frac{(s-1)(q-1)}{h}+\tau -1,l=\frac{(s-1)(q-1)}{h}+\tau +\frac{q-1}{2}\) where s is odd and \(1\le s\le 2t_0+1\); or \(j=\frac{(s-1)(q-1)}{h}+\tau ,l=\frac{(s-1)(q-1)}{h}+\tau -\frac{q+1}{2}\) where s is odd and \(\frac{h}{2}+1\le s\le \frac{h}{2}+ 2t_0+1\). There are \(2t_0+2\) pairs (jl) such that \(({\varvec{a}}^{qj+l},{\varvec{v}}^{q+1})_E \ne 0\).

By \(\varvec{g_jg_l^\dag } = ({\varvec{a}}^{qj+l},{\varvec{v}}^{q+1})_E\), \(\mathrm{dim}(\mathrm{Hull}_h(C))=k-\mathrm{rank}(GG^\dag )=k-2t_0-2\).

In the second case: \(0\le t_0 \le \frac{h}{4}-t\) and \(\frac{q-1}{2}+\tau +\frac{2(t+t_0-1)(q-1)}{h}\le k \le \frac{q-1}{2}+2\tau + \frac{2(t_0+t-1)(q-1)}{h}-1 \). It is easy to prove that \(({\varvec{a}}^{qj+l},{\varvec{v}}^{q+1})_E \ne 0\) if and only if \(j=l=\frac{s(q-1)}{h}-1\), where s is even and \(\frac{h}{2}+2t< s\le \frac{h}{2}+2t+2t_0\); \(j=\frac{(s-1)(q-1)}{h}+\tau -1,l=\frac{(s-1)(q-1)}{h}+\tau +\frac{q-1}{2}\) where s is odd and \(1\le s\le 2t_0+2t-1\); or \(j=\frac{(s-1)(q-1)}{h}+\tau ,l=\frac{(s-1)(q-1)}{h}+\tau -\frac{q+1}{2}\) where s is odd and \(\frac{h}{2}+1\le s\le \frac{h}{2}+ 2t_0+2t-1\). There are \(3t_0+2t\) pairs (jl) such that \(({\varvec{a}}^{qj+l},{\varvec{v}}^{q+1})_E \ne 0\).

By \(\varvec{g_jg_l^\dag } = ({\varvec{a}}^{qj+l},{\varvec{v}}^{q+1})_E\), \(\mathrm{dim}(\mathrm{Hull}_h(C))=k-\mathrm{rank}(GG^\dag )=k-3t_0-2t\).

In the last case: \(0\le t_0 \le \frac{h}{4}-t-1\) and \(\frac{q-1}{2}+2\tau +\frac{2(t+t_0-1)(q-1)}{h}\le k \le \frac{q-1}{2}+\tau + \frac{2(t_0+t)(q-1)}{h}-1 \). It is easy to prove that \(({\varvec{a}}^{qj+l},{\varvec{v}}^{q+1})_E \ne 0\) if and only if \(j=l=\frac{s(q-1)}{h}-1\), where s is even and \(\frac{h}{2}+2t\le s\le \frac{h}{2}+2t+2t_0\); \(j=\frac{(s-1)(q-1)}{h}+\tau -1,l=\frac{(s-1)(q-1)}{h}+\tau +\frac{q-1}{2}\) where s is odd and \(1\le s\le 2t_0+2t-1\); or \(j=\frac{(s-1)(q-1)}{h}+\tau ,l=\frac{(s-1)(q-1)}{h}+\tau -\frac{q+1}{2}\) where s is odd and \(\frac{h}{2}+1\le s\le \frac{h}{2}+ 2t_0+2t-1\). There are \(3t_0+2t+1\) pairs (jl) such that \(({\varvec{a}}^{qj+l},{\varvec{v}}^{q+1})_E \ne 0\).

By \(\varvec{g_jg_l^\dag } = ({\varvec{a}}^{qj+l},{\varvec{v}}^{q+1})_E\), \(\mathrm{dim}(\mathrm{Hull}_h(C))=k-\mathrm{rank}(GG^\dag )=k-3t_0-2t-1\). \(\square \)

Similar to (2) and (3) of Lemma 3, when \(n=n'(\frac{h}{4}-t),(0\le t\le \frac{h}{4}-1)\), we can get the following lemma.

Lemma 4

Let \(q, h, \tau ,n' \) be defined as above, and \(n=n'(\frac{h}{4}-t),(0\le t\le \frac{h}{4}-1)\). Then, there exist some GRS codes with following parameters:

  1. (1)

    Let \(t_0,k\) be integers, where \(0\le t_0 \le \frac{h}{4}-1\) and \(\frac{q-1}{2}+\tau +\frac{2t_0(q-1)}{h}\le k \le \frac{q-1}{2}+2\tau + \frac{2(t_0+1)(q-1)}{h}-1 \), the code C has parameters \([n,k,n-k+1]\), and Hullh(C) has dimension \(k-t-3t_0-3\).

  2. (2)

    Let \(t_0,k\) be integers, where \(0\le t_0 \le \frac{h}{4}-2\) and \(\frac{q-1}{2}+2\tau +\frac{2t_0(q-1)}{h}\le k \le \frac{q-1}{2}+\tau + \frac{2(t_0+1)(q-1)}{h}-1 \), the code C has parameters \([n,k,n-k+1]\), and Hullh(C) has dimension \(k-t-3t_0-4\).

From Lemmas 3, 4 and Proposition 3, we can get the following theorem.

Theorem 1

Let \(q, n', h, \tau \) be defined as above and k be an integer. Then, there exist \([[n,n-2k+c,k+1;c]]_q\) EAQMDS codes and \([[n,c,n-k+1;n-2k+c]]_q\) EAQECCs, if one of the following conditions holds:

  1. (1)

    \(n=n'(\frac{h}{4}+t)\), \(c=2t_0+2\),and \(\frac{q-1}{2}+\tau +\frac{2t_0(q-1)}{h}\le k \le \frac{q-1}{2}+\tau + \frac{2(t_0+1)(q-1)}{h}-1\), where \(2\le t \le \frac{h}{4}\) and \(0\le t_0 \le t-2\).

  2. (2)

    \(n=n'(\frac{h}{4}+t)\), \(c=2t+3t_0\), and \(\frac{q-1}{2}+\tau +\frac{2(t+t_0-1)(q-1)}{h}\le k \le \frac{q-1}{2}+2\tau + \frac{2(t_0+t-1)(q-1)}{h}-1 \), where \(1\le t \le \frac{h}{4}\) and \(0\le t_0 \le \frac{h}{4}-t\).

  3. (3)

    \(n=n'(\frac{h}{4}+t)\), \(c=2t+3t_0+1\), \(\frac{q-1}{2}+2\tau +\frac{2(t+t_0-1)(q-1)}{h}\le k \le \frac{q-1}{2}+\tau + \frac{2(t_0+t)(q-1)}{h}-1 \), where \(1\le t \le \frac{h}{4}\) and \(0\le t_0 \le \frac{h}{4}-t-1\).

  4. (4)

    \(n=n'(\frac{h}{4}-t)\), \(c=t+3t_0+3\), and \(\frac{q-1}{2}+\tau +\frac{2t_0(q-1)}{h}\le k \le \frac{q-1}{2}+2\tau + \frac{2(t_0+1)(q-1)}{h}-1 \), where \(0\le t \le \frac{h}{4}-1\) and \(0\le t_0 \le \frac{h}{4}-1\).

  5. (5)

    \(n=n'(\frac{h}{4}-t)\), \(c=t+3t_0+4\) and \(\frac{q-1}{2}+2\tau +\frac{2t_0(q-1)}{h}\le k \le \frac{q-1}{2}+\tau + \frac{2(t_0+1)(q-1)}{h}-1 \), where \(0\le t \le \frac{h}{4}-1\) and \(0\le t_0 \le \frac{h}{4}-2\).

Remark 1

In Theorem 11 of [24], Fang et al. constructed a class of EAQMDS codes with parameters \([[n,k-l,n-k+1;n-k-l]]_q\) and \([[n,n-k-l,k+1;k-l]]_q\), where \(n'|(q^2-1),n=tn',n_1=\frac{n'}{gcd(n',q+1)},1\le t\le \frac{q-1}{n_1},1\le k \le \lfloor \frac{n+q}{q+1}\rfloor \) and \(0\le l \le k-1\). Compared with Theorem 1, we find that the range of k is disjoint for the same length. It means that the EAQMDS codes constructed by Theorem 1 are new.

Example 1

Let \(q=29,h=8\), and then \(\tau =3\). Then, there exist \([[n,n-2k+c,k+1;c]]_q\) EAQMDS codes and \([[n,c,n-k+1;n-2k+c]]_q\) EAQECCs, where the values of nkc can be found in Table 1.

Table 1 The values of nkc in Example 1

4 The second construction

Throughout this section, let \(\omega \) be a primitive element of \(\mathrm{GF}(q^2)\) and \(\gamma =\omega ^h\), where \(h>4\) is an even integer such that \(\frac{2(q+1)}{h}=2\tau +1\) for some \(\tau \ge 1\). Let \(n'=\frac{q^2-1}{h}\), then \(\gamma \) is a primitive \(n'\)-th root of unity.

For our construction, we need the following lemmas.

Lemma 5

Let \(q, h, \tau \) and \(n'\) be defined as above. Suppose that \(0\le j,l\le q-2\), then \(jq+l+q+1 \equiv 0 ~(\mathrm{mod}~n')\) if and only if jl satisfy one of the following three conditions: \(j=\frac{s(q+1)}{h}-2\) and \(l=q-\frac{s(q+1)}{h}-1\) where s is even and \(2\le s\le h\); \(j=\frac{(s-1)(q+1)}{h}+\tau -1\) and \(l=\frac{q-3}{2}-\frac{(s-1)(q+1)}{h}-\tau \) where s is odd and \(1\le s\le \frac{h}{2}-1\); or \(j=\frac{(s-1)(q+1)}{h}+\tau -2\) and \(l=\frac{3q-3}{2}-\frac{(s-1)(q+1)}{h}-\tau \) where s is odd and \(\frac{h}{2}+1\le s\le h-1\).

Proof

Suppose that \(jq+l+q+1 \equiv 0 ~(\text {mod}~n')\). Note that \(0\le j,l <q-2\), we have \(q+1\le jq+l+q+1< (q-1)(q+1)\), then there exists an integer s such that

$$\begin{aligned} \begin{aligned} jq+l=sn'-q-1, \end{aligned} \end{aligned}$$

where \(1\le s\le h\). If s is odd, then

$$\begin{aligned} \begin{aligned} jq+l&=\left[ \frac{(s-1)(q+1)}{h}-1 \right] q-\frac{(s-1)(q+1)}{h}+\frac{q^2-1}{h}-1 \\&=\left[ \frac{(s-1)(q+1)}{h}-1 \right] q-\frac{(s-1)(q+1)}{h}+\frac{2(q+1)}{h} \cdot \frac{q-1}{2}-1\\&= \left[ \frac{(s-1)(q+1)}{h}+\tau -1 \right] q+\left[ \frac{q-3}{2}-\frac{(s-1)(q+1)}{h}-\tau \right] . \end{aligned} \end{aligned}$$

There are two cases.

  • Case 1 If \(1\le s\le \frac{h}{2}-1\), then

    $$\begin{aligned} \begin{aligned} 0<\tau -1&\le \frac{q-3}{2}-\frac{(s-1)(q+1)}{h}-\tau \le q-3-\tau <q. \end{aligned} \end{aligned}$$

    It follows that \(j=\frac{(s-1)(q+1)}{h}+\tau -1\) and \(l=\frac{q-3}{2}-\frac{(s-1)(q+1)}{h}-\tau \).

  • Case 2 If \(\frac{h}{2}+1\le s\le h-1\), then

    $$\begin{aligned} \begin{aligned} -q<\tau -\frac{q-3}{2}\le q-3-\tau \le -\tau -2<0. \end{aligned} \end{aligned}$$

    It follows that \(j=\frac{(s-1)(q+1)}{h}+\tau -2\) and \(l=\frac{3q-3}{2}-\frac{(s-1)(q+1)}{h}-\tau \).

If s is even, then

$$\begin{aligned} \begin{aligned} jq+l=\left[ \frac{s(q+1)}{h}-2 \right] q+ \left[ q-\frac{s(q+1)}{h}-1 \right] . \end{aligned} \end{aligned}$$

Notice that \(2\le s\le h\), then we have

$$\begin{aligned} j=\frac{s(q+1)}{h}-2, l=q-\frac{s(q+1)}{h}-1. \end{aligned}$$

\(\square \)

4.1 The case \(q\equiv 3\,(mod\,4)\)

By using Lemma 5, we can obtain the GRS codes with the following parameters. Firstly, we consider the case that \(q\equiv 3\,(mod\,4)\).

Lemma 6

Let \(q\equiv 3\,(mod\,4)\) and \( h, \tau ,n' \) be defined as above, and \(n=n'(\frac{h}{4}+2t+2)\) for \(0\le t\le \frac{h}{8}-1\). Then, there exist some GRS codes with following parameters:

  1. (1)

    Let \(t_1,t_2,k\) be integers, where \(0\le t_1 \le t_2\le t\) and \(\frac{q+3}{2}+\tau +\frac{2(t_1+t_2)(q+1)}{h}\le k \le \frac{q-3}{2}+\tau +\frac{2(t_1+t_2+1)(q+1)}{h}\), the code C has parameters \([n,k,n-k+1]\), and \(Hull_h(C)\) has dimension \(k-2t_1-2t_2-2\).

  2. (2)

    Let \(t_1,t_2,k\) be integers, where \(0\le t_1 \le t_2\le \frac{h}{8}-1-t\) and \(\frac{q+3}{2}+\tau +\frac{2(2t+t_1+t_2)(q+1)}{h}\le k \le \frac{q-3}{2}+\tau +\frac{2(2t+t_1+t_2+1)(q+1)}{h}\), the code C has parameters \([n,k,n-k+1]\), and \(Hull_h(C)\) has dimension \(k-4t-4t_1-2t_2-2\).

Proof

If \(q\equiv 3\,(mod\,4)\), then 8|h. Let \(\gamma ,\omega \) be defined as above. Set

$$\begin{aligned}&{\varvec{a}}=(1,\gamma ,\dots ,\gamma ^{n'-1},\omega ,\dots ,\omega \gamma ^{n'-1},\dots ,\omega ^{\frac{h}{4}+2t+1},\dots ,\omega ^{\frac{h}{4}+2t+1}\gamma ^{n'-1}),\\&{\varvec{v}}=(u_0,u_0\gamma ,\dots ,u_0\gamma ^{n'-1},u_1,\dots ,u_1\gamma ^{n'-1},\dots ,u_{\frac{h}{4}+2t+1},\dots ,u_{\frac{h}{4}+2t+1}\gamma ^{n'-1}), \end{aligned}$$

where \(u_0,u_1,\ldots ,u_{\frac{h}{4}+2t+1}\) are \(\frac{h}{4}+2t+2\) nonzero elements in \(\mathrm{GF}(q^2)\).

We will prove that there exist \(\frac{h}{4}+2t+2\) nonzero elements \(u_0,u_1,\dots ,u_{\frac{h}{4}+2t+1}\) in \(\mathrm{GF}(q^2)\) such that \(G = G_{k,k_1}({\varvec{a}},{\varvec{v}})\) has parameters above. In fact,

$$\begin{aligned} \begin{aligned} ({\varvec{a}}^{qj+l},{\varvec{v}}^{q+1})_E=\sum _{i=0}^{\frac{h}{4}+2t+1} \omega ^{i(qj+l)}u_i^{q+1}\sum _{r=0}^{n'-1} \gamma ^{r(qj+l+q+1)}. \end{aligned} \end{aligned}$$

Notice that the order of \(\gamma \) is \(n'\), then

$$\begin{aligned} \begin{aligned} \sum _{r=0}^{n'-1} \gamma ^{r\ell }={\left\{ \begin{array}{ll} 0 &{}\mathrm{~if~} n'\not \mid \ell ,\\ n'&{} \mathrm{~if~} n' \mid \ell . \end{array}\right. } \end{aligned} \end{aligned}$$

It follows that \(({\varvec{a}}^{qj+l},{\varvec{v}}^{q+1})_E=0\) except for \(n' \mid (qj+l+q+1)\). Now assume that \(0\le j,l\le k-1\) such that \(n'\mid (qj+l+q+1)\). From Lemma 5, if s is even and \(2\le s\le h\) , then \(j=\frac{s(q+1)}{h}-2,l=q-\frac{s(q+1)}{h}-1\); if s is odd and \(1\le s\le \frac{h}{2}-1\) ,then \(j=\frac{(s-1)(q+1)}{h}+\tau -1,l=\frac{q-3}{2}-\frac{(s-1)(q+1)}{h}-\tau \); if s is odd and \(\frac{h}{2}+1\le s\le h-1\), then \(j=\frac{(s-1)(q+1)}{h}+\tau -2,l=\frac{3q-3}{2}-\frac{(s-1)(q+1)}{h}-\tau \).

Hence, we will prove that \(({\varvec{a}}^{qj+l},{\varvec{v}}^{q+1})_E=0\) for \(j=\frac{s(q+1)}{h}-2\) and \(l=q-\frac{s(q+1)}{h}-1\), where s is even and \(\frac{h}{4}-2t\le s\le \frac{3h}{4}+2t\), which means \(\frac{h}{8}-t\le \frac{s}{2} \le \frac{3h}{8}+t\) and

$$\begin{aligned} \begin{aligned} ({\varvec{a}}^{qj+l},{\varvec{v}}^{q+1})_E=n'\sum _{i=0}^{\frac{h}{4}+2t+1} \omega ^{i[\frac{s(q^2-1)}{h}-q-1)]}u_i^{q+1}. \end{aligned} \end{aligned}$$

Let \(m=\frac{s}{2}-\frac{h}{2}\), It suffices to prove that the system of \(\frac{h}{4}+2t+1\) equations \(\sum _{i=0}^{\frac{h}{4}+2t+1} \omega ^{2i(m+\frac{h}{2})n'-i(q+1) }u_i^{q+1}=\sum _{i=0}^{\frac{h}{4}+2t+1} (\omega ^{2n'})^{im}(\omega ^{i(q-2)} u_i)^{q+1}=0\) for \(-\frac{h}{8}-t\le m \le \frac{h}{8}+t\) has a solution in \((\mathrm{GF}(q^2)^*)^{\frac{h}{4}+2t+2}\). Take \(y_i=(\omega ^{i(q-2)}u_i)^{(q+1)}\) for \(0\le i\le \frac{h}{4}+2t+1\), then \(y_i\in \mathrm{GF}(q)^*\). That is to say, it suffices to prove that the system of the equations

$$\begin{aligned} \begin{aligned} \begin{pmatrix} 1 &{} \beta ^{-\frac{h}{8}-t} &{} \cdots &{} \beta ^{(-\frac{h}{8}-t)\cdot (\frac{h}{4}+2t+1)}\\ \vdots &{} \vdots &{} \cdots &{} \vdots \\ 1 &{} 1 &{} \cdots &{} 1 \\ \vdots &{} \vdots &{} \cdots &{} \vdots \\ 1 &{} \beta ^{\frac{h}{8}+t} &{} \cdots &{} \beta ^{(\frac{h}{8}+t)\cdot (\frac{h}{4}+2t+1)} \\ \end{pmatrix} \begin{pmatrix} y_0 \\ y_1 \\ \vdots \\ y_{\frac{h}{4}+2t+1}\\ \end{pmatrix}=0 \end{aligned} \end{aligned}$$

has a solution in \((\mathrm{GF}(q)^*)^{\frac{h}{4}+2t+2}\), where \(\beta =\omega ^{2n'}\).

Notice that \(\mathrm{ord}(\beta )=\frac{h}{2}\), then \(\mathrm{ord}(\beta )\) divides \(q+1\). Hence, \(\beta ^{q+1}=\beta ^q\beta =1\), then \(\beta ^{-1}=\beta ^q\) and \(\beta ^{-1}+\beta \in \mathrm{GF}(q)^*\). Put \(f(x)=\prod _{m=-\frac{h}{8}-t}^{\frac{h}{8}+t}(x-\beta ^m)\), then \(f(x)\in \mathrm{GF}(q)[x]\) and \(f(x)\mid (x^\frac{h}{2}-1)\). Consider a q-ary cyclic code \({\mathcal {C}}\) of length \(\frac{h}{2}\) with generator polynomial f(x). It is easy to check that \({\mathcal {C}}\) is a \([\frac{h}{2},\frac{h}{4}-2t-1,\frac{h}{4}+2t+2]\) MDS code. Hence, all coefficients of \(f(x)=x^{\frac{h}{4}+2t+1}+a_{\frac{h}{4}+2t}x^{\frac{h}{4}+2t}+\cdots +a_0\) are all nonzero. That is, the last system has a solution

$$\begin{aligned} \begin{aligned} (y_0,\dots ,y_{\frac{h}{4}+2t},y_{\frac{h}{4}+2t+1})=(a_0,\dots ,a_{\frac{h}{4}+2t},1) \in (\mathrm{GF}(q)^*)^{\frac{h}{4}+2t+2}. \end{aligned} \end{aligned}$$

For each \(0\le i\le \frac{h}{4}+2t+1\), since \(a_i\in \mathrm{GF}(q)^*\), there exists \(b_i\in \mathrm{GF}(q^2)^*\) such that \(a_i=b_i^{(q+1)}\). Therefore, taking

$$\begin{aligned} \begin{aligned} {\varvec{u}}=(u_0,u_1,\dots ,u_{\frac{h}{4}+2t+1})=(b_0,\omega b_1,\dots ,\omega ^{\frac{h}{4}+2t+1}b_{\frac{h}{4}+2t+1},\omega ^{\frac{h}{4}+2t+1}), \end{aligned} \end{aligned}$$

we have \(({\varvec{a}}^{qj+l},{\varvec{v}}^{q+1})_E=0\) for \(j=\frac{s(q+1)}{h}-2\) and \(l=q-\frac{s(q+1)}{h}-1\), where s is even and \(\frac{h}{4}-2t\le s\le \frac{3h}{4}+2t\).

Let \(G = G_{k,k_1}({\varvec{a}},{\varvec{v}})=\begin{pmatrix} \varvec{g_{k_1}} \\ \varvec{g_{k_1+1}} \\ \vdots \\ \varvec{g_{k_1+k-1}}\end{pmatrix}\).

Then, \(GG^\dagger = \begin{pmatrix} \varvec{g_{k_1}g_{k_1}^\dag } &{} \varvec{g_{k_1}g_{k_1+1}^\dag } &{} \cdots &{} \varvec{g_{k_1}g_{k_1+k-1}^\dag } \\ \varvec{g_{k_1+1}g_{k_1}^\dag } &{} \varvec{g_{k_1+1}g_{k_1+1}^\dag } &{} \cdots &{} \varvec{g_{k_1+1}g_{k_1+k-1}^\dag } \\ \vdots &{} \vdots &{} \cdots &{} \vdots \\ \varvec{g_{k_1+k-1}g_{k_1}^\dag } &{} \varvec{g_{k_1+k-1}g_{k_1+1}^\dag } &{} \cdots &{} \varvec{g_{k_1+k-1}g_{k_1+k-1}^\dag } \\ \end{pmatrix}\).

In the first case: \(0\le t_1 \le t_2\le t\), let \(\frac{q-3}{4}-\tau -\frac{2t_1(q+1)}{h} \le k_1\le \frac{q+1}{4}-2-\frac{2t_1(q+1)}{h} \) and \(\frac{3q-1}{4}+\tau -1+\frac{2t_2(q+1)}{h} \le k_1+k-1\le \frac{3q-1}{4}-3+\frac{2(t_2+1)(q+1)}{h}\). Then the range of k satisfies \(\frac{q+3}{2}+\tau +\frac{2(t_1+t_2)(q+1)}{h}\le k \le \frac{q-3}{2}+\tau +\frac{2(t_1+t_2+1)(q+1)}{h}\). It is easy to prove that \(({\varvec{a}}^{qj+l},{\varvec{v}}^{q+1})_E \ne 0\) if and only if \(j=\frac{(s-1)(q+1)}{h}+\tau -1\) and \(l=\frac{q-3}{2}-\frac{(s-1)(q+1)}{h}-\tau \), where s is odd and \(\frac{h}{4}+1-2t_1\le s\le \frac{h}{4}-1+2t_1\); or \(j=\frac{(s-1)(q+1)}{h}+\tau -2,l=\frac{3q-3}{2}-\frac{(s-1)(q+1)}{h}-\tau \), where s is odd and \(\frac{3h}{4}-2t_2-1\le s\le \frac{3h}{4}+2t_2+1\). There are \(2t_1+2t_2+2\) pairs (jl) such that \(({\varvec{a}}^{qj+l},{\varvec{v}}^{q+1})_E \ne 0\).

Since \(\varvec{g_jg_l^\dag } = ({\varvec{a}}^{qj+l},{\varvec{v}}^{q+1})_E\), then \(\mathrm{dim}(\mathrm{Hull}_h(C))=k-\mathrm{rank}(GG^\dag )=k-2t_1-2t_2-2\).

In the second case: \(0\le t_1 \le t_2\le \frac{h}{8}-1-t\), let \(\frac{q-3}{4}-\tau -\frac{2(t+t_1)(q+1)}{h} \le k_1\le \frac{q+1}{4}-2-\frac{2(t+t_1)(q+1)}{h} \) and \(\frac{3q-1}{4}+\tau -1+\frac{2(t+t_2)(q+1)}{h} \le k_1+k-1\le \frac{3q-1}{4}-3+\frac{2(t+t_2+1)(q+1)}{h}\). Then the range of k satisfies \(\frac{q+3}{2}+\tau +\frac{2(2t+t_1+t_2)(q+1)}{h}\le k \le \frac{q-3}{2}+\tau +\frac{2(2t+t_1+t_2+1)(q+1)}{h}\). It is easy to prove that \(({\varvec{a}}^{qj+l},{\varvec{v}}^{q+1})_E \ne 0\) if and only if \(j=\frac{(s-1)(q+1)}{h}+\tau -1\) and \(l=\frac{q-3}{2}-\frac{(s-1)(q+1)}{h}-\tau \), where s is odd and \(\frac{h}{4}+1-2t-2t_1\le s\le \frac{h}{4}-1+2t+2t_1\); \(j=\frac{(s-1)(q+1)}{h}+\tau -2,l=\frac{3q-3}{2}-\frac{(s-1)(q+1)}{h}-\tau \), where s is odd and \(\frac{3h}{4}-2t-2t_2-1\le s\le \frac{3h}{4}+2t+2t_2+1\). or \(j=\frac{s(q+1)}{h}-2,l=q-\frac{s(q+1)}{h}-1\), where s is even and \( 0<|s-\frac{h}{2}|-\frac{h}{4}-2t\le 2t_1\); There are \(4t+4t_1+2t_2+2\) pairs (jl) such that \(({\varvec{a}}^{qj+l},{\varvec{v}}^{q+1})_E \ne 0\).

By \(\varvec{g_jg_l^\dag } = ({\varvec{a}}^{qj+l},{\varvec{v}}^{q+1})_E\), then \(\mathrm{dim}(\mathrm{Hull}_h(C))=k-\mathrm{rank}(GG^\dag )=k-4t-4t_1-2t_2-2\). \(\square \)

Similar to (2) of Lemma 6, when \(n=n'(\frac{h}{4}-2t),(0\le t\le \frac{h}{4}-1)\), we can get the following lemma.

Lemma 7

Let \(q\equiv 3\,(mod\, 4)\) and \( h, \tau ,n' \) be defined as above, and \(n=n'(\frac{h}{4}-2t)\), for \(0\le t\le \frac{h}{8}-1\). Then there exist some GRS codes with following parameters:

Let \(t_1,t_2,k\) be integers, where \(0\le t_1 \le t_2\le \frac{h}{8}-1\) and \(\frac{q+3}{2}+\tau +\frac{2(t_1+t_2)(q+1)}{h}\le k \le \frac{q-3}{2}+\tau +\frac{2(t_1+t_2+1)(q+1)}{h}\), the code C has parameters \([n,k,n-k+1]\), and \(Hull_h(C)\) has dimension \(k-2t-2t_1-2t_2-4\).

From Lemmas 6, 7 and Proposition 3, we can get the following theorem.

Theorem 2

Let \(q, n', h, \tau \) be defined as above and \(t,t_1,t_2,k\) be integers. Then, there exist \([[n,n-2k+c,k+1;c]]_q\) EAQMDS codes and \([[n,c,n-k+1;n-2k+c]]_q\) EAQECCs, if one of the following holds:

  1. (1)

    \(n=n'(\frac{h}{4}+2t+2)\), \(c=2t_1+2t_2+2\), \(\frac{q+3}{2}+\tau +\frac{2(t_1+t_2)(q+1)}{h}\le k \le \frac{q-3}{2}+\tau +\frac{2(t_1+t_2+1)(q+1)}{h}\), where \(0\le t_1 \le t_2\le t\le \frac{h}{8}-1\).

  2. (2)

    \(n=n'(\frac{h}{4}+2t+2)\), \(c=4t+4t_1+2t_2+2\), \(\frac{q+3}{2}+\tau +\frac{2(2t+t_1+t_2)(q+1)}{h}\le k \le \frac{q-3}{2}+\tau +\frac{2(2t+t_1+t_2+1)(q+1)}{h}\), where \(0\le t_1 \le t_2\le \frac{h}{8}-1-t\).

  3. (3)

    \(n=n'(\frac{h}{4}-2t)\), \(c=2t+4t_1+2t_2+4\), and \(\frac{q+3}{2}+\tau +\frac{2(t_1+t_2)(q+1)}{h}\le k \le \frac{q-3}{2}+\tau +\frac{2(t_1+t_2+1)(q+1)}{h}\), where \(0\le t \le \frac{h}{8}-1\) and \(0\le t_1 \le t_2\le \frac{h}{8}-1\).

Remark 2

Comparing Theorem 2 with Theorem 11 in [24], we find that most of the length is different and the range of k is disjoint for the same length. Comparing Theorem 2 with Corollary 3.4 of [22], we can conclude although some codes have the same parameters, there are still many codes with different parameters. Here is an example.

Example 2

Let \(q=59\) and \(h=24\), then \(\tau =2\). By Theorem 2, there exist \([[n,n-2k+c,k+1;c]]_q\) EAQMDS codes and \([[n,c,n-k+1;n-2k+c]]_q\) EAQECCs, where the values of nkc can be found in Table 2.

Table 2 The values of nkc in Example 2

After removing the same parameters as in Reference [22], we can get the codes in Table 3.

Table 3 The values of nkc in Example 2 after deleting the same parameters

In Theorem 2, the length of those codes is even times of \(n'\). And then we move on to the case where length is positive integer multiples of \(n'\).

Lemma 8

Let \(q\equiv 3\,(mod\,4)\) and \( h, \tau ,n' \) be defined as above, and \(n=tn'\), for \(1\le t\le h\). Then, there exist some GRS codes with following parameters:

Let \(t_1,t_2,k\) be integers, where \(0\le t_1 \le t_2\le \frac{h}{8}-1\) and \(\frac{q+3}{2}+\tau +\frac{2(t_1+t_2)(q+1)}{h}\le k \le \frac{q-3}{2}+\tau +\frac{2(t_1+t_2+1)(q+1)}{h}\), the code C has parameters \([n,k,n-k+1]\), and \(Hull_h(C)\) has dimension \(k-\frac{h}{4}-4t_1-2t_2-3\).

Proof

If \(q\equiv 3\,(mod\,4)\), then 8|h. Let \(\gamma ,\omega \) be defined as above. Set

$$\begin{aligned}&{\varvec{a}}=(1,\gamma ,\dots ,\gamma ^{n'-1},\omega ,\dots ,\omega \gamma ^{n'-1},\dots ,\omega ^{t-1},\dots ,\omega ^{t-1}\gamma ^{n'-1}),\\&{\varvec{v}}=(u_0,u_0\gamma ,\dots ,u_0\gamma ^{n'-1},u_1,\dots ,u_1\gamma ^{n'-1},\dots ,u_{t-1},\dots ,u_{t-1}\gamma ^{n'-1}). \end{aligned}$$

And then, we have

$$\begin{aligned} \begin{aligned} ({\varvec{a}}^{qj+l},{\varvec{v}}^{q+1})_E=\sum _{i=0}^{t-1} \omega ^{i(qj+l)}u_i^{q+1}\sum _{r=0}^{n'-1} \gamma ^{r(qj+l+q+1)}. \end{aligned} \end{aligned}$$

where \(u_0,u_1,\dots ,u_{t}\) are t nonzero elements in \(\mathrm{GF}(q^2)\) such that

$$\begin{aligned} \begin{aligned}\sum _{i=0}^{t-1} \omega ^{i(qj+l)}u_i^{q+1}\ne 0.\end{aligned} \end{aligned}$$

Notice that the order of \(\gamma \) is \(n'\), then

$$\begin{aligned} \begin{aligned} \sum _{r=0}^{n'-1} \gamma ^{r\ell }={\left\{ \begin{array}{ll} 0 &{}\quad \mathrm{if } n'\not \mid \ell ,\\ n'&{}\quad \mathrm{if } n' \mid \ell . \end{array}\right. } \end{aligned} \end{aligned}$$

It follows that \(({\varvec{a}}^{qj+l},{\varvec{v}}^{q+1})_E=0\) except for \(n' \mid (qj+l+q+1)\). Now assume that \(0\le j,l\le k-1\) such that \(n'\mid (qj+l+q+1)\). From Lemma 5, if s is even and \(2\le s\le h\) , then \(j=\frac{s(q+1)}{h}-2,l=q-\frac{s(q+1)}{h}-1\); if s is odd and \(1\le s\le \frac{h}{2}-1\) ,then \(j=\frac{(s-1)(q+1)}{h}+\tau -1,l=\frac{q-3}{2}-\frac{(s-1)(q+1)}{h}-\tau \); if s is odd and \(\frac{h}{2}+1\le s\le h-1\), then \(j=\frac{(s-1)(q+1)}{h}+\tau -2,l=\frac{3q-3}{2}-\frac{(s-1)(q+1)}{h}-\tau \).

Let \(0\le t_1 \le t_2\le \frac{h}{8}-1\), \(\frac{q-3}{4}-\tau -\frac{2t_1(q+1)}{h} \le k_1\le \frac{q+1}{4}-2-\frac{2t_1(q+1)}{h} \) and \(\frac{3q-1}{4}+\tau -1+\frac{2t_2(q+1)}{h} \le k_1+k-1\le \frac{3q-1}{4}-3+\frac{2(t_2+1)(q+1)}{h}\). Then the range of k satisfies \(\frac{q+3}{2}+\tau +\frac{2(t_1+t_2)(q+1)}{h}\le k \le \frac{q-3}{2}+\tau +\frac{2(t_1+t_2+1)(q+1)}{h}\). It is easy to prove that \(({\varvec{a}}^{qj+l},{\varvec{v}}^{q+1})_E \ne 0\) if and only if \(j=\frac{(s-1)(q+1)}{h}+\tau -1\) and \(l=\frac{q-3}{2}-\frac{(s-1)(q+1)}{h}-\tau \), where s is odd and \(\frac{h}{4}+1-2t_1\le s\le \frac{h}{4}-1+2t_1\); \(j=\frac{(s-1)(q+1)}{h}+\tau -2,l=\frac{3q-3}{2}-\frac{(s-1)(q+1)}{h}-\tau \), where s is odd and \(\frac{3h}{4}-2t_2-1\le s\le \frac{3h}{4}+2t_2+1\); or \(j=\frac{s(q+1)}{h}-2,l=q-\frac{s(q+1)}{h}-1\), where s is even and \(\frac{h}{4}-2t_1\le s \le \frac{3h}{4}+2t_1\); There are \(\frac{h}{4}+4t_1+2t_2+3\) pairs (jl) such that \(({\varvec{a}}^{qj+l},{\varvec{v}}^{q+1})_E \ne 0\).

Let \(G = G_{k,k_1}({\varvec{a}},{\varvec{v}})=\begin{pmatrix} \varvec{g_{k_1}} \\ \varvec{g_{k_1+1}} \\ \vdots \\ \varvec{g_{k_1+k-1}}\end{pmatrix}\).

By \(\varvec{g_jg_l^\dag } = ({\varvec{a}}^{qj+l},{\varvec{v}}^{q+1})_E\), then \(\mathrm{dim}(\mathrm{Hull}_h(C))=k-\mathrm{rank}(GG^\dag )=k-\frac{h}{4}-4t_1-2t_2-3\). \(\square \)

From Lemmas 8 and Proposition 3, we can get the following theorem.

Theorem 3

Let \(q, n', h, \tau \) be defined as above and \(t_1,t_2,k\) be integers. Then, there exist \([[n,n-2k+c,k+1;c]]_q\) EAQMDS codes and \([[n,c,n-k+1;n-2k+c]]_q\) EAQECCs, where \(n=tn'\), \(c=\frac{h}{4}+4t_1+2t_2+3\), and \(\frac{q+3}{2}+\tau +\frac{2(t_1+t_2)(q+1)}{h}\le k \le \frac{q-3}{2}+\tau +\frac{2(t_1+t_2+1)(q+1)}{h}\), \(1\le t\le h\), and \(0\le t_1 \le t_2\le \frac{h}{8}-1\).

Remark 3

Comparing Theorem 3 with Theorem 11 in [24], we find that most of the length is different and the range of k is disjoint for the same length. Comparing Theorem 3 with Corollary 3.4 of [22], we can conclude if t is odd, the length are different. This means that the EAQMDS codes constructed in Theorem 3 are new when t is odd.

Example 3

Let \(q=59\) and \(h=24\), then \(n'=145\), \(1\le t \le 24\), and \(\tau =2\). By Theorem 3, there exist \([[n,n-2k+c,k+1;c]]_q\) EAQMDS codes and \([[n,c,n-k+1;n-2k+c]]_q\) EAQECCs, where the values of nkc can be found in Table 4.

Table 4 The values of nkc in Example 3

4.2 The case \(q\equiv 1\,(mod\,4)\)

In this subsection, we consider the case that \(q\equiv 1\,(mod\,4)\). Similarly, using Lemma 5, we can obtain the GRS codes with the following parameters.

Lemma 9

Let \(q\equiv 1\,(mod\,4)\) and \( h, \tau ,n' \) be defined as above, and \(n=n'(\frac{h}{4}+2t+1),(0\le t\le \frac{h-4}{8})\). Then, there exist some GRS codes with following parameters:

  1. (1)

    Let \(t_1,t_2,k\) be integers, where \(0\le t_1 \le t_2\le t-1\) and \(\frac{q+1}{2} +\frac{2(t_1+t_2)(q+1)}{h}\le k \le \frac{q-3}{2}+\frac{2(t_1+t_2+2)(q+1)}{h}\), the code C has parameters \([n,k,n-k+1]\), and \(Hull_h(C)\) has dimension \(k-2t_1-2t_2-2\).

  2. (2)

    Let \(t_1,t_2,k\) be integers, where \(0\le t_1 \le t_2\le \frac{h-4}{8}-t\) and \( \frac{q+1}{2}+\frac{2(2t+t_1+t_2)(q+1)}{h}\le k \le \frac{q+1}{2}-3+\frac{2(2t+t_1+t_2+1)(q+1)}{h}\), the code C has parameters \([n,k,n-k+1]\), and \(Hull_h(C)\) has dimension \(k-4t-4t_1-2t_2-2\).

Proof

If \(q\equiv 1\,(mod\,4)\), then \(8|(h-4)\). Let \(\gamma ,\omega \) be defined as above. Set

$$\begin{aligned} \begin{aligned} {\varvec{a}}&=(1,\gamma ,\dots ,\gamma ^{n'-1},\omega ,\dots ,\omega \gamma ^{n'-1},\dots ,\omega ^{\frac{h}{4}+2t+1},\dots ,\omega ^{\frac{h}{4}+2t+1}\gamma ^{n'-1}),\\ {\varvec{v}}&=(u_0,u_0\gamma ,\dots ,u_0\gamma ^{n'-1},u_1,\dots ,u_1\gamma ^{n'-1},\dots ,u_{\frac{h}{4}+2t+1},\dots ,u_{\frac{h}{4}+2t+1}\gamma ^{n'-1}), \end{aligned} \end{aligned}$$

where \(u_0,u_1,\dots ,u_{\frac{h}{4}+2t+1}\) are \(\frac{h}{4}+2t+2\) nonzero elements in \(\mathrm{GF}(q^2)\).

From Lemma 5, we have \(({\varvec{a}}^{qj+l},{\varvec{v}}^{q+1})_E=0\) if and only if (jl) takes the following values:

If s is even and \(2\le s\le h\), then \(j=\frac{s(q+1)}{h}-2,l=q-\frac{s(q+1)}{h}-1\); if s is odd and \(1\le s\le \frac{h}{2}-1\), then \(j=\frac{(s-1)(q+1)}{h}+\tau -1,l=\frac{q-3}{2}-\frac{(s-1)(q+1)}{h}-\tau \); if s is odd and \(\frac{h}{2}+1\le s\le h-1\), then \(j=\frac{(s-1)(q+1)}{h}+\tau -2,l=\frac{3q-3}{2}-\frac{(s-1)(q+1)}{h}-\tau \).

Similar to Lemma 6, we can find \(\frac{h}{4}+2t+1\) nonzero elements \(u_0,u_1,\dots ,u_{\frac{h}{4}+2t+1}\) in \(\mathrm{GF}(q^2)\) such that \(({\varvec{a}}^{qj+l},{\varvec{v}}^{q+1})_E=0\) for \(j=\frac{s(q+1)}{h}-2\) and \(l=q-\frac{s(q+1)}{h}-1\), where s is even and \(\frac{h}{4}+1-2t\le s\le \frac{3h}{4}-1+2t\).

Let \(G = G_{k,k_1}({\varvec{a}},{\varvec{v}})=\begin{pmatrix} \varvec{g_{k_1}} \\ \varvec{g_{k_1+1}} \\ \vdots \\ \varvec{g_{k_1+k-1}}\end{pmatrix}\).

In the first case: \(0\le t_1 \le t_2\le t-1\), let \(\frac{(h-4)(q+1)}{4h}-\tau -1-\frac{2t_1(q+1)}{h} \le k_1\le \frac{(h-4)(q+1)}{4h}+\tau -1-\frac{2t_1(q+1)}{h} \) and \(\frac{(3h-4)(q+1)}{4h}+\tau -2+\frac{2t_2(q+1)}{h} \le k_1+k-1\le \frac{(3h-4)(q+1)}{4h}+\tau -3+\frac{2(t_2+1)(q+1)}{h} \). Then the range of k satisfies \(\frac{q+1}{2} +\frac{2(t_1+t_2)(q+1)}{h}\le k \le \frac{q-3}{2}+\frac{2(t_1+t_2+2)(q+1)}{h}\). It is easy to prove that \(({\varvec{a}}^{qj+l},{\varvec{v}}^{q+1})_E \ne 0\) if and only if \(j=\frac{(s-1)(q+1)}{h}+\tau -1\) and \(l=\frac{q-3}{2}-\frac{(s-1)(q+1)}{h}-\tau \), where s is odd and \(\frac{h}{4}-2t_1\le s\le \frac{h}{4}+ 2t_1\); or \(j=\frac{(s-1)(q+1)}{h}+\tau -2,l=\frac{3q-3}{2}-\frac{(s-1)(q+1)}{h}-\tau \), where s is odd and \(\frac{3h}{4}-2t_2\le s\le \frac{3h}{4}+ 2t_1\). There are \(2t_1+2t_2+2\) pairs (jl) such that \(({\varvec{a}}^{qj+l},{\varvec{v}}^{q+1})_E \ne 0\).

By \(\varvec{g_jg_l^\dag } = ({\varvec{a}}^{qj+l},{\varvec{v}}^{q+1})_E\), then \(\mathrm{dim}(\mathrm{Hull}_h(C))=k-\mathrm{rank}(GG^\dag )=k-2t_1-2t_2-2\).

In the second case: \(0\le t_1 \le t_2\le \frac{h-4}{8}-t\), let \(\frac{(h-4)(q+1)}{4h}-\frac{2(t+t_1)(q+1)}{h} \le k_1\le \frac{(h-4)(q+1)}{4h}+\tau -1-\frac{2(t+t_1)(q+1)}{h} \) and \(\frac{(3h-4)(q+1)}{4h}+\tau -2+\frac{2(t+t_2)(q+1)}{h} \le k_1+k-1\le \frac{(3h-4)(q+1)}{4h}-4+\frac{2(t+t_2+1)(q+1)}{h} \). Then the range of k satisfies \( \frac{q+1}{2}+\frac{2(2t+t_1+t_2)(q+1)}{h}\le k \le \frac{q+1}{2}-3+\frac{2(2t+t_1+t_2+1)(q+1)}{h}\). It is easy to prove that \(({\varvec{a}}^{qj+l},{\varvec{v}}^{q+1})_E \ne 0\) if and only if \(j=\frac{(s-1)(q+1)}{h}+\tau -1\) and \(l=\frac{q-3}{2}-\frac{(s-1)(q+1)}{h}-\tau \), where s is odd and \(\frac{h}{4}-2t-2t_1\le s\le \frac{h}{4}+2t+2t_1\); \(j=\frac{(s-1)(q+1)}{h}+\tau -2,l=\frac{3q-3}{2}-\frac{(s-1)(q+1)}{h}-\tau \), where s is odd and \(\frac{3h}{4}-2t-2t_2\le s\le \frac{3h}{4}+2t+2t_2\); or \(j=\frac{s(q+1)}{h}-2,l=q-\frac{s(q+1)}{h}-1\), where s is even and \( 0<|s-\frac{h}{2}|+1-\frac{h}{4}-2t\le 2t_1\); There are \(4t+4t_1+2t_2+2\) pairs (jl) such that \(({\varvec{a}}^{qj+l},{\varvec{v}}^{q+1})_E \ne 0\).

By \(\varvec{g_jg_l^\dag } = ({\varvec{a}}^{qj+l},{\varvec{v}}^{q+1})_E\), then \(\mathrm{dim}(\mathrm{Hull}_h(C))=k-\mathrm{rank}(GG^\dag )=k-4t-4t_1-2t_2-2\). \(\square \)

Similar to (2) of Lemma 9, when \(n=n'(\frac{h}{4}-2t),(0\le t\le \frac{h}{4}-1)\), we can get the following lemma.

Lemma 10

Let \(q\equiv 1\,(mod\,4)\) and \( h, \tau ,n' \) be defined as above, and \(n=n'(\frac{h}{4}-2t-1),(0\le t\le \frac{h-4}{8}-1)\). Then there exist some GRS codes with following parameters:

Let \(t_1,t_2,k\) be integers, where \(0\le t_1 \le t_2\le \frac{h-4}{8}\) and \(\frac{q+1}{2}+\frac{2(t_1+t_2)(q+1)}{h}\le k \le \frac{q+1}{2}-3 +\frac{2(t_1+t_2+1)(q+1)}{h}\), the code C has parameters \([n,k,n-k+1]\), and \(Hull_h(C)\) has dimension \(k-4t-4t_1-2t_2-4\).

From Lemmas 9, 10 and Proposition 3, we can get the following theorem.

Theorem 4

Let \(q, n', h, \tau \) be defined as above and \(t_1,t_2,k\) be an integer. Then, there exist \([[n,n-2k+c,k+1;c]]_q\) EAQMDS codes and \([[n,c,n-k+1;n-2k+c]]_q\) EAQECCs, if one of the following holds:

  1. (1)

    \(n=n'(\frac{h}{4}+2t+1)\), \(c=2t_1+2t_2+2\), \(\frac{q+1}{2} +\frac{2(t_1+t_2)(q+1)}{h}\le k \le \frac{q-3}{2}+\frac{2(t_1+t_2+2)(q+1)}{h}\), where \(0\le t_1 \le t_2\le t-1\le \frac{h-4}{8}-1\).

  2. (2)

    \(n=n'(\frac{h}{4}+2t+1)\), \(c=4t+4t_1+2t_2+2\), \( \frac{q+1}{2}+\frac{2(2t+t_1+t_2)(q+1)}{h}\le k \le \frac{q+1}{2}-3+\frac{2(2t+t_1+t_2+1)(q+1)}{h}\), where \(0\le t \le \frac{h-4}{8}\) and \(0\le t_1 \le t_2\le \frac{h-4}{8}-t\).

  3. (3)

    \(n=n'(\frac{h}{4}-2t-1)\), \(c=2t+4t_1+2t_2+4\), and \(\frac{q+1}{2}+\frac{2(t_1+t_2)(q+1)}{h}\le k \le \frac{q+1}{2}-3 +\frac{2(t_1+t_2+1)(q+1)}{h}\), where \(0\le t \le \frac{h-4}{8}-1\) and \(0\le t_1 \le t_2\le \frac{h-4}{8}\).

Remark 4

Comparing Theorem 4 with Theorem 11 of [24], we find that most of the length is different and the range of k is disjoint for the same length. Comparing Theorem 4 with Corollary 3.4 of [22], we can conclude although some codes have the same parameters, there are still many codes with different parameters. Here is an example.

Example 4

Let \(q=49\) and \(h=20\), then \(\tau =2\). By Theorem 4, there exist \([[n,n-2k+c,k+1;c]]_q\) EAQMDS codes and \([[n,c,n-k+1;n-2k+c]]_q\) EAQECCs, where the values of nkc can be found in Table 5.

Table 5 The values of nkc in Example 4

After removing the same parameters as in Reference [22], we can get the codes in Table 6.

Table 6 The values of nkc in Example 4 after deleting the same parameters

Lemma 11

Let \(q\equiv 1\,(mod\,4)\) and \( h, \tau ,n' \) be defined as above, and \(n=tn',(1\le t\le h)\). Then, there exist some GRS codes with following parameters:

Let \(t_1,t_2,k\) be integers, where \(0\le t_1 \le t_2\le \frac{h-4}{8}\) and \( \frac{q+1}{2}+\frac{2(t_1+t_2)(q+1)}{h}\le k \le \frac{q+1}{2}-3+\frac{2(t_1+t_2+1)(q+1)}{h}\), the code C has parameters \([n,k,n-k+1]\), and \(Hull_h(C)\) has dimension \(k-\frac{h}{4}-4t_1-2t_2-2\).

Proof

If \(q\equiv 1\,(mod\,4)\), then \(8|(h-4)\). Let \(\gamma ,\omega \) be defined as above. Set

$$\begin{aligned} \begin{aligned} {\varvec{a}}&=(1,\gamma ,\dots ,\gamma ^{n'-1},\omega ,\dots ,\omega \gamma ^{n'-1},\dots ,\omega ^{t-1},\dots ,\omega ^{t-1}\gamma ^{n'-1}),\\ {\varvec{v}}&=(u_0,u_0\gamma ,\dots ,u_0\gamma ^{n'-1},u_1,\dots ,u_1\gamma ^{n'-1},\dots ,u_{t-1},\dots ,u_{t-1}\gamma ^{n'-1}), \end{aligned} \end{aligned}$$

And then, we have

$$\begin{aligned} \begin{aligned} ({\varvec{a}}^{qj+l},{\varvec{v}}^{q+1})_E=\sum _{i=0}^{t-1} \omega ^{i(qj+l)}u_i^{q+1}\sum _{r=0}^{n'-1} \gamma ^{r(qj+l+q+1)}. \end{aligned} \end{aligned}$$

where \(u_0,u_1,\dots ,u_{t-1}\) are t nonzero elements in \(\mathrm{GF}(q^2)\) such that

$$\begin{aligned} \begin{aligned}\sum _{i=0}^{t-1} \omega ^{i(qj+l)}u_i^{q+1}\ne 0.\end{aligned} \end{aligned}$$

From Lemma 5, we have \(({\varvec{a}}^{qj+l},{\varvec{v}}^{q+1})_E=0\) if and only if (jl) takes the following values:

If s is even and \(2\le s\le h\), then \(j=\frac{s(q+1)}{h}-2,l=q-\frac{s(q+1)}{h}-1\); If s is odd and \(1\le s\le \frac{h}{2}-1\), then \(j=\frac{(s-1)(q+1)}{h}+\tau -1,l=\frac{q-3}{2}-\frac{(s-1)(q+1)}{h}-\tau \); If s is odd and \(\frac{h}{2}+1\le s\le h-1\), then \(j=\frac{(s-1)(q+1)}{h}+\tau -2,l=\frac{3q-3}{2}-\frac{(s-1)(q+1)}{h}-\tau \).

Let \(G = G_{k,k_1}({\varvec{a}},{\varvec{v}})=\begin{pmatrix} \varvec{g_{k_1}} \\ \varvec{g_{k_1+1}} \\ \vdots \\ \varvec{g_{k_1+k-1}}\end{pmatrix}\).

Let \(0\le t_1 \le t_2\le \frac{h-4}{8}\), \(\frac{(h-4)(q+1)}{4h}-\frac{2t_1(q+1)}{h} \le k_1\le \frac{(h-4)(q+1)}{4h}+\tau -1-\frac{2t_1(q+1)}{h} \) and \(\frac{(3h-4)(q+1)}{4h}+\tau -2+\frac{2t_2(q+1)}{h} \le k_1+k-1\le \frac{(3h-4)(q+1)}{4h}-4+\frac{2(t_2+1)(q+1)}{h} \). Then the range of k satisfies \( \frac{q+1}{2}+\frac{2(t_1+t_2)(q+1)}{h}\le k \le \frac{q+1}{2}-3+\frac{2(t_1+t_2+1)(q+1)}{h}\). It is easy to prove that \(({\varvec{a}}^{qj+l},{\varvec{v}}^{q+1})_E \ne 0\) if and only if \(j=\frac{(s-1)(q+1)}{h}+\tau -1\) and \(l=\frac{q-3}{2}-\frac{(s-1)(q+1)}{h}-\tau \), where s is odd and \(\frac{h}{4}-2t_1\le s\le \frac{h}{4}+2t_1\); \(j=\frac{(s-1)(q+1)}{h}+\tau -2,l=\frac{3q-3}{2}-\frac{(s-1)(q+1)}{h}-\tau \), where s is odd and \(\frac{3h}{4}-2t_2\le s\le \frac{3h}{4}+2t_2\); or \(j=\frac{s(q+1)}{h}-2,l=q-\frac{s(q+1)}{h}-1\), where s is even and \(\frac{h}{4}-2t_1\le s \le \frac{3h}{4}+2t_1\); There are \(\frac{h}{4}+4t_1+2t_2+2\) pairs (jl) such that \(({\varvec{a}}^{qj+l},{\varvec{v}}^{q+1})_E \ne 0\).

By \(\varvec{g_jg_l^\dag } = ({\varvec{a}}^{qj+l},{\varvec{v}}^{q+1})_E\), then \(\mathrm{dim}(\mathrm{Hull}_h(C))=k-\mathrm{rank}(GG^\dag )=k-\frac{h}{4}-4t_1-2t_2-2\).

\(\square \)

From Lemmas 11 and Proposition 3, we can get the following theorem.

Theorem 5

Let \(q, n', h, \tau \) be defined as above and \(t_1,t_2,k\) be integers. Then, there exist \([[n,n-2k+c,k+1;c]]_q\) EAQMDS codes and \([[n,c,n-k+1;n-2k+c]]_q\) EAQECCs, where \(n=tn'\), \(c=\frac{h}{4}+4t_1+2t_2+2\), and \( \frac{q+1}{2}+\frac{2(t_1+t_2)(q+1)}{h}\le k \le \frac{q+1}{2}-3+\frac{2(t_1+t_2+1)(q+1)}{h}\), \(1\le t\le h\), and \(0\le t_1 \le t_2\le \frac{h-4}{8}\).

Remark 5

Comparing Theorem 5 with Theorem 11 in [24], we find that most of the length is different and the range of k is disjoint for the same length. Comparing Theorem 5 with Corollary 3.4 of [22], we can conclude if t is odd, the length is different. That means that the EAQMDS codes constructed in Theorem 5 are new when t is odd.

Example 5

Let \(q=29\) and \(h=12\), then \(n'=70\), \(1\le t \le 12\), and \(\tau =2\). By Theorem 5, there exist \([[n,n-2k+c,k+1;c]]_q\) EAQMDS codes and \([[n,c,n-k+1;n-2k+c]]_q\) EAQECCs, where the values of nkc can be found in Table 7.

Table 7 The values of nkc in Example 5

5 The third construction

In this section, similar to the previous two sections, we will construct some new EAQECCs by extended GRS codes.

In the proofs of Lemmas 3, 4, 6, 7, 8, 9, 10 and 11, if the generator matrices of GRS code satisfy the condition in Lemma 1, we can construct the following extended GRS codes:

Lemma 12

Let \(q, h, \tau ,n' \) be defined as in Sect. 3, and \(n=n'(\frac{h}{4}+t),(1\le t\le \frac{h}{4})\). Then, there exist some extended GRS codes with following parameters:

  1. (1)

    Let \(t_0,k\) be integers, where \(0\le t_0 \le t-2(t\ge 2)\) and \(\frac{q-1}{2}+\tau +\frac{2t_0(q-1)}{h}< k \le \frac{q-1}{2}+\tau + \frac{2(t_0+1)(q-1)}{h}-1\), the code C has parameters \([n+1,k,n-k+2]\), and \(Hull_h(C)\) has dimension \(k-2t_0-3\).

  2. (2)

    Let \(t_0,k\) be integers, where \(0\le t_0 \le \frac{h}{4}-t\) and \(\frac{q-1}{2}+\tau +\frac{2(t+t_0-1)(q-1)}{h}< k \le \frac{q-1}{2}+2\tau + \frac{2(t_0+t-1)(q-1)}{h}-1 \), the code C has parameters \([n+1,k,n-k+2]\), and \(Hull_h(C)\) has dimension \(k-2t-3t_0-1\).

  3. (3)

    Let \(t_0,k\) be integers, where \(0\le t_0 \le \frac{h}{4}-t-1\) and \(\frac{q-1}{2}+2\tau +\frac{2(t+t_0-1)(q-1)}{h}< k \le \frac{q-1}{2}+\tau + \frac{2(t_0+t)(q-1)}{h}-1 \), the code C has parameters \([n+1,k,n-k+2]\), and \(Hull_h(C)\) has dimension \(k-2t-3t_0-2\).

Lemma 13

Let \(q, h, \tau ,n' \) be defined as in Sect. 3, and \(n=n'(\frac{h}{4}-t),(0\le t\le \frac{h}{4}-1)\). Then, there exist some extended GRS codes with following parameters:

  1. (1)

    Let \(t_0,k\) be integers, where \(0\le t_0 \le \frac{h}{4}-1\) and \(\frac{q-1}{2}+\tau +\frac{2t_0(q-1)}{h}< k \le \frac{q-1}{2}+2\tau + \frac{2(t_0+1)(q-1)}{h}-1 \), the code C has parameters \([n+1,k,n-k+2]\), and \(Hull_h(C)\) has dimension \(k-t-3t_0-4\).

  2. (2)

    Let \(t_0,k\) be integers, where \(0\le t_0 \le \frac{h}{4}-2\) and \(\frac{q-1}{2}+2\tau +\frac{2t_0(q-1)}{h}< k \le \frac{q-1}{2}+\tau + \frac{2(t_0+1)(q-1)}{h}-1 \), the code C has parameters \([n+1,k,n-k+2]\), and \(Hull_h(C)\) has dimension \(k-t-3t_0-5\).

Lemma 14

Let \(q\equiv 3\,(mod\,4)\) and \( h, \tau ,n' \) be defined as in Sect. 4.1, and \(n=n'(\frac{h}{4}+2t+2),(0\le t\le \frac{h}{8}-1)\). Then, there exist some extended GRS codes with following parameters:

  1. (1)

    Let \(t_1,t_2,k\) be integers, where \(0\le t_1 \le t_2\le t\) and \(\frac{q+3}{2}+\tau +\frac{2(t_1+t_2)(q+1)}{h}< k \le \frac{q-3}{2}+\tau +\frac{2(t_1+t_2+1)(q+1)}{h}\), the code C has parameters \([n+1,k,n-k+2]\), and \(Hull_h(C)\) has dimension \(k-2t_1-2t_2-3\).

  2. (2)

    Let \(t_1,t_2,k\) be integers, where \(0\le t_1 \le t_2\le \frac{h}{8}-1-t\) and \(\frac{q+3}{2}+\tau +\frac{2(2t+t_1+t_2)(q+1)}{h}< k \le \frac{q-3}{2}+\tau +\frac{2(2t+t_1+t_2+1)(q+1)}{h}\), the code C has parameters \([n+1,k,n-k+2]\), and \(Hull_h(C)\) has dimension \(k-4t-4t_1-2t_2-3\).

Lemma 15

Let \(q\equiv 3\,(mod\,4)\) and \( h, \tau ,n' \) be defined as in Sect. 4.1, and \(n=n'(\frac{h}{4}-2t),(0\le t\le \frac{h}{8}-1)\). Then, there exist some extended GRS codes with following parameters:

Let \(t_1,t_2,k\) be integers, where \(0\le t_1 \le t_2\le \frac{h}{8}-1\) and \(\frac{q+3}{2}+\tau +\frac{2(t_1+t_2)(q+1)}{h}< k \le \frac{q-3}{2}+\tau +\frac{2(t_1+t_2+1)(q+1)}{h}\), the code C has parameters \([n+1,k,n-k+2]\), and \(Hull_h(C)\) has dimension \(k-2t-2t_1-2t_2-5\).

Lemma 16

Let \(q\equiv 3\,(mod\,4)\) and \( h, \tau ,n' \) be defined as in Sect. 4.1, and \(n=tn'\), for \(1\le t\le h\). Then, there exist some extended GRS codes with following parameters:

Let \(t_1,t_2,k\) be integers, where \(0\le t_1 \le t_2\le \frac{h}{8}-1\) and \(\frac{q+3}{2}+\tau +\frac{2(t_1+t_2)(q+1)}{h} < k \le \frac{q-3}{2}+\tau +\frac{2(t_1+t_2+1)(q+1)}{h}\), the code C has parameters \([n,k,n-k+1]\), and \(Hull_h(C)\) has dimension \(k-\frac{h}{4}-4t_1-2t_2-4\).

Lemma 17

Let \(q\equiv 1\,(mod\,4)\) and \( h, \tau ,n' \) be defined as in Sect. 4.2, and \(n=n'(\frac{h}{4}+2t+1),(0\le t\le \frac{h-4}{8})\). Then, there exist some extended GRS codes with following parameters:

  1. (1)

    Let \(t_1,t_2,k\) be integers, where \(0\le t_1 \le t_2\le t-1\) and \(\frac{q+1}{2} +\frac{2(t_1+t_2)(q+1)}{h}< k \le \frac{q-3}{2}+\frac{2(t_1+t_2+2)(q+1)}{h}\), the code C has parameters \([n+1,k,n-k+2]\), and \(Hull_h(C)\) has dimension \(k-2t_1-2t_2-3\).

  2. (2)

    Let \(t_1,t_2,k\) be integers, where \(0\le t_1 \le t_2\le \frac{h-4}{8}-t\) and \(\frac{q+1}{2}+\frac{2(2t+t_1+t_2)(q+1)}{h} < k \le \frac{q+1}{2}-3 +\frac{2(2t+t_1+t_2+1)(q+1)}{h}\), the code C has parameters \([n+1,k,n-k+2]\), and \(Hull_h(C)\) has dimension \(k-4t-4t_1-2t_2-3\).

Lemma 18

Let \(q\equiv 1\,(mod\,4)\) and \( h, \tau ,n' \) be defined as in Sect. 4.2, and \(n=n'(\frac{h}{4}-2t-1),(0\le t\le \frac{h-4}{8})\). Then, there exist some extended GRS codes with following parameters:

Let \(t_1,t_2,k\) be integers, where \(0\le t_1 \le t_2\le \frac{h-4}{8}\) and \(\frac{q+1}{2}+\frac{2(t_1+t_2)(q+1)}{h}< k \le \frac{q+1}{2} +\frac{2(t_1+t_2+1)(q+1)}{h}\), the code C has parameters \([n+1,k,n-k+2]\), and \(Hull_h(C)\) has dimension \(k-4t-4t_1-2t_2-5\).

Lemma 19

Let \(q\equiv 1\,(mod\,4)\) and \( h, \tau ,n' \) be defined as in Sect. 4.2, and \(n=tn',(1\le t\le h)\). Then, there exist some extended GRS codes with following parameters:

Let \(t_1,t_2,k\) be integers, where \(0\le t_1 \le t_2\le \frac{h-4}{8}\) and \( \frac{q+1}{2}+\frac{2(t_1+t_2)(q+1)}{h}< k \le \frac{q+1}{2}-3+\frac{2(t_1+t_2+1)(q+1)}{h}\), the code C has parameters \([n,k,n-k+1]\), and \(Hull_h(C)\) has dimension \(k-\frac{h}{4}-4t_1-2t_2-3\).

From Lemmas 12, 13, 14, 15, 16, 17, 18, 19 and Proposition 3, we can get the following theorems.

Theorem 6

Let \(q, n', h, \tau \) be defined as in Sect. 3 and k be an integer. Then, there exist \([[n+1,n-2k+c+2,k+1;c+1]]_q\) EAQMDS codes and \([[n+1,c+1,n-k+2;n-2k+c+2]]_q\) EAQECCs, if one of the following holds:

  1. (1)

    \(n=n'(\frac{h}{4}+t)\), \(c=2t_0+2\),and \(\frac{q-1}{2}+\tau +\frac{2t_0(q-1)}{h}< k \le \frac{q-1}{2}+\tau + \frac{2(t_0+1)(q-1)}{h}-1\), where \(2\le t \le \frac{h}{4}\) and \(0\le t_0 \le t-2\).

  2. (2)

    \(n=n'(\frac{h}{4}+t)\), \(c=2t+3t_0\), and \(\frac{q-1}{2}+\tau +\frac{2(t+t_0-1)(q-1)}{h}< k \le \frac{q-1}{2}+2\tau + \frac{2(t_0+t-1)(q-1)}{h}-1 \), where \(1\le t \le \frac{h}{4}\) and \(0\le t_0 \le \frac{h}{4}-t\).

  3. (3)

    \(n=n'(\frac{h}{4}+t)\), \(c=2t+3t_0+1\), \(\frac{q-1}{2}+2\tau +\frac{2(t+t_0-1)(q-1)}{h}< k \le \frac{q-1}{2}+\tau + \frac{2(t_0+t)(q-1)}{h}-1 \), where \(1\le t \le \frac{h}{4}\) and \(0\le t_0 \le \frac{h}{4}-t-1\).

  4. (4)

    \(n=n'(\frac{h}{4}-t)\), \(c=t+3t_0+3\), and \(\frac{q-1}{2}+\tau +\frac{2t_0(q-1)}{h}< k \le \frac{q-1}{2}+2\tau + \frac{2(t_0+1)(q-1)}{h}-1 \), where \(0\le t \le \frac{h}{4}-1\) and \(0\le t_0 \le \frac{h}{4}-1\).

  5. (5)

    \(n=n'(\frac{h}{4}-t)\), \(c=t+3t_0+4\) and \(\frac{q-1}{2}+2\tau +\frac{2t_0(q-1)}{h}< k \le \frac{q-1}{2}+\tau + \frac{2(t_0+1)(q-1)}{h}-1 \), where \(0\le t \le \frac{h}{4}-1\) and \(0\le t_0 \le \frac{h}{4}-2\).

Theorem 7

Let \(q, n', h, \tau \) be defined as in Sect. 4.1 and \(t_1,t_2,k\) be an integer. Then, there exist \([[n+1,n-2k+c+2,k+1;c+1]]_q\) EAQMDS codes and \([[n+1,c+1,n-k+2;n-2k+c+2]]_q\) EAQECCs, if one of the following holds:

  1. (1)

    \(n=n'(\frac{h}{4}+2t+2)\), \(c=2t_1+2t_2+2\), \(\frac{q+3}{2}+\tau +\frac{2(t_1+t_2)(q+1)}{h}< k \le \frac{q-3}{2}+\tau +\frac{2(t_1+t_2+1)(q+1)}{h}\), where \(0\le t_1 \le t_2\le t\le \frac{h}{8}-1\).

  2. (2)

    \(n=n'(\frac{h}{4}+2t+2)\), \(c=4t+4t_1+2t_2+2\), \(\frac{q+3}{2}+\tau +\frac{2(2t+t_1+t_2)(q+1)}{h}< k \le \frac{q-3}{2}+\tau +\frac{2(2t+t_1+t_2+1)(q+1)}{h}\), where \(0\le t_1 \le t_2\le \frac{h}{8}-1-t\).

  3. (3)

    \(n=n'(\frac{h}{4}-2t)\), \(c=2t+4t_1+2t_2+4\), and \(\frac{q+3}{2}+\tau +\frac{2(t_1+t_2)(q+1)}{h}< k \le \frac{q-3}{2}+\tau +\frac{2(t_1+t_2+1)(q+1)}{h}\), where \(0\le t \le \frac{h}{8}-1\) and \(0\le t_1 \le t_2\le \frac{h}{8}-1\).

Theorem 8

Let \(q, n', h, \tau \) be defined as in Sect. 4.1 and \(t_1,t_2,k\) be integers. Then, there exist \([[n+1,n-2k+c+2,k+1;c+1]]_q\) EAQMDS codes and \([[n+1,c+1,n-k+2;n-2k+c+2]]_q\) EAQECCs, where \(n=tn'\), \(c=\frac{h}{4}+4t_1+2t_2+3\), and \(\frac{q+3}{2}+\tau +\frac{2(t_1+t_2)(q+1)}{h}< k \le \frac{q-3}{2}+\tau +\frac{2(t_1+t_2+1)(q+1)}{h}\), \(1\le t\le h\), and \(0\le t_1 \le t_2\le \frac{h}{8}-1\).

Theorem 9

Let \(q, n', h, \tau \) be defined as in Sect. 4.2 and \(t_1,t_2,k\) be an integer. Then, there exist \([[n+1,n-2k+c+2,k+1;c+1]]_q\) EAQMDS codes and \([[n+1,c+1,n-k+2;n-2k+c+2]]_q\) EAQECCs, if one of the following holds:

  1. (1)

    \(n=n'(\frac{h}{4}+2t+1)\), \(c=2t_1+2t_2+2\), \(\frac{q+1}{2} +\frac{2(t_1+t_2)(q+1)}{h}< k \le \frac{q-3}{2}+\frac{2(t_1+t_2+1)(q+1)}{h}\), where \(0\le t_1 \le t_2\le t\le \frac{h-4}{8}\).

  2. (2)

    \(n=n'(\frac{h}{4}+2t+1)\), \(c=4t+4t_1+2t_2+2\), \(\frac{q+1}{2}+\frac{2(2t+t_1+t_2)(q+1)}{h}< k \le \frac{q+1}{2}-3 +\frac{2(2t+t_1+t_2+1)(q+1)}{h}\), where \(0\le t_1 \le t_2\le \frac{h-4}{8}-t\).

  3. (3)

    \(n=n'(\frac{h}{4}-2t-1)\), \(c=2t+4t_1+2t_2+4\), \(\frac{q+1}{2}+\frac{2(t_1+t_2)(q+1)}{h}< k \le \frac{q+1}{2}-3 +\frac{2(t_1+t_2+1)(q+1)}{h}\), where \(0\le t \le \frac{h-4}{8}\) and \(0\le t_1 \le t_2\le \frac{h-4}{8}\).

Theorem 10

Let \(q, n', h, \tau \) be defined as in Sect. 4.2 and \(t_1,t_2,k\) be integers. Then, there exist \([[n+1,n-2k+c+2,k+1;c+1]]_q\) EAQMDS codes and \([[n+1,c+1,n-k+2;n-2k+c+2]]_q\) EAQECCs, where \(n=tn'\), \(c=\frac{h}{4}+4t_1+2t_2+2\), and \( \frac{q+1}{2}+\frac{2(t_1+t_2)(q+1)}{h}< k \le \frac{q+1}{2}-3+\frac{2(t_1+t_2+1)(q+1)}{h}\), \(1\le t\le h\), and \(0\le t_1 \le t_2\le \frac{h-4}{8}\).

Remark 6

Similar to Remark 1, 2, 3, 4 and 5, we can see that most of EAQMDS codes constructed in Theorem 6, 7, 8, 9 and 10 are new.

Table 8 Quantum MDS codes with length \(\frac{a(q^2-1)}{b}\) and \(\frac{a(q^2-1)}{b}+1\)

6 Conclusions

In this paper, we constructed some classes of EAQMDS codes and EAQECCs and evaluated the dimensions of their Hermitian hulls. According to the entanglement-assisted quantum singleton bound, the resulting EAQMDS codes are optimal. In Table 8 we summarize the parameters of all precious quantum MDS codes with length \(\frac{a(q^2-1)}{b}\) and \(\frac{a(q^2-1)}{b}+1\) (where \(b|(q^2-1)\) and a is a positive integer). From the tables, we can easily see most of these q-ary EAQMDS codes are new in the sense that their parameters are not covered by the codes available in the literature. GRS code is a powerful tool for constructing EAQMDS codes. In the future work, we look forward to getting more EAQMDS codes with large minimum distance from GRS codes.