1 Introduction

Affine variety codes [1] are linear codes obtained evaluating multivariate polynomials at the \({{\mathbb {F}}}_q\)-rational points of a certain affine variety. Since any linear code can be described as an affine variety code (see [1, Prop 1.4]), such codes constitute the entire class of linear codes. Even though it is easy to determine the length and the dimension of an affine variety code, a more difficult task is to provide estimates on the minimum distance, or, more generally, on the weight distribution of the code. Still, computing the planar intersections of the chosen variety with some low-degrees ones is often useful in obtaining information on the weight spectrum and the weight distribution of affine-variety codes, see for example [2,3,4,5,6].

Given any linear code C, another challenging task is the determination of the set of its minimal codewords. For a codeword \(c\in C\), the support of c, denoted by \(\mathrm {Supp(c)}\), is the set of its nonzero coordinate positions, and the weight of c is \(\textrm{wt}(c)=\#\mathrm {Supp(c)}\). If the support of a codeword c contains the support of another codeword \(c^\prime \), then we will say that c covers \(c^\prime \). A codeword c is said to be minimal if it covers only the proportional codewords, i.e. if \(c^\prime \in C\) is linearly independent from c, then \(\mathrm {Supp(c^\prime )}\not \subseteq \mathrm {Supp(c)}\). Minimal codewords were employed by Massey [7] for the construction of a secret sharing scheme. For this reason, in recent years, several papers have been dedicated to the determination of the minimal codewords of a linear code [8,9,10,11,12,13,14,15,16,17].

In this paper, we give information on the weight distribution and the minimal codewords of affine variety codes arising from the Norm-Trace curve, as already investigated in the literature; see [18,19,20].In more detail, throughout the paper we consider the affine variety code \(C_{q,r,k}\) obtained evaluating the polynomials

$$\begin{aligned} b y=a_kx^k+\ldots +a_1x+a_0, \end{aligned}$$
(1)

where \(b,a_i\in {\mathbb {F}}_{q^r}\), at the affine \({\mathbb {F}}_{q^r}\)-rational points of the Norm-Trace curve \({\mathcal {N}}_{q,r}\), that is the plane curve defined by the affine equation

$$\begin{aligned} x^{\frac{q^r-1}{q-1}}=y^{q^{r-1}}+y^{q^{r-2}}+\ldots +y^q+y. \end{aligned}$$
(2)

Note that, up to rescaling, we can assume that the polynomials as in (1) are either of type

$$\begin{aligned} y=a_kx^k+\ldots +a_1x+a_0, \end{aligned}$$
(3)

or

$$\begin{aligned} a_kx^k+\ldots +a_1x+a_0=0. \end{aligned}$$

In order to obtain information on the weight distribution of the code \(C_{q,r,k}\), we deal with the possible intersection patterns of the curve \({\mathcal {N}}_{q,r}\) and the curves with affine Equation (3). To do this, our approach is based on the investigation of the absolute irreducibility of a certain algebraic variety, and therefore it relies on tools of algebraic geometry; see Sect. 2 for the details. In the last decades, such tools have proved successful in the construction and investigation of many classes of linear codes; see for instance [5, 21,22,23,24,25].

The paper is organized as follows. The prerequisites on Norm-Trace curves, affine variety codes, and the description of our approach, are give in Sect. 2. Section 3 deals with the absolute irreducibility of an algebraic variety attached to the problem, and these results are then applied in Sect. 4 to investigate the weight distribution of the code \(C_{q,r,k}\). Finally, in Sect. 5, we determine the set of minimal codewords of \(C_{q,r,k}\).

2 Preliminaries

In this section, we introduce the notation and terminology that we will use throughout the paper. Hereafter, p is a prime and \(q=p^m\), where m is a positive integer. Also, \({\mathbb {F}}_q\) denotes the finite field with q elements. With the symbol \({\mathbb {A}}^r({\mathbb {F}}_q)\) (resp. \({\mathbb {P}}^r({\mathbb {F}}_q)\)) we denote the affine (resp. projective) r-dimensional space over \({\mathbb {F}}_q\).

The norm function \(\text {N}_{{{\mathbb {F}}}_q}^{{{\mathbb {F}}}_{q^r}}\) and the trace function \(\text {T}_{{{\mathbb {F}}}_q}^{{{\mathbb {F}}}_{q^r}}\) are the functions from \({{\mathbb {F}}}_{q^r}\) to \({{\mathbb {F}}}_q\) defined by

$$\begin{aligned} \text {N}_{{{\mathbb {F}}}_q}^{{{\mathbb {F}}}_{q^r}}(x)=x^{\frac{q^r-1}{q-1}}=x^{q^{r-1}+q^{r-2}+\ldots +q+1} \end{aligned}$$

and

$$\begin{aligned} \text {T}_{{{\mathbb {F}}}_q}^{{{\mathbb {F}}}_{q^r}}(x)=x^{q^{r-1}}+x^{q^{r-2}}+\ldots +x^q+x, \end{aligned}$$

respectively. When q and r are understood, we will write \(\text {N}=\text {N}_{{{\mathbb {F}}}_q}^{{{\mathbb {F}}}_{q^r}}\) and \(\text {T}=\text {T}_{{{\mathbb {F}}}_q}^{{{\mathbb {F}}}_{q^r}}\).

2.1 Affine variety codes

We introduce now affine variety codes, see [1] for further information.

Let \(t\ge 1\) and consider an ideal \(I=\langle g_1,\ldots ,g_s\rangle \) of \({{\mathbb {F}}}_q[x_1,\ldots ,x_t]\), \(\{x_1^q-x_1,\ldots ,\, x_t^q-x_t\}\subset I\). The ideal I is zero-dimensional and radical. Let \(V(I)=\{P_1,\ldots , P_n\}\) be the variety of I and \(R={{\mathbb {F}}}_q[x_1,\ldots ,x_t]/I\).

An affine variety code C(IL) is the image \(\phi (L)\) of \(L\subseteq R\), an \({\mathbb {F}}_q\)-vector subspace of R of dimension r, given by the isomorphism of \({{\mathbb {F}}}_q\)-vector spaces \(\phi :R\longrightarrow {{\mathbb {F}}}_q^n\) that evaluates an element \(f\in R\) on \(\{P_1,\ldots ,P_n\}\), i.e. \(\phi (f)=(f(P_1),\ldots ,f(P_n))\).

2.2 Norm-trace curve

The Norm-Trace curve \({\mathcal {N}}_{q,r}\) is the plane curve defined by the affine equation

$$\begin{aligned} \text {N}_{{{\mathbb {F}}}_q}^{{{\mathbb {F}}}_{q^r}}(x)=\text {T}_{{{\mathbb {F}}}_q}^{{{\mathbb {F}}}_{q^r}}(y). \end{aligned}$$

The equation \( \text {N}_{{{\mathbb {F}}}_q}^{{{\mathbb {F}}}_{q^r}}(x)=\text {T}_{{{\mathbb {F}}}_q}^{{{\mathbb {F}}}_{q^r}}(y)\) has precisely \(q^{2r-1}\) solutions in \({{\mathbb {F}}}_{q^r}^2\), so the curve \({\mathcal {N}}_{q,r}\) has \(q^{2r-1}+1\) rational points: \(q^{2r-1}\) of them correspond to affine points, plus a single point at infinity \(P_{\infty }\). If \(r=2\), \({\mathcal {N}}_{q,r}\) coincides with the Hermitian curve, whereas \({\mathcal {N}}_{q,r}\) is singular in \(P_{\infty }\) if \(r\ge 3\).

Let \(C_{q,r,k}\) be the affine variety code obtained evaluating the polynomials

$$\begin{aligned} by=a_kx^k+\ldots +a_1x+a_0, \end{aligned}$$

with b and \(a_i\) ranging in \({\mathbb {F}}_{q^r}\), at the \(q^{2r-1}\) affine \({\mathbb {F}}_{q^r}\)-rational points of \({\mathcal {N}}_{q,r}\), and \(k< q^{r-1}\). Then \(C_{q,r,k}\) has length \(q^{2r-1}\), dimension \(k+1\), and the weight of a codeword associated to the evaluation of a polynomial \(by=f(x)\) as in (1) is given by

$$\begin{aligned}\textrm{w}(\textrm{ev}(f))=q^{2r-1}-|{\mathcal {N}}_{q,r}\cap {\mathcal {X}} \cap {\mathbb {A}}^{2}({{\mathbb {F}}}_{q^{r}})|,\end{aligned}$$

where \({\mathcal {X}}\) is the curve with affine equation \(by-f(x)=0\). Therefore, in order to investigate the weight distribution of the code \(C_{q,r,k}\), we must study the possible planar intersections in \({\mathbb {A}}^{2}({{\mathbb {F}}}_{q^{r}})\) between \({\mathcal {N}}_{q,r}\) and the (rational) curves whose affine equations are given by (1). Here, by planar intersections (or simply intersections) of two curves lying in the affine space \({\mathbb {A}}^{2}({{\mathbb {F}}}_{q^{r}})\), we mean the number of points in \({\mathbb {A}}^{2}({{\mathbb {F}}}_{q^{r}})\) lying on both curves, disregarding multiplicity. Notice that, when b is non-zero then up to rescaling it is possible to assume \(b=1\). For this reason in our investigation we will concentrate on the study of the cases \(b=0\) and \(b=1\).

For the remaining part of this section, we report the approach used in [19, 20] to deal with this problem.

In the following we deal with the case \(b\ne 0\) in (1). Substituting \(y=f(x)\) as in (3) in the equation of \({\mathcal {N}}_{q,r}\), and exploiting the linearity of the trace function, we get

$$\begin{aligned} \textrm{N}(x)=\textrm{T}(a_{k}x^k)+\ldots +\textrm{T}(a_{2}x^{2})+\textrm{T}(a_{1}x)+\textrm{T}(a_{0}). \end{aligned}$$
(4)

Now, fix a normal basis \({\mathcal {B}}=\{\alpha ,\alpha ^q,\ldots ,\alpha ^{q^{r-1}}\}\) of \({{\mathbb {F}}}_{q^r}\) over \({{\mathbb {F}}}_{q}\) with a suitable \(\alpha \in {{\mathbb {F}}}_{q^r}\) (see [26] for the details), and let \(\Phi _{{\mathcal {B}}}\) be the canonical vector space isomorphism defined by

$$\begin{aligned}{} & {} \Phi _{{\mathcal {B}}}:({{\mathbb {F}}}_{q})^{r} \longrightarrow {{\mathbb {F}}}_{q^{r}}\\{} & {} \Phi _{{\mathcal {B}}}((s_{1},\ldots ,s_{r}))=s_{1}\alpha +s_{2}\alpha ^q+\ldots +s_{r}\alpha ^{q^{r-1}}. \end{aligned}$$

This isomorphism allows us to read the norm \(\textrm{N}\) and the trace \(\textrm{T}\) as maps from \(({{\mathbb {F}}}_{q})^{r}\) to \({{\mathbb {F}}}_{q}\), by taking \(\widetilde{\text {N}}=\text {N}\circ \Phi _{{\mathcal {B}}}\) and \(\widetilde{\text {T}}=\text {T}\circ \Phi _{{\mathcal {B}}}\). Let \( T_{i} : = T(a_{i} x^{i} ) \) and \(\widetilde{\text {T}}_i:=\text {T}_i\circ \Phi _{{\mathcal {B}}}\), for \(1\le i\le k\). Then it is readily seen that \(\widetilde{\text {N}}\) and \(\widetilde{\text {T}}_i\) are homogeneous polynomials of degrees r and i, respectively, in \({{\mathbb {F}}}_q[x_1,\ldots ,x_{r}]\), \(i=0,\ldots ,k\).

Therefore, we can rewrite (4) as

$$\begin{aligned} \widetilde{\text {N}}(x_1,\ldots ,x_{r})=\widetilde{\text {T}}_k(x_1,\ldots ,x_{r})+\ldots +\widetilde{\text {T}}_1(x_1,\ldots ,x_{r})+\text {T}(a_0). \end{aligned}$$
(5)

Equation (5) is the equation of a variety \({\mathcal {S}}\) defined over \({{\mathbb {F}}}_q\). Note that the RHS of (5) has degree r, and the LHS has degree k. By construction, the \({{\mathbb {F}}}_q\)-rational points of \({\mathcal {S}}\), correspond to the planar intersections in \({\mathbb {A}}^2({{\mathbb {F}}}_{q^r})\) between the Norm-Trace curve \({\mathcal {N}}_{q.r}\) and the rational curve of equation \(y=f(x)\), see [19, Remark 4.1].

Let \({\mathcal {V}}_{k,r}\) be the variety \(\psi ({\mathcal {S}})\), where \(\psi \) is the affine change of variables of \({\mathbb {A}}^r({\overline{{{\mathbb {F}}}}}_q)\) defined by

$$\begin{aligned} \psi (x_1,\ldots ,x_{r})=M(x_1,\ldots ,x_{r})^t=(X_1,\ldots ,X_r)^t, \end{aligned}$$

and M is the non-singular matrix

$$\begin{aligned} M=\begin{pmatrix} \alpha &{}\alpha ^q&{}\ldots &{}\alpha ^{q^{r-1}}\\ \alpha ^q&{}\ldots &{}\alpha ^{q^{r-1}}&{}\alpha \\ \vdots &{}\vdots &{}\vdots &{}\vdots \\ \alpha ^{q^{r-1}}&{}\alpha &{}\ldots &{}\alpha ^{q^{r-2}} \end{pmatrix}. \end{aligned}$$

Then, the variety \({\mathcal {V}}_{k,r}\) is defined over \({{\mathbb {F}}}_{q^r}\), and it has affine equation \(V_{k,r}(X_1,\ldots ,X_r)=0\), with

$$\begin{aligned} V_{k,r}(X_1,\ldots ,X_r)=-\prod _{i=1}^r X_i+\sum _{i=1}^r a_k^{q^{i-1}}X_i^k+\ldots +\sum _{i=1}^r a_1^{q^{i-1}}X_i+\textrm{T}(a_0). \end{aligned}$$
(6)

Note that \(\psi \) is an affine change of variables and thus preserves the number of absolutely irreducible components of \({\mathcal {S}}\), and their degrees. This equivalence between \({\mathcal {V}}_{k,r}\) and \({\mathcal {S}}\) is crucial in our investigation and in the next sections we will make use of this link a number of times.

3 Planar intersections of \({\mathcal {N}}_{q,r}\) and the curves \(y-f(x)=0\)

As it was shown in Sect. 2, finding the planar intersections of the norm-trace curve \({\mathcal {N}}_{q,r}\) and the curves of Equation (3) is equivalent to finding the number of \({{\mathbb {F}}}_{q}\)-rational points of the \({{\mathbb {F}}}_{q}\)-rational variety \({\mathcal {S}}\). Our aim is to prove that \({\mathcal {S}}\) is absolutely irreducible under certain assumptions on k and r, by proving the absolute irreducibility of \({\mathcal {V}}_{k,r}\). Indeed, since \(\psi (x_1,\ldots ,x_{r})\) preserves the number of absolutely irreducible components of a variety, it follows that if \({\mathcal {V}}_{k,r}\) is absolutely irreducible the same holds for \({\mathcal {S}}\). Also, if \({\mathcal {S}}\) is absolutely irreducible we can apply the Lang-Weil bound to estimate the number of its \({{\mathbb {F}}}_q\)-rational points.

Theorem 3.1

[27, Lang-Weil bound] Let \({\mathcal {V}}\subset {\mathbb {P}}^N({\mathbb {F}}_q)\) be an absolutely irreducible variety of dimension n and degree d. Then there exists a constant C depending only on N, n, and d such that

$$\begin{aligned} \left| \#({\mathcal {V}}\cap {\mathbb {P}}^N({\mathbb {F}}_q))-\sum _{i=0}^{n} q^i\right| \le (d-1)(d-2)q^{n-1/2}+Cq^{n-1}. \end{aligned}$$

Although the constant C was not computed in [27], explicit estimates have been provided for instance in [26, 28,29,30,31,32] and they have the general shape \(C=r(d)\) provided that \(q>s(n,d)\), where r and s are polynomials of (usually) small degree. We refer to [29] for a survey on these bounds. We only include the following result due to Cafure and Matera.

Theorem 3.2

[29, Theorem 7.1] Let \({\mathcal {V}}\subset {\mathbb {A}}^N({\mathbb {F}}_q)\) be an absolutely irreducible variety defined over \({\mathbb {F}}_q\) of dimension n and degree d. If \(q>2(n+1)d^2\), then the following estimate holds:

$$\begin{aligned} |\#({\mathcal {V}}\cap {\mathbb {A}}^N({\mathbb {F}}_q))-q^n|\le (d-1)(d-2)q^{n-1/2}+5d^{13/3} q^{n-1}. \end{aligned}$$

We report here some results that we will use to prove the irreducibility of \({\mathcal {V}}_{k,r}\), under certain conditions on k and r. As a corollary of [33, Lemma 4.15], we have the following.

Proposition 3.3

Let H be a hyperplane of \({\mathbb {P}}^{r}({{\mathbb {F}}}_{q^r})\) such that \({\mathcal {V}}_{k,r}\cap H\) is absolutely irreducibile and of multiplicity one. Then \({\mathcal {V}}_{k,r}\) is absolutely irreducible.

The following result about the absolute irreducibility of varieties of Fermat-type is well known and it is a direct consequence of their non-singularity.

Proposition 3.4

Let nr be two positive integers such that \(p\not \mid n\) and \(r\ge 3\). Then, the variety of \({\mathbb {P}}^{r-1}({\overline{{{\mathbb {F}}}}}_{q})\) with homogeneous equation

$$\begin{aligned} a_1X_1^n+a_2X_2^n+\ldots +a_rX_r^n=0, \end{aligned}$$

where \(a_1,\ldots ,a_r\in {\overline{{{\mathbb {F}}}}}_{q}\), is absolutely irreducible.

Proposition 3.5

Suppose that \(k>r\ge 3\) and \(p\not \mid k\). Then \({\mathcal {V}}_{k,r}\) is absolutely irreducible.

Proof

It is readily seen that the homogeneous part in \(V_{k,r}\) of the highest degree is

$$\begin{aligned} \sum _{i=1}^r a_k^{q^{i-1}}X_i^k, \end{aligned}$$

which is absolutely irreducible by Proposition 3.4. Since \(\sum _{i=1}^r a_k^{q^{i-1}}X_i^k=0\) is the intersection between \({\mathcal {V}}_{k,r}\) and the hyperplane at infinity, it follows that \({\mathcal {V}}_{k,r}\) is absolutely irreducible by Proposition 3.3. \(\square \)

Proposition 3.6

Suppose that \(k=r\ge 4\) and \(p\not \mid k\). Then \({\mathcal {V}}_{k,r}\) is absolutely irreducible.

Proof

In this case, the homogeneous part in \(V_{k,r}(X_1,X_2,\ldots ,X_r)\) of the highest degree is

$$\begin{aligned} R(X_1,\ldots ,X_r):=-\prod _{i=1}^r X_i+\sum _{i=1}^r a_r^{q^{i-1}}X_i^r. \end{aligned}$$

Since \(r\ge 4\), the polynomial

$$\begin{aligned}R(0,X_2,\ldots ,X_r)=\sum _{i=2}^r a_r^{q^{i-1}}X_i^r \end{aligned}$$

is absolutely irreducible by Proposition 3.4, and hence also \(R(X_1,\ldots ,X_r)\) is absolutely irreducible by Proposition 3.3.

Finally, since \(R(X_1,\ldots ,X_r)=0\) is the intersection between \({\mathcal {V}}_{k,r}\) and the hyperplane at infinity, by Proposition 3.3 the claim follows. \(\square \)

Proposition 3.7

Suppose that \(k=r\ge 4\) and \(p\mid r\). Then \({\mathcal {V}}_{k,r}\) is absolutely irreducible.

Proof

Write \(r={\bar{r}}p^\alpha \), with \(p\not \mid {\bar{r}}\). Then \(\alpha \ge 1\) and \({\bar{r}}<r\). The homogeneous part in \(V_{k,r}(X_1,X_2,\ldots ,X_r)\) of the highest degree is

$$\begin{aligned} R(X_1,\ldots ,X_r):=-\prod _{i=1}^r X_i+\sum _{i=1}^r a_r^{q^{i-1}}X_i^r=-\prod _{i=1}^r X_i+\left( \sum _{i=1}^r {\bar{a}}_r^{q^{i-1}}X_i^{{\bar{r}}}\right) ^{p^\alpha }, \end{aligned}$$

where \({\bar{a}}_r^{p^\alpha }=a_r\).

We will prove that \(R(X_1,\ldots ,X_{r-1},1)=0\) is absolutely irreducible.

Let \(F=\sum _{i=1}^{r-1} {\bar{a}}_r^{q^{i-1}}X_i^{{\bar{r}}}\). Observe that F is absolutely irreducible by Proposition 3.4. Suppose now that

$$\begin{aligned} R(X_1,\ldots ,X_{r-1},1)=G(X_1,X_2,\ldots ,X_r)H(X_1,X_2,\ldots ,X_r), \end{aligned}$$

where \(G(X_1,X_2,\ldots ,X_r)\) and \(H(X_1,X_2,\ldots ,X_r)\) have the following shape

$$\begin{aligned}{} & {} G(X_1,X_2,\ldots ,X_r)=F^{\beta }+G_{{\bar{r}}\beta -1}+\ldots +G_0,\\{} & {} H(X_1,X_2,\ldots ,X_r)=F^{p^\alpha -\beta }+H_{(p^\alpha -\beta ){\bar{r}}-1}+\ldots +H_0, \end{aligned}$$

with \(0<\beta <p^{\alpha }\), and \(H_i\) and \(G_j\) are either homogeneous polynomials of degree i and j respectively, or they are the zero polynomials. Thus

$$\begin{aligned} F^\beta H_{(p^\alpha -\beta ){\bar{r}}-1}+F^{p^\alpha -\beta }G_{{\bar{r}}\beta -1}=-\prod _{i=1}^{r-1}X_i. \end{aligned}$$

This yields \(F\mid \prod _{i=1}^rX_i\), a contradiction. Therefore \(R(X_1,\ldots ,X_{r-1},1)=0\) is absolutely irreducible and so is \({\mathcal {V}}_{r,k}\) by Proposition 3.3. \(\square \)

Proposition 3.8

Suppose that \(0<k<r\). Then \({\mathcal {V}}_{k,r}\) is absolutely irreducible.

Proof

If \({\mathcal {V}}_{k,r}\) is reducible then \(V_{k,r}(X_1,X_2,\ldots ,X_r)\) splits into the product of two polynomials H and G with the following shape,

$$\begin{aligned}{} & {} H(X_1,X_2,\ldots ,X_r)=X_1\ldots X_s+H_{s-1}+\ldots +H_{0}, \\{} & {} G(X_1,X_2,\ldots ,X_r)=X_{s+1}\ldots X_{r}+G_{r-s-1}+\ldots +G_{0}, \end{aligned}$$

where \(H_i\) and \(G_j\) are either homogeneous polynomials of degree i and j respectively, or they are the zero polynomials, and \(1\le s \le r-1\). Let \(F_u=\sum _{i=1}^ra_u^{q^{i-1}}X_i^u\), then

$$\begin{aligned} H(X_1,X_2,\ldots ,X_r)G(X_1,X_2,\ldots ,X_r)=X_1\cdot \ldots \cdot X_r+\sum _{u=0}^kF_u. \end{aligned}$$

Because of the shape of \(V_{k,r}(X_1,X_2,\ldots ,X_r)\), for each i such that \(i\ge s+1+k-r\) and \(i\le s-1\), we have that \(H_i=0\). For the same reason, for each j such that \(j\ge k-s+1\) and \(j\le r-s-1\), \(G_{j}=0\).

Now observe that it is not possible that \(k-r+s+1<0\) or \(k+1-s<0\), otherwise there would exist a variable \(X_i\) dividing \(H(X_1,X_2,\ldots ,X_r)\) or \(G(X_1,X_2,\ldots ,X_r)\) (and hence dividing \(V_{k,r}\)).

Therefore, the only possibility left is \(k-r+s+1\ge 0\) and \(k+1-s\ge 0\), which gives

$$\begin{aligned}{} & {} F_k(X_1,X_2,\ldots ,X_r)=X_1\ldots X_s\cdot G_{k-s}(X_1,X_2,\ldots ,X_r)+X_{s+1}\ldots X_r \\ {}{} & {} \qquad \cdot H_{k-r+s}(X_1,X_2,\ldots ,X_r). \end{aligned}$$

Still, this is not possible, since for \(X_1=0\) we would have

$$\begin{aligned} F_k(0,X_2,\ldots ,X_r)=\sum _{i=2}^ra_k^{q^{i-1}}X_i^k=H_{k-r+s}(0,X_2,\ldots ,X_r)\prod _{i=s+1}^rX_i. \end{aligned}$$

Clearly, this is impossible by Proposition 3.4, as this would imply that \(\sum _{i=2}^r a_k^{q^{i-1}} X_i^k\) is divisible by \(X_{s+1}\cdot \ldots \cdot X_r\). \(\square \)

We recall that by the definition of \({\mathcal {V}}_{k,r}\) and \({\mathcal {S}}\), these two varieties have the same number of absolutely irreducible components. Therefore, as a byproduct of the previous results, together with Theorem 3.2, we directly obtain the following.

Proposition 3.9

Let \(d=\max {(k,r)}\), and suppose that one of the following cases holds:

  1. 1.

    \(k>r\), \(p\not \mid k\);

  2. 2.

    \(k=r\ge 4\);

  3. 3.

    \(0<k<r\).

Then, \({\mathcal {S}}\) is absolutely irreducible and, if \(q>2rd^2\), it contains at least \(q^{r-1}-(d-1)(d-2)q^{r-3/2}+5d^{13/3}q^{r-2}\) points in \({\mathbb {A}}^r({{\mathbb {F}}}_{q})\).

We finally point out that some results for the case \((k,r)=(3,3)\) and \((k,r)=(3,2)\) can be found in [20] and [19]), respectively. Unfortunately, it does not seem to be easy to say when \({\mathcal {V}}_{3,3}\) is irreducible, but when this happens it is possible to give a good estimate on the number of planar intersections between the Norm-Trace curve and rational curves of degree up to three. On the other hand, it is possible to prove (see [19]) that \({\mathcal {V}}_{2,3}\) is always absolutely irreducible.

