1 Introduction

Quantum error-correcting codes play an important role in quantum information transmission and quantum computation. Due to the establishment of the connections between quantum codes and classical codes (see [2, 4, 23]), great progress has been made in the study of quantum error-correcting codes. One of these connections shows that quantum codes can be constructed from classical linear error-correcting codes satisfying symplectic, Euclidean or Hermitian self-orthogonal properties (see [1, 13, 24]).

Let q be a prime power. We use \([[n,k,d]]_q\) to denote a q-ary quantum code of length n, dimension \(q^k\) and minimum distance d. Similar to the classical counterparts, quantum codes have to satisfy the quantum Singleton bound: \(k\le n-2d+2\). The quantum code attaching this bound is called quantum maximum distance separable(MDS) code.

In the past few decades, quantum MDS codes have been extensively studied. The construction of q-ary quantum MDS codes with length \(n\le q+1\) has been investigated from classical Euclidean orthogonal codes (see [7, 20]). On the other hand, some quantum MDS codes with length \(n\ge q+1\) have been investigated, most of which have minimum distances less than \(\frac{q}{2}+1\) (see [11]). So it is a challenging and valuable task to construct quantum MDS codes with minimal distances larger than \(\frac{q}{2}+1\). Recently, researchers have constructed some of such quantum MDS codes utilizing constacyclic codes, negacyclic codes and generalized Reed–Solomon codes (see [3, 5, 6, 8,9,10,11,12, 14,15,16,17, 21, 22, 25,26,28]). However, q-ary quantum MDS codes with minimal distances bigger than \(\frac{q}{2}+1\) are far from complete.

There are dozens of papers on the construction of \([[n,n-2d,d+1]]_q\) quantum MDS codes with relatively large minimum distances. Most of the known \([[n,n-2d,d+1]]_q\) quantum MDS codes with minimum distances larger than \(\frac{q}{2}+1\) have lengths \(n\equiv 0,1\,(\mathrm {mod}\,q+1)\) (see [3, 5, 7, 9, 11, 14, 15, 21, 22, 28]) or \(n\equiv 0,1\,(\mathrm {mod}\,q-1)\) (see [5, 7, 9,10,11,12, 14, 21, 22, 25, 28]), except for the following cases.

  1. (i).

    \(n=q^2-l\) and \(d\le q-l-1\) for \(0\le l\le q-2 \) (see [17]).

  2. (ii).

    \(n=mq-l\) and \(d\le m-l\) for \(0\le l<m\) and \(1<m<q\) (see [17] and also [6] for \(l=0\)).

  3. (iii).

    \(n=t(q+1)+2\) and \(1\le d \le t+1\) for \(1\le t\le q-1\) and \((p,t,d)\ne (2,q-1,q)\) (see [6] and also [17] for \(t=q-1\)).

In this paper, we construct several new classes of quantum MDS codes whose minimum distances can be larger than \(\frac{q}{2}+1\) via generalized Reed–Solomon codes and Hermitian construction. Their lengths are different from the above three cases and also in most cases are not of the form \(n\equiv 0,1\,({\mathrm {mod}}\,q\pm 1)\). More precisely, the parameters of \([[n,n-2d,d+1]]_q\) quantum MDS codes are as follows:

  1. (i).

    \(n=1+lh+mr-\frac{q^2-1}{st}\cdot hr\) and \(1\le d\le \min \{\frac{s+h}{2}\cdot \frac{q+1}{s}-1,\frac{q+1}{2}+\frac{q-1}{t}-1\}\), for odd \(s\mid q+1\), even \(t\mid q-1\), \(t\ge 2\), \(l=\frac{q^2-1}{s}\), \(m=\frac{q^2-1}{t}\), odd \(h\le s-1\), \(r\le t\) and \(q-1>\frac{q^2-1}{st}\cdot hr\) (see Theorem 3);

  2. (ii).

    \(n=lh+mr-\frac{q^2-1}{st}\cdot hr\) and \(1\le d\le \min \{\lfloor \frac{s+h}{2}\rfloor \cdot \frac{q+1}{s}-2,\frac{q+1}{2}+\frac{q-1}{t}-1\}\), for odd \(s\mid q+1\), even \(t\mid q-1\), \(t\ge 2\), \(l=\frac{q^2-1}{s}\), \(m=\frac{q^2-1}{t}\), \(h\le s-1\), \(r\le t\) and \(q-1>\frac{q^2-1}{st}\cdot hr\) (see Theorem 4);

  3. (iii).

    \(n=lh+mr\) and \(1\le d\le \min \{\lfloor \frac{s+h}{2}\rfloor \cdot \frac{q+1}{s}-2,\frac{q+1}{2}+\frac{q-1}{t}-1\}\), for even \(s\mid q+1\), even \(t\mid q-1\), \(t\ge 2\), \(l=\frac{q^2-1}{s}\), \(m=\frac{q^2-1}{t}\), \(h\le \frac{s}{2}\) and \(r\le \frac{t}{2}\) (see Theorem 5).

This paper is organized as follows. In Sect. 2, we will introduce some basic knowledge and useful results on Hermitian self-orthogonality and generalized Reed–Solomon codes, which will be utilized in the proof of main results. In Sects. 3, 4 and 5, we will present our main results on the constructions of quantum MDS codes. In Sect. 6, we will make a conclusion.

2 Preliminaries

In this section, we introduce some basic notations and useful results on Hermitian self-orthogonality and generalized Reed–Solomon codes (or GRS codes for short).

Let \({\mathbb {F}}_{q^2}\) be the finite field with \(q^2\) elements and \({\mathbb {F}}_{q^2}^*={\mathbb {F}}_{q^2}\backslash \{0\}\), where q is a prime power. Obviously, \({\mathbb {F}}_{q}\) is a subfield of \({\mathbb {F}}_{q^{2}}\) with q elements and denoted by \({\mathbb {F}}_{q}^{*}={\mathbb {F}}_{q}\backslash \{0\}\). For any two vectors \(\overrightarrow{x}=(x_1,\ldots ,x_n)\) and \(\overrightarrow{y}=(y_1,\ldots ,y_n)\in {\mathbb {F}}_{q^2}\), the Euclidean and Hermitian inner products are defined as

$$\begin{aligned} \langle \overrightarrow{x},\overrightarrow{y}\rangle =\sum \limits _{i=1}^nx_iy_i \end{aligned}$$

and

$$\begin{aligned} \langle \overrightarrow{x},\overrightarrow{y}\rangle _H=\sum \limits _{i=1}^nx_iy_i^q, \end{aligned}$$

respectively.

For a linear code C of length n over \({\mathbb {F}}_{q^2}\), the Euclidean dual code of C is defined as

$$\begin{aligned} C^\perp :=\{\overrightarrow{x}\in {\mathbb {F}}_{q^2}^n:\langle \overrightarrow{x},\overrightarrow{y}\rangle =0, \,\,\text {for all}\,\,\overrightarrow{y}\in C\}, \end{aligned}$$

and the Hermitian dual code of C is defined as

$$\begin{aligned} C^{\perp _H}:=\{\overrightarrow{x}\in {\mathbb {F}}_{q^2}^n:\langle \overrightarrow{x},\overrightarrow{y}\rangle _H=0, \,\,\text {for all}\,\,\overrightarrow{y}\in C\}. \end{aligned}$$

