1 Introduction and preliminaries

Polynomial time algorithms for prime factorization and discrete logarithms on quantum computers were given by Shor in 1994 [42]. Thus, if an efficient quantum computer existed (see [5, 45], for recent advances), most popular cryptographic systems could be broken and much computational work could be done much faster. Unlike classical information, quantum information cannot be cloned [12, 49], despite this fact quantum (error-correcting) codes do exist [43, 46]. The above facts explain why, in the last decades, the interest in quantum computations and, in particular, in quantum coding theory grew dramatically. There exists an extensive literature on quantum codes, see for instance [3, 4, 810, 26, 28] for the binary case and [2, 6, 16, 29, 33, 38] for the general case.

Classical linear codes and Hermitian and Euclidean inner products are useful tools to construct codes in a class of quantum codes named stabilizer codes. In this paper, we introduce J-affine variety codes and use them, together with the Hamada’s generalization [30] of the Steane’s enlargement procedure, to derive new stabilizer codes. The main procedures in the literature we use are collected in Theorems 1 and 2. Furthermore, we introduce and consider a new enlargement that we state in Theorem 3. This result extends the mentioned Hamada’s generalization and is proved in the “Appendix.” With the above ideas, we obtain binary stabilizer codes which are records in [27] and nonbinary codes that exceed the Gilbert–Varshamov bounds.

Set \(q=p^r\) a positive power of a prime number p and let \(\mathbb {C}\) be the complex numbers. A stabilizer code \({\mathcal {C}} \ne \{0\}\) is the common eigenspace of an abelian subgroup \(\varDelta \) of the error group \(G_n\) generated by a nice error basis on the space \(\mathbb {C}^{q^n}\), n being a positive integer. The code \({\mathcal {C}}\) has minimum distance d whenever all error in \(G_n\) with weight less than d can be detected or have no effect on \({\mathcal {C}}\) but some error of weight d cannot be detected. In addition, \({\mathcal {C}}\) is called to be pure if \(\varDelta \) has not nonscalar matrices with weight less than d. Finally, a code as above is an \([[n,k,d]]_q\)-code when it is a \(q^k\)-dimensional subspace of \(\mathbb {C}^{q^n}\) and has minimum distance d (see for instance [9, 32]). Recall that the Hermitian inner product of two vectors \(\mathbf {x} =(x_1,x_2, \ldots , x_n)\) and \(\mathbf {y}=(y_1,y_2, \ldots , y_n)\) in the vector space \({\mathbb {F}}_{q^2}^n\) is defined as \(\mathbf {x} \cdot _h \mathbf {y}= \sum x_i y_i^q\) and the Euclidean product of \(\mathbf {x}\) and \(\mathbf {y}\) in \({\mathbb {F}}_{q}^n\) as \(\mathbf {x} \cdot \mathbf {y} = \sum x_i y_i\). Given a linear code C in \({\mathbb {F}}_{q^2}^n\) (respectively, \({\mathbb {F}}_{q}^n\)), the Hermitian (respectively, Euclidean) dual space is denoted by \(C^{\perp _h}\) (respectively, \(C^\perp \)).

Theorem 1

[1, 32] The following two statements hold.

  1. (1)

    Let C be a linear [nkd] error-correcting code over \({\mathbb {F}}_{q}\) such that \(C^\perp \subseteq C\). Then, there exists an \([[n, 2k -n, \ge d]]_q\) stabilizer code which is pure to d. If the minimum distance of \(C^\perp \) exceeds d, then the stabilizer code is pure and has minimum distance d.

  2. (2)

    Let C be a linear [nkd] error-correcting code over \({\mathbb {F}}_{q^2}\) such that \(C^{\perp _h }\subseteq C\). Then, there exists an \([[n, 2k -n, \ge d]]_q\) stabilizer code which is pure to d. If the minimum distance \(d^{\perp _h}\) of the code \(C^{\perp _h}\) exceeds d, then the stabilizer code is pure and has minimum distance d.

Codes obtained as described in Item (1) of Theorem 1 are usually referred to as obtained from the CSS construction [10, 46]. This last procedure is not only useful for quantum error correction but also for privacy amplification of quantum cryptography [44]. In addition, it has been extended to construct asymmetric quantum codes which are suitable for quantum mechanical systems where the phase-flip errors happen more frequently than the bit-flip errors [15, 41]. The parameters of the codes coming from Item (1) of Theorem 1 can be improved with the Hamada’s generalization [30] of the Steane’s enlargement procedure [48]. Let us state the result, where \({\mathrm {wt}}\) denotes minimum weight.

Theorem 2

