1 Introduction

The theory of quantum error-correcting codes (QECCs) has been exhaustively investigated in the literature. As we all know, QECCs are a powerful tool for fighting against noise in quantum communication and quantum computation. Therefore, there are many recent contributions to this topic [1, 5, 8, 11, 14, 15, 22,23,24]. Recently, such theory has been extended to entanglement-assisted quantum error-correcting codes (EAQECCs). Customarily, an entanglement-assisted quantum error-correcting code can be denoted as \([[n,k,d;c]]_q\), which encodes k information qubits into n channel qubits with the help of c pairs of maximally entangled states and corrects up to \(\lfloor \frac{d-1}{2}\rfloor \) errors, where d is the minimum distance of the code. If \(c=0\), then it is called a q-ary standard \([[n,k,d]]_q\) quantum code. The net rate of an EAQECC is \(\frac{k-c}{n}\) and the rate of an EAQECC is \(\frac{k}{n}\).

The concept of an EAQECC was introduced by Brun et al. [3], which overcomes the barrier of the dual-containing condition in constructing standard quantum codes from classical codes. So, it is much easier to construct EAQECCs by classical codes. They proved that if the shared entanglement is available between the sender and receiver in advance, non-dual-containing classical quaternary codes can be used to construct EAQECCs. Afterward, many researchers presented some constructions of good EAQECCs [4, 7, 9, 10, 17,18,19, 21, 25].

For many purposes, the net rate is an important parameter of an EAQECC. In general, the net rate can be positive, negative, or zero. EAQECCs with negative net rates may actually have advantages in practice. One great advantage of shared entanglement as a resource is that it is independent of the message being sent, and can in principle be prepared well ahead of time. One natural application of EAQECCs would therefore be to a quantum network where usage varies at different times. EAQECCs with positive net rates can be employed in some other ways to improve the power and flexibility of quantum communications. Brun et al. [4] indicated that it is possible to construct catalytic codes if the net rate of an EAQECC is positive. Precisely speaking, any \([[n,k;c]]_q\) EAQECC with \(k-c>0\) can lead to an \([[n,k-c;c]]_q\) catalytic quantum error-correcting code. It is clear that the net rate of the EAQECC is the rate of the catalytic quantum error-correcting code. Generally, one would like to design a code with large rate to decrease the redundant date.

As Brun et al. pointed out in [4], there exists a practical advantage of EAQECCs over standard QECCs. In the protocol, the entanglement is a strictly weaker resource than quantum communication. Hence, the comparison of the net yield, \(k-c\), between an \([[n,k,d;c]]_q\) EAQECC and an \([[n,k,d;0]]_q\) QECC is not being entirely fair to former. Furthermore, one can obtain the pre-shared entanglement from a two-way entanglement distillation protocol that has higher rates than one-way schemes. At this point, a large value of c is favorable because it implies a higher qubit channel yield. Above all, the design of an EAQECC with a flexible value of c is significant.

Recently, Guenda et al. [12] constructed some EAQECCs with good parameters. Furthermore, they established a link between the number of maximally shared qubits required to construct an EAQECC from any classical linear code and the hull of the classical code. And they also provided methods for constructing EAQECCs requiring desirable amounts of entanglement.

The main goal of this paper is to construct MDS EAQECCs. Enlightened by the idea of [12], we propose two constructions of generalized Reed–Solomon codes and determine their hulls. Using these generalized Reed–Solomon codes, we obtain two new infinite families of MDS EAQECCs. Notably, the parameters of these MDS EAQECCs are new and flexible. For reference, we list the parameters of some known MDS EAQECCs and the new ones in Table 1.

Table 1 Some known classes of MDS EAQECCs with parameters \([[n,k,d,c]]_q\) for an odd prime power q

This paper is organized as follows. In Sect. 2, some basic background and results about generalized Reed–Solomon codes and EAQECCs are reviewed. In Sect. 3, we construct two infinite classes of MDS EAQECCs. Section 4 concludes the paper.

