Macaulay2 » Documentation
Packages » NCAlgebra :: setWeights
next | previous | forward | backward | up | index | toc

# setWeights -- Set a nonstandard grading for a NCRing.

- Usage:
    `setWeights(A,degList)`
- Inputs:
  - A, an instance of the type NCRing,
  - degList, a list, a list of integer weights to be assigned to the generators of A
- Outputs:
  - an instance of the type NCRing,

## Description

This method enables the user to work with rings which are not naturally graded (the generators are not all degree 1). The user should be aware that methods which call Bergman may not work with nonstandard gradings. Perhaps the most important example is hilbertBergman, which throws an error. Instead, use hilbertSeries.

    i1 : A=QQ{x,y,z}

    o1 = A

    o1 : NCPolynomialRing

    i2 : w=x^3-y^2

           2  3
    o2 = -y +x

    o2 : A

    i3 : isHomogeneous w

    o3 = false

    i4 : setWeights(A, {2,3,1})

    o4 = A

    o4 : NCPolynomialRing

    i5 : isHomogeneous w

    o5 = true

    i6 : C = QQ{a,b,c}

    o6 = C

    o6 : NCPolynomialRing

    i7 : g = ncMap(C,A,{a^3,b^2,a+b,a-b})

    o7 = NCRingMap C <--- A

    o7 : NCRingMap

    i8 : isHomogeneous g

    o8 = false

    i9 : setWeights(A,{3,2,1,1})

    o9 = A

    o9 : NCPolynomialRing

    i10 : isHomogeneous g

    o10 = true

## See also

- isHomogeneous -- whether something is homogeneous (graded)

## Ways to use setWeights:

- `setWeights(NCRing,List)`

## For the programmer

The object setWeights is a method function.

The source of this document is in /build/macaulay2-88fgJW/macaulay2-1.25.11+ds/M2/Macaulay2/packages/NCAlgebra/NCAlgebraDoc.m2:2192:0.