ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Wed, 23 Jan 2019 07:44:20 +0100Homomorphisms lifted from base ring in PowerSeriesRing do not preserve precisionhttps://ask.sagemath.org/question/45002/homomorphisms-lifted-from-base-ring-in-powerseriesring-do-not-preserve-precision/Hi all,
Homomorphisms which are lifted from the base ring seem to be unaware that precision exists in power/Laurent series rings. For example:
sage: R.<x> = PowerSeriesRing(ZZ)
sage: f = Hom(ZZ, ZZ)([1])
sage: Rf = Hom(R, R)(f); Rf
Ring endomorphism of Power Series Ring in x over Integer Ring
Defn: Induced from base ring by
Ring endomorphism of Integer Ring
Defn: 1 |--> 1
sage: Rf(1 + x + O(x^2))
1 + x
Can someone confirm that the expected output should be 1 + x + O(x^2), and that this is a bug?
Thanks,
HenryFri, 11 Jan 2019 02:06:35 +0100https://ask.sagemath.org/question/45002/homomorphisms-lifted-from-base-ring-in-powerseriesring-do-not-preserve-precision/Answer by vdelecroix for <p>Hi all,</p>
<p>Homomorphisms which are lifted from the base ring seem to be unaware that precision exists in power/Laurent series rings. For example:</p>
<pre><code>sage: R.<x> = PowerSeriesRing(ZZ)
sage: f = Hom(ZZ, ZZ)([1])
sage: Rf = Hom(R, R)(f); Rf
Ring endomorphism of Power Series Ring in x over Integer Ring
Defn: Induced from base ring by
Ring endomorphism of Integer Ring
Defn: 1 |--> 1
sage: Rf(1 + x + O(x^2))
1 + x
</code></pre>
<p>Can someone confirm that the expected output should be 1 + x + O(x^2), and that this is a bug?</p>
<p>Thanks,</p>
<p>Henry</p>
https://ask.sagemath.org/question/45002/homomorphisms-lifted-from-base-ring-in-powerseriesring-do-not-preserve-precision/?answer=45142#post-id-45142Indeed, this is broken. Note that it works fine with the identity morphism
sage: fR = Hom(R, R).one()
sage: fR
Identity endomorphism of Power Series Ring in x over Integer Ring
sage: fR(1 + x + O(x^2))
1 + x + O(x^2)
But not for the lifted identity
sage: fZZ = Hom(ZZ, ZZ).one()
sage: fR2 = Hom(R, R)(fZZ)
sage: fR2(1 + x + O(x^2))
1 + x
Wed, 23 Jan 2019 07:44:20 +0100https://ask.sagemath.org/question/45002/homomorphisms-lifted-from-base-ring-in-powerseriesring-do-not-preserve-precision/?answer=45142#post-id-45142