1 Introduction

Cyclic codes form an important class of linear codes due to their good algebraic structures in coding theory and decoding theory. Skew cyclic codes are generalizations of cyclic codes. Boucher et al. [4] showed that skew cyclic codes allowed to systematically search for codes with good properties and some examples of codes which improved the previously best known linear codes were obtained. Siap et al. [37] gave the structure of skew cyclic codes of arbitrary length. Recently, Ashraf and Mohammad [3] studied the structure and the idempotent generators of skew cyclic codes over the ring \({\mathbb {F}}_q+u{\mathbb {F}}_q+v{\mathbb {F}}_q\), where \(u^2=u\), \(v^2=v\) and \(uv=vu=0\). Bag and Upadhyay [7] introduced the structures of skew cyclic and skew constacyclic codes over the ring \({{\mathbb {F}}_p} + {u_1}{{\mathbb {F}}_p} + \cdots + {u_{2m}}{{\mathbb {F}}_p}\). Furthermore, Dertli et al. [11], Gursoy et al. [25] and Gao et al. [17] studied skew cyclic and skew constacyclic codes over finite rings, respectively.

Quantum error-correcting codes are used in quantum communication and quantum computation to protect quantum information from errors due to the decoherence and other quantum noise. Quantum error-correcting codes provides an efficient way to overcome decoherence. Quantum error-correcting codes were first discovered by Shor [39]. Later, Calderbank et al. [8] introduced the CSS construction for constructing quantum codes from widely well-known classical error-correcting codes. Shortly afterwards, the construction of quantum error-correcting codes from codes over finite fields and finite rings has developed rapidly, such as [1, 2, 6, 8,9,10, 12,13,14,15,16, 18,19,21, 23, 24, 26,27,28, 30,31,33, 35, 36, 38, 40].

Additive skew cyclic codes over finite fields could be used to construct quantum error-correcting codes. In 2011, Ezerman et al. [14] gave a method to construct additive asymmetric quantum codes from additive skew cyclic codes over \({\mathbb {F}}_4\). Recently, Aydin and Abualrub [1] studied the structure of additive skew cyclic codes over the quaternary field \({\mathbb {F}}_4\). And many best known and optimal quantum codes were obtained. Recently, we gave a family of cyclic \({\mathbb {F}}_q\)-linear \({\mathbb {F}}_{q^t}\)-codes of length n, and constructed 60 optimal cyclic \({\mathbb {F}}_q\)-linear \({\mathbb {F}}_{q^2}\)-codes [22], where n was a positive integer coprime to q. In this paper, we will study the structure of \({\mathbb {F}}_q\)-linear skew cyclic codes over \({\mathbb {F}}_{q^2}\) and give a method to construct optimal and new quantum codes from these skew cyclic codes.

The paper is organized as follows. In Sect. 2, we sketch some basic results needed in this paper. Section 3 studies the structure of \({\mathbb {F}}_q\)-linear skew cyclic codes over \({\mathbb {F}}_{q^2}\). Some good \({\mathbb {F}}_q\)-linear skew cyclic codes over \({\mathbb {F}}_{q^2}\) are constructed. In Sect. 4, we obtain some optimal and new quantum codes from \({\mathbb {F}}_q\)-linear skew cyclic codes over \({\mathbb {F}}_{q^2}\).

2 Preliminaries

Let \({\mathbb {F}}_{q^2}\) be a finite field of cardinality \(q^2\), where \(q=p^m\), p is a prime and m is a positive integer. Let \(\xi \) be a primitive element of \({\mathbb {F}}_{q^2}\) with \(\mathrm{{ord}}(\xi ) = q^2 - 1\). Then \({{\mathbb {F}}_{q^2}} = \{ 0,\xi ,{\xi ^2}, \ldots ,{\xi ^{q^2 - 1}}\}.\) Consider the map \(\theta :{{\mathbb {F}}_{q^2}} \rightarrow {{\mathbb {F}}_{q^2}};\;\alpha \mapsto {\alpha ^q}\) for any \(\alpha \in {\mathbb {F}}_{q^2}\). It is known that \(\theta \) is the Frobenius automorphism of \({\mathbb {F}}_{q^2}\) with \(\left| {\left\langle \theta \right\rangle } \right| \mathrm{{ = 2}}\). Similarly to [1, Definition 1], we have the following definition.

Definition 1

Let \({\mathbb {F}}_{q^2}\) be a finite field with \(q^2\) elements and \(\theta \) be the Frobenius automorphism of \({\mathbb {F}}_{q^2}\) with \(\left| {\left\langle \theta \right\rangle } \right| \mathrm{{ = 2}}\). Let C be a subset of \({\mathbb {F}}_{q^2}^n\). Then C is called an \({\mathbb {F}}_q\)-linear skew cyclic code of length n if

  1. (i)

    C is an additive subgroup of \(({\mathbb {F}}_{q^2}^n,+)\);

  2. (ii)

    If \(c = ({c_0},{c_1}, \ldots ,{c_{n - 1}}) \in C\), then \(w\cdot c = (w{c_0},w{c_1}, \ldots ,w{c_{n - 1}}) \in C\) for any \(w\in {\mathbb {F}}_q\);

  3. (iii)

    C is closed under the \(\theta \)-cyclic shift, i.e., if \(c = ({c_0},{c_1}, \ldots ,{c_{n - 1}}) \in C\) then

    $$\begin{aligned} \theta (c) = (\theta ({c_{n - 1}}),\theta ({c_0}), \ldots ,\theta ({c_{n - 2}})) \in C. \end{aligned}$$

For any positive integer n, we consider the skew polynomial set

$$\begin{aligned} {{\mathbb {F}}_{q^2}}[x,\theta ] = \{ {a_0} + {a_1}x + \cdots + {a_{n - 1}}{x^{n - 1}}|\;{a_i} \in {{\mathbb {F}}_{q^2}}, 0 \le i \le n - 1\}. \end{aligned}$$

The skew multiplication denoted by \(*\) in skew polynomial set \({{\mathbb {F}}_{q^2}}[x,\theta ]\) is defined by the basic rule

