1 Introduction

The construction of quantum error-correcting codes (quantum codes for short) with good parameters is a hot topic in the area of quantum information and quantum computing. Some scholars used classical codes to construct some classes of good quantum codes in [4, 9, 24, 26, 27, 44]. In particular, maximal-distance-separable (MDS) codes that satisfy the classical Singleton bound are an important part of cyclic codes which have been fully studied in [20]. These codes that attain the Singleton bound are optimal codes. Some scholars have researched other classes of cyclic codes in [5,6,7,8, 10]. In [23], Kai et al. studied some families of constacyclic codes attaining the classical Singleton bound that are called optimal codes. Moreover, constacyclic codes contained cyclic codes and negacyclic codes. The construction of optimal codes is an important research in classical coding theory as well as in quantum coding theory, where quantum codes satisfying the quantum Singleton bound are optimal [13]. Relative to cyclic codes, constacyclic codes can provide a good source to construct optimal quantum codes. In [21], Kai et al. utilized negacyclic codes to construct two families of optimal quantum codes. In [22], Kai et al. constructed two families of good quantum codes and a family of optimal quantum codes by using negacyclic codes. Some families of constacyclic codes were used to construct optimal quantum codes in [45]. In [11], the authors constructed some families of constacyclic codes that were different from the ones in [23] and utilized them to construct optimal quantum codes. For more details of constructions of optimal quantum codes, the readers can consult [40, 43].

Quantum codes defined over quantum channels where qudit-flip errors and phase-shift errors may have different probabilities are called asymmetric quantum codes [29]. In many quantum mechanical systems, the probabilities of occurrence of qudit-flip and phase-shift errors are quite different [28]. For the past two decades, some researchers studied the constructions of good asymmetric quantum codes [32, 33, 37]. In [28,29,30], La Guardia obtained some families of good asymmetric quantum codes compared with the ones in [1]. Qian et al. used \(q^2\)-ary cyclotomic cosets to construct a family of optimal asymmetric quantum codes in [42]. In [12], Chen et al. studied optimal asymmetric quantum codes by using negacyclic codes. In [16], Chen et al. also constructed some families of optimal asymmetric quantum codes from constacyclic codes. In [46], Wang et al. used constacyclic codes in [23] to obtain some classes of optimal asymmetric quantum codes. Xu et al. constructed two families of optimal asymmetric quantum codes by using a skew symmetric coset and skew asymmetric coset pair of constacyclic codes in [47]. For more constructions of asymmetric quantum codes, the readers can consult [13, 17, 19, 39].

Recently, some researchers studied the constructions of good quantum convolutional codes [2, 3, 14,15,16, 18]. In [31], La Guardia utilized some classes of cyclic codes to construct some good quantum convolutional codes compared with the ones in [2]. In [34], the optimal quantum convolutional codes constructed from BCH cyclic codes were studied by La Guardia. In [35], La Guardia used negacyclic codes to construct two families of optimal quantum convolutional codes. In [36], La Guardia constructed some families of optimal convolutional codes and asymmetric quantum codes by using constacyclic codes. In [38, 48], the authors studied some families of optimal quantum convolutional codes by using constacyclic codes with different lengths.

In this work, some families of optimal quantum convolutional codes and asymmetric quantum codes are constructed from constacyclic codes with length \(n=\frac{q^2+1}{10h}\), where q is an odd prime power with the form \(q=10hm+t\) or \(q=10hm+10h-t\), where m is a positive integer, both h and t are odd with \(10h=t^2+1\) and \(t\ge 3\). Compared with [12, 16, 17, 42, 46, 49], in which the authors constructed some classes of optimal asymmetric quantum codes with parameters \([[n,k,d_z\) \(/d_x]]_{q^2}\) in the Hermitian case, where \(d_z\) is the minimum distance corresponding to phase-shift errors and \(d_x\) is the minimum distance corresponding to qudit-flip errors, the minimum distance \(d_z\) of optimal asymmetric quantum codes constructed in this paper is larger except for very a few codes. It also shows that these constructed codes in this paper have greater asymmetry than most of the ones in [12, 16, 17, 42, 46, 49] and are shown as follows.

  1. (1)

    \([[ \frac{q^2+1 }{10h},\frac{q^2+1 }{10h}-2(\delta _1+\delta _2+2),2\delta _1+3/2\delta _2+3]]_{q^2},\) where q is an odd prime power of the form \(10hm+t\), m is an odd, both h and t are odd with \(10h= t^2+1\) and \(t\ge 3\), both \( \delta _1\) and \(\delta _2\) are integers such that \(0 \le \delta _1\le \frac{q-10h-t}{20h}\) and \(\frac{q-3}{2}\le \delta _2\le \frac{q-3}{2}+q\delta _1\).

  2. (2)

    \([[ \frac{q^2+1 }{10h},\frac{q^2+1 }{10h}-2(\delta _1+\delta _2+2),2\delta _1+3/2\delta _2+3]]_{q^2},\) where q is an odd prime power of the form \(10hm+t\), \(m\ge 2\) is an even, both h and t are odd with \(10h=t^2+1\) and \(t\ge 3\), both \( \delta _1\) and \(\delta _2\) are integers such that \(0 \le \delta _1\le \frac{q-20h-t}{20h}\) and \(\frac{q-3}{2}\le \delta _2\le \frac{q-3}{2}+q\delta _1\).

  3. (3)

    \([[ \frac{q^2+1 }{10h},\frac{q^2+1 }{10h}-2(\delta _1+\delta _2+2),2\delta _1+3/2\delta _2+3]]_{q^2},\) where q is an odd prime power of the form \(10hm+10h-t\), m is an odd, both h and t are odd with \(10h= t^2+1\) and \(t\ge 3\), both \( \delta _1\) and \(\delta _2\) are integers such that \(0 \le \delta _1\le \frac{q-20h+t}{20h}\) and \(\frac{q-3}{2}\le \delta _2\le \frac{q-3}{2}+q\delta _1\).

  4. (4)

    \([[ \frac{q^2+1 }{10h},\frac{q^2+1 }{10h}-2(\delta _1+\delta _2+2),2\delta _1+3/2\delta _2+3]]_{q^2},\) where q is an odd prime power of the form \(10hm+10h-t\), \(m\ge 2\) is an even, both h are t are odd with \(10h= t^2+1\) and \(t\ge 3\), both \( \delta _1\) and \(\delta _2\) are integers such that \(0 \le \delta _1\le \frac{q-30h+t}{20h}\) and \(\frac{q-3}{2}\le \delta _2\le \frac{q-3}{2}+q\delta _1\).

Additionally, we construct two new families of optimal quantum convolutional codes that are more general relative to the ones in [16, 34, 35, 38, 48, 50, 51] and showed as follows.

  1. (1)

    \([(\frac{q^2+1 }{10h},\frac{q^2+1 }{10h}-4\delta ,1;2,2\delta +3)]_q\), where q is an odd prime power of the form \(10hm+t\), \(m\ge 2\) is a positive integer, both h and t are odd with \(10h=t^2+1\) and \(t\ge 3\), and \(\delta \) is an integer such that \(2 \le \delta \le \frac{(t+1)(q-t)-20h}{20h}.\)

  2. (2)

    \([(\frac{q^2+1 }{10h},\frac{q^2+1 }{10h}-4\delta ,1;2,2\delta +3)]_q,\) where q is an odd prime power of the form \(10hm+10h-t\), m is a positive integer, both h and t are odd with \(10h=t^2+1\) and \(t\ge 3\), and \(\delta \) is an integer such that \(2 \le \delta \le \frac{(t+1)q-(t^2-t+2)-20h}{20h}.\)

The main organization of this paper is as follows. In Sect. 2, we present some basic concepts and results about \(q^2\)-cyclotomic cosets and \(\eta \)-constacyclic codes. In Sect. 3, we review the method of classical convolutional codes constructed from the parity check matrix in the Hermitian case, and then we introduce some concepts and basic results of quantum convolutional stabilizer codes based on a quantum stabilizer. Finally, two families of optimal quantum convolutional codes are constructed by using constacyclic codes with length \(\frac{q^2+1}{10h}\). In Sect. 4, we recall some basic concepts and results of asymmetric quantum codes under the Hermitian construction, and then we construct four families of optimal asymmetric quantum codes by using constacyclic codes with length \(\frac{q^2+1}{10h}\).

2 Review of constacyclic codes

In this section, we recall some basic results about constacyclic codes in [11, 23].