2 Preliminaries

In this section, we recall some basic definitions and results about generalized Reed–Solomon codes and entanglement-assisted quantum error-correcting codes.

2.1 Generalized Reed–Solomon codes

Let q be a power of a prime and \({\mathbb F}_q\) denote the finite field with q elements. We write \({\mathbb F}_q^*={\mathbb F}_q\setminus \{0\}\). An [nkd] linear code over \({\mathbb F}_q\) is a k-dimensional subspace of \({\mathbb F}_q^n\) with minimum Hamming distance d. Let \({\mathbb F}_q^n\) stand for the vector space with dimension n over \({\mathbb F}_q\). An [nkd] code \({\mathcal C}\) is called an MDS code if \(n=k+d-1\). For any two vectors, \(\mathbf {x}=(x_1,x_2,\ldots ,x_n)^t\) and \(\mathbf {y}=(y_1,y_2,\ldots ,y_n)^t\) of \({\mathbb F}_q^n\), their Euclidean inner product is defined as

$$\begin{aligned} \mathbf {x}\cdot \mathbf {y}=\sum _{i=1}^nx_iy_i. \end{aligned}$$

The dual of the code \({\mathcal C}\) is defined by the set

$$\begin{aligned} {\mathcal C}^{\bot }=\{\mathbf {x}\in {\mathbb F}_q^n:\mathbf {x}\cdot \mathbf {y}=0\ \quad \mathrm{for\ all }\ \ \mathbf {y}\in {\mathcal C}\}. \end{aligned}$$

The hull of \({\mathcal C}\) is the code \({\mathcal C}\bigcap {\mathcal C}^{\bot }\), denoted by Hull\(({\mathcal C})\), in the terminology that was introduced in [2].

Assume that \(\alpha _1,\alpha _2,\ldots ,\alpha _n\) are n distinct elements of \({\mathbb F}_q\), where \(1<n\le q\). For n nonzero fixed elements \(v_1,v_2,\ldots ,v_n\) of \({\mathbb F}_q\) (\(v_i\) may not be distinct), the generalized Reed–Solomon code (GRS code for short) [20] associated with \(\mathbf {a}=(\alpha _1,\alpha _2,\ldots ,\alpha _n)\) and \(\mathbf {v}=(v_1,v_2,\ldots ,v_n)\) is defined as follows:

$$\begin{aligned}&GRS_k(\mathbf {a},\mathbf {v})=\{(v_1f(\alpha _1),v_2f(\alpha _2),\ldots ,v_nf(\alpha _n)):f(x)\in {\mathbb F}_q[x],\nonumber \\&\quad \mathrm{deg}(f(x))\le k-1\}. \end{aligned}$$
(1)

A generator matrix of \(GRS_k(\mathbf {a},\mathbf {v})\) is

$$\begin{aligned} G=\left( \begin{matrix} v_1 &{} v_2 &{}\cdots &{} v_n&{}\\ v_1\alpha _1 &{} v_2\alpha _2 &{}\cdots &{} v_n\alpha _n&{}\\ v_1\alpha _1^2 &{} v_2\alpha _2^2 &{}\cdots &{} v_n\alpha _n^2&{}\\ \vdots &{} \vdots &{} \ddots &{} \vdots &{}\\ v_1\alpha _1^{k-1} &{} v_2\alpha _2^{k-1} &{}\cdots &{} v_n\alpha _n^{k-1}&{}\\ \end{matrix}\right) . \end{aligned}$$

It is well known that the code \(GRS_k(\mathbf {a},\mathbf {v})\) is a q-ary \([n,k,n-k+1]\)-MDS code [20, Th. 9.1.4] and the dual of a GRS code is again a GRS code. More specifically,

$$\begin{aligned} GRS_k(\mathbf {a},\mathbf {v})^{\bot }=GRS_{n-k}(\mathbf {a},\mathbf {v}^{\prime }) \end{aligned}$$