If \(C\subseteq C^{\perp _H}\), the code C is called Hermitian self-orthogonal.

Ashikhmin and Knill [2] proposed the Hermitian construction of quantum codes, which is a very important technique for constructing quantum codes from classical codes.

Theorem 1

[2, Corollary 1] A q-ary quantum \([[n,n-2d,d+1]]_q\) MDS code exists provided that an \([n,d,n-d+1]_{q^2}\) MDS Hermitian self-orthogonal code exists.

Choose two vectors \(\overrightarrow{v}=(v_{1},v_{2},\ldots ,v_{n})\) and \(\overrightarrow{a}=(a_{1},a_{2},\ldots ,a_{n})\), where \(v_{i}\in {\mathbb {F}}_{q^2}^{*}\) (\(v_{i}\) may not be distinct) and \(a_{i}\) are distinct elements in \({\mathbb {F}}_{q^2}\). For an integer d with \(1\le d\le n\), the GRS code of length n associated with \(\overrightarrow{v}\) and \(\overrightarrow{a}\) is defined as follows:

$$\begin{aligned} {{\mathbf {GRS}}}_{d}(\overrightarrow{a},\overrightarrow{v}) =\{(v_{1}f(a_{1}),\ldots ,v_{n}f(a_{n})):f(x) \in {\mathbb {F}}_{q^2}[x],{\mathrm {deg}}(f(x))\le d-1\}. \end{aligned}$$
(1)

A generator matrix of the code \({{\mathbf {GRS}}}_{d}(\overrightarrow{a},\overrightarrow{v})\) is

$$\begin{aligned} G_{d}(\overrightarrow{a},\overrightarrow{v})= \left( \begin{array}{cccc} v_1 &{} v_2 &{} \cdots &{} v_n \\ v_1a_1 &{} v_2a_{2} &{} \cdots &{} v_na_{n} \\ \vdots &{} \vdots &{} \ddots &{} \vdots \\ v_1a_1^{d-1} &{} v_2a_2^{d-1} &{} \cdots &{} v_na_n^{d-1} \\ \end{array} \right) . \end{aligned}$$
(2)

It is well known that the code \({{\mathbf {GRS}}}_{d}(\overrightarrow{a},\overrightarrow{v})\) is a q-ary \([n,d,n-d+1]\) MDS code [18, Chapter 11]. The following theorem will be useful, and it has been shown in [19, 28].

Theorem 2

[19, 28] The two vectors \(\overrightarrow{a}=(a_1,\ldots ,a_n)\) and \(\overrightarrow{v}=(v_1,\ldots ,v_n)\) are defined above. Then, \({{\mathbf {GRS}}}_{d}(\overrightarrow{a},\overrightarrow{v})\) is Hermitian self-orthogonal if and only if \(\langle \overrightarrow{a}^{qi+j},\overrightarrow{v}^{q+1}\rangle =0\), for all \(0\le i,j\le d-1\).

If there are no specific statements, the following notations are fixed throughout this paper.

  • Let \(s\mid q+1\) and \(t\mid q-1\) with t even.

  • Let \(l=\frac{q^{2}-1}{s}\) and \(m=\frac{q^{2}-1}{t}\).

  • Let g be a primitive element of \({\mathbb {F}}_{q^2}\), \(\delta =g^s\) and \(\theta =g^t\).

Lemma 2.1

Suppose \(\gcd (s,t)=1\). For any \(\alpha ,\beta \in {\mathbb {Z}}_{q^2-1}\), the number of (ij) of the equation \(\alpha +si\equiv \beta +tj\,({\mathrm {mod}}\,q^{2}-1)\) satisfying \(0\le i<\frac{q^2-1}{s}\) and \(0\le j<\frac{q^2-1}{t}\) is \(\frac{q^2-1}{st}\).

Proof

Let \(\beta -\alpha =\gamma \). From \(\alpha +si\equiv \beta +tj\,({\mathrm {mod}}\,q^{2}-1)\), we have \(si-tj\equiv \gamma \,({\mathrm {mod}}\,q^{2}-1)\). When \(0\le i<\frac{q^2-1}{s}\) and \(0\le j<\frac{q^2-1}{t}\), \(si-tj\,\,{\mathrm {mod}}\,\,q^2-1\) runs \(\frac{q^2-1}{st}\) times through every element of \({{\mathbb {Z}}}_{q^2-1}\).

Indeed, for any \(\gamma \in {{\mathbb {Z}}}_{q^2-1}\), we have \(si-tj\equiv \gamma \,({\mathrm {mod}}\,q^{2}-1)\Leftrightarrow s\mid tj+\gamma \Leftrightarrow tj\equiv -\gamma \,({\mathrm {mod}}\,s)\). Since \(\gcd (s,t)=1\), then \(j\,\,{\mathrm {mod}}\,\,s\) is unique. So when \(0\le j<\frac{q^2-1}{t}\), the number of j satisfying the equation is \(\frac{q^2-1}{st}\). The values of \(\gamma \) and i will be determined after fixing j. So the number of (ij) of the equation \(\alpha +si\equiv \beta +tj\,({\mathrm {mod}}\,q^{2}-1)\) is \(\frac{q^2-1}{st}\) satisfying \(0\le i<\frac{q^2-1}{s}\) and \(0\le j<\frac{q^2-1}{t}\) is \(\frac{q^2-1}{st}\). \(\square \)

The following two lemmas have been shown in [5, 9]. In order to make the paper self-completeness, we will give proofs.

Lemma 2.2

[5, Lemmas 5 and 11] Assume that \(h\le s-1\).

  1. (i).

    For any \(0\le i,j\le \lfloor \frac{s+h}{2}\rfloor \cdot \frac{q+1}{s}-3\), \(l\mid (qi+j+q+1)\) if and only if \(qi+j+q+1=\mu \cdot l\), with \(\lceil \frac{s-h}{2}\rceil +1\le \mu \le \lfloor \frac{s+h}{2}\rfloor -1\).

  2. (ii).

    For any \(0\le i,j\le \lfloor \frac{s+h}{2}\rfloor \cdot \frac{q+1}{s}-2\) with \((i,j)\ne (0,0)\), \(l\mid (qi+j)\) if and only if \(qi+j=\mu \cdot l\), with \(\lceil \frac{s-h}{2}\rceil +1\le \mu \le \lfloor \frac{s+h}{2}\rfloor -1\).

Proof

  1. (i).

    When \(s\equiv h\,({\mathrm {mod}}\,2)\), it implies \(\lfloor \frac{s+h}{2}\rfloor =\frac{s+h}{2}\) and \(\lceil \frac{s-h}{2}\rceil =\frac{s-h}{2}\). Since \(0\le i,j\le \frac{s+h}{2}\cdot \frac{q+1}{s}-3<q-2\), \(0<qi+j+q+1< q^2-1\), that is \(0<\mu <s\). From \(qi+j+q+1=q\left( \frac{\mu \cdot (q+1)}{s}-1\right) +\left( q-\frac{\mu \cdot (q+1)}{s}\right) \), it follows that

    $$\begin{aligned} i=\frac{\mu \cdot (q+1)}{s}-2,\quad j=q-\frac{\mu \cdot (q+1)}{s}-1. \end{aligned}$$

    By \(i<\frac{s+h}{2}\cdot \frac{q+1}{s}-2\) and \(j<\frac{s+h}{2}\cdot \frac{q+1}{s}-2\), it implies \(\frac{s-h}{2}<\mu <\frac{s+h}{2}\). So \(l\mid (qi+j)\) if and only if \(qi+j=\mu \cdot l\), with \(\frac{s-h}{2}+1\le \mu \le \frac{s+h}{2}-1\).

    When \(s\not \equiv h\,({\mathrm {mod}}\,2)\), it implies \(\lfloor \frac{s+h}{2}\rfloor =\frac{s+h-1}{2}\) and \(\lceil \frac{s-h}{2}\rceil =\frac{s-h+1}{2}\). Then, the proof can be completed by proceeding as the situation that \(s\equiv h\,({\mathrm {mod}}\,2)\).

  2. (ii).

    In a similar way, we can complete the proof. So we omit the details.

