1 Introduction

Quantum error-correcting codes (quantum codes) are useful in quantum computing and quantum communication. Given a prime power q, an \([[n,k,d]]_q\) quantum code is a \(q^k\)-dimensional vector subspace of the Hilbert space \(({\mathbb {C}}^q)^{\otimes n}\) with minimal distance d [1]. Especially, if a quantum code reaches the quantum Singleton bound, i.e. \(k=n-2d+2\), it is called a quantum maximum-distance-separable (MDS) code. A quantum code can also be denoted by \(((n,K,d))_q\), where \(k=log_q K\).

In [2], Calderbank et al. presented the first systematic and effective mathematical method for constructing quantum codes and thus established the connection between classical error-correcting codes and quantum error-correcting codes. Since then, the mathematical study of quantum codes has progressed rapidly. Many good quantum codes have been constructed by using different approaches [1, 3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39]. Among these methods, the most commonly used methods are Euclidean construction and Hermitian construction. We list the quantum MDS codes constructed by these two methods in Table 1. In [40], Goyeneche et al. builded a relationship between an irredundant orthogonal array (IrOA), v-uniform state, and quantum code \(((n,K,d))_q\) for \(K=1\). Based on Hamming distances and construction methods of orthogonal arrays (OAs), Pang et al. constructed infinite classes of v-uniform states for \(v=2,3\) in [41] and infinite classes of v-uniform states for \(v\ge 4\) in [42]. Besides, Pang et al. generalized construction method of uniform states for homogeneous systems to heterogeneous systems [43]. Moreover, Pang et al. extended methods of constructing quantum codes \(((n,K,d))_q\) for \(K=1\) to \(K>1\) [44, 45]. And a large number of quantum codes including quantum MDS codes can be obtained. Part of these codes are listed in Table 2. Even so, there are still some good quantum codes that remain unknown.

In this paper, let \(q\equiv 1\ \textrm{mod}\ 4\) be an odd prime power, \(m\ge 3\) be odd, \(x \ge 3\) be an odd divisor of \(q-1\), and \(y \ge 3\) be an odd divisor of \(q+1\). Using negacyclic codes over \(F_{q^2}\), we construct new quantum codes of length \(n=2xy\frac{q^{2m}-1}{q^2-1}\) with parameters \([[n,n-2m(\delta _1-\lfloor \frac{\delta _1}{q^2}\rfloor +\delta _2-\lfloor \frac{\delta _2}{q^2}\rfloor )-2,\ge \delta _1+\delta _2+2]]_q\), where \(0\le \delta _1, \delta _2\le y\lfloor \frac{q^m-1}{q^2-1} \rfloor \). Besides, for smaller odd xya with \(gcd(x,y)=1\), let \(q=2am\pm \sqrt{(x^2+y^2)a-1}\) be an odd prime power, where m is a positive integer. We get some q-ary quantum MDS codes of length \(n=\frac{q^2+1}{a}\) from \({\omega }^{q-1}\)-constacyclic codes over \(F_{q^2}\).

The paper is organized as follows. In Sect. 2, we state the basic notations and review the results about constacyclic codes and quantum codes used in this work. In addition, we present some lemmas for constructing quantum codes. In Sect. 3, some new quantum codes and quantum MDS codes are constructed by using constacyclic codes. This paper is summarised in Sect. 4.

Table 1 Quantum MDS codes \([[n,k,d]]_q\)
Table 2 Quantum codes \(((n,K,d))_q\)

2 Preliminaries

In this section, we state some basic notations and review some results about constacyclic codes and quantum codes [18, 48, 49].

Throughout this paper, assume that q is an odd prime power. Define \({\bar{\alpha }}={\alpha }^q\) for any element \(\alpha \in F_{q^2}\). For any two vectors \(a=(a_0,a_1,\ldots ,a_{n-1})\) and \(b=(b_0,b_1,\ldots ,b_{n-1})\in F_{q^2}^n\), their Hermitian inner product is defined as

$$\begin{aligned} \langle a,b \rangle =a_0{\bar{b}}_0+a_1{\bar{b}}_1+\ldots +a_{n-1}{\bar{b}}_{n-1} \in F_{q^2}. \end{aligned}$$

The vectors a and b are called orthogonal with respect to the Hermitian inner product if \(\langle a,b \rangle =0\). For a \(q^2\)-ary linear code C of length n, the Hermitian dual code of C is defined as

$$\begin{aligned} C^{\bot h}=\{a\in F_{q^2}^n|\langle a,b \rangle =0, b\in C \}. \end{aligned}$$

Definition 2.1

([49] Constacyclic Code) A \(q^2\)-ary linear code C of length n is said to be constacyclic if C is closed under the \(\eta \)-constacyclic shift \({\tau }_{\eta }\) on \(F_{q^2}^n\)

$$\begin{aligned} {\tau }_{\eta }(a_0,a_1,\ldots ,a_{n-1})=(\eta a_{n-1},a_0,\ldots ,a_{n-2}), \end{aligned}$$

where \(\eta \) is a nonzero element of \(F_{q^2}\). In particular, if \(\eta =-1\), then C is said to be negacyclic.

Let \(\omega \) be a primitive element of \(F_{q^2}\). Assume that \(gcd(n,q)=1\) and \(\eta ={\omega }^{v(q-1)}\) for some \(v\in \{0,1,\ldots ,q\}\). Then, \(C^{\bot h}\) of an \(\eta \)-constacyclic code C over \(F_{q^2}\) is also \(\eta \)-constacyclic. And there exists a unique monic divisor g(x) of \(x^n-\eta \) such that \(C=\langle g(x) \rangle \), where \({\langle g(x) \rangle }=\{r(x)g(x)|r(x)\in F_{q^2}[x]/\langle x^n-\eta \rangle \}\). The polynomial g(x) is called the generator polynomial of C.