Throughout this paper, let \(F_{q^2}\) be the finite field with \(q^2\) elements, where q is a power of p and p is an odd prime number. We assume that n is a positive integer relatively prime to q, i.e., \(gcd(n,q)=1\). If \(\mathcal {C}\) is a k-dimensional subspace of \(F_{q^2}^n\), then \(\mathcal {C}\) is said to be an [nk]-linear code. The number of nonzero components of \(c\in \mathcal {C}\) is said to be the weight wt(c) of the codeword c. The minimum nonzero weight d of all codewords in \(\mathcal {C}\) is said to be the minimum weight of \(\mathcal {C}\). Given \(\eta \in F_{q^2}^*\), a linear code \(\mathcal {C}\) of length n over \(F_{q^2}\) is said to be \(\eta \)-constacyclic if

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

for every

$$\begin{aligned} (c_0,c_1,\ldots ,c_{n-1})\in \mathcal {C}. \end{aligned}$$

When \(\eta =-1,\) then \(\mathcal {C}\) is a negacyclic code. When \(\eta =1,\) then \(\mathcal {C}\) is a cyclic code. We know that a \(q^2\)-ary \(\eta \)-constacyclic code \(\mathcal {C}\) of length n is an ideal of \(F_{q^2}[x]/\langle x^n-\eta \rangle \) and \(\mathcal {C}\) can be generated by a monic polynomial g(x) which divides \(x^n-\eta \). Let \(a^q=(a_0^q,a_1^q,\ldots ,a_{n-1}^q)\) denote the conjugation of the vector \(a=(a_0,a_1, \ldots ,a_{n-1}) \). For \(u=(u_0,u_1,\ldots ,u_{n-1})\) and \(v=(v_0,v_1,\ldots ,v_{n-1})\in F_{q^2}^n,\) the Hermitian inner product is defined as

$$\begin{aligned} \langle u,v\rangle _h=u_0v_0^q+u_1v_1^q+\cdots +u_{n-1}v_{n-1}^q. \end{aligned}$$

The Hermitian dual code of \(\mathcal {C}\) can be defined as

$$\begin{aligned} \mathcal {C}^{\bot _h}=\left\{ u\in F_{q^2}^n\mid \langle u,v\rangle _h=0~\mathrm{for}~\mathrm{all}~v\in \mathcal {C} \right\} . \end{aligned}$$

If \(\mathcal {C}\subseteq \mathcal {C}^{\perp _h},\) then \(\mathcal {C}\) is called a Hermitian self-orthogonal code. If \(\mathcal {C}^{\perp _h}\subseteq \mathcal {C},\) then \(\mathcal {C}\) is a Hermitian dual-containing code. Let \(\omega \) be a primitive element of \(F_{q^2}\) and \(\eta =\omega ^{v(q-1)}\) for some \(v\in \{0,1,2,\ldots ,q\}\). Then the order r of \(\eta \) in \(F_{q^2}^*\) is equal to \(\frac{q+1}{gcd(v,q+1)}\). From [23], we can see that the Hermitian dual \(\mathcal {C}^{\perp _h}\) of an \(\eta \)-constacyclic code over \(F_{q^2}\) is an \(\eta \)-constacyclic code according to \(\eta \eta ^{q}=1\). We assume that \(\eta \in F_{q^2}^*\) is a primitive r-th root of unity, and then there exists a primitive rn-th root of unity over some extension field of \(F_{q^2}\), denoted by \(\xi \), such that \(\xi ^n=\eta .\) Hence, the elements \(\xi ^{1+ri}\) are the roots of \(x^n-\eta \) for \(1\le i\le n-1.\) Let \(\mathcal {O} _{rn}=\{1+jr|0\le j\le n-1\}\). For each \(i\in \mathcal {O}_{rn}\), let

$$\begin{aligned} C_i=\left\{ i,iq^2,iq^4,\ldots ,iq^{(2k-2)}\right\} (\text {mod}~rn), \end{aligned}$$

where k is the smallest positive integer such that \(i(q^2)^k \equiv i(\text {mod}~rn)\), and then \(C_i\) is called the \(q^2\)-cyclotomic coset modulo rn containing i. It is easy to see that the defining set Z is a union of some \(q^2\)-cyclotomic cosets modulo rn. The defining set of a constacyclic code \(\mathcal {C}=\langle g(x)\rangle \) of length n is the set \(Z=\{i\in \mathcal {O}_{rn}\mid \xi ^i ~\mathrm{is}~ a~ \mathrm{root}~ \mathrm{of}~ g(x)\}.\) Let \(\mathcal {C}\) be an [nk] constacyclic code over \(F_{q^2}\) with defining set Z. Then the Hermitian dual \(\mathcal {C}^{\perp _h}\) has a defining set

$$\begin{aligned} Z^{\perp _h}=\{z\in \mathcal {O}_{rn}|-qz(\text {mod}~rn)\not \in Z\}. \end{aligned}$$

Proposition 1

[11, 23, 25] (The BCH bound for constacyclic codes) Assume that \(gcd(n,q)=1\). Let \(\mathcal {C}\) be a \(q^2\)-ary \(\eta \)-constacyclic code of length n. If the generator polynomial g(x) of \(\mathcal {C}\) has the elements \(\{\xi ^{1+ri}\mid 0 \le i \le d-2\}\) as the roots where \(\xi \) is a primitive rn-th root of unity, then the minimum distance of \(\mathcal {C}\) is at least d.

Proposition 2

[41] (Singleton bound) If an [nkd] linear code \(\mathcal {C}\) exists, then

$$\begin{aligned} k\le n-d+1. \end{aligned}$$

If \(k= n-d+1,\) then \(\mathcal {C}\) is called an optimal code.

3 Constructions of optimal quantum convolutional codes

In this section, we firstly state some basic notions of classical convolutional codes in the Hermitian case, and then we state the construction of classical convolutional codes by utilizing the method of dividing the parity check matrix into some submatrices [2, 3]. Additionally, based on classical convolutional codes and stabilizer of quantum codes, we state some concepts and basic results of quantum convolutional stabilizer codes. Finally, we construct two families of optimal quantum convolutional codes by using constacyclic codes with length \(\frac{q^2+1}{10h}\) in the Hermitian case. For more details about classical convolutional codes and quantum convolutional codes, the readers can consult [2, 3, 31, 34,35,36].

A polynomial encoder matrix \(G(D)=(g_{ij})\in F_{q^2}[D]^{k\times n}\) is called basic if G(D) has a polynomial right inverse. If the overall constraint length \(\gamma =\sum _{i=1}^{k}\gamma _i\) has the smallest value among all basic generator matrices of the convolutional code \(\mathcal {C}\), then the basic generator matrix of the convolutional code \(\mathcal {C}\) is said to be reduced. For this case, the overall constraint length \(\gamma \) is called the degree of the convolutional code \(\mathcal {C}\). The weight of an element \(v(D)\in F_{q^2}[D]^n\) is defined as \(wt(v(D))=\sum _{i=1}^nwt(v_i(D)),\) where \(wt(v_i(D))\) is the number of nonzero coefficients of \(v_i(D).\) For \(u(D)=\sum _{i}u_iD^i\) and \(v(D)=\sum _{j}v_jD^j\) in \(F_{q^2}[D]^n\), the Hermitian inner product is defined as \(\langle u(D)|v(D)\rangle _h\) \( =\sum _{i}u_iv_i^{q},\) where \(u_i, v_i\in F_{q^2}^n\) and \(v_i^q=(v_{1i}^q,v_{2i}^q,\ldots ,v_{ni}^q).\) \(\mathcal {C}^{\bot _h}=\{u(D)\in F_{q^2}[D]^n|\langle u(D)|v(D)\rangle _h\) \(=0~for~all~v(D)\in \mathcal {C}\}\) denotes the Hermitian dual of a convolutional code \(\mathcal {C}\).

Definition 1

[2, 3] A rate k / n convolutional code \(\mathcal {C}\) with parameters \((n,k,\gamma ;\) \( \mu ,d_f)_{q^2}\) is a submodule of \(F_{q^2}[D]^n\) generated by a reduced basic matrix \(G(D)=(g_{ij})\in F_{q^2}[D]^{k\times n},\) that is, \(\mathcal {C}=\{u(D)G(D)|u(D)\in F_{q^2}[D]^k\},\) where n is the length, k is the dimension, \(\gamma =\sum _{i=1}^k\gamma _i\) is the degree, where \(\gamma _i=\mathrm{max}_{1 \le j \le n }\) \(\{deg~g_{ij}\},\) \(\mu =\mathrm{max}_{1 \le i\le k}\{\gamma _i\}\) is the memory and \(d_f=wt(\mathcal {C})=\mathrm{min}\{wt(v(D))|\) \(v(D)\in \mathcal {C}, v(D)\ne 0\}\) is the free distance of the code.

