Skip to content

Commit

Permalink
gh-37567: Improve documentation for degree() method of singular mul…
Browse files Browse the repository at this point in the history
…tivariate polynomials

    
Following the discussion of #37513,
it was decided that the documentation of the degree function could be
improved.

Following the comment
#37513 (comment) this
has been made into a separate PR.
    
URL: #37567
Reported by: Giacomo Pope
Reviewer(s): nbruin
  • Loading branch information
Release Manager committed Mar 29, 2024
2 parents c7bf519 + c2ff366 commit f55c3c5
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions src/sage/rings/polynomial/multi_polynomial_libsingular.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -2543,12 +2543,11 @@ cdef class MPolynomial_libsingular(MPolynomial_libsingular_base):
OUTPUT:
If ``x`` is not given, return the maximum degree of the monomials of
the polynomial. Note that the degree of a monomial is affected by the
gradings given to the generators of the parent ring. If ``x`` is given,
it is (or coercible to) a generator of the parent ring and the output
is the maximum degree in ``x``. This is not affected by the gradings of
the generators.
If ``x`` is ``None``, return the total degree of ``self``. Note that
this result is affected by the weighting given to the generators of the
parent ring. Otherwise, if ``x`` is (or is coercible to) a generator of
the parent ring, the output is the maximum degree of ``x`` in ``self``.
This is not affected by the weighting of the generators.
EXAMPLES::
Expand All @@ -2563,6 +2562,19 @@ cdef class MPolynomial_libsingular(MPolynomial_libsingular_base):
sage: (y^10*x - 7*x^2*y^5 + 5*x^3).degree(y)
10
When the generators have a grading (weighting) then the total degree
respects this, but the degree for a given generator is unaffected::
sage: T = TermOrder("wdegrevlex", (2, 3))
sage: R.<x, y> = PolynomialRing(QQ, order=T)
sage: f = x^2 * y + y^4
sage: f.degree()
12
sage: f.degree(x)
2
sage: f.degree(y)
4
The term ordering of the parent ring determines the grading of the
generators. ::
Expand Down

0 comments on commit f55c3c5

Please sign in to comment.