Macaulay2 » Documentation
Packages » Macaulay2Doc » The Macaulay2 language » lists and sequences » BasicList » RingElement » degree(RingElement)
next | previous | forward | backward | up | index | toc

# degree(RingElement)

- Function: degree
- Usage:
    `degree f`
- Inputs:
  - f, a ring element, a ring element or vector
- Outputs:
  - a list, the degree or multidegree of f

## Description

In Macaulay2, the degree of a polynomial is a list of integers. This is to accommodate polynomial rings having multigradings. The usual situation is when the ring has the usual grading: each variable has length 1.

    i1 : R = QQ[a..d];

    i2 : degree (a^3-b-1)^2

    o2 = {6}

    o2 : List

When not dealing with multigraded rings, obtaining the degree as a number is generally more convenient:

    i3 : first degree (a^3-b-1)^2

    o3 = 6

    i4 : S = QQ[a..d,Degrees=>{1,2,3,4}];

    i5 : first degree (a+b+c^3)

    o5 = 9

    i6 : T = QQ[a..d,Degrees=>{{0,1},{1,0},{-1,1},{3,4}}];

    i7 : degree c

    o7 = {-1, 1}

    o7 : List

In a multigraded ring, the degree of a polynomial whose terms have different degrees is perhaps non-intuitive: it is the maximum (in each of the component degree) over each term:

    i8 : degree c^5

    o8 = {-5, 5}

    o8 : List

    i9 : degree d

    o9 = {3, 4}

    o9 : List

    i10 : degree (c^5+d)

    o10 = {3, 5}

    o10 : List

## See also

- isHomogeneous -- whether something is homogeneous (graded)
- degreeLength -- the length of the degree vector

## Ways to use this method:

- degree(RingElement)
- `degree(Vector)`

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