Now, we state some results about classical convolutional codes available in [2, 3, 34,35,36].

Let \([n,k,d]_{q^2}\) be a block code with the parity check matrix H, which can be partitioned into \(\mu +1\) disjoint submatrices \(H_i\) such that \(H=[H_0, H_1,\ldots H_\mu ]^\mathrm{T},\) where each \(H_i\) has n columns. Therefore, the polynomial matrix G(D) is given as follows.

$$\begin{aligned} G(D)=\widetilde{H}_0+\widetilde{H}_1 D+\widetilde{H}_2 D^2+\cdots +\widetilde{H}_\mu D^\mu . \end{aligned}$$
(1)

A convolutional code V can be generated by the matrix G(D) that has \(\kappa \) rows, where \(\kappa \) is the maximum number of rows among the matrices \(H_i.\) The matrices \(\widetilde{H}_i\) can be derived from the matrices \(H_i\) by adding zero-rows at the bottom such that the matrices \(\widetilde{H}_i\) have \(\kappa \) rows in total. Using this method, the authors constructed different classical convolutional codes in [2, 3, 34, 35].

Theorem 1

[2, 3, 34, 35] Let \(\mathcal {C}\subseteq F_{q^2}^n\) be an \([n,k,d]_{q^2}\) code with the parity check matrix \(H\in F_{q^2}^{(n-k)\times n}\). Assume that H is partitioned into submatrices \(H_0,H_1,\ldots ,H_\mu \) as above such that \(\kappa =rkH_0\) and \(rkH_i\le \kappa \) for \(1\le i\le \mu .\) Consider the matrix G(D) in (1), and then we have:

  1. (a)

    The matrix G(D) is a reduced basic generator matrix.

  2. (b)

    If \(\mathcal {C}^{\perp _h}\subseteq \mathcal {C}\), then the convolutional code \(V=\{v(D)=u(D)G(D)|u(G)\in F_{q^2}^{n-k}[D]\}\) satisfies \(V\subset V^{\perp _h}\).

  3. (c)

    If \(d_f\) and \(d_f^{\perp _h}\) denote the free distance of V and \(V^{\perp _h}\), respectively, \(d_i\) denotes the minimum distance of the code \(\mathcal {C}_i=\{v\in F_{q^2}^n|v\widetilde{H}_i^t=0\}\) and \(d^{\perp _h}\) is the minimum distance of \(\mathcal {C}^{\perp _h}\), then one has min\(\{d_0+d_\mu ,d\}\le d_f^{\perp _h}\le d\) and \(d_f\ge d^{\perp _h}\).

Based on classical convolutional codes, the authors introduced the stabilizer of quantum block codes into constructing quantum convolutional stabilizer codes in [2, 3, 34, 35].

The stabilizer is given by a matrix of the form

$$\begin{aligned} S(D)=(X(D)|Z(D))\in F_q[D]^{(n-k)\times 2n} \end{aligned}$$

which satisfies \(X(D)Z(1/D)^t-Z(D)X(1/D)^t=0.\) Consider a quantum convolutional code \(\mathcal {C}\) defined by the full-rank stabilizer matrix S(D) given above, and then \(\mathcal {C}\) is a rate k / n quantum convolutional code with parameters \([(n,k,\mu ;\gamma ,\) \(d_f)]_q\), where n is called the frame size and k is the number of logical qudits per frame. The memory of the quantum convolutional code is

$$\begin{aligned} \mu =\mathrm{max}_{1 \le i\le n-k, 1\le j\le n}\{\mathrm{max}\{degX_{ij}(D),degZ_{ij}(D)\}\}, \end{aligned}$$

while \(d_f\) is the free distance and \(\gamma \) is the degree of the code. Additionally, the constraint lengths of quantum convolutional codes are defined as

$$\begin{aligned} \gamma _i=\mathrm{max}_{1\le j\le n}\{\mathrm{max}\{degX_{ij}(D),degZ_{ij}(D)\}\}. \end{aligned}$$

Moreover, the overall constraint length is defined as \(\gamma =\sum _{i=1}^{n-k}\gamma _i.\) For more details about quantum convolutional stabilizer codes, readers can consult [2, 3, 34, 35].

In order to construct quantum convolutional stabilizer codes with good parameters, the authors used classical convolutional codes to construction of quantum convolutional stabilizer codes in [2].

Theorem 2

[2] Let \(\mathcal {C}\) be an \((n,(n-k)/2,\gamma ;\mu ,d_f^*)_{q^2}\) convolutional code such that \(\mathcal {C}\subseteq \mathcal {C}^{\perp _h}\). Then there exists an \([(n,k,\mu ;\gamma ,d_f)]_q\) quantum convolutional stabilizer code, where \(d_f=wt(\mathcal {C}^{\perp _h}{\setminus } \mathcal {C}).\)

Proposition 3

[2] (Quantum Singleton bound) The free distance of an [(nk\(\mu ;\gamma ,d_f)]_q\) pure convolutional stabilizer code is bounded by

$$\begin{aligned} d_f\le \frac{n-k}{2}\left( \lfloor \frac{2\gamma }{n+k}\rfloor +1\right) +1+\gamma . \end{aligned}$$

If a quantum convolutional stabilizer code can achieve this bound, then it is called an optimal quantum convolutional stabilizer code.

In the following part of this section, we compute \(q^2\)-cyclotomic cosets of constacyclic codes with length \(\frac{q^2+1}{10h}\) and study the case of Hermitian dual contain of constacyclic codes over \(F_{q^2}\). Here, we focus on the construction of quantum convolutional stabilizer codes (quantum convolutional codes for short).

Lemma 1

Let \(n=\frac{q^2+1}{10h}\) and \(s=\frac{q^2+1}{2}\), where q is an odd prime power of the form \(10hm+t\) or \(10hm+10h-t\), m is a positive integer, both h and t are odd with \(10h=t^2+1\) and \(t\ge 3\). Then \( C_s=\{s\} \) and \( C_{s-(q+1)(\frac{n-1}{2}-i)}=\{s-(q+1)(\frac{n-1}{2}-i),s+(q+1)(\frac{n-1}{2}-i)\} \) for \(0\le i\le \frac{n-1}{2}-1\).

Proof

Since \(sq^2=s(q^2+1-1)\equiv s~\text {mod}~(q+1)n\), it follows that \( C_s=\{s\} \). For \(0\le i\le \frac{n-1}{2}-1\), we have

$$\begin{aligned} C_{s-(q+1)(\frac{n-1}{2}-i)}=\left\{ s-(q+1) \left( \frac{n-1}{2}-i\right) ,s+(q+1)\left( \frac{n-1}{2}-i\right) \right\} \end{aligned}$$

from

$$\begin{aligned} \left( s-(q+1)\left( \frac{n-1}{2}-i\right) \right) q^2&= \left( s-(q+1)\left( \frac{n-1}{2}-i\right) \right) (q^2+1-1)\\&\equiv s+(q+1)\left( \frac{n-1}{2}-i\right) ~\text {mod}~(q+1)n\\ \end{aligned}$$

and

$$\begin{aligned} \left( s+(q+1)\left( \frac{n-1}{2}-i\right) \right) q^2&= \left( s+(q+1)\left( \frac{n-1}{2}-i\right) \right) (q^2+1-1)\\&\equiv s-(q+1)\left( \frac{n-1}{2}-i\right) ~\text {mod}~(q+1)n. \end{aligned}$$

Moreover, we show that

$$\begin{aligned} C_{s-(q+1)\left( \frac{n-1}{2}-i\right) }=\left\{ s-(q+1) \left( \frac{n-1}{2}-i\right) ,s+(q+1)\left( \frac{n-1}{2}-i\right) \right\} \end{aligned}$$

is disjoint for \(0\le i\le \frac{n-1}{2}-1\).

In fact, we assume that there exist two integers i and j, \(0\le i\ne j\le \frac{n-1}{2}-1\), such that

$$\begin{aligned} C_{s-(q+1)\left( \frac{n-1}{2}-i\right) }=C_{s-(q+1)\left( \frac{n-1}{2}-j\right) }, \end{aligned}$$

and then we have

$$\begin{aligned} \left( s-(q+1)\left( \frac{n-1}{2}-i\right) \right) q^{2k} \equiv s-(q+1)\left( \frac{n-1}{2}-j\right) ~\text {mod}~(q+1)n \end{aligned}$$

