Macaulay2 » Documentation
Packages » Macaulay2Doc :: hilbertFunction
next | previous | forward | backward | up | index | toc

hilbertFunction -- the Hilbert function

Synopsis

Description

In the following example, compare the rank of the source of the basis map to the number provided by hilbertFunction.

i1 : R = QQ[x,y,z, Degrees=>{3:{1,1}}];
i2 : hilbertFunction({3,3}, R)

o2 = 10
i3 : basis({3,3},R)

o3 = | x3 x2y x2z xy2 xyz xz2 y3 y2z yz2 z3 |

             1      10
o3 : Matrix R  <-- R

The standard meaning of subscripts on functions permits a simpler syntax to be used.

i4 : hilbertFunction_{3,3} R

o4 = 10

Here is a singly graded example.

i5 : R = QQ[x,y,z];
i6 : hilbertFunction({3}, R)

o6 = 10
i7 : hilbertFunction(3, R)

o7 = 10

Here is an example with a module.

i8 : R = QQ[a..d, Degrees=>{4:{1,1}}];
i9 : M = coker matrix {{a,c,d},{c,b,d}}

o9 = cokernel | a c d |
              | c b d |

                            2
o9 : R-module, quotient of R
i10 : hilbertFunction({2,2}, M)

o10 = 8
i11 : B = basis({2,2},M)

o11 = | b2 bc c2 cd d2 0  0  0  |
      | 0  0  0  0  0  a2 ac c2 |

                    8
o11 : Matrix M <-- R
i12 : numgens source B

o12 = 8

Here is an example with an ideal.

i13 : R = QQ[a..f, Degrees=>{6:{1,1}}];
i14 : I = ideal (a*b, c*d, e*f);

o14 : Ideal of R
i15 : hilbertFunction({2,2}, I)

o15 = 18
i16 : S = R/I;
i17 : basis({2,2},S)

o17 = | a2 ac ad ae af b2 bc bd be bf c2 ce cf d2 de df e2 f2 |

              1      18
o17 : Matrix S  <-- S

If d is not given, then a function is returned that will accept different values of d.

i18 : R = QQ[a..d];
i19 : I = monomialCurveIdeal(R, {1,2,3});

o19 : Ideal of R
i20 : h = hilbertFunction I

o20 = h

o20 : FunctionClosure
i21 : h 1

o21 = 4
i22 : h 2

o22 = 7

Caveat

It can be much faster to compute a basis for the desired degree, because hilbertFunction works by expanding the Hilbert series to a sufficiently high order, thus, in effect, computing many values of the Hilbert function simultaneously. If several values of the Hilbert function are desired, it is best to compute the ones of higher degree first, so the expansion will be done to sufficiently high order at the first attempt, and thus be done just once.

See also

Ways to use hilbertFunction :

For the programmer

The object hilbertFunction is a method function.