for some \(\mathbf {v}^{\prime }=(v_1^{\prime },v_2^{\prime },\cdots ,v_n^{\prime })\) such that \(v_i^{\prime }\ne 0\) for any \(1\le i\le n\). Furthermore, Jin [13] indicated that

$$\begin{aligned} GRS_k(\mathbf {a},\mathbf {1})^{\bot }=GRS_{n-k}(\mathbf {a},\mathbf {u}), \end{aligned}$$

where \(\mathbf {1}\) stands for the all-one row vector of length n and \(\mathbf {u}=\{u_1,u_2,\ldots ,u_n\}\) with \(u_i=\prod _{1\le j\le n,j\ne i}(\alpha _i-\alpha _j)^{-1}\) for \(1\le i\le n\). By this fact, we have following lemma.

Lemma 2.1

Let the symbols be the same as above. Then the dual code of \(GRS_k(\mathbf {a},\mathbf {v})\) is \(GRS_{n-k}(\mathbf {a},\mathbf {w})\), where \(\mathbf {w}=\{\omega _1,\omega _2,\ldots ,\omega _n\}\) with \(\omega _i=v_i^{-1}u_i\) for \(1\le i\le n\).

proof

Thanks to \(GRS_k(\mathbf {a},\mathbf {1})^{\bot }=GRS_{n-k}(\mathbf {a},\mathbf {u})\), we get that \(\sum _{i=1}^nf(\alpha _i)(u_ig(\alpha _i))=0\) for any two polynomials \(f(x),g(x)\in {\mathbb F}_q[x]\) such that \(\mathrm{deg}(f(x))\le k-1\) and \(\mathrm{deg}(g(x))\le n-k-1\). Note that \(\mathbf {v}=(v_1,v_2,\ldots ,v_n)\) and \(v_1,v_2,\cdots ,v_n\) are nonzero elements of \({\mathbb F}_q\). Then we deduce that

$$\begin{aligned} \sum _{i=1}^nv_if(\alpha _i)(v_i^{-1}u_ig(\alpha _i))=0, \end{aligned}$$

for any two polynomials \(f(x),g(x)\in {\mathbb F}_q[x]\) such that \(\mathrm{deg}(f(x))\le k-1\) and \(\mathrm{deg}(g(x))\le n-k-1\). Assume that \(\mathbf {w}=\{\omega _1,\omega _2,\ldots ,\omega _n\}\) with \(\omega _i=v_i^{-1}u_i\) for \(1\le i\le n\). Hence, \(GRS_{n-k}(\mathbf {a},\mathbf {w})\) is orthogonal to \(GRS_k(\mathbf {a},\mathbf {v})\). The lemma follows immediately from the fact that

$$\begin{aligned} \mathrm{dim}(GRS_k(\mathbf {a},\mathbf {v}))+\mathrm{dim}(GRS_{n-k}(\mathbf {a},\mathbf {w}))=k+n-k=n. \end{aligned}$$

\(\square \)

The following result provides a method for determining the hull of a GRS code.

Lemma 2.2

Let \(GRS_k(a,v)\) be the generalized Reed–Solomon code associated with \(\mathbf {a}\) and \(\mathbf {v}\). For a codeword \(\mathbf {c}=(v_1f(\alpha _1),v_2f(\alpha _2),\ldots ,v_nf(\alpha _n))\) of \(GRS_k(\mathbf {a},\mathbf {v})\), \(\mathbf {c}\) is contained in \(GRS_k(\mathbf {a},\mathbf {v})^{\bot }\) if and only if there is a polynomial \(g(x)\in {\mathbb F}_q[x]\) with deg\((g(x))\le n-k-1\) such that

$$\begin{aligned} (v_1f(\alpha _1),v_2f(\alpha _2),\ldots ,v_nf(\alpha _n))=(v_1^{-1}u_1g(\alpha _1),v_2^{-1}u_2g(\alpha _2),\ldots ,v_n^{-1}u_ng(\alpha _n)), \end{aligned}$$

