# User:Richard Pinch/sandbox-codes

A family of linear codes defined over finite fields. Let $F = \mathbf{F}_q$ and put $n = q-1$. Let $\beta$ be a primitive element of $F^*$. For an integer $k \le n$, let $L_k$ denote the vector space of polynomials over $F$ of degree $\le k-1$, and let $E$ be the evaluation map $e : L_k \rightarrow F^n$ given by $$E : f \mapsto \left({ f(\beta), f(\beta^2), \ldots, f(\beta^n) }\right) \ .$$
The image $E[L_k]$ is a subspace of $F^n$ and constitutes the Reed–Solomon code $\mathrm{RS}(q,k)$. It is a primitive BCH code.
The map $E$ is injective, as a non-zero polynomial of degree $k<n$ cannot be zero at $n$ distinct values. The rank of the code is thus $k$. The minimum weight is $n-k+1$, corresponding to a polynomial with $k-1$ zeroes all in $F$. The Reed–Solomon code thus meets the singleton bound and is an MDS code.
More generally, we may prescribe a set of $n$ evaluation points, $k \le n \le q-1$, distinct elements $\mathbf{x} = (x_1,\ldots,x_n)$ of $F$, and non-zero weights $\mathbf{y} = (y_i)$. The generalised Reed–Solomon code is defined by the evaluation map $$E : f \mapsto \left({ y_1 f(x_1), \ldots, y_n f(x_n) }\right) \ .$$ The image is of rank $n$ and minimum weight $n-k+1$: it is denoted $\mathrm{GRS}_k(\mathbf{x}, \mathbf{y})$. The dual code is $\mathrm{GRS}_{n-k}(\mathbf{x}, \mathbf{y'})$ for some $\mathbf{y'}$.