Skip to content

Commit bbf4ff7

Browse files
author
Release Manager
committed
gh-40046: Precision issue in the normalization of a Tate series This PR fixes the following bug: ``` sage: S.<x,y> = TateAlgebra(Qp(5), log_radii=(1,0)) sage: f = 5*x sage: f.valuation() 0 sage: f.add_bigoh(1) O(5 * <x/5, y>) ``` The correct answer is `(5 + O(5^2))*x + O(5 * <x/5, y>)` given that the first summand is not absorbed by the `O(.)`. ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [ ] I have linked a relevant issue or discussion. - [x] I have created tests covering the changes. - [x] I have updated the documentation and checked the documentation preview. URL: #40046 Reported by: Xavier Caruso Reviewer(s): TristanVaccon, Vilanele
2 parents 4e1881b + 9713051 commit bbf4ff7

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

src/sage/rings/tate_algebra_element.pyx

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1115,6 +1115,15 @@ cdef class TateAlgebraElement(CommutativeAlgebraElement):
11151115
sage: A.<x,y> = TateAlgebra(R)
11161116
sage: A(78612, prec=3) # indirect doctest
11171117
...100 + O(2^3 * <x, y>)
1118+
1119+
TESTS:
1120+
1121+
We check that :issue:`40046` is fixed::
1122+
1123+
sage: S.<x,y> = TateAlgebra(Qp(5), log_radii=(1,0))
1124+
sage: f = 5*x
1125+
sage: f.add_bigoh(1)
1126+
(5 + O(5^2))*x + O(5 * <x/5, y>)
11181127
"""
11191128
self._is_normalized = True
11201129
if self._prec is Infinity:
@@ -1124,9 +1133,9 @@ cdef class TateAlgebraElement(CommutativeAlgebraElement):
11241133
for (e, c) in list(self._poly.__repn.items()):
11251134
v = (<ETuple>self._parent._log_radii).dotprod(<ETuple>e)
11261135
coeff = self._poly.__repn[e]
1127-
if coeff.precision_absolute() > self._prec - v:
1128-
coeff = coeff.add_bigoh(self._prec - v)
1129-
if coeff.valuation() >= self._prec - v:
1136+
if coeff.precision_absolute() > self._prec + v:
1137+
coeff = coeff.add_bigoh(self._prec + v)
1138+
if coeff.valuation() >= self._prec + v:
11301139
del self._poly.__repn[e]
11311140
else:
11321141
self._poly.__repn[e] = coeff
@@ -2534,7 +2543,7 @@ cdef class TateAlgebraElement(CommutativeAlgebraElement):
25342543
However `\log(1+x)` converges on a smaller disk::
25352544
25362545
sage: f.restriction(-1).log()
2537-
...0000000001*x + ...000000000.1*x^3 + ...111111111*x^2 + ...
2546+
...000000001*x + ...0000000.1*x^3 + ...111111*x^2 + ...
25382547
+ O(3^10 * <3*x, 3*y>)
25392548
25402549
TESTS::
@@ -2692,7 +2701,7 @@ cdef class TateAlgebraElement(CommutativeAlgebraElement):
26922701
However `\exp(x)` converges on a smaller disk::
26932702
26942703
sage: f.restriction(-1).exp()
2695-
...0000000001 + ...0000000001*x + ...111111111.2*x^3 + ...111111112*x^2
2704+
...0000000001 + ...000000001*x + ...1111111.2*x^3 + ...111112*x^2
26962705
+ ... + O(3^10 * <3*x, 3*y>)
26972706
26982707
TESTS::

0 commit comments

Comments
 (0)