In Macaulay2, each free module over a polynomial ring comes equipped with a
monomial order and this routine returns the matrix whose
i-th column is the lead term of the
i th column of
f.
i1 : R = QQ[a..d];
|
i2 : f = matrix{{0,a^2-b*c},{c,d}}
o2 = | 0 a2-bc |
| c d |
2 2
o2 : Matrix R <--- R
|
i3 : leadTerm f
o3 = | 0 a2 |
| c 0 |
2 2
o3 : Matrix R <--- R
|
Coefficients are included in the result:
i4 : R = ZZ[a..d][x,y,z];
|
i5 : f = matrix{{0,(a+b)*x^2},{c*x, (b+c)*y}}
o5 = | 0 x2a+x2b |
| xc yb+yc |
2 2
o5 : Matrix R <--- R
|
i6 : leadTerm f
o6 = | 0 x2a |
| xc 0 |
2 2
o6 : Matrix R <--- R
|
The argument
f can also be
a Groebner basis, in which case the lead term matrix of the generating matrix of
f is returned.