next | previous | forward | backward | up | top | index | toc | Macaulay2 web site
Macaulay2Doc :: hilbertFunction

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];,

o6 = (, )

o6 : Sequence
i7 : hilbertFunction({3}, R)

o7 = 10
i8 : hilbertFunction(3, R)

o8 = 10
Here is an example with a module.
i9 : R = QQ[a..d, Degrees=>{4:{1,1}}];
i10 : M = coker matrix {{a,c,d},{c,b,d}}

o10 = cokernel | a c d |
               | c b d |

                             2
o10 : R-module, quotient of R
i11 : hilbertFunction({2,2}, M)

o11 = 8
i12 : B = basis({2,2},M)

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

o12 : Matrix
i13 : numgens source B

o13 = 8
Here is an example with an ideal.
i14 : R = QQ[a..f, Degrees=>{6:{1,1}}];
i15 : I = ideal (a*b, c*d, e*f);

o15 : Ideal of R
i16 : hilbertFunction({2,2}, I)

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

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

              1       18
o18 : Matrix S  <--- S

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 :