\(\square \)

Lemma 2.3

[9, Lemma 3.1] The identity \(\sum _{\nu =0}^{m-1}\theta ^{\nu \left( qi+j+\frac{q+1}{2}\right) }=0\) holds for all \(0\le i,j\le \frac{q+1}{2}+\frac{q-1}{t}-2\), with even \(t\ge 2\).

Proof

It is easy to check that the identity holds if and only if \(m\not \mid qi+j+\frac{q+1}{2}\). On the contrary, assume that \(m\mid qi+j+\frac{q+1}{2}\). Let

$$\begin{aligned} qi+j+\frac{q+1}{2}=\mu \cdot m=q\cdot \frac{\mu (q-1)}{t}+\frac{\mu (q-1)}{t} \end{aligned}$$
(3)

with \(\mu \in {\mathbb {Z}}\). By \(t\ge 2\), we have \(qi+j+\frac{q+1}{2}<q^2-1\), which implies \(0<\mu <t\).

  • If \(j+\frac{q+1}{2}\le q-1\), comparing remainder and quotient of module q on both sides of (3), we can deduce \(i=j+\frac{q+1}{2}=\mu \cdot \frac{q-1}{t}\). Since t is even, \(\frac{q-1}{t}\mid \frac{q-1}{2}\). From \(\frac{q-1}{t}\mid j+1+\frac{q-1}{2}\), we can deduce that \(\frac{q-1}{t}\mid j+1\). Since \(j+1\ge 1\), \(j+1\ge \frac{q-1}{t}\). So \(i=j+\frac{q+1}{2}\ge \frac{q+1}{2}+\frac{q-1}{t}-1\), which is a contradiction.

  • When \(j+\frac{q+1}{2}\ge q\), it takes \(qi+j+\frac{q+1}{2}=q(i+1)+\left( j-\frac{q-1}{2}\right) =q\cdot \frac{\mu (q-1)}{t}+\frac{\mu (q-1)}{t}\). In a similar way, \(j-\frac{q-1}{2}=i+1=\mu \cdot \frac{q-1}{t}\) which implies \(\frac{q-1}{t}\mid i+1\). Since \(i+1\ge 1\), \(i+1\ge \frac{q-1}{t}\). Therefore, \(j=i+1+\frac{q-1}{2}\ge \frac{q+1}{2}+\frac{q-1}{t}-1\), which is a contradiction.

As a result, \(m\not \mid qi+j+\frac{q+1}{2}\) which yields \(\sum _{\nu =0}^{m-1}\theta ^{\nu (qi+j+\frac{q+1}{2})}=0\) for all \(0\le i,j\le \frac{q+1}{2}+\frac{q-1}{t}-2\). \(\square \)

3 Quantum MDS codes of length \(n=1+lh+mr-\frac{q^2-1}{st}\cdot hr\)

In this section, we assume that \({\mathbf {s}}\,\,{\mathbf {is}}\,\,{\mathbf {odd}}\), \({\mathbf {h}}\le {\mathbf {s-1}}\) with \({\mathbf {h}}\,\,{\mathbf {odd}}\) and \({\mathbf {r}}\le {\mathbf {t}}\). Quantum MDS codes of length \(n=1+lh+mr-\frac{q^2-1}{st}\cdot hr\) will be constructed. The construction is based on [5, 9]. Firstly, we choose elements in \({\mathbb {F}}_{q^2}^*/\langle \delta \rangle \) as the first part of coordinates in the vector \(\overrightarrow{a}\). Secondly, we choose elements from cosets of \({\mathbb {F}}_{q^2}^*/\langle \theta \rangle \) as the second part of coordinates in \(\overrightarrow{a}\). Finally, we consider the duplicating elements between these two parts. We construct the vector \(\overrightarrow{v}\) in a similar way. Then, we can construct quantum MDS codes of length \(n=1+lh+mr-\frac{q^2-1}{st}\cdot hr\), whose minimum distances can be bigger than \(\frac{q}{2}+1\).

The next lemma has been shown in [5]. We give a new proof by Cramer’s rule, which is shorter than [5].

Lemma 3.1

[5, Lemma 7] For \(\frac{s-h}{2}+1\le \mu \le \frac{s+h}{2}-1\), there exists a solution in \(({\mathbb {F}}_{q}^*)^{h}\) of the following system of equations

$$\begin{aligned} {\left\{ \begin{array}{ll} u_{0}+u_{1}+\cdots +u_{h-1}=1\\ \sum \limits _{k=0}^{h-1}g^{k\mu l}u_{k}=0&{} \end{array}\right. } \end{aligned}$$
(4)

Proof

Denote \(\xi =g^l\) and \(c=\frac{s-h}{2}+1\). For any \(0\le \nu \ne \nu '\le h-2<s-2\), the elements \(\xi ^{c+\nu }\), \(\xi ^{c+\nu '}\) and 1 are distinct. The system of Eq. (4) can be expressed in the matrix form

$$\begin{aligned} \begin{aligned} A\overrightarrow{u}^{T}=(1,0,\ldots ,0)^T, \end{aligned} \end{aligned}$$
(5)

where

$$\begin{aligned} A= \left( \begin{array}{cccc} 1 &{} 1 &{} \cdots &{} 1 \\ 1 &{} \xi ^{c} &{} \cdots &{} \xi ^{(h-1)c} \\ \vdots &{} \vdots &{} \ddots &{} \vdots \\ 1 &{} \xi ^{c+h-2} &{} \cdots &{} \xi ^{(h-1)(c+h-2)} \\ \end{array} \right) _{h\times h} \end{aligned}$$

and

$$\begin{aligned} \overrightarrow{u}=(u_{0},u_{1},\ldots ,u_{h-1}). \end{aligned}$$

We will show that \(u_k\in {\mathbb {F}}_q^*\) for any \(0\le k\le h-1\).

It is obvious that \({\mathrm {det}}(A)\ne 0\). By Cramer’s rule,

$$\begin{aligned} u_k=\frac{(-1)^{k}\cdot {\mathrm {det}}(D_{k})}{\mathrm {det}(A)}, \end{aligned}$$

where