where \(u_i=\prod _{1\le j\le n,j\ne i}(\alpha _i-\alpha _j)^{-1}\) for \(1\le i\le n\).

Lemma 2.2 is now a direct consequence of Lemma 2.1. In fact, Lemma 2.2 is another form of [6, Lemma III.1], and we have given a different proof of it.

2.2 Entanglement-assisted quantum error-correcting codes

By utilizing classical linear codes over finite fields, one can construct EAQECCs as follows.

Lemma 2.3

[25] Suppose that \(H_1\) and \(H_2\) are parity check matrices of two q-ary linear codes \([n, k_1, d_1]\) and \([n, k_2, d_2]\), respectively. Then there exists an \([[n,k_1+k_2-n+c,\mathrm{min}\{d_1,d_2\};c]]_q\) EAQECC, where \(c=rank(H_1H_2^t)\) is the required number of maximally entangled states.

Between the parameters n, k d and c of an EAQECC, there exists a trade-off, known as the Singleton bound [3, 16].

Lemma 2.4

[3, 16] For any \([[n,k,d;c]]_q\) EAQECC with \(d\le \frac{n+2}{2}\), it satisfies

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

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

An EAQECC is called an MDS EAQECC if the parameters meet the Singleton bound. Guenda et al. [12] established a relation between the required number of maximally entangled states and the dimension of the hull of a classical code.

Lemma 2.5

[12] Let \({\mathcal C}\) be a q-ary linear code with parameters [nkd]. Assume that H is a parity check matrix and G is a generator matrix of \({\mathcal C}\). Then we have

$$\begin{aligned} rank(HH^t)=n-k-\mathrm{dim}(\mathrm{Hull}({\mathcal C}))=n-k-\mathrm{dim}(\mathrm{Hull}({\mathcal C}^{\bot })), \end{aligned}$$

and

$$\begin{aligned} rank(GG^t)=k-\mathrm{dim}(\mathrm{Hull}({\mathcal C}))=k-\mathrm{dim}(\mathrm{Hull}({\mathcal C}^{\bot })). \end{aligned}$$

As a direct consequence of Lemmas 2.3 and 2.5, one has the following lemma.

Lemma 2.6

[12] Let \({\mathcal C}\) be an [nkd] linear code over \({\mathbb F}_q\) and \({\mathcal C}^{\bot }\) its Euclidean dual with parameters \([n, n-k, d^{\bot }]\). Then there exist \([[n,k-\mathrm{dim}(\mathrm{Hull}({\mathcal C})),d;n-k-\mathrm{dim}(\mathrm{Hull}({\mathcal C}))]]_q\) and \([[n,n-k-\mathrm{dim}(\mathrm{Hull}({\mathcal C})),d^{\bot };k-\mathrm{dim}(\mathrm{Hull}({\mathcal C}))]]_q\) EAQECCs.

3 New MDS entanglement-assisted quantum error-correcting codes

In this section, using generalized Reed–Solomon codes, we present two infinite families of MDS EAQECCs. We begin with a construction of MDS linear codes over finite fields.

Theorem 3.1

Let \(q>3\) be an odd prime power. Suppose that \(m>1\) is an integer with m|q and n is a positive integer such that \(1<n<m\). If \(1<k\le \lfloor \frac{n}{2}\rfloor \) and \(n+k>m+1\), then there exists a q-ary [nk] MDS linear code \({\mathcal C}\) with h-dimensional hull for any \(1\le h \le n-m+k-1\).

proof

Due to m|q, \({\mathbb F}_m\) is the finite field with m elements and label the elements of

$$\begin{aligned} {\mathbb F}_m=\{\alpha _1,\ldots ,\alpha _n,\alpha _{n+1},\ldots ,\alpha _m\}. \end{aligned}$$