$$\begin{aligned} (\alpha {x^i}) * (\beta {x^j}) = \alpha {\theta ^i}(\beta ){x^{i + j}}, \end{aligned}$$

\(0 \le i,j \le n - 1\), \(\alpha , \beta \in {\mathbb {F}}_{q^2}\) and \({\theta ^i}(\beta ) = {\beta ^{{q^i}}}\). It is not difficult to verify that the multiplication \(*\) is not commutative. By [4] and [37], we have that the skew polynomial set \({{\mathbb {F}}_{q^2}}[x,\theta ]\) with respect to the usual addition of polynomials and multiplication defined above forms a non-commutative ring called the skew polynomial ring.

Let \({R_n} = {{{{\mathbb {F}}_{{q^2}}}[x,\theta ]} \big / {\langle {{x^n} - 1} \rangle }}\). We identify each element \(c=({c_0},{c_1}, \ldots ,{c_{n - 1}})\) of \({{\mathbb {F}}_{q^2}^n}\) with the polynomial \(c(x)={c_0} + {c_1}x + \cdots + {c_{n - 1}}{x^{n - 1}} \in R_n\). It is not difficult to verify that the Frobenius automorphism \(\theta \) on \( {\mathbb {F}}_{q^2}^n\) is corresponding to the operation on \(R_n\) by multiplying x, that is

$$\begin{aligned} x*c(x) = \theta ({c_{n - 1}}) + \theta ({c_0})x + \theta ({c_1}){x^2} + \cdots + \theta ({c_{n - 2}}){x^{n - 1}}. \end{aligned}$$

Let \(f(x)+\langle x^n-1\rangle \) be an element in the set \(R_n\), and let \(r(x)\in {\mathbb {F}}_{q^2}[x,\theta ]\). Define multiplication from left as:

$$\begin{aligned} r(x) * (f(x) + \langle {x^n} - 1\rangle ) = r(x) * f(x) + \langle {x^n} - 1\rangle . \end{aligned}$$

According to [37], we have that the multiplication is well-defined for any positive integer n and \(R_n\) is a left \({\mathbb {F}}_{q^2}[x,\theta ]\)-module.

3 \({\mathbb {F}}_q\)-Linear skew cyclic codes over \({\mathbb {F}}_{q^2}\)

In this section, we study the structure of \({\mathbb {F}}_q\)-linear skew cyclic codes over \({\mathbb {F}}_{q^2}\). With the discussion above, we give the polynomial definition of \({\mathbb {F}}_q\)-linear skew cyclic codes of arbitrary length n over \({\mathbb {F}}_{q^2}\) as follows.

Definition 2

Let C be a subset of \(R_n\). C is called an \({\mathbb {F}}_q\)-linear skew cyclic code if the following three conditions hold.

  1. (i)

    C is a subgroup of \(R_n\);

  2. (ii)

    \(w\cdot c(x) = w{c_0} + w{c_1}x + \cdots + w{c_{n - 1}}{x^{n - 1}} \in C\) for any \(c(x)\in C\) and any \(w\in {\mathbb {F}}_q\);

  3. (iii)

    If \(c(x) = {c_0} + {c_1}x + \cdots + {c_{n - 1}}{x^{n - 1}} \in C\), then

    $$\begin{aligned} x * c(x) = \theta ({c_{n - 1}}) + \theta ({c_0})x + \theta ({c_1})x^2 + \cdots + \theta ({c_{n - 2}}){x^{n - 1}} \in C. \end{aligned}$$

Lemma 1

A code C in \(R_n\) is an \({\mathbb {F}}_q\)-linear skew cyclic code of length n if and only if C is a left \({{{{\mathbb {F}}_{{q}}}[x]} \big / {\left\langle {{x^n} - 1} \right\rangle }}\)-submodule of \(R_n\).

Proof

Suppose that C is an \({\mathbb {F}}_q\)-linear skew cyclic code in \(R_n\). According to Definition 2, we have that C is a subgroup of \(R_n\) and C is \({\mathbb {F}}_q\)-linear. Furthermore, for any codeword \(c(x)\in C\), by the definition of \({\mathbb {F}}_q\)-linear skew cyclic codes, we have that \(x^i*c(x)\in C\) for \(0\le i\le n-1\). By Definitions 1 and 2, we obtain that \(f(x)*c(x)\in C\) for any \(f(x)\in {\mathbb {F}}_{q}[x]\). Therefore, C is a left \({{{{\mathbb {F}}_{{q}}}[x]} \big / {\left\langle {{x^n} - 1} \right\rangle }}\)-submodule of \(R_n\).

Conversely, suppose C is a left \({{{{\mathbb {F}}_{{q}}}[x]} \big / {\left\langle {{x^n} - 1} \right\rangle }}\)-submodule of \(R_n\). Then we have that \(f(x)*c(x)\in C\) for any codeword \(c(x)\in C\) and \(f(x)\in {\mathbb {F}}_q[x]\). Furthermore, for any \(a(x),\;b(x)\in C\), we have \(a(x)+b(x)\in C\). This means that C is a subgroup of \(R_n\) and C is \({\mathbb {F}}_q\)-linear. Hence, C is an \({\mathbb {F}}_q\)-linear skew cyclic code in \(R_n\). \(\square \)

Lemma 2

[29, Theorem 2.25] Let F be a finite extension of \(K={\mathbb {F}}_q\). Then for \(\alpha \in F\) we have \(T{r_{{F/K}}}(\alpha ) = 0\) if and only if \(\alpha =\beta ^q-\beta \) for some \(\beta \in F\).

According to the definitions and lemmas given above, we get the structure of \({\mathbb {F}}_q\)-linear skew cyclic codes over \({\mathbb {F}}_{q^2}\) in the following theorem.

Theorem 1

The code C is an \({\mathbb {F}}_q\)-linear skew cyclic code of length n over \({\mathbb {F}}_{q^2}\) if and only if C is a left \({{{{\mathbb {F}}_q}[x]} \big / {\left\langle {{x^n} - 1} \right\rangle }}\)-submodule of \(R_n\) in the form