[30] Let C be an [nk] linear code over the field \({\mathbb {F}}_q\) such that \(C^\perp \subseteq C\). Assume that C can be enlarged to an \([n,k']\) linear code \(C'\), where \(k' \ge k + 2\). Then, there exists a stabilizer code with parameters \([[n,k+k'-n, d \ge \min \{d', \lceil \frac{q+1}{q} d'' \rceil \} ]]_q\), where \(d' = {\mathrm {wt}} (C{\setminus }C'^\perp )\) and \(d'' = {\mathrm {wt}} (C' {\setminus } C'^\perp )\).

Using the above results, many quantum codes coming from classical codes have been constructed, see [32] for example. A complete table of parameters corresponding to known binary quantum codes, up to length 128, can be consulted in [27]. There is no table for nonbinary quantum codes, although there are some codes with good parameters, essentially concerning MDS quantum codes, quantum LDPC codes or quantum BCH codes [1, 14, 31, 3335, 40, 50]. Most of the above-mentioned codes have specific lengths depending on q. A way to get codes with good parameters uses evaluation (classical) codes [2125]. In [19, 20], the authors consider affine variety codes which form a class of evaluation codes such that duality can be characterized. The reader can consult [23] for a lower bound for the minimum distance of these codes.

The above-mentioned papers [19, 20] considered affine variety codes, where we could compare parameters of our codes with others given by BCH codes and improve some of them. The evaluation at zero was not considered, and we only used duality with respect to the Euclidean inner product. This paper is devoted to construct algebraically generated stabilizer codes from a more general version of affine variety codes (J-affine variety codes), where we decide which coordinates of the points to evaluate may be zero. In this way, we get a wider range of lengths for our codes. Moreover, in this work, both Euclidean and Hermitian duality are considered, which allows us to obtain a richer family of codes. Notice that our codes are based on cyclotomic sets and subfield-subcodes, so they can be seen as a natural extension of BCH codes since these can be constructed with cyclotomic cosets and are subfield-subcodes of Reed–Solomon codes.

Stabilizer codes derived from the Euclidean inner product and J-affine variety codes (and their subfield-subcodes) are studied in Sect. 2, and their parameters are described in Theorem 6. Section 3 develops the Hermitian case; the main result is Theorem 7, which also gives the parameters of the corresponding codes. To prove this result, we show that Delsarte theorem [11] also holds in our case, that is, with respect to Hermitian inner product. Furthermore, we prove in the “Appendix” the following generalization of the Steane’s enlargement procedure.

Theorem 3

Let \(C_1\) and \(\hat{C}_1\) be two linear codes over the field \({\mathbb {F}}_q\), with parameters \([n,k_1,d_1]\) and \([n,\hat{k}_1,\hat{d}_1]\), respectively, and such that \(C_1^\perp \subseteq \hat{C}_1\). Consider a linear code \(D \subseteq {\mathbb {F}}_q^n\) such that \(\dim D \ge 2\) and \((C_1 + \hat{C}_1) \cap D = \{ 0 \}\). Set \(C_2 = C_1 + D\) and \(\hat{C}_2 = \hat{C}_1 + D\), that enlarge \(C_1\) and \(\hat{C}_1\), respectively, with parameters \([n,k_2,d_2]\) and \([n,\hat{k}_2,\hat{d}_2]\) (\(k_2 - k_1 = \hat{k}_2 - \hat{k_1} = \dim D >1\)). Set \(C_3\) the code sum of the vector spaces \(C_1 + \hat{C}_1 + D\), whose parameters we denote by \([n,k_3,d_3]\). Then, there exists a stabilizer code with parameters

$$\begin{aligned} \left[ \left[ n, k_2 + \hat{k}_1-n, d \ge \min \left\{ d_1, \hat{d}_1, \left\lceil \frac{d_2 + \hat{d}_2 + d_3}{2} \right\rceil \right\} \right] \right] _2, \end{aligned}$$

when \(q=2\). Otherwise, the parameters are

$$\begin{aligned} \left[ \left[ n, k_2 + \hat{k}_1-n, d \ge \min \left\{ d_1, \hat{d}_1, M \right\} \right] \right] _q, \end{aligned}$$

where \(M = \max \{ d_3 + \lceil (d_2/q) \rceil , d_3 + \lceil (\hat{d}_2/q) \rceil \}\).

In Sect. 4 (see Table 2), we use Theorem 3 to determine stabilizer binary codes of length 127 which are records in [27]. Within the same section and with the help of the previously mentioned results, we provide tables with unknown stabilizer codes over different ground fields that exceed the Gilbert–Varshamov bounds [13, 17, 39], [32, Lemma 31]. When comparisons are possible, our codes improve those available in the literature.

2 Stabilizer J-affine variety codes: Euclidean inner product

In this section, we introduce J-affine variety codes and characterize their duality with respect to the Euclidean inner product. Our results provide stabilizer quantum codes, derived from these codes and their subfield-subcodes, whose parameters are also described.

2.1 Euclidean duality for J-affine variety codes

Set \(q=p^r\) a positive power of a prime number p and consider the finite field \({\mathbb {F}}_q\). Next we are going to introduce a family of affine variety codes and study their dual codes.

Consider the ring of polynomials \({\mathbb {F}}_{q}[X_1, X_2, \ldots , X_m]\) in m variables over the field \({\mathbb {F}}_{q}\) and fix m integers \(N_j >1\) such that \(N_j -1\) divides \(q-1\) for \(1 \le j \le m\). For a subset \(J \subseteq \{1,2, \ldots , m\}\), set \(I_J\) the ideal of the ring \({\mathbb {F}}_{q}[X_1, X_2, \ldots , X_m]\) generated by \(X_j^{N_j}-X_j\) whenever \(j\not \in J\) and by \(X_j^{N_j -1}- 1\) otherwise, for \(1 \le j \le m\). We denote by \(R_J\) the quotient ring

$$\begin{aligned} R_J := {\mathbb {F}}_{q}[X_1, X_2, \ldots , X_m]/I_J. \end{aligned}$$

Set \(Z_J = Z(I_J) = \{P_1, P_2, \ldots , P_{n_J}\}\) the set of zeros over \({\mathbb {F}}_q\) of the defining ideal of \(R_J\). Clearly, the points \(P_i\), \(1 \le i \le n_J\), can have 0 as a coordinate for those indices j which are not in J but this is not the case for the remaining coordinates. Denote \(\mathrm {ev}_J: R_J \rightarrow {\mathbb {F}}_{q}^{n_J}\) the evaluation map defined as \(\mathrm {ev}_J(f) = (f(P_1), f(P_2), \ldots , f(P_{n_J}) \), where \(n_J = \prod _{j \notin J} N_j \prod _{j \in J} (N_j -1)\). Denote also \(T_j = N_j -1\) except when \(j \in J\), in this last case, \(T_j = N_j -2\), consider the set

$$\begin{aligned} {\mathcal {H}}_J := \{0,1,\ldots ,T_1\}\times \{0,1,\ldots ,T_2\} \times \cdots \times \{0,1,\ldots ,T_m\} \end{aligned}$$

and a nonempty subset \(\varDelta \subseteq {\mathcal {H}}_J\). Then, we define the J-affine variety code given by \(\varDelta \), \(E_\varDelta ^J\), as the vector subspace (over \({\mathbb {F}}_{q}\)) of \({\mathbb {F}}_{q}^{n_J}\) generated by the evaluation by \(\mathrm {ev}_J\) of the set of classes in \(R_J\) corresponding to monomials \(X^{\varvec{a}} := X_1^{a_1} X_1^{a_2}\cdots X_{m}^{a_m}\) such that \(\varvec{a}=(a_1,a_2, \ldots , a_m) \in \varDelta \). Stabilizer codes constructed from \(\{1,2, \ldots , m\}\)-affine variety codes were considered in [19, 20] because they allowed us to do comparisons with some quantum BCH codes. In this paper, \(\emptyset \)-affine variety codes are named evaluating at zero affine variety codes although in some papers they are simply called affine variety codes [23]. We will stand \({\mathcal {H}}\) for \({\mathcal {H}}_\emptyset \), and we will also write \( \mathcal {H'} := {\mathcal {H}}_{\{1,2, \ldots , m\}}\). Notice that considering different sets J, we get codes of different lengths

$$\begin{aligned} (N_1 -1) (N_2 -1) \cdots (N_m-1)= n_{\{1,2, \ldots , m\}}\le n_J \le n_\emptyset =N_1 N_2 \cdots N_m. \end{aligned}$$

Generalized Reed–Muller codes are a well-known family of evaluating at zero affine variety codes. Indeed, they can be defined as \(RM(r,m) := E_{\varDelta ^0_{(r,m)}}\), where \(N_j=q\) for all j and \(\varDelta ^0_{(r,m)}\) corresponds with the exponents of the monomials in the set \(\{f \in R_\emptyset | \deg f \le r\}\), \(\deg f\) meaning the total degree of the unique representative of f of degree less than q in each indeterminate.

The following result extends one given in [7] for \(N_j=q\), \(1 \le j \le m\), and it will be used for describing dual codes of J-affine variety codes.

Proposition 1

Let \(J \subseteq \{ 1 , 2, \ldots , m\}\), consider \(\varvec{a}, \varvec{b} \in {\mathcal {H}}_J\) and let \(X^{\varvec{a}}\) and \(X^{\varvec{b}}\) be two monomials representing elements in \(R_J\). Then, the Euclidean inner product \(\mathrm {ev}_J ( X^{\varvec{a}}) \cdot \mathrm {ev}_J (X^{\varvec{b}})\) is not 0 if, and only if, the following two conditions happen.

  • For every \(j \in J\), it holds that \(a_j + b_j \equiv 0 \mod (N_j -1)\), (i.e., \(a_j = N_j -1 - b_j\) when \(a_j + b_j > 0\) or \(a_j=b_j=0\)).

  • For every \(j \notin J\), it holds that

    • either \(a_j + b_j > 0\) and \(a_j + b_j \equiv 0 \mod (N_j -1)\) (i.e., \(a_j = N_j -1 - b_j\) if   \(0 < a_j, b_j < N_j -1\) or \((a_j,b_j) \in \left\{ (0,N_j -1), (N_j -1,0), (N_j -1,N_j -1) \right\} \) otherwise),

    • or \(a_j = b_j = 0\) and \(p \not | ~ N_j\).

Proof

For \(j=1, 2, \ldots , m\), pick an element \(\xi _j \in {\mathbb {F}}_q\) with order \(N_j-1\); the existence is guaranteed by the fact that \(N_j -1\) divides \(q-1\). Then \(\langle \xi _j \rangle = \{ \xi _j^0 , \xi _j^1 , \ldots , \xi _j^{N_j-1} \} = Z(X_j^{N_j-1} -1)\) and \(\langle \xi _j \rangle \cup \{ 0\} = Z(X_j^{N_j} -X_j)\). By the distributive law, one has that

$$\begin{aligned} \mathrm {ev}_J ( X^{\varvec{a}}) \cdot \mathrm {ev}_J (X^{\varvec{b}}) = \left( \prod _{j \in J} \sum _{\gamma _i \in \langle \xi _j \rangle } \gamma _i^{a_j + b_j} \right) \left( \prod _{j \not \in J} \sum _{\gamma _i \in \langle \xi _j \rangle \cup \{ 0\}} \gamma _i^{a_j + b_j}\right) . \end{aligned}$$

Therefore, the previous product is different from zero if, and only if, every factor is different from zero.

Let us consider \(j \in J\) and assume that \(a_j + b_j > 0\) and \(a_j = N_j -1 - b_j\), then \(a_j + b_j = N_j -1\), and it happens that \(\sum _{\gamma _i \in \langle \xi _j \rangle } \gamma _i^{a_j + b_j} \ne 0 \) because

$$\begin{aligned} \sum _{\gamma _i \in \langle \xi _j \rangle } \gamma _i^{a_j + b_j} = \sum _{\gamma _i \in \langle \xi _j \rangle } \gamma _i^0 = N_j-1 \ne 0 ~(\text {in}~{\mathbb {F}}_q). \end{aligned}$$

The same result holds for \(a_j=b_j=0\). Note that \(N_j -1 \ne 0\) in \({\mathbb {F}}_q\) since \(p \not | ~ N_j -1\). Indeed if \(p ~| ~ N_j -1\), then, as \(N_j -1 | ~ p^r -1\), p had to divide \(p^r -1\) which is false. It remains to show what happens when \(a_j + b_j \not \equiv 0 \mod (N_j -1)\). In this case, \(a_j + b_j = c \ne 0\) in the ring of congruences modulo \(N_j -1\), which we set \(\mathbb {Z}_{N_j-1}\), and the following chain of equalities holds:

$$\begin{aligned} \sum _{\gamma _i \in \langle \xi _j \rangle } \gamma _i^{a_j + b_j} = \sum _{i=0}^{N_j-2} (\xi _j^i)^{c} = \sum _{i=0}^{N_j-2} (\xi _j^c)^{i} = \frac{1-(\xi _j^c)^{N_j-1}}{1 - \xi _j^c} = 0, \end{aligned}$$

which completes the proof for the case \(j \in J\). Notice that \(\xi _j^c \ne 1\) since \(c \ne 0 \) in \(\mathbb {Z}_{N_j-1}\).

To finish, assume \(j \not \in J\). We remark that \(0^k = 0\) for \(k \ne 0\) and \(0^0 = 1\). If \(a_j + b_j >0\) then

$$\begin{aligned} \sum _{\gamma _i \in \langle \xi _j \rangle \cup \{ 0\}} \gamma _i^{a_j + b_j} = \sum _{\gamma _i \in \langle \xi _j \rangle } \gamma _i^{a_j + b_j} \end{aligned}$$

and the corresponding factor will be different from zero if and only if \(a_j + b_j \equiv 0 \mod (N_j -1)\) (by the case \(j \in J\)). However, if \(a_j = b_j =0\), then

$$\begin{aligned} \sum _{\gamma _i \in \langle \xi _j \rangle \cup \{ 0\}} \gamma _i^{a_j + b_j} = 1+ \sum _{\gamma _i \in \langle \xi _j \rangle } \gamma _i^0 = N_j \end{aligned}$$

that will be equal to zero if and only if \(p ~| ~N_j\). \(\square \)

The above result shows that each monomial \(X^{\varvec{a}} = X_1^{a_1} X_2^{a_2}\cdots X_{m}^{a_m}\), \(\varvec{a} \in {\mathcal {H}}\), admits \(2^{\mathrm {card} (Q)}\) monomials \(X^{\varvec{b}}\) such that \(\mathrm {ev}_J (X^{\varvec{a}}) \cdot \mathrm {ev}_J (X^{\varvec{b}}) \ne 0\), where

$$\begin{aligned} Q= \{j \; | \; 1 \le j \le m; a_j = N_j -1\}. \end{aligned}$$

Now, for a set J as above, consider a subset \(\varDelta \) of \({\mathcal {H}}_J\). If \(\varDelta \subseteq \mathcal {H'}\), we define \(\varDelta ^\perp \) as the set

$$\begin{aligned} {\mathcal {H}}_J {\setminus } \{ (N_1 -1 -a_1, N_2 -1 - a_2, \ldots , N_m- 1 -a_m) \; | \; \varvec{a} \in \varDelta \}. \end{aligned}$$

Otherwise, i.e., in our monomials there is an exponent of some \(X_j\) equal to \(N_j-1\), \(\varDelta ^\perp \) is defined as

$$\begin{aligned}&{\mathcal {H}}_J{\setminus } \left\{ \{ (N_1 -1 -a_1, N_2 -1 -a_2, \ldots , N_m -1-a_m ) \right. \\&\left. \quad | \varvec{a} \in \varDelta \cap \mathcal {H'} \} \cup \{ \varvec{a}' | \varvec{a} \in \varDelta , \varvec{a} \notin \mathcal {H'} \} \right\} , \end{aligned}$$

where \(a'_j = N_j -1 -a_j\) if \(a_j \ne N_j -1\) and \(a'_j\) equals either \(N_j -1\) or 0 otherwise. Notice that an element \(\varvec{a} \in \varDelta \), \(\varvec{a} \not \in \mathcal {H'}\), determines several values \(\varvec{a}'\).

This definition allows us to state the following straightforward result:

Proposition 2

Consider a set \(\varDelta \subseteq {\mathcal {H}}_J\) as above.

  1. (1)

    If the following inclusion \(\varDelta \subseteq \mathcal {H'}\) happens, then the equality of codes \((E^J_\varDelta )^\perp = E^J_{\varDelta ^\perp }\) holds, where \((E^J_\varDelta )^\perp \) denotes the dual code of \(E^J_\varDelta \).

  2. (2)

    Otherwise, if \(\varDelta \not \subseteq \mathcal {H'}\), then \(E^J_{\varDelta ^\perp } \subseteq (E^J_\varDelta )^\perp \).

Remark 1

When considering \(\{1,2, \ldots ,m\}\)-affine variety codes, the defining set \(\varDelta \) must satisfy \(\varDelta \subseteq \mathcal {H'}\). Thus the same reasoning as above shows that \((E^{\{1,2, \ldots ,m\}}_\varDelta )^\perp = E^{\{1,2, \ldots ,m\}}_{\varDelta ^\perp }\).

2.2 Subfield-subcodes of J-affine variety codes

In this section, we show some results concerning dimension and self-orthogonality with respect to Euclidean inner product of subfield-subcodes of J-affine variety codes.

Recall that \(q=p^r\) and pick a positive integer s such that s divides r. With the above notations, consider the set \({\mathcal {H}}_J\) and recall that \(N_j -1\) divides \(q -1\) for all j such that \(1 \le j \le m\). Next we define three trace type maps which will be useful: \(\mathrm {tr}_r^s: {\mathbb {F}}_{p^r} \rightarrow {\mathbb {F}}_{p^s}\) defined as \(\mathrm {tr}_r^s(x)= x + x^{p^s} + \cdots + x^{p^{s(\frac{r}{s}-1)}}\); \(\mathbf {tr}: {\mathbb {F}}_{p^{r}}^{n_J} \rightarrow {\mathbb {F}}_{p^{s}}^{n_J}\), determined by \(\mathrm {tr}_r^s\) componentwise and \(\mathcal {T}: R_J \rightarrow R_J\), \(\mathcal {T}(f) = f + f^{p^s} + \cdots + f^{p^{s(\frac{r}{s}-1)}}\).

For \(1 \le j \le m\), consider the above-defined integer numbers \(T_j\) and, as before, denote by \(\mathbb {Z}_{T_j}\) the quotient ring \(\mathbb {Z}/T_j \mathbb {Z}\). In this section, we will consider cyclotomic sets that are subsets \(\mathfrak {I}\) of the cartesian product \(\mathbb {Z}_{T_1}\times \mathbb {Z}_{T_2} \times \cdots \times \mathbb {Z}_{T_m}\) such that \( \mathfrak {I}= \{p^s \cdot \varvec{a} \;| \; \varvec{a}\in \mathfrak {I}\} \), where \(p^s \cdot \varvec{a} = (p^s a_1, p^s a_2, \ldots , p^s a_m)\). A cyclotomic set \(\mathfrak {I}\) is minimal (for the above given exponent s) whenever all the elements in \(\mathfrak {I}\) can be expressed as \(p^{s i } \cdot \varvec{a}\) for some fixed element \(\varvec{a} \in \mathfrak {I}\) and some nonnegative integer i. Consider a set \(\mathcal {A}\) representing the minimal cyclotomic sets, that is pick \(\mathbf {a} \in \mathfrak {I}\) for each minimal cyclotomic set in such a way that \( \mathfrak {I} = \mathfrak {I}_\mathbf {a}\) for some \(\mathbf {a} \in \mathcal {A}\). Thus, the set of minimal cyclotomic sets will be \(\{ \mathfrak {I}_\mathbf {a}\}_{\mathbf {a} \in \mathcal {A}}\). Moreover, set \(i_\mathbf {a} : = \mathrm {card}(\mathfrak {I}_\mathbf {a})\).

The subfield-subcodes (over \({\mathbb {F}}_{p^s}\)) of our J-affine variety codes \(E^J_\varDelta \) are defined as \(E^{J,\sigma }_\varDelta := E^J_\varDelta \cap {\mathbb {F}}_{p^s}^{n_J}\). We write \(C^J_\varDelta \) (respectively, \(C^{J,\sigma }_\varDelta \)) the dual code of \(E^{J}_\varDelta \) (respectively, \(E^{J,\sigma }_\varDelta \)). Moreover, an element \(f \in R_J\) evaluates to \({\mathbb {F}}_{p^s}\) whenever \(f(\varvec{a}) \in {\mathbb {F}}_{p^s}\) for all \(\varvec{a} \in Z_J\). Notice that this happens if and only if \(f = \mathcal {T}(g)\) for some \(g \in R_J\). Now we are ready to state the following result that determines the dimension of the subfield-subcodes \(E^{J,\sigma }_\varDelta \). It can be proved reasoning as in [19, Theorem 3].

Theorem 4

Let \(\beta _\mathbf {a}\) be a primitive element of the finite field \({\mathbb {F}}_{p^{si_\mathbf {a}}}\) and set \(\mathcal {T}_\mathbf {a} : R_J \rightarrow R_J\) the mapping defined as \(\mathcal {T}_\mathbf {a}(f) = f + f^{p^s} + \cdots + f^{p^{s(i_\mathbf {a} -1)}}\). Consider a set \(\varDelta \subseteq {\mathcal {H}}_J\). Then, the vector space \(E^{J,\sigma }_\varDelta \) is generated by the images under the evaluation map \(\mathrm {ev}_J\) of the following elements in \(R_J\): \(\bigcup _{\mathbf {a} \in \mathcal {A}| \mathfrak {I}_\mathbf {a}\subseteq \varDelta } \left\{ \mathcal {T}_{\mathbf {a}} (\beta _\mathbf {a}^{l} X^\mathbf {a}) \; | \; 0 \le l \le i_\mathbf {a}-1 \right\} \).

Next, we provide a result concerning the dimension of the dual code \(C^{J,\sigma }_\varDelta \).

Theorem 5

Let \(\varDelta \) be a subset of \({\mathcal {H}}_J\). Consider the dual code \(C_\varDelta ^{J,\sigma }\) of the subfield-subcode \(E_\varDelta ^{J,\sigma }\). Then:

  1. (1)

    The dimension of the code \(C_\varDelta ^{J,\sigma }\) satisfies the inequality

    $$\begin{aligned} \dim (C_\varDelta ^{J,\sigma }) \ge \sum _{\mathbf {a} \in \mathcal {A}| \mathfrak {I}_\mathbf {a} \cap \varDelta ^\perp \ne \emptyset } i_\mathbf {a}. \end{aligned}$$
  2. (2)

    If \(\mathfrak {I}_\mathbf {a} \cap \varDelta ^\perp \ne \emptyset \) whenever \(\mathfrak {I}_\mathbf {a} \subseteq \varDelta \), then the inclusion \(E_\varDelta ^{J,\sigma } \subseteq C_\varDelta ^{J,\sigma }\) holds.

  3. (3)

    Assume that \(\varDelta \) is a subset of \(\mathcal {H'}\). Then we get an equality in (1), and the conditions given in (2) are equivalent.

Proof

We keep the above notation and recall that \(E^J_{\varDelta ^\perp } \subseteq (E^J_{\varDelta })^\perp \). Moreover \((E_\varDelta ^{J,\sigma })^\perp = \mathbf {tr} (E_\varDelta ^{J})^\perp \) holds by Delsarte theorem [11]. Therefore, we get \( \mathbf {tr} (E^J_{\varDelta ^\perp }) \subseteq (E_\varDelta ^{J,\sigma })^\perp \). Set \({\mathbb {F}}_{p^r}^{\varDelta ^\perp }\) the vector space over the field \({\mathbb {F}}_{p^r}\) of polynomials generated by monomials with exponents in \(\varDelta ^\perp \), which is generated by the set \(\{ \mathcal {T} (\gamma X^{\mathbf {a}}\}_{\mathbf {a} \in \varDelta ^\perp , \gamma \in {\mathbb {F}}_{p^r}}\). Taking into account that \(\mathrm {ev} \circ \mathcal {T} = \mathbf {tr} \circ \mathrm {ev}\), we deduce that \(\mathrm {ev} \left( \mathcal {T} ({\mathbb {F}}_{p^r}^{\varDelta ^\perp })\right) = \mathbf {tr} (E^J_{\varDelta ^\perp })\) which concludes the proof of items (1) and (2). Item (3) follows from the same reasoning and the equality \(E^J_{\varDelta ^\perp } = (E^J_{\varDelta })^\perp \). \(\square \)

2.3 Results on stabilizer codes

The results and ideas in Sects. 2.1 and 2.2 together with Theorem 1 prove the following result which, keeping the notations as above, states some results for stabilizer codes constructed with J-affine variety codes.

Theorem 6

Let \(N_j\), \(1 \le j \le m\), be positive integers such that \(N_j -1 \) divides \(q -1\) for all index j. Let \(\varDelta \) be a subset of the above-defined set \({\mathcal {H}}_J\). Then:

  1. (1)

    Assume the set inclusion \(\varDelta \subseteq \varDelta ^\perp \). Then, a stabilizer code coming from \(E_\varDelta ^J\) can be constructed. Its parameters are \([[n_J, k, \ge d]]_q\), where \(n_J = \prod _{j \not \in J} N_j \prod _{j \in J} (N_j-1)\), \(k= n_J - 2 \; \mathrm {card} (\varDelta )\) and \(d= d\left( (E_\varDelta ^J)^\perp \right) \).

  2. (2)

    Consider s a positive integer that divides r and subfield-subcodes with respect to the field \({\mathbb {F}}_{p^s}\). Assume that \(\mathfrak {I}_\mathbf {a} \cap \varDelta ^\perp \ne \emptyset \) whenever \(\mathfrak {I}_\mathbf {a} \subseteq \varDelta \). Then, a stabilizer code coming from \(E_\varDelta ^{J,\sigma }\) can be constructed. Its parameters are \([[n_J, \ge k, \ge d]]_{p^s}\), where \(n_J\) is as above, \(k= 2 \sum _{\mathbf {a} \in \mathcal {A}| \mathfrak {I}_\mathbf {a} \cap \varDelta ^\perp \ne \emptyset } i_\mathbf {a} - n_J\) and \(d= d\left( (E_\varDelta ^{J,\sigma })^\perp \right) \).

  3. (3)

    Let s and \(\varDelta \) be as in (2). Suppose also that \(\varDelta \subseteq {\mathcal {H}}'\). Then, the parameters of the corresponding stabilizer code are \([[n_J, k, \ge d]]_{p^s}\), where \(n_J = \prod _{j \not \in J} N_j \prod _{j \in J} (N_j-1)\), \(k = n_J -2 \; \sum _{\mathfrak {I}_\mathbf {a} |\mathfrak {I}_\mathbf {a} \subseteq \varDelta } i_\mathbf {a}\) and \(d= d\left( (E^{J,\sigma }_\varDelta )^\perp \right) \).

Notice that the condition \(\varDelta \subseteq \varDelta ^\perp \) for sets \(\varDelta \) containing the element \(\varvec{0}\) can only happen when \(p \mid N_j\), for some \(j \notin J\).

Later, in Sect. 4, we will provide some examples of quantum codes with good parameters. Now, without any pretension on parameters and only for ease of reading, we give a simple example of stabilizer codes constructed with the tools of this section.

Example 1

With the above notation, consider \(p=2, r=4, m=2, N_1=4, N_2=6\) and set \(J=\{2\} \subseteq \{1,2\}\). It is clear that \(R_J = {\mathbb {F}}_{q}[X_1, X_2]/\langle X_1^4 -X_1, X_2^5 - 1\rangle \), \(T_1=3\), \(T_2 = 4\), \({\mathcal {H}}_J =\{0,1,2,3\} \times \{0,1,2,3,4\}\) and \(\mathcal {H'} =\{0,1,2\} \times \{0,1,2,3,4\}\).

If we consider the subset of \({\mathcal {H}}_J\)

$$\begin{aligned} \varDelta := \{(0,1), (0,2),(0,3),(0,4),(1,2),(1,3),(2,0),(2,1),(2,4)\}, \end{aligned}$$

then it is clear that \(\varDelta \subseteq \mathcal {H'}\) and by the paragraph before Proposition 2, \(\varDelta ^\perp = \varDelta \cup \{(0,0), (3,0)\}\). Then \(\varDelta \subseteq \varDelta ^\perp \), Items (1) in Proposition 2 and Theorem 6 and [36] determine a \([[20, 20 -2\cdot 9,4]]_{16}\) code because the cardinality of \(\varDelta \) is nine.

With respect to subfield-subcodes, set \(s=1\), then the minimal cyclotomic sets are: \(\mathfrak {I}_{(0,0)} = \{(0,0)\}\), \(\mathfrak {I}_{(0,1)} = \{(0,1),(0,2),(0,3),(0,4)\}\), \(\mathfrak {I}_{(1,0)} = \{(1,0),(2,0)\}\), \(\mathfrak {I}_{(1,1)} = \{(1,1),(2,2),(1,4),(2,3)\}\), \(\mathfrak {I}_{(1,2)} = \{(1,2),(2,4),(1,3),(2,1)\}\), \(\mathfrak {I}_{(3,0)} = \{(3,0)\}\), \(\mathfrak {I}_{(3,1)} = \{(3,1),(3,2),(3,3),(3,4)\}\). Consider the set \(\varDelta _1 = \mathfrak {I}_{(0,1)} \cup \mathfrak {I}_{(1,2)}\), where \(i_{(0,1)}=4, i_{(1,2)}=4\) and as, \((0,1) \in \mathfrak {I}_{(0,1)} \cap \varDelta _1^\perp \) and \((1,2) \in \mathfrak {I}_{(1,2)} \cap \varDelta _1^\perp \), the inclusion \(E_{\varDelta _{1}}^{J,\sigma } \subseteq C_{\varDelta _{1}}^{J,\sigma }\) holds by Item (2) of Theorem 5. Finally, \(\varDelta _1 \subseteq \mathcal {H'}\) and Statement (3) in Theorem 6 shows that we can construct a \([[20, 20 -2\cdot (4+4),4]]_{2}\) stabilizer code.

3 Stabilizer J-affine variety codes: Hermitian inner product

We have just studied stabilizer codes determined by J-affine variety codes which are self-orthogonal with respect to the Euclidean inner product. Next we describe what happens when one considers the Hermitian inner product.

3.1 Hermitian duality for affine variety codes

In this section, our ring of polynomials is \({\mathbb {F}}_{q^2}[X_1, X_2, \ldots , X_m]\) where, as above, \(q= p^r\) and fix m integers \(N_j >1\), \(1 \le j \le m\), such that each \(N_j -1\) divides \(q^2-1\). Following Sect. 2.1, we define the rings \(R_J\) as quotients of the above ring. Now we state our first result.

Proposition 3

Let \(J \subseteq \{ 1 , 2, \ldots , m\}\), consider \(\varvec{a}, \varvec{b} \in {\mathcal {H}}_J\) and let \(X^{\varvec{a}}\) and \(X^{\varvec{b}}\) be two monomials representing elements in \(R_J\). Then, the Hermitian inner product \(\mathrm {ev}_J ( X^{\varvec{a}}) \cdot _h \mathrm {ev}_J (X^{\varvec{b}})\) is not 0 if, and only if, the following two conditions happen.

  • For every \(j \in J\), it holds that \(q a_j + b_j \equiv 0 \mod (N_j -1)\), (i.e., \(b_j = - q a_j + \lambda (N_j -1)\), for some \(\lambda \ge 0\)).

  • For every \(j \notin J\), it holds that

    • either \(a_j + b_j > 0\) and \(q a_j + b_j \equiv 0 \mod (N_j -1)\) (i.e., \(b_j = - q a_j + \lambda (N_j -1)\), for some \(\lambda > 0\), if \(0 < a_j, b_j < N_j -1\), or \((a_j,b_j) \in \left\{ (0,N_j -1), (N_j -1,0), (N_j -1,N_j -1) \right\} \), otherwise);

    • or \(a_j = b_j = 0\) and \(p \not | ~ N_j\).

Proof

It follows from Proposition 1 after taking into account that \(\mathrm {ev}_J ( X^{\varvec{a}}) \cdot _h \mathrm {ev}_J (X^{\varvec{b}})= \mathrm {ev}_J ( X^{\varvec{a}}) \cdot \mathrm {ev}_J (X^{q \cdot \varvec{b}})\), and \(a_j + q b_j \equiv 0 \mod (N_j -1)\) if, and only if, \(b_j \equiv -q a_j \mod (N_j -1)\). Notice that this last equivalence happens because \(N_j-1\) divides \(q^2-1\) and thus q is the inverse of q modulo \(N_j -1\). \(\square \)

Consider a set \(\varDelta \subseteq {\mathcal {H}}_J\) and an element \(\mathbf {a}\) in \(\varDelta \) as in Sect. 2. Recall that, now, our field is \({\mathbb {F}}_{q^2}\). Suppose that \(\varDelta \subseteq \mathcal {H'}\), and, for each j, set \([-qa_j]_{N_j -1}\) a suitable representant of the congruence class modulo \(N_j -1\) given by \(-q a_j\). Then, we define \(\varDelta ^{\perp _h}\) as the set

$$\begin{aligned} {\mathcal {H}}_J {\setminus } \{ ([-qa_1]_{N_1 -1}, [-qa_2]_{N_2 -1}, \ldots , [-qa_m]_{N_m- 1})\; | \; \varvec{a} \in \varDelta \}. \end{aligned}$$

Otherwise, \(\varDelta ^{\perp _h}\) is defined as

$$\begin{aligned}&{\mathcal {H}}_J {\setminus } \left\{ \{ ([-qa_1]_{N_1 -1}, [-qa_2]_{N_2 -1}, \ldots , [-qa_m]_{N_m- 1}) | \varvec{a}\right. \\&\left. \quad \in \varDelta \cap \mathcal {H'} \} \cup \{ \varvec{a}' | \varvec{a} \in \varDelta , \varvec{a} \notin \mathcal {H'} \} \right\} , \end{aligned}$$

where \(\varvec{a}'\) is a multi-valued vector defined by \(a'_j = [-qa_j]_{N_j -1}\) if \(a_j \notin \{ 0, N_j -1\)}, \(a'_j\) is equal to \(N_j -1\) if \(a_j=0\) and \(a'_j\) admits two values which are \(N_j -1\) and 0 if \(a_j = N_j-1\).

Next we give a result about Hermitian duality of our codes which can be deduced from Proposition 3.

Proposition 4

Let \(\varDelta \subseteq {\mathcal {H}}_J\) be as above.

  1. (1)

    Assume \(\varDelta \subseteq \mathcal {H'}\). Then the equality of codes \((E^J_\varDelta )^{\perp _h} = E^J_{\varDelta ^{\perp _h}}\) holds.

  2. (2)

    Otherwise, \(\varDelta \not \subseteq \mathcal {H'}\), it happens that \(E^J_{\varDelta ^{\perp _h}} \subseteq (E^J_\varDelta )^{\perp _h}\).

A necessary condition for the inclusion of a generalized Reed–Muller code over \({\mathbb {F}}_{q^2}\) into its Hermitian dual is given in [40]. We conclude this section with the following result which proves that such a condition is also sufficient.

Proposition 5

Set \(RM_{q^2}(r,m)\) the (rm)-generalized Reed–Muller code over the finite field \({\mathbb {F}}_{q^2}\). Then, the codes’ inclusion \(RM_{q^2}(r,m) \subseteq \left( RM_{q^2}(r,m) \right) ^{\perp _h}\) holds if, and only if, \(0 \le r \le m(q-1) -1\).

Proof

By [40], it suffices to prove that \(r > m(q-1) -1\) implies

$$\begin{aligned} RM_{q^2}(r,m) \not \subseteq \left( RM_{q^2}(r,m) \right) ^{\perp _h}. \end{aligned}$$

Indeed, consider the m-tuple \(\mathbf {q-1} = (q-1,q-1, \ldots , q-1)\) that provides the monomial \(X^{\mathbf {q-1}}\). Clearly \(\mathrm {ev}_\emptyset (X^{\mathbf {q-1}}) \in RM_{q^2}(r,m)\), however \(\mathrm {ev}_\emptyset (X^{\mathbf {q-1}}) \not \in \left( RM_{q^2}(r,m)\right) ^{\perp _h}\) because \(q-1 + q(q-1) = q^2 -1\) which, by Proposition 3, proves that \(\mathrm {ev}_\emptyset (X^{\mathbf {q-1}}) \cdot _h \mathrm {ev}_\emptyset (X^{\mathbf {q-1}}) \ne 0\). This concludes the proof. \(\square \)

3.2 Results on stabilizer codes using Hermitian inner product

In this section, we prove that, considering duality with respect to the inner Hermitian product, an analogous result to Theorem 6 holds. As above, \(q=p^r\) and s is a positive integer that divides r. The ground field of our evaluation codes is \({\mathbb {F}}_{q^2}\), and we consider subfield-subcodes over \({\mathbb {F}}_{p^{2s}}\). Recall that \(N_j -1\) divides \(q^2 -1\) for all j. The trace maps are defined as: \(\mathrm {tr}_{2r}^{2s}: {\mathbb {F}}_{p^{2r}} \rightarrow {\mathbb {F}}_{p^{2s}}\), \(\mathrm {tr}_{2r}^{2s}(x)= x + x^{p^{2s}} + \cdots + x^{p^{2s(\frac{r}{s}-1)}}\); \(\mathbf {tr}: {\mathbb {F}}_{p^{2r}}^{n_J} \rightarrow {\mathbb {F}}_{p^{2s}}^{n_J}\), determined by \(\mathrm {tr}_{2r}^{2s}\) componentwise and \(\mathcal {T}: R_J \rightarrow R_J\), \(\mathcal {T}(f) = f + f^{p^{2s}} + \cdots + f^{p^{2s(\frac{r}{s}-1)}}\).

Let us state our before-mentioned result for codes constructed using the Hermitian inner product.

Theorem 7

Let \(N_j\), \(1 \le j \le m\), be positive integers such that \(N_j -1 \) divides \(p^{2r} -1\) for all index j. Let \(\varDelta \) be a subset of the above-defined set \({\mathcal {H}}_J\).

  1. (1)

    Assume the set inclusion \(\varDelta \subseteq \varDelta ^{\perp _h}\). Then, a stabilizer code coming from \(E_\varDelta ^J\) can be constructed, and their parameters can be obtained with the same formulae given in Item (1) of Theorem 6 but replacing \(\perp \) with \(\perp _h\).

  2. (2)

    Consider a positive integer s dividing r and subfield-subcodes with respect to the field \({\mathbb {F}}_{p^{2s}}\). Assume that \(\mathfrak {I}_\mathbf {a} \cap \varDelta ^{\perp _h} \ne \emptyset \) whenever \(\mathfrak {I}_\mathbf {a} \subseteq \varDelta \). Then, a stabilizer code coming from \(E_\varDelta ^{J,\sigma }\) can be constructed. Formulae in Item (2) (respectively (3), whenever \(\varDelta \subseteq \mathcal {H'}\)) of Theorem 6, replacing \(\perp \) with \(\perp _h\), determine the parameters of these codes.

Proof

Item (1) follows from Statement (2) of Theorem 1 and similar arguments to those given in Sect. 2. With respect to Item (2), we prove our second statement since the unique difference with respect to the first one relies in Proposition 4 and we can only ensure \((E_\varDelta ^{J})^{\perp _h} = E_{\varDelta ^{\perp _h}}\) when \(\varDelta \subseteq \mathcal {H'}\).

Delsarte theorem is stated for Euclidean dual. Let us show that it is true in our case and so our result is proved with the same arguments given in Sect. 2 and (2) of Theorem 1. We start by proving the inclusion \((E_\varDelta ^{J,\sigma })^{\perp _h} \supseteq \mathbf {tr} (E_\varDelta ^{J})^{\perp _h} \). Indeed, to do it, it suffices to take \(\mathbf {a} \in (E_\varDelta ^{J})^{\perp _h}\) and \(\mathbf {b} \in E_\varDelta ^{J,\sigma }\) and consider the following chain of equalities

$$\begin{aligned} \mathbf {tr}(\mathbf {a}) \cdot _h \mathbf {b}= \mathbf {tr}(\mathbf {a}) \cdot \mathbf {b}^q = \mathrm {tr}_{2r}^{2s}(\mathbf {a} \cdot \mathbf {b}^q) = \mathrm {tr}_{2r}^{2s}(\mathbf {a} \cdot _h \mathbf {b}) = \mathrm {tr}_{2r}^{2s} (0) = 0. \end{aligned}$$

Finally, we prove that the dimensions of the vector spaces over \({\mathbb {F}}_{p^{2s}}\), \((E_\varDelta ^{J,\sigma })^{\perp _h}\) and \(\mathbf {tr} (E_\varDelta ^{J})^{\perp _h} \), coincide, which concludes the proof. Write \(\varDelta = \varDelta _1 \cup \varDelta _2\) where \(\varDelta _1\) is the union of the minimal cyclotomic sets \(\mathfrak {I}_\mathbf {a}\) which are included in \(\varDelta \). \(\varDelta _2\) does not contain any complete set \(\mathfrak {I}_\mathbf {a}\). Theorem 4 proves that the dimension of the vector space \((E_\varDelta ^{J,\sigma })^{\perp _h}\) is \(n_J - \mathrm {card} \; \varDelta _1\). Now, consider the set \( {\mathcal {H}}_J {\setminus } \{ ([-qa_1]_{N_1 -1}, [-qa_2]_{N_2 -1}, \ldots , [-qa_m]_{N_m- 1})\; | \; \varvec{a} \in \varDelta \}\) and notice that the set of tuples \(([-qb_1]_{N_1 -1}, [-qb_2]_{N_2 -1}, \ldots , [-qb_m]_{N_m- 1})\), defined by the elements \(\varvec{b}\) in a minimal cyclotomic set \(\mathfrak {I}_\mathbf {a}\), determine a minimal cyclotomic set of the same size, which we denote \(\mathfrak {I}_{-q\mathbf {a}}\). Moreover, \(\mathfrak {I}_\mathbf {a} \ne \mathfrak {I}_\mathbf {a'}\) implies \(\mathfrak {I}_{-q\mathbf {a}} \ne \mathfrak {I}_{-q\mathbf {a'}}\). Taking into account that

$$\begin{aligned} \dim \mathbf {tr} (E_\varDelta ^{J})^{\perp _h} = \sum _{\mathbf {a} \in \mathcal {A}| \mathfrak {I}_\mathbf {a} \cap \varDelta ^{\perp _h} \ne \emptyset } i_\mathbf {a} \end{aligned}$$

and that \(\mathfrak {I}_\mathbf {a} \cap \varDelta ^{\perp _h} = \emptyset \) if, and only if, \(\mathbf {a} = - q \mathbf {c}\), \(\mathfrak {I}_\mathbf {c} \subset \varDelta _1\), we deduce that \(\dim \mathbf {tr} (E_\varDelta ^{J})^{\perp _h} = n_J - \mathrm {card} \; \varDelta _1\) and our proof is finished. \(\square \)

We remark that, as in the previous section, the condition \(\varDelta \subseteq \varDelta ^{\perp _h}\) for sets \(\varDelta \) containing the element \(\varvec{0}\) can only happen when \(p \mid N_j\), for some \(j \notin J\).

As above, we give an example only to facilitate the readability of this section. Examples with good parameters will be found in the next section.

Example 2

With the previous notations, set \(p=2, r=4, s=2, N_1=4, N_2=6\). Also, \(m=2\) and \(J=\{2\}\). We deduce our example from the second statement in Theorem 7. The minimal cyclotomic sets are \(\{(0,0)\}\), \(\{(0,1),(0,4)\}\), \(\{(0,2),(0,3)\}\), \(\{(1,0)\}\), \(\{(1,4),(1,1)\}\), \(\{(1,3),(1,2)\}\), \(\{(2,0)\}\), \(\{(2,1),(2,4)\}\), \(\{(2,2),(2,3)\}\), \(\{(3,0)\}\), \(\{(3,2),(3,3)\}\), \(\{(3,4),(3,1)\}\). The set \(\varDelta \) in Example 1 cannot be used now, since \((\mathfrak {I}_{(2,0)} = \{(2,0)\}) \cap \varDelta ^{\perp _h} = \emptyset \). To prove it, it suffices to recall that \(s=2\) and to apply the paragraph after the proof of Proposition 3.

Finally, consider the three minimal cyclotomic sets \(\mathfrak {I}_{(0,1)}= \{(0,1),(0,4)\}\), \(\mathfrak {I}_{(0,2)}= \{(0,2),(0,3)\}\), \(\mathfrak {I}_{(2,1)}= \{(2,1),(2,4)\}\) and the set \(\varDelta _2= \mathfrak {I}_{(0,1)} \cup \mathfrak {I}_{(0,2)} \cup \mathfrak {I}_{(2,1)}\) which satisfies the requirements in Theorem 7 because, by the above-mentioned paragraph, to determine the Hermitian dual, each element in \(\varDelta _2\) erases from \({\mathcal {H}}_J\) another one which is not in \(\varDelta _2\). For instance, (0, 4) and (2, 4), erase (3, 2) and (2, 2), respectively. Each minimal cyclotomic set has two elements and therefore, by [36] and Item (2) in Theorem 7, we get a \([[20, 20 -2 (2+2+2),3]]_2\) code.

We conclude this section with a short remark on decoding of our codes.

Remark 2

Since classical methods of error correction can be adapted to decode quantum codes [10, 38, 47], we briefly comment on the decoding of affine variety codes. The literature contains some decoding procedures for affine variety codes [18, 37], a subclass of J-affine variety codes, which we believe that could be easily adapted to decode J-affine variety codes as well. More efficient decoding procedures, which correct up to the Feng–Rao bound, have been described for affine variety codes defined by order functions (see [25] and references therein). It would be interesting to get self-orthogonal order domain codes providing good stabilizer codes, and investigate whether our examples are given by codes of this type.

4 Some good quantum codes

4.1 Stabilizer codes with Euclidean inner product

We devote this section to give some examples of stabilizer codes obtained applying Theorems 2, 3 and 6, with the help of [36]. We first provide parameters of some stabilizer codes over \({\mathbb {F}}_2\). These codes come from subfield-subcodes of J-affine variety codes. With the above notation, set \(p=2\), \(r=7\), \(s=1\), \(N_1=128\) and consider codes \({\mathcal {C}}_i = C^\sigma _{\varDelta _i}\), \(\hat{{\mathcal {C}}}_i = C^\sigma _{\hat{\varDelta }_i}\), \(i=1,2\) and \({\mathcal {C}}_3 = C^\sigma _{\varDelta _3}\), where we have omitted the super-index \(J=\{1\}\). Table 1 shows their defining sets \(\varDelta \) and parameters (as linear codes).

Table 1 J-affine variety codes over \({\mathbb {F}}_2\)

Theorem 3 applied to these codes provides the stabilizer code \(C_1\). Table 2 displays the parameters of this stabilizer quantum code and several expurgations. According to [27], the parameters of the codes in Table 2 improve the parameters of the best known binary quantum codes, and thus they are records.

Table 2 New records of quantum codes over \({\mathbb {F}}_2\)

Consider now \({\mathbb {F}}_3\) as a ground field. Table 4 shows defining sets, values \(p, r, s, N_j\) and sets J as above defined to determine stabilizer codes coming from subfield-subcodes of J-affine variety codes. They are obtained following Item (3) in Theorem 6. The corresponding parameters are displayed in Table 3. Parameters of the codes given by Steane enlargement, SE, can be seen in Table 5. Notice that all these codes exceed the different known versions of the (quantum) Gilbert–Varshamov bound [13, 17, 39], [32, Lemma 31], which is noted in the tables by saying that are of type GV.

Table 3 Stabilizer codes over \({\mathbb {F}}_3\)
Table 4 Defining sets of J-affine variety codes over \({\mathbb {F}}_3\)
Table 5 Stabilizer codes over \({\mathbb {F}}_3\) exceeding the Gilbert–Varshamov bounds. Obtained from codes \(C_i\), \(1 \le i \le 6\), in Table 3

Finally, we use Theorem 3 to give a stabilizer code C over the field \({\mathbb {F}}_4\) with parameters \([[63,45, {\ge } 6]]_4\), which is of type GV. Notice that La Guardia in [33] (see also [30]) gives two stabilizer codes with parameters \([[63,42, {\ge }6]]_4\) and \([[63,46, {\ge }5]]_4\). Our code improves the first one and has relative parameters better than the second one. To construct C, it suffices to take values \(p=2\), \(r=6\), \(s=2\) and \(N_1=64\) and apply Theorem 3 with respect to the affine variety codes \({\mathcal {C}}_i = C^\sigma _{\varDelta _i}\), \(\hat{{\mathcal {C}}}_i = C^\sigma _{\hat{\varDelta }_i}\), \(i=1,2\) and \({\mathcal {C}}_3 = C^\sigma _{\varDelta _3}\), again the super-index \(J=\{1\}\) is omitted. Table 6 shows the sets \(\varDelta \) and their parameters. Notice that codes and parameters in Table 6 correspond to linear codes.

Table 6 J-affine variety codes over \({\mathbb {F}}_4\) that produce a \([[63,45, {\ge }6]]_4\) quantum code by Theorem 3
Table 7 Stabilizer codes over \({\mathbb {F}}_2\)
Table 8 Defining sets of the codes over \({\mathbb {F}}_2\) in Table 7

4.2 Stabilizer codes with the Hermitian inner product

This section gives examples of stabilizer codes obtained following Theorem 7. They are constructed from subfield-subcodes of J-affine variety codes, and we have considered duality with respect to the Hermitian inner product. We group them in tables corresponding to the same ground field. We display first the parameters and the type (GV or not) and afterward the defining set \( \varDelta \) and the corresponding values \(p, r, s, N_j\) and sets J. Tables 7 and 8 (respectively Tables 9 and 10, 11 and 12, 13 and 14, 15 and 16) correspond to stabilizer codes over \({\mathbb {F}}_2\) (respectively, \({\mathbb {F}}_3\), \({\mathbb {F}}_4\), \({\mathbb {F}}_5\), \({\mathbb {F}}_7\)).

We conclude by adding that the codes in Sect. 4 improve the parameters of those codes in [14] which have the same length. In addition, our code in Table 15 with parameters \([[144,134, {\ge }4]]_7\) also improves the parameters \([[144,132, {\ge }4]]_7\) which can be obtained by applying [34, Theorem 39].

Table 9 Stabilizer codes over \({\mathbb {F}}_3\)
Table 10 Defining sets of the codes over \({\mathbb {F}}_3\) in Table 9
Table 11 Stabilizer codes over \({\mathbb {F}}_4\) exceeding the Gilbert–Varshamov bounds
Table 12 Defining sets of the codes over \({\mathbb {F}}_4\) in Table 11
Table 13 Stabilizer codes over \({\mathbb {F}}_5\) exceeding the Gilbert–Varshamov bounds
Table 14 Defining sets of the codes over \({\mathbb {F}}_5\) in Table 13
Table 15 Stabilizer codes over \({\mathbb {F}}_7\) exceeding the Gilbert–Varshamov bounds