4 On the weight spectrum of Norm-Trace codes

Since the codewords of \(C_{q,r,k}\) are all given by the evaluations of polynomials of the form \(by=f(x)\) as in (1), their weights are then given by

$$\begin{aligned}\textrm{w}(\textrm{ev}(by-f))=q^{2r-1}-|{\mathcal {N}}_{q,r}\cap {\mathcal {X}} \cap {\mathbb {A}}^{2}({{\mathbb {F}}}_{q^{r}})|,\end{aligned}$$

where \({\mathcal {X}}\) is the curve with affine equation \(by-f(x)=0\). Therefore, an estimate on the maximum possible number of \({{\mathbb {F}}}_q\)-rational planar intersections between \({\mathcal {N}}_{q,r}\) and the curves \({\mathcal {X}}\) provides a lower bound on the minimum weight of \(C_{q,r,k}\). The case when \(b=0\) was already investigated in [4], while the case \(b\ne 0\) and \(\deg (f)\le 3\) can be found in [19, 20]. Therefore, from now on we will focus on the case \(b\ne 0\) and \(\deg (f)>3\).

Classical arguments relying on the Bézout theorem tell us that the number of planar intersections between the two curves can be bounded by the product of the degrees of \({\mathcal {N}}_{q,r}\) and \({\mathcal {X}}\). Then, the maximum number of planar intersections is less than or equal to \(k \frac{q^r-1}{q-1}\). Therefore the weight of the codewords of \({\mathcal {C}}_{q,r,k}\) is at least \(q^{2r-1}-s \frac{q^r-1}{q-1}\), where \(s\le k\) is the degree of the polynomial whose evaluation defines the codeword.

