On Fri, Mar 1, 2024 at 5:58 PM 'Martin R' via sage-devel < sage-devel@googlegroups.com> wrote:
> 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. > with series (power series, or formal Laurent series) the degree is naturally the minimal degree, not the maximal one. (for a non-0 series; ought to be -oo for 0). > On Friday 1 March 2024 at 18:49:15 UTC+1 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. >> >> On Friday, March 1, 2024 at 5:29:53 PM UTC Martin R wrote: >> >>> Could you expand on 'the whole valuation interpretation of "degree" goes >>> out of the window'? What do you mean with "valuation interpretation"? >>> >>> Is raising an exception out of the question? >>> >>> On Friday 1 March 2024 at 18:11:40 UTC+1 Nils Bruin wrote: >>> >>>> On Friday 1 March 2024 at 04:26:43 UTC-8 Dima Pasechnik wrote: >>>> >>>> >>>> It seems that exactly the same algorithm will work (I didn't check >>>> this!) for Laurent polynomials (they still form a Euclidean domain), and >>>> there you better set degree(0)=-oo, otherwise it's going to be a problem. >>>> >>>> I think it's been established >>>> that LaurentPolynomialRing(QQ,'x').zero().degree() == -1 is problematic. >>>> With the definition that (1/x).degree() == -1 it clearly is. >>>> >>>> I think the question is more: do we have enough evidence that setting >>>> degree(0) == -oo for *all* polynomial rings is significantly better (if >>>> better at all) that it's worth the pain and incompatibilities that would >>>> ensue from changing the rest of sage as well? That's not so clear to me. >>>> From the perspective of multivariate polynomials, the whole valuation >>>> interpretation of "degree" goes out of the window, so there "-1" is largely >>>> available and quite possibly used extensively by the underlying libraries. >>>> >>>> I guess one could see what happens if the change is made to Laurent >>>> polynomials (and Laurent series as well, perhaps?). Based on how that goes >>>> one could re-evaluate degrees of 0 polynomials in other polynomial rings. >>>> >>>> Alternatively, we could deprecate degree on them in favour of using >>>> valuation-inspired terms instead, where the extension val(0)=oo is more >>>> universal. As Oscar's example in Matlab shows, the concept of degree gets >>>> (mis)used for other, more implementation-oriented definitions as well, so >>>> perhaps the term should just be avoided for Laurent polynomials. >>>> >>> -- > 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/b6ede155-fb29-4607-be7b-b028ce39e973n%40googlegroups.com > <https://groups.google.com/d/msgid/sage-devel/b6ede155-fb29-4607-be7b-b028ce39e973n%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/CAAWYfq3O5t0X6Arwt-A2%3D464xXMQsX87zm7a%3DE8JEf55ac5e0Q%40mail.gmail.com.