I definitely get your point but completely disagree with the compromise.
I think that functions that behave differently depending on the
arithmetic nature of the object should simply not exist. The worst being
sage: 4.sqrt().parent()
Integer Ring
sage: 2.sqrt().parent()
Symbolic Ring
In other words my motto is: the parent of the ouptut should be
determined by the parent of the input.
If I am not mistaken, one can take a degree 2 extension in the example
by considering the ring of Puiseux series in u = (2t)^(1/2). Not very
convenient to work with because of denominators but well defined
(2t + t^3)^(1/2) = u + 1/16*u^5 - 1/512*u^9 + ...
Would it be acceptable?
Vincent
On 21/12/2017 11:59, John Cremona wrote:
I agree that the behaviour you would like is desirable in some
circumstances, but possibly not all. Note that to get the square root of
your power series, as well as adjoining t^{1/2} when the valuation is odd,
you also need to adjoin the square root of the leading coefficient (if it
is not a square). In your example the square roots are power series in
t^{1/2} with coefficients in QQ(\sqrt{2}). So you could argue that you
would be making a degree 4 extension to get a square root, which is
overkill. (In an analogous way perhaps some people might extend Q to get
(-2).sqrt() by adjoinging I=sqrt(-1) and sqrt(2), and say that the answer
is sqrt(2)*I. I know that I would not give that as the answer, but I bet
many people who are not number theorists would "simplify" sqrt(-2) like
that).
Perhaps the simplest quadratic extension for your example would be QQ[[s]]
with s^2=2*t. How about that as a compromise? i.e. if the lowest order
term is not an n'th power then adjoin its n'th root?
John
On 21 December 2017 at 11:17, Vincent Delecroix <[email protected]>
wrote:
Dear all,
I might introduce a non backward incompatible change for square root (and
more generally n-th roots) of power series.
While working on [1] I stumbled on a weird implementation of square root
for power series [2]. Namely, when extend=True it might just return a
formal element p so that p^2 is the initial series (example at [3])
sage: K.<t> = PowerSeriesRing(QQ, 5)
sage: f = 2*t + t^3 + O(t^4)
sage: s = f.sqrt(extend=True, name='sqrtf'); s
sqrtf
sage: s^2
2*t + t^3 + O(t^4)
A much more meaningful answer is to return a Puiseux series in t^(1/2)
which is the natural algebraic closure of power series (at least in
characteristic zero). Of course, I am aware that Puiseux series are not yet
there... and this is one of our oldest open ticket [4].
Anybody disagree?
[1] https://trac.sagemath.org/ticket/10720
[2] https://github.com/sagemath/sagetrac-mirror/blob/master/src/
sage/rings/power_series_ring_element.pyx#L1186
[3] https://github.com/sagemath/sagetrac-mirror/blob/master/src/
sage/rings/power_series_ring_element.pyx#L1253
[4] https://trac.sagemath.org/ticket/4618
Vincent
--
You received this message because you are subscribed to the Google Groups
"sage-nt" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to [email protected].
To post to this group, send an email to [email protected].
Visit this group at https://groups.google.com/group/sage-nt.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups
"sage-nt" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send an email to [email protected].
Visit this group at https://groups.google.com/group/sage-nt.
For more options, visit https://groups.google.com/d/optout.