-
-
Notifications
You must be signed in to change notification settings - Fork 698
Open
Description
sage: t = QQ[['t']].0
sage: sqrt(1+t)
1 + 1/2*t - 1/8*t^2 + 1/16*t^3 - 5/128*t^4 + 7/256*t^5 - 21/1024*t^6 + 33/2048*t^7 - 429/32768*t^8 + 715/65536*t^9 - 2431/262144*t^10 + 4199/524288*t^11 - 29393/4194304*t^12 + 52003/8388608*t^13 - 185725/33554432*t^14 + 334305/67108864*t^15 - 9694845/2147483648*t^16 + 17678835/4294967296*t^17 - 64822395/17179869184*t^18 + 119409675/34359738368*t^19 + O(t^20)
sage: sqrt(2+t)
------------------------------------------------------------
Traceback (most recent call last):
Now this error is expected because sqrt() has an extend keyword that allows to extend the base ring, and to give the name of the generator of the quadratic field, but this does not work:
sage: K.<t> = PowerSeriesRing(QQ, 5)
sage: (t+2).sqrt(extend=True, name='sqrt2')
sqrt2
The expected output would be sqrt2 + sqrt2*x/4 + sqrt2*x^2/32 +...
However, more convenient would be to make the default of extend to be True and for square roots of integers N the name sqrtN provided. Only raise an error for nonintegers if no name is given.
Component: commutative algebra
Keywords: power series
Issue created by migration from https://trac.sagemath.org/ticket/3354