If M is finite dimensional over k, the degree of M is its dimension over k. Otherwise, the degree of M is the multiplicity of M, i.e., the integer d such that the Hilbert polynomial of M has the form z |--> d z^e/e! + lower terms in z.
i1 : R = ZZ/101[t,x,y,z]; |
i2 : degree (R^1 / (ideal vars R)^6) o2 = 126 |
i3 : degree minors_2 matrix {{t,x,y},{x,y,z}} o3 = 3 |
The algorithm computes the poincare polynomial of M, divides it by 1-T as often as possible, then evaluates it at T=1. When the module has finite length, the result is the Hilbert series evaluated at 1, that is the dimension over the ground field, which for a graded (homogenous) is the same as the length.