-
-
Notifications
You must be signed in to change notification settings - Fork 679
Closed
Milestone
Description
Both Laurent and power series ring elements have a default precision of 20. OTOH, symbolic series expansions need the precision set:
sage: R.<t> = LaurentSeriesRing(QQ)
sage: 1/(1-t)
1 + t + t^2 + t^3 + t^4 + t^5 + t^6 + t^7 + t^8 + t^9 + t^10 + t^11 + t^12 + t^13 + t^14 + t^15 + t^16 + t^17 + t^18 + t^19 + O(t^20)
sage: var('x')
x
sage: ex=1/(1-x)
sage: ex.series(x)
...
TypeError: series() takes exactly 2 positional arguments (1 given)
This ticket proposes to unify the behaviour by allowing the following:
sage: ex.series(x)
1 + 1*x + 1*x^2 + 1*x^3 + 1*x^4 + 1*x^5 + 1*x^6 + 1*x^7 + 1*x^8 + 1*x^9 + 1*x^10 + 1*x^11 + 1*x^12 + 1*x^13 + 1*x^14 + 1*x^15 + 1*x^16 + 1*x^17 + 1*x^18 + 1*x^19 + Order(x^20)
As this is about reducing surprise for the user both algebra and symbolic series default precision should have the same value, so the ticket should also implement such a global value.
This ticket also deprecates the use of LaurentSeriesRing_generic.set_default_prec as it contradicts the immutability of parents and conflicts with the caching of LaurentSeriesRings.
Component: algebra
Keywords: series precision
Author: Ralf Stephan
Branch/Commit: 0d7da1b
Reviewer: Clemens Heuberger
Issue created by migration from https://trac.sagemath.org/ticket/16201