next | previous | forward | backward | up | top | index | toc | Macaulay2 web site
Macaulay2Doc > rings > monomial orderings > examples of specifying alternate monomial orders

examples of specifying alternate monomial orders

For definitions of these monomial orders, see GRevLex, Lex, Weights, Eliminate, GroupLex, GroupRevLex, RevLex, and NCLex.

Graded reverse lexicographic order

i1 : R = ZZ[a..d];
i2 : a+b^100+c*d

      100
o2 = b    + c*d + a

o2 : R

Lexicographic order

i3 : R = ZZ[a..d, MonomialOrder=>Lex];
i4 : a+b^100+c*d

          100
o4 = a + b    + c*d

o4 : R

Weight order

i5 : R = ZZ[a..d, MonomialOrder => Weights => {201,2}];
i6 : a+b^100+c*d

          100
o6 = a + b    + c*d

o6 : R

Graded lexicographic order

i7 : R = ZZ[a..d, MonomialOrder=>{Weights=>4:1,Lex}];
i8 : a+b^100+c*d

      100
o8 = b    + c*d + a

o8 : R

Elimination order

To use an elimination order, which eliminates the first 2 variables, use
i9 : R = ZZ[a..f, MonomialOrder=>Eliminate 2];
i10 : a+b^100+c*d

       100
o10 = b    + a + c*d

o10 : R
Alternatively, use a weight vector
i11 : R = ZZ[a..f, MonomialOrder=>Weights=>2:1];
i12 : a+b^100+c*d

       100
o12 = b    + a + c*d

o12 : R

Product (block) order

To make a product order where each block has the GRevLex order:
i13 : R = ZZ[a..f, MonomialOrder=>{2,4}];
i14 : a^2*(c+d) + b*(c^100+d^100)*(c + e + f)

       2     2       101        100      100       100       100       100
o14 = a c + a d + b*c    + b*c*d    + b*c   e + b*d   e + b*c   f + b*d   f

o14 : R
The orders in each block can be other orders as well.
i15 : R = ZZ[a..f, MonomialOrder=>{Weights=>2:1,Lex}]

o15 = R

o15 : PolynomialRing
i16 : a^2*(c+d) + b*(c^100+d^100)*(c + e + f)

       2     2       101      100       100         100      100       100
o16 = a c + a d + b*c    + b*c   e + b*c   f + b*c*d    + b*d   e + b*d   f

o16 : R

GroupLex

This order is useful for making degree rings, and allows some variables to appear with negative exponent.
i17 : R = ZZ[a..f, MonomialOrder => GroupLex => 3];
i18 : a^-2*(c+d) + b*(c^100+d^100)*(c + e + f)

         101      100       100         100      100       100     -2     -2
o18 = b*c    + b*c   e + b*c   f + b*c*d    + b*d   e + b*d   f + a  c + a  d

o18 : R

GroupRevLex

This order is useful for making degree rings, and allows some variables to appear with negative exponent. Not implemented yet.

RevLex

Warning: this is a local ordering, not a global ordering.
i19 : R = ZZ[a..f, MonomialOrder=>RevLex, Global=>false];
i20 : a^2*(c+d) + b*(c^100+d^100)*(c + e + f)

         100       100         100      100       100       101    2     2
o20 = b*d   f + b*d   e + b*c*d    + b*c   f + b*c   e + b*c    + a d + a c

o20 : R

NCLex

For non-commutative Gröbner bases. Not implemented yet.

See also