HILBERT QUASI-POLYNOMIAL FOR ORDER DOMAINS AND APPLICATION TO CODING THEORY

. We present an application of Hilbert quasi-polynomials to order domains, allowing the eﬀective check of the second order-domain condition in a direct way. We also provide an improved algorithm for the computation of the related Hilbert quasi-polynomials. This allows to identify order domain codes more easily. of one-point geometric Goppa codes, an improved construction of one-point geometric Goppa codes and a generalization of the bound and the improved construction to algebraic structures of higher transcendence degrees. To derive these results, they consider ﬁrst the problems in the most general set-up described by Miura in [18] and by Miura and Matsumoto [17].


Introduction
Fundamental algebraic invariants of a standard-graded ring can be deduced from its Hilbert-Poincaré series and Hilbert polynomial. The Hilbert quasi-polynomial generalizes Hilbert polynomial from the standard grading case to more generalized weighted grading, but until [2] no effective algorithms for its computation were known.
Apart from its natural ideal-theoretical application, we believe that more practical applications can arise from its use, e.g. for the study of order domains and the related codes. We consider order domains as pairs of a quotient ring R/I and a generalized weighted degree ordering which satisfy some conditions that depend largely on the weights of monomials under the Hilbert staircase of the ideal I of R.
An important research area in coding theory is that of algebraic geometric codes, which are known to achieve near-optimal performance since the seminal Goppa paper ( [11]). A class of algebraic geometric codes that have received a lot of recent attention is formed by the so-called order domain codes ( [7], [8]). These codes are defined by evaluating a polynomial vector space at points of a variety which is definided starting from an order domain, and as such they form a subclass of the so-called affine variety codes ( [4], [15]). In [12], Høholdt, van Lint and Pellikaan introduced order domains for the first time. They showed how to deal with one-point geometric Goppa codes in the language of order domain theory. In [1], Andersen and Geil give an improved bound on the minimum distance of one-point geometric Goppa codes, an improved construction of one-point geometric Goppa codes and a generalization of the bound and the improved construction to algebraic structures of higher transcendence degrees. To derive these results, they consider first the problems in the most general set-up described by Miura in [18] and by Miura and Matsumoto [17].
In this paper we present our application of Hilbert quasi-polynomials to order domains, which consists in verifying the order domain conditions in a direct way, once the Hilbert quasi-polynomial has been computed for a related quotient ring. This computation is effective thanks to our algorithm, that improves on that of [2] and can be specialized to the order domain case.
The remainder of this paper is organized as follows: Section 2: here we provide some notation, preliminaries and known results on Hilbert functions, Hilbert quasi-polynomials, order domains and order domain codes. Section 3: in this section we present some results on Hilbert quasi-polynomials, which lead to improvements in their effective calculation, and our main results Corollary 1 and Algorithm 10, which allow to decide effectively if the second order-domain condition is actually satisfied. Section 4: we show some examples of application of our results. In particular, the most important family of affine-variety codes is that of codes coming from maximal curves, since these codes have large length. In this section we specialize our previous results to this family, showing some actual practical cases that can be solved easily. Section 5: in this section we draw our conclusions and point at possible future improvements.

Preliminaries
In this section we fix some notation and recall some known results. We denote by N + the set of positive integers, by K a field, by R := K[x 1 , . . . , x n ] the polynomial ring in n variables over K, and by M = M(X) the set of all monomials in the variables x 1 , . . . , x n . We assign a weight w i ∈ N r + to each variable x i , i.e. if X α = x α1 1 · · · x αn n ∈ M w(X α ) := α 1 w 1 + · · · + α n w n .
Let ≺ N r + and ≺ M be monomial orderings on N r + and M respectively, and let W := [w 1 , . . . , w n ] ∈ (N r + ) n be the vector of the variable weights. The generalized weighted degree ordering ≺ W defined from W , ≺ N r + and ≺ M is the ordering given by Given f ∈ R and ≺ W , lm(f ) (resp. lt(f )) stands for the leading monomial (resp. leading term) of f w.r.t ≺ W . Let I ⊆ R be an ideal of R, then we denote bȳ I := in ≺ W (I) the initial ideal of I, which is the ideal generated by {lt(f ) | f ∈ I}, and by N ≺ W (I) the Hilbert staircase of I, which is the set of all monomials that are not leading monomials of any polynomial in I. In the remainder of this paper, we suppose w i ∈ N + , unless specified otherwise. In this section we are going to give the notion of order domain, which represents a relatively new tool in the study of algebraic geometric codes. We refer to [6] and [7].
Recall that an K-algebra is a commutative ring with a unit that contains K as a unitary subring. The standard example of an K-algebra is R = K[x 1 , . . . , x n ]. Definition 1. Let Γ be a semigroup and ≺ a well-ordering. An order function on an K-algebra R is a surjective function If f and g are non-zero and ρ(f ) = ρ(g), then there exists a non-zero a ∈ F such that ρ(f − ag) < ρ(g) for all f, g, h ∈ R. Definition 2. Let R be an K-algebra, (Γ, ≺) a well-order and ρ : R → Γ ∪ {−∞} an order function. Then (R, ρ, Γ) is called an order structure and R an order domain over K.
All order functions relevant in coding theory are actually weight functions. Definition 3. Let R be an K-algebra. A weight function on R is an order function on R that satisfies furthermore (O.6) ρ(f g) = ρ(f ) + ρ(g) for all f, g ∈ R. Here −∞ + n = −∞ for all n ∈ N.
Order domains and weight functions represent helpful tools to construct a large class of algebraic geometric codes. Actually, one can only use Groebner basis theoretical methods for constructing order domains and weight functions, instead of their formal definition, as showed by the following theorem. Theorem 1. [6] Let I be an ideal in R = K[x 1 , . . . , x n ] and assume G is a Groebner basis for I with respect to a generalized weighted degree ordering ≺ W , with W ⊆ N r + . Suppose that (C1) any g ∈ G has exactly two monomials of highest weight in its support; (C2) no two monomials in the staircase N ≺ W (I) of I are of the same weight. If I and ≺ W satisfy the hypotheses of Theorem 1, we call the pair (R/I, ≺ W ) an order domain.

Example 2.
Let q be a prime power and consider the so-called Hermitian polynomial x q+1 − y q − y and let I be the ideal I = (x q+1 − y q − y) ⊆ F q 2 [x, y], where F q 2 stands for a field with q 2 elements and q is a prime power. We consider ≺ W given by w(x) = q, w(y) = q + 1 and x ≺ lex y. Then G = {x q+1 − y q − y} is a Groebner basis for I, and it is not difficult to verify that I and ≺ W satisfy the order domain conditions (C1) and (C2), then (R/I, ≺ w ) is an order domain.
One main advantage of Theorem 1 is that it allows to construct in a very easy way order domains of higher transcendence degree.

2.2.
Affine-variety codes and order domain codes. In this section, we present a class of codes, called affine-variety codes and defined in [4], obtained by evaluating functions in the coordinate ring of an affine variety on all the K-rational points, i.e. points whose coordinates are in K, of the variety. Let I be any ideal in R := K[x 1 , . . . , x n ], where K := F q is the field with q elements. Put The points of the affine variety V(I q ) defined by I q are the F q -rational points of the affine variety defined by I.
it is a 0-dimensional and radical ideal. It follows that the coordinate ring is an Artinian ring of length N and that there is an isomorphism ev of F q -vector spaces ev : where f is a representative in R of the residue classf . Let L ⊆ R q be an F q -vector subspace of R q of dimension k. The image ev(L) of L under the evaluation map ev is called the affine-variety code and we denote it by C(I, L). The dual code C ⊥ (I, L) is the orthogonal complement of C(I, L) with respect to the usual inner product on F N q . Theorem 3. [4] Every linear code may be represented as an affine-variety code.
Let G be a Groebner basis for I q . An ordered pair of monomials (m 1 , m 2 ), with where the notation "f rem G" stands for the remainder of f modulo G.
We are going to define the order domain codes, thus we can translate the results on their minimum distance given in Theorem 4 into the language of semigroup.
and ≺ W be as in Example 2, with q = 2. (R/I, ≺ W ) is an order domain and then the code from the curve x 3 − y 2 − y over F 4 is an order domain code.
We observe that this code is called Hermitian code since it is obtained by evaluating at the points of the Hermitian curve.
Observe that also other algebraic geometric codes, such as norm-trace codes, Reed-Solomon codes and Hyperbolic codes can be put into a form satisfying the order domain conditions ( [8]).
and so it is at least One of the advantages of the order domain approach to algebraic geometric codes is given by the bound on the distance (1) provided in previous theorem, since this is a bound that can be easily computed from the knowledge of the semigroup.
2.3. Introduction to Hilbert quasi-polynomials. In the following we refer to [13] for standard notation.
Let I be a W -homogeneous ideal of (R, ≺ W ). The component of R/I of degree k ∈ N is given by ) and the Hilbert-Poincaré series of (R/I, ≺ W ) is given by When the grading given by W is clear from the context, we denote the Hilbert function and the Hilbert-Poincaré series of (R/I, ≺ W ) by H R/I and HP R/I , respectively.
By the Hilbert-Serre theorem, the Hilbert-Poincaré series of (R/I, ≺ W ) is a rational function, which is We recall that a function f : . . . , w n ) and let (R/I, ≺ W ) be as above. We now refer to [21] for Hilbert quasi-polynomial theory. There exists a unique quasi-polynomial P W R/I : H R/I (k) = P i (k) ∀i ≡ k mod d and ∀k 0.
P W R/I is called the Hilbert quasi-polynomial associated to (R/I, ≺ W ). Observe that if d = 1, then P W R/I is a polynomial, and it is simply the Hilbert polynomial. We underline that the Hilbert quasi-polynomial does not depend on the chosen monomial ordering ≺ M , but only on the variable weights. It consists of d polynomials, which are not necessarily distinct. The minimum integer k 0 ∈ N such that H R/I (k) = P W R/I (k) ∀ k ≥ k 0 is called generalized regularity index and we denote it by ri W (R/I). All the polynomials of the Hilbert quasi-polynomial P W R/I have rational coefficients and the same degree r ≤ n − 1, where the equality holds if and only if I = (0). In this latter case, the leading coefficient a n−1 is the same for all P i , with i = 0, . . . , d − 1, and a n−1 = wi .