$$\begin{aligned} C = \langle \xi g(x) + p(x), k(x)\rangle , \end{aligned}$$

where \(g(x)\in {{{{\mathbb {F}}_q}[x]} \big / {\left\langle {{x^n} - 1} \right\rangle }}\), \(g(x)|({x^n} - 1)\bmod q\), \(p(x)\in \ker (\varphi )\) and \(k(x)=r^q(x)-r(x)\in C\) for some \(r(x)\in {{{{\mathbb {F}}_{{q^2}}}[x]} \big / {\left\langle {{x^n} - 1} \right\rangle }}\).

Proof

Suppose that C is an \({\mathbb {F}}_q\)-linear skew cyclic code of length n over \({\mathbb {F}}_{q^2}\). We define the map

$$\begin{aligned} \varphi : C \rightarrow {{{{\mathbb {F}}_q}[x]} \big / {\left\langle {{x^n} - 1} \right\rangle }} \end{aligned}$$

by \(\varphi ({c_0} + {c_1}x + \cdots + {c_{n - 1}}{x^{n - 1}}) \mapsto ({c_0} + \theta ({c_0})) + ({c_1} + \theta ({c_1}))x + \cdots + ({c_{n - 1}} + \theta ({c_{n - 1}})){x^{n - 1}}\) for any \(c(x)={c_0} + {c_1}x + \cdots + {c_{n - 1}}{x^{n - 1}}\in C\) and \(c_i\in {\mathbb {F}}_{q^2}\), \(0\le i \le n-1\). It is evident that \(\varphi \) is the trace map from \({\mathbb {F}}_{q^2}[x]\) to \({\mathbb {F}}_q[x]\). With the definition of the trace map \(\varphi \), we have that \(\varphi (z)=z+\theta (z)\in {\mathbb {F}}_q\) for any \(z\in {\mathbb {F}}_{q^2}\). Furthermore, for any \(c(x)\in {{{{\mathbb {F}}_{{q^2}}}[x]} \big / {\left\langle {{x^n} - 1} \right\rangle }},\; d(x)\in {{{{\mathbb {F}}_{{q^2}}}[x]} \big / {\left\langle {{x^n} - 1} \right\rangle }}\), we have

$$\begin{aligned} \varphi (c(x) + d(x)) = \varphi (c(x)) + \varphi (d(x)) \end{aligned}$$

and

$$\begin{aligned} \begin{array}{*{20}{l}} {\varphi (w{x^i}*({c_0} + {c_1}x + \cdots + {c_{n - 1}}{x^{n - 1}}))}\\ {\;\; = \varphi (w{\theta ^i}({c_0}){x^i} + w{\theta ^i}({c_1}){x^{i + 1}} + \cdots + w{\theta ^i}({c_{n - 1}}){x^{n - 1 + i}})}\\ {\;\; = (w{\theta ^i}({c_0}) + w{\theta ^{i + 1}}({c_0})){x^i} + (w{\theta ^i}({c_1}) + w{\theta ^{i + 1}}({c_1})){x^{i + 1}} + \cdots }\\ {\;\;\;\;\;\; + (w{\theta ^i}({c_{n - 1}}) + w{\theta ^{i + 1}}({c_{n - 1}})){x^{n - 1 + i}}}\\ \begin{array}{l} \;\, = w{x^i}({\theta ^i}({c_0}) + {\theta ^{i + 1}}({c_0}) + ({\theta ^i}({c_1}) + {\theta ^{i + 1}}({c_1}))x + \cdots \\ \;\;\;\;\;\; + ({\theta ^i}({c_{n - 1}}) + {\theta ^{i + 1}}({c_{n - 1}})){x^{n - 1}}) \end{array}\\ {\;\; = w{x^i}*\varphi ({c_0} + {c_1}x + \cdots + {c_{n - 1}}{x^{n - 1}})\,\bmod \,{} ({x^n} - 1)} \end{array} \end{aligned}$$

for any \(w\in {\mathbb {F}}_q\) and \(0\le i \le n-1\). This means that

$$\begin{aligned} \varphi (f(x) * c(x)) = f(x)*\varphi (c(x)) \end{aligned}$$

for any \(f(x)\in {{{{\mathbb {F}}_q}[x]} \big / {\left\langle {{x^n} - 1} \right\rangle }}\). Therefore, \(\varphi \) is an \({{{{\mathbb {F}}_q}[x]} \big / {\left\langle {{x^n} - 1} \right\rangle }}\) module homomorphism.

By Lemma 2, it is not difficult to see that

$$\begin{aligned} \ker (\varphi ) = \left\{ {k(x) |\exists \;r(x) \in {{\mathbb {F}}_{{q^2}}}[x]/\left\langle {{x^n} - 1} \right\rangle \;\mathrm{{such}}\;\mathrm{{that}}\;k(x) = {r^q}(x) - r(x)}\in C \right\} , \end{aligned}$$

where \(r^q(x)=r_0^q + r_1^qx + \cdots + r_{n - 1}^q{x^{n - 1}}\). Let \(k(x)\in \ker (\varphi )\) and \(f(x)\in {{{{{\mathbb {F}}_{{q}}}[x]} \big / {\left\langle {{x^n} - 1} \right\rangle }}}\). Then we have

$$\begin{aligned} {\varphi (f(x)*k(x)) = f(x)*\varphi (k(x)) = f(x)*0 = 0}. \end{aligned}$$

Therefore, \(\ker (\varphi )\) is an \({\mathbb {F}}_{q}[x]\)-submodule of \({{{{{\mathbb {F}}_{q^2}}[x]} \big / {\left\langle {{x^n} - 1} \right\rangle }}}\).

Suppose that \(\varphi (c(x)) = b(x) \in {\mathrm{Im}} (\varphi )\) and let \(f(x)\in {{{{\mathbb {F}}_q}[x]} \big / {\left\langle {{x^n} - 1} \right\rangle }}\), where \(c(x)\in C\). Then