Assume that \(u_i=\prod _{1\le j\le n,j\ne i}(\alpha _i-\alpha _j)^{-1}\) for \(1\le i\le n\). Let s be an integer such that \(1\le s\le n+k-m-1\). Put \(\mathbf {a}=(\alpha _1,\alpha _2,\ldots ,\alpha _{n})\) and \(\mathbf {v}=(v_1,v_2,\ldots ,v_s,\underbrace{1,\ldots ,1}_{n-s})\), where \(v_i\in {\mathbb F}_q^*\) and \(-v_i^2\prod _{j=n+1}^m(\alpha _i-\alpha _j)\ne u_i\) for all \(1\le i\le s\). Then we obtain the q-ary GRS code \(GRS_k(\mathbf {a},\mathbf {v})\) of length n relative to \(\mathbf {a}\) and \(\mathbf {v}\) as follows:

$$\begin{aligned}&GRS_k(\mathbf {a},\mathbf {v})=\{(v_1f(\alpha _1),\ldots , v_sf(\alpha _{s}),f(\alpha _{s+1}),\ldots ,\\&\quad f(\alpha _{n})):f(x)\in {\mathbb F}_q[x],\mathrm{deg}(f(x))\le k-1\}. \end{aligned}$$

Let \((v_1f(\alpha _1),\ldots , v_sf(\alpha _{s}),f(\alpha _{s+1}),\ldots ,f(\alpha _{n}))\in GRS_k(\mathbf {a},\mathbf {v})\cap GRS_k(\mathbf {a},\mathbf {v}) ^{\bot }\). It follows from Lemma 2.2 that there is a polynomial \(g(x)\in {\mathbb F}_q[x]\) with deg\((g(x))\le n-k-1\) such that

$$\begin{aligned}&(v_1f(\alpha _1),\ldots , v_sf(\alpha _{s}),f(\alpha _{s+1}),\ldots ,f(\alpha _{n}))=(v_1^{-1}u_1g(\alpha _1 ),\nonumber \\&\quad \ldots , v_s^{-1}u_sg(\alpha _{s}),u_{s+1}g(\alpha _{s+1}),\ldots ,u_ng(\alpha _n)). \end{aligned}$$
(2)

Note that \(\prod _{1\le j\le m,j\ne i}(\alpha _i-\alpha _j)^{-1}=\prod _{x\in {\mathbb F}_m^*}x=-1\). It follows from the last \(n-s\) coordinates of (2) that

$$\begin{aligned} f(\alpha _{i})=u_ig(\alpha ^i)=\prod _{1\le j\le n,j\ne i}(\alpha _i-\alpha _j)^{-1}g(\alpha ^i)=-\prod _{j=n+1}^m(\alpha _i-\alpha _j)g(\alpha ^i), \end{aligned}$$

for any \(s<i\le n\). Hence, \(f(x)=-\prod _{j=n+1}^m(x-\alpha _j)g(x)\) has at least \(n-s\) distinct roots. It follows from the definition of f(x), g(x) and \(k\le \lfloor \frac{n}{2}\rfloor \) that

$$\begin{aligned} \mathrm{deg} (f(x))\le k-1\le n-k-1<m-k-1, \end{aligned}$$
$$\begin{aligned} \mathrm{deg} \left( \prod _{j=n+1}^m(x-\alpha _j)g(x)\right) \le m-n+n-k-1=m-k-1. \end{aligned}$$

Note that \(1\le s\le n+k-m-1\). We deduce that

$$\begin{aligned} n-s\ge n-(n+k-m-1)=m-k+1. \end{aligned}$$

Since the degree of the polynomial \(f(x)+\prod _{j=n+1}^m(x-\alpha _j)g(x)\) is less than \(m-k-1\) and it has at least \(n-s\) distinct roots, we have \(f(x)=-\prod _{j=n+1}^m(x-\alpha _j)g(x)\) for any \(x\in {\mathbb F}_q\). Considering the first s coordinates of (2), we have

