1 Introduction

Quantum computation and communication attracted much attention due to efficient quantum algorithms in the late 1990s. It is well known that quantum computation and communication rely on undisturbed evolution of quantum coherence. Unfortunately, the decoherence caused by interaction with the environment destroys the information in a superposition of states. At the same time, because of the no-cloning theorem [42], the technique that duplicates information could not be applied to quantum information. To overcome these difficulties, Shor [33] and Steane [34] showed that quantum error-correcting codes do exist and constructed the first example of quantum codes. This signs the birth of quantum error-correcting codes. Quantum error-correcting codes introduce some auxiliary qubits and make them entangle with the transmitted qubits. The redundancy is stored in the new entangled state. The original state can be recovered by making use of the auxiliary qubits (see [29, 31]). Soon afterwards, Calderbank et al. [5] presented a mathematical scheme to obtain quantum codes from classical error-correcting codes over \({\mathbb {F}}_{2}\) or \({\mathbb {F}}_{4}\) with certain orthogonal properties. Finding good quantum error-correcting codes has become another subject of quantum error-correction besides fault-tolerant quantum hardware design. A number of good binary quantum codes were constructed from classical self-orthogonal codes over \({\mathbb {F}}_{2}\) or \({\mathbb {F}}_{4}\) (see [5, 7, 10, 24]). Later, non-binary quantum codes have received increasing attention because they can be used in the realization of fault-tolerant quantum computation [4, 25]. Several construction methods were presented based on self-orthogonal codes over finite fields [2, 20].

Due to good algebraic structure, classical cyclic codes were used to construct quantum codes. This yields quantum cyclic codes including quantum BCH codes and quantum Reed-Solomon codes. In [35], Steane discovered efficient binary quantum codes via BCH codes. Non-binary quantum cyclic codes were constructed from Euclidean or Hermitian self-orthogonal codes (see [1, 22, 27]). Since then, various techniques are applied to construct new and good quantum cyclic codes. At the application level, the theory of quantum shift registers has been discussed in [15, 41] and their realization was performed by the ion traps or nuclear magnetic resonance (NMR) in the experiments [9, 23]. Meanwhile, designing arithmetic and logic unit based on quantum technologies was proposed in [13, 30, 32].

As a generalization of cyclic codes, constacyclic codes have been naturally considered to construct quantum codes. Many quantum maximal distance separable (MDS) codes were derived from constacyclic codes (see [6, 18, 39]). In contrast with quantum cyclic codes, numerous quantum constacyclic codes have better parameters on the same length [17, 19]. Liu et al. [26] explored quantum constacyclic codes of length \(q^{2m}+1\) and found a lot of good quantum codes. Wang and Gao [40] constructed new quantum codes from constacyclic codes over the finite non-chain ring \({\mathbb {F}}_{q}+v{\mathbb {F}}_{q}\) with \(v^{2}=v\). Chen et al. [8] constructed new optimal asymmetric quantum codes and quantum convolutional codes from constacyclic codes. The research above indicates that constacyclic codes have advantages in constructing quantum error-correcting codes. Based on concatenated method, Grassl et al. [16] constructed quantum codes from the binary images of Reed-Solomon codes over \({\mathbb {F}}_{2^{k}}\). Tangataj and McLaughlin [37] derived good quantum codes from Hermitian self-orthogonal codes over \({\mathbb {F}}_{4}\) as the images of cyclic codes over \({\mathbb {F}}_{4^{m}}\). Sundeep and Tangataj [36] studied the self-orthogonality of q-ary images of \(q^{m}\)-ary codes and constructed new quantum codes from the images of cyclic codes over \({\mathbb {F}}_{4^{m}}\). In the above literature, Hermitian self-orthogonal cyclic codes over large fields or rings were used to construct quantum codes.

In this paper, we utilize a class of constacyclic codes over \({\mathbb {F}}_{q^{2m}}\) to construct quantum codes. Let \({\mathbb {F}}_{q^{2m}}\) be the extension field of \({\mathbb {F}}_{q^{2}}\) with degree m. Let \(\eta \) be a nonzero element of \({\mathbb {F}}_{q^{2}}\). We provide an explicit criterion for judging the \(q^2\)-ary images of \(\eta \)-constacyclic codes over \({\mathbb {F}}_{q^{2m}}\) to be Hermitian self-orthogonal. Based on Hermitian self-orthogonal images of constacyclic codes over \({\mathbb {F}}_{q^{2m}}\), we construct some quantum codes with parameters better than the ones available in the literature. It is worth noting that constacyclic codes over \({\mathbb {F}}_{q^{2m}}\) are not necessarily Hermitian self-orthogonal. The paper is organized as follows. In Sect. 2, basic notations and results about constacyclic codes and quantum codes are recalled. In Sect. 3, a sufficient condition for \(q^2\)-ary images of \(q^{2m}\)-ary constacyclic codes is given. In Sect. 4, some quantum codes are constructed. Section 5 gives a conclusion.

2 Preliminaries

Let \({\mathbb {F}}_{q^{2}}\) be the finite field with \(q^{2}\) elements, where q is a power of a prime p. The Hamming weight of a vector \(\mathbf{x }=(x_{0},x_{1},\ldots ,x_{n-1})\in {\mathbb {F}}_{q^{2}}^{n}\) is the number of nonzero \(x_{i}\) and is denoted by \(\text {wt}(\mathbf{x })\). Let \({\mathbb {F}}_{q^{2}}^{*}\) be the multiplicative group of \({\mathbb {F}}_{q^{2}}\). Assume that \(\eta \) is an element of \({\mathbb {F}}_{q^{2}}^{*}\). An \(\eta \)-constacyclic code \({\mathcal {C}}\) over \({\mathbb {F}}_{q^{2}}\) of length n is a linear code with the property that if \((c_{0},c_{1},\ldots ,c_{n-1})\in {\mathcal {C}}\) then \((\eta c_{n-1},c_{0},\ldots ,c_{n-2})\in {\mathcal {C}}\). An \(\eta \)-constacyclic code \({\mathcal {C}}\) over \({\mathbb {F}}_{q^{2}}\) of length n can be viewed as an ideal in the principal ideal ring \({\mathbb {F}}_{q^{2}}[x]/\langle x^{n}-\eta \rangle \). Hence, \({\mathcal {C}}=\langle g(x)\rangle \), where g(x) is a monic divisor of \(x^{n}-\eta \). The polynomial g(x) is called the generator polynomial of \({\mathcal {C}}\), and \(h(x)=(x^{n}-\eta )/g(x)\) is referred to as the parity-check polynomial of \({\mathcal {C}}\). The roots of g(x) and h(x) are called the zeros and nonzeros of \({\mathcal {C}}\), respectively. Assume that \(\gcd (n,q)=1\) and \(\eta \) has order r in \({\mathbb {F}}_{q^{2}}^{*}\). Let \(\xi \) be a primitive nr-th root of unity such that \(\eta =\xi ^{n}\). Then, the roots of \(x^{n}-\eta \) are \(\xi ^{1+rj}\) for \(0\le j\le n-1\). Denote \(\varOmega =\{1+rj\mid 0\le j\le n-1\}\). For each \(s\in \varOmega \), denote by \(C_{q^{2}}[s,nr]\) the \(q^2\)-cyclotomic coset modulo nr containing s. Then \(g(x)=\prod _{s}\prod _{i\in C_{q^{2}}[s,nr]}(x-\xi ^{i})\), where s runs through some subset of representatives of the \(q^2\)-cyclomotic cosets modulo nr. Let \(Z=\bigcup _{s}C_{q^{2}}[s,nr]\) be the union of these \(q^{2}\)-cyclotomic cosets. The set Z is called the zero set of \({\mathcal {C}}\), and the set \(T=\varOmega \backslash Z\) is called the nonzero set of \({\mathcal {C}}\). The following is the BCH-type bound for constacyclic codes (see [3, 21]).

Theorem 2.1

Assume that \(\gcd (n,q)=1\). Let \({\mathcal {C}}\) be an \(\eta \)-constacyclic code of length n over \({\mathbb {F}}_{q^{2}}\). If the generator polynomial g(x) of \({\mathcal {C}}\) has the elements \(\{\xi ^{1+ri}|\ b\le i\le b+d-1\}\) as the zeros for some integer b, then the minimum Hamming distance of \({\mathcal {C}}\) is at least \(d+1\).

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

