@@ -745,7 +745,7 @@ def hodge_numbers(self):
745745
746746 .. SEEALSO::
747747
748- :meth:`degree`, :meth:`hodge_polynomial`
748+ :meth:`degree`, :meth:`hodge_polynomial`, :meth:`hodge_polygon`
749749
750750 EXAMPLES::
751751
@@ -796,7 +796,7 @@ def hodge_polynomial(self):
796796
797797 .. SEEALSO::
798798
799- :meth:`hodge_numbers`
799+ :meth:`hodge_numbers`, :meth:`hodge_polygon_vertices`, :meth:`hodge_function`
800800
801801 EXAMPLES::
802802
@@ -951,7 +951,7 @@ def has_symmetry_at_one(self):
951951
952952 - [Roberts2017]_
953953 """
954- _ , beta_twist = self .twist ().alpha_beta ()
954+ beta_twist = self .twist ()._beta
955955 return self .degree () % 2 == 0 and self ._alpha == beta_twist
956956
957957 def canonical_scheme (self , t = None ):
@@ -1020,6 +1020,8 @@ def twist(self):
10201020 sage: H = Hyp(alpha_beta=([1/2],[0]))
10211021 sage: H.twist()
10221022 Hypergeometric data for [0] and [1/2]
1023+ sage: H.twist().twist() == H
1024+ True
10231025
10241026 sage: Hyp(cyclotomic=([6],[1,2])).twist().cyclotomic_data()
10251027 ([3], [1, 2])
@@ -1069,6 +1071,9 @@ def padic_H_value(self, p, f, t, prec=None):
10691071 Return the `p`-adic trace of Frobenius, computed using the
10701072 Gross-Koblitz formula.
10711073
1074+ If left unspecified, `prec` is set to the minimum `p`-adic precision
1075+ needed to recover the Euler factor.
1076+
10721077 INPUT:
10731078
10741079 - `p` -- a prime number
@@ -1077,7 +1082,7 @@ def padic_H_value(self, p, f, t, prec=None):
10771082
10781083 - `t` -- a rational parameter
10791084
1080- - ``prec`` -- precision (optional, default 20 )
1085+ - ``prec`` -- precision (optional)
10811086
10821087 OUTPUT:
10831088
@@ -1142,7 +1147,7 @@ def padic_H_value(self, p, f, t, prec=None):
11421147 p_ring = Qp (p , prec = prec )
11431148 teich = p_ring .teichmuller (M / t )
11441149
1145- gauss_table = [None for _ in range (q - 1 )]
1150+ gauss_table = [None ] * (q - 1 )
11461151 for r in range (q - 1 ):
11471152 if gauss_table [r ] is None :
11481153 gauss_table [r ] = padic_gauss_sum (r , p , f , prec , factored = True ,
@@ -1152,11 +1157,17 @@ def padic_H_value(self, p, f, t, prec=None):
11521157 gauss_table [r1 ] = gauss_table [r ]
11531158 r1 = (r1 * p )% (q - 1 )
11541159
1155- sigma = sum (((- p )** (sum (gauss_table [(v * r ) % (q - 1 )][0 ] * gv
1156- for v , gv in gamma .items ()) // (p - 1 )) *
1157- prod (gauss_table [(v * r ) % (q - 1 )][1 ] ** gv
1158- for v , gv in gamma .items ()) * teich ** r )
1159- << (f * (D + m [0 ] - m [r ])) for r in range (q - 1 ))
1160+ sigma = p_ring .zero ()
1161+ u1 = p_ring .one ()
1162+ for r in range (q - 1 ):
1163+ i = int (0 )
1164+ u = u1
1165+ u1 *= teich
1166+ for v , gv in gamma .items ():
1167+ r1 = (v * r ) % (q - 1 )
1168+ i += gauss_table [r1 ][0 ] * gv
1169+ u *= gauss_table [r1 ][1 ] ** gv
1170+ sigma += (- p )** (i // (p - 1 )) * u << (f * (D + m [0 ]- m [r ]))
11601171 resu = ZZ (- 1 ) ** m [0 ] / (1 - q ) * sigma
11611172 return IntegerModRing (p ** prec )(resu ).lift_centered ()
11621173
@@ -1268,7 +1279,8 @@ def sign(self, t, p):
12681279 Return the sign of the functional equation for the Euler factor of the motive `H_t` at the prime `p`.
12691280
12701281 For odd weight, the sign of the functional equation is +1. For even
1271- weight, the sign is computed by a recipe found in 11.1 of [Watkins]_.
1282+ weight, the sign is computed by a recipe found in 11.1 of [Watkins]_
1283+ (when 0 is not in alpha).
12721284
12731285 EXAMPLES::
12741286
@@ -1302,9 +1314,9 @@ def sign(self, t, p):
13021314 if w % 2 : # sign is always +1 for odd weight
13031315 sign = 1
13041316 elif d % 2 :
1305- sign = - kronecker_symbol ((1 - t ) * self ._sign_param , p )
1317+ sign = - kronecker_symbol ((1 - t ) * self ._sign_param , p )
13061318 else :
1307- sign = kronecker_symbol (t * (t - 1 ) * self ._sign_param , p )
1319+ sign = kronecker_symbol (t * (t - 1 ) * self ._sign_param , p )
13081320 return sign
13091321
13101322 @cached_method
@@ -1386,12 +1398,12 @@ def euler_factor(self, t, p):
13861398 - [Roberts2015]_
13871399 - [Watkins]_
13881400 """
1401+ if t not in QQ or t in [0 , 1 ]:
1402+ raise ValueError ('wrong t' )
13891403 alpha = self ._alpha
13901404 if 0 in alpha :
13911405 return self ._swap .euler_factor (~ t , p )
13921406
1393- if t not in QQ or t in [0 , 1 ]:
1394- raise ValueError ('wrong t' )
13951407 if not is_prime (p ):
13961408 raise ValueError ('p not prime' )
13971409 if not all (x .denominator () % p for x in self ._alpha + self ._beta ):
0 commit comments