1 Introduction

Quantum error-correcting codes play an important role in both quantum communication and quantum computation. It has experienced a great progress since the establishment of the connections between quantum codes and classical codes (see [4]). It was shown that the construction of quantum codes can be reduced to that of classical linear error-correcting codes with certain self-orthogonality properties.

Let \(q\) be a prime power. A \(q\)-ary quantum code \(Q\) of length \(n\) and size \(K\) is a \(K\)-dimensional subspace of a \(q^n\)-dimensional Hilbert space \({\mathbb {H}}={\mathbb {C}}^{q^n}={\mathbb {C}}^q\otimes \cdots \otimes {\mathbb {C}}^q.\) The error correction and deletion capabilities of a quantum error-correcting code are the most crucial aspects of the code. If a quantum code has minimum distance \(d\), then it can detect any \(d-1\) and correct any \(\lfloor (d-1)/2\rfloor \) quantum errors. Let \(k=log_qK\). We use \([[n,k,d]]_q\) to denote a \(q\)-ary quantum code of length \(n\) with size \(q^k\) and minimum distance \(d\). One of the principal problems in quantum error correction is to construct quantum codes with the best possible minimum distance. It is well known that quantum codes with parameters \([[n,k,d]]_q\) must satisfy the quantum Singleton bound: \(k\le n-2d+2\) (see [14, 15]). A quantum code achieving this bound is called a quantum maximum-distance-separable (MDS) code. Quantum MDS codes are one of the most useful and interesting quantum codes in quantum error correction.

In recent years, constructing quantum MDS codes has become one of the central topics for quantum codes. Several families of quantum MDS codes have been constructed (see [3, 611, 17, 19, 20]). As we know, if the classical MDS conjecture holds, the length of nontrivial \(q\)-ary quantum MDS codes cannot exceed \(q^2+1\) (see [14]). The problem of constructing quantum MDS codes with \(n\le q+1\) has been completely solved (see [7, 8]). Many quantum MDS codes of length between \(q+1\) and \(q^2+1\) have also been constructed (see [3, 10, 11, 1719]). Although so, there are still a lot of quantum MDS codes difficult to be constructed. It is a great challenge to construct new quantum MDS codes and a even more challenge to construct quantum MDS codes with relatively large minimum distance.

As mentioned in [11], except for some sparse lengths, almost all known \(q\)-ary quantum MDS codes have minimum distance less than or equal to \(q/2+1\). Recently, Kai and Zhu constructed two new classes of quantum MDS codes based on classical negacyclic codes (see [12]) and six new classes of quantum MDS codes based on classical constacyclic codes (see [13]). These codes have minimum distance larger than \(q/2+1\) in general. Two classes of the quantum MDS codes constructed in [13] are

  1. 1.

    \([[\lambda (q-1),\lambda (q-1)-2d+2,d]]_q\), where \(\lambda =(q+1)/2\) and \(2\le d\le q\),

  2. 2.

    \([[\lambda (q-1),\lambda (q-1)-2d+2,d]]_q\), where \(2\le d\le (q+1)/2\) and \(\lambda =(q+1)/r\) with even \(r\ne 2\).

We extend these two classes of quantum codes and obtain our first class of quantum MDS codes with parameters \([[\lambda (q-1),\lambda (q-1)-2d+2,d]]_q,\) where \(2\le d\le (q+1)/2+\lambda -1\) and \(q+1=\lambda r\) with \(r\) even. This class of quantum MDS codes has larger minimum distance than the quantum MDS codes that they constructed under the case even \(r\ne 2\). In particular, the obtained quantum codes have minimum distance bigger than \(q/2+1\). Furthermore, we consider the case \(r\) is an odd divisor of \(q+1\) and get our second class of quantum MDS codes with parameters \([[\lambda (q-1),\lambda (q-1)-2d+2,d]]_q\), where \(2\le d\le (q+1)/2+\lambda /2-1\) and \(q+1=\lambda r\). It is new in sense that its parameters are not covered by the codes available in the literature, and it has minimum distance bigger than \(q/2+1\) when \(q\ge 11.\)