$$\begin{aligned} {\mathcal {C}}^{\perp _{E}}=\{\mathbf{c }\in {\mathbb {F}}_{q^{2}}^{n}\mid \mathbf{c }\cdot \mathbf{x }=0\ \text {for}\ \text {all}\ \mathbf{x }\in {\mathcal {C}}\}, \end{aligned}$$

where \(\mathbf{c }\cdot \mathbf{x }=\sum _{i=0}^{n-1}c_{i}x_{i}\) denotes the Euclidean product inner of \(\mathbf{c }\) and \(\mathbf{x }\). The Hermitian dual code of \({\mathcal {C}}\) is defined as

$$\begin{aligned} {\mathcal {C}}^{\perp _{H}}=\{\mathbf{c }\in {\mathbb {F}}_{q^{2}}^{n}\mid \langle \mathbf{c },\mathbf{x }\rangle _{H}=0\ \text {for}\ \text {all}\ \mathbf{x }\in {\mathcal {C}}\}, \end{aligned}$$

where \(\langle \mathbf{c },\mathbf{x }\rangle _{H}=\sum _{i=0}^{n-1}c_{i}x_{i}^{q}\) denotes the Hermitian product inner of \(\mathbf{c }\) and \(\mathbf{x }\). For any \(\mathbf{x }=(x_{0},x_{1},\ldots ,x_{n-1})\in {\mathbb {F}}_{q^{2}}^{n}\), let \(\mathbf{x }^{q}=(x_{0}^{q},x_{1}^{q},\ldots ,x_{n-1}^{q})\). Set \({\mathcal {C}}^{q}=\left\{ \mathbf{c }^{q}\mid \mathbf{c }\in {\mathcal {C}}\right\} \). It can be directly checked that \({\mathcal {C}}^{\perp _{H}}=({\mathcal {C}}^{q})^{\perp _{E}}=({\mathcal {C}}^{\perp _{E}})^{q}\). Hence, \({\mathcal {C}}^{\perp _{E}}\) and \({\mathcal {C}}^{\perp _{H}}\) have the same minimum Hamming distance. If \({\mathcal {C}}\subseteq {\mathcal {C}}^{\perp _{H}}\) (resp. \({\mathcal {C}}\subseteq {\mathcal {C}}^{\perp _{E}}\)), then \({\mathcal {C}}\) is called a Hermitian self-orthogonal code (resp. an Euclidean self-orthogonal code). Define the symplectic weight of a vector \((\mathbf{a }|\mathbf{b })=(a_{0},a_{1},\ldots ,a_{n-1}|b_{0},b_{1}, \ldots ,b_{n-1})\in {\mathbb {F}}_{q}^{2n}\) as

$$\begin{aligned} \text {wt}_{s}((\mathbf{a }|\mathbf{b }))=|\{i\mid (a_{i},b_{i})\ne (0,0), 0\le i\le n-1\}|. \end{aligned}$$

For two vectors \((\mathbf{a }|\mathbf{b })\), \((\mathbf{a }'|\mathbf{b }')\in {\mathbb {F}}_{q}^{2n}\), define the trace-symplectic inner product as

$$\begin{aligned} \left\langle (\mathbf{a }|\mathbf{b }), (\mathbf{a }'|\mathbf{b }')\right\rangle _{s}=\text {Tr}_{q/p} (\mathbf{b }\cdot \mathbf{a }'-\mathbf{b }'\cdot \mathbf{a }), \end{aligned}$$

where \(\text {Tr}_{q/p}\) denotes the trace map from \({\mathbb {F}}_{q}\) to \({\mathbb {F}}_{p}\). For a linear code \({\mathcal {D}}\subseteq {\mathbb {F}}_{q}^{2n}\), the trace-symplectic dual code of \({\mathcal {D}}\) is defined as

$$\begin{aligned} {\mathcal {D}}^{\perp _{s}}=\{\mathbf{c }\in {\mathbb {F}}_{q}^{2n}\mid \langle \mathbf{c },\mathbf{x }\rangle _{s}=0\ \text {for}\ \text {all}\ \mathbf{x }\in {\mathcal {C}}\}. \end{aligned}$$

If \({\mathcal {D}}\subseteq {\mathcal {D}}^{\perp _{s}}\), then \({\mathcal {D}}\) is called a symplectic self-orthogonal code. For any nonempty subset \(A\subseteq {\mathbb {F}}_{q}^{2n}\), define the weight of A as \(\text {wt}_{s}(A)=\min \{\text {wt}_{s}(\mathbf{a }) \mid \mathbf{0 }\ne \mathbf{a }\in A\}.\)

Let \({\mathcal {C}}\) be an \(\eta \)-constacyclic code over \({\mathbb {F}}_{q^{2}}\) of length n. Assume that the order r of \(\eta \) in \({\mathbb {F}}_{q^{2}}^{*}\) is a divisor of \(q+1\). Then \({\mathcal {C}}^{\perp _{H}}\) is still \(\eta \)-constacyclic [18]. Suppose that \({\mathcal {C}}\) has nonzero set \(T\subseteq \varOmega \). Then \({\mathcal {C}}^{\perp _{H}}\) has zero set \(-qT=\{-qz(\bmod ~nr)\mid z\in T\}\). Moreover, \({\mathcal {C}}\subseteq {\mathcal {C}}^{\perp _{H}}\) if and only if \(-qT\bigcap T=\emptyset \). In the next section, we will derive Hermitian self-orthogonal codes over \({\mathbb {F}}_{q^{2}}\) from constacyclic codes over \({\mathbb {F}}_{q^{2m}}\), where \(m\ge 2\) is a positive integer. Let \({\mathbb {F}}_{q^{2m}}\) be an extension field of \({\mathbb {F}}_{q^{2}}\) with degree m. Then \({\mathbb {F}}_{q^{2m}}\) can be viewed as an m-dimensional vector space over \({\mathbb {F}}_{q^{2}}\). The trace map \(\text {Tr}_{q^{2m}/q^{2}}:~{\mathbb {F}}_{q^{2m}}\rightarrow {\mathbb {F}}_{q^{2}}\) is defined as

$$\begin{aligned} \text {Tr}_{q^{2m}/q^{2}}(a)=a+a^{q^{2}}+\cdots +a^{q^{2(m-1)}}. \end{aligned}$$

Let \({\mathcal {A}}=\{\alpha _{0},\alpha _{1},\ldots ,\alpha _{m-1}\}\) and \({\mathcal {B}}=\{\beta _{0},\beta _{1},\ldots ,\beta _{m-1}\}\) be two bases of \({\mathbb {F}}_{q^{2m}}\) over \({\mathbb {F}}_{q^{2}}\). If

