Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve documentation for degree() method of singular multivariate polynomials #37567

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading