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/6a79e795-60d5-4385-b2fb-79e53be18bc1n%40googlegroups.com.