Skip to content

Commit fa9bbe7

Browse files
author
Release Manager
committed
sagemathgh-41194: Fix printing of Tate series
The bigoh of a Tate series with a nonzero log-radius is currently incorrectly printed. ``` sage: S.<x> = TateAlgebra(Qp(5), log_radii=[-1]) sage: S(x, 10) (1 + O(5^9))*x + O(5^10 * <5*x>) ``` This should be `O(5^10 * <x/5>)`. This PR fixes this. ### 📝 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: sagemath#41194 Reported by: Xavier Caruso Reviewer(s): Rubén Muñoz--Bertrand
2 parents 449adce + 67a2a69 commit fa9bbe7

File tree

3 files changed

+22
-13
lines changed

3 files changed

+22
-13
lines changed

build/pkgs/configure/checksums.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
tarball=configure-VERSION.tar.gz
2-
sha1=8b7aba4104cd77481cfc7602c26382d1788ecd2e
3-
sha256=99c4fd081a93073924a90d7b8af2dbb6fe23d8b4602115511fa1399080667023
2+
sha1=760ea281be72aa2e57309e5f0f9544dea2d6759d
3+
sha256=b4edef2c928a0c929b1c5d09f8c2fb108a5f350e941b8dbe7b510d5ea3a4a819
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4119163dc533ea5446f33e48918fd637a8e856e2
1+
070bec01dbddc7c8980fbe0ed0746ff39802d219

src/sage/rings/tate_algebra_element.pyx

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1123,7 +1123,7 @@ cdef class TateAlgebraElement(CommutativeAlgebraElement):
11231123
sage: S.<x,y> = TateAlgebra(Qp(5), log_radii=(1,0))
11241124
sage: f = 5*x
11251125
sage: f.add_bigoh(1)
1126-
(5 + O(5^2))*x + O(5 * <x/5, y>)
1126+
(5 + O(5^2))*x + O(5 * <5*x, y>)
11271127
"""
11281128
self._is_normalized = True
11291129
if self._prec is Infinity:
@@ -1169,6 +1169,15 @@ cdef class TateAlgebraElement(CommutativeAlgebraElement):
11691169
11701170
sage: A(x + 2*x^2 + x^3, prec=5)
11711171
...00001*x^3 + ...00001*x + ...00010*x^2 + O(2^5 * <x, y>)
1172+
1173+
TESTS::
1174+
1175+
sage: S.<x> = TateAlgebra(R, log_radii=[-1])
1176+
sage: S(x, 5)
1177+
...0001*x + O(2^5 * <x/2>)
1178+
sage: S.<x> = TateAlgebra(R, log_radii=[1])
1179+
sage: S(x, 5)
1180+
...000001*x + O(2^5 * <2*x>)
11721181
"""
11731182
vars = self._parent.variable_names()
11741183
s = ""
@@ -1191,14 +1200,14 @@ cdef class TateAlgebraElement(CommutativeAlgebraElement):
11911200
for i in range(len(vars)):
11921201
if lr[i] == 0:
11931202
sv.append(vars[i])
1194-
elif lr[i] == -1:
1195-
sv.append("%s*%s" % (su, vars[i]))
11961203
elif lr[i] == 1:
1204+
sv.append("%s*%s" % (su, vars[i]))
1205+
elif lr[i] == -1:
11971206
sv.append("%s/%s" % (vars[i], su))
1198-
elif lr[i] < 0:
1199-
sv.append("%s^%s*%s" % (su, -lr[i], vars[i]))
1207+
elif lr[i] > 0:
1208+
sv.append("%s^%s*%s" % (su, lr[i], vars[i]))
12001209
else:
1201-
sv.append("%s/%s^%s" % (vars[i], su, lr[i]))
1210+
sv.append("%s/%s^%s" % (vars[i], su, -lr[i]))
12021211
sv = ", ".join(sv)
12031212
if self._prec == 0:
12041213
s += "O(<%s>)" % sv
@@ -2534,8 +2543,8 @@ cdef class TateAlgebraElement(CommutativeAlgebraElement):
25342543
However `\log(1+x)` converges on a smaller disk::
25352544
25362545
sage: f.restriction(-1).log()
2537-
...000000001*x + ...0000000.1*x^3 + ...111111*x^2 + ...
2538-
+ O(3^10 * <3*x, 3*y>)
2546+
...000000001*x + ...0000000.1*x^3 + ...11111111*x^2 + ...
2547+
+ O(3^10 * <x/3, y/3>)
25392548
25402549
TESTS::
25412550
@@ -2692,8 +2701,8 @@ cdef class TateAlgebraElement(CommutativeAlgebraElement):
26922701
However `\exp(x)` converges on a smaller disk::
26932702
26942703
sage: f.restriction(-1).exp()
2695-
...0000000001 + ...000000001*x + ...1111111.2*x^3 + ...111112*x^2
2696-
+ ... + O(3^10 * <3*x, 3*y>)
2704+
...0000000001 + ...000000001*x + ...1111111.2*x^3 + ...11111112*x^2
2705+
+ ... + O(3^10 * <x/3, y/3>)
26972706
26982707
TESTS::
26992708

0 commit comments

Comments
 (0)