Still, this result is not tight and, as a byproduct of the results obtained in the previous section, we can give improvements on \(\textrm{d}(C_{q,r,k})\).

Corollary 4.1

Consider the norm-trace curve \({\mathcal {N}}_{q,r}\) over the field \({{\mathbb {F}}}_{q^r}\), with q large enough, and the code \(C=C_{q,r,k}\). Suppose also that one of the following conditions holds

  1. (a)

    \(k>r\) and \(p\not | k\),

  2. (b)

    \(k=r\ge 4\),

  3. (c)

    \(0< k< r\).

Let \(c=\textrm{ev}(by-f(x))\in C\), then:

  1. (i)

    If \(b=0\) and f has s distinct roots over \({{\mathbb {F}}}_{q^r}\), then \(\textrm{w}(c)=q^{2r-1}-sq^{r-1}\).

  2. (ii)

    If \(b\ne 0\) then \(\textrm{w}(c)\ge q^{2r-1}-q^r-5d^{13/3}q^{r-1}-(k-1)(k-2)q^{\frac{r-1}{2}}\).

Notice that the case \(k=r=3\) was investigated in [20].

5 Minimal codewords in Norm-Trace codes

First, we investigate the case \(k=r=2\), in which \({\mathcal {N}}_{q,r}\) coincides with the Hermitian curve \({{\mathcal {H}}}\) of homogeneous equation

