1 Introduction

Quantum error correcting codes (QECCs) can safeguard quantum information from unwanted noise. As pioneer discovery in the area of quantum error correction theory, entanglement-assisted stabilizer formalism was developed to construct QECCs with the help of pre-shared entanglement between the sender and the receiver. It was proposed by Brun et al. in [1], and includes the standard stabilizer formalism as a special case. It has been proven that the construction of quantum codes can be derived from arbitrary classical linear error-correcting codes without certain dual-containing properties, which greatly simplifies their construction and leads to a more general framework for construction of quantum codes. Currently, many researchers focused on studying the construction of EAQECCs and many new and good-performing codes have been found (see [4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24]).

Let q be a prime power. An [[n, k, d;c]]q EAQECC that encodes k information qubits into n channel qubits with the help of c pairs of maximally-entangled ebits can correct up to \(\left \lfloor \frac {d-1}{2}\right \rfloor \) errors, where d is the minimum distance of the code. If c = 0, then it is called a standard [[n, k, d]]q quantum code.

Similar to the quantum Singleton bound of standard quantum codes, we have the following more general EA-quantum Singleton bound.

Lemma 1

(EA-quantum Singleton bound [1,2,3]) An EAQECC [[n, k, d; c]]q satisfies n + ck ≥ 2(d − 1) if\(d \leq \frac {n+2}{2}\), where 0 ≤ cn − 1. Particularly, if c = 0, then nk ≥ 2(d − 1). An [[n, k, d; c]]qEAQECC achieving n + ck = 2(d − 1) is called an EAQMDS code, an EAQMDS code with c = 0 is a standard QMDS code.

Just like QMDS codes, EAQMDS codes is also of significantly theoretical interest, since EAQMDS codes can achieve the entanglement-assisted quantum Singleton bound. The search for best-performing codes has been an ongoing endeavor. In the past few years, a large number of EAQMDS codes also have been constructed by employing GRS codes and constacyclic MDS codes in [8,9,10,11, 13,14,15,16,17,18,19,20,21,22,23,24]. Up to now, GRS and extended GRS codes are the most important classes of MDS codes, and many new results on EAQMDS codes have been published based on them. In [8], Fan et al. proposed several constructions of q-ary EAQMDS codes based on classical constacyclic codes and Reed-Solomon(for short RS) codes. Since Guenda et al. [11] established a link between the number of maximally shared qubits required to construct an EAQECC and the hull of the classical code, construction of EAQMDS codes based on the dimension of the Euclidean and Hermitian hull of GRS codes has been a hot issue. In [20], Luo and Cao studied the hull of GRS and extended GRS codes over finite fields with respect to the Euclidean inner product and constructed several new infinite families of EAQMDS codes. In [23] , Fang and Fu et al. completely determined all possible parameters for q-ary EAQMDS codes of length nq and also obtained several new classes of q-ary EAQMDS codes of length n > q via GRS and extended GRS codes. Meanwhile, Li and Zhu et al. [9] constructed two classes of EAQMDS codes by using GRS codes. Enlightened by the work of [9] and [24], we construct several classes of q-ary EAQMDS codes with flexible parameters.

The remainder of this paper is organized as follows. In Section 2, we present the fundamentals which are needed in the rest of the paper. In Section 3, several classes of EAQMDS codes are derived from GRS codes. In Section 4, we conclude the paper.

2 Preliminaries

Firstly, we recall some definitions and basic theory of GRS codes and EAQECCs.

Let q be a prime power and \(\mathbb {F}_{q^{2}}\) be the finite field with q2 elements. Let \(\mathbb {F}_{q^{2}}^{\ast }\) denote the multiplicative group of nonzero elements of \(\mathbb {F}_{q^{2}}\). For any \(\alpha \in \mathbb {F}^{*}_{q^{2}}\), the conjugation of α is denoted by \(\overline {\alpha }=\alpha ^{q}\). Let \(\mathbb {F}_{q^{2}}^{n}\) be the \(\mathbb {F}_{q^{2}}\) vector space of n-tuples. A linear code \(\mathcal {C}\) of length n is an \(\mathbb {F}_{q^{2}}\) subspace of \(\mathbb {F}_{q^{2}}^{n}\). A linear code of length n over \(\mathbb {F}_{q^{2}}\) is called an \([n,k,d]_{q^{2}}\) code if its dimension is k and minimum Hamming distance is d.

Let x = {x1, x2,…, xn}, \(\mathbf {y}=\{y_{1},y_{2},\ldots ,y_{n}\}\in \mathbb {F}_{q^{2}}^{n}\), the Euclidean and Hermitian dual code of \(\mathcal {C}\) are defined as

$$\mathcal{C}^{\perp}=\left\{\mathbf{x} \mid \mathbf{x} \in \mathbb{F}_{q^{2}}^{n},\left\langle\mathbf{x},\mathbf{y}\right\rangle_{E}= x_{1}y_{1}+x_{2}y_{2}+\cdots+x_{n}y_{n}=0, \text{ for all } \mathbf{y} \in\mathcal{C} \right\}.$$

and

$$\mathcal{C}^{\perp H}=\left\{\mathbf{x} \mid \mathbf{x} \in \mathbb{F}_{q^{2}}^{n}, \left\langle\mathbf{x},\mathbf{y}\right\rangle_{H}=x_{1}\overline{y_{1}}+x_{2}\overline{y_{2}}+ \cdots+x_{n}\overline{y_{n}}=0, \text{ for all }\mathbf{y} \in\mathcal{C} \right\}.$$

