Macaulay2 » Documentation
Packages » Macaulay2Doc » rings » polynomial rings » monomial orderings » Weights
next | previous | forward | backward | up | index | toc

# Weights -- assigning weights to the variables

## Description

Given a list L of n integers, the weight order on a polynomial ring in n variables is defined by: x^A > x^B if A_1 L_1 + ... + A_n L_n > B_1 L_1 + ... + B_n L_n.

The leading component of a polynomial under a weight order need not be a monomial. When two monomials have the same weight, by default they are further distinguished with the GRevLex order.

    i1 : R = QQ[a..d,MonomialOrder=>{Weights => {-1,2,3,4}},Global=>false];

    i2 : f = a^2 + b+ c^2 + b*d

          2              2
    o2 = c  + b*d + b + a

    o2 : R

    i3 : leadTerm f

          2
    o3 = c

    o3 : R

However, we can retrieve the entire leading component with the command leadTerm(1,f). The plain leadTerm f is in this case the same as leadTerm(2,f): they both use the full specification of the monomial ordering, first by weight and then by the GRevLex order. In contrast, leadTerm(1,f)only distinguishes monomials by the first, i.e., weight, specification.

    i4 : leadTerm(1,ideal(f))

                2
    o4 = ideal(c  + b*d)

    o4 : Ideal of R

The weight order may be combined with further ordering elements to break ties. In the following example, we use a second weight vector to break ties under first weight vector.

    i5 : R = QQ[a..d,MonomialOrder=>{Weights => {1,2,3,4}, Weights => {2,4,2,1}}];

    i6 : f = a^6 + b^3+ c^2

          6    3    2
    o6 = a  + b  + c

    o6 : R

    i7 : leadTerm(f)

          6
    o7 = a

    o7 : R

    i8 : leadTerm(1, ideal(f))

                6    3    2
    o8 = ideal(a  + b  + c )

    o8 : Ideal of R

    i9 : leadTerm(2, ideal(f))

                6    3
    o9 = ideal(a  + b )

    o9 : Ideal of R

    i10 : leadTerm(3, ideal(f))

                 6
    o10 = ideal a

    o10 : Ideal of R

leadTerm(3, ideal(f)) uses both the specified weights and the GRevLex order to calculate the leading component.

When the number of weights is smaller than the number of variables, the remaining variables are given weight 0. In the following example, c and d have weight 0.

    i11 : R = QQ[a..d,MonomialOrder=>{Weights => {1,2}, Lex}];

    i12 : f = a^2 + b+ c^2 + b*d

           2              2
    o12 = a  + b*d + b + c

    o12 : R

## See also

- leadTerm -- get the greatest term

## Functions with optional argument named Weights:

- `betti(...,Weights=>...)` -- see betti(BettiTally) -- view and set the weight vector of a Betti diagram
- `minimalBetti(...,Weights=>...)` -- see minimalBetti -- minimal betti numbers of (the minimal free resolution of) a homogeneous ideal or module
- monoid(...,Weights=>...) -- specify weights of the variables
- `newRing(...,Weights=>...)` -- see newRing -- make a copy of a ring, with some features changed
- `regularity(...,Weights=>...)` -- see regularity -- compute the Castelnuovo-Mumford regularity
- `symmetricAlgebra(...,Weights=>...)` -- see symmetricAlgebra -- the symmetric algebra of a module
- `tensor(Monoid,Monoid,Weights=>...)` -- see tensor(Monoid,Monoid) -- tensor product of monoids
- `tensor(Ring,Ring,Weights=>...)` -- see tensor(Monoid,Monoid) -- tensor product of monoids

## For the programmer

The object Weights is a symbol.

The source of this document is in /build/macaulay2-88fgJW/macaulay2-1.25.11+ds/M2/Macaulay2/packages/Macaulay2Doc/ov_monomial_orderings.m2:515:0.