Computational improvements for Hilbert quasi-polynomials, with an application to order domains
In this section we present an algorithm for an effective computation of Hilbert quasi-polynomials and we show how to exploit them for checking order domain conditions.
We have improved the Singular procedures showed in [2] to compute the Hilbert quasi-polynomial for rings K[x 1 , . . . , x n ]/I.
Before showing the algorithm and our improvement, we give some preliminary results.

Theorem 7. [19]
Let α 1 , . . . , α d be a fixed sequence of complex numbers, d ≥ 1 and α d = 0. The following condition on a function f : N → C are equivalent: (iii) For all n ≥ 0, . Then there is a unique finite set E f ⊂ N and a unique function (1 − γ i x) di as above, there are unique polynomials P 1 , . . . , P k for which (3)

holds for n sufficiently large. Then m(f ) is the largest integer n for which (3) fails.
Thanks to these two results, we are able to compute the generalized regularity index of R/I, once computed the Hilbert-Poincaré series of R/I.

Proof. By Theorem 7 and Proposition 1, and since
where ζ is a primitive dth root of unity and the Hilbert function can be written as where S i (k) is a polynomial in k of degree less than α i . Then, by uniqueness of the Hilbert quasi-polynomial of period d, we deduce that the ith polynomial of P R/I is given by P i (t) := d−1 j=0 S j (t)ζ ij and that H R/I (k) = P i (k) for k ≥ k 0 and k ≡ i mod d.

Remark 1. Since HP
(1−t w i ) , the generalized regularity index of R is 0.
Thanks to the following two results we can recover H W R/I (k) from H W R (k) and P W R/I from P W R , where W is obtained by W dividing each w i ∈ W by gcd(W ).

Proposition 3. LetĪ be the initial ideal of I and HP W R/Ī (t) = h(t) g(t) the Hilbert-Poincaré series of
we have . Then it holds: if a | i 3.1. Algorithm for computing Hilbert quasi-polynomials. Let (R/I, ≺ W ) be as usual, we wish to compute its Hilbert quasi-polynomial P W R/I := {P 0 , . . . , P d−1 }. Since we know some degree bounds for Hilbert quasi-polynomials, we can compute them by means of interpolation.
First of all, let us consider I = (0) and W such that the w i 's have no common factor. Each P j has degree equal to n − 1, so, given j = 0, . . . , d − 1, we want to calculate P j (x) := a 0 + a 1 x + · · · + a n−1 x n−1 such that ∀k ≥ 0 and k ≡ j mod d Therefore, let us consider the first n positive integers x r such that P j (x r ) = H R (x r ) x r := j + rd, for r = 0, . . . , n − 1.
By construction, the polynomial P j (x) interpolates the points (x r , H R (x r )).
Since we know the leading coefficient a n−1 , we can reduce the number of interpolation points x r , and we get a system of linear equations in the coefficients a i , with i = 0, . . . , n − 2. The system in matrix-vector form reads We observe that for computing P j the algorithm requires the computation of n − 1 values of the Hilbert function, the construction of a Vandermonde matrix of dimension n − 1 and its inversion. We have not yet shown how to calculate H R (x r ), for r = 0, . . . , n − 2.
Let k ∈ N. The problem of calculating H R (k) is equivalent to the problem of determining the number of partitions of an integer into elements of a finite set S := {w 1 , . . . , w n }, that is, the number of solutions in non-negative integers, α 1 , . . . , α n , of the equation α 1 w 1 + · · · + α n w n = k This problem was solved in [20], [10] and the solution is the coefficient of x k in the following power series We are going to give an efficient method for getting the coefficient of x k in the power series expansion of Equation (5). We refer to [14] for an in-depth analysis on the power series expansion of a rational function. Let be polynomials in C[x], where α 1 , . . . , α l are non-negative integers, all λ i 's are distinct and non-zero and the degree of f (x) is less than that of g(x).
Let ζ := ζ d be a primitive dth root of unity. Since for some pairwise disjoint subsets T 1 , . . . , T n ⊆ {0, . . . , d − 1}, we can apply Lemma 2 with g(x) := k i=1 (1 − x wi ) and f (x) = 1. Observing that any j in {0, . . . , d − 1} appears in exactly one of the T i 's, say T ι , and that ζ j appears ι times in the product, we obtain the following recursive formula for computing H R (k) It follows that if we know H R (i) for all i = 1, . . . , k − 1, we can easily compute H R (k) by means of (6).
Given an equation α 1 w 1 + · · · + α n w n = k the problem of counting the number of non-negative integer solutions α 1 , . . . , α n could be solved also using brute force. But, given k ∈ N, to compute H W R (k) with brute force needs O(k n ) operations, whereas the procedure which we have implemented has a quadratic cost in k, in fact it needs O(nk 2 ) operations ( [2]).
Up to now we have shown how to calculate P W R . For computing a Hilbert quasipolynomial P W R/I = {P 0 , . . . , P d−1 }, for any vector W and any homogeneous ideal I of R, the procedure computes first P W R , where W is obtained by dividing W by  gcd(w 1 , . . . , w n ), and then it produces P W R/I starting from P W R , using the relation between P W R and P W R/I showed in Lemma 1.b. We reduced the complexity of the algorithm presented in [2] by exploiting formulas for the 2th and 3rd coefficient of the Hilbert quasi-polynomial of R, whenever possible, and by computing the values of the Hilbert function once, instead of d times. In particular, the considered formulas, which are defined in [2], allow to reduce the dimension of the linear system (4) to be solved in order to compute the Hilbert quasi-polynomials P W R . We compare experimentally the difference of speed of the two algorithms for computing H W R , that in [2] and ours, with R = K[x 1 , . . . , x n ] where n ∈ {2, . . . , 5} and W a random vector of weights w i ∈ [1, . . . , 12]. The following table summarizes the results obtained using an Intel(R) Core(TM) i3-6100 CPU @ 3.70 GHz processor and 8 GB of RAM. n W Old Algorithm Time in ms New Algorithm Time in ms 2 [1,3] 20 0 3 [2,5,12] 3300 580 4 [1,4,5,8] 1080 140 5 [2,2,6,9,12] 5340 230 For n ≥ 6, we have to choose suitably low weights w i , otherwise we encounter software limitation of Singular. For example, for n = 6 we set W = [1,1,1,2,2,9], and the old algorithm obtains some Int-overflow errors, and then it computes wrongly 4 of the 18 polynomials of H W R , in 1050 ms, whereas our algorithm computes correctly all the 18 polynomials in 100 ms.