for \(k\in \{0,1\}\).

If \(k=0\), we have

$$\begin{aligned} s-(q+1)\left( \frac{n-1}{2}-i\right) \equiv s-(q+1)\left( \frac{n-1}{2}-j\right) ~\text {mod}~(q+1)n, \end{aligned}$$

which is equivalent to \(i=j\), where it is in contradiction with \(0\le i\ne j\le \frac{n-1}{2}-1\).

If \(k=1\), we have

$$\begin{aligned} \left( s-(q+1)\left( \frac{n-1}{2}-i\right) \right) q^{2}\equiv s-(q+1)\left( \frac{n-1}{2}-j\right) ~\text {mod}~(q+1)n, \end{aligned}$$

which is equivalent to \( n-1 \equiv i+j~\text {mod}~ n\), where it is in contradiction with \(0\le i+ j\le n-3\). Therefore, the result follows. \(\square \)

Theorem 3

Let \(n=\frac{q^2+1}{10h}\) and \(s=\frac{q^2+1}{2}\), where q is an odd prime power of the form \(10hm+t\), m is a positive integer, both h and t are odd with \(10h=t^2+1\) and \(t\ge 3\). If \(\mathcal {C}\) is a constacyclic code whose defining set is given by \(Z=\cup _{i=0}^{\delta }C_{s-(q+1)(\frac{n-1}{2}-i)}\), where \(0\le \delta \le \frac{(t+1)(q-t)-20h}{20h} \), then \(\mathcal {C}^{\perp _h}\subseteq \mathcal {C}\).

Proof

From Lemma 1 and Lemma 2.7 of [11], we only need to consider that \( Z\cap -qZ= \emptyset .\) If \( Z\cap -qZ \ne \emptyset ,\) then there exist two integers i and j, where \(0\le i,j \le \frac{(t+1)(q-t)-20h}{20h}\), such that

$$\begin{aligned} s-(q+1)\left( \frac{n-1}{2}-i\right) \equiv -q \left( s-(q+1)\left( \frac{n-1}{2}-j\right) \right) q^{2k}~\text {mod}~(q+1)n \end{aligned}$$