Let r be the order of \(\eta \) in \(F_{q^2}^*=F_{q^2}-\{0\}\) and \(\delta \) be a primitive rn-th root of unity in some extension field of \(F_{q^2}\) such that \({\delta }^n=\eta \). Then, the roots of \(x^n-\eta \) are \({\delta }^{1+rj},\ 0\le j\le n-1\). Denote \(\Omega =\{1+rj|0\le j\le n-1\}\). For \(i \in \Omega \), let \(C_i=\{\ iq^{2j}\ \textrm{mod}\ rn,\ j\in N\}\) be the \(q^2\)-cyclotomic coset modulo rn containing i. The set \(Z=\{z\in \Omega |g({\delta }^z)=0 \}\) is called the defining set of C. Let \(g(x)=\prod _{z\in Z}(x-{\delta }^z)\) be the generator polynomial of C. Then, \(C^{\bot h}\) has generator polynomial \(g^{\bot h}(x)=\prod _{z\in \Omega \backslash Z}{(x-{\delta }^{-qz})}\). Hence, \(C^{\bot h}\) has defining set \(Z^{\bot h}=\{-qz \ \textrm{mod}\ rn|z\in \Omega \backslash Z\}\).

Lemma 2.1

([49] The BCH Bound for Constacyclic Codes) Assume that \(gcd(n,q)=1\). Let C be an \(\eta \)-constacyclic code of length n over \(F_{q^2}\), and let the generator polynomial g(x) have the elements \(\{{\delta }^{1+rj}|0\le j\le d-2\}\) as the roots, where \(\delta \) is a primitive rn-th root of unity. Then, the minimum distance of C is at least d.

Lemma 2.2

([50] Hermitian Construction) If C is a \(q^2\)-ary [nkd] linear code such that \(C^{\bot h}\subseteq C\), then there exists a q-ary \([[n,2k-n,\ge d]]\) quantum code.

Lemma 2.3

[18, 48] Let C be an \(\eta \)-constacyclic code of length n over \(F_{q^2}\) with defining set \(Z\subseteq \Omega \). Then, \(C^{\bot h}\subseteq C\) if and only if \(Z\bigcap {Z^{-q}}=\varnothing \), where \(Z^{-q}=-qZ=\{-qz\ \textrm{mod}\ rn|z\in Z\}\).

Let \(\lfloor x \rfloor \) denote the largest integer not exceeding x. To construct new quantum codes, we give the following lemmas.

Lemma 2.4

Let \(x,y,m\ge 3\) be odd, \(x|(q-1),\ y|(q+1)\), and let \(n=2xy\frac{q^{2m}-1}{q^2-1}\). Then \(gcd(n,q)=1\).

Proof

Note that \(n=2xy\frac{q^{2m}-1}{q^2-1}=2xy(q^{2(m-1)}+q^{2(m-2)}+\cdots +q^2+1)\), so \(gcd(n,q)=gcd(2xy,q)\). Since \(2x|(q-1)\), we can assume that \(q-1=2xm\), i.e. \(q=2xm+1,\ m\ge 1\). Then, we have \(gcd(2xy,q)=gcd(2xy,2xm+1)=gcd(y,2xm+1)=gcd(y,q)\). Note that \(2y|(q+1)\), we can assume that \(q+1=2yl\), i.e. \(q=2yl-1,\ l\ge 1\). It follows that \(gcd(y,q)=gcd(y,2yl-1)=gcd(y,1)=1\). Thus, we can conclude that \(gcd(n,q)=1\). \(\square \)

Lemma 2.5

Under the conditions of Lemma 2.4, let \(\zeta =y\frac{q^{2m}-1}{q^2-1}\). Then, for integers \(i,j,\ 1\le i,j\le y\lfloor \frac{q^m-1}{q^2-1} \rfloor \), we have the following results.

(1) The \(q^2\)-cyclotomic coset \(C_\zeta \) modulo 2n is \(C_\zeta =\{\zeta \}\);

(2) The \(q^2\)-cyclotomic coset \(C_{\zeta -2i}\) and \(C_{\zeta +2i}\) modulo 2n have cardinality m;

(3) \(C_{\zeta -2i}=C_{\zeta +2j}\) if and only if there exists \(t\in [0,\frac{m-1}{2}]\) such that \(i+jq^{2t}\equiv 0\ \textrm{mod}\ n\) or \(j+iq^{2t}\equiv 0\ \textrm{mod}\ n\);

(4) If \(i<j\), then \(C_{\zeta -2i}=C_{\zeta -2j}\) if and only if \(j=iq^{2t}\) for some \(t\in [1,\frac{m-1}{2}]\);

(5) If \(i<j\), then \(C_{\zeta +2i}=C_{\zeta +2j}\) if and only if \(j=iq^{2t}\) for some \(t\in [1,\frac{m-1}{2}]\);

(6) \(C_{\zeta -2i}=-qC_{\zeta +2j}\) if and only if there exists \(t\in [0,\frac{m-1}{2}]\) such that \(\zeta -2i \equiv -(\zeta +2j)q^{2t+1}\ \textrm{mod}\ 2n\) or \(\zeta +2j \equiv -(\zeta -2i)q^{2t+1}\ \textrm{mod}\ 2n\);

(7) \(C_{\zeta -2i}=-qC_{\zeta -2j}\) if and only if there exists \(t\in [0,\frac{m-1}{2}]\) such that \(\zeta -2i \equiv -(\zeta -2j)q^{2t+1}\ \textrm{mod}\ 2n\) or \(\zeta -2j \equiv -(\zeta -2i)q^{2t+1}\ \textrm{mod}\ 2n\);

