Values of Hilbert function

Is there a built in sage command to get values of the Hilbert function of an ideal? Of course for for large enough integers the value of the Hilbert function is equal to the value of the Hilbert polynomial, and there is a command to in sage for the Hilbert polynomial. But I need the values of the Hilbert function for small integers. Also, I could use the command for Hilbert series but the output is a rational function that I have to expand in a power series in order to see the values of the Hilbert function. Is there a built in command to give me the value directly?

edit retag close merge delete

Sort by » oldest newest most voted Well, there is no built-in function, but you can make your own:

sage: rng = QQ['x, y']
sage: rng.inject_variables()
Defining x, y
sage: I = rng.ideal([x**3, y*x**2, y**10*x])
sage: I.hilbert_series()
(t^11 + t^3 - t^2 - t - 1)/(t - 1)
sage: def hilbert_coeffs(ideal):
....:     t = PowerSeriesRing(QQ, 't').gen()
....:     return ideal.hilbert_series()(t).coefficients()
....:
sage:
sage: hilbert_coeffs(I)
[1, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1]
more