$$\begin{aligned} \varphi (f(x) * c(x)) = f(x)*\varphi (c(x)) = f(x)*b(x) \in {\mathrm{Im}} (\varphi ). \end{aligned}$$

Therefore, we obtain that \({\mathrm{Im}} (\varphi )\) is an ideal in \({{{{\mathbb {F}}_q}[x]} \big / {\left\langle {{x^n} - 1} \right\rangle }}\) and it is an \({\mathbb {F}}_q[x]\)-submodule of \({{{{{\mathbb {F}}_q}[x]} \big / {\left\langle {{x^n} - 1} \right\rangle }}}\). Thus, we have \({\mathrm{Im}} (\varphi ) = \left\langle {g(x)} \right\rangle \) for some \(g(x)|({x^n} - 1)\bmod q\). Then, by the first module isomorphism theorem, we have that

$$\begin{aligned} {C \big / {\ker (\varphi )}} \cong \left\langle {g(x)} \right\rangle . \end{aligned}$$

Let \(\xi g(x)+p(x)\in C\) such that \(\varphi (\xi g(x) + p(x)) =(\xi +\xi ^q) g(x)=ag(x)\), where \(p(x)\in \ker (\varphi )\) and \(a \in {\mathbb {F}}_q\setminus \{0\}\). Since \(\left\langle {ag(x)} \right\rangle = \left\langle {g(x)} \right\rangle \), we have that C is generated by two elements of the form

$$\begin{aligned} C = \langle \xi g(x) + p(x), k(x)\rangle , \end{aligned}$$

where \(k(x)={r^q}(x) - r(x)\in C\) for some \(r(x)\in {{{{\mathbb {F}}_{q^2}}[x]} \big / {\left\langle {{x^n} - 1} \right\rangle }}\).

Inversely, suppose C is a left \({{{{\mathbb {F}}_q}[x]} \big / {\left\langle {{x^n} - 1} \right\rangle }}\)-submodule of \(R_n\) given by

$$\begin{aligned} C = \langle \xi g(x) + p(x), k(x)\rangle , \end{aligned}$$

where \(g(x)\in {{{{\mathbb {F}}_q}[x]} \big / {\left\langle {{x^n} - 1} \right\rangle }}\), \(g(x)|({x^n} - 1)\bmod q\), \(p(x)\in \ker (\varphi )\) and \(k(x)=r^q(x)-r(x)\in C\) for some \(r(x)\in {{{{\mathbb {F}}_{{q^2}}}[x]} \big / {\left\langle {{x^n} - 1} \right\rangle }}\). Then, by Lemma 1, we have that C is an \({\mathbb {F}}_q\)-linear skew cyclic code of length n over \({\mathbb {F}}_{q^2}\). \(\square \)

Lemma 3

Let \(C = \langle \xi g(x) + p(x), k(x)\rangle \) be an \({\mathbb {F}}_q\)-linear skew cyclic code of odd length n over \({\mathbb {F}}_{q^2}\). Then \(g(x) \in C\).

Proof

Let \(c(x)=\xi g(x)+p(x)\in C\), where \(g(x)\in {{{{\mathbb {F}}_q}[x]} \big / {\left\langle {{x^n} - 1} \right\rangle }}\), \(g(x)|({x^n} - 1)\bmod q\) and \(p(x)\in \ker (\varphi )\). Without loss of generality, we may assume that \(p(x)=r_1^q(x)-r_1(x)\in C\) for some \(r_1(x) \in {{{{\mathbb {F}}_{q^2}}[x]} \big / {\left\langle {{x^n} - 1} \right\rangle }}\). By the definition of the skew multiplication \(*\), we have that

$$\begin{aligned} {x^n} * c(x) = {\xi ^q}g(x) + r_1(x)-r_1^q(x) \in C, \end{aligned}$$

where n is odd. Hence, we have

$$\begin{aligned} {x^n} * c(x) + c(x)= & {} ({\xi ^q} + \xi )g(x) +r_1(x)-r_1^q(x)+r_1^q(x)-r_1(x) \\= & {} ({\xi ^q} + \xi )g(x) \in C. \end{aligned}$$

Since \({\xi ^q} + \xi \in {\mathbb {F}}_q\setminus \{0\}\), by Definition 2, we have that \(g(x) \in C\). \(\square \)

According to Theorem 1 and Lemma 3, we give some good \({\mathbb {F}}_q\)-linear skew cyclic codes over \({\mathbb {F}}_{q^2}\) with \(k(x)=0\) which have the same parameters with the best known linear codes given in [34].

Example 1

Let \(q=2\) and \(n=8\). Then \(x^8-1=(x+1)^8\) over \({\mathbb {F}}_2\). Let \(g(x)=(x+1)^3=x^3 + x^2 + x + 1\) and \(p(x)=x^6 + x^2 + 1\). Then

$$\begin{aligned} C=\langle \xi _1 g(x) + p(x)\rangle =\langle x^6+\xi _1x^3+(1+\xi _1)x^2+\xi _1x+1+\xi _1\rangle \end{aligned}$$

with generator matrix