$$\begin{aligned} x^{q+1}=y^q+y. \end{aligned}$$

In this section we provide a complete classification of the minimal codewords of the affine variety code C obtained by evaluating the polynomials of degree 2 with coefficients in \({\mathbb {F}}_{q^2}[x,y]\) at the points of \({{\mathcal {H}}}\) in \({\mathbb {A}}^2({\mathbb {F}}_{q^2})\), when q is odd. Observe that such a code C contains in particular each codeword of \(C_{q,2,2}\). In order to describe the minimal codewords of C, we consider the possible planar intersections in \({\mathbb {A}}^2({\mathbb {F}}_{q^2})\) between \({{\mathcal {H}}}\) and the algebraic curves \({{\mathcal {C}}}\) described by polynomials of degree 2.

In the case \({{\mathcal {C}}}\) is irreducible, i.e. it is an irreducible conic, a complete list of the possible planar intersections between \({{\mathcal {H}}}\) and \({{\mathcal {C}}}\), which we report below, was given for q odd in [34]. Here, by a subconic of a conic \({{\mathcal {C}}}\) we mean \(q+1\) points of \({{\mathcal {C}}}\) lying in a Baer subplane \({\mathbb {P}}^2({\mathbb {F}}_q)\) of \({\mathbb {P}}^2({\mathbb {F}}_{q^2})\).