$$\begin{aligned} \text {Tr}_{q^{2m}/q^{2}}(\alpha _{i}\beta _{j}^{q^{m}})=\left\{ {{\begin{array}{ll} {1,} &{} {i = j,} \\ {0,} &{} {i\ne j} \\ \end{array} }}\right. \end{aligned}$$

for \(0\le i,j\le m-1\), then the bases \({\mathcal {A}}\) and \({\mathcal {B}}\) are said to be Hermitian dual to each other. Similar to the Euclidean dual bases, it can be verified that any basis of \({\mathbb {F}}_{q^{2m}}\) over \({\mathbb {F}}_{q^{2}}\) has a unique Hermitian dual basis (see [38]).

Now, we review some basic concepts on quantum error-correct codes. Quantum bits or qubits are the basic unit for quantum systems used to store quantum information. The state of a qubit is a nonzero vector in the complex vector space \({\mathbb {C}}^{q}\). Denote by \(\{|x\rangle \mid x\in {\mathbb {F}}_{q}\}\) an orthonormal basis of \({\mathbb {C}}^{q}\) with respect to the Hermitian inner product. Let \({\mathcal {H}}=({\mathbb {C}}^{q})^{\otimes n}={\mathbb {C}}^{q^{n}}\) be the n-th tensor product of \({\mathbb {C}}^{q}\). A quantum system of n qubits has basis states of the form

$$\begin{aligned} |x_{1}\rangle \otimes |x_{2}\rangle \otimes \cdots \otimes |x_{n}\rangle =|x_{1}x_{2}\cdots x_{n}\rangle . \end{aligned}$$

So a quantum state of such a system can be represented as a superposition of these basis states and is specified by \(q^{n}\) amplitudes. A quantum state having the property that it cannot be written as a product of states of its component systems is said to be an entangled state. Entangled states play a crucial role in quantum computation and quantum information. In an entangled state, the component systems are correlated. A quantum error-correcting scheme is proposed by entangling the transmitted qubits of a quantum codeword with some ancilla qubits (see [29, 31]).

A q-ary quantum code is a K-dimensional subspace of the Hilbert space \({\mathbb {C}}^{q^{n}}\). Let a and b be any two elements of \({\mathbb {F}}_{q}\). Define the unitary operators X(a) and Z(b) on \({\mathbb {C}}^{q}\) as \(X(a)|x\rangle =|x+a\rangle \) and \(Z(b)|x\rangle =\omega ^{\text {Tr}_{q/p}(bx)}|x\rangle \), where \(\omega =\text {exp}(2\pi i/p)\) is a primitive p-th root of unity. For any vector \(\mathbf{a }=(a_{0},a_{1},\ldots ,a_{n-1})\in {\mathbb {F}}_{q}^{n}\), let \(X(\mathbf{a })=X(a_{1})\otimes \cdots \otimes X(a_{n})\). The set \({\mathcal {E}}_{n}=\{X(\mathbf{a })X(\mathbf{b })\mid \mathbf{a },\mathbf{b }\in {\mathbb {F}}_{q}^{n}\}\) forms an error basis on \({\mathbb {C}}^{q^n}\). The basis \({\mathcal {E}}_{n}\) can generate a finite error group \(G_{n}=\{\omega ^{i}X(\mathbf{a })X(\mathbf{b })\mid \mathbf{a },\mathbf{b }\in {\mathbb {F}}_{q}^{n},0\le i\le p-1\}\). For a quantum error \(\mathbf{e }=\omega ^{\lambda }X(\mathbf{a })X(\mathbf{b })\in G_{n}\) with \(\mathbf{a }=(a_{0},a_{1},\ldots ,a_{n-1})\in {\mathbb {F}}_{q}^{n}\) and \(\mathbf{b }=(b_{0},b_{1},\ldots ,b_{n-1})\in {\mathbb {F}}_{q}^{n}\), the quantum weight is defined as \(\text {wt}_{Q}(\mathbf{e })=\text {wt}_{s}((\mathbf{a }|\mathbf{b }))\). A quantum code has minimum distance d if and only if it can detect all errors in \(G_{n}\) of weight less than d, but cannot detect some error of weight d. A quantum stabilizer code \({\mathcal {Q}}\) is a nonzero subspace of \({\mathbb {C}}^{q^n}\) that satisfies \({\mathcal {Q}}=\bigcap _{E\in S}\{v\in {\mathbb {C}}^{q^n}\mid Ev=v\}\), where S is a subgroup of \(G_{n}\). Denoted by \(((n,K,d))_{q}\) or \([[n,k,d]]_{q}\) a quantum stabilizer code \({\mathcal {Q}}\) with dimension K and minimum distance d, where \(k=\log _{q}{K}\). An \([[n,k,d]]_{q}\) quantum code can encode k logical qubits of information into n physical qubits and has \(q^{k}\) basis codewords. For a subgroup S of \(G_{n}\), let \(C_{G_{n}}(S)\) be the centralizer of S in \(G_{n}\) and \(SZ(G_{n})\) be the subgroup generated by S and the center \(Z(G_{n})\). Regard a quantum error \(\omega ^{\lambda }X(\mathbf{a })X(\mathbf{b })\) in \(G_{n}\) as an element \((\mathbf{a }|\mathbf{b })\) in \({\mathbb {F}}_{q}^{2n}\), then \(C_{G_{n}}(S)\) and \(SZ(G_{n})\) are, respectively, mapped into an additive code and its dual code with respect to the symplectic inner product. Moreover, \(SZ(G_{n})\) is a subgroup of \(C_{G_{n}}(S)\). Based on this, the connection between quantum stabilizer codes and classical additive codes was established in [2, 20]

Theorem 2.2

[2, 20] An \(((n,K,d))_{q}\) quantum stabilizer code exists if and only if there exists an additive code \({\mathcal {C}}\subseteq {\mathbb {F}}_{q}^{2n}\) of size \(q^{n}/K\) such that \({\mathcal {C}}\subseteq {\mathcal {C}}^{\perp _{s}}\) and \(\text {wt} _{s}({\mathcal {C}}^{\perp _{s}}\backslash {\mathcal {C}})=d\) if \(K>1\) (and \(\text {wt} _{s}({\mathcal {C}}^{\perp _{s}})=d\) if \(K=1\)).

We briefly recall the connection between Hermitian codes and quantum stabilizer codes (see [2, 5]). Let \(\gamma _{0}\) be a nonzero element in \({\mathbb {F}}_{q}\). Take \(\gamma \in {\mathbb {F}}_{q^{2}}\backslash {\mathbb {F}}_{q}\) so that \(\gamma ^{q}=-\gamma +\gamma _{0}\). It is easy to verify that \({\mathcal {B}}=\{1,\gamma \}\) is a basis of \({\mathbb {F}}_{q^{2}}\) over \({\mathbb {F}}_{q}\). Let \({\mathcal {D}}\) be a Hermitian self-orthogonal code over \({\mathbb {F}}_{q^{2}}\) of length n, then the image \({\mathcal {L}}_{{\mathcal {B}}}({\mathcal {D}})\) of \({\mathcal {D}}\) under the basis \({\mathcal {B}}\) is a linear code over \({\mathbb {F}}_{q}\) of length 2n. Let \(\mathbf{a }=(a_{0},a_{1},\ldots ,a_{n-1})\in {\mathcal {D}}\) and \(\mathbf{b }=(b_{0},b_{1},\ldots ,b_{n-1})\in {\mathcal {D}}^{\perp _{H}}\). Let \(a_{i}=a_{i}^{(1)}+\gamma a_{i}^{(2)}\) and \(b_{i}=b_{i}^{(1)}+\gamma b_{i}^{(2)}\). Then

$$\begin{aligned} \langle \mathbf{a },\mathbf{b }\rangle _{H}= & {} \sum _{i=0}^{n-1}a_{i}b_{i}^{q}\\= & {} \sum _{i=0}^{n-1}\left[ a_{i}^{(1)}+\gamma a_{i}^{(2)}\right] \left[ b_{i}^{(1)}+(\gamma _{0}-\gamma ) b_{i}^{(2)}\right] \\= & {} \sum _{i=0}^{n-1}\left[ a_{i}^{(1)}b_{i}^{(1)}+\gamma _{0}a_{i}^{(1)}b_{i}^{(2)} +\gamma \left( a_{i}^{(2)}b_{i}^{(1)}-a_{i}^{(1)}b_{i}^{(2)}\right) +\gamma ^{q+1}a_{i}^{(2)}b_{i}^{(2)} \right] \\= & {} 0. \end{aligned}$$

Note that \(\gamma ^{q+1}\) is in \({\mathbb {F}}_{q}\), so it must be \(\langle \mathbf{a },\mathbf{b }\rangle _{H}=a_{i}^{(2)}b_{i}^{(1)} -a_{i}^{(1)}b_{i}^{(2)}=0\), implying that \({\mathcal {L}}_{{\mathcal {B}}}({\mathcal {D}})\) is a trace-symplectic self-orthogonal code. Applying Theorem 2.2 produces an explicit construction of quantum stabilizer codes from Hermitian self-orthogonal codes.

Theorem 2.3

(Hermitian Construction) [2, 5] Let \({\mathcal {C}}\) be a Hermitian self-orthogonal [nk] linear code over \({\mathbb {F}}_{q^{2}}\) and let \(d=\min \{\text {wt} (\mathbf{v })\mid \mathbf{v }\in {\mathcal {C}}^{\perp _{H}}\backslash {\mathcal {C}}\}\). Then a q-ary \([[n,n-2k,d]]\) quantum stabilizer code can be obtained from \({\mathcal {C}}\).

3 Images of constacyclic codes

Let \({\mathcal {A}}=\{\alpha _{0},\alpha _{1},\ldots ,\alpha _{m-1}\}\) be a basis of \({\mathbb {F}}_{q^{2m}}\) over \({\mathbb {F}}_{q^{2}}\). For any \(\mathbf{x }=(x_{0},x_{1},\ldots ,x_{n-1})\in {\mathbb {F}}_{q^{2m}}^{n}\), each entry of \(\mathbf{x }\) can be expressed as \(x_{i}=\sum _{j=0}^{m-1}x_{ij}\alpha _{j}\), where \(x_{ij}\in {\mathbb {F}}_{q^{2}}\). We can define a map \(\mathcal {L_{{\mathcal {A}}}}\) from \({\mathbb {F}}_{q^{2m}}^{n}\) to \({\mathbb {F}}_{q^{2}}^{nm}\) as

$$\begin{aligned} \mathcal {L_{{\mathcal {A}}}}((x_{0},x_{1},\ldots ,x_{n-1})) =(x_{00},\ldots ,x_{n-1,0},x_{01},\ldots ,x_{n-1,1},x_{0,m-1},\ldots ,x_{n-1,m-1}). \end{aligned}$$

It is obvious that \(\mathcal {L_{{\mathcal {A}}}}\) is an isomorphism of the \({\mathbb {F}}_{q^{2}}\)-vector space. Let \({\mathcal {C}}\) be a linear [nkd] code over \({\mathbb {F}}_{q^{2m}}\). Define the \(q^2\)-ary image of \({\mathcal {C}}\) with respect to the basis \({\mathcal {A}}\) to be \(\mathcal {L_{{\mathcal {A}}}}({\mathcal {C}})=\{\mathcal {L_{{\mathcal {A}}}}(\mathbf{c })\mid \mathbf{c }\in {\mathcal {C}}\}\). Then \(\mathcal {L_{{\mathcal {A}}}}({\mathcal {C}})\) is an \([mn,km,\ge d]\) linear code over \({\mathbb {F}}_{q^{2}}\).

Lemma 3.1

Let \({\mathcal {A}}=\{\alpha _{0},\alpha _{1},\ldots ,\alpha _{m-1}\}\) be a basis of \({\mathbb {F}}_{q^{2m}}\) over \({\mathbb {F}}_{q^{2}}\) and \({\mathcal {B}}=\{\beta _{0},\beta _{1},\ldots ,\beta _{m-1}\}\) be a Hermitian dual basis of \({\mathcal {A}}\). Let \({\mathcal {C}}\) be a linear [nk] code over \({\mathbb {F}}_{q^{2m}}\) and \({\mathcal {C}}^{\perp _{H}}\) be its Hermitian dual code. If m is odd, then \(\mathcal {L_{{\mathcal {A}}}}({\mathcal {C}})^{\perp _{H}} =\mathcal {L_{{\mathcal {B}}}}({\mathcal {C}}^{\perp _{H}})\). If m is even, then \(\mathcal {L_{{\mathcal {A}}}}({\mathcal {C}})^{\perp _{H}}= \mathcal {L_{{\mathcal {B}}}}({\mathcal {C}}^{\perp _{H}})^{q}\).

Proof

Let \(\mathbf{u }=(u_{0},u_{1},\ldots ,u_{n-1})\) be any codeword in \({\mathcal {C}}\) with \(u_{i}=\sum _{j=0}^{m-1}u_{ij}\alpha _{j}\), where \(u_{ij}\in {\mathbb {F}}_{q^2}\). Let \(\mathbf{v }=(v_{0},v_{1},\ldots ,v_{n-1})\) be any codeword in \({\mathcal {C}}^{\perp _{H}}\) with \(v_{i}=\sum _{\ell =0}^{m-1}v_{i\ell }\beta _{\ell }\), where \(v_{i\ell }\in {\mathbb {F}}_{q^2}\). Then

$$\begin{aligned} (\mathbf{u }, \mathbf{v })_{H}=\sum _{i=0}^{n-1}u_{i}v_{i}^{q^{m}}=\sum _{i=0}^{n-1} \left( \sum _{j=0}^{m-1}u_{ij}\alpha _{j}\right) \left( \sum _{\ell =0}^{m-1} v_{i\ell }^{q^m}\beta _{\ell }^{q^m}\right) =0. \end{aligned}$$
(1)

Taking the trace on two sides of (1), we can get that

$$\begin{aligned} \text {Tr}_{{\mathbb {F}}_{q^{2m}}/{\mathbb {F}}_{q^2}}\left( (\mathbf{u }, \mathbf{v })_{H}\right) =\sum _{i=0}^{n-1}\sum _{j=0}^{m-1} \sum _{\ell =0}^{m-1}u_{ij}v_{i\ell }^{q^m}\text {Tr}_{{\mathbb {F}}_{q^{2m}} /{\mathbb {F}}_{q^2}}\left( \alpha _{j}\beta _{\ell }^{q^{m}}\right) =0. \end{aligned}$$
(2)

If m is odd, then \(v_{i\ell }^{q^m}=v_{i\ell }^{q}\) for \(0\le i\le n-1\) and \(0\le \ell \le m-1\). By the orthogonality of bases, (2) becomes \(\sum _{i=0}^{n-1}\sum _{j=0}^{m-1}u_{ij}v_{ij}^{q}=0.\) This shows that \(\mathcal {L_{{\mathcal {B}}}}({\mathcal {C}}^{\perp _{H}})\subseteq \mathcal {L_{{\mathcal {A}}}}({\mathcal {C}})^{\perp _{H}}.\) If m is even, then \(v_{i\ell }^{q^m}=v_{i\ell }\) for \(0\le i\le n-1\) and \(0\le \ell \le m-1\). By the orthogonality of bases, (2) becomes \(\sum _{i=0}^{n-1}\sum _{j=0}^{m-1}u_{ij}v_{ij}=0.\) This shows that \(\mathcal {L_{{\mathcal {B}}}}({\mathcal {C}}^{\perp _{H}})\subseteq \mathcal {L_{{\mathcal {A}}}}({\mathcal {C}})^{\perp _{E}},\) i.e., \(\mathcal {L_{{\mathcal {B}}}}({\mathcal {C}}^{\perp _{H}})^{q}\subseteq \mathcal {L_{{\mathcal {A}}}}({\mathcal {C}})^{\perp _{H}}.\) Note that \(\mathcal {L_{{\mathcal {B}}}}({\mathcal {C}}^{\perp _{H}})\) and \(\mathcal {L_{{\mathcal {A}}}}({\mathcal {C}})^{\perp _{H}}\) have the same cardinality. The desired result follows. \(\square \)

Let \(\eta \) be a fixed nonzero element of \({\mathbb {F}}_{q^{2}}\). Assume that \(\eta \) has order r in \({\mathbb {F}}_{q^{2}}^{*}\). Note that \({\mathbb {F}}_{q^{2}}^{*}\) is a subgroup of \({\mathbb {F}}_{q^{2m}}^{*}\), so \(\eta \) must be in \({\mathbb {F}}_{q^{2m}}^{*}\) and has order r. An \(\eta \)-constacyclic code over \({\mathbb {F}}_{q^{2m}}\) of length n is an ideal in \({\mathbb {F}}_{q^{2m}}[x]/\langle x^{n}-\eta \rangle \). Let \(\xi \) be a primitive nr-th root of unity. Let \({\mathcal {C}}\subseteq {\mathbb {F}}_{q^{2m}}[x]/\langle x^{n}-\eta \rangle \) be the \(\eta \)-constacyclic code with zero set \(Z_{2m}\subseteq \varOmega =\{1+rj\mid 0\le j\le n-1\}\). Note that \(Z_{2m}\) is a union of some \(q^{2m}\)-cyclotomic cosets modulo nr, moreover, \({\mathcal {C}}=\langle g(x)\rangle \) where \(g(x)=\prod _{z\in Z_{2m}}(x-\xi ^{z})\). To study the \(q^2\)-ary image of \({\mathcal {C}}\), we consider an \(\eta \)-constacyclic code over \({\mathbb {F}}_{q^{2}}\) of length n. For any \(\lambda \in C_{q^{2m}}[s,nr]\), it is obvious that \(\lambda \in C_{q^{2}}[s,nr]\). Define the set \(Z_{2}\) to be the union of the \(q^{2}\)-cyclotomic cosets modulo nr contained in \(Z_{2m}\), i.e.,

$$\begin{aligned} Z_{2}=\bigcup \nolimits _{C_{q^2}[\lambda ,nr]\subseteq Z_{2m}}C_{q^2}[\lambda ,nr].\end{aligned}$$
(3)

Let \({\mathcal {D}}\) be the \(\eta \)-constacyclic code over \({\mathbb {F}}_{q^{2}}\) of length n with zero set \(Z_{2}\subseteq \varOmega \). Then \({\mathcal {D}}\) has generator polynomial

$$\begin{aligned} g_{q^{2}}(x)=\prod _{z\in Z_{2}}(x-\xi ^{z}). \end{aligned}$$

Note that \(g_{q^{2}}(x)\) is a polynomial over \({\mathbb {F}}_{q^{2}}\). It is obvious that \(g_{q^{2}}(x)\) is a divisor of g(x) with the highest degree in \({\mathbb {F}}_{q^{2}}[x]\).

Assume that \(g(x)=g_{q^{2}}(x)h(x)\), for some \(h(x)\in {\mathbb {F}}_{q^{2m}}[x]\). Let \(c(x)=\sum _{i=0}^{n-1}c_{i}x^{i}\) be a codeword in \({\mathcal {C}}\), where \(c_{i}\in {\mathbb {F}}_{q^{2m}}\). Under the basis \({\mathcal {A}}=\{\alpha _{0},\alpha _{1},\ldots ,\alpha _{m-1}\}\), we can write \(c_{i}=\sum _{j=0}^{m-1}c_{ij}\alpha _{j}\), where \(c_{ij}\in {\mathbb {F}}_{q^{2}}\). Then

$$\begin{aligned} c(x)=\sum _{i=0}^{n-1}\left( \sum _{j=0}^{m-1}c_{ij}\alpha _{j}\right) x^{i} =\sum _{j=0}^{m-1}\left( \sum _{i=0}^{n-1}c_{ij}x^{i}\right) \alpha ^{j}. \end{aligned}$$

Write \(c_{j}(x)=\sum _{i=0}^{n-1}c_{ij}x^{i}\), for \(0\le j\le m-1\). Then \(c_{j}(x)\) can be viewed as a word over \({\mathbb {F}}_{q^{2}}\) of length n. The following result tells us that the word is from the code \({\mathcal {D}}\).

Lemma 3.2

Let \(c_{j}(x)\), \(0\le j\le m-1\), be defined as above. Let \({\mathcal {C}}\) be the \(\eta \)-constacyclic code in \({\mathbb {F}}_{q^{2m}}[x]/\langle x^{n}-\eta \rangle \) with generator polynomial g(x). Let \({\mathcal {D}}\) be the \(\eta \)-constacyclic code in \({\mathbb {F}}_{q^{2}}[x]/\langle x^{n}-\eta \rangle \) with generator polynomial \(g_{q^{2}}(x)\). Then \(c_{j}(x)\), \(0\le j\le m-1,\) are codewords in \({\mathcal {D}}\).

Proof

Let \(\deg (g(x))=\ell _{1}\) and \(\deg (g_{q^2}(x))=\ell _{2}\). Since c(x) belongs to \({\mathcal {C}}\), we have \(c(x)=g(x)s(x)\), for some \(s(x)\in {\mathbb {F}}_{q^{2m}}[x]\) and \(\deg (s(x)<n-\ell _{1}\). Hence, \(c(x)=g_{q^{2}}(x)h(x)s(x)\). Write \(t(x)=h(x)s(x)\), then \(t(x)\in {\mathbb {F}}_{q^{2m}}[x]\) and \(\deg (t(x)<n-\ell _{2}\). Under the basis \({\mathcal {A}}=\{\alpha _{0},\alpha _{1},\ldots ,\alpha _{m-1}\}\), we can write \(t(x)=\sum _{j=0}^{m-1}u_{j}(x)\alpha _{j}\), where \(u_{j}(x)\in {\mathbb {F}}_{q^{2}}[x]\) and \(\deg (u_{j}(x))<n-\ell _{2}\). It then follows that \(c(x)=\sum _{j=0}^{m-1}g_{q^{2}}(x)u_{j}(x)\alpha _{j}\). Note that \(g_{q^{2}}(x)u_{j}(x)\) has degree less than n. Thus, \(c_{j}(x)=g_{q^{2}}(x)u_{j}(x)\). The desired result follows. \(\square \)

From Lemma 3.2, we see that each codeword of \(\mathcal {L_{{\mathcal {A}}}}({\mathcal {C}})\) is a concatenation of the codewords of an \(\eta \)-constacyclic code in \({\mathbb {F}}_{q^{2}}[x]/\langle x^{n}-\eta \rangle \). This directly yields the following theorem.

Theorem 3.3

Let \({\mathcal {C}}\) be the \(\eta \)-constacyclic code in \({\mathbb {F}}_{q^{2m}}[x]/\langle x^{n}-\eta \rangle \) with zero set \(Z_{2m}\). Let \({\mathcal {D}}\) be the \(\eta \)-constacyclic code in \({\mathbb {F}}_{q^{2}}[x]/\langle x^{n}-\eta \rangle \) with zero set \(Z_{2}\), where \(Z_{2}\) is defined as (3). If \({\mathcal {D}}\subseteq {\mathcal {D}}^{\perp _{H}}\), then \(\mathcal {L_{{\mathcal {A}}}}({\mathcal {C}})\subseteq \mathcal {L_{{\mathcal {A}}}}({\mathcal {C}})^{\perp _{H}}\).

According to Theorem 3.3, if \({\mathcal {C}}\) is an \(\eta \)-constacyclic [nk] code over \({\mathbb {F}}_{q^{2m}}\) such that \({\mathcal {D}}\subseteq {\mathcal {D}}^{\perp _{H}}\), then \(\mathcal {L_{{\mathcal {A}}}}({\mathcal {C}})\) is Hermitian self-orthogonal and has parameters [nmmk]. By Lemma 3.1, \(\mathcal {L_{{\mathcal {A}}}}({\mathcal {C}})^{\perp _{H}} =\mathcal {L_{{\mathcal {B}}}}({\mathcal {C}}^{\perp _{H}})\) or \(\mathcal {L_{{\mathcal {A}}}}({\mathcal {C}})^{\perp _{H}} =\mathcal {L_{{\mathcal {B}}}}({\mathcal {C}}^{\perp _{H}})^{q}\). Hence, \(\mathcal {L_{{\mathcal {A}}}}({\mathcal {C}})^{\perp _{H}}\) has parameters \([nm, nm-mk,\ge d^{\perp }]\), where \(d^{\perp }\) is the minimum Hamming distance of \({\mathcal {C}}^{\perp _{H}}\). By the Hermitian construction, a q-ary \([[mn,mn-2mk,\ge d^{\perp }]]\) can be obtained from \(\mathcal {L_{{\mathcal {A}}}}({\mathcal {C}})\). To construct quantum codes of length mn, we need to find Hermitian self-orthogonal constacyclic codes over \({\mathbb {F}}_{q^{2}}\) of length n. For this, assume that \(\eta =\omega ^{\ell (q-1)}\), for some \(\ell \in \{0,1,\ldots ,q\}\), then the Hermitian dual code of an \(\eta \)-constacyclic code over \({\mathbb {F}}_{q^{2}}\) is still \(\eta \)-constacyclic [18]. We now give a sufficient condition for \({\mathcal {L}}_{{\mathcal {A}}}({\mathcal {C}})\) to be Hermitian self-orthogonal. We first give the following useful lemma.

Lemma 3.4

Let \({\mathcal {C}}\) be the \(\eta \)-constacyclic code in \({\mathbb {F}}_{q^{2m}}[x]/\langle x^{n}-\eta \rangle \) with nonzero set \(T_{2m}\). Denote \(T_{2}=\bigcup _{s\in T_{2m}} C_{q^{2}}[s,nr]\). Then \(-q T_{2}\bigcap T_{2}=\emptyset \) if and only if \(aq^{2\ell +1}+b\not \equiv 0(\bmod ~nr)\) for any \(a,b\in T_{2m}\) and any nonnegative integer \(\ell \).

Proof

The necessity directly follows from the condition that \(-q T_{2}\bigcap T_{2}=\emptyset \). We now prove the sufficiency. Suppose that \(-q T_{2}\bigcap T_{2}\ne \emptyset \). Then there exists \(z\in \varOmega \) such that \(z\in -q T_{2}\bigcap T_{2}\). This means that \(C_{q^{2}}[z,nr]\subseteq -q T_{2}\bigcap T_{2}\). Hence, we can find \(y\in T_{2m}\) such that \(y\in C_{q^{2}}[z,nr]\). Meanwhile, we can also find \(x\in T_{2}\) such that \(y\equiv -qx(\bmod ~nr)\in C_{q^{2}}[z,nr]\). By the condition, x must be not in \(T_{2m}\). From the definition of \(T_{2}\), there exists \(w\in T_{2m}\) such that \(x\in C_{q^{2}}[w,nr]\). This means that \(x\equiv wq^{2\ell }(\bmod ~nr)\), for some integer \(\ell \). Hence, \(y\equiv -wq^{2\ell +1}(\bmod ~nr)\), which contradicts the assumption. Hence, \(-q T_{2}\bigcap T_{2}=\emptyset \). This completes the proof. \(\square \)

Theorem 3.5

Let \({\mathcal {C}}\) be the \(\eta \)-constacyclic code in \({\mathbb {F}}_{q^{2m}}[x]/\langle x^{n}-\eta \rangle \) with nonzero set \(T_{2m}\). Assume that \(aq^{2\ell +1}+b\not \equiv 0(\bmod ~nr)\) for any \(a,b\in T_{2m}\) and any nonnegative integer \(\ell \). Then \(\mathcal {L_{{\mathcal {A}}}}({\mathcal {C}})\subseteq \mathcal {L_{{\mathcal {A}}}}({\mathcal {C}})^{\perp _{H}}\).

Proof

Let \(Z_{2m}\) be the zero set of \({\mathcal {C}}\). Let \({\mathcal {D}}\) be the \(\eta \)-constacyclic code over \({\mathbb {F}}_{q^{2}}\) of length n with zero set \(Z_{2}\), where \(Z_{2}\) is given as (3). Then \({\mathcal {D}}^{\perp _{H}}\) has zero set

$$\begin{aligned} Z_{2}^{\perp _{H}}=\{z\in \varOmega \mid -qz(\bmod ~nr)\not \in Z_{2}\}. \end{aligned}$$

Let y be any element in \(Z_{2}^{\perp _{H}}\). Then \(-qy(\bmod ~ nr)\not \in Z_{2}\). We claim that \(-qy(\bmod ~rn)\in T_{2}=\bigcup _{s\in T_{2m}} C_{q^{2}}[s,nr]\). In fact, if \(-qy(\bmod ~nr)\in T_{2m}\), then it is obvious that \(-qy(\bmod ~nr)\in T_{2}\). If \(-qy(\bmod ~rn)\not \in T_{2m}\), then \(-qy(\bmod ~rn)\in Z_{2m}\). By the definition of \(Z_{2}\), there exists \(w\in T_{2m}\) such that \(-qy(\bmod ~nr)\in C_{q^{2}}[w,nr]\), which means that \(-qy(\bmod nr)\in T_{2}\). By Lemma 3.4, we know \(-q T_{2}\bigcap T_{2}=\emptyset \). So, \(y\not \in T_{2}\), which means \(y\in Z_{2}\). This shows that \(Z_{2}^{\perp _{H}}\subseteq Z_{2}\). Hence, \({\mathcal {D}}\subseteq {\mathcal {D}}^{\perp _{H}}\). By Theorem 3.3, \(\mathcal {L_{{\mathcal {A}}}}({\mathcal {C}})\subseteq \mathcal {L_{{\mathcal {A}}}}({\mathcal {C}})^{\perp _{H}}\). \(\square \)

Theorem 3.5 provides a method for constructing Hermitian self-orthogonal codes by exploiting the \(q^2\)-ary images of constacyclic codes over \({\mathbb {F}}_{q^{2m}}\). It is worth mentioning that constacyclic codes over \({\mathbb {F}}_{q^{2m}}\) in Theorem 3.5 are not necessarily Hermitian self-orthogonal. For any \(a,b\in T_{2m}\), note that \(aq^{2\ell +1}+b\not \equiv 0(\bmod ~nr)\) for any nonnegative integer \(\ell \) if and only if \(C_{q^{2}}[a,nr]\ne -qC_{q^{2}}[b,nr]\).

4 Quantum codes

In this section, we will use constacyclic MDS codes over \({\mathbb {F}}_{q^{2m}}\) to construct two classes of quantum codes.

4.1 Construction I

We first consider constacyclic MDS codes over \({\mathbb {F}}_{q^{2m}}\) of length \(n=q^{2m}+1\), where \(m\ge 2\). We divide the prime power q into two cases.

Case 1: q is even

In this case, all the \(q^{2m}\)-cyclotomic cosets modulo n are given by \(C_{q^{2m}}[0,n]=\{0\}\) and \(C_{q^{2m}}[\frac{n-1}{2}-i,n]=\{\frac{n-1}{2}-i,\frac{n-1}{2}+i+1\}\), for \(0\le i\le \frac{n-3}{2}\) [28]. Define

$$\begin{aligned} \varDelta _{1}=\left\{ {{\begin{array}{ll} {\frac{q^{m+1}-q^{2}-2}{2},\ \text {if}\ m=2\nu \ge 2;}\\ {\frac{q^{m}-2}{2},\ \ \ \ \ \ \ \ \text {if}\ m=2\nu +1\ge 3.} \\ \end{array} }} \right. \end{aligned}$$
(4)

Lemma 4.1

Let \(n=q^{2m}+1\), where q is an even prime power and \(m\ge 2\) is a positive integer. If \({\mathcal {C}}\) is the cyclic code over \({\mathbb {F}}_{q^{2m}}\) of length n with nonzero set \(T_{2m}=\bigcup _{i=0}^{\delta }C_{q^{2m}}[\frac{n-1}{2}-i,n]\), where \(0\le \delta \le \varDelta _{1}\), then \(\mathcal {L_{{\mathcal {A}}}}({\mathcal {C}})\subseteq \mathcal {L_{{\mathcal {A}}}}({\mathcal {C}})^{\perp _{H}}\).

Proof

We prove that, for any \(a,b\in T_{2m}\), \(C_{q^{2}}[a,n]\ne -qC_{q^{2}}[b,n]\). Suppose that there exist \(a=\frac{n-1}{2}-j\) and \(b=\frac{n-1}{2}-k\) with \(j,k\in \left\{ 0,1,\ldots ,\varDelta _{1}\right\} \) such that \(aq^{2\ell +1}+b\equiv 0(\bmod ~n)\) for \(0\le \ell \le 2m-1\). That is, for \(0\le \ell \le 2m-1\),

$$\begin{aligned} (1+2j)q^{2\ell +1}+(1+2k)\equiv 0(\bmod ~n). \end{aligned}$$
(5)

Observe that \((1+2j)+(1+2k)q^{2(2m-\ell -1)+1}\equiv 0(\bmod ~n)\), so we can assume that \(0\le \ell \le m-1\). We only seek a contradiction for the case that m is even. The case that m is odd is very similar and omitted.

If \(0\le \ell \le \frac{m-2}{2}\), then \(1+q\le (1+2j)q^{2\ell +1}+(1+2k)<n\). This gives a contradiction.

If \(\frac{m}{2}\le \ell \le m-1\), from (5) we get that \((1+2k)q^{2(m-\ell )-1}\equiv 1+2j(\bmod ~n).\) Note that \(q\le (1+2k)q^{2(m-\ell )-1}<n\) and \(1\le 1+2j\le q^{m+1}-q^{2}-1\). It must be \((1+2k)q^{2(m-\ell )-1}=1+2j\). This is impossible since \((1+2k)q^{2(m-\ell )-1}\) is even and \(1+2j\) is odd.

Hence, for any \(a,b\in T_{2m}\), \(C_{q^{2}}[a,n]\ne -qC_{q^{2}}[b,n]\). By Theorem 3.5, we have the desired result. \(\square \)

Based on \(q^{2m}\)-ary cyclic codes, we now construct q-ary quantum codes by using the Hermitian construction.

Theorem 4.2

Let \(n=q^{2m}+1\), where q is an even prime power and \(m\ge 2\) is a positive integer. Then there exists a q-ary quantum code with parameters \([[mn,mn-4m(\delta +1),\ge 2\delta +3]]\), where \(0\le \delta \le \varDelta _{1}\).

Proof

Let \({\mathcal {C}}\) be the \(q^{2m}\)-ary cyclic code of length n with nonzero set

$$\begin{aligned} T_{2m}=\bigcup _{i=0}^{\delta }C_{q^{2m}}[(n-1)/2-i,n], \end{aligned}$$

where \(0\le \delta \le \varDelta _{1}\). By Lemma 4.1, \(\mathcal {L_{{\mathcal {A}}}}({\mathcal {C}})\subseteq \mathcal {L_{{\mathcal {A}}}}({\mathcal {C}})^{\perp _{H}}\). Note that \({\mathcal {C}}\) has zero set

$$\begin{aligned} S_{2m}=C_{q^{2m}}[0,n]\bigcup \bigcup \nolimits _{i=\delta +1}^{(n-3)/2} C_{q^{2m}}[(n-1)/2-i,n]. \end{aligned}$$

Since \(S_{2m}\) consists of \((n-2\delta -2)\) consecutive integers

$$\begin{aligned} \left\{ 0,1,-1,\ldots ,\frac{n-1}{2}-\delta -1, -\left( \frac{n-1}{2}-\delta -1\right) \right\} , \end{aligned}$$

it follows that \({\mathcal {C}}\) is an \([n,2\delta +2,n-2\delta -1]\) MDS code over \({\mathbb {F}}_{q^{2m}}\). Hence, \({\mathcal {C}}^{\perp _{H}}\) is MDS and has minimum distance \(2\delta +3\). By Lemma 3.1, \(\mathcal {L_{{\mathcal {A}}}}({\mathcal {C}})^{\perp _{H}}\ge 2\delta +3\). Hence, \(\mathcal {L_{{\mathcal {A}}}}({\mathcal {C}})\) has dimension \(2m(\delta +1)\) and dual distance \(d^{\perp }\ge 2\delta +3\). Applying the Hermitian construction to the code \(\mathcal {L_{{\mathcal {A}}}}({\mathcal {C}})\) can yield the desired q-ary quantum code. \(\square \)

Example 4.3

Let \(q=2\) and \(m=2\). Then \(n=17\). Applying Theorem 4.2, we obtain binary quantum codes with parameters \([[34,26,\ge 3]]\) and \([[34,18,\ge 5]]\). They have the same parameters as the best known binary quantum codes in the Database [14].

Example 4.4

Let \(q=2\) and \(m=3\). Then \(n=65\). Applying Theorem 4.2, we can get 4 binary quantum codes of length 195. On this length, the resulting quantum codes have larger code rate than the quantum twisted codes shown in [11]. We list them in Table 1.

Table 1 Code comparison

Case 2: q is odd

Let \(\eta =\omega ^{q-1}\), where \(\omega \) is a primitive element of \({\mathbb {F}}_{q^{2}}\). Let \({\mathcal {C}}\) be an \(\eta \)-constacyclic code over \({\mathbb {F}}_{q^{2m}}\) of length \(n=q^{2m}+1\), where \(m\ge 2\) is a positive integer. All the \(q^{2m}\)-cyclotomic cosets modulo \((q+1)n\) containing the elements in \(\varOmega =\{1+(q+1)j\mid 0\le j\le n-1\}\) are given as follows [18].

  1. (1)

    \(C_{q^{2m}}[\frac{n}{2},(q+1)n]=\{\frac{n}{2}\}\) and \(C_{q^{2m}}[\frac{n(q+2)}{2},(q+1)n]=\left\{ \frac{n(q+2)}{2}\right\} .\)

  2. (2)

    \(C_{q^{2m}}[\frac{n}{2}-(q+1)j,(q+1)n]=\left\{ \frac{n}{2}-(q+1)j, \frac{n}{2}+(q+1)j\right\} \) for \(1\le j\le \frac{n-2}{2(q+1)}\), and \(C_{q^{2m}}[\frac{n(q+2)}{2}-(q+1)j,(q+1)n]=\left\{ \frac{n(q+2)}{2} -(q+1)j,\frac{n(q+2)}{2}+(q+1)j\right\} \) for \(1\le j\le \frac{q(n-2)}{2(q+1)}\).

Constacyclic BCH codes in \({\mathbb {F}}_{q^{2}}[x]/\langle x^{n}-\eta \rangle \) with length \(n=q^{2m}+1\) have been studied in [26], where maximum designed distances such that these codes are Hermitian dual-containing codes are given. Now, we use the maximum designed distances for constructing quantum codes. Define

$$\begin{aligned} \varDelta _{2}=\left\{ {{\begin{array}{ll} {\frac{q^{3}-q^{2}+q-1}{2},\ \text {if}\ m=2;}\\ {\frac{q^{m+1}-q^{2}}{2},\ \ \ \ \text {if}\ m=2\nu \ge 4;}\\ {\frac{q^{m}-1}{2},\ \ \ \ \ \ \ \ \text {if}\ m=2\nu +1\ge 3.} \\ \end{array} }} \right. \end{aligned}$$
(6)

Lemma 4.5

Let \(\eta =\omega ^{q-1}\), where \(\omega \) is a primitive element of \({\mathbb {F}}_{q^{2}}\). Let \(n=q^{2m}+1\), where q is an odd prime power and \(m\ge 2\) is a positive integer. If \({\mathcal {C}}\) is the \(\eta \)-constacyclic code of length n over \({\mathbb {F}}_{q^{2m}}\) with nonzero set \(T_{2m}=\bigcup _{i=0}^{\delta }C_{q^{2m}}[\frac{n}{2}-(q+1)i,(q+1)n]\), where \(0\le \delta \le \varDelta _{2}\), then \(\mathcal {L_{{\mathcal {A}}}}({\mathcal {C}})\subseteq \mathcal {L_{{\mathcal {A}}}}({\mathcal {C}})^{\perp _{H}}\).

Proof

By Corollary 3.4 in [26], we have \(-qT_{2}\bigcap T_{2}=\emptyset \), which means that \(C_{q^{2}}[a,n]\ne -qC_{q^{2}}[b,n]\) for any \(a,b\in T_{2m}\). Hence, \(\mathcal {L_{{\mathcal {A}}}}({\mathcal {C}})\subseteq \mathcal {L_{{\mathcal {A}}}}({\mathcal {C}})^{\perp _{H}}\). \(\square \)

Theorem 4.6

Let \(n=q^{2m}+1\), where q is an odd prime power and \(m\ge 2\) is a positive integer. Then there exists a q-ary quantum code with parameters \([[mn,mn-2m(2\delta +1),\ge 2\delta +2]]\), where \(0\le \delta \le \varDelta _{2}\).

Proof

Let \({\mathcal {C}}\) be the \(\eta \)-constacyclic code of length n over \({\mathbb {F}}_{q^{2m}}\) with nonzero set \(T_{2m}=\bigcup _{i=0}^{\delta }C_{q^{2m}}[\frac{n}{2}-(q+1)i,n]\), where \(0\le \delta \le \varDelta _{2}\). Then the zero set of \({\mathcal {C}}\) is \(S=\varOmega \backslash T_{2m}\), which contains \((n-2\delta -1)\) integers at intervals of \(q+1\). It then follows that \({\mathcal {C}}\) is an \([n,2\delta +1, n-2\delta ]\) MDS code over \({\mathbb {F}}_{q^{2m}}\). Hence, \({\mathcal {C}}^{\perp _{H}}\) is MDS and has minimum distance \(2\delta +2\). By Lemma 3.1, the minimum distance of \(\mathcal {L_{{\mathcal {A}}}}({\mathcal {C}})^{\perp _{H}}\) is at least \(2\delta +2\). Also, \(\mathcal {L_{{\mathcal {A}}}}({\mathcal {C}})\) has dimension \(m(2\delta +1)\). By the Hermitian construction, a q-ary quantum code with parameters \([[mn,mn-2m(2\delta +1),\ge 2\delta +2]]\) is obtained. \(\square \)

Example 4.7

Let \(q=3\) and \(m=2\). Then \(n=82\). Using Theorem 4.6, we obtain 11 new ternary quantum codes of length 164. Further, we can obtain 10 ternary quantum codes of length 161 by using a propagation rule [12]. Six codes of them have larger code rate than the quantum twisted codes with the same length. We list these codes in Table 2.

Table 2 Code comparison

4.2 Construction II

Now, let us consider cyclic codes over \({\mathbb {F}}_{q^{2m}}\) of length \(n=\frac{q^{2m}+1}{q^{2}+1}\), where q is an even prime power and \(m\ge 3\) is odd. It is easy to obtain that, for \(1\le i\le \frac{n-1}{2}\), all the \(q^{2m}\)-cyclotomic cosets modulo n are given by \(C_{q^{2m}}\left[ 0,n\right] =\{0\}\) and \(C_{q^{2m}}\left[ i,n\right] =\{i,n-i\}\). Define

$$\begin{aligned} \varDelta _{3}=\left\{ {{\begin{array}{ll} {\frac{q^{m+1}+q^{m}-3q^{2}-q-2}{2(q^2+1)},\ \text {if}\ m\equiv 1(\bmod ~4);}\\ {\frac{q^{m+1}+q^{m}-3q^{2}+q-4}{2(q^2+1)},\ \text {if}\ m\equiv 3(\bmod ~4).} \\ \end{array} }} \right. \end{aligned}$$
(7)

Lemma 4.8

Let \(n=\frac{q^{2m}+1}{q^2+1}\), where q is an even prime power and \(m\ge 3\) is odd. If \({\mathcal {C}}\) is the cyclic code of length n over \({\mathbb {F}}_{q^{2m}}\) with nonzero set \(T_{2m}=\bigcup _{i=0}^{\delta }C_{q^{2m}}[(n-1)/2-i,n]\), where \(0\le \delta \le \varDelta _{3}\), then \(\mathcal {L_{{\mathcal {A}}}}({\mathcal {C}})\subseteq \mathcal {L_{{\mathcal {A}}}}({\mathcal {C}})^{\perp _{H}}\).

Proof

We only prove the case that \(m\equiv 1(\bmod ~4)\), and the other case is similar. By Theorem 3.5, we only need to prove that, for any \(a,b\in T_{2m}\), \(C_{q^{2}}[a,n]\ne -qC_{q^{2}}[b,n]\). Suppose that there exist \(a=\frac{n-1}{2}-j\) and \(b=\frac{n-1}{2}-k\) with \(j,k\in \left\{ 0,1,\ldots ,\varDelta _{3}\right\} \) such that \(aq^{2\ell +1}+b\equiv 0(\bmod ~n)\) for \(0\le \ell \le 2m-1\). This means that, for \(0\le \ell \le 2m-1\),

$$\begin{aligned} (q^{2}+1)\left[ (1+2j)q^{2\ell +1}+(1+2k)\right] \equiv 0(\bmod ~q^{2m}+1). \end{aligned}$$
(8)

Note that \(q^{4m}\equiv 1(\bmod ~q^{2m}+1)\), so we can assume that \(0\le \ell \le m-1\).

If \(0\le \ell \le \frac{m-3}{2}\), then it is easy to verify that the left-hand side of (8) is between \((q+1)(q^{2}+1)-1\) and \(q^{2m}+1\). This gives a contradiction.

If \(\ell =\frac{m-1}{2}\), then (8) becomes

$$\begin{aligned} (q^{2}+1)\left[ (1+2j)q^{m}+(1+2k)\right] \equiv 0(\bmod ~q^{2m}+1). \end{aligned}$$

Then

$$\begin{aligned} (q^{2}+1)\left[ (1+2j)q^{m}+(1+2k)\right] =\lambda (q^{2m}+1), \end{aligned}$$
(9)

for some odd integer \(\lambda \). Since \((q^2+1)(q^{m}+1)\le (q^2+1)[(1+2j)q^{m}+(1+2k)]<(q+1)(q^{2m}+1)\) holds, it follows that \(1\le \lambda \le q-1\). By taking (9) modulo \(q^{m}\), we obtain \((q^{2}+1)(1+2k)-\lambda \equiv 0(\bmod ~q^{m}).\) Let

$$\begin{aligned} (q^{2}+1)(1+2k)-\lambda =\mu q^{m}, \end{aligned}$$
(10)

for some integer \(\mu \). Since

$$\begin{aligned} q^{2}-q+2\le (q^{2}+1)(1+2k)-\lambda \le q^{m+1}+q^{m}-2q^2-q-2 \end{aligned}$$

holds, we have \(1\le \mu \le q\). Taking (10) modulo \(q^{2}+1\) can get \(\mu q+\lambda \equiv 0(\bmod ~q^{2}+1)\). Then \(\mu q+\lambda =q^{2}+1\), which implies that \(\mu =q\) and \(\lambda =1\). By putting them into (9) and (10), it can be obtained from the obtained equations that \((q^{2}+1)(1+2j)=q^{m}-q\). But, \((q^{2}+1)(1+2j)\) is odd and \(q^{m}-q\) is even, which is a contradiction.

If \(\frac{m+1}{2}\le \ell \le m-1\), then it follows from (8) that \((q^{2}+1)(1+2k)q^{2(m-\ell )-1}\equiv (q^{2}+1)(1+2j)(\bmod ~q^{2m}+1).\) Note that two sides are both between 1 and \(q^{2m}+1\). Hence, \((1+2k)q^{2(m-\ell )-1}=1+2j\). This is a contradiction since \((1+2k)q^{2(m-\ell )-1}\) is even and \(1+2k\) is odd. \(\square \)

According to Lemma 4.8, similar to Theorem 4.2, we easily obtain the following result.

Theorem 4.9

Let \(n=\frac{q^{2m}+1}{q^2+1}\), where q is an even prime power and \(m\ge 3\) is odd. Then there exists a q-ary quantum code with parameters \([[mn,mn-4m(\delta +1),\ge 2\delta +3]]\), where \(0\le \delta \le \varDelta _{3}\).

Example 4.10

Let \(q=4\) and \(m=3\). Then \(n=241\). By using Theorem 4.9, we can get 9 quaternary quantum codes of length 723. The resulting quantum codes have larger minimum distance than the quantum twisted codes with the same dimension shown in [11]. These codes are listed in Table 3.

Table 3 Code comparison

5 Conclusion

In this paper, we gave a sufficient condition for the images of \(\eta \)-constacyclic codes over \({\mathbb {F}}_{q^{2m}}\) to be Hermitian self-orthogonal codes over \({\mathbb {F}}_{q^{2}}\), where \(\eta \) is a nonzero element of \({\mathbb {F}}_{q^{2}}\). Then, by choosing constacyclic MDS codes over \({\mathbb {F}}_{q^{2m}}\), we obtained Hermitian self-orthogonal codes over \({\mathbb {F}}_{q^{2}}\). Further, we constructed quantum codes with good parameters. The resulting quantum codes are actually concatenated codes, and hence they can be encoded and decoded by using the spectral techniques (see [16]). Based on the twisted discrete Fourier transform over finite fields, we can copy the syndrome of an error vector to auxiliary qubits using the controlled NOT (CNOT) gate. Through measuring the syndromes of bit-flip and phase-flip errors, the most likely positions of errors are determined. A further work is to provide an efficient encoding and decoding algorithm for this class of concatenated quantum codes.