This paper is structured as follows. Section 2 presents a review of classical constacyclic code. In Sect. 3, two classes of quantum MDS codes are derived by using Hermitian construction. Section 4 concludes the paper.

2 Review of constacyclic codes

Let \({\mathbb {F}}_{q^2}\) be the Galois field with \(q^2\) elements, where \(q\) is a prime power. A \(q^2\)-ary linear code \(C\) of length \(n\) is a nonempty subspace of \({\mathbb {F}}_{q^2}^n\). A \(q^2\)-ary linear code \(C\) of length \(n\) is called \(\eta \)-constacyclic if it is invariant under the \(\eta \)-constacyclic shift of \({\mathbb {F}}_{q^2}^n\):

$$\begin{aligned} (c_0,c_1,\ldots ,c_{n-1})\rightarrow (\eta c_{n-1},c_0,\ldots ,c_{n-2}), \end{aligned}$$

where \(\eta \) is a nonzero element of \({\mathbb {F}}_{q^2}\). Each code word \(\mathbf c =(c_0,c_1,\ldots ,c_{n-1})\) is customarily identified with its polynomial representation \(c(x)=c_0+c_1x+\cdots +c_{n-1}x^{n-1}\), and the code \(C\) is in turn identified with the set of all polynomial representations of its code words. Then, in the ring \(\frac{{\mathbb {F}}_{q^2}[x]}{\langle x^n-\eta \rangle },\) \(xc(x)\) corresponds to a \(\eta \)-constacyclic shift of \(c(x)\). It is well known that a linear code \(C\) of length \(n\) over \({\mathbb {F}}_{q^2}\) is \(\eta \)-constacyclic if and only if \(C\) is an ideal of the quotient ring \(\frac{{\mathbb {F}}_{q^2}[x]}{\langle x^n-\eta \rangle }.\) Moreover, \(\frac{{\mathbb {F}}_{q^2}[x]}{\langle x^n-\eta \rangle }\) is a principal ideal ring, whose ideals are generated by monic factors of \(x^n-\eta \), i.e., \(C=\langle f(x)\rangle \) and \(f(x)|(x^n-\eta )\).

Given two vectors \(\mathbf x =(x_0, x_1,\ldots ,x_{n-1})\) and \(\mathbf y =(y_0, y_1,\ldots ,y_{n-1})\in {\mathbb {F}}_{q^2}^n\), their Hermitian inner product is defined as

$$\begin{aligned} \langle \mathbf x , \mathbf y \rangle =x_0\bar{y}_0+x_1\bar{y}_1 +\cdots +x_{n-1}\bar{y}_{n-1}\in {\mathbb {F}}_{q^2}, \end{aligned}$$

where \(\bar{y}_i=y_i^q\). The vectors \(\mathbf x \) and \(\mathbf y \) are called orthogonal with respect to the Hermitian inner product if \(\langle \mathbf x , \mathbf y \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}}=\left\{ \mathbf{x}\in {{\mathbb {F}}}_{q^2}^n|\langle \mathbf{x}, \mathbf y \rangle =0\, for\, all\, \mathbf y \in C\right\} . \end{aligned}$$

A linear code \(C\) of length \(n\) over \({\mathbb {F}}_{q^2}\) is called Hermitian self-orthogonal if \(C\subseteq C^{\bot _H}\), and it is called Hermitian self-dual if \(C=C^{\bot _H}.\)

We assume \(\gcd (q, n)=1\). Let \(\delta \) be a primitive \(rn\)th root of unity in some extension field of \({\mathbb {F}}_{q^2}\) such that \(\delta ^n=\eta \). Let \(\xi =\delta ^r,\) then \(\xi \) is a primitive \(n\)th root of unity. Hence,

$$\begin{aligned} x^n-\eta =\prod _{i=0}^{n-1}(x-\delta \xi ^i)=\prod _{i=0}^{n-1}(x-\delta ^{1+ir}). \end{aligned}$$