$$\begin{aligned} G\mathrm{{ = }}\left( {\begin{array}{*{20}{c}} {1 + {\xi _1}}&{}{{\xi _1}}&{}{1 + {\xi _1}}&{}{{\xi _1}}&{}0&{}0&{}1&{}0\\ 0&{}{{{(1 + {\xi _1})}^2}}&{}{\xi _1^2}&{}{{{(1 + {\xi _1})}^2}}&{}{\xi _1^2}&{}0&{}0&{}1\\ 1&{}0&{}{{{(1 + {\xi _1})}^4}}&{}{\xi _1^4}&{}{{{(1 + {\xi _1})}^4}}&{}{\xi _1^4}&{}0&{}0\\ 0&{}1&{}0&{}{{{(1 + {\xi _1})}^8}}&{}{\xi _1^8}&{}{{{(1 + {\xi _1})}^8}}&{}{\xi _1^8}&{}0\\ 0&{}0&{}1&{}0&{}{{{(1 + {\xi _1})}^{16}}}&{}{\xi _1^{16}}&{}{{{(1 + {\xi _1})}^{16}}}&{}{\xi _1^{16}}\\ {\xi _1^{32}}&{}0&{}0&{}1&{}0&{}{{{(1 + {\xi _1})}^{32}}}&{}{\xi _1^{32}}&{}{{{(1 + {\xi _1})}^{32}}}\\ {{{(1 + {\xi _1})}^{64}}}&{}{\xi _1^{64}}&{}0&{}0&{}1&{}0&{}{{{(1 + {\xi _1})}^{64}}}&{}{\xi _1^{64}}\\ {\xi _1^{128}}&{}{{{(1 + {\xi _1})}^{128}}}&{}{\xi _1^{128}}&{}0&{}0&{}1&{}0&{}{{{(1 + {\xi _1})}^{128}}} \end{array}} \right) , \end{aligned}$$

where \(\xi _1\) is a primitive element of \({\mathbb {F}}_{2^2}\) with \(\mathrm{{ord}}(\xi _1 ) = 3\). By computer system Magma [5], we have that C is a \((8,(2^2)^4,4)\) \({\mathbb {F}}_2\)-linear skew cyclic code over \({\mathbb {F}}_4\) which has the same parameters as that of the best known linear code [8, 4, 4] over \({\mathbb {F}}_{4}\) given in [34].

At the end of this example, we list some good \({\mathbb {F}}_q\)-linear skew cyclic codes \((n,(q^2)^k,\) d) over \({\mathbb {F}}_{4}\) and \({\mathbb {F}}_{9}\) which have the same parameters with the best known linear codes given in [34] in Table 1. In Table 1n is the length of C, k is the dimension of C and d is the minimum Hamming distance of C.

Table 1 Some good \({\mathbb {F}}_q\)-linear skew cyclic codes over \({\mathbb {F}}_{q^2}\)

Remark 1

In Table 1,

  • \(a_1=x^{10} + x^9 + x^8 + x^7 + x^6 + x^5 + x^4 + x^3 + x^2 + x + 1,\)

  • \(a_2=x^{12} + x^{11} + x^{10} + x^9 + x^8 + x^7 + x^6 + x^5 + x^4 + x^3 + x^2 + x + 1,\)

  • \(a_3=x^9 + x^8 + x^7 + x^6 + x^5 + x^4 + x^3 + x^2 + x + 1,\)

  • \(a_4=x^{10} + x^9 + x^8 + x^7 + x^6 + x^5 + x^4 + x^3 + x^2 + x + 1\)

and \(\xi _2\) is a primitive element of \({\mathbb {F}}_{3^2}\) with \(\mathrm{{ord}}(\xi _2 ) = 8\).

Now we define a map \({\mathcal {S}}\) from \({\mathbb {F}}_{q^2}^n\) to \({\mathbb {F}}_{q^2}^{2n}\) as follows

$$\begin{aligned} \begin{array}{l} \;{\mathcal {S}}:\;\;\;\;\;\;{\mathbb {F}}_{{q^2}}^n\;\;\;\; \rightarrow \;\;\;\;{\mathbb {F}}_{q^2}^{2n}\\ \;\;({c_0}, \ldots ,{c_{n - 1}}) \mapsto ({c_0},\theta ({c_0}), \ldots ,{c_{n - 1}},\theta ({c_{n - 1}})). \end{array} \end{aligned}$$

Clearly, \({\mathcal {S}}\) is an \({\mathbb {F}}_q\)-linear map, injective but not surjective. Let \(n=2\) and \(c=(\xi , \xi ^q)\), where \(\xi \) is a primitive element of \({\mathbb {F}}_{q^2}\). Then we have

$$\begin{aligned}&{\mathcal {S}}(c)=(\xi , \xi ^q, \xi ^q, \xi ), \\&{\mathcal {S}}(\xi \cdot c)={\mathcal {S}}(\xi ^2, \xi ^{q+1})=(\xi ^2, \xi ^{2q}, \xi ^{q+1}, \xi ^{q+1}) \end{aligned}$$

and

$$\begin{aligned} \xi \cdot {\mathcal {S}}(c)=\xi \cdot (\xi , \xi ^q, \xi ^q, \xi )=(\xi ^2, \xi ^{q+1}, \xi ^{q+1}, \xi ^2). \end{aligned}$$

Since \({\mathcal {S}}(\xi \cdot c)\ne \xi \cdot {\mathcal {S}}(c)\), we have that \({\mathcal {S}}\) is not an \({\mathbb {F}}_{q^2}\)-linear map.

Let \((n,M, d)_{q^2}\) denotes a code C of length n over \({\mathbb {F}}_{q^2}\), where M is the cardinality of C and d is the minimum Hamming distance of C. By the definition of \({\mathcal {S}}\), we have the following lemma immediately.

Lemma 4

Let C be a code of length n over \({\mathbb {F}}_{q^2}\) with parameters \((n,M, d)_{q^2}\). For any \(c=({c_0}, \ldots ,{c_{n - 1}})\in C\), we have

$$\begin{aligned} w{t_H}({\mathcal {S}}(c)) = 2w{t_H}(c) \end{aligned}$$

and

$$\begin{aligned} d({\mathcal {S}}(C))=2d(C), \end{aligned}$$

where \(wt_H(c)\) denotes the Hamming weight of c and d(C) denotes the minimum Hamming distance of C.

Proof

According to the definition of the map \({\mathcal {S}}\), for any \(c=({c_0}, \ldots ,{c_{n - 1}})\in C\), we have that

$$\begin{aligned} {\mathcal {S}}(c)=({c_0},c_0^q, \ldots ,{c_{n - 1}}, c_{n - 1}^q). \end{aligned}$$

It is not difficult to show that, \(c_i^q=0\) if and only if \(c_i=0\) for \(0\le i \le n-1\). So, if \(c_i\ne 0\), then we have \(c_i^q\ne 0\). The proof of the lemma is now complete. \(\square \)