$$\begin{aligned} D_{k}= \left( \begin{array}{ccccccc} 1 &{} \xi ^{c} &{} \cdots &{} \xi ^{(k-1)c} &{} \xi ^{(k+1)c} &{} \cdots &{} \xi ^{(h-1)c} \\ 1 &{} \xi ^{c+1} &{} \cdots &{} \xi ^{(k-1)(c+1)} &{} \xi ^{(k+1)(c+1)} &{} \cdots &{} \xi ^{(h-1)(c+1)} \\ \vdots &{} \vdots &{} \ddots &{} \vdots &{} \vdots &{} \ddots &{} \vdots \\ 1 &{} \xi ^{c+h-2} &{} \cdots &{} \xi ^{(k-1)(c+h-2)} &{} \xi ^{(k+1)(c+h-2)} &{} \cdots &{} \xi ^{(h-1)(c+h-2)} \\ \end{array} \right) \end{aligned}$$
(6)

is an \((h-1)\times (h-1)\) matrix obtained from A by deleting the first row and the \((k+1)\)th column with \(0\le k\le h-1\). It is easy to see \({\mathrm {det}}(D_{k})\) is equal to nonzero constant times of a Vandermonde determinant. So \({\mathrm {det}}(D_{k})\ne 0\), which implies \(u_k\ne 0\).

It remains to show \(u_{k}\in {\mathbb {F}}_q\), for any \(0\le k\le h-1\). Since \(s\mid q+1\) and \(\xi ^s=1\),

$$\begin{aligned} \xi ^{k(c+\nu )q}=\xi ^{-k\left( \frac{s-h}{2}+1+\nu \right) }=\xi ^{k\left( \frac{s+h}{2}-1-\nu \right) }=\xi ^{k(c+h-2-\nu )}, \end{aligned}$$

for any \(0\le k\le h-1\) and \(0\le \nu \le h-2\). So \(({\mathrm {det}}(A))^q=(-1)^{\frac{h-1}{2}}\cdot {\mathrm {det}}(A)\) and \({\mathrm {det}}(D_{k})^{q}=(-1)^{\frac{h-1}{2}}\cdot {\mathrm {det}}(D_{k})\). It follows that \(u_k^q=\frac{(-1)^{qk}\cdot {\mathrm {det}}(D_{k})^q}{({\mathrm {det}}(A))^q}=\frac{(-1)^{k}\cdot {\mathrm {det}}(D_{k})}{{\mathrm {det}}(A)}=u_k\), which implies \(u_k\in {\mathbb {F}}_{q}^*\) with \(0\le k\le h-1\). This completes the proof. \(\square \)

Now, we let \(\overrightarrow{u}=(u_0,u_1,\ldots ,u_{h-1})\) satisfy the system of Eq. (4). Choose

$$\begin{aligned} \overrightarrow{a}_1=(0,1,\delta ,\ldots ,\delta ^{l-1},g,g\delta ,\ldots ,g\delta ^{l-1},\ldots , g^{h-1},g^{h-1}\delta ,\ldots ,g^{h-1}\delta ^{l-1}) \end{aligned}$$

and

$$\begin{aligned} \overrightarrow{v}_1=(e,\underbrace{v_{0},\ldots ,v_{0}}_{l\,\, \text {times}},\ldots ,\underbrace{v_{h-1},\ldots ,v_{h-1}}_{l\,\, \text {times}}), \end{aligned}$$

where \(v_{k}^{q+1}=u_k\) (\(0\le k\le h-1\)) and \(e^{q+1}=-l\). Then, we have the following lemma, which has been shown in [5]. We give proof in order to make the paper self-completeness.

Lemma 3.2

[5, Theorem 3] The identity

$$\begin{aligned} \langle \overrightarrow{a}_1^{qi+j},\overrightarrow{v}_1^{q+1}\rangle =0 \end{aligned}$$

holds for all \(0\le i,j\le \frac{s+h}{2}\cdot \frac{q+1}{s}-2\).

Proof

When \((i,j)=(0,0)\),

$$\begin{aligned} \langle \overrightarrow{a}_1^{0},\overrightarrow{v}_1^{q+1}\rangle =e^{q+1}+l(v_{0}^{q+1}+\cdots +v_{h-1}^{q+1})=-l+l(u_0+\cdots + u_{h-1})=0. \end{aligned}$$

When \((i,j)\ne (0,0)\), since \(\delta \) is of order l,