$$\begin{aligned} v_i^2f(\alpha _i)=u_ig(\alpha _i)=-v_i^2\prod _{j=n+1}^m(\alpha _i-\alpha _j)g(\alpha _i), \end{aligned}$$

for any \(1\le i\le s\). Since \(-v_i^2\prod _{j=n+1}^m(\alpha _i-\alpha _j)\ne u_i\) for all \(1\le i\le s\), g(x) has at least s distinct roots \(\alpha _1,\alpha _2,\ldots ,\alpha _s\). Thanks to \(f(x)=-\prod _{j=n+1}^m(x-\alpha _j)g(x)\), we obtain \(\mathrm{deg} (f(x))=\mathrm{deg} (g(x))+m-n\le k-1\), i.e., \(\mathrm{deg} (g(x))\le n-m+k-1\). Therefore,

$$\begin{aligned} g(x)=h(x)\prod _{i=1}^s(x-\alpha ^i),\ \ h(x)\in {\mathbb F}_q[x],\ \ \mathrm{deg}(h(x))\le n-m+k-1-s. \end{aligned}$$

For any \(g(x)\in {\mathbb F}_q[x]\) of the form \(g(x)=h(x)\prod _{i=1}^s(x-\alpha _i)\), where \(\mathrm{deg}(h(x))\le n-m+k-1-s\), there exists a polynomial \(f(x)=-\prod _{j=n+1}^m(x-\alpha _j)g(x)=-h(x)\prod _{j=n+1}^m(x-\alpha _j)\prod _{i=1}^s(x-\alpha _i)\) such that

$$\begin{aligned}&(v_1f(\alpha _1),\ldots , v_sf(\alpha _{s}),f(\alpha _{s+1}),\ldots ,f(\alpha _{n}))=(v_1^{-1}u_1g(\alpha _1 ),\ldots ,\\&\quad v_s^{-1}u_sg(\alpha _{s}),u_{s+1}g(\alpha _{s+1}),\ldots ,u_ng(\alpha _n)), \end{aligned}$$

which implies that

$$\begin{aligned} (v_1f(\alpha _1),\ldots , v_sf(\alpha _{s}),f(\alpha _{s+1}),\ldots ,f(\alpha _{n}))\in GRS_k(\mathbf {a},\mathbf {v})\cap GRS_k(\mathbf {a},\mathbf {v}) ^{\bot }. \end{aligned}$$

Therefore, \(\mathrm{dim}(\mathrm{Hull}(GRS_k(\mathbf {a},\mathbf {v})))=n-m+k-1-s+1=n-m+k-s\),    where \(1\le s \le n-m+k-1\). \(\square \)

Below, we provide another construction of MDS linear codes and determine their hulls.

Theorem 3.2

Let \(q>3\) be an odd prime power. Suppose that \(m>1\) is an integer with m|q and n is a positive integer such that \(1<n<m\). If \(1<k<\lfloor \frac{n}{2}\rfloor \) and \(2n-k-1<m\le 2n-2\), then there exists a q-ary [nk] MDS linear code with h-dimensional hull for any \(1\le h \le 2n-m-1\).

proof

According to m|q, we get that \({\mathbb F}_m\) is the finite field with m elements and label the elements of

$$\begin{aligned} {\mathbb F}_m=\{\alpha _1,\ldots ,\alpha _n,\alpha _{n+1},\ldots ,\alpha _m\}. \end{aligned}$$

Let s be an integer with \(m-n-k+1\le s \le n-k-1\). Take \(\mathbf {a}=(\alpha _1,\alpha _2,\ldots ,\alpha _{n})\) and \(\mathbf {v}=(v_1,v_2,\ldots ,v_n)\), where \(v_i=\prod _{j=1}^s(\alpha _i-\alpha _{n+j})\) for \(1\le i\le n\). Consider the GRS code \(GRS_k(\mathbf {a},\mathbf {v})\) of length n as follows:

$$\begin{aligned} GRS_k(\mathbf {a},\mathbf {v})=\{(v_1f(\alpha _1),\ldots ,v_nf(\alpha _n)):f(x)\in {\mathbb F}_q[x],\quad \mathrm{deg}(f(x))\le k-1\}. \end{aligned}$$

For an arbitrary codeword \((v_1f(\alpha _1),\ldots ,v_nf(\alpha _n))\) of \(GRS_k(\mathbf {a},\mathbf {v})\cap GRS_k(\mathbf {a},\mathbf {v})^{\bot }\), by Lemma 2.2, there exists a polynomial \(g(x)\in {\mathbb F}_q[x]\) with deg\((g(x))\le n-k-1\) such that

$$\begin{aligned} (v_1f(\alpha _1),\ldots ,v_nf(\alpha _{n}))=(v_1^{-1}u_1g(\alpha _1 ),\ldots ,v_n^{-1}u_ng(\alpha _n)), \end{aligned}$$

where \(u_i=\prod _{1\le j\le n,j\ne i}(\alpha _i-\alpha _j)^{-1}\) for \(1\le i\le n\), which implies that \(v_if(\alpha _i)=v_i^{-1}u_ig(\alpha _i)\) for \(1\le i\le n\). Since

$$\begin{aligned} v_if(\alpha _i)=\prod _{j=1}^s(\alpha _i-\alpha _{n+j})f(\alpha _i) \end{aligned}$$

and

$$\begin{aligned}&u_ig(\alpha _i)=\prod _{j=1}^s(\alpha _i-\alpha _{n+j})^{-1}\prod _{1\le j\le n,j\ne i}(\alpha _i-\alpha _j)^{-1}g(\alpha _i)=-\prod _{j=1}^s(\alpha _i-\alpha _{n+j})^{-1}\\&\quad \prod _{j=n+1}^m(\alpha _i-\alpha _j)g(\alpha _i), \end{aligned}$$

we obtain

$$\begin{aligned} \prod _{j=1}^s(\alpha _i-\alpha _{n+j})f(\alpha _i)=-\prod _{j=s+1}^{m-n}(\alpha _i-\alpha _{n+j})g(\alpha _i), \end{aligned}$$

for all \(1\le i\le n\). Note that

$$\begin{aligned} \mathrm{deg}\left( \prod _{j=1}^s(x-\alpha _{n+j})f(x)\right) \le s+k-1\le n-2 \end{aligned}$$

and

$$\begin{aligned} \mathrm{deg}\left( \prod _{j=s+1}^{m-n}(x-\alpha _{n+j})g(x)\right)\le & {} m-n-s+n-k-1\\= & {} m-s-k-1\\\le & {} m-(m-n-k+1)-k-1\\= & {} n-2. \end{aligned}$$

Hence, we deduce that \(\prod _{j=1}^s(x-\alpha _{n+j})f(x)=-\prod _{j=s+1}^{m-n}(x-\alpha _{n+j})g(x)\) for any \(x\in {\mathbb F}_q\), which implies that

$$\begin{aligned} \prod _{j=s+1}^{m-n}(x-\alpha _{n+j})| f(x). \end{aligned}$$

Suppose that \(f(x)=h(x)\prod _{j=s+1}^{m-n}(x-\alpha _{n+j})\), where \(h(x)\in {\mathbb F}_q\) and \(\mathrm{deg} (h(x))\le n+s+k-m-1\). For any \(f(x)\in {\mathbb F}_q[x]\) of the form \(f(x)=h(x)\prod _{j=s+1}^{m-n}(x-\alpha _{n+j})\), there exists a polynomial \(g(x)=-h(x)\prod _{j=1}^s(x-\alpha _{n+j})\) such that

$$\begin{aligned} (v_1f(\alpha _1),\ldots , v_nf(\alpha _{n}))=(v_1^{-1}u_1g(\alpha _1 ),\ldots ,v_n^{-1}u_ng(\alpha _n)), \end{aligned}$$