If \(\mathcal {C}^{\perp } \subseteq \mathcal {C}\) (\(\mathcal {C}^{\perp H} \subseteq \mathcal {C}\)), then \(\mathcal {C}\) is called a (Hermitian) dual-containing code and \(\mathcal {C}^{\perp }(\mathcal {C}^{\perp H})\) is called a self-orthogonal code.

The GRS codes are defined as follows.

For a positive integer k, let

$$ \mathbb{F}_{q^{2}}[x]_{k}=\left\{f(x) \in \mathbb{F}_{q^{2}}[x] | \operatorname{deg}(f(x)) \leq k-1\right\} $$

be an \(\mathbb {F}_{q^{2}}\)-linear space of dimension k. Let \(\mathbf {a}=\left (\alpha _{1}, \alpha _{2}, \ldots , \alpha _{n}\right )\) with α1, α2,…, αn distinct elements, \(\mathbf {v}=\left (v_{1}, v_{2}, \ldots , v_{n}\right ) \in (\mathbb {F}_{q^{2}}^{\ast })^{n},\) and \(k \leq n\left (\leq q^{2}\right )\). Therefore, we have the generalized Reed-Solomon code

$$GRS_{k}(\mathbf{a}, \mathbf{v})=\left\{\left( v_{1} f\left( \alpha_{1}\right), v_{2} f\left( \alpha_{2}\right), \ldots, v_{n} f\left( \alpha_{n}\right)\right) | \text { for all } f(x) \in \mathbb{F}_{q^{2}}[x]_{k}\right\}.$$

It is known that the GRS code is an [n, k, nk + 1] linear MDS code over \(\mathbb {F}_{q^{2}} \). A generator matrix of GRSk(a, v) is presented by

$$G=\left( \begin{array}{cccc}{v_{1} } & {v_{2} } & {\dots} & {v_{n} } \\ {v_{1} \alpha_{1}} & {v_{2} \alpha_{2}} & {\dots} & {v_{n} \alpha_{n}} \\ {\vdots} & {\vdots} & {\ddots} & {\vdots} \\ {v_{1} \alpha_{1}^{k-1}} & {v_{2} \alpha_{2}^{k-1}} & {\dots} & {v_{n} \alpha_{n}^{k-1}} \end{array}\right).$$

In [5], Wilde and Brun proved that EAQECCs can be constructed using classical linear codes with respect to the Hermitian case as follows.

Theorem 1

[5] If \(\mathcal {C}\)is an\([n, k, d]_{q^{2}}\)classical code over\(\mathbb {F}_{q^{2}}\)with parity check matrix H, then there exists an EAQECC with parameters [[n, 2kn + c, d; c]]q, where\(c=\operatorname {rank}\left (H H^{\dagger }\right )\)is the number of maximally entangled states required and His the conjugate transpose of H over\(\mathbb {F}_{q^{2}}\).

3 New EAQMDS Codes

We devote this section to derive several classes of entanglement-assisted quantum MDS codes from generalized Reed-Solomon codes over \(\mathbb {F}_{q^{2}}\). As we all know, the dual of a GRS code is also a GRS code. Hence we just need to consider k-dimensional codes of length n with 1 ≤ k ≤⌊n/2⌋. We also always assume that ω is a primitive element of \(\mathbb {F}_{q^{2}}\), that is \(\mathbb {F}_{q^{2}}^{*}=\langle \omega \rangle \). Then we present our contributions in the following.

3.1 Length \(n=1+\frac {q-1}{h}(q+1)\), q is Even

In this subsection, we always assume that q = hm + 1, h ≥ 1 is an integer, \(n=1+\frac {q^{2}-1}{h}\). Set α1 = ωq+ 1, α2 = ωq− 1, then ord(α1) = q − 1, ord(α2) = q + 1. Moreover, let \(\theta ={\alpha _{1}^{h}}\), then ord\((\theta )=\frac {q-1}{h}\). Thus gcd(ord(θ), ord(α2))= 1. Hence, \(\langle \theta \rangle , \alpha _{2}\langle \theta \rangle , \cdots , {\alpha _{2}^{q}}\langle \theta \rangle \) are distinct cosets in the multiplicative group \(\mathbb {F}_{q^{2}}^{*}\). Assume

$$ \begin{array}{@{}rcl@{}} \mathbf{a}_{s}&=&\left( 0,{\alpha_{2}^{0}}(w^{s}, w^{s} \theta, \cdots, w^{s} \theta^{\frac{q-1}{h}-1}), {\alpha_{2}^{1}}(w^{s}, w^{s} \theta, \cdots, w^{s} \theta^{\frac{q-1}{h}-1}),\right.\\ &&\quad\left. \cdots, {\alpha_{2}^{q}}(w^{s},{w^{s} \theta, \cdots, w^{s} \theta^{\frac{q-1}{h}-1})}\right)\in \mathbb{F}_{q^{2}}^{n},\\ \mathbf{u}&=&\left( 1, \omega^{-ch}, \cdots, \omega^{-c(\frac{q-1}{h}-1)h}\right),\\ \mathbf{v}&=&(1,\underbrace{\mathbf{u},\mathbf{u}, \cdots, \mathbf{u}}_ {(q+1) \text { times }})\in (\mathbb{F}_{q^{2}}^{\ast})^{n}. \end{array} $$

