@@ -364,7 +364,8 @@ def apply_coeff_info(L, coeff_info):
364
364
the format in the database to algebraic and analytic form
365
365
"""
366
366
367
- def convert_coefficient (an , base_power_int ):
367
+ base_power_int = int (coeff_info [0 ][2 :- 3 ])
368
+ def convert_coefficient (an ):
368
369
"""
369
370
this is only meant for dirichlet L-functions, and
370
371
converts the format in the database to algebraic and analytic form
@@ -397,19 +398,21 @@ def convert_coefficient(an, base_power_int):
397
398
res = arithmetic , analytic
398
399
return res [0 ], CDF (res [1 ])
399
400
400
- base_power_int = int (coeff_info [0 ][2 :- 3 ])
401
401
fix = None
402
- for n , an in enumerate (L .dirichlet_coefficients_arithmetic ):
403
- L .dirichlet_coefficients_arithmetic [n ], L .dirichlet_coefficients [n ] = convert_coefficient (an , base_power_int )
402
+ for n , an in enumerate (L .dirichlet_coefficients_arithmetic [:] ):
403
+ L .dirichlet_coefficients_arithmetic [n ], L .dirichlet_coefficients [n ] = convert_coefficient (an )
404
404
# checks if we need to fix the Euler factors
405
405
if is_prime (n + 1 ) and L .dirichlet_coefficients_arithmetic [n ] != 0 :
406
406
p = n + 1
407
+ idx = prime_pi (p )- 1
408
+ ap = L .dirichlet_coefficients [p - 1 ]
409
+ ef_ap = - convert_coefficient (L .localfactors [idx ][1 ])[1 ]
407
410
if fix is None :
408
- fix = L . dirichlet_coefficients_arithmetic [ p - 1 ] == L . localfactors [ prime_pi ( p ) - 1 ][ 1 ]
409
- assert L . dirichlet_coefficients_arithmetic [ p - 1 ] == ( 1 if fix else - 1 )* L . localfactors [ prime_pi ( p ) - 1 ][ 1 ]
411
+ fix = ( ap - ef_ap ). abs () > 1e-5
412
+ assert ( ap - ( - 1 if fix else 1 )* ef_ap ). abs () < 1e-5
410
413
411
414
def convert_euler_Lpoly (poly_coeffs ):
412
- Fp = [convert_coefficient (c , base_power_int )[1 ] for c in poly_coeffs ]
415
+ Fp = [convert_coefficient (c )[1 ] for c in poly_coeffs ]
413
416
# WARNING: the data in the database is wrong!
414
417
# it lists Fp(-T) instead of Fp(T)
415
418
# this is a temporary fix
0 commit comments