3.2.
Hilbert quasi-polynomials for order domain codes. To test if a pair (R/I, ≺ W ) satisfies the order domain condition (C1), it suffices to compute a Groebner basis of I w.r.t. ≺ W and, for each polynomial in the basis, to check the two monomials of highest weight. Whereas, for the condition (C2) we would need to study the ideal I or the semigroup N ≺ W (I). We give an alternative and efficient way to establish if the condition (C2) is respected by I and ≺ W . for the values 0 ≤ k < ri W (R/Ī). If the previous test does not fail we can compute, using the algorithm showed in Section 3.1, the quasipolynomial of R/Ī, completing the test of the second condition described in Corollary 1. We would like to point out an interesting aspect of our approach. For our computation of Hilbert quasi-polynomials it is essential to work in a characteristic-0 field. In our applications, e.g. to coding theory, we can have positive characteristic fields for the order domain. However, the actual field matters only for the computation of the Groebner basis of I. Once the Groebner basis has been obtained, the monomials under the Hilbert staircase are the same for any field and so we can consider the leading monomials of the obtained Groebner basis as if they were on a characteristic-zero field.

Applications to codes from maximal curves
A maximal curve over a finite field F q is a projective geometrically irreducible non-singular algebraic curve defined over F q whose number of F q -rational points attains the Hasse-Weil upper bound where g is the genus of the curve. Maximal curves, especially those having large genus with respect to q, are known to be very useful in coding theory. In this section, we show some examples of affine-variety codes constructed over maximal curves, which are also order domains.
Let I = (y 16  (1−t 7 )(1−t 16 ) and so ri W (R/Ī) = 90, which means that we are left with computing H R/Ī (k), with 0 < k < 90. With our recursive algorithm we can easily see that all obtained values are in {0, 1}. Then we can conclude that (R/I, ≺ W ) is an order domain.
In the previous example we could avoid to compute the Hilbert function for values less than 90, thanks to the following lemma. Proof. Suppose by contradiction H R/Ī (k) ∈ {0, 1} for somek ≥ 0, then there exist two distinct monomials m 1 , m 2 ∈ R/Ī with the same weightk. For all α n ≥ 0 also the monomials m 1 x αn n , m 2 x αn n ∈ R/Ī, and they are distinct with the same weight k + α n w n . In particular, it holds also fork + α n w n ≥ ri W (R/Ī), but this contradicts our hypothesis on the Hilbert quasi-polynomial of R/Ī.

Remark 3.
If I and ≺ W satisfy the hypothesis of Proposition 4, then (R/I, ≺ W ) is an order domain.
Example 12. Let q > 2 be a prime power. The GK-curve, introduced by Giulietti and Korchmaros in [9], is the curve C 3 ⊆ P 3 defined over F q 6 by the affine equations v q+1 = u q + u and w where h(u) = (u q + u) q−1 − 1. This curve is maximal over F q 6 and it is so far the only known example of a maximal curve which cannot be dominated by the Hermitian curve. It turns out in [5] that C 3 can also be defined by the equations v q+1 = u q + u and w We are going to investigate if C 3 , with an opportune generalized weighted degree ordering ≺ W , defines an order domain. Let q = 3, and Obviously, G = {v 4 − u 3 − u, w 7 − v 9 + v} is a Groebner basis for I andĪ = (v 4 , w 7 ). In order to satisfy condition (C1), we set W = [28, 21,27]. Note that, up to a constant factor, W is unique. Since lcm(28, 21, 27) = 756, we have computed the Hilbert quasi-polynomial P R/Ī = {P 0 , . . . , P 755 } of (R/Ī, ≺ W ). Since each P i turns out to be 1, thanks to the remark above, we can conclude that (R/I, ≺ W ) is an order domain.

Conclusions and further comments
Algorithm 10 allows to decide effectively if a quotient ring can be seen as an order domain w.r.t. a generalized weighted degree ordering. It can be applied to coding theory, and it can indeed solve some interesting examples, as we have shown, and as such we believe it can become a convenient tools for coding theorists working with algebraic geometric codes.
We see at least two paths to follow in order to increase the impact of our approach, as we elaborate below.
An advantage of order domain codes (with respect to more traditional codes over curves) is that we can build them on higher dimensions variety, e.g. the surface in Example 51 [1]. The higher dimension requires generalized weighted degree orderings ≺ W , with W ∈ (N r + ) n and r ≥ 2, that cannot be tackled by our present theory and algorithms. Therefore, we believe that this extension is natural and worth studying.
In addition, our algorithm is well-suited when a given variety has been chosen to build the code. Often it happens that we know an infinite family of varieties that would be ideal to build codes on them, e.g. known families of maximal curves. In this situation we would need to adapt our computational approach to a more theoretical one, in order to use the core ideas of our algorithm for generating general proofs.