Skip to content

Commit 96c4ae9

Browse files
author
Release Manager
committed
Trac #34735: some details in hyperelliptic_padic_field
URL: https://trac.sagemath.org/34735 Reported by: chapoton Ticket author(s): Frédéric Chapoton Reviewer(s): Lorenz Panny
2 parents f9cee4d + 51dfa86 commit 96c4ae9

File tree

1 file changed

+24
-37
lines changed

1 file changed

+24
-37
lines changed

src/sage/schemes/hyperelliptic_curves/hyperelliptic_padic_field.py

Lines changed: 24 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
"""
22
Hyperelliptic curves over a `p`-adic field
33
"""
4-
#*****************************************************************************
4+
# ****************************************************************************
55
# Copyright (C) 2007 Robert Bradshaw <[email protected]>
66
#
77
# This program is free software: you can redistribute it and/or modify
88
# it under the terms of the GNU General Public License as published by
99
# the Free Software Foundation, either version 2 of the License, or
1010
# (at your option) any later version.
11-
# http://www.gnu.org/licenses/
12-
#*****************************************************************************
11+
# https://www.gnu.org/licenses/
12+
# ****************************************************************************
1313

1414

1515
from sage.rings.all import (PowerSeriesRing, PolynomialRing, ZZ, QQ,
@@ -27,10 +27,10 @@
2727
class HyperellipticCurve_padic_field(hyperelliptic_generic.HyperellipticCurve_generic,
2828
ProjectivePlaneCurve_field):
2929

30-
# The functions below were prototyped at the 2007 Arizona Winter School by
31-
# Robert Bradshaw and Ralf Gerkmann, working with Miljan Brakovevic and
32-
# Kiran Kedlaya
33-
# All of the below is with respect to the Monsky Washnitzer cohomology.
30+
# The functions below were prototyped at the 2007 Arizona Winter School by
31+
# Robert Bradshaw and Ralf Gerkmann, working with Miljan Brakovevic and
32+
# Kiran Kedlaya
33+
# All of the below is with respect to the Monsky Washnitzer cohomology.
3434

3535
def local_analytic_interpolation(self, P, Q):
3636
"""
@@ -158,7 +158,7 @@ def weierstrass_points(self):
158158
raise NotImplementedError()
159159
return [self((0,1,0))] + [self((x, 0, 1)) for x in f.roots(multiplicities=False)]
160160

161-
def is_in_weierstrass_disc(self,P):
161+
def is_in_weierstrass_disc(self, P):
162162
"""
163163
Checks if `P` is in a Weierstrass disc
164164
@@ -186,12 +186,9 @@ def is_in_weierstrass_disc(self,P):
186186
187187
- Jennifer Balakrishnan (2010-02)
188188
"""
189-
if (P[1].valuation() == 0 and P != self(0,1,0)):
190-
return False
191-
else:
192-
return True
189+
return not (P[1].valuation() == 0 and P != self(0, 1, 0))
193190

194-
def is_weierstrass(self,P):
191+
def is_weierstrass(self, P):
195192
"""
196193
Checks if `P` is a Weierstrass point (i.e., fixed by the hyperelliptic involution)
197194
@@ -218,12 +215,8 @@ def is_weierstrass(self,P):
218215
AUTHOR:
219216
220217
- Jennifer Balakrishnan (2010-02)
221-
222218
"""
223-
if (P[1] == 0 or P[2] ==0):
224-
return True
225-
else:
226-
return False
219+
return (P[1] == 0 or P[2] == 0)
227220

228221
def find_char_zero_weier_point(self, Q):
229222
"""
@@ -260,7 +253,7 @@ def find_char_zero_weier_point(self, Q):
260253
if self.is_same_disc(P,Q):
261254
return P
262255

263-
def residue_disc(self,P):
256+
def residue_disc(self, P):
264257
"""
265258
Gives the residue disc of `P`
266259
@@ -306,7 +299,7 @@ def residue_disc(self,P):
306299
else:
307300
return HF(0,1,0)
308301

309-
def is_same_disc(self,P,Q):
302+
def is_same_disc(self, P, Q):
310303
"""
311304
Checks if `P,Q` are in same residue disc
312305
@@ -326,10 +319,7 @@ def is_same_disc(self,P,Q):
326319
sage: HK.is_same_disc(Q,S)
327320
False
328321
"""
329-
if self.residue_disc(P) == self.residue_disc(Q):
330-
return True
331-
else:
332-
return False
322+
return self.residue_disc(P) == self.residue_disc(Q)
333323

334324
def tiny_integrals(self, F, P, Q):
335325
r"""
@@ -1001,12 +991,12 @@ def newton_sqrt(self, f, x0, prec):
1001991
- Jennifer Balakrishnan
1002992
"""
1003993
z = x0
1004-
loop_prec = (log(RR(prec))/log(RR(2))).ceil()
994+
loop_prec = log(RR(prec), 2).ceil()
1005995
for i in range(loop_prec):
1006-
z = (z + f/z) / 2
996+
z = (z + f / z) / 2
1007997
return z
1008998

1009-
def curve_over_ram_extn(self,deg):
999+
def curve_over_ram_extn(self, deg):
10101000
r"""
10111001
Return ``self`` over `\QQ_p(p^(1/deg))`.
10121002
@@ -1123,7 +1113,7 @@ def P_to_S(self, P, S):
11231113
val = [I(S[1]) for I in integrals]
11241114
return vector(val)
11251115

1126-
def coleman_integral_P_to_S(self,w,P,S):
1116+
def coleman_integral_P_to_S(self, w, P, S):
11271117
r"""
11281118
Given a finite Weierstrass point `P` and a point `S`
11291119
in the same disc, computes the Coleman integral `\int_P^S w`
@@ -1168,7 +1158,7 @@ def coleman_integral_P_to_S(self,w,P,S):
11681158
int_sing_a = int_sing(S[1])
11691159
return int_sing_a
11701160

1171-
def S_to_Q(self,S,Q):
1161+
def S_to_Q(self, S, Q):
11721162
r"""
11731163
Given `S` a point on self over an extension field, computes the
11741164
Coleman integrals `\{\int_S^Q x^i dx/2y \}_{i=0}^{2g-1}`
@@ -1248,13 +1238,12 @@ def S_to_Q(self,S,Q):
12481238
b = V(L)
12491239
M_sys = matrix(K, M_frob).transpose() - 1
12501240
B = (~M_sys)
1251-
v = [c.valuation() for c in B.list()]
1252-
vv = min(v)
1241+
vv = min(c.valuation() for c in B.list())
12531242
B = (p**(-vv)*B).change_ring(K)
12541243
B = p**(vv)*B
12551244
return B*(b-S_to_FS-FQ_to_Q)
12561245

1257-
def coleman_integral_S_to_Q(self,w,S,Q):
1246+
def coleman_integral_S_to_Q(self, w, S, Q):
12581247
r"""
12591248
Compute the Coleman integral `\int_S^Q w`
12601249
@@ -1293,7 +1282,6 @@ def coleman_integral_S_to_Q(self,w,S,Q):
12931282
AUTHOR:
12941283
12951284
- Jennifer Balakrishnan
1296-
12971285
"""
12981286
import sage.schemes.hyperelliptic_curves.monsky_washnitzer as monsky_washnitzer
12991287
K = self.base_ring()
@@ -1350,10 +1338,9 @@ def coleman_integral_from_weierstrass_via_boundary(self, w, P, Q, d):
13501338
AUTHOR:
13511339
13521340
- Jennifer Balakrishnan
1353-
13541341
"""
13551342
HJ = self.curve_over_ram_extn(d)
1356-
S = self.get_boundary_point(HJ,P)
1357-
P_to_S = self.coleman_integral_P_to_S(w,P,S)
1358-
S_to_Q = HJ.coleman_integral_S_to_Q(w,S,Q)
1343+
S = self.get_boundary_point(HJ, P)
1344+
P_to_S = self.coleman_integral_P_to_S(w, P, S)
1345+
S_to_Q = HJ.coleman_integral_S_to_Q(w, S, Q)
13591346
return P_to_S + S_to_Q

0 commit comments

Comments
 (0)