Proposition 5.1

In \({\mathbb {P}}^2({\mathbb {F}}_{q^2})\), q odd, the intersection pattern of \({{\mathcal {H}}}\) and an irreducible conic \({{\mathcal {C}}}\) is one of the following.

  1. (i)

    \({{\mathcal {H}}}\cap {{\mathcal {C}}}=\emptyset \);

  2. (ii)

    \(|{{\mathcal {H}}}\cap {{\mathcal {C}}}|=1\);

  3. (iii)

    \(|{{\mathcal {H}}}\cap {{\mathcal {C}}}|=2\);

  4. (iv)

    \(|{{\mathcal {H}}}\cap {{\mathcal {C}}}|=q+1\). In particular, \({{\mathcal {H}}}\cap {{\mathcal {C}}}\) is a subconic of \({{\mathcal {C}}}\);

  5. (v)

    \(|{{\mathcal {H}}}\cap {{\mathcal {C}}}|\in \{2q,2q+1,2q+2\}\). In particular, \({{\mathcal {H}}}\cap {{\mathcal {C}}}\) is the union of two subconics of \({{\mathcal {C}}}\) sharing either zero, one, or two points;

  6. (vi)

    \(|{{\mathcal {H}}}\cap {{\mathcal {C}}}|\in \{q,q+1,q+2\}\) and meets every subconic of \({{\mathcal {C}}}\) in at most four points;

  7. (vii)

    \(q-2\sqrt{q}+2\le |{{\mathcal {H}}}\cap {{\mathcal {C}}}|\le q+2\sqrt{q}+2\) and meets every subconic of \({{\mathcal {C}}}\) in at most six points.