Let \(\Omega =\{1+ir|0\le i\le n-1\}.\) For each \(j\in \Omega ,\) let \(C_j\) be the \(q^2\)-cyclotomic coset modulo \(rn\) containing \(j\). Let \(C\) be an \(\eta \)-constacyclic code of length \(n\) over \({\mathbb {F}}_{q^2}\) with generator polynomial \(g(x)\). Then, the set \(Z=\{j\in \Omega |g(\delta ^j)=0\}\) is called the defining set of \(C\). It is clear to see the defining set of \(C\) is a union of some \(q^2\)-cyclotomic cosets modulo \(rn\) and \(dim(C)=n-|Z|\). It is also easily to see \(C^{\bot _H}\) has defining set \(Z^{\bot _H}=\{z\in \Omega |-qz \mod \ rn\not \in Z\}\) (see Ref. [13]).

Similar to cyclic codes, there exists the following BCH bound for constacyclic code (see [2, Theorem 2.2] or [16, Lemma 4]).

Theorem 2.1

(The BCH bound for constacyclic codes) Assume that \(\gcd (q, n)=1\). Let \(C=\langle g(x)\rangle \) be an \(\eta \)-constacyclic code of length \(n\) over \({\mathbb {F}}_{q^2}\) with the roots \(\{\delta ^{1+ir}|0\le i\le d-2\}\), where \(\delta \) is a primitive \(rn\)th root of unity. Then, the minimum distance of \(C\) is at least \(d\).

The following result presents a criterion to determine whether or not a given \(q^2\)-ary \(\eta \)-constacyclic code is dual containing (see [13, Lemma 2.2]).

Lemma 2.2

Let \(r\) be a positive divisor of \(q+1\) and \(\eta \in {\mathbb {F}}_{q^2}^*\) be of order \(r\). Let \(C\) be an \(\eta \)-constacyclic code of length \(n\) over \({\mathbb {F}}_{q^2}\) with defining set \(Z\subseteq \Omega \), then \(C\) contains its Hermitian dual code if and only if \(Z\bigcap Z^{-q}=\emptyset ,\) where \(Z^{-q}=\{-qz\ \mod \ rn|z\in Z\}\).

3 Codes construction

Let \(r=(q+1)/gcd(v, q+1)\) and \(q\) be an odd prime power. In the next two parts, we give the construction of quantum MDS codes due to the case \(r\) is even or odd by using Hermitian construction. First, we recall the Hermitian quantum code construction:

Lemma 3.1

[1] If \(C\) is a \(q^2\)-ary \([n,k,d]\)-linear code such that \(C^{\bot _{H}}\subseteq C\), then there exists an \([[n, 2k-n, \ge d]]_q\) quantum code.

  1. A.

    Length \(n=\lambda (q-1)\) with \(\lambda \) a divisor of \(q+1\) and \(r\) even

Let \(r=(q+1)/gcd(v, q+1)\) be even, for some \(v\in \{1,2,\ldots ,q\}\). Let \(\xi =\omega ^{v(q-1)}\) and \(\lambda =(q+1)/r\). Based on \(\xi \)-constacyclic codes, we first construct \(q\)-ary quantum MDS codes of length \(\lambda (q-1)\). It is easy to see that the \(q^2\)-cyclotomic coset containing \(1+jr+\frac{r-2}{2}(q+1)\) modulo \(nr\) has only one element \(1+jr+\frac{r-2}{2}(q+1)\), i.e., \(C_{1+jr+\frac{r-2}{2}(q+1)}=\{1+jr+\frac{r-2}{2}(q+1)\}\) under the case \(0\le j\le \frac{r+2}{2r}(q+1)\).

Lemma 3.2