Lemma 5

If C is an \({\mathbb {F}}_q\)-linear skew cyclic \((n,M, d)_{q^2}\) code, then \({\mathcal {S}}(C)\) is an additive skew \((2n,M, 2d)_{q^2}\) 2-quasi-cyclic code.

Proof

As C is an \({\mathbb {F}}_q\)-linear skew cyclic code over \({\mathbb {F}}_{q^2}\), by the definition of C, we have that \(c=({c_0}, \ldots ,{c_{n - 1}})\in C\) if and only if \(\theta (c) = (\theta ({c_{n - 1}}),\theta ({c_0}), \ldots ,\) \(\theta ({c_{n - 2}})) \in C.\) Applying \({\mathcal {S}}\) on c and \(\theta (c) \), we get

$$\begin{aligned} {\mathcal {S}}(c)=({c_0}, \theta (c_0), \ldots , {c_{n - 1}}, \theta (c_{n-1}))\in {\mathcal {S}}(C) \end{aligned}$$

if and only if

$$\begin{aligned} {\mathcal {S}}(\theta (c)) = (\theta ({c_{n - 1}}), c_{n - 1}, \theta ({c_0}), c_0, \ldots ,\theta ({c_{n - 2}}), c_{n-2}) \in {\mathcal {S}}(C). \end{aligned}$$

According to Lemma 4, we have that \({\mathcal {S}}(C)\) is an additive skew \((2n,M, 2d)_{q^2}\) 2-quasi-cyclic code. \(\square \)

4 Quantum codes from \({\mathbb {F}}_q\)-linear skew cyclic codes over \({\mathbb {F}}_{q^2}\)

In this section, we give a method to construct quantum codes from \({\mathbb {F}}_q\)-linear skew cyclic codes over \({\mathbb {F}}_{q^2}\). We consider a trace-alternating form of two vectors b and c in \({\mathbb {F}}_{q^2}^n\) by

$$\begin{aligned} <b,c>_a = t{r_{{{{q}} \big / p}}}\left( {\frac{{b \cdot {c^q} - {b^q} \cdot c}}{{{\xi ^{2q}} - {\xi ^2}}}} \right) , \end{aligned}$$

where \(\xi \) is a primitive element of \({\mathbb {F}}_{q^2}\), \(q=p^m\) and \(t{r_{{{{q}} \big / p}}}\) is the trace map from \({\mathbb {F}}_{q}\) to \({\mathbb {F}}_p\) defined by

$$\begin{aligned} \begin{array}{*{20}{l}} {t{r_{{q/p}}}:{{\mathbb {F}}_q} \rightarrow {{\mathbb {F}}_p}}\\ {\;\;\;\;\;\;\;\;\;\;\,\beta \mapsto \beta + {\beta ^p} + \cdots + {\beta ^{{p^m} - 1}}.} \end{array} \end{aligned}$$

It is easy to see that \(<b,c>_a\in {\mathbb {F}}_q\). By [27], we have that the trace-alternating form is bi-additive, and it is \({\mathbb {F}}_p\)-linear, but not \({\mathbb {F}}_q\)-linear. Furthermore, it is alternating in the sense that \(<b,b>_a = 0\) holds for all \(b\in {\mathbb {F}}_{q^2}^n\).

Let C be an \({\mathbb {F}}_q\)-linear skew cyclic code of length n over \({\mathbb {F}}_{q^2}\). Its trace-alternating dual code is defined as

$$\begin{aligned} {C^{{ \bot _a}}} = \{ u \in {\mathbb {F}}_{{q^2}}^n|<u,c>_a = 0\;\mathrm{{for}}\;\mathrm{{all}}\;c \in C\} . \end{aligned}$$

Furthermore, C is said to be self-orthogonal if \(C \subseteq {C^{{ \bot _a}}}\), dual containing if \({C^{{ \bot _a}}} \subseteq C\) and self-dual if \(C = {C^{{ \bot _a}}}\).

Lemma 6

Let C be an \({\mathbb {F}}_q\)-linear skew cyclic code over \({\mathbb {F}}_{q^2}\) with parameters \((n,M,d)_{q^2}\). Then

$$\begin{aligned} {\mathcal {S}}(C)\subseteq {{\mathcal {S}}(C)}^{\perp _a}. \end{aligned}$$

Proof

For any \(b = ({b_0},{b_1}, \ldots ,{b_{n - 1}})\in C\), \(c = ({c_0},{c_1}, \ldots ,{c_{n - 1}})\in C\), by the definition of the trace-alternating form, we have that

$$\begin{aligned} < {{{{\mathcal {S}}}}(b),{{{\mathcal {S}}}}(c)}> _a = t{r_{{{{q}}/p}}}\left( {\sum \limits _{i = 0}^{n - 1} {\frac{{{b_i}c_i^q + b_i^q{c_i}}}{{{\xi ^{2q}} - {\xi ^2}}} - \sum \limits _{i = 0}^{n - 1} {\frac{{b_i^q{c_i} + {b_i}c_i^q}}{{{\xi ^{2q}} - {\xi ^2}}}} } } \right) =t{r_{{{{q}}/p}}}\left( 0 \right) = 0. \end{aligned}$$

This implies that for any \({{{\mathcal {S}}}}(b),{{{\mathcal {S}}}}(c)\in {{{\mathcal {S}}}}(C)\), we have \(<{{{\mathcal {S}}}}(b),{{{\mathcal {S}}}}(c)> _a = 0\). Thus we get \({\mathcal {S}}(C)\subseteq {{\mathcal {S}}(C)}^{\perp _a}\). \(\square \)

Let \([[n,k,d]]_q\) denotes a quantum code over \({\mathbb {F}}_q\) with length n, dimension k and minimum Hamming distance d. The following lemma is useful for our results.

Lemma 7