(8) \(C_{\zeta +2i}=-qC_{\zeta +2j}\) if and only if there exists \(t\in [0,\frac{m-1}{2}]\) such that \(\zeta +2i \equiv -(\zeta +2j)q^{2t+1}\ \textrm{mod}\ 2n\) or \(\zeta +2j \equiv -(\zeta +2i)q^{2t+1}\ \textrm{mod}\ 2n\);

(9) \(C_\zeta \ne -qC_\zeta \);

(10) \(C_{\zeta -2i}\ne C_{\zeta +2j}\).

Proof

Here, we only prove (1), (2), (9) and (10). Other proofs are similar to that of Lemma 3 and Lemma 5 of [51], so we omit.

(1) Obviously, \(2n|\ (\zeta (q^2-1))\). Thus, we have \(C_\zeta =\{\zeta \}\).

(2) Since \(2n|(q^{2m}-1)\), we have \((\zeta -2i)q^{2m}\equiv \zeta -2i\ \textrm{mod}\ 2n\). Suppose that \(|C_{\zeta -2i}|=t<m\). Then, we have \((\zeta -2i)q^{2t}\equiv \zeta -2i\ \textrm{mod}\ 2n\). Because \(m\ge 3\) is odd and t|m, we can get \(1\le t\le \frac{m}{3}\le \frac{m-1}{2}\). By \(\zeta q^2\equiv \zeta \ \textrm{mod}\ 2n\), we have \(i(q^{2t}-1)\equiv 0\ \textrm{mod}\ n\). It follows from \(1\le i,j\le y\lfloor \frac{q^m-1}{q^2-1} \rfloor \) and \(1\le t\le \frac{m-1}{2}\) that \(0<q^2-1 \le i(q^{2t}-1)\le y\lfloor \frac{q^m-1}{q^2-1}\rfloor (q^{m-1}-1)<y\frac{q^m-1}{q^2-1}(q^m+1)<n\). This contradicts \(i(q^{2t}-1)\equiv 0\ \textrm{mod}\ n\). Therefore, \(|C_{\zeta -2i}|=m\). Similarly, we can also get \(|C_{\zeta +2i}|=m\).

(9) Suppose that \(C_\zeta = -qC_\zeta \). Then, we have \(\zeta \equiv -q\zeta \ \textrm{mod}\ 2n\), i.e. \(\zeta (q+1)\equiv 0\ \textrm{mod}\ 2n\). This shows that \(2n|(\zeta (q+1))\), which is equivalent to \(4x|(q+1)\). It contradicts the fact that \(2x|(q-1)\). Hence, \(C_\zeta \ne -qC_\zeta \).

(10) Suppose that \(C_{\zeta -2i}=C_{\zeta +2j}\). Then, by (3), we can assume that there exists \(t\in [0,\frac{m-1}{2}]\) such that \(i+jq^{2t}\equiv 0\ \textrm{mod}\ n\). Note that \(0<i+jq^{2t}\le y\lfloor \frac{q^m-1}{q^2-1}\rfloor (q^{m-1}+1)<y\frac{q^m-1}{q^2-1}(q^m+1)<n\). This yields a contradiction. Hence, \(C_{\zeta -2i}\ne C_{\zeta +2j}\). \(\square \)

Lemma 2.6

For q with the form \(2am\pm t\), where amt are positive integers, let \(n=\frac{q^2+1}{a}\) be an integer. Then \(gcd(n,q)=1\).

Proof

Here, we only prove the case of \(q=2am+t\), the case of \(q=2am-t\) is similar. Since \(q^2+1=(2am+t)^2+1=4a^2m^2+4amt+t^2+1\), it follows that \(n=\frac{q^2+1}{a}=4am^2+4mt+\frac{t^2+1}{a}\). Thus, \(gcd(n,q)=gcd(4am^2+4m t+\frac{t^2+1}{a},2am+t)=gcd(2m(2am+t)+2mt+\frac{t^2+1}{a},2am+t)=gcd(2mt+\frac{t^2+1}{a},2am+t)\). Suppose that \(gcd(2mt+\frac{t^2+1}{a},2am+t)=s\) and \(s\ne 1\). Let \(2mt+\frac{t^2+1}{a}=sx\) and \(2am+t=sy\), where xy are integers. Then, we can obtain \(s(ax-ty)=1\). Obviously, this is impossible. Hence \(gcd(n,q)=1\). \(\square \)

Lemma 2.7

[30] For q with the form \(2am\pm t\), where m is a positive integer and at are odd, let \(n=\frac{q^2+1}{a},\ s=\frac{q^2+1}{2}\). Then, for any integer \(i\in \Omega =\{1+(q+1)j|0\le j\le n-1\}\), the \(q^2\)-cyclotomic coset \(C_i\) modulo \((q+1)n\) is given by

\((1)\ C_s=\{s\},\ C_{s+\frac{n(q+1)}{2}}=\{s+\frac{n(q+1)}{2}\}\).

\((2)\ C_{s-(q+1)j}=\{s-(q+1)j, s+(q+1)j\},\ 1\le j\le \frac{n}{2}-1\).

3 New quantum codes from constacyclic codes

3.1 \(\textrm{Length}\ n=2xy\frac{q^{2m}-1}{q^2-1}\)

Based on the lemmas in Sect. 2, we can give a sufficient condition for the existence of negacyclic codes over \(F_{q^2}\) of length \(2xy\frac{q^{2m}-1}{q^2-1}\) which contain their Hermitian duals.

Lemma 3.1

