Mathematically, the degree of a nonzero polynomial is the negative of its valuation at infinity, i.e. the valuation for which 1/x is a uniformiser.
On Fri, 1 Mar 2024, 19:29 Travis Scrimshaw, <tcscr...@gmail.com> wrote: > Some quick data points: > > - The general graded modules (and hence algebras) code raises an error for > `0` since it is defined there by the direct summand the element belongs to > (and `0` belongs to all of them. > - For polynomials, it is very useful to have a single check `f.degree() > > k` for some `k`. Having error messages or check `f.is_zero()` first makes > things more complicated. > - Comparisons of integers to `-infinity` is (relatively) expensive. > Although this happening frequently seems unlikely. > > Martin, note that Dima is calling degree with a min/max qualifier added in > front. I think this is leading to some confusion and cross-talk. However, I > think it is better to have easily separable terms "valuation" and "degree" > (which exist for polynomials). > > Best, > Travis > > On Saturday, March 2, 2024 at 3:44:55 AM UTC+9 Martin R wrote: > >> I don't get it - are my previous messages invisible? >> >> 1st Message: I don't understand - `degree` doesn't make much sense for >> Laurent series - there is no way to determine the degree of a LaurentSeries >> and no way to determine the degree of a LazyLaurentSeries with one minor >> exception - which is when it is known that the series terminates, but >> that's rare. >> >> 2nd Message: I am very much against this. I realise that this is a >> convention one uses in mathematics, but here it would be extremely >> confusing: in the lazy series code we use valuation a lot, and it must mean >> lowest degree, but we also use the degree of polynomials and Laurent >> polynomials and we must distinguish between the two. >> >> I feel a bit ignored, >> >> Martin >> >> >> On Friday 1 March 2024 at 19:29:26 UTC+1 Giacomo Pope wrote: >> >> As an aside, the univariate LaurentPolynomialRing had a notion of >> `valuation` but the multivariate one didn't... >> >> In the PR: https://github.com/sagemath/sage/pull/37490 I added random >> elements but also a notion of valuation() for the multivariate case and >> just made it act similarly to the univariate one. >> >> On Friday, March 1, 2024 at 6:18:01 PM UTC Nils Bruin wrote: >> >> On Friday 1 March 2024 at 09:49:15 UTC-8 Giacomo Pope wrote: >> >> Following this discussion, I have made a draft PR to change the degree >> for *only* the LaurentPolynomialRing and I will see if the CI detects >> anything. >> >> https://github.com/sagemath/sage/pull/37513 >> >> I agree that if we change the LaurentPolynomialRing we should also change >> the `LaurentSeriesRing`, at the moment `LazyLaurentSeriesRing` has no >> method `degree()` but *does* have a `valuation()` method... so this is odd. >> >> >> OK, let's keep it that way then! I don't think there is a notion on >> LaurentSeriesRing that deserves the name "degree". Sorry about mixing that >> one in. I thought it existed. And I think it does: >> >> sage: R.<x>=LaurentSeriesRing(QQ) >> sage: z=R(0) >> sage: z.valuation() >> +Infinity >> sage: z.degree() >> -1 >> >> but if it's not documented, perhaps we can just ignore it. >> >> -- > You received this message because you are subscribed to the Google Groups > "sage-devel" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to sage-devel+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/sage-devel/6a9a6131-8c51-4760-9fad-897e220bfd1fn%40googlegroups.com > <https://groups.google.com/d/msgid/sage-devel/6a9a6131-8c51-4760-9fad-897e220bfd1fn%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/CAD0p0K4_PhM3U_gj6siv_gBH-oBefwV%2Bq7f9y0Zie27i_y%2B2iA%40mail.gmail.com.