[27, Theorem 15] An \(((n,K,d))_q\) stabilizer code exists if and only if there exists an additive subcode D of \({\mathbb {F}}_{q^2}^n\) of cardinality \(|D| = {{{q^n}}/K}\) such that \(D\le D^{\perp _a}\) and \(\mathrm{{wt}}({D^{{ \bot _a}}}\backslash D) = d\) if \(K>1\) (and \(\mathrm{{wt}}({D^{\bot _a}}) = d\) if \(K=1\)).

According to the results above and Lemmas 6 and 7, we give the existence of quantum codes over \({\mathbb {F}}_q\) in the following theorem.

Theorem 2

Let C be an \({\mathbb {F}}_q\)-linear skew cyclic code over \({\mathbb {F}}_{q^2}\) with parameters \((n,M,d)_{q^2}\). Then \({\mathcal {S}}(C)\) is an additive skew \((2n,M,2d)_{q^2}\)-code, \({\mathcal {S}}(C)\subseteq {{\mathcal {S}}(C)}^{\perp _a}\) and there exists an \([[2n,k,d_Q]]_q\) quantum code, where \(k = {\log _q}({{{q^{2n}}} \big / M})\), \(d_Q=\mathrm{{wt}}({{\mathcal {S}}(C)}^{\perp _a}\backslash {\mathcal {S}}(C))\) if \(q^k>1\) (and \(d_Q=wt({{\mathcal {S}}(C)}^{\perp _a})\) if \(q^k=1\)).

For the convenience and practicality of the calculation, we just consider these codes which have a single generator polynomial, that is \(k(x) = 0\) in Theorem 1, in the rest of this article. Let

$$\begin{aligned} C = \langle \xi g(x) + p(x)\rangle \end{aligned}$$

be an \({\mathbb {F}}_q\)-linear skew cyclic code of length n over \({\mathbb {F}}_{q^2}\). According to the definition of the trace-alternating inner product \(< \cdot , \cdot > _a\) and \(|C| \cdot |{C^{{ \bot _a}}}| = {q^{2n}}\), it is not difficult to verify that if \(|C|=q^n\), then we have

$$\begin{aligned} {C^{{ \bot _a}}} = \langle \xi g(x) + p(x)\rangle \end{aligned}$$

is an \({\mathbb {F}}_q\)-linear skew cyclic code of length n with cardinality \(|{C^{{ \bot _a}}}| = q^n\) over \({\mathbb {F}}_{q^2}\). This means that C is a trace-alternating self-dual \({\mathbb {F}}_q\)-linear skew cyclic code over \({\mathbb {F}}_{q^2}\).

Let \(C ={C^{{ \bot _a}}} = \langle \xi g(x) + p(x)\rangle \) be a trace-alternating self-dual \({\mathbb {F}}_q\)-linear skew cyclic code over \({\mathbb {F}}_{q^2}\). Then \({\mathcal {S}}(C) = {\mathcal {S}}({C^{{ \bot _a}}})\). According to Lemma 6, we have that \({\mathcal {S}}(C)\subseteq {{\mathcal {S}}(C)}^{\perp _a}\), which implies that \({\mathcal {S}}(C) ={\mathcal {S}}({C^{{ \bot _a}}}) \subset {{\mathcal {S}}(C)}^{\perp _a}\).

With notations and results listed above, we give some good quantum codes in the following examples.

Example 2

Let \(q=2\) and \(n=4\). Then \(x^4-1=(x+1)^4\) over \({\mathbb {F}}_2\). Let \(g(x)=(x+1)^2=x^2 + 1\) and \(p(x)=x^3 + x^2 + x + 1\), then we have

$$\begin{aligned} C=\langle \xi _1 g(x) + p(x)\rangle =\langle x^3+(1+\xi _1)x^2+x+1+\xi _1\rangle \end{aligned}$$

with generator matrix

$$\begin{aligned} G\mathrm{{ = }}\left( {\begin{array}{*{20}{c}} {\mathrm{{1 + }}\xi _1 }&{}\mathrm{{1}}&{}{\mathrm{{1 + }}\xi _1}&{}\mathrm{{1}}\\ \mathrm{{1}}&{}{{{(\mathrm{{1 + }}\xi _1 )}^2}}&{}1&{}{{{(\mathrm{{1 + }}\xi _1)}^2}} \end{array}} \right) , \end{aligned}$$

where \(\xi _1\) is a primitive element of \({\mathbb {F}}_{2^2}\) with \(\mathrm{{ord}}(\xi _1 ) = 3\). With the computational algebra system Magma [5], we have that C is an \({\mathbb {F}}_2\)-linear skew cyclic \((4,2^2, 4)_{4}\) code. According to Lemma 5, we have that \({\mathcal {S}}(C)\) is an additive skew \((8,2^2,8)_{4}\) 2-quasi-cyclic code with generator matrix

$$\begin{aligned} {G_{S(C)}} = \left( {\begin{array}{*{20}{c}} {\mathrm{{1 + }}{\xi _1}}&{}{{{(\mathrm{{1 + }}{\xi _1})}^2}}&{}1&{}1&{}{\mathrm{{1 + }}{\xi _1}}&{}{{{(\mathrm{{1 + }}{\xi _1})}^2}}&{}1&{}1\\ 1&{}1&{}{{{(\mathrm{{1 + }}{\xi _1})}^2}}&{}{{{(\mathrm{{1 + }}{\xi _1})}^4}}&{}1&{}1&{}{{{(\mathrm{{1 + }}{\xi _1})}^2}}&{}{{{(\mathrm{{1 + }}{\xi _1})}^4}} \end{array}} \right) . \end{aligned}$$

Using Magma [5], we have that \({{{{\mathcal {S}}}}(C)^{{ \bot _a}}}\) is an additive skew \((8,2^{14},2)_{4}\) code. By Theorem 2, we obtain an optimal binary quantum code [[8, 6, 2]] which has the same parameters with the best known binary additive quantum code given in [34].

At the end of this example, we give some optimal binary quantum codes which have the same parameters with the best known binary additive quantum codes given in [34] in Table 2.

Table 2 Some optimal binary quantum codes [[nkd]]

Example 3