Let \(q\equiv 1\ \textrm{mod}\ 4\), \(x,y,m\ge 3\) be odd, \(x|(q-1),\ y|(q+1)\), and let \(n=2xy\frac{q^{2m}-1}{q^2-1},\ \zeta =y\frac{q^{2m}-1}{q^2-1}\). If C is a \(q^2\)-ary negacyclic code of length n with defining set \(Z=\bigcup _{i=-\delta _1}^{\delta _2}{C_{\zeta +2i}}\), where \(0\le \delta _1, \delta _2\le y\lfloor \frac{q^m-1}{q^2-1} \rfloor \), then \(C^{\bot h}\subseteq C\).

Proof

By Lemma 2.3, we only need to prove that \(Z\bigcap Z^{-q}=\emptyset \). Suppose that \(Z\bigcap Z^{-q}\ne \emptyset \). By Lemma 2.5, we have \(C_\zeta \bigcap -qC_\zeta =\emptyset \). Then, for integers \(i,j,\ 1\le i,j\le y\lfloor \frac{q^m-1}{q^2-1} \rfloor \), we can obtain a contradiction by considering the following three cases:

Case 1 \(C_{\zeta -2i}=-qC_{\zeta -2j}\), which means that there exists \(t\in [0,\frac{m-1}{2}]\) such that \(\zeta -2i\equiv -(\zeta -2j)q^{2t+1}\ \textrm{mod}\ 2n\). By \(q\equiv 1\ \textrm{mod}\ 4\) and \(x|(q-1)\), we can get \(2n|(\zeta (q-1))\), i.e. \(q\zeta \equiv \zeta \ \textrm{mod}\ 2n\). Thus, we have \(\zeta -i-jq^{2t+1}\equiv 0 \ \textrm{mod}\ n\). It follows from \(1\le i,j\le y\lfloor \frac{q^m-1}{q^2-1} \rfloor \) that \(0<y\frac{q^{2m}-1}{q^2-1}-(q^m+1)y\lfloor \frac{q^{m}-1}{q^2-1}\rfloor \le \zeta -i-jq^{2t+1}\le y\frac{q^{2m}-1}{q^2-1}-(q+1)<n\). This contradicts the fact that \(\zeta -i-jq^{2t+1}\equiv 0 \ \textrm{mod}\ n\).

Case 2 \(C_{\zeta +2i}=-qC_{\zeta +2j}\), which means that there exists \(t\in [0,\frac{m-1}{2}]\) such that \(\zeta +2i\equiv -(\zeta +2j)q^{2t+1}\ \textrm{mod}\ 2n\). This is equivalent to \(\zeta +i+jq^{2t+1}\equiv 0 \ \textrm{mod}\ n\). Note that \(0< \zeta +i+jq^{2t+1}\le y\frac{q^{2m}-1}{q^2-1}+(q^m+1)y\lfloor \frac{q^m-1}{q^2-1}\rfloor<2y\frac{q^{2m}-1}{q^2-1}<n\). This gives a contradiction.

Case 3 \(C_{\zeta -2i}=-qC_{\zeta +2j}\), which means that there exists \(t\in [0,\frac{m-1}{2}]\) such that \(\zeta -2i\equiv -(\zeta +2j)q^{2t+1}\ \textrm{mod}\ 2n\). This is equivalent to \(\zeta -i+jq^{2t+1}\equiv 0 \ \textrm{mod}\ n\). Since \(1\le i,j\le y\lfloor \frac{q^m-1}{q^2-1} \rfloor \), it follows that \(0<y\frac{q^{2m}-1}{q^2-1}+q-y\lfloor \frac{q^m-1}{q^2-1}\rfloor \le \zeta -i+jq^{2t+1}\le y\frac{q^{2m}-1}{q^2-1}-1+y\lfloor \frac{q^m-1}{q^2-1}\rfloor q^m<y\frac{q^{2m}-1}{q^2-1}-1+y\frac{q^m-1}{q^2-1}(q^m+1)=2y\frac{q^{2m}-1}{q^2-1}-1<n\). It contradicts the fact that \(\zeta -i+jq^{2t+1}\equiv 0 \ \textrm{mod}\ n\).

Therefore, \(Z\bigcap Z^{-q}=\emptyset \), i.e. \(C^{\bot h}\subseteq C\). \(\square \)

Using the aforementioned lemma, some new q-ary quantum codes of length \(2xy\frac{q^{2m}-1}{q^2-1}\) can be constructed.

Theorem 3.1

Under the conditions of Lemma 3.1, there exist quantum codes with parameters \([[n,n-2m(\delta _1-\lfloor \frac{\delta _1}{q^2}\rfloor +\delta _2-\lfloor \frac{\delta _2}{q^2}\rfloor )-2,\ge \delta _1+\delta _2+2]]_q\).

Proof

Consider the negacyclic code C over \(F_{q^2}\) of length n with defining set \(Z=\bigcup _{i=-\delta _1}^{\delta _2}{C_{\zeta +2i}}\), where \(0\le \delta _1, \delta _2\le y\lfloor \frac{q^m-1}{q^2-1} \rfloor \). By Lemma 2.1, we have \(d(C)\ge \delta _1+\delta _2+2\). By Lemma 2.5, for \(1\le i \le y\lfloor \frac{q^m-1}{q^2-1} \rfloor \), we have \(C_{\zeta -2i}=C_{\zeta -2iq^{2t}}\) and \(C_{\zeta +2i}=C_{\zeta +2iq^{2t}}\) for some \(t\in [1,\frac{m-1}{2}]\). Hence, the number of cosets is reduced by \(\lfloor \frac{\delta _1}{q^2}\rfloor +\lfloor \frac{\delta _2}{q^2}\rfloor \). Therefore, C is a negacyclic code over \(F_{q^2}\) with parameters \([n,n-m(\delta _1-\lfloor \frac{\delta _1}{q^2}\rfloor +\delta _2-\lfloor \frac{\delta _2}{q^2}\rfloor )-1,\ge \delta _1+\delta _2+2]\). By Lemma 3.1, \(C^{\bot h}\subseteq C\). Applying the Hermitian construction to C obtains q-ary \([[n,n-2m(\delta _1-\lfloor \frac{\delta _1}{q^2}\rfloor +\delta _2-\lfloor \frac{\delta _2}{q^2}\rfloor )-2,\ge \delta _1+\delta _2+2]]\) quantum codes. \(\square \)

We list some new quantum codes in Table 3. When the distance is equal, the dimension of quantum codes we construct is better than those in [52]. We give Theorem 21 of [52] as follows.

Theorem 3.2

( [53, 52, Theorem 21]) Let \(n=r\frac{q^{2m}-1}{q^2-1}\), where \(m\ge 2\) and q is a prime power. For \(2\le \delta \le \lfloor r\frac{q^m-1}{q^2-1}\rfloor \), then there exists a quantum code with parameters \([[n,n-2m\lceil (\delta -1)(1-\frac{1}{q^2}) \rceil ,\ge \delta ]]_q\).

Table 3 Comparisons of quantum codes with length \(n=r\frac{q^{2m}-1}{q^2-1}\)

3.2 \(\textrm{Length}\ n=\frac{q^2+1}{a}\ \mathrm{with\ odd}\ a\)

In this section, for q with the form \(2am\pm t\), we will use \({\omega }^{q-1}\)-constacyclic codes over \(F_{q^2}\) to construct some q-ary quantum MDS codes of length \(\frac{q^2+1}{a}\).

Lemma 3.2

(1) For q with the form \(178m+55\), where m is a positive integer, let \(s=\frac{q^2+1}{2},\ n=\frac{q^2+1}{89}\). If C is an \({\omega }^{q-1}\)-constacyclic code over \(F_{q^2}\) of length n with defining set \(Z=\bigcup _{j=0}^{\delta }{C_{s-(q+1)j}}\), where \(0\le \delta \le 13m+3\), then \(C^{\bot h}\subseteq C\);

(2) For q with the form \(178m-55\), where m is a positive integer, let \(s=\frac{q^2+1}{2},\ n=\frac{q^2+1}{89}\). If C is an \({\omega }^{q-1}\)-constacyclic code over \(F_{q^2}\) of length n with defining set \(Z=\bigcup _{j=0}^{\delta }{C_{s-(q+1)j}}\), where \(0\le \delta \le 13m-5\), then \(C^{\bot h}\subseteq C\).

Proof

(1) By Lemma 2.3, we only need to prove that \(Z\bigcap Z^{-q}=\emptyset \). Suppose that \(Z\bigcap Z^{-q}\ne \emptyset \). Then, by Lemma 2.7, there exist two integers \(i,\ j,\ 0\le i,\ j\le 13m+3\), such that \(s-(q+1)i\equiv -[s-(q+1)j]q^{\epsilon }\ \textrm{mod}\ (q+1)n\) for \(\epsilon =1,3\).

If \(\epsilon =1\), then \(s-(q+1)i\equiv -[s-(q+1)j]q\ \textrm{mod}\ (q+1)n\). This is equivalent to \(s\equiv jq+i\ \textrm{mod}\ n\), which means

$$\begin{aligned} q^2+1\equiv 178jq+178i\ \textrm{mod}\ 2(q^2+1). \end{aligned}$$

As \(0\le i,j\le 13m+3=\frac{13q-181}{178}\), it follows that \(0\le 178i,178j\le 13q-181\). We can obtain a contradiction by considering the following two cases:

(i) \(0\le 178i\le 12q-1\). Then, \(0\le 178jq+178i\le (13q-181)q+12q-1=13q^2-169q-1<13q^2\). Assume that \(178i=eq+u\), where \(0\le e\le 11\) and \(0\le u\le {q-1}\) are integers. Then, by \(q^2+1\equiv 178jq+178i\ \textrm{mod}\ 2(q^2+1)\), we have \(178jq+178i=(178j+e)q+u=h(q^2+1)=hq^2+h\), where \(1\le h\le 11\) is odd. This implies that \(q|(u-h)\). Since \(-q<-h\le u-h\le q-1-h<q\), we have \(u-h=0\), i.e. \(u=h\). It follows that \(178j+e=hq\), where \(1\le e\le 11\) is odd. Then, \(j=\frac{hq-e}{178}=\frac{h(178m+55)-e}{178}=hm+\frac{55h-e}{178}\). Obviously, when \(1\le e,h\le 11\) are odd, j is not an integer. This gives a contradiction.

(ii) \(12q\le 178i\le 13q-181\). Then, \(12q\le 178jq+178i\le (13q-181)(q+1)=13q^2-168q-181<13q^2\). Assume that \(178i=12q+u\), where \(0\le u\le q-181\). Then, we have \(178jq+178i=(178j+12)q+u=h(q^2+1)=hq^2+h\), where \(1\le h\le 11\) is odd. Hence \(q|(u-h)\). Similar to (i), we can get \(u=h\). Thus \(178j+12=hq\). Note that \(178j+12\) is even and hq is odd. This gives a contradiction.

If \(\epsilon =3\), then \(s-(q+1)i\equiv -[s-(q+1)j]q^3\ \textrm{mod}\ (q+1)n\). This is equivalent to \(s-(q+1)i\equiv -sq-(q+1)qj\ \textrm{mod}\ (q+1)n\), which means

$$\begin{aligned} 178jq+q^2+1\equiv 178i\ \textrm{mod}\ 2(q^2+1). \end{aligned}$$

As \(0\le 178i,178j\le 13q-181\), it follows that \(q^2+1\le 178jq+q^2+1\le (13q-181)q+q^2+1=14q^2-181q+1\). We can obtain a contradiction by considering the following two cases:

(i) \(q^2+1\le 178jq+q^2+1\le \ {2q^2+1}\). Then, \(178jq+q^2+1=178i\). It follows that \(q|(178i-1)\). Note that \(-1\le {178i-1}\le 13q-181-1<13q\). Hence, we can assume \(178i-1=hq\), where \(1\le h\le 11\) is odd. Then, \(178i=hq+1=h(178m+55)+1=178mh+55h+1\), which implies that \(178|(55h+1)\). Assume that \(55h+1=178p=2\frac{55^2+1}{34}p,\ p\ge 1\). This is equivalent to \(34\cdot 55h+34=2\cdot 55^2p+2p\), which means \(55|(2p-34)\). Note that \(2p-34> -55\), so we can assume that \(2p-34=55c,\ c\ge 0\). Then, \(2p=55c+34\ge 34\), i.e. \(p\ge 17\). So \(h=\frac{178p-1}{55}\ge 55\). It contradicts the fact that \(1\le h\le 11\).

(ii) \(2(q^2+1)\le 178jq+q^2+1\le \ 14q^2-181q+1<14q^2\). Then, we have \(178jq+q^2+1-178i=h(q^2+1)\), where \(2\le h\le 12\) is even. It follows that \(178jq-(h-1)q^2=178i+h-1\). Obviously, \(q|(178i+h-1)\). Note that \(1\le 178i+h-1\le 13q-170<13q\), so we can assume that \(178i+h-1=h'q\), where \(1\le h'\le 11\) is odd. Then, \(i=\frac{h'q-(h-1)}{178}=\frac{h'(178m+55)-(h-1)}{178}=h'm+\frac{55h'-(h-1)}{178}\). Similar to the case of \(\epsilon =1\), we can also get a contradiction here.

Therefore, \(Z\bigcap Z^{-q}=\emptyset \), i.e. \(C^{\bot h}\subseteq C\).

(2) It is similar to the proof of (1). \(\square \)

Now, we can construct some q-ary quantum MDS codes by using the above lemma.

Theorem 3.3

For q with the form \(178m+55\ (178m-55)\), where m is a positive integer, let \(n=\frac{q^2+1}{89}\). Then, there exist quantum MDS codes with parameters \([[n,n-2d+2,d]]_q\), where \(2\le d\le 26m+8\ (2\le d\le 26m-8)\) is even.

Proof

Suppose that \(q=178m+55\). Let \(s=\frac{q^2+1}{2}\). Consider the \({\omega }^{q-1}\)-constacyclic code C over \(F_{q^2}\) of length n with defining set \(Z=\bigcup _{j=0}^{\delta }{C_{s-(q+1)j}}\), where \(0 \le \delta \le 13m+3\). By Lemma 2.1 and Singleton bound, \(d(C)=2\delta +2\). Hence, C is an \({\omega }^{q-1}\)-constacyclic code over \(F_{q^2}\) with parameters \([n,n-(2\delta +1),2\delta +2]\). By Lemma 3.2, \(C^{\bot h}\subseteq C\). Applying the Hermitian construction and quantum Singleton bound to C obtains a q-ary quantum MDS code with parameters \([[n,n-4\delta -2,2\delta +2]]\). The desired quantum MDS code follows. The case \(q=178m-55\) is similar. \(\square \)

Some quantum MDS codes obtained from Theorem 3.3 are listed in Table 4.

Table 4 Some quantum MDS codes for \(m\le 9\)

Lemma 3.3

(1) For q with the form \(250m+57\), where m is a positive integer, let \(s=\frac{q^2+1}{2},\ n=\frac{q^2+1}{125}\). If C is an \({\omega }^{q-1}\)-constacyclic code over \(F_{q^2}\) of length n with defining set \(Z=\bigcup _{j=0}^{\delta }{C_{s-(q+1)j}}\), where \(0\le \delta \le 13m+2\), then \(C^{\bot h}\subseteq C\);

(2) For q with the form \(250m-57\), where m is a positive integer, let \(s=\frac{q^2+1}{2},\ n=\frac{q^2+1}{125}\). If C is an \({\omega }^{q-1}\)-constacyclic code over \(F_{q^2}\) of length n with defining set \(Z=\bigcup _{j=0}^{\delta }{C_{s-(q+1)j}}\), where \(0\le \delta \le 13m-4\), then \(C^{\bot h}\subseteq C\).

Proof

(1) Suppose that \(Z\bigcap Z^{-q}\ne \emptyset \). Then, by Lemma 2.7, there exist two integers \(i,\ j,\ 0\le i,\ j\le 13m+2\), such that \(s-(q+1)i\equiv -[s-(q+1)j]q^{\epsilon }\ \textrm{mod}\ (q+1)n\) for \(\epsilon =1,3\).

If \(\epsilon =1\), then \(s-(q+1)i\equiv -[s-(q+1)j]q\ \textrm{mod}\ (q+1)n\). This is equivalent to

$$\begin{aligned} q^2+1\equiv 250jq+250i\ \textrm{mod}\ 2(q^2+1). \end{aligned}$$

As \(0\le i,j\le 13m+2=\frac{13q-241}{250}\), it follows that \(0\le 250i,250j\le 13q-241\). We can obtain a contradiction by considering the following two cases:

(i) \(0\le 250i\le 12q-1\). Then, \(0\le 250jq+250i\le (13q-241)q+12q-1=13q^2-229q-1<13q^2\). Assume that \(250i=eq+u\), where \(0\le e\le 11\) and \(0\le u\le {q-1}\) are integers. By \(q^2+1\equiv 250jq+250i\ \textrm{mod}\ 2(q^2+1)\), we have \(250jq+250i=(250j+e)q+u=h(q^2+1)=hq^2+h\), where \(1\le h\le 11\) is odd. Similar to the proof of Lemma 3.2, we can get \(250j+e=hq\). Thus, \(j=\frac{hq-e}{250}=\frac{h(250m+57)-e}{250}=hm+\frac{57h-e}{250}\). Obviously, when \(1\le e,h\le 11\) are odd, j is not an integer. This gives a contradiction.

(ii) \(12q\le 250i\le 13q-241\). Then, \(12q\le 250jq+250i\le (13q-241)(q+1)=13q^2-228q-241<13q^2\). Assume that \(250i=12q+u\), where \(0\le u\le q-241\). Hence, \(250jq+250i=(250j+12)q+u=h(q^2+1)=hq^2+h\), where \(1\le h\le 11\) is odd. Similarly, we have \(250j+12=hq\). This is impossible since hq is odd.

If \(\epsilon =3\), then \(s-(q+1)i\equiv -[s-(q+1)j]q^3\ \textrm{mod}\ (q+1)n\). This is equivalent to

$$\begin{aligned} 250jq+q^2+1\equiv 250i\ \textrm{mod}\ 2(q^2+1). \end{aligned}$$

As \(0\le 250i,250j\le 13q-241\), it follows that \(q^2+1\le 250jq+q^2+1\le (13q-241)q+q^2+1=14q^2-241q+1\). We can obtain a contradiction by considering the following two cases:

(i) \(q^2+1\le 250jq+q^2+1\le \ {2q^2+1}\). Then \(250jq+q^2+1=250i\), which implies that \(q|(250i-1)\). Note that \(-1\le {250i-1}\le 13q-241-1<13q\), so we can assume that \(250i-1=hq\), where \(1\le h\le 11\) is odd. Then \(250i=hq+1=h(250m+57)+1=250mh+57h+1\). Obviously, \(250|(57h+1)\). Assume that \(57h+1=250p=2\frac{57^2+1}{26}p,\ p\ge 1\), it follows that \(26\cdot 57h+26=2\cdot 57^2p+2p\). Then, we can get \(57|(2p-26)\). Note that \(2p-26> -57\), so we can assume that \(2p-26=57c,\ c\ge 0\). Then, \(2p=57c+26\ge 26\), i.e. \(p\ge 13\). Thus \(h=\frac{250p-1}{57}\ge 57\). It contradicts the fact that \(1\le h\le 11\).

(ii) \(2(q^2+1)\le 250jq+q^2+1\le \ 14q^2-241q+1<14q^2\). Then, we have \(250jq+q^2+1-250i=h(q^2+1)\), where \(2\le h\le 12\) is even. It follows that \(250jq-(h-1)q^2=250i+h-1\). This gives that \(q|(250i+h-1)\). Note that \(1\le 250i+h-1\le 13q-230<13q\), so we can assume that \(250i+h-1=h'q\), where \(1\le h'\le 11\) is odd. Hence, \(i=\frac{h'q-(h-1)}{250}=\frac{h'(250m+57)-(h-1)}{250}=h'm+\frac{57h'-(h-1)}{250}\). Similar to the case of \(\epsilon =1\), we can also get a contradiction here.

Therefore, \(Z\bigcap Z^{-q}=\emptyset \), i.e. \(C^{\bot h}\subseteq C\).

(2) The proof is similar to that of (1). \(\square \)

Theorem 3.4

For q with the form \(250m+57\ (250m-57)\), where m is a positive integer, let \(n=\frac{q^2+1}{125}\). Then, there exist quantum MDS codes with parameters \([[n,n-2d+2,d]]_q\), where \(2\le d\le 26m+6\ (2\le d\le 26m-6)\) is even.

Proof

Here, we only prove the case of \(q=250m+57\), the case of \(q=250m-57\) is similar. Let \(s=\frac{q^2+1}{2}\). Consider the \({\omega }^{q-1}\)-constacyclic code C over \(F_{q^2}\) of length n with defining set \(Z=\bigcup _{j=0}^{\delta }{C_{s-(q+1)j}}\), where \(0 \le \delta \le 13m+2\). By Lemma 2.1 and Singleton bound, \(d(C)=2\delta +2\). Hence, C is an \({\omega }^{q-1}\)-constacyclic code over \(F_{q^2}\) with parameters \([n,n-(2\delta +1),2\delta +2]\). By Lemma 3.3, \(C^{\bot h}\subseteq C\). Applying the Hermitian construction and quantum Singleton bound to C obtains a q-ary quantum MDS code with parameters \([[n,n-4\delta -2,2\delta +2]]\). The desired quantum MDS code follows. \(\square \)

In Table 5, we list some quantum MDS codes obtained from Theorem 3.4.

Table 5 Some quantum MDS codes for \(m\le 10\)

Lemma 3.4

(1) For q with the form \(298m+105\), where m is a positive integer, let \(s=\frac{q^2+1}{2},\ n=\frac{q^2+1}{149}\). If C is an \({\omega }^{q-1}\)-constacyclic code over \(F_{q^2}\) of length n with defining set \(Z=\bigcup _{j=0}^{\delta }{C_{s-(q+1)j}}\), where \(0\le \delta \le 17m+5\), then \(C^{\bot h}\subseteq C\);

