next | previous | forward | backward | up | top | index | toc | home

hilbertFunction(List,Module) -- compute the Hilbert function of a module

Synopsis

Description

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

o2 = cokernel | a c d |
              | c b d |

                            2
o2 : R-module, quotient of R
i3 : hilbertFunction({2,2}, M)

o3 = 8
i4 : B = basis({2,2},M)

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

o4 : Matrix
i5 : numgens source B

o5 = 8
The last command numgens source counts the number of columns in this matrix.

In the case where the ring is singly graded, then instead of having the input be a list of length 1 containing the degree, it is sufficient to write an integer.

i6 : R = QQ[a..d];
i7 : M = coker matrix {{a,c,d},{c,b,d}}

o7 = cokernel | a c d |
              | c b d |

                            2
o7 : R-module, quotient of R
i8 : hilbertFunction(2, M)

o8 = 8
i9 : basis(2,M)

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

o9 : Matrix

Caveat

This requires a homogeneous module to compute properly, but will output something if run on a module which is not homogeneous.