Let \(r=(q+1)/\gcd (v, q+1)\) be even and \(r\ne q+1\), for some \(v\in \{1,2,\ldots ,q\}\). Let \(n=\lambda (q-1)\) with \(\lambda =(q+1)/r\). Suppose that \(C\) is an \(\xi \)-constacyclic code of length \(n\) over \({\mathbb {F}}_{q^2}\) with defining set \(Z=\bigcup _{j=1}^{\delta }C_{1+r(j-1)+\frac{r-2}{2}(q+1)}\), where \(1\le \delta \le \frac{r+2}{2r}(q+1)-2\), then \(C^{\perp _H}\subseteq C\).

Proof

Suppose that \(C\) does not contain its Hermitian dual code, then by Lemma 2.2, \(Z\bigcap Z^{-q}\ne \emptyset \). Hence, there exist two integers \(k,l\in \{1,2,\ldots ,\frac{r+2}{2r}(q+1)-2\}\) such that

$$\begin{aligned} 1+r(k-1)+\frac{r-2}{2}(q+1)\equiv -\left[ 1+r(l-1)+\frac{r-2}{2}(q+1)\right] q\mod \ rn, \end{aligned}$$

which is equivalent to

$$\begin{aligned} k+ql-\lambda \equiv 0\mod \lambda (q-1). \end{aligned}$$
(1)

Let \(r=2s\) with some integer \(s\ge 1\). Then, \(1\le l\le \lambda (s+1)-2\). We express \(l\) in the form \(l=u\lambda +v\), where \(0\le u\le s\) and \(0\le v\le \lambda -2\) (except for the case \(u=v=0\)). We now consider it due to the following two cases.

  1. (1)

    \(0\le u\le s\) and \(1\le v\le \lambda -2.\) The congruence (1) yields \(k+l+(q-1)v-\lambda \equiv 0\mod \ \lambda (q-1)\). Since \(1\le k,l\le \frac{r+2}{2r}(q+1)-2<q-1,\) it follows that \(k+l+(q-1)v-\lambda <(q-1)+(q-1)+(\lambda -2)(q-1)-\lambda =\lambda (q-2)\). This gives a contradiction.

  2. (2)

    \(1\le u\le s\) and \(v=0.\) The congruence (1) yields \(k+l-\lambda \equiv 0\mod \ \lambda (q-1)\). But \(k+l-\lambda <2(q-1)-\lambda <2(q-1)\) and \(\lambda >1\). This gives a contradiction.

This completes the proof. \(\square \)

Theorem 3.3

Let \(r\) be an even divisor of \(q+1\) and \(r\ne q+1\), and let \(n=\lambda (q-1)\) with \(\lambda =(q+1)/r\). Then, there exist an \([[n,n-2d+2,d]]_q\) quantum MDS code, where \(2\le d\le \frac{r+2}{2r}(q+1)-1.\)

Proof

Let \(\xi =\omega ^{\lambda (q-1)}\), where \(\omega \) is a primitive element of \({\mathbb {F}}_{q^2}\). Let \(C\) be the \(\xi \)-constacyclic code of length \(n\) over \({\mathbb {F}}_{q^2}\) with defining set \(Z\!=\!\bigcup _{j=1}^{\delta }C_{1+r(j-1)+\frac{r-2}{2}(q+1)}\), where \(1\le \delta \le \frac{r+2}{2r}(q+1)-2\). It follows from Lemma 3.2 that \(C\) contains its Hermitian dual code, and \(dim(C)=n-\delta \). The BCH bound for constacyclic codes gives that the distance of \(C\) is at least \(\delta +1\). Hence, \(C\) is a constacyclic code with parameters \([n, n-\delta , \ge \delta +1]_{q^2}\). Using the Hermitian construction, we obtain an \([[n, n-2\delta ,\ge \delta +1]]_q\) quantum code. Combining the quantum Singleton bound yields a quantum code with parameters \([[n, n-2\delta ,\delta +1]]_q\), which is the desired quantum MDS code. \(\square \)