For any 0 ≤ i, jn − 1, we have

$$ \begin{array}{@{}rcl@{}} \left\langle\mathbf{a}_{s}^{q i+j}, \mathbf{v}^{q+1}\right\rangle_{E} &=& \omega^{s(qi+j)}\sum\limits_{t=0}^{\frac{q-1}{h}-1} \theta^{t(q i+j)} \omega^{-ch(q+1)t} \sum\limits_{v=0}^{q} \alpha_{2}^{v(q i+j)}\\ &=& \omega^{s(qi+j)}\sum\limits_{t=0}^{\frac{q-1}{h}-1} \theta^{t(q i+j-c)} \sum\limits_{v=0}^{q} \alpha_{2}^{v(q i+j)}. \end{array} $$

Thus

$$\left\langle\mathbf{a}_{s}^{q i+j}, \mathbf{v}^{q+1}\right\rangle_{E}= \left\{\begin{array}{l}{0, \quad \quad \quad \quad ~\frac{q-1}{h} \nmid q i+j-c},\\ {\omega^{s(qi+j)}n,\quad \frac{q-1}{h} | q i+j-c, q+1 | q i+j}. \end{array}\right.$$

Then \(\left \langle \mathbf {a}_{s}^{q i+j}, \mathbf {v}^{q+1}\right \rangle _{E} \neq 0\) if and only if

$$ \left \{\begin{array}{l}{qi+j\equiv c, \quad \text { mod } ~\frac{q-1}{h}},\\ {qi+j \equiv 0,\quad \text { mod }~ q+1}. \end{array}\right. $$

According to [24], the system has a solution

$$qi+j\equiv \frac{1}{2}(\frac{q-1}{h}+1)(q+1)c ~(\bmod ~n).$$

Hence, \(\left \langle \mathbf {a}_{s}^{q i+j}, \mathbf {v}^{q+1}\right \rangle _{E} \neq 0\) if and only if \(\frac {q^{2}-1}{h} | q i+j-\frac {1}{2}(\frac {q-1}{h}+1)(q+1)c\).

We firstly present the following result.

Lemma 2

[24] Suppose the notationsas, vbe given as above. Let q = hm + 1 be a prime power and h ≥ 1 be an integer. Assume c is some integer such that 1 ≤ ch + 1.

  1. (1)

    If c is some integer such that\( c=l\frac {q-1}{h}, l=1,2,\cdots \). Suppose\((c-1)\frac {q-1}{h}+1\leq k\leq c\frac {q-1}{h}\), then for any 0 ≤ i, jk − 1, \(\left \langle \mathbf {a}_{s}^{q i+j}, \mathbf {v}^{q+1} \right \rangle _{E}\neq 0\)if and only if\((i,j)=(\frac {1}{2}(\frac {q-1}{h}+1)c+r\frac {q-1}{h}, \frac {1}{2}(\frac {q-1}{h}+1)c+r\frac {q-1}{h}), r\in [-\frac {1}{2}(\frac {q-1}{h}+1)l, c-[\frac {1}{2}(\frac {q-1}{h}+1)l+1]]\).

  2. (2)

    If c is some integer such that\(1+l\frac {q-1}{h}\leq c<(l+1)\frac {q-1}{h}, l=0,1,\cdots \). Suppose\(\frac {1}{2}(\frac {q-1}{h}+1)c+\left \lceil \frac {c-l-2}{2}\right \rceil \frac {q-1}{h}+1\leq k\leq \frac {1}{2}(\frac {q-1}{h}+1)c+\left \lceil \frac {c-l}{2}\right \rceil \frac {q-1}{h}\), then for any 0 ≤ i, jk − 1, \(\left \langle \mathbf {a}_{s}^{q i+j}, \mathbf {v}^{q+1} \right \rangle _{E}\neq 0\)if and only if\( (i,j)= (\frac {1}{2}(\frac {q-1}{h}+1)c+r\frac {q-1}{h}, \frac {1}{2}(\frac {q-1}{h}+1)c+r\frac {q-1}{h}), r\in [-\left \lceil \frac {c+l-1}{2}\right \rceil , \left \lceil \frac {c-l-2}{2}\right \rceil ]\).

Next we will obtain below result in the light of the previous lemma.

Theorem 2

Let q = hm + 1 be a prime power with h ≥ 1 an integer. Set\(n =1+\frac {q^{2}-1}{h}\). Assume c be some integer such that 1 ≤ ch + 1, then

  1. (1)

    For any\( c=l\frac {q-1}{h}, l=1,2,\cdots \), there exist EAQMDS codes with parameters [[n, n − 2k + c, k + 1; c]]q, where\((c-1)\frac {q-1}{h}+1\leq k\leq c\frac {q-1}{h}\).

  2. (2)

    For any\(1+l\frac {q-1}{h}\leq c<(l+1)\frac {q-1}{h}, l=0,1,\cdots \), there exist EAQMDS codes with parameters [[n, n − 2k + c, k + 1; c]]q, where\(\frac {1}{2}(\frac {q-1}{h}+1)c+\left \lceil \frac {c-l-2}{2}\right \rceil \frac {q-1}{h}+1\leq k\leq \frac {1}{2}(\frac {q-1}{h}+1)c+\left \lceil \frac {c-l}{2}\right \rceil \frac {q-1}{h}\).

Proof

Suppose the notations as, v be given as above, let GRSk(as, v) be a classical \([n,k,d]_{q^{2}}\) code with generator matrix Gs = AsV, where

$$ {A}_{s}=\left( \begin{array}{cccccccc}{1} & {1} & {1} & {\cdots} & {1} & {1} & {\cdots} & {1} \\ {0} &{w^{s}} & { w^{s}\theta} & {\cdots} & {w^{s}\theta^{m-1} } & {w^{q-1+s}} & {\cdots} & {w^{q(q-1)+s}\theta^{m-1}}\\ {0} &{w^{2s}} & { w^{2s}\theta^{2}} & {\cdots} & {w^{2s}\theta^{2(m-1)} } & {w^{2(q-1+s)}} & {\cdots} & {w^{2[q(q-1)+s]}\theta^{2(m-1)}}\\ {\vdots} & {\vdots} & {\vdots} & {\ddots} & {\vdots} & {\vdots} & {\ddots} & {\vdots}\\ {0} & {w^{(k-1)s}} &\! {w^{(k-1)s}\theta^{k-1}} &\! {\cdots} &\! {w^{(k-1)s}\theta^{(k-1)(m-1)} } &\! {w^{(k-1)(q-1+s)}} &\! {\cdots} &\! {w^{(k-1)[q(q-1)+s]}\theta^{(k-1)(m-1)}} \end{array}\right), $$
$$ V=\left( \begin{array}{cccccccc}{1} & {} & {} & {} & {}& {}& {} \\ {} & {1} & {} & {} & {} & {} & {}& {}\\ {} & {} & { w^{-ch}} & {} & {} & {} & {} & {}\\ {} & {} & {} & {\ddots} & {} & {} & {} & {}\\ {} &{} & { } & {w^{-c(m-1)h}} & {} & {} & {} & {}\\ {} &{} & {} & {} & {} & {1} & {} & {}\\ {} &{} & {} & {} & {} & {} & {\ddots} & {}\\ {} &{} & {} & {} & {} & {} & {} & {w^{-c(m-1)h}} \end{array}\right). $$

In accordance with the proof of Theorem 2 in [24], we can obtain the conclusion.

We can obtain a more general result as follows. □

Theorem 3

Let q = hm + 1 be a prime power with h ≥ 1 an integer. Set\(n =1+r\frac {q^{2}-1}{h}\), 1 ≤ rh. Assume cis some integer such that 1 ≤ ch + 1, then

  1. (1)

    For any\( c=l\frac {q-1}{h}, l=1,2,\cdots \), there exist EAQMDS codes with parameters [[n, n − 2k + c, k + 1; c]]q, where\((c-1)\frac {q-1}{h}+1\leq k\leq c\frac {q-1}{h}\).

  2. (2)

    For any\(1+l\frac {q-1}{h}\leq c<(l+1)\frac {q-1}{h}, l=0,1,\cdots \), there exist EAQMDS codes with parameters [[n, n − 2k + c, k + 1; c]]q, where\(\frac {1}{2}(\frac {q-1}{h}+1)c+\left \lceil \frac {c-l-2}{2}\right \rceil \frac {q-1}{h}+1\leq k\leq \frac {1}{2}(\frac {q-1}{h}+1)c+\left \lceil \frac {c-l}{2}\right \rceil \frac {q-1}{h}\).

Proof

Let \(\mathbf {a}=\left (0,\mathbf {a}_{1}, \mathbf {a}_{2}, {\cdots } , \mathbf {a}_{r}\right )\) and \(\mathbf {v}_{r}=(1,\underbrace {\mathbf {v}, \mathbf {v}, \cdots , \mathbf {v}}_{r \text { times}})\), where 1 ≤ rh. Assume GRSk(a, vr) is a classical \([n,k,d]_{q^{2}}\) code with generator matrix G, where

$$ G=\left[\begin{array}{c|cccc} {\frac{1}{\mathbf{0}_{k-1}^{T}}} & {G_{1}} & {G_{2}} & {\cdots} & {G_{r}} \end{array}\right].$$

With the same manner in Theorem 2, there exsits the linear code GRSnk(a, wr) has parameters \([n, n-k, k+1]_{q^{2}}\) and parity check matrix H = G.

Apparently, \(\operatorname {rank}\left ({G}{G}^{\dagger }\right )= \operatorname {rank}\left ({G}_{s}{G}_{s}^{\dagger }\right )=c\). It follows from Theorem 1 that the result holds.

This completes the proof. □

Firstly, we compare parameters of new EAQMDS codes with corresponding QMDS codes in Theorem 2 [25] for q even by Table 1.

Table 1 Some EAQMDS codes of length \(n=1+r\frac {q^{2}-1}{h}\), 1 ≤ rh

Particularly, when c = 1, if h = q − 1, then we have k = c = 1; if h < q − 1, then we obtain \(\frac {1}{2}(\frac {q-1}{h}+1)+1\leq k\leq \frac {1}{2}(\frac {q-1}{h}+1)+\frac {q-1}{h}\).

3.2 Length \(n=1+\frac {q-1}{h} \cdot \frac {q+1}{2}\), q ≡ 1(mod 4)

In this subsection, we always assume that q = hm + 1, h ≥ 1 is an integer, \(n=1+\frac {q^{2}-1}{2h}\). Set α1 = ωq+ 1, α2 = ω2(q− 1), then ord(α1) = q − 1, ord\((\alpha _{2})=\frac {q+1}{2}\). Moreover, let \(\theta ={\alpha _{1}^{h}}\), then ord\((\theta )=\frac {q-1}{h}\). Thus gcd(ord(θ),ord(α2))= 1. Hence, \(\langle \theta \rangle , \alpha _{2}\langle \theta \rangle , \cdots , \alpha _{2}^{\frac {q+1}{2}-1}\langle \theta \rangle \) are distinct cosets in the multiplicative group \(\mathbb {F}_{q^{2}}^{*}\). Assume

$$ \begin{array}{@{}rcl@{}} \mathbf{a}_{s}&=&\left( 0, {\alpha_{2}^{0}}(w^{s}, w^{s} \theta, \cdots, w^{s} \theta^{\frac{q-1}{h}-1}), {\alpha_{2}^{1}}(w^{s}, w^{s} \theta, \cdots, w^{s} \theta^{\frac{q-1}{h}-1}),\right.\\ &&\quad \left. \cdots, \alpha_{2}^{\frac{q+1}{2}-1}{(w^{s}, w^{s} \theta, \cdots, w^{s} \theta^{\frac{q-1}{h}-1})}\right)\in \mathbb{F}_{q^{2}}^{n},\\ \mathbf{u}&=&\left( 1, \omega^{-ch}, \cdots, \omega^{-c(\frac{q-1}{h}-1)h}\right),\\ \mathbf{v}&=&(1, \underbrace{\mathbf{u},\mathbf{u},\cdots, \mathbf{u}}_{\frac{q+1}{2} \text { times }})\in (\mathbb{F}_{q^{2}}^{\ast})^{n}. \end{array} $$

Firstly, we present the following result.

For any 0 ≤ i, jn − 1, we have

$$ \begin{array}{@{}rcl@{}} \left\langle\mathbf{a}_{s}^{q i+j}, \mathbf{v}^{q+1}\right\rangle_{E} &=& \omega^{s(qi+j)}\sum\limits_{t=0}^{\frac{q-1}{h}-1} \theta^{t(q i+j)} \omega^{-ch(q+1)t} \sum\limits_{v=0}^{\frac{q+1}{2}-1} \alpha_{2}^{v(q i+j)}\\ &=& \omega^{s(qi+j)}\sum\limits_{t=0}^{\frac{q-1}{h}-1} \theta^{t(q i+j-c)} \sum\limits_{v=0}^{\frac{q+1}{2}-1} \alpha_{2}^{v(q i+j)}. \end{array} $$

Thus

$$ \left\langle\mathbf{a}_{s}^{q i+j}, \mathbf{v}^{q+1}\right\rangle_{E}= \left\{\begin{array}{l}{0, ~\quad\quad\quad\quad \frac{q-1}{h} \nmid q i+j-c}, \\ {\omega^{s(qi+j)}n,\quad \frac{q-1}{h} | q i+j-c, \frac{q+1}{2} | q i+j}. \end{array}\right. $$

Then \(\left \langle \mathbf {a}_{s}^{q i+j}, \mathbf {v}^{q+1}\right \rangle _{E} \neq 0\) if and only if

$$ \left \{\begin{array}{l}{qi+j\equiv c, \quad \text{mod} ~\frac{q-1}{h}},\\ {qi+j \equiv 0,\quad \text{mod}~ \frac{q+1}{2}}. \end{array}\right. $$

According to [24], the system has a solution

$$ qi+j\equiv \frac{q+1}{2}c ~(\bmod ~n). $$

Next, we discuss the following two cases:

3.2.1 \(\frac {q-1}{h}\) is Even

Lemma 3

[24] Let q = hm + 1 be a prime power with h ≥ 1 an integer, where m is even. Set\(n =\frac {q^{2}-1}{2h}\). Assume c is some even integer such that 2 ≤ c ≤ 2h.

  1. (1)

    If c is some even integer such that\( c=l\frac {q-1}{h}, l=1,2,\cdots \). Suppose\((c-1)\frac {q-1}{2h}+1\leq k\leq c\frac {q-1}{2h}\), then for any 0 ≤ i, jk − 1, \(\left \langle \mathbf {a}_{s}^{q i+j}, \mathbf {v}^{q+1} \right \rangle _{E}\neq 0\)if and only if\((i,j)=(r\frac {q-1}{2h}+\frac {c}{2},r\frac {q-1}{2h}+\frac {c}{2}), r\in [-l, c-(l+1)]\).

  2. (2)

    If c is some even integer such that\(2+l\frac {q-1}{h}\leq c<(l+1)\frac {q-1}{h}, l=0,1,\cdots \). Suppose\((c-l-1)\frac {q-1}{2h}+\frac {c}{2}+1\leq k\leq (c-l)\frac {q-1}{2h}+\frac {c}{2}\), then for any 0 ≤ i, jk − 1, \(\left \langle \mathbf {a}_{s}^{q i+j}, \mathbf {v}^{q+1} \right \rangle _{E}\neq 0\)if and only if\((i,j)=(r\frac {q-1}{2h}+\frac {c}{2},r\frac {q-1}{2h}+\frac {c}{2}), r\in [-l, c-(l+1)]\).

Theorem 4

Let q = hm + 1 be a prime power with h ≥ 1 an integer, where m is even. Set\(n =1+\frac {q^{2}-1}{2h}\). Assume c is some even integer such that 2 ≤ c ≤ 2h, then

  1. (1)

    For any\( c=l\frac {q-1}{h}, l=1,2,\cdots \), there exist EAQMDS codes with parameters [[n, n − 2k + c, k + 1; c]]q, where\((c-1)\frac {q-1}{2h}+1\leq k\leq c\frac {q-1}{2h}\).

  2. (2)

    For any\(2+l\frac {q-1}{h}\leq c<(l+1)\frac {q-1}{h}, l=0,1,\cdots \), there exist EAQMDS codes with parameters [[n, n − 2k + c, k + 1; c]]q, where\((c-l-1)\frac {q-1}{2h}+\frac {c}{2}+1\leq k\leq (c-l)\frac {q-1}{2h}+\frac {c}{2}\).

We can also obtain a more general result.

Theorem 5

Let q = hm + 1 be a prime power with h ≥ 1 an integer, where mis even. Set\(n =1+r\frac {q^{2}-1}{2h}\), 1 ≤ r ≤ 2h. Assume cis some even integer such that 2 ≤ c ≤ 2h, then

  1. (1)

    For any\( c=l\frac {q-1}{h}, l=1,2,\cdots \), there exist EAQMDS codes with parameters [[n, n − 2k + c, k + 1; c]]q, where\((c-1)\frac {q-1}{2h}+1\leq k\leq c\frac {q-1}{2h}\).

  2. (2)

    For any\(2+l\frac {q-1}{h}\leq c<(l+1)\frac {q-1}{h}, l=0,1,\cdots \), there exist EAQMDS codes with parameters [[n, n − 2k + c, k + 1; c]]q, where\((c-l-1)\frac {q-1}{2h}+\frac {c}{2}+1\leq k\leq (c-l)\frac {q-1}{2h}+\frac {c}{2}\).

3.2.2 \(\frac {q-1}{h}\) is Odd

Lemma 4

[24] Let q = hm + 1 be a prime power with h ≥ 1 an even integer, where m is odd. Set\(n =1+\frac {q^{2}-1}{2h}\). Assume c is some integer such that\(1\leq c\leq \frac {h}{2}\).

  1. (1)

    If c is some integer such that\( c=l\frac {q-1}{h}, l=1,2,\cdots \). Suppose\((c-1)\frac {q-1}{h}+1\leq k\leq c\frac {q-1}{h}\), then for any 0 ≤ i, jk − 1, \(\left \langle \mathbf {a}_{s}^{q i+j}, \mathbf {v}^{q+1} \right \rangle _{E}\neq 0\)if and only if\((i,j)=(\frac {1}{2}(\frac {q-1}{h}+1)c+r\frac {q-1}{h}, \frac {1}{2}(\frac {q-1}{h}+1)c+r\frac {q-1}{h}), r\in [-\frac {1}{2}(\frac {q-1}{h}+1)l, c-[\frac {1}{2}(\frac {q-1}{h}+1)l+1]]\).

  2. (2)

    If c is some integer such that\(1+l\frac {q-1}{h}\leq c<(l+1)\frac {q-1}{h}, l=0,1,\cdots \). Suppose\(\frac {1}{2}(\frac {q-1}{h}+1)c+\left \lceil \frac {c-l-2}{2}\right \rceil \frac {q-1}{h}+1 \leq k\leq \frac {1}{2}(\frac {q-1}{h}+1)c+\left \lceil \frac {c-l}{2}\right \rceil \frac {q-1}{h}\), then for any 0 ≤ i, jk − 1, \(\left \langle \mathbf {a}_{s}^{q i+j}, \mathbf {v}^{q+1} \right \rangle _{E}\neq 0\)if and only if\( (i,j)= (\frac {1}{2}(\frac {q-1}{h}+1)c+r\frac {q-1}{h}, \frac {1}{2}(\frac {q-1}{h}+1)c+r\frac {q-1}{h}), r\in [-\left \lceil \frac {c+l-1}{2}\right \rceil , \left \lceil \frac {c-l-2}{2}\right \rceil ]\).

Next we will obtain the following result in the light of the previous lemma.

Theorem 6

Let q = hm + 1 be a prime power with h ≥ 1 an even integer, where mis odd. Set\(n =1+\frac {q^{2}-1}{2h}\). Assume c is some integer such that\(1\leq c\leq \frac {h}{2}\), then

  1. (1)

    For any\( c=l\frac {q-1}{h}, l=1,2,\cdots \), there exist EAQMDS codes with parameters [[n, n − 2k + c, k + 1; c]]q, where\((c-1)\frac {q-1}{h}+1\leq k\leq c\frac {q-1}{h}\).

  2. (2)

    For any\(1+l\frac {q-1}{h}\leq c<(l+1)\frac {q-1}{h}, l=0,1,\cdots \), there exist EAQMDS codes with parameters [[n, n − 2k + c, k + 1;c]]q, where\(\frac {1}{2}(\frac {q-1}{h}+1)c+\left \lceil \frac {c-l-2}{2}\right \rceil \frac {q-1}{h}+1 \leq k\leq \frac {1}{2}(\frac {q-1}{h}+1)c+\left \lceil \frac {c-l}{2}\right \rceil \frac {q-1}{h}\).

Theorem 7

Let q = hm + 1 be a prime power with h ≥ 1 an even integer, where m is odd. Set\(n =1+r\frac {q^{2}-1}{2h}\), 1 ≤ r ≤ 2h. Assume c is some integer such that\(1\leq c\leq \frac {h}{2}\), then

  1. (1)

    For any\( c=l\frac {q-1}{h}, l=1,2,\cdots \), there exist EAQMDS codes with parameters [[n, n − 2k + c, k + 1; c]]q, where\((c-1)\frac {q-1}{h}+1\leq k\leq c\frac {q-1}{h}\).

  2. (2)

    For any\(1+l\frac {q-1}{h}\leq c<(l+1)\frac {q-1}{h}, l=0,1,\cdots \), there exist EAQMDS codes with parameters [[n, n − 2k + c, k + 1; c]]q, where\(\frac {1}{2}(\frac {q-1}{h}+1)c+\left \lceil \frac {c-l-2}{2}\right \rceil \frac {q-1}{h}+1 \leq k\leq \frac {1}{2}(\frac {q-1}{h}+1)c+\left \lceil \frac {c-l}{2}\right \rceil \frac {q-1}{h}\).

We compare parameters of new EAQMDS codes with corresponding QMDS codes in Theorem 2 [25] for q ≡ 1(mod 4) by Table 2.

Table 2 Some EAQMDS codes of length \(n=1+r\frac {q^{2}-1}{2h}\), 1 ≤ r ≤ 2h

3.3 Length \(n=1+\frac {q-1}{2h}(q+1)\), q ≡ 3(mod 4)

In this subsection, we always assume that q = 2hm + 1, h ≥ 1 is an integer, \(n=1+\frac {q^{2}-1}{2h}\). Set α1 = ω2(q+ 1), α2 = ωq− 1, then ord\((\alpha _{1})=\frac {q-1}{2},\) ord(α2) = q + 1. Moreover, let \(\theta ={\alpha _{1}^{h}}\), then ord\((\theta )=\frac {q-1}{2h}\). Thus gcd(ord(θ),ord(α2))= 1. Hence, \(\langle \theta \rangle , \alpha _{2}\langle \theta \rangle , \cdots , {\alpha _{2}^{q}}\langle \theta \rangle \) are distinct cosets in the multiplicative group \(\mathbb {F}_{q^{2}}^{*}\). Assume

$$ \begin{array}{@{}rcl@{}} \mathbf{a}_{s}&=&\left( 0, {\alpha_{2}^{0}}(w^{s}, w^{s} \theta, \cdots, w^{s} \theta^{\frac{q-1}{2h}-1}), {\alpha_{2}^{1}}(w^{s}, w^{s} \theta, \cdots, w^{s} \theta^{\frac{q-1}{2h}-1}), \right. \\ &&\quad\left.\cdots, {\alpha_{2}^{q}}(w^{s}, w^{s} \theta, \cdots, w^{s} \theta^{\frac{q-1}{2h}-1})\right)\in \mathbb{F}_{q^{2}}^{n},\\ \mathbf{u}&=&\left( 1, \omega^{-2ch}, \cdots, \omega^{-2c(\frac{q-1}{2h}-1)h}\right),\\ \mathbf{v}&=&(1, \underbrace{\mathbf{u},\mathbf{u},\cdots, \mathbf{u}}_{(q+1) \text { times }})\in (\mathbb{F}_{q^{2}}^{\ast})^{n}. \end{array} $$

We firstly give the following result.

For any 0 ≤ i, jn − 1, we have

$$ \begin{array}{@{}rcl@{}} \left\langle\mathbf{a}_{s}^{q i+j}, \mathbf{v}^{q+1}\right\rangle_{E} &=& \omega^{s(qi+j)}\sum\limits_{t=0}^{\frac{q-1}{2h}-1} \theta^{t(q i+j)} \omega^{-2ch(q+1)t} \sum\limits_{v=0}^{q} \alpha_{2}^{v(q i+j)}\\ &=& \omega^{s(qi+j)}\sum\limits_{t=0}^{\frac{q-1}{2h}-1} \theta^{t(q i+j-c)} \sum\limits_{v=0}^{q} \alpha_{2}^{v(q i+j)}. \end{array} $$

Thus

$$ \left\langle\mathbf{a}_{s}^{q i+j}, \mathbf{v}^{q+1}\right\rangle_{E}= \left\{\begin{array}{l}{0, ~\quad\quad\quad\quad \frac{q-1}{2h} \nmid q i+j-c}, \\ {\omega^{s(qi+j)}n,\quad \frac{q-1}{2h} | q i+j-c, q+1 | q i+j}. \end{array}\right. $$

Then \(\left \langle \mathbf {a}_{s}^{q i+j}, \mathbf {v}^{q+1}\right \rangle _{E} \neq 0\) if and only if

$$ \left \{\begin{array}{l}{qi+j\equiv c, \quad \text{mod} ~\frac{q-1}{2h}},\\ {qi+j \equiv 0,\quad \text{mod} ~ q+1}. \end{array}\right. $$

According to [24], the system has a solution

$$qi+j\equiv \frac{1}{2}(\frac{q-1}{2h}+1)(q+1)c ~(\bmod ~n).$$

According to previous discussions, we can obtain the result as follows.

Lemma 5

[24] Let q = 2hm + 1 be a prime power with h ≥ 1 an integer. Set\(n =1+\frac {q^{2}-1}{2h}\). Assume c is some integer such that 1 ≤ c ≤ 2h + 1.

  1. (1)

    If c is some integer such that\( c=l\frac {q-1}{2h}, l=1,2,\cdots \). Suppose\((c-1)\frac {q-1}{2h}+1\leq k\leq c\frac {q-1}{2h}\), then for any 0 ≤ i, jk − 1, \(\left \langle \mathbf {a}_{s}^{q i+j}, \mathbf {v}^{q+1} \right \rangle _{E}\neq 0\)if and only if\((i,j)=(\frac {1}{2}(\frac {q-1}{2h}+1)c+r\frac {q-1}{2h}, \frac {1}{2}(\frac {q-1}{2h}+1)c+r\frac {q-1}{2h}), r\in [-\frac {1}{2}(\frac {q-1}{2h}+1)l, c-[\frac {1}{2}(\frac {q-1}{2h}+1)l+1]]\).

  2. (2)

    If c is some integer such that\(1+l\frac {q-1}{2h}\leq c<(l+1)\frac {q-1}{2h}, l=0,1,\cdots \). Suppose\(\frac {1}{2}(\frac {q-1}{2h}+1)c+\left \lceil \frac {c-l-2}{2}\right \rceil \frac {q-1}{2h}+1\leq k\leq \frac {1}{2}(\frac {q-1}{2h}+1)c+\left \lceil \frac {c-l}{2}\right \rceil \frac {q-1}{2h}\), then for any 0 ≤ i, jk − 1, \(\left \langle \mathbf {a}_{s}^{q i+j}, \mathbf {v}^{q+1} \right \rangle _{E}\neq 0\)if and only if\( (i,j)= (\frac {1}{2}(\frac {q-1}{2h}+1)c+r\frac {q-1}{2h}, \frac {1}{2}(\frac {q-1}{2h}+1)c+r\frac {q-1}{2h}), r\in [-\left \lceil \frac {c+l-1}{2}\right \rceil , \left \lceil \frac {c-l-2}{2}\right \rceil ]\).

Theorem 8

Let q = 2hm + 1 be a prime power with h ≥ 1 an integer. Set\(n =1+\frac {q^{2}-1}{2h}\). Assume cis some integer such that 1 ≤ c ≤ 2h + 1, then

  1. (1)

    For any\( c=l\frac {q-1}{2h}, l=1,2,\cdots \), there exist EAQMDS codes with parameters [[n, n − 2k + c, k + 1; c]]q, where\((c-1)\frac {q-1}{2h}+1\leq k\leq c\frac {q-1}{2h}\).

  2. (2)

    For any\(1+l\frac {q-1}{2h}\leq c<(l+1)\frac {q-1}{2h}, l=0,1,\cdots \), there exist EAQMDS codes with parameters [[n, n − 2k + c, k + 1; c]]q, where\(\frac {1}{2}(\frac {q-1}{2h}+1)c+\left \lceil \frac {c-l-2}{2}\right \rceil \frac {q-1}{2h}+1\leq k\leq \frac {1}{2}(\frac {q-1}{2h}+1)c+\left \lceil \frac {c-l}{2}\right \rceil \frac {q-1}{2h}\).

We can similarly yield a more general result as follows.

Theorem 9

Let q = 2hm + 1 be a prime power with h ≥ 1 an integer. Set\(n =1+r\frac {q^{2}-1}{2h}\), 1 ≤ r ≤ 2h. Assume c is some integer such that 1 ≤ c ≤ 2h + 1, then

  1. (1)

    For any\( c=l\frac {q-1}{2h}, l=1,2,\cdots \), there exist EAQMDS codes with parameters [[n, n − 2k + c, k + 1; c]]q, where\((c-1)\frac {q-1}{2h}+1\leq k\leq c\frac {q-1}{2h}\).

  2. (2)

    For any\(1+l\frac {q-1}{2h}\leq c<(l+1)\frac {q-1}{2h}, l=0,1,\cdots \), there exist EAQMDS codes with parameters [[n, n − 2k + c, k + 1; c]]q, where\(\frac {1}{2}(\frac {q-1}{2h}+1)c+\left \lceil \frac {c-l-2}{2}\right \rceil \frac {q-1}{2h}+1\leq k\leq \frac {1}{2}(\frac {q-1}{2h}+1)c+\left \lceil \frac {c-l}{2}\right \rceil \frac {q-1}{2h}\).

Now, we compare parameters of new EAQMDS codes with corresponding QMDS codes in Theorem 2 [25] for q ≡ 3(mod 4) by Table 3.

Table 3 Some EAQMDS codes of length \(n=1+r\frac {q^{2}-1}{2h}\), 1 ≤ r ≤ 2h

4 Conclusion and Discussion

We have known that GRS and extended GRS codes have become one of the best resources for constructing optimal quantum codes and entanglement-assisted quantum codes. In this paper we have employed GRS codes to construct several classes of entanglement-assisted quantum MDS codes which have best parameters. In addition to the existing results, these quantum codes are new. The further investigation is to construct q-ary EAQMDS codes that minimum distance as large as possible with respect to the code length.