(2) For q with the form \(298m-105\), where m is a positive integer, let \(s=\frac{q^2+1}{2},\ n=\frac{q^2+1}{149}\). If C is an \({\omega }^{q-1}\)-constacyclic code over \(F_{q^2}\) of length n with defining set \(Z=\bigcup _{j=0}^{\delta }{C_{s-(q+1)j}}\), where \(0\le \delta \le 17m-7\), then \(C^{\bot h}\subseteq C\).

Proof

It is similar to the proofs of Lemma 3.2 and Lemma 3.3. \(\square \)

Theorem 3.5

For q with the form \(298m+105\ (298m-105)\), where m is a positive integer, let \(n=\frac{q^2+1}{149}\). Then, there exist quantum MDS codes with parameters \([[n,n-2d+2,d]]_q\), where \(2\le d\le 34m+12\ (2\le d\le 34m-12)\) is even.

Proof

The proof is similar to that of Theorems 3.3 and 3.4. \(\square \)

Applying Theorem 3.5 obtains some quantum MDS codes in Table 6.

Table 6 Some quantum MDS codes for \(m\le 4\)

Lemma 3.5

(1) For q with the form \(338m+99\), where m is a positive integer, let \(s=\frac{q^2+1}{2},\ n=\frac{q^2+1}{169}\). If C is an \({\omega }^{q-1}\)-constacyclic code over \(F_{q^2}\) of length n with defining set \(Z=\bigcup _{j=0}^{\delta }{C_{s-(q+1)j}}\), where \(0\le \delta \le 17m+4\), then \(C^{\bot h}\subseteq C\);

(2) For q with the form \(338m-99\), where m is a positive integer, let \(s=\frac{q^2+1}{2},\ n=\frac{q^2+1}{169}\). If C is an \({\omega }^{q-1}\)-constacyclic code over \(F_{q^2}\) of length n with defining set \(Z=\bigcup _{j=0}^{\delta }{C_{s-(q+1)j}}\), where \(0\le \delta \le 17m-6\), then \(C^{\bot h}\subseteq C\).

Proof

The proof is similar to that of Lemmas 3.2 and 3.3. \(\square \)

Theorem 3.6

For q with the form \(338m+99\ (338m-99)\), where m is a positive integer, let \(n=\frac{q^2+1}{169}\). Then, there exist quantum MDS codes with parameters \([[n,n-2d+2,d]]_q\), where \(2\le d\le 34m+10\ (2\le d\le 34m-10)\) is even.

Proof

The proof is similar to that of Theorems 3.3 and 3.4. \(\square \)

Some quantum MDS codes obtained from Theorem 3.6 are listed in Table 7.

Table 7 Some quantum MDS codes for \(m\le 8\)

According to the proofs of the above lemmas and theorems, for smaller odd xya with \(gcd(x,y)=1\) and q with the form \(2am+\sqrt{(x^2+y^2)a-1}\ (2am-\sqrt{(x^2+y^2)a-1})\), where m is a positive integer such that q is a prime power, let \(n=\frac{q^2+1}{a}\). We can construct quantum MDS codes \([[n,n-2d+2,d]]_q\) from constacyclic MDS codes over \(F_{q^2}\), where \(2\le d\le 2km+x+y\ (2\le d\le 2km-x-y)\) is even and some k are given in Table 8.

Table 8 Some quantum MDS codes with smaller xya

4 Conclusion

Let \(q\equiv 1\ \textrm{mod}\ 4\) be an odd prime power, and let \(x,y,m\ge 3\) be odd, \(x|(q-1),\ y|(q+1)\). Based on negacyclic codes over \(F_{q^2}\), we construct new quantum codes of length \(n=2xy\frac{q^{2m}-1}{q^2-1}\) with parameters \([[n,n-2m(\delta _1-\lfloor \frac{\delta _1}{q^2}\rfloor +\delta _2-\lfloor \frac{\delta _2}{q^2}\rfloor )-2,\ge \delta _1+\delta _2+2]]_q\), where \(0\le \delta _1, \delta _2\le y\lfloor \frac{q^m-1}{q^2-1} \rfloor \).

Besides, for smaller odd xya with \(gcd(x,y)=1\) and odd prime power q with the form \(2am+t\ (2am-t)\), where \(t=\sqrt{(x^2+y^2)a-1}\) and m is a positive integer, let \(n=\frac{q^2+1}{a}\). Based on \({\omega }^{q-1}\)-constacyclic codes, we construct some quantum MDS codes with parameters \([[n,n-2d+2,d]]_q\), where \(2\le d\le 2\,km+x+y\ (2\le d\le 2\,km-x-y)\) is even and k is given in Table 8. Although Theorem 3.4 in [10] is very powerful, its construction method based on GRS codes is not simple. Hence, it is of certain significance to construct quantum MDS codes by using constacyclic codes here.

In the future, we want to explore the proofs of the case that for all odd xya with \(gcd(x,y)=1\) and odd prime power q with the form \(2am+t\ (2am-t)\), where \(t=\sqrt{(x^2+y^2)a-1}\) and m is a positive integer, let \(n=\frac{q^2+1}{a}\), then there exist quantum MDS codes with parameters \([[n,n-2d+2,d]]_q\), where \(2\le d\le 2\,km+x+y\ (2\le d\le 2\,km-x-y)\) is even and

$$\begin{aligned} \begin{aligned} k=\left\{ \begin{array}{ll} \frac{(x+y)t+(x-y)}{x^2+y^2}; &{} if\ \frac{(x+y)t+(x-y)}{x^2+y^2}\ is\ an\ integer,\\ \\ \frac{(x+y)t-(x-y)}{x^2+y^2}; &{} if\ \frac{(x+y)t-(x-y)}{x^2+y^2}\ is\ an\ integer. \end{array} \right. \end{aligned} \end{aligned}$$