If \({{\mathcal {C}}}\) is reducible, the following holds.

Proposition 5.2

In \({\mathbb {P}}^2({\mathbb {F}}_{q^2})\), q odd, the intersection pattern of \({{\mathcal {H}}}\) and a reducible conic \({{\mathcal {C}}}\) is one of the following.

  1. (viii)

    If \({{\mathcal {C}}}\) is a repeated line \(\ell \), then either \(|{{\mathcal {H}}}\cap {{\mathcal {C}}}|=1\) and \(\ell \) is a tangent to \({{\mathcal {H}}}\), or \(|{{\mathcal {H}}}\cap {{\mathcal {C}}}|=q+1\) and \(\ell \) is a secant to \({{\mathcal {H}}}\);

  2. (ix)

    \(|{{\mathcal {H}}}\cap {{\mathcal {C}}}|=2\) and \({{\mathcal {C}}}\) is the product of two distinct tangents to \({{\mathcal {H}}}\);

  3. (x)

    \(|{{\mathcal {H}}}\cap {{\mathcal {C}}}|\in \{q+1,q+2\}\) and \({{\mathcal {C}}}\) is the product of a tangent to \({{\mathcal {H}}}\) and a secant to \({{\mathcal {H}}}\);

  4. (xi)

    \(|{{\mathcal {H}}}\cap {{\mathcal {C}}}|\in \{2q+1,2q+2\}\) and \({{\mathcal {C}}}\) is the product of two distinct secants to \({{\mathcal {H}}}\).