for \(k\in \{0,1\}\). We can seek some contradictions as follows.

  1. (1)

    When \(k=0\),

    $$\begin{aligned} s-(q+1)\left( \frac{n-1}{2}-i\right) \equiv -q \left( s-(q+1)\left( \frac{n-1}{2}-j\right) \right) ~\text {mod}~(q+1)n \end{aligned}$$

    is equivalent to

    $$\begin{aligned} 0 \equiv \frac{q+1}{2}+qj+i ~\text {mod}~n. \end{aligned}$$

    From \(0\le i,j \le \frac{(t+1)(q-t)-20h}{20h}\), we can seek some contradictions by considering the following cases.

    1. (i)

      When \(0\le j\le \frac{2q-20h-2t}{20h}\), we have

      $$\begin{aligned} \begin{aligned} \frac{q+1}{2}&\le \frac{q+1}{2}+qj+i\\&\le \frac{q+1}{2}+q\frac{2q-20h-2t}{20h}+\frac{(t+1)(q-t)-20h}{20h}\\&= \frac{2q^2-q(10h+t-1)-10h-t^2-t}{20h}<n. \end{aligned} \end{aligned}$$

      It is in contradiction with the congruence

      $$\begin{aligned} 0 \equiv \frac{q+1}{2}+qj+i ~\text {mod}~n. \end{aligned}$$
    2. (ii)

      When \(\frac{2q-2t}{20h}\le j\le \frac{4q-20h-4t}{20h}\), let \(j'=j-\frac{2q-20h-2t}{20h} \) for \(1\le j'\le \frac{2q-2t}{20h}\). Then we have

      $$\begin{aligned} 0 \equiv \frac{q+1}{2}+q\left( j'+\frac{2q-20h-2t}{20h}\right) +i ~\text {mod}~n, \end{aligned}$$

      which is equivalent to

      $$\begin{aligned} 0\equiv & {} q j'+\frac{2q^2-10hq-2qt+10h}{20h} +i\\\equiv & {} q j'+\frac{-10hq-2qt+10h-2}{20h} +i ~\text {mod}~n. \end{aligned}$$

      Moreover,

      $$\begin{aligned} \begin{aligned} 0<\frac{ 10hq-2qt+10h-2}{20h}&= q +\frac{-10hq-2qt+10h-2}{20h} \\&\le q j'+\frac{-10hq-2qt+10h-2}{20h} +i\\&\le q \left( \frac{2q-2t}{20h}\right) +\frac{-10hq-2qt+10h-2}{20h}\\&\quad +\frac{(t+1)(q-t)-20h}{20h}\\&=\frac{ 2q^2\!-\!q(3t\!-\!1\!+\!10h)\!-\!10h\!-\!2\!-\!t^2-t}{20h} <n. \end{aligned} \end{aligned}$$

      It is in contradiction with the congruence

      $$\begin{aligned} 0\equiv q j'+\frac{-10hq-2qt+10h-2}{20h} +i ~\text {mod}~n. \end{aligned}$$
    3. (iii)

      When \( \frac{2(\varepsilon -1) q-2(\varepsilon -1) t}{20h}\le j\le \frac{2\varepsilon q-20h-2 \varepsilon t}{20h}\), where \(3\le \varepsilon \le \frac{t+1}{2}\) (here, if there exists the case of \(t>3\)). Let \(j'=j-\frac{2(\varepsilon -1) q-20h-2(\varepsilon -1) t}{20h} \) for \(1\le j'\le \frac{2q-2t}{20h}\). Then we have

      $$\begin{aligned} 0 \equiv \frac{q+1}{2}+q\left( j'+\frac{2(\varepsilon -1) q-20h-2(\varepsilon -1) t}{20h}\right) +i ~\text {mod}~n, \end{aligned}$$

      which is equivalent to

      $$\begin{aligned} \begin{aligned} 0&\equiv q j'+\frac{2(\varepsilon -1)q^2-10hq-2(\varepsilon -1)qt+10h}{20h} +i\\&\equiv q j'+\frac{-10hq-2(\varepsilon -1)qt+10h-2(\varepsilon -1)}{20h} +i ~\text {mod}~n. \end{aligned} \end{aligned}$$

      Moreover,

      $$\begin{aligned} 0&<\frac{ 10hq-(t-1)(qt+1)+10h}{20h}\\&\le \frac{ 10hq-2(\varepsilon -1)qt+10h-2(\varepsilon -1)}{20h}\\&= q +\frac{-10hq-2(\varepsilon -1)qt+10h-2(\varepsilon -1)}{20h} \\&\le q j'+\frac{-10hq-2(\varepsilon -1)qt+10h-2(\varepsilon -1)}{20h} +i\\&\le q \left( \frac{2q-2t}{20h}\right) +\frac{-10hq-2(\varepsilon -1)qt+10h-2(\varepsilon -1)}{20h} \\&+\frac{(t+1)(q-t)-20h}{20h}\\&\le \frac{ 2q^2-q(5t-1+10h)-10h-4-t^2-t}{20h} <n. \end{aligned}$$

      It is in contradiction with the congruence

      $$\begin{aligned} 0\equiv q j'+\frac{-10hq-2(\varepsilon -1)qt+10h-2(\varepsilon -1)}{20h} +i ~\text {mod}~n. \end{aligned}$$
  2. (2)

    When \(k=1\),

    $$\begin{aligned} s-(q+1)\left( \frac{n-1}{2}-i\right) \equiv -q^3\left( s-(q+1) \left( \frac{n-1}{2}-j\right) \right) ~\text {mod}~(q+1)n \end{aligned}$$

    is equivalent to

    $$\begin{aligned} 0 \equiv \frac{q-1}{2}+qj-i ~\text {mod}~n. \end{aligned}$$
    1. (i)

      When \(0\le j\le \frac{2q-20h-2t}{20h}\), we have

      $$\begin{aligned} \begin{aligned} 0<\frac{(10h-t-1)q+10h+t(t+1)}{20h}&=\frac{q-1}{2}-\frac{(t+1)(q-t)-20h}{20h}\\&\le \frac{q-1}{2}+qj-i\\&\le \frac{q-1}{2}+q\left( \frac{2q-20h-2t}{20h}\right) \\&= \frac{2q^2-q(10h+2t)-10h}{20h}<n. \end{aligned} \end{aligned}$$

      It is in contradiction with the congruence

      $$\begin{aligned} 0 \equiv \frac{q-1}{2}+qj-i ~\text {mod}~n. \end{aligned}$$
    2. (ii)

      When \(\frac{2q-2t}{20h}\le j\le \frac{4q-20h-4t}{20h}\), let \(j'=j-\frac{2q-20h-2t}{20h} \) for \(1\le j'\le \frac{2q-2t}{20h}\). Then we have

      $$\begin{aligned} 0 \equiv \frac{q-1}{2}+q\left( j'+\frac{2q-20h-2t}{20h}\right) -i ~\text {mod}~n, \end{aligned}$$

      which is equivalent to

      $$\begin{aligned} 0\equiv & {} q j'+\frac{2q^2-10hq-2qt-10h}{20h} -i\\\equiv & {} q j'+\frac{-10hq-2qt-10h-2}{20h} -i ~\text {mod}~n. \end{aligned}$$

      Moreover,

      $$\begin{aligned} \begin{aligned}&0<\frac{ 10hq-q(3t+1)+10h-2+t(t+1)}{20h}\\&= q +\frac{-10hq-2qt-10h-2}{20h}-\frac{(t+1)(q-t)-20h}{20h} \\&\le q j'+\frac{-10hq-2qt-10h-2}{20h} -i\\&\le q \left( \frac{2q-2t}{20h}\right) +\frac{-10hq-2qt-10h-2}{20h}\\&=\frac{ 2q^2-q(4t+10h)-10h-2}{20h} <n. \end{aligned} \end{aligned}$$

      It is in contradiction with the congruence

      $$\begin{aligned} 0\equiv q j'+\frac{-10hq-2qt-10h-2}{20h} +i ~\text {mod}~n. \end{aligned}$$
    3. (iii)

      When \( \frac{2(\varepsilon -1) q-2(\varepsilon -1) t}{20h}\le j\le \frac{2\varepsilon q-20h-2 \varepsilon t}{20h}\), where \(3\le \varepsilon \le \frac{t+1}{2}\) (here, if there exists the case of \(t> 3\)). Let \(j'=j-\frac{2(\varepsilon -1) q-20h-2(\varepsilon -1) t}{20h} \) for \(1\le j'\le \frac{2q-2t}{20h}\). Then we have

      $$\begin{aligned} 0 \equiv \frac{q-1}{2}+q\left( j'+\frac{2(\varepsilon -1) q-20h-2(\varepsilon -1) t}{20h}\right) -i ~\text {mod}~n, \end{aligned}$$

      which is equivalent to

      $$\begin{aligned} \begin{aligned} 0&\equiv q j'+\frac{2(\varepsilon -1)q^2-10hq-2(\varepsilon -1)qt-10h}{20h} -i\\&\equiv q j'+\frac{-10hq-2(\varepsilon -1)qt-10h-2(\varepsilon -1)}{20h} -i ~\text {mod}~n. \end{aligned} \end{aligned}$$

      Moreover,

      $$\begin{aligned} \begin{aligned} 0&<\frac{ 10hq-(t-1)(qt+1)+10h-(t+1)(q-t)}{20h}\\&\le \frac{ 10hq-2(\varepsilon -1)(qt+1)+10h-(t+1)(q-t)}{20h}\\&= q +\frac{-10hq-2(\varepsilon -1)qt-10h-2(\varepsilon -1)}{20h}-\frac{(t+1)(q-t)-20h}{20h} \\&\le q j'+\frac{-10hq-2(\varepsilon -1)qt-10h-2(\varepsilon -1)}{20h}-i\\&\le q \left( \frac{2q-2t}{20h}\right) +\frac{-10hq-2(\varepsilon -1)qt-10h-2(\varepsilon -1)}{20h} \\&=\frac{ 2q^2-q(10h+2\varepsilon t)-10h-2(\varepsilon -1)}{20h} <n. \end{aligned} \end{aligned}$$

      It is in contradiction with the congruence

      $$\begin{aligned} 0\equiv q j'+\frac{-10hq-2(\varepsilon -1)qt-10h-2(\varepsilon -1)}{20h} +i ~\text {mod}~n. \end{aligned}$$

\(\square \)

Theorem 4

Let \(n=\frac{q^2+1}{10h}\) and \(s=\frac{q^2+1}{2}\), where q is an odd prime power of the form \(10hm+t\), \(m\ge 2\) is a positive integer, both h and t are odd with \(10h=t^2+1\) and \(t\ge 3\). Then there exist optimal quantum convolutional codes with parameters \([( \frac{q^2+1}{10h} ,\frac{q^2+1}{10h} -4\delta ,1;2,2\delta +3)]_{q},\) where \(2 \le \delta \le \frac{(t+1)(q-t)-20h}{20h}\).

Proof

Assume that the defining set of the constacyclic code \(\mathcal {C}\) is

$$\begin{aligned} Z =C_{s-(q+1)(\frac{n-1}{2})}\cup C_{s-(q+1)\left( \frac{n-1}{2}-1\right) }\cup \cdots \cup C_{s-(q+1)\left( \frac{n-1}{2}-\delta \right) }, \end{aligned}$$

where \(2 \le \delta \le \frac{(t+1)(q-t)-20h}{20h}\).

Let

$$\begin{aligned}&H_{2\delta +3,s-(q+1)\left( \frac{n-1}{2}-\delta \right) }\\&\quad =\left[ \begin{array}{cccccc c} 1&{}\xi ^{ s-(q+1) \frac{n-1}{2} }&{} \xi ^{2\left[ s-(q+1) \frac{n-1}{2} \right] } &{}\cdots &{}\xi ^{(n-1)\left[ s-(q+1) \frac{n-1}{2} \right] }\\ 1&{}\xi ^{ s-(q+1)\left( \frac{n-1}{2}-1\right) } &{}\xi ^{2\left[ s-(q+1)\left( \frac{n-1}{2}-1\right) \right] } &{}{\cdots }&{} \xi ^{(n-1)\left[ s-(q+1)\left( \frac{n-1}{2}-1\right) \right] } \\ \vdots &{}\vdots &{}\vdots &{} \vdots &{}\vdots \\ 1 &{} \xi ^{ s-(q+1)\left( \frac{n-1}{2}-\delta +1\right) } &{} \xi ^{2\left[ s-(q+1)\left( \frac{n-1}{2}-\delta +1\right) \right] } &{}{\cdots }&{} \xi ^{(n-1)\left[ s-(q+1)\left( \frac{n-1}{2}-\delta +1\right) \right] } \\ 1 &{} \xi ^{ s-(q+1)\left( \frac{n-1}{2}-\delta \right) } &{} \xi ^{2\left[ s-(q+1)\left( \frac{n-1}{2}-\delta \right) \right] } &{}{\cdots } &{} \xi ^{(n-1)\left[ s-(q+1)\left( \frac{n-1}{2}-\delta \right) \right] } \\ \end{array} \right] . \end{aligned}$$

Since \(2=ord_{(q+1)n}(q^2)\), from Theorem 4.2 in [36] (readers also can see Lemma 4 in [25]), the parity check matrix H of \(\mathcal {C}\) can be obtained from \(H_{2\delta +3,s-(q+1)(\frac{n-1}{2}-\delta )}\) by expanding each entry as a column vector over some \(F_{q^2}-\)basis of \(F_{q^4}\). Therefore, \(\mathcal {C}\) is a constacyclic code with parameters \([\frac{q^2+1}{10h},\frac{q^2+1}{10h}\) \( -2\delta -2,2\delta +3]_{q^2} \) from Propositions 1 and 2, where \(2 \le \delta \le \frac{(t+1)(q-t)-20h}{20h}.\)

Similarly, consider the case that the defining set of a constacyclic code \(\mathcal {C}_0\) over \(F_{q^2}\) is

$$\begin{aligned} Z_0=C_{s-(q+1)\left( \frac{n-1}{2}\right) }\cup C_{s-(q+1)\left( \frac{n-1}{2}-1\right) }\cup \cdots \cup C_{s-(q+1)\left( \frac{n-1}{2}-\delta +1\right) } . \end{aligned}$$

Let

$$\begin{aligned}&H_{2\delta +1,s-(q+1)\left( \frac{n-1}{2}-\delta +1 \right) }\\&\quad =\left[ \begin{array}{cccccc c} 1&{}\xi ^{ s-(q+1) \frac{n-1}{2} }&{} \xi ^{2\left[ s-(q+1) \frac{n-1}{2} \right] } &{}\cdots &{}\xi ^{(n-1)\left[ s-(q+1) \frac{n-1}{2} \right] }\\ 1&{}\xi ^{ s-(q+1)\left( \frac{n-1}{2}-1\right) } &{}\xi ^{2\left[ s-(q+1)\left( \frac{n-1}{2}-1\right) \right] } &{}{\cdots }&{} \xi ^{(n-1)\left[ s-(q+1)\left( \frac{n-1}{2}-1\right) \right] } \\ \vdots &{}\vdots &{}\vdots &{} \vdots &{}\vdots \\ 1 &{} \xi ^{ s-(q+1)\left( \frac{n-1}{2}-\delta +1\right) } &{} \xi ^{2\left[ s-(q+1)\left( \frac{n-1}{2}-\delta +1\right) \right] } &{}{\cdots }&{} \xi ^{(n-1)\left[ s-(q+1)\left( \frac{n-1}{2}-\delta +1\right) \right] } \\ \end{array} \right] . \end{aligned}$$

From Theorem 4.2 in [36], the parity check matrix \(H_0\) of \(\mathcal {C}_0\) can be obtained from \(H_{2\delta +1,s-(q+1)(\frac{n-1}{2}-\delta +1 )}\) by expanding each entry as a column vector over some \(F_{q^2}-\)basis of \(F_{q^4}\). Then \(\mathcal {C}_0\) is a constacyclic code with parameters \([\frac{q^2+1}{10h} ,\frac{q^2+1}{10h} -2\delta , 2\delta +1]_{q^2} \) from Propositions 1 and 2, where \(2 \le \delta \le \frac{(t+1)(q-t)-20h}{20h}.\)

Now, assume that the defining set of the constacyclic code \(\mathcal {C}_1\) over \(F_{q^2}\) is \(Z_1= C_{s-(q+1)(\frac{n-1}{2}-\delta ) }.\)

Let

$$\begin{aligned}&H_{2,s-(q+1)\left( \frac{n-1}{2}-\delta \right) }\\&\quad =\left[ \begin{array}{cccccc c} 1&\xi ^{ s-(q+1)\left( \frac{n-1}{2}-\delta \right) }&\xi ^{2\left[ s-(q+1)\left( \frac{n-1}{2}-\delta \right) \right] }&{\cdots }&\xi ^{(n-1)\left[ s-(q+1)\left( \frac{n-1}{2}-\delta \right) \right] } \end{array} \right] . \end{aligned}$$

From Theorem 4.2 in [36], the parity check matrix \(H_1\) of \(\mathcal {C}_1\) can be obtained from \(H_{2,s-(q+1)(\frac{n-1}{2}-\delta ) }\) by expanding each entry as a column vector over some \(F_{q^2}-\)basis of \(F_{q^4}\). We can see that \(\mathcal {C}_1\) is a constacyclic code with parameters \([ \frac{q^2+1 }{10h}, \frac{q^2+1 }{10h}-2, d\ge 2 ]_{q^2} \) from Proposition 1.

From the above discussion, we know that \(rkH_0\ge rkH_1.\) Therefore, the convolutional code V generated by the matrix \(G(D)=\widetilde{H}_0+\widetilde{H}_1 D\) has parameters \((\frac{q^2+1 }{10h}, 2\delta ,2;1,d_f^*)_{q^2},\) where \(\widetilde{H}_0=H_0\) and \(\widetilde{H}_1\) can be obtained from \(H_1\) by adding zero-rows at the bottom such that \(\widetilde{H}_1\) has the same number of rows as \(H_0\). We also have \(d_f^{\perp _h}= 2\delta +3\) from Theorem 1. From Theorem 1 and Theorem 3, one has \(V\subset V^{\perp _h}.\) Therefore, there exist quantum convolutional codes with parameters \([(\frac{q^2+1 }{10h},\frac{q^2+1 }{10h}-4\delta ,1;2,2\delta +3)]_q\) from Theorem 2, where \(2\le \delta \le \frac{(t+1)(q-t)-20h}{20h}\). From Proposition 3, we can see that these codes constructed here are optimal. \(\square \)

The following Theorem 5 is obtained by using the method of Theorem 3.

Theorem 5

Let \(n=\frac{q^2+1}{10h}\) and \(s=\frac{q^2+1}{2}\), where q is an odd prime power of the form \(10hm+10h-t\), m is a positive integer, both h and t are odd with \(10h=t^2+1\) and \(t\ge 3\). If \(\mathcal {C}\) is a constacyclic code whose defining set is given by \(Z=\cup _{i=0}^{\delta }C_{s-(q+1)(\frac{n-1}{2}-i)}\), where \(0\le \delta \le \frac{(t+1)q-(t^2-t+2)-20h}{20h}\), then \(\mathcal {C}^{\perp _h}\subseteq \mathcal {C}\).

Table 1 Sample parameters of optimal quantum convolutional codes constructed from Theorems 4 and 6

Theorem 6

Let \(n=\frac{q^2+1}{10h}\) and \(s=\frac{q^2+1}{2}\), where \(q=10hm+10h-t\) is an odd prime, m is a positive integer, both h and t are odd with \(10h=t^2+1\) and \(t\ge 3\). Then there exist quantum convolutional codes with parameters \([(\frac{q^2+1}{10h},\frac{q^2+1}{10h}-4\delta ,1;2,2\delta +3)]_{q},\) where \(2 \le \delta \le \frac{(t+1)q-(t^2-t+2)-20h}{20h}\).

Proof

Since the proof presented here uses the same method of Theorem 4, we just give a sketch. Assume that the defining set of the constacyclic code \(\mathcal {C}\) is

$$\begin{aligned} Z=C_{s-(q+1)\left( \frac{n-1}{2}\right) }\cup C_{s-(q+1)\left( \frac{n-1}{2}-1\right) }\cup \cdots \cup C_{s-(q+1)\left( \frac{n-1}{2}-\delta \right) }, \end{aligned}$$

where \(2 \le \delta \le \frac{(t+1)q-(t^2-t+2)-20h}{20h}\). Then \(\mathcal {C}\) is a constacyclic code with parameters \([\frac{q^2+1}{10h},\frac{q^2+1}{10h}\) \(-2\delta -2, 2\delta +3]_{q^2} \) for \(2 \le \delta \le \frac{(t+1)q-(t^2-t+2)-20h}{20h} \) and assume that its parity check matrix is H. Similarly, consider the case that the defining set of the constacyclic code \(\mathcal {C}_0\) over \(F_{q^2}\) is

$$\begin{aligned} Z_0=C_{s-(q+1)\left( \frac{n-1}{2}\right) }\cup C_{s-(q+1)\left( \frac{n-1}{2}-1\right) }\cup \cdots \cup C_{s-(q+1)\left( \frac{n-1}{2}-\delta +1\right) }. \end{aligned}$$

Then \(\mathcal {C}_0\) is a constacyclic code with parameters \([\frac{q^2+1}{10h},\frac{q^2+1}{10h}-2\delta , 2\delta +1]_{q^2} \) and assume that its parity check matrix is \(H_0\). Now, assume that the defining set of the constacyclic code \(\mathcal {C}_1\) over \(F_{q^2}\) is \(Z_1= C_{s-(q+1)(\frac{n-1}{2}-\delta )}.\) Then \(\mathcal {C}_1\) is a constacyclic code with parameters \([\frac{q^2+1}{10h}, \frac{q^2+1}{10h}-2, d\ge 2 ]_{q^2}\) and assume that its parity check matrix is \(H_1\).

From the above discussion, we know that \(rkH_0\ge rkH_1.\) Therefore, the convolutional code V generated by the matrix \(G(D)=\widetilde{H}_0+\widetilde{H}_1 D\) has parameters \((\frac{q^2+1}{10h}, 2\delta ,2;1,d_f^*)_{q^2},\) where \(\widetilde{H}_0=H_0\) and \(\widetilde{H}_1\) can be obtained from \(H_1\) by adding zero-rows at the bottom such that \(\widetilde{H}_1\) has the same number of rows as \(H_0\). We have \(d_f^{\perp _h}= 2\delta +3\) from Theorem 1. From Theorems 1 and 5, one has \(V\subset V^{\perp _h}.\) Therefore, there exist quantum convolutional codes with parameters \([(\frac{q^2+1}{10h},\frac{q^2+1}{10h}-4\delta ,1;2,2\delta +3)]_q\) from Theorem 2, where \(2\le \delta \le \frac{(t+1)q-(t^2-t+2)-20h}{20h}\). From Proposition 3, we can see that these codes constructed here are optimal. \(\square \)

Example 1

Let \(h=5\), \(m=3\) and \(t=7\), then we have \(q=157\) and \(n=493\) from Theorem 4. Moreover, we can obtain some optimal quantum convolutional codes listed in Table 1.

Example 2

Let \(h=5\), \(m=3\) and \(t=7\), then we have \(q=193\) and \(n=745\) from Theorem 6. Moreover, we can obtain some optimal quantum convolutional codes listed in Table 1.

4 Constructions of optimal asymmetric quantum codes

In this section, we state some definitions and basic results in [28,29,30, 32, 33], and then we utilize the constacyclic codes to construct some families of optimal asymmetric quantum codes with greater asymmetry compared with those codes constructed from [12, 16, 17, 42, 46, 49] except for very a few codes.

Let H be the Hilbert space \(H=\mathbf {C}^{q^n}=\mathbf {C}^q\bigotimes \cdots \bigotimes \mathbf {C}^q.\) Let \(|x\rangle \) be the vectors of an orthonormal basis of \(\mathbf {C}^q\), where the notion x represents the elements of \(F_q.\) Given \(a,b\in F_q,\) the unitary operators X(a) and Z(b) in \(\mathbf { C }^q\) are defined by

$$\begin{aligned} X(a)\mid x\rangle =\mid x+a\rangle \end{aligned}$$

and

$$\begin{aligned} Z(b)\mid x\rangle =\omega ^{tr(bx)}\mid x\rangle , \end{aligned}$$

respectively, where \(\omega =\mathrm{exp}(2\pi i/p)\) is a pth root of unity and tr is the trace map from \(F_q\) to \(F_p.\) Consider \(a=(a_1,a_2,\cdots ,a_n)\in F_q^n\) and \(b=(b_1,b_2,\cdots ,b_n)\in F_q^n.\) Let

$$\begin{aligned} X(a)=X(a_1)\otimes X(a_2)\otimes \cdots \otimes X(a_n) \end{aligned}$$

and

$$\begin{aligned} Z(a)=Z(b_1)\otimes Z(b_2)\otimes \cdots \otimes Z(b_n) \end{aligned}$$

be the tensor products of n error operators. The set

$$\begin{aligned} E_n=\left\{ X(a)Z(b)\mid a,b \in F_q^n\right\} \end{aligned}$$

is an error basis on the complex vector space \(\mathbf {C}^{q^n}\) and the set

$$\begin{aligned} G_n=\left\{ \omega ^cX(a)Z(b)\mid a,b\in F_q^n,c\in F_p\right\} \end{aligned}$$

is the error group associated with \(E_n\). For a quantum error \(e=\omega ^cX(a)Z(b)\in G_n\), the quantum weight \(\omega _{Q}(e),\) the X-weight \(\omega _X(e)\) and the Z-weight \(\omega _Z(e)\) of e,  are defined, respectively, by

$$\begin{aligned} \omega _Q(e)= & {} \sharp \{i: 1\le i\le n,(a_i,b_i)\ne (0,0)\},\\ \omega _X(e)= & {} \sharp \{i: 1\le i\le n, a_i \ne 0 \},\\ \omega _Z(e)= & {} \sharp \{i: 1\le i\le n, b_i \ne 0 \}. \end{aligned}$$

Definition 2

[28] A q-ary asymmetric quantum code Q, denoted by \([[n,k,d_z\) \(/d_x]]_q,\) is a \(q^k\)-dimensional subspace of the Hilbert space \(\mathbf {C}^{q^n}\), which can control all qudit-flip errors up to \(\lfloor (d_x-1)/2\rfloor \) and all phase-shift errors up to \(\lfloor (d_z-1)/2\rfloor \).

Theorem 7 given as follows from [42] shows the construction of construct asymmetric quantum codes. This result holds for the Euclidean and Hermitian case.

Theorem 7

[42] (CSS Construction) Let \(\mathcal {C}_i\) be a classical code with parameters \([n,k_i,d_i]_{q^2}\) for \(i=1,2\), with \(\mathcal {C}^{\perp _h}_1\subseteq \mathcal {C}_2.\) Then there exists an asymmetric quantum code Q with parameters \([[n,k_1+k_2-n,d_z/d_x]]_{q^2}\), where \(d_x=wt(\mathcal {C}_1\backslash \mathcal {C}^{\perp _h}_2)\) and \(d_z=wt(\mathcal {C}_2\backslash \mathcal {C}^{\perp _h}_1).\)

Proposition 4

[42] (Quantum Singleton bound) If an \([[n,k,d_z/d_x]]_{q^2}\) asymmetric quantum code \(\mathcal {C}\) exists, then

$$\begin{aligned} d_z+d_x\le n-k+2. \end{aligned}$$

If \( d_z+d_x= n-k+2,\) then \(\mathcal {C}\) is called an optimal asymmetric quantum code.

In the following part of this section, we focus on the construction of optimal asymmetric quantum codes by using constacyclic codes with length \(\frac{q^2+1}{10h}\). Additionally, these families of optimal asymmetric quantum codes have larger asymmetry compared with most of the ones in the literature.

Theorem 8

Let \(n=\frac{q^2+1}{10h}\) and \(s=\frac{q^2+1}{2}\). Then there exist optimal asymmetric quantum codes as follows.

  1. (1)

    \([[ \frac{q^2+1 }{10h},\frac{q^2+1 }{10h}-2(\delta _1+\delta _2+2),2\delta _1+3/2\delta _2+3]]_{q^2},\) where q is an odd prime power of the form \(10hm+t\), m is an odd, both h and t are odd with \(10h= t^2+1\) and \(t\ge 3\), both \( \delta _1\) and \(\delta _2\) are integers such that \(0 \le \delta _1\le \frac{q-10h-t}{20h}\) and \(\frac{q-3}{2}\le \delta _2\le \frac{q-3}{2}+q\delta _1\).

  2. (2)

    \([[ \frac{q^2+1 }{10h},\frac{q^2+1 }{10h}-2(\delta _1+\delta _2+2),2\delta _1+3/2\delta _2+3]]_{q^2},\) where q is an odd prime power of the form \(10hm+t\), \(m\ge 2\) is an even, both h and t are odd with \(10h=t^2+1\) and \(t\ge 3\), both \( \delta _1\) and \(\delta _2\) are integers such that \(0 \le \delta _1\le \frac{q-20h-t}{20h}\) and \(\frac{q-3}{2}\le \delta _2\le \frac{q-3}{2}+q\delta _1\).

Proof

Let \(\mathcal {C}_1\) be a constacyclic code with the defining set

$$\begin{aligned} Z_1=\cup _{j=0}^{\delta _1} C_{s-(q+1)\left( \frac{n-1}{2}-j\right) } \end{aligned}$$

from Lemma 1, where \(0\le \delta _1\le \frac{q-10h-t}{20h} \), and then \(\mathcal {C}_1\) is an optimal constacyclic code with parameters \([n,n-2\delta _1-2 ,2\delta _1+3]_{q^2}\) from Propositions 1 and 2. Let \(\mathcal {C}_2\) be a constacyclic code with the defining set

$$\begin{aligned} Z_2=\cup _{j=0}^{\delta _2} C_{s-(q+1)\left( \frac{n-1}{2}-j\right) } \end{aligned}$$

from Lemma 1, where \( \frac{q-3}{2}\le \delta _2\le \frac{q-3}{2}+q\delta _1\), then \(\mathcal {C}_2\) is an optimal constacyclic code with parameters \([n,n-2\delta _2-2,2\delta _2+3]_{q^2}\) from Propositions 1 and 2. For \(0 \le \delta _1\le \frac{q-10h-t}{20h}\) and \(\frac{q-3}{2}\le \delta _2\le \frac{q-3}{2}+q\delta _1\), we can obtain \( \mathcal {C}_1^{\perp _h}\subseteq \mathcal {C}_2\), where \(\mathcal {C}_1^{\perp _h}\) and \(\mathcal {C}_2\) are both constacyclic codes from Lemma 2.5 of [11]. In fact, we only need to show that \( Z_2\cap -qZ_1=\emptyset \) for \(0 \le \delta _1\le \frac{q-10h-t}{20h}\) and \(\frac{q-3}{2}\le \delta _2\le \frac{q-3}{2}+q\delta _1\). If \( Z_2\cap -qZ_1\ne \emptyset \), then there exist two integers \(0 \le \delta _1'\le \frac{q-10h-t}{20h}\) and \(\frac{q-3}{2}\le \delta _2'\le \frac{q-3}{2}+q\delta _1'\) such that

$$\begin{aligned} s-(q+1)\left( \frac{n-1}{2}-\delta _2'\right) \equiv -q\left( s-(q+1)\left( \frac{n-1}{2}-\delta _1'\right) \right) q^{2k}~\text {mod}~(q+1)n \end{aligned}$$

for \(k\in \{0,1\}\).

If \(k=0\), we have

$$\begin{aligned} s-(q+1)\left( \frac{n-1}{2}-\delta _2'\right) \equiv -q\left( s-(q+1)\left( \frac{n-1}{2}-\delta _1'\right) \right) ~\text {mod}~(q+1)n, \end{aligned}$$

i.e.,

$$\begin{aligned} 0\equiv \frac{q+1}{2}+\delta _2'+q\delta _1'~\text {mod}~n. \end{aligned}$$

Since

$$\begin{aligned} q-1 \le \frac{q+1}{2}+\delta _2'+q\delta _1'\le q-1+2q \frac{q-10h-t}{20h}= \frac{q^2-tq-10h}{10h}<n, \end{aligned}$$

which is in contradiction with \( 0\equiv \frac{q+1}{2}+\delta _2'+q\delta _1'~\text {mod}~n.\)

If \(k=1\), we have

$$\begin{aligned} s-(q+1)\left( \frac{n-1}{2}-\delta _2'\right) \equiv -q^3\left( s-(q+1)\left( \frac{n-1}{2}-\delta _1'\right) \right) ~\text {mod}~(q+1)n, \end{aligned}$$

i.e.,

$$\begin{aligned} \delta _2'\equiv \frac{q-1}{2} +q\delta _1'~\text {mod}~n. \end{aligned}$$

Since \( \frac{q-3}{2}\le \delta _2'\le \frac{q-3}{2}+q\delta _1'\), it is a contradiction. Therefore, we can obtain asymmetric quantum codes with parameters \([[n,n-2(\delta _1+\delta _2+2),2\delta _2+3/2\delta _1+3]]_{q^2}\) from Theorem 7, where \(0 \le \delta _1\le \frac{q-10h-t}{20h}\), \(\frac{q-3}{2}\le \delta _2\le \frac{q-3}{2}+q\delta _1\). From Proposition 4, we can see that these codes are asymmetric quantum MDS codes.

(2) The proof is similar with (1), so we omit it. \(\square \)

Example 3

Let \(h=5\), \(m=3\) and \(t=7\), then we have \(q=157\) and \(n=493\). Furthermore, we have \( 0\le \delta _1\le 1 \) and \(77 \le \delta _2\le 77+157\delta _1\). Therefore, there exist some optimal asymmetric quantum codes from Theorem 8 listed in Table 2.

Example 4

Let \(h=5\), \(m=2\) and \(t=7\), then we have \(q=107\) and \(n=229\). Furthermore, we have \( \delta _1=0 \) and \( \delta _2= 52\). Therefore, there exists an optimal asymmetric quantum codes with parameters \([[229,121,107/3]]_{q^2}\). Let \(h=5\), \(m=6\) and \(t=7\), then we have \(q=307\) and \(n=1885\). Furthermore, we have \( 0\le \delta _1\le 2 \) and \(152 \le \delta _2\le 152+307\delta _1\). Therefore, there exist some optimal asymmetric quantum codes from Theorem 8 listed in Table 2.

Table 2 Sample parameters of optimal asymmetric quantum codes constructed from Theorem 8
Table 3 Sample parameters of optimal asymmetric quantum codes constructed from Theorem 9

Theorem 9

Let \(n=\frac{q^2+1}{10h}\) and \(s=\frac{q^2+1}{2}\). Then there exist optimal asymmetric quantum codes as follows.

  1. (1)

    \([[ \frac{q^2+1 }{10h},\frac{q^2+1 }{10h}-2(\delta _1+\delta _2+2),2\delta _1+3/2\delta _2+3]]_{q^2},\) where q is an odd prime power of the form \(10hm+10h-t\), m is an odd, both h and t are odd with \(10h= t^2+1\) and \(t\ge 3\), both \( \delta _1\) and \(\delta _2\) are integers such that \(0 \le \delta _1\le \frac{q-20h+t}{20h}\) and \(\frac{q-3}{2}\le \delta _2\le \frac{q-3}{2}+q\delta _1\).

  2. (2)

    \([[ \frac{q^2+1 }{10h},\frac{q^2+1 }{10h}-2(\delta _1+\delta _2+2),2\delta _1+3/2\delta _2+3]]_{q^2},\) where q is an odd prime power of the form \(10hm+10h-t\), \(m\ge 2\) is an even, both h and t are odd with \(10h= t^2+1\) and \(t\ge 3\), both \( \delta _1\) and \(\delta _2\) are integers such that \(0 \le \delta _1\le \frac{q-30h+t}{20h}\) and \(\frac{q-3}{2}\le \delta _2\le \frac{q-3}{2}+q\delta _1\).

Proof

We omit the proof of this theorem because it is similar with the proof of Theorem 8. \(\square \)

Example 5

Let \(h=5\), \(m=3\) and \(t=7\), then we have \(q=193\) and \(n=745\). Furthermore, we have \( 0\le \delta _1\le 1 \) and \(95 \le \delta _2\le 95+193\delta _1\). Therefore, there exist optimal asymmetric quantum codes from Theorem 9 listed in Table 3.

Example 6

Let \(h=5\), \(m=8\) and \(t=7\), then we have \(q=443\) and \(n=3925\). Furthermore, we have \( 0\le \delta _1\le 3 \) and \(220 \le \delta _2\le 220+443\delta _1\). Therefore, there exist asymmetric quantum codes from Theorem 9 listed in Table 3.

Table 4 Asymmetric quantum codes

5 Conclusion and discussion

In this paper, constacyclic codes with length \(n=\frac{q^2+1}{10h}\) are utilized to construct two families of optimal quantum convolutional codes, where q is an odd prime power with the form \(q=10hm+t\) or \(q=10hm+10h-t\), where m is a positive integer, both h and t are odd with \(10h=t^2+1\) and \(t\ge 3\). Additionally, optimal quantum convolutional codes constructed in this paper with length \(\frac{q^2+1}{10h}\) are not covered in [16, 34, 35, 38, 48, 50, 51] except for the case of \(h=1\). In [50], Zhang et al. studied a class of optimal quantum convolutional codes with parameters \([(\frac{q^2+1}{10},\frac{q^2+1}{10}-4\delta ,1;2,2\delta +3)]_q\), where q is an odd prime power with the form \(10m+3\) or \(10m+ 7\), where \(m\ge 2\) is a positive integer and \(\delta \) is a positive integer such that \(2 \le \delta \le 2m-1\) (the range of \(\delta \) is equivalent to \(2 \le \delta \le \frac{q-8}{5}\) or \(2 \le \delta \le \frac{q-12}{5}\)), while the range of \(\delta \) from Theorems 4 and 6 is \(2 \le \delta \le \frac{q-8}{5}\) or \(2 \le \delta \le \frac{q-7}{5}\), respectively, which implies that optimal quantum convolutional codes with length \(\frac{q^2+1}{10}\) constructed from Theorem 6 are better than the ones in [50]. Finally, we weaken the case of Hermitian dual-containing codes applied to construct optimal asymmetric quantum codes with parameters \([[n,k,d_z/d_x]]_{q^2}\) and obtain four families of asymmetric quantum codes with length \(\frac{q^2+1}{10h}\). When \(h=1\), we can obtain the result of Theorems 5 and 6 in [19] with length \(\frac{q^2+1}{10}\) directly. In Table 4, we state some families of optimal asymmetric quantum codes available in [12, 16, 17, 42, 46, 49] as well as the new families of optimal asymmetric quantum codes constructed in this paper. We give the parameters \([[n, k, d_z/d_x ]]_{q^2}\) of optimal asymmetric quantum codes in the first column; the range of parameters in the second column; the minimum distance \(d_z\) of the corresponding asymmetric quantum codes in the third column, and the corresponding references in the fourth column. From Table 4, although the lengths are different, the lower bound of the range of \(d_z\) of those codes constructed in this paper is larger than the upper bound of the codes in [12, 16, 17, 42, 46, 49] except for very a few codes that can achieve the bound \(q+1\) or q in [12, 42, 49]. It means that these codes constructed from Theorems 8 and 9 can correct quantum errors with greater asymmetry. In the future work, we will search for other methods to construct optimal asymmetric quantum codes with greater asymmetry and other optimal quantum convolutional codes.