which implies that

$$\begin{aligned} (v_1f(\alpha _1),\ldots , v_nf(\alpha _{n}))\in GRS_k(\mathbf {a},\mathbf {v})\cap GRS_k(\mathbf {a},\mathbf {v}) ^{\bot }. \end{aligned}$$

Consequently, \(\mathrm{dim}(\mathrm{Hull}(GRS_k(\mathbf {a},\mathbf {v})))=n+s+k-m-1+1=n+s+k-m\), where \(m-n-k+1\le s \le n-k-1\).\(\square \)

Using Lemma 2.6, Theorems 3.1 and 3.2, we can easily obtain the following results.

Theorem 3.3

Let \(q>3\) be an odd prime power. Assume that \(m>1\) is an integer such that m|q and n is a positive integer with \(1<n<m\). If \(1<k\le \lfloor \frac{n}{2}\rfloor \) and \(n+k>m+1\), then there exist an \([[n,k-h,n-k+1;n-k-h]]_q\) EAQECC and an \([[n,n-k-h,k+1;k-h]]_q\) MDS EAQECC for any \(1\le h\le n-m+k-1\).

Example 1

Let \(q=13\), \(m=13\) and \(n=12\) in Theorem 3.3. Then we can obtain some new EAQECCs and MDS EAQECCs. Their parameters are listed in Table 2.

Table 2 Sample parameters of EAQECCs of Theorem 3.3 for \(q=13\), \(m=13\) and \(n=12\)

Theorem 3.4

Let \(q>3\) be an odd prime power. Let \(m>1\) be an integer with m|q and n a positive integer such that \(1<n<m\). If \(1<k<\lfloor \frac{n}{2}\rfloor \) and \(2n-k-1<m\le 2n-2\), then there exist an \([[n,k-h,n-k+1;n-k-h]]_q\) EAQECC and an \([[n,n-k-h,k+1;k-h]]_q\) MDS EAQECC for any \(1\le h \le 2n-m-1\).

Example 2

Let \(q=27\), \(m=27\) and \(n=15\) in Theorem 3.4. Then some new EAQECCs and MDS EAQECCs with the parameters are listed in Table 3.

Remark 1

From Tables 2 and 3, we see that the required number of maximally entangled states of the MDS EAQECC obtained by Theorems 3.3 or 3.4 is very flexible while the required number of maximally entangled states of many known MDS EAQECCs reported in the literature (see Table 1) is a fixed number. For instance, the MDS EAQECCs constructed in [9] have parameters \(\left[ \left[ \frac{q^2-1}{5},\frac{q^2-5q+4-20t}{5},\frac{q+5+4t}{2};4\right] \right] _q\) and its required number of maximally entangled states is always equal to 4. In fact, it is easy to check that the net rate \(\frac{k-c}{n}\) of the MDS EAQECC derived from Theorems 3.3 or 3.4 is ranged from 0 to \(\frac{n-4}{n}\). It is easier to obtain a large net rate of MDS EAQECCs from our constructions than those listed in Table 1. Above all, employing the MDS EAQECCs obtained by Theorems 3.3 and 3.4, one can obtain many catalytic quantum error correction codes with large rates and flexible parameters by the technique introduced in [4].

Table 3 Sample parameters of EAQECCs of Theorem 3.4 for \(q=27\), \(m=27\) and \(n=15\)

4 Conclusion

In this paper, we presented two constructions of generalized Reed–Solomon codes and evaluated the dimensions of their hulls. Employing these generalized Reed–Solomon codes, we have constructed two families of MDS EAQECCs over the finite field \(\mathbb {F}_{q}\), where \(q>3\) is an odd prime power. According to the entanglement-assisted quantum Singleton bound, the resulting EAQECCs are optimal. Notably, the parameters of our MDS EAQECCs are new and flexible. It would be interesting to construct optimal EAQECCs from other types of generalized Reed–Solomon codes.