We are now in position to prove the main result of this section. Its proof is based on the observation that a codeword \(c\in C\) associated to the evaluation of a degree 2 polynomial defining a conic \({{\mathcal {C}}}\) is minimal if and only if there does not exist another conic \({{\mathcal {C}}}^\prime \ne {{\mathcal {C}}}\) such that \({{\mathcal {H}}}\cap {{\mathcal {C}}}\subseteq {{\mathcal {H}}}\cap {{\mathcal {C}}}^\prime \).

Proposition 5.3

Let \(q>7\) be odd. With the notations of Propositions 5.1 and 5.2, the minimal codewords of the code C arise from conics whose intersection pattern with \({{\mathcal {H}}}\) is as in (iv), (v), (vi), (vii), (xi).

Proof

Among the reducible cases, minimal codewords can only arise from conics that are the product of two distinct secants to \({{\mathcal {H}}}\) (case (xi)). Indeed, the intersection patterns of cases (viii), (ix), (x) are strictly contained in the intersection of \({{\mathcal {H}}}\) with two distinct (properly chosen) secant lines, and hence, by the above mentioned observation, the corresponding codewords are not minimal. To prove that a conic \({{\mathcal {C}}}\) as in (iv), (v), (vi), (vii) corresponds to a minimal codeword, assume by way of contradiction that there exists a conic \({{\mathcal {C}}}^\prime \) such that \({{\mathcal {H}}}\cap {{\mathcal {C}}}\subseteq {{\mathcal {H}}}\cap {{\mathcal {C}}}^\prime \). Then \({{\mathcal {C}}}\cap {{\mathcal {C}}}^\prime \) contains \({{\mathcal {H}}}\cap {{\mathcal {C}}}\). However, as \(|{{\mathcal {H}}}\cap {{\mathcal {C}}}|>4\) holds in each of the cases (iv), (v), (vi), (vii) for \(q>7\), this is in contradiction to Bézout’s Theorem stating that \(|{{\mathcal {C}}}\cap {{\mathcal {C}}}^\prime |\le 4\). Finally, it is readily seen that cases (i), (ii), (iii) don’t correspond to minimal codewords. \(\square \)

From now on in this section we assume \(k>3\), and we give a description of the minimal codewords of the code \(C_{q,r,k}\).

Proposition 5.4