Taking \(r=2\) in Theorem 3.3, we obtain a quantum MDS code with parameters \([[(q^2-1)/2,(q^2-1)/2-2d+2, d]]_q,\) where \(2\le d\le q\), which is the quantum MDS codes got in [13, Theorem3.2]. But when \(r\) is an even divisor of \(q+1\) and \(r\ne 2\), there exists a quantum code in [13] with parameters \([[\lambda (q-1),\lambda (q-1)-2d+2, d]]_q,\) where \(2\le d\le (q+1)/2\). However, the construction in Theorem 3.3 produces some new quantum MDS codes with parameters \([[\lambda (q-1),\lambda (q-1)-2d+2, d]]_q,\) where \((q+1)/2+1\le d\le (q+1)/2+\lambda -1\). These codes have much larger minimum distance in general. Hence, we unite the results of \(r=2\) and \(r\ne 2\) in [13], and more quantum MDS codes are obtained in our construction.

Example 3.4

Let \(q=19\). Applying Theorem 3.3 produces four new quantum MDS codes with parameters \([[90,70,11]]_{19}\), \([[90,68,12]]_{19}\), \([[90,66,13]]_{19}\), and \([[90,64,14]]_{19}\).

Example 3.5

Let \(q=23\). Applying Theorem 3.3 produces some new quantum MDS codes in Table 1.

Table 1 New quantum MDS codes
  1. B.

    Length \(n=\lambda (q-1)\) with \(\lambda \) a divisor of \(q+1\) and \(r\) odd

In [13], the authors only consider the case \(r\) is an even divisor of \(q+1\), but how about the case \(r\) is an odd divisor of \(q+1\). In this part, we consider this problem and construct a new class of quantum MDS codes under such case.

Let \(r=(q+1)/gcd(v, q+1)\) be odd, for some \(v\in \{1,2,\ldots ,q\}\). Let \(\xi =\omega ^{v(q-1)}\) and \(\lambda =(q+1)/r\). Based on \(\xi \)-constacyclic codes, we construct \(q\)-ary quantum MDS codes of length \(\lambda (q-1)\). It is easy to see that the \(q^2\)-cyclotomic coset containing \(1+jr+\frac{r-1}{2}(q+1)\) modulo \(nr\) has only one element \(1+jr+\frac{r-1}{2}(q+1)\), i.e., \(C_{1+jr+\frac{r-1}{2}(q+1)}=\{1+jr+\frac{r-1}{2}(q+1)\}\) under the case \(0\le j\le \frac{r+1}{2r}(q+1)\).

Lemma 3.6

Let \(r=(q+1)/\gcd (v, q+1)\) be odd, for some \(v\in \{1,2,\ldots ,q\}\). Let \(n=\lambda (q-1)\) with \(\lambda =(q+1)/r\). Suppose that \(C\) is an \(\xi \)-constacyclic code of length \(n\) over \({\mathbb {F}}_{q^2}\) with defining set \(Z=\bigcup _{j=1}^{\delta }C_{1+r(j-1)+\frac{r-1}{2}(q+1)}\), where \(1\le \delta \le \frac{r+1}{2r}(q+1)-2\), then \(C^{\perp _H}\subseteq C\).

Proof

Suppose that \(C\) does not contain its Hermitian dual code, then \(Z\bigcap Z^{-q}\ne \emptyset \). Hence, there exist two integers \(k,l\in \{1,2,\ldots ,\frac{r+1}{2r}(q+1)-2\}\) such that

$$\begin{aligned} 1+r(k-1)+\frac{r-1}{2}(q+1)\equiv -\left[ 1+r(l-1)+\frac{r-1}{2}(q+1)\right] q\mod \ rn, \end{aligned}$$

which is equivalent to

$$\begin{aligned} k+ql\equiv 0\mod \lambda (q-1). \end{aligned}$$
(2)