Let \(q=3\) and \(n=3\). Then \(x^3-1=(x+2)^3\) over \({\mathbb {F}}_3\). Let \(g(x)=(x+2)^2=x^2 + x + 1\) and \(p(x)=\xi _2^2x + \xi _2^6\). Then

$$\begin{aligned} C=\langle \xi _2 g(x) + p(x)\rangle =\langle \xi _2x^2+(\xi _2+\xi _2^2)x+\xi _2+\xi _2^6\rangle \end{aligned}$$

with generator matrix

$$\begin{aligned} G\mathrm{{ = }}\left( {\begin{array}{*{20}{c}} {{\xi _\mathrm{{2}}}\mathrm{{ + }}\xi _\mathrm{{2}}^\mathrm{{6}}}&{}{{\xi _\mathrm{{2}}}\mathrm{{ + }}\xi _\mathrm{{2}}^\mathrm{{2}}}&{}{{\xi _\mathrm{{2}}}}\\ {\xi _\mathrm{{2}}^\mathrm{{3}}}&{}{{{({\xi _\mathrm{{2}}}\mathrm{{ + }}\xi _\mathrm{{2}}^\mathrm{{6}})}^3}}&{}{{{({\xi _\mathrm{{2}}}\mathrm{{ + }}\xi _\mathrm{{2}}^\mathrm{{2}})}^3}}\\ {{{({\xi _\mathrm{{2}}}\mathrm{{ + }}\xi _\mathrm{{2}}^\mathrm{{2}})}^9}}&{}{\xi _\mathrm{{2}}^9}&{}{{{({\xi _\mathrm{{2}}}\mathrm{{ + }}\xi _\mathrm{{2}}^\mathrm{{6}})}^9}} \end{array}} \right) , \end{aligned}$$

where \(\xi _2\) is a primitive element of \({\mathbb {F}}_{3^2}\) with \(\mathrm{{ord}}(\xi _2 ) = 8\). Using Magma [5], we have that C is an \({\mathbb {F}}_3\)-linear skew cyclic \((3,3^3, 2)_{9}\) code. By Lemma 5, we have that \({\mathcal {S}}(C)\) is an additive skew \((6,3^3,4)_{9}\) 2-quasi-cyclic code with generator matrix

$$\begin{aligned} {G_{S(C)}} = \left( {\begin{array}{*{20}{c}} {{\xi _\mathrm{{2}}}\mathrm{{ + }}\xi _\mathrm{{2}}^\mathrm{{6}}}&{}{{{({\xi _\mathrm{{2}}}\mathrm{{ + }}\xi _\mathrm{{2}}^\mathrm{{6}})}^3}}&{}{{\xi _\mathrm{{2}}}\mathrm{{ + }}\xi _\mathrm{{2}}^\mathrm{{2}}}&{}{{{({\xi _\mathrm{{2}}}\mathrm{{ + }}\xi _\mathrm{{2}}^\mathrm{{2}})}^3}}&{}{{\xi _\mathrm{{2}}}}&{}{\xi _2^3}\\ {\xi _\mathrm{{2}}^\mathrm{{3}}}&{}{\xi _\mathrm{{2}}^9}&{}{{{({\xi _\mathrm{{2}}}\mathrm{{ + }}\xi _\mathrm{{2}}^\mathrm{{6}})}^3}}&{}{{{({\xi _\mathrm{{2}}}\mathrm{{ + }}\xi _\mathrm{{2}}^\mathrm{{6}})}^9}}&{}{{{({\xi _\mathrm{{2}}}\mathrm{{ + }}\xi _\mathrm{{2}}^\mathrm{{2}})}^3}}&{}{{{({\xi _\mathrm{{2}}}\mathrm{{ + }}\xi _\mathrm{{2}}^\mathrm{{2}})}^9}}\\ {{{({\xi _\mathrm{{2}}}\mathrm{{ + }}\xi _\mathrm{{2}}^\mathrm{{2}})}^9}}&{}{{{({\xi _\mathrm{{2}}}\mathrm{{ + }}\xi _\mathrm{{2}}^\mathrm{{2}})}^{27}}}&{}{\xi _\mathrm{{2}}^9}&{}{\xi _\mathrm{{2}}^{27}}&{}{{{({\xi _\mathrm{{2}}}\mathrm{{ + }}\xi _\mathrm{{2}}^\mathrm{{6}})}^9}}&{}{{{({\xi _\mathrm{{2}}}\mathrm{{ + }}\xi _\mathrm{{2}}^\mathrm{{6}})}^{27}}} \end{array}} \right) . \end{aligned}$$

Using Magma [5], we have that \({{{{\mathcal {S}}}}(C)^{{ \bot _a}}}\) is an additive skew \((6,3^9,2)_{9}\) code. By Theorem 2, we obtain a new quantum code \([[6,3,2]]_3\) which has better parameters than the quantum code \([[6,2,2]]_3\) given in [2].

Let \(q=3\), \(n=4\), \(g(x)=x^2+2\) and \(p(x)=\xi _2^2x + \xi _2^6\). According to the numerical results by using Magma [5], Lemma 5, Theorems 1 and 2, we have that \({\mathcal {S}}(C)\) is an additive skew \((8,3^3,6)_{9}\) 2-quasi-cyclic code and \({{{{\mathcal {S}}}}(C)^{{ \bot _a}}}\) is an additive skew \((8,3^{13},2)_{9}\) code. Thus, we obtain a new quantum code \([[8,5,2]]_3\) which has better parameters than the quantum code \([[8,4,2]]_3\) given in [2].

5 Conclusion

In this paper, we study the structure of \({\mathbb {F}}_q\)-linear skew cyclic codes over \({\mathbb {F}}_{q^2}\). Some good \({\mathbb {F}}_q\)-linear skew cyclic codes over \({\mathbb {F}}_{q^2}\) are constructed. Moreover, we give a method to construct quantum codes from \({\mathbb {F}}_q\)-linear skew cyclic codes over \({\mathbb {F}}_{q^2}\) and some optimal and new quantum codes are obtained.