Let \(k< \#{\mathcal {N}}_{q,r}({{\mathbb {F}}}_{q^r})\). The minimal codewords of \(C_{q,r,k}\) are the ones generated by the evaluations of polynomials of the shape

  1. (i)

    \(y-f(x)\), \(\deg (f)= {\overline{k}}\), with

    $$\begin{aligned} q^{r-1}-(\max \{{\overline{k}},r\}-1)(\max \{{\overline{k}},r\}-2)q^{r-3/2}+5\max \{{\overline{k}},r\}^{13/3}q^{r-2}>k, \end{aligned}$$

    and

    $$\begin{aligned} {\overline{k}}>r\text { and }p\not \mid {\overline{k}}, \quad \text { or } {\overline{k}}=r\ge 4, \quad \text { or } 0<{\overline{k}}<r; \end{aligned}$$
  2. (ii)

    g(x), where g(x) is a polynomial of degree k having all distinct roots in \({\mathbb {F}}_{q^r}\);

  3. (iii)

    \(y-\alpha \), with \(\alpha \in {\mathbb {F}}_{q^r}\).

Proof

Consider two codewords \(c,c^\prime \in C_{q,r,k}\). Recall that the codewords of \( C_{q,r,k}\) are the evaluations of polynomials in the span of the set \(\{y,x^{i}\}_{i=0,\ldots ,k}\) at the \({{\mathbb {F}}}_{q^r}\)-rational points of \({\mathcal {N}}_{q,r}\). Let F(xy) and \(F^\prime (x,y)\) be the polynomials that correspond to c and \(c^\prime \), respectively. First, we assume \(F(x,y)=f(x)\) and \(F^\prime (x,y)=y-g(x)\). Then, we claim that the support of \(c=\textrm{ev}(f(x))\) doesn’t contain the support of \(c^\prime =\textrm{ev}(y-g(x))\). Indeed, write \(f(x)=\prod _{i=1}^{\deg (f)} (x-t_i)\), with \(t_i\in \overline{{\mathbb {F}}}_q\). Then, the zeros of c correspond to all the affine points of \({\mathcal {N}}_{q,r}\) with coordinates \((t_i,y_i^{(j)})\) such that \(t_i\in {\mathbb {F}}_{q^r}\) and

$$\begin{aligned} \text {N}_{{{\mathbb {F}}}_q}^{{{\mathbb {F}}}_{q^r}}(t_i)=\text {T}_{{{\mathbb {F}}}_q}^{{{\mathbb {F}}}_{q^r}}(y_i^{(j)}), \end{aligned}$$

for \(j=1,\ldots ,q^{r-1}\). Observe that if \(t_i\not \in {\mathbb {F}}_{q^r}\) for every \(i\in \{1,\ldots ,\deg (f)\}\), then c is a full-weight codeword and hence it is not minimal. Also, for each \(t_i\in {\mathbb {F}}_{q^r}\), there exists at most a unique \({\bar{y}}_i\) such that \({\bar{y}}_i=g(t_i)\) and \((t_i,{\bar{y}}_i)\) belongs to \({\mathcal {N}}_{q,r}\). Therefore, the support of c cannot contain the support of \(c^{\prime }\).

On the other hand, it is readily seen that if \(\deg (g)={\bar{k}}>0\), and \({\bar{k}}\) is as in (i), then the support of c cannot be contained in the support of \(c^{\prime }\). Indeed, Proposition 3.9 together with the assumption \(q^{r-1}-(\max \{{\overline{k}},r\}-1)(\max \{{\overline{k}},r\}-2)q^{r-3/2}+5\max \{{\overline{k}},r\}^{13/3}q^{r-2}>k\), show that the zeros of c cannot contain the zeros of \(c^{\prime }\).

Now, we deal with the case \(F(x,y)=y-f(x)\) and \(F^\prime (x,y)=y-g(x)\), with \(f(x)\ne g(x)\). Suppose that the zeros of \(c=\textrm{ev}(y-f(x))\) are also zeros of \(c^\prime =\textrm{ev}(y-g(x))\), \(f(x)\ne g(x)\). Thus, they are also zeros of \({\hat{c}}=c-c^{\prime }=\textrm{ev}(f(x)-g(x))\). Then, the argument above applied to c and \({\hat{c}}\) shows that this case is not possible.

Assume now that \(F(x,y)=f(x)\) and \(F^\prime (x,y)=g(x)\), and denote by \(\{t_1,\ldots ,t_h\}\) and \(\{u_1,\ldots ,u_l\} \) the zeros of f and g in \({\mathbb {F}}_{q^r}\), respectively. Then, it is readily seen that the support of \(c=\textrm{ev}(f(x))\) contains the support of \(c^\prime =\textrm{ev}(g(x))\) if and only if \(\{t_1,\ldots ,t_h\}\subset \{u_1,\ldots ,u_l\} \). As a direct consequence, the minimal codewords arising from a polynomial of type f(x) must be as in Case (ii).

Finally, let \(F(x,y)=y-\alpha \) for a certain \(\alpha \in {\mathbb {F}}_{q^r}\). Then, by the above mentioned arguments, together with the fact that the support of c cannot contain the support of a codeword arising from a polynomial of type \(y-\beta \), with \(\beta \ne \alpha \), we have that in this case c is minimal. \(\square \)