Degree of a monomial in Macaulay2?

26 Views Asked by At


Instead of defining a monomial ordering in Macaulay2, I would like to get the vector of degrees of a monomial. For example, if I define

R=QQ[x,y]
p=x^2*y^5

I would like to get, from p, the vector (2,5) giving the corresponding degrees. How can I do this?
Thanks a lot!

1

There are 1 best solutions below

1
On

You probably want to use a multigrading.

i1 : QQ[x,y, Degrees => {{0,1},{1,0}}];

i2 : degree(x^2*y^5)

o2 : {2,5}

See also the documentation.