$$\begin{aligned} \langle \overrightarrow{a}_1^{qi+j},\overrightarrow{v}_1^{q+1}\rangle =\sum \limits _{k=0}^{h-1}g^{k(qi+j)}v_{k}^{q+1} \sum \limits _{\nu =0}^{l-1}\delta ^{\nu (qi+j)}= {\left\{ \begin{array}{ll} 0,&{} l\not \mid qi+j,\\ l\cdot \sum \limits _{k=0}^{h-1}g^{k(qi+j)}v_{k}^{q+1},&{} l\mid qi+j. \end{array}\right. } \end{aligned}$$

We consider the case \(l\mid qi+j\). According to Lemma 2.2 (ii) and Lemma 3.1,

$$\begin{aligned} \langle \overrightarrow{a}_1^{qi+j},\overrightarrow{v}_1^{q+1}\rangle =\langle \overrightarrow{a}_1^{\mu l},\overrightarrow{v}_1^{q+1}\rangle =l\cdot \sum \limits _{k=0}^{h-1}g^{k\mu l}v_{k}^{q+1} =l\cdot \sum \limits _{k=0}^{h-1}g^{k\mu l}u_{k}=0. \end{aligned}$$

Therefore, the result holds. \(\square \)

For the second part of \(\overrightarrow{a}\) and \(\overrightarrow{v}\), we choose

$$\begin{aligned} \overrightarrow{a}_2=(1,\theta ,\ldots ,\theta ^{m-1},g,g\theta ,\ldots ,g\theta ^{m-1}, \ldots ,g^{r-1},g^{r-1}\theta ,\ldots ,g^{r-1}\theta ^{m-1}) \end{aligned}$$

and

$$\begin{aligned} \overrightarrow{v}_2=(1,g^{\frac{t}{2}},\ldots ,g^{(m-1)\cdot \frac{t}{2}},1,g^{\frac{t}{2}}, \ldots ,g^{(m-1)\cdot \frac{t}{2}},\ldots ,1,g^{\frac{t}{2}},\ldots ,g^{(m-1)\cdot \frac{t}{2}}). \end{aligned}$$

Then, the following lemma can be obtained.

Lemma 3.3

The identity

$$\begin{aligned} \langle \overrightarrow{a}_2^{qi+j},\overrightarrow{v}_2^{q+1}\rangle =0 \end{aligned}$$

holds for all \(0\le i,j\le \frac{q+1}{2}+\frac{q-1}{t}-2\).

Proof

By Lemma 2.3, we can calculate directly

$$\begin{aligned} \begin{aligned} \langle \overrightarrow{a}_2^{qi+j},\overrightarrow{v}_2^{q+1}\rangle&=\sum \limits _{k=0}^{r-1}\sum \limits _{\nu =0}^{m-1} (g^k\theta ^{\nu })^{qi+j}\cdot \theta ^{\nu \cdot \frac{q+1}{2}}&\\&=\sum \limits _{k=0}^{r-1}g^{k(qi+j)}\sum \limits _{\nu =0}^{m-1}\theta ^{\nu (qi+j+\frac{q+1}{2})}&\\&=0.&\end{aligned} \end{aligned}$$
(7)

\(\square \)

Now, we give our first construction.

Theorem 3

Let \(n=1+lh+mr-\frac{q^2-1}{st}\cdot hr\), where odd \(s\mid q+1\), even \(t\mid q-1\), \(t\ge 2\), \(l=\frac{q^2-1}{s}\), \(m=\frac{q^2-1}{t}\), odd \(h\le s-1\) and \(r\le t\). If \(q-1>\frac{q^2-1}{st}\cdot hr\), then for any \(1\le d\le \min \{\frac{s+h}{2}\cdot \frac{q+1}{s}-1,\frac{q+1}{2}+\frac{q-1}{t}-1\}\), there exists an \([[n,n-2d,d+1]]_q\) quantum MDS code.

Proof

Denote

$$\begin{aligned} A=\{g^\alpha \delta ^i|0\le \alpha \le h-1,\quad 0\le i\le l-1\} \end{aligned}$$

and

$$\begin{aligned} B=\{g^\beta \theta ^j|0\le \beta \le r-1,\quad 0\le j\le m-1\}. \end{aligned}$$

From Lemma 2.1, we know \(|A\cap B|=\frac{q^2-1}{st}\cdot hr\). Let \(A_1=A-B\) and \(B_1=B-A\). Define

$$\begin{aligned} \begin{array}{lcr} f_1:A\cup \{0\}\rightarrow {\mathbb {F}}_q^*,\quad f_1(g^\alpha \delta ^i)=v_\alpha ^{q+1}\quad \text {and}\quad f_1(0)=-l,\\ f_2:B\rightarrow {\mathbb {F}}_q^*,\quad f_2(g^\beta \theta ^j)=\theta ^{j\cdot \frac{q+1}{2}}.\\ \end{array} \end{aligned}$$

Let

$$\begin{aligned} \overrightarrow{a}=(0,\overrightarrow{a}_{A_1},\overrightarrow{a}_{B_1},\overrightarrow{a}_{A\cap B}), \end{aligned}$$

where \(\overrightarrow{a}_{S}=(a_1,\ldots ,a_k)\) for \(S=\{a_1,\ldots ,a_k\}\) and

$$\begin{aligned} \overrightarrow{v}^{q+1}=(-l, f_1(\overrightarrow{a}_{A_1}),\lambda f_2(\overrightarrow{a}_{B_1}),f_1(\overrightarrow{a}_{A\cap B})+\lambda f_2(\overrightarrow{a}_{A\cap B})), \end{aligned}$$

where \(\lambda \in {\mathbb {F}}_q^*\) and \(f_j(\overrightarrow{a}_{S})=(f_j(a_1),\ldots ,f_j(a_k))\) with \(S=\{a_1,\ldots ,a_k\}\) and \(j=1,2\).

Indeed, since \(q-1>\frac{q^2-1}{st}\cdot hr=|A\cap B|\), there exists \(\lambda \in {\mathbb {F}}_q^*\) such that all coordinates of \(f_1(\overrightarrow{a}_{A\cap B})+\lambda f_2(\overrightarrow{a}_{A\cap B})\) are nonzero.

According to Lemmas 3.2 and 3.3, it takes

$$\begin{aligned} \langle \overrightarrow{a}^{qi+j},\overrightarrow{v}^{q+1}\rangle =\langle \overrightarrow{a}_1^{qi+j},\overrightarrow{v}_1^{q+1}\rangle +\lambda \langle \overrightarrow{a}_2^{qi+j},\overrightarrow{v}_2^{q+1}\rangle =0, \end{aligned}$$

for any \(0\le i,j\le d-1\). As a consequence, by Theorem 2, \({\mathbf {GRS}}_{d}(\overrightarrow{a},\overrightarrow{v})\) is Hermitian self-orthogonal. Therefore, by Theorem 1, there exists an \([[n,n-2d,d+1]]_q\) quantum MDS code, where \(n=1+lh+mr-\frac{q^2-1}{st}\cdot hr\) and \(1\le d\le \min \{\frac{s+h}{2}\cdot \frac{q+1}{s}-1,\frac{q+1}{2}+\frac{q-1}{t}-1\}\). \(\square \)

Remark 3.1

We try to choose sht such that \(\frac{s+h}{2}\cdot \frac{q+1}{s}-1\approx \frac{q+1}{2}+\frac{q-1}{t}-1\). For large q, we take \(s\approx \frac{1}{2}\sqrt{2(q+1)}\cdot h\) and \(t\approx \sqrt{2(q+1)}\). Then, it follows that

$$\begin{aligned} \frac{s+h}{2}\cdot \frac{q+1}{s}-1\approx \frac{q}{2}+\sqrt{\frac{q}{2}}\quad \text {and}\quad \frac{q+1}{2}+\frac{q-1}{t}-1\approx \frac{q}{2}+\sqrt{\frac{q}{2}}. \end{aligned}$$

This indicates that the minimum distance of the quantum MDS code in Theorem 3 can reach \(\frac{q}{2}+\sqrt{\frac{q}{2}}\) approximately.

Example 3.1

Let \(q=641\). Choose \(s=107\), \(t=32\), \(h=5\) and \(r=1\). In this case, one has \(\frac{s+h}{2s}\cdot (q+1)-1=341\) and \(\frac{q+1}{2}+\frac{q-1}{t}-1=340\approx \frac{q}{2}+\sqrt{\frac{q}{2}}=338.4\). The length is \(n=1+lh+mr-\frac{q^2-1}{st}\cdot hr=16{,}081\). There exists \([[16081, 15401, 341]]_{641}\) quantum MDS code, which has not been covered in any previous work.

4 Quantum MDS codes of length \(n=lh+mr-\frac{q^2-1}{st}\cdot hr\)

In this section, we assume \({\mathbf {s}}\,\,{\mathbf {is}}\,\,{\mathbf {odd}}\), \({\mathbf {h}}\le {\mathbf {s-1}}\) and \({\mathbf {r}}\le {\mathbf {t}}\). Now, we consider the first part of coordinates in vectors \(\overrightarrow{a}\) and \(\overrightarrow{v}\). Firstly, we give two useful lemmas that are Lemmas 4.1 and 4.2, which generalize Lemma 13 and Theorem 5 in [5], respectively.

Lemma 4.1

There exists a solution in \(({\mathbb {F}}_{q}^*)^{h}\) of the following system of equations

$$\begin{aligned} \begin{aligned} \sum \limits _{k=0}^{h-1}g^{k(\mu l-q-1)}u_{k}=0 \end{aligned} \end{aligned}$$
(8)

for \(\lceil \frac{s-h}{2}\rceil +1\le \mu \le \lfloor \frac{s+h}{2}\rfloor -1\).

Proof

Let \(\xi =g^l\), \(\eta =g^{-q-1}\in {\mathbb {F}}_q^*\) and \(c=\lceil \frac{s-h}{2}\rceil +1\). It is clear that \(\xi ^{c+\nu }\ne \xi ^{c+\nu '}\) for any \(0\le \nu \ne \nu '\le h-2<s-2\). We discuss two cases.

Case 1 h is odd. In this case, \(\lceil \frac{s-h}{2}\rceil =\frac{s-h}{2}\) and \(\lfloor \frac{s+h}{2}\rfloor =\frac{s+h}{2}\). The system of equations (8) can be expressed in the matrix form

$$\begin{aligned} \begin{aligned} A\overrightarrow{u}^{T}=(0,0,\ldots ,0)^T, \end{aligned} \end{aligned}$$
(9)

where

$$\begin{aligned} A= \left( \begin{array}{ccccc} 1 &{} \xi ^{c}\eta &{} \xi ^{2c}\eta ^2 &{} \cdots &{} \xi ^{(h-1)c}\eta ^{h-1} \\ 1 &{} \xi ^{c+1}\eta &{} \xi ^{2(c+1)}\eta ^2 &{} \cdots &{} \xi ^{(h-1)(c+1)}\eta ^{h-1} \\ \vdots &{} \vdots &{} \vdots &{} \ddots &{} \vdots \\ 1 &{} \xi ^{c+h-2}\eta &{} \xi ^{2(c+h-2)}\eta ^2 &{} \cdots &{} \xi ^{(h-1)(c+h-2)}\eta ^{h-1} \\ \end{array} \right) \end{aligned}$$

is an \((h-1)\times h\) matrix over \({\mathbb {F}}_{q^2}\) and

$$\begin{aligned} \overrightarrow{u}=(u_{0},u_{1},\ldots ,u_{h-1}). \end{aligned}$$

It is obvious that \({{\mathrm {rank}}}(A)=h-1\). We will show that \(u_k\in {\mathbb {F}}_q^*\) for any \(0\le k\le h-1\).

Let

$$\begin{aligned} A'= \left( \begin{array}{ccccc} 1 &{} 1 &{} 1 &{} \cdots &{} 1 \\ 1 &{} \xi ^{c}\eta &{} \xi ^{2c}\eta ^2 &{} \cdots &{} \xi ^{(h-1)c}\eta ^{h-1} \\ 1 &{} \xi ^{c+1}\eta &{} \xi ^{2(c+1)}\eta ^2 &{} \cdots &{} \xi ^{(h-1)(c+1)}\eta ^{h-1} \\ \vdots &{} \vdots &{} \vdots &{} \ddots &{} \vdots \\ 1 &{} \xi ^{c+h-2}\eta &{} \xi ^{2(c+h-2)}\eta ^2 &{} \cdots &{} \xi ^{(h-1)(c+h-2)}\eta ^{h-1} \\ \end{array} \right) . \end{aligned}$$

We consider the equations

$$\begin{aligned} \begin{aligned} A'\overrightarrow{u}^{T}=(1,0,0,\ldots ,0)^T. \end{aligned} \end{aligned}$$
(10)

It is easy to check that \(A'\) is row equivalent to \(A'^{(q)}\) and \(\det (A')\ne 0\). Similarly as the proof of Lemma 3.1, we obtain that (10) has a solution \(\overrightarrow{u}=(u_{0},u_{1},\ldots ,u_{h-1})\in ({\mathbb {F}}_{q}^*)^{h}\). Since the solution of (10) is also the solution of (9), the result has been proved.

Case 2 h is even. In this case, \(\lceil \frac{s-h}{2}\rceil =\frac{s-h+1}{2}\) and \(\lfloor \frac{s+h}{2}\rfloor =\frac{s+h-1}{2}\). The system of equations (8) can be expressed in the matrix form

$$\begin{aligned} \begin{aligned} A\overrightarrow{u}^{T}=(0,0,\ldots ,0)^T, \end{aligned} \end{aligned}$$
(11)

where

$$\begin{aligned} A= \left( \begin{array}{ccccc} 1 &{} \xi ^{c}\eta &{} \xi ^{2c}\eta ^2 &{} \cdots &{} \xi ^{(h-1)c}\eta ^{h-1} \\ 1 &{} \xi ^{c+1}\eta &{} \xi ^{2(c+1)}\eta ^2 &{} \cdots &{} \xi ^{(h-1)(c+1)}\eta ^{h-1} \\ \vdots &{} \vdots &{} \vdots &{} \ddots &{} \vdots \\ 1 &{} \xi ^{c+h-3}\eta &{} \xi ^{2(c+h-3)}\eta ^2 &{} \cdots &{} \xi ^{(h-1)(c+h-3)}\eta ^{h-1} \\ \end{array} \right) \end{aligned}$$

is an \((h-2)\times h\) matrix over \({\mathbb {F}}_{q^2}\). By \(s\mid q+1\) and \(\xi ^s=1\), it takes

$$\begin{aligned} \left( \xi ^{k(c+\nu )}\eta ^k\right) ^q=\xi ^{-k\left( \frac{s-h+1}{2}+1+\nu \right) }\eta ^k =\xi ^{k\left( \frac{s+h-1}{2}-1-\nu \right) }\eta ^k=\xi ^{k(c+h-3-\nu )}\eta ^k, \end{aligned}$$

for any \(0\le k\le h-1\) and \(0\le \nu \le h-3\). Therefore, A and \(A^{(q)}\) are row equivalent. By deleting the first (resp. the last) column of A, we obtain an \((h-2)\times (h-1)\) matrix denoted by \(A_0\) (resp. \(A_{h-1}\)). Then, \(A_0\) (resp. \(A_{h-1}\)) is row equivalent to \(A_0^{(q)}\) (resp. \(A_{h-1}^{(q)}\)). Obviously, \({\mathrm {rank}}(A_0)={\mathrm {rank}}(A_{h-1})=h-2\). Similarly as the proof of Case 1, we can deduce that the following equations

$$\begin{aligned} A_0\overrightarrow{x}^T=(0,\ldots ,0)^T,\quad A_{h-1}\overrightarrow{y}^T=(0,\ldots ,0)^T \end{aligned}$$

have two solutions \(\overrightarrow{x}=(x_1,x_2,\ldots ,x_{h-1}),\overrightarrow{y}=(y_0,y_1,\ldots ,y_{h-2})\in ({\mathbb {F}}_q^*)^{h-1}\). From \(h<q+1\), there exists \(\lambda \in {\mathbb {F}}_q^*\setminus \{\frac{x_1}{y_1},\ldots ,\frac{x_{h-2}}{y_{h-2}}\}\) such that \(\overrightarrow{u}=(0,\overrightarrow{x})-\lambda (\overrightarrow{y},0)\in ({\mathbb {F}}_q^*)^h\). Then, it implies

$$\begin{aligned} A\overrightarrow{u}^T=\left( \begin{array}{c} 0 \\ A_0\overrightarrow{x}^T \\ \end{array} \right) -\lambda \left( \begin{array}{c} A_{h-1}\overrightarrow{y}^T \\ 0 \\ \end{array} \right) =(0,0,\ldots ,0)^T. \end{aligned}$$

Therefore, the result has been proved. \(\square \)

We choose

$$\begin{aligned} \overrightarrow{a}_1=(1,\delta ,\ldots ,\delta ^{l-1},g,g\delta ,\ldots ,g\delta ^{l-1},\ldots , g^{h-1},g^{h-1}\delta ,\ldots ,g^{h-1}\delta ^{l-1}) \end{aligned}$$

and

$$\begin{aligned} \overrightarrow{v}_1=(v_0,v_0\delta ,\ldots ,v_0\delta ^{l-1},v_1,v_1\delta ,\ldots ,v_1\delta ^{l-1},\ldots , v_{h-1},v_{h-1}\delta ,\ldots ,v_{h-1}\delta ^{l-1}), \end{aligned}$$

where \(v_{k}^{q+1}=u_k\) (\(0\le k\le h-1\)) and \(\overrightarrow{u}=(u_0,u_1,\ldots ,u_{h-1})\) satisfies (8).

Lemma 4.2

The identity

$$\begin{aligned} \langle \overrightarrow{a}_1^{qi+j},\overrightarrow{v}_1^{q+1}\rangle =0 \end{aligned}$$

holds for all \(0\le i,j\le \lfloor \frac{s+h}{2}\rfloor \cdot \frac{q+1}{s}-3\).

Proof

Similarly as Lemma 3.2, we only need to consider the case \(l\mid qi+j+q+1\). From Lemmas 2.2 (i) and 4.1, we deduce that

$$\begin{aligned} \langle \overrightarrow{a}_1^{qi+j},\overrightarrow{v}_1^{q+1}\rangle =\langle \overrightarrow{a}_1^{\mu l-q-1},\overrightarrow{v}_1^{q+1}\rangle =l\cdot \sum \limits _{k=0}^{h-1}g^{k(\mu l-q-1)}v_{k}^{q+1}=0. \end{aligned}$$

Therefore, for all \(0\le i,j\le \lfloor \frac{s+h}{2}\rfloor \cdot \frac{q+1}{s}-3\),

$$\begin{aligned} \langle \overrightarrow{a}_1^{qi+j},\overrightarrow{v}_1^{q+1}\rangle =0. \end{aligned}$$

\(\square \)

The vectors \(\overrightarrow{a}_2\) and \(\overrightarrow{v}_2\) are the same as in Sect. 3.

Theorem 4

Let \(n=lh+mr-\frac{q^2-1}{st}\cdot hr\), where odd \(s\mid q+1\), even \(t\mid q-1\), \(t\ge 2\), \(l=\frac{q^2-1}{s}\), \(m=\frac{q^2-1}{t}\), \(h\le s-1\) and \(r\le t\). Assume that \(q-1>\frac{q^2-1}{st}\cdot hr\), then for any \(1\le d\le \min \{\lfloor \frac{s+h}{2}\rfloor \cdot \frac{q+1}{s}-2,\frac{q+1}{2}+\frac{q-1}{t}-1\}\), there exists an \([[n,n-2d,d+1]]_q\) quantum MDS code.

Proof

Similarly as Theorem 3, we also let \(A=\{g^\alpha \delta ^i|0\le \alpha \le h-1,0\le i\le l-1\}\), \(B=\{g^\beta \theta ^j|0\le \beta \le r-1,0\le j\le m-1\}\), \(A_1=A-B\) and \(B_1=B-A\). Define

$$\begin{aligned} \begin{array}{lcr} f_1:A\rightarrow {\mathbb {F}}_q^*,\,\,f_1(g^\alpha \delta ^i)=(v_\alpha \delta ^i)^{q+1},\\ f_2:B\rightarrow {\mathbb {F}}_q^*,\,\,f_2(g^\beta \theta ^j)=\theta ^{j\cdot \frac{q+1}{2}}.\\ \end{array} \end{aligned}$$

Let

$$\begin{aligned} \overrightarrow{a}=(\overrightarrow{a}_{A_1},\overrightarrow{a}_{B_1},\overrightarrow{a}_{A\cap B}), \end{aligned}$$

where \(\overrightarrow{a}_{S}=(a_1,\ldots ,a_k)\) for \(S=\{a_1,\ldots ,a_k\}\) and

$$\begin{aligned} \overrightarrow{v}^{q+1}=(f_1(\overrightarrow{a}_{A_1}),\lambda f_2(\overrightarrow{a}_{B_1}),f_1(\overrightarrow{a}_{A\cap B})+\lambda f_2(\overrightarrow{a}_{A\cap B})), \end{aligned}$$

where \(\lambda \in {\mathbb {F}}_q^*\) is chosen such that all the coordinates of \(f_1(\overrightarrow{a}_{A\cap B})+\lambda f_2(\overrightarrow{a}_{A\cap B})\) are nonzero and \(f_j(\overrightarrow{a}_{S})=(f_j(a_1),\ldots ,f_j(a_k))\) with \(S=\{a_1,\ldots ,a_k\}\) for \(j=1,2\).

According to Lemmas 3.3 and 4.2, similarly as the proof of Theorem 3, \({\mathbf {GRS}}_{d}(\overrightarrow{a},\overrightarrow{v})\) is Hermitian self-orthogonal. As a consequence, by Theorem 1, there exists \([[n,n-2d,d+1]]_q\) quantum MDS code, where \(n=lh+mr-\frac{q^2-1}{st}\cdot hr\) with odd h and \(1\le d\le \min \{\lfloor \frac{s+h}{2}\rfloor \cdot \frac{q+1}{s}-2,\frac{q+1}{2}+\frac{q-1}{t}-1\}\). \(\square \)

Remark 4.1

Similarly as Remark 3.1, the minimum distance can reach \(\frac{q}{2}+\sqrt{\frac{q}{2}}\) approximately.

5 Quantum MDS codes of length \(n=lh+mr\)

In this section, \({\mathbf {s}}\,\,{\mathbf {is}}\,\,{\mathbf {even}}\), \({\mathbf {h}}\le \frac{{\mathbf {s}}}{{\mathbf {2}}}\) and \({\mathbf {r}}\le \frac{\mathbf {t}}{\mathbf {2}}\) and quantum MDS codes with length \(n=lh+mr\) will be constructed. Similarly as the previous constructions, we also divide the vectors \(\overrightarrow{a}\) and \(\overrightarrow{v}\) into two parts. However, in this case, coordinates of these two parts in the vector \(\overrightarrow{a}\) have no duplication. Therefore, the quantum MDS codes in this section have larger minimum distances than the codes in previous sections.

The proof of the next result is similar to that of Lemma 4.1, and we omit the details.

Lemma 5.1

The following system of equations

$$\begin{aligned} \begin{aligned} \sum \limits _{k=0}^{h-1}g^{(2k+1)(\mu l-q-1)}u_{k}=0 \end{aligned} \end{aligned}$$
(12)

has a solution denoted by \(\overrightarrow{u}=(u_{0},u_{1},\ldots ,u_{h-1})\in ({\mathbb {F}}_{q}^*)^{h}\) for all \(\lceil \frac{s-h}{2}\rceil +1\le \mu \le \lfloor \frac{s+h}{2}\rfloor -1\).

Here, we choose

$$\begin{aligned} \overrightarrow{a}_1=(g,g\delta ,\ldots ,g\delta ^{l-1},g^3,g^3\delta ,\ldots ,g^3\delta ^{l-1},\ldots , g^{2h-1},g^{2h-1}\delta ,\ldots ,g^{2h-1}\delta ^{l-1}) \end{aligned}$$

and

$$\begin{aligned} \overrightarrow{v}_1=(v_0,v_0\delta ,\ldots ,v_0\delta ^{l-1},v_1,v_1\delta ,\ldots ,v_1\delta ^{l-1},\ldots , v_{h-1},v_{h-1}\delta ,\ldots ,v_{h-1}\delta ^{l-1}), \end{aligned}$$

where \(v_{k}^{q+1}=u_k\) (\(0\le k\le h-1\)) and \(\overrightarrow{u}=(u_0,u_1,\ldots ,u_{h-1})\) is a solution of (12).

Lemma 5.2

The identity

$$\begin{aligned} \langle \overrightarrow{a}_1^{qi+j},\overrightarrow{v}_1^{q+1}\rangle =0 \end{aligned}$$

holds for all \(0\le i,j\le \lfloor \frac{s+h}{2}\rfloor \cdot \frac{q+1}{s}-3\).

Proof

The result follows from Lemmas 2.2 (i) and 5.1. \(\square \)

Now, we construct the second part of coordinates in \(\overrightarrow{a}\) and \(\overrightarrow{v}\). We choose

$$\begin{aligned} \overrightarrow{a}_2=(1,\theta ,\ldots ,\theta ^{m-1},g^2,g^2\theta ,\ldots ,g^2\theta ^{m-1}, \ldots ,g^{2r-2},g^{2r-2}\theta ,\ldots ,g^{2r-2}\theta ^{m-1}) \end{aligned}$$

and

$$\begin{aligned} \overrightarrow{v}_2=(1,g^{\frac{t}{2}},\ldots ,g^{(m-1)\cdot \frac{t}{2}},1,g^{\frac{t}{2}}, \ldots ,g^{(m-1)\cdot \frac{t}{2}},\ldots ,1,g^{\frac{t}{2}},\ldots ,g^{(m-1)\cdot \frac{t}{2}}). \end{aligned}$$

Then, we have the following lemma.

Lemma 5.3

The identity

$$\begin{aligned} \langle \overrightarrow{a}_2^{qi+j},\overrightarrow{v}_2^{q+1}\rangle =0 \end{aligned}$$

holds for all \(0\le i,j\le \frac{q+1}{2}+\frac{q-1}{t}-2\).

Proof

By Lemma 2.3,

$$\begin{aligned} \begin{aligned} \langle \overrightarrow{a}_2^{qi+j},\overrightarrow{v}_2^{q+1}\rangle&=\sum \limits _{k=0}^{r-1}\sum \limits _{\nu =0}^{m-1} (g^{2k}\theta ^{\nu })^{qi+j}\cdot \theta ^{\nu \cdot \frac{q+1}{2}}&\\&=\sum \limits _{k=0}^{r-1}g^{2k(qi+j)}\sum \limits _{\nu =0}^{m-1}\theta ^{\nu (qi+j+\frac{q+1}{2})}&\\&=0.&\end{aligned} \end{aligned}$$
(13)

\(\square \)

Since both s and t are even, it is clear that all coordinates of \(\overrightarrow{a}_1\) are nonsquares and all coordinates of \(\overrightarrow{a}_2\) are squares. Thus, there exists no duplication between these two parts. Choose \(\overrightarrow{a}=(\overrightarrow{a}_1,\overrightarrow{a}_2)\) and \(\overrightarrow{v}=(\overrightarrow{v}_1,\overrightarrow{v}_2)\).

Theorem 5

Let \(n=lh+mr\), where even \(s\mid q+1\), even \(t\mid q-1\), \(t\ge 2\), \(l=\frac{q^2-1}{s}\), \(m=\frac{q^2-1}{t}\), \(h\le \frac{s}{2}\) and \(r\le \frac{t}{2}\). Then for any \(1\le d\le \min \{\lfloor \frac{s+h}{2}\rfloor \cdot \frac{q+1}{s}-2,\frac{q+1}{2}+\frac{q-1}{t}-1\}\), there exists an \([[n,n-2d,d+1]]_q\) quantum MDS code.

Proof

The vectors \(\overrightarrow{a}\) and \(\overrightarrow{v}\) are defined as above. According to Lemmas 5.2 and 5.3, it takes

$$\begin{aligned} \langle \overrightarrow{a}^{qi+j},\overrightarrow{v}^{q+1}\rangle =\langle \overrightarrow{a}_1^{qi+j},\overrightarrow{v}_1^{q+1}\rangle + \langle \overrightarrow{a}_2^{qi+j},\overrightarrow{v}_2^{q+1}\rangle =0, \end{aligned}$$

for any \(0\le i,j\le d-1\). Therefore, by Theorem 2, the code \({\mathbf {GRS}}_{d}(\overrightarrow{a},\overrightarrow{v})\) is Hermitian self-orthogonal. By Theorem 1, there exists an \([[n,n-2d,d+1]]_q\) quantum MDS code, where \(n=lh+mr\) and \(1\le d\le \min \{\lfloor \frac{s+h}{2}\rfloor \cdot \frac{q+1}{s}-2,\frac{q+1}{2}+\frac{q-1}{t}-1\}\). \(\square \)

Remark 5.1

When h approaches to \(\frac{s}{2}\) and \(t=4\), both \(\lfloor \frac{s+h}{2}\rfloor \cdot \frac{q+1}{s}-2\) and \(\frac{q+1}{2}+\frac{q-1}{t}-1\) approach to \(\frac{3}{4}q\). So the minimum distance of the quantum MDS code can approach to \(\frac{3}{4}q\).

Table 1 Some of new \([[n,n-2d,d+1]]_{37}\) quantum MDS codes

Example 5.1

When \(q\equiv 9 \pmod {20}\), applying Theorem 5 with \((s,h,t,r)=(10, 4, 4, 1)\), there exist q-ary quantum MDS codes with parameters

$$\begin{aligned} \left[ \left[ \frac{13}{20}(q^2-1), \frac{13q^2-28q+79}{20}, \frac{7q-13}{10}\right] \right] _q \end{aligned}$$

whose minimal distance is approximately 0.7q when q is large. In general, the length satisfies \(\frac{13}{20}(q^2-1)\not \equiv 0,1\pmod {q\pm 1}\). Therefore, this class of quantum MDS codes are new.

Example 5.2

When \(q\equiv 29\pmod {60}\), applying Theorem 5 with \((s,h,t,r)=(30, 14, 4, 1)\), there exist quantum MDS codes with parameters

$$\begin{aligned} \left[ \left[ \frac{43}{60}(q^2-1), \frac{43q^2-88q+229}{60}, \frac{11q-19}{15}\right] \right] _q \end{aligned}$$

whose minimal distance is approximately \(11q/15\approx 0.733q\) when q is large. Also, the length satisfies \(\frac{43}{60}(q^2-1)\not \equiv 0,1\pmod {q\pm 1}\) and these quantum MDS codes are new.

6 Conclusion

Applying Hermitian construction and GRS codes, we construct several new classes of quantum MDS codes over \({\mathbb {F}}_{q^2}\) through Hermitian self-orthogonal GRS codes. Some of these quantum MDS codes can have minimum distance bigger than \(\frac{q}{2}+1\). Since the lengths are chosen up to two variables h and r, this makes their lengths more flexible than previous constructions. Using our results, we can produce many new quantum MDS codes with new lengths which have not appeared in previous works. We give an example.

Example 6.1

Choose \(q=37\). Utilizing the results in this paper, there are 438 new \([[n,n-2d,d+1]]_{37}\) quantum MDS codes with minimum distance \(d+1\ge \frac{q}{2}+1\), which were not reported in previous papers. We list some of new \([[n,n-2d,d+1]]_{37}\) quantum MDS codes in Table 1.

For a fixed q, it is expected to have \([[n,n-2d,d+1]]_q\) quantum MDS codes for any length of \(q+1<n\le q^2+1\) and minimum distance \(\frac{q}{2}+1\le d+1\le \min \{\frac{n}{2},q+1\}\). But summing up all the results, such quantum MDS codes are still very sparse. It is expected that more quantum MDS codes with large minimal distance will be explored.