Let \(r=2s+1\) with some integer \(s\ge 1\). Then, \(1\le l\le \lambda (s+1)-2\). We express \(l\) in the form \(l=u\lambda +v\), where \(0\le u\le s\) and \(0\le v\le \lambda -2\) (except for the case \(u=v=0\)). We now consider it due to the following two cases.

  1. (1)

    \(0\le u\le s\) and \(1\le v\le \lambda -2.\) The congruence (2) yields \(k+l+(q-1)v\equiv 0\mod \ \lambda (q-1)\). Since \(1\le k,l\le \frac{r+1}{2r}(q+1)-2<q-1,\) it follows that \(k+l+(q-1)v<(q-1)+(q-1)+(\lambda -2)(q-1)=\lambda (q-1)\). This gives a contradiction.

  2. (2)

    \(1\le u\le s\) and \(v=0.\) The congruence (2) yields \(k+l\equiv 0\mod \ \lambda (q-1)\). But \(k+l<2(q-1)\) and \(\lambda >1\). This gives a contradiction.

This completes the proof. \(\square \)

Theorem 3.7

Let \(r\) be an odd divisor of \(q+1\) and \(n=\lambda (q-1)\) with \(\lambda =(q+1)/r\). Then, there exist an \([[n,n-2d+2,d]]_q\) quantum MDS code, where \(2\le d\le \frac{r+1}{2r}(q+1)-1.\)

Proof

Let \(\xi =\omega ^{\lambda (q-1)}\), where \(\omega \) is a primitive element of \({\mathbb {F}}_{q^2}\). Let \(C\) be the \(\xi \)-constacyclic code of length \(n\) over \({\mathbb {F}}_{q^2}\) with defining set \(Z\!=\!\bigcup _{j=1}^{\delta }C_{1+r(j-1)+\frac{r-1}{2}(q+1)}\), where \(1\le \delta \le \frac{r+1}{2r}(q+1)-2\). It follows from Lemma 3.6 that \(C\) contains its Hermitian dual code. Note that \(dim(C)=n-\delta \) and \(d(C)\ge \delta +1\). So, \(C\) is a \(\xi \)-constacyclic code with parameters \([n, n-\delta , \ge \delta +1]_{q^2}\). Combining the Hermitian construction and the quantum Singleton bound, we obtain an \([[n, n-2\delta ,\delta +1]]_q\) quantum code, which is the desired quantum MDS code. \(\square \)

The construction in Theorem 3.7 produces some quantum MDS codes with parameters \([[\lambda (q-1),\lambda (q-1)-2d+2, d]]_q,\) where \((q+1)/2\le d\le (q+1)/2+\lambda /2-1\). These codes are new in the sense that their parameters are not covered in the literature, and this class of quantum MDS codes has larger minimum distance than the known ones. Recently, we notice that this class of quantum MDS code can also be obtained from Ref. [11] by deleting the evaluation point at 0 in Theorem 3.9.

Example 3.8

Let \(q=17\). Applying Theorem 3.7 produces four new quantum MDS codes in Table 2.

Table 2 New quantum MDS codes

Example 3.9

Let \(q=29\). Applying Theorem 3.7 produces some new quantum MDS codes in Table 3.

Table 3 New quantum MDS codes

In Ref. [5], the authors constructed several classes of pure asymmetric quantum codes based on subclass of alternant codes, such as nested Goppa codes and Euclidean self-orthogonal generalized Reed–Solomon codes. However, in this paper, we construct classical Hermitian dual-containing constacyclic codes by computing cyclotomic cosets in detail. Based on such constacyclic codes, we obtain two classes of quantum MDS codes by using the known Hermitian construction.

4 Conclusion

We have constructed two classes of quantum MDS codes whose parameters are given by \([[\lambda (q-1),\lambda (q-1)-2d+2,d]]_q\), where \(2\le d\le (q+1)/2+\lambda -1\) and \(q+1=\lambda r\) with \(r\) even, and \([[\lambda (q-1),\lambda (q-1)-2d+2,d]]_q\), where \(2\le d\le (q+1)/2+\lambda /2-1\) and \(q+1=\lambda r\) with \(r\) odd. The first class of quantum MDS codes has much larger minimum distance than the known ones. The second class of quantum MDS codes is new in the sense that its parameters are different from all the known ones and they also have much larger minimum distances. It would be interesting to go on this line of study, and more new quantum codes with good parameters may be constructed from classical constacyclic codes.