passagemath-schemes 10.8.1a4__cp314-cp314t-macosx_13_0_arm64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (312) hide show
  1. passagemath_schemes/.dylibs/libflint.22.0.dylib +0 -0
  2. passagemath_schemes/.dylibs/libgmp.10.dylib +0 -0
  3. passagemath_schemes/.dylibs/libgmpxx.4.dylib +0 -0
  4. passagemath_schemes/.dylibs/libmpfr.6.dylib +0 -0
  5. passagemath_schemes/__init__.py +3 -0
  6. passagemath_schemes-10.8.1a4.dist-info/METADATA +203 -0
  7. passagemath_schemes-10.8.1a4.dist-info/METADATA.bak +204 -0
  8. passagemath_schemes-10.8.1a4.dist-info/RECORD +312 -0
  9. passagemath_schemes-10.8.1a4.dist-info/WHEEL +6 -0
  10. passagemath_schemes-10.8.1a4.dist-info/top_level.txt +3 -0
  11. sage/all__sagemath_schemes.py +23 -0
  12. sage/databases/all__sagemath_schemes.py +7 -0
  13. sage/databases/cremona.py +1723 -0
  14. sage/dynamics/all__sagemath_schemes.py +2 -0
  15. sage/dynamics/arithmetic_dynamics/affine_ds.py +1083 -0
  16. sage/dynamics/arithmetic_dynamics/all.py +14 -0
  17. sage/dynamics/arithmetic_dynamics/berkovich_ds.py +1101 -0
  18. sage/dynamics/arithmetic_dynamics/dynamical_semigroup.py +1543 -0
  19. sage/dynamics/arithmetic_dynamics/endPN_automorphism_group.py +2426 -0
  20. sage/dynamics/arithmetic_dynamics/endPN_minimal_model.py +1169 -0
  21. sage/dynamics/arithmetic_dynamics/generic_ds.py +663 -0
  22. sage/dynamics/arithmetic_dynamics/product_projective_ds.py +339 -0
  23. sage/dynamics/arithmetic_dynamics/projective_ds.py +9556 -0
  24. sage/dynamics/arithmetic_dynamics/projective_ds_helper.cpython-314t-darwin.so +0 -0
  25. sage/dynamics/arithmetic_dynamics/projective_ds_helper.pyx +301 -0
  26. sage/dynamics/arithmetic_dynamics/wehlerK3.py +2578 -0
  27. sage/lfunctions/all.py +18 -0
  28. sage/lfunctions/dokchitser.py +727 -0
  29. sage/lfunctions/pari.py +971 -0
  30. sage/lfunctions/zero_sums.cpython-314t-darwin.so +0 -0
  31. sage/lfunctions/zero_sums.pyx +1847 -0
  32. sage/modular/abvar/abvar.py +5132 -0
  33. sage/modular/abvar/abvar_ambient_jacobian.py +414 -0
  34. sage/modular/abvar/abvar_newform.py +246 -0
  35. sage/modular/abvar/all.py +8 -0
  36. sage/modular/abvar/constructor.py +187 -0
  37. sage/modular/abvar/cuspidal_subgroup.py +371 -0
  38. sage/modular/abvar/finite_subgroup.py +896 -0
  39. sage/modular/abvar/homology.py +721 -0
  40. sage/modular/abvar/homspace.py +989 -0
  41. sage/modular/abvar/lseries.py +415 -0
  42. sage/modular/abvar/morphism.py +935 -0
  43. sage/modular/abvar/torsion_point.py +274 -0
  44. sage/modular/abvar/torsion_subgroup.py +741 -0
  45. sage/modular/all.py +43 -0
  46. sage/modular/arithgroup/all.py +20 -0
  47. sage/modular/arithgroup/arithgroup_element.cpython-314t-darwin.so +0 -0
  48. sage/modular/arithgroup/arithgroup_element.pyx +474 -0
  49. sage/modular/arithgroup/arithgroup_generic.py +1406 -0
  50. sage/modular/arithgroup/arithgroup_perm.py +2692 -0
  51. sage/modular/arithgroup/congroup.cpython-314t-darwin.so +0 -0
  52. sage/modular/arithgroup/congroup.pyx +334 -0
  53. sage/modular/arithgroup/congroup_gamma.py +361 -0
  54. sage/modular/arithgroup/congroup_gamma0.py +692 -0
  55. sage/modular/arithgroup/congroup_gamma1.py +659 -0
  56. sage/modular/arithgroup/congroup_gammaH.py +1491 -0
  57. sage/modular/arithgroup/congroup_generic.py +630 -0
  58. sage/modular/arithgroup/congroup_sl2z.py +266 -0
  59. sage/modular/arithgroup/farey_symbol.cpython-314t-darwin.so +0 -0
  60. sage/modular/arithgroup/farey_symbol.pyx +1067 -0
  61. sage/modular/arithgroup/tests.py +425 -0
  62. sage/modular/btquotients/all.py +4 -0
  63. sage/modular/btquotients/btquotient.py +3736 -0
  64. sage/modular/btquotients/pautomorphicform.py +2564 -0
  65. sage/modular/buzzard.py +100 -0
  66. sage/modular/congroup.py +29 -0
  67. sage/modular/congroup_element.py +13 -0
  68. sage/modular/cusps.py +1107 -0
  69. sage/modular/cusps_nf.py +1270 -0
  70. sage/modular/dims.py +571 -0
  71. sage/modular/dirichlet.py +3310 -0
  72. sage/modular/drinfeld_modform/all.py +2 -0
  73. sage/modular/drinfeld_modform/element.py +446 -0
  74. sage/modular/drinfeld_modform/ring.py +773 -0
  75. sage/modular/drinfeld_modform/tutorial.py +236 -0
  76. sage/modular/etaproducts.py +1076 -0
  77. sage/modular/hecke/algebra.py +725 -0
  78. sage/modular/hecke/all.py +19 -0
  79. sage/modular/hecke/ambient_module.py +994 -0
  80. sage/modular/hecke/degenmap.py +119 -0
  81. sage/modular/hecke/element.py +302 -0
  82. sage/modular/hecke/hecke_operator.py +736 -0
  83. sage/modular/hecke/homspace.py +185 -0
  84. sage/modular/hecke/module.py +1744 -0
  85. sage/modular/hecke/morphism.py +139 -0
  86. sage/modular/hecke/submodule.py +970 -0
  87. sage/modular/hypergeometric_misc.cpython-314t-darwin.so +0 -0
  88. sage/modular/hypergeometric_misc.pxd +4 -0
  89. sage/modular/hypergeometric_misc.pyx +166 -0
  90. sage/modular/hypergeometric_motive.py +2020 -0
  91. sage/modular/local_comp/all.py +2 -0
  92. sage/modular/local_comp/liftings.py +292 -0
  93. sage/modular/local_comp/local_comp.py +1070 -0
  94. sage/modular/local_comp/smoothchar.py +1825 -0
  95. sage/modular/local_comp/type_space.py +748 -0
  96. sage/modular/modform/all.py +30 -0
  97. sage/modular/modform/ambient.py +817 -0
  98. sage/modular/modform/ambient_R.py +177 -0
  99. sage/modular/modform/ambient_eps.py +306 -0
  100. sage/modular/modform/ambient_g0.py +120 -0
  101. sage/modular/modform/ambient_g1.py +199 -0
  102. sage/modular/modform/constructor.py +545 -0
  103. sage/modular/modform/cuspidal_submodule.py +708 -0
  104. sage/modular/modform/defaults.py +14 -0
  105. sage/modular/modform/eis_series.py +487 -0
  106. sage/modular/modform/eisenstein_submodule.py +663 -0
  107. sage/modular/modform/element.py +4105 -0
  108. sage/modular/modform/half_integral.py +154 -0
  109. sage/modular/modform/hecke_operator_on_qexp.py +247 -0
  110. sage/modular/modform/j_invariant.py +47 -0
  111. sage/modular/modform/l_series_gross_zagier.py +127 -0
  112. sage/modular/modform/l_series_gross_zagier_coeffs.cpython-314t-darwin.so +0 -0
  113. sage/modular/modform/l_series_gross_zagier_coeffs.pyx +177 -0
  114. sage/modular/modform/notes.py +45 -0
  115. sage/modular/modform/numerical.py +514 -0
  116. sage/modular/modform/periods.py +14 -0
  117. sage/modular/modform/ring.py +1257 -0
  118. sage/modular/modform/space.py +1859 -0
  119. sage/modular/modform/submodule.py +118 -0
  120. sage/modular/modform/tests.py +64 -0
  121. sage/modular/modform/theta.py +110 -0
  122. sage/modular/modform/vm_basis.py +380 -0
  123. sage/modular/modform/weight1.py +221 -0
  124. sage/modular/modform_hecketriangle/abstract_ring.py +1932 -0
  125. sage/modular/modform_hecketriangle/abstract_space.py +2527 -0
  126. sage/modular/modform_hecketriangle/all.py +30 -0
  127. sage/modular/modform_hecketriangle/analytic_type.py +590 -0
  128. sage/modular/modform_hecketriangle/constructor.py +416 -0
  129. sage/modular/modform_hecketriangle/element.py +351 -0
  130. sage/modular/modform_hecketriangle/functors.py +752 -0
  131. sage/modular/modform_hecketriangle/graded_ring.py +541 -0
  132. sage/modular/modform_hecketriangle/graded_ring_element.py +2225 -0
  133. sage/modular/modform_hecketriangle/hecke_triangle_group_element.py +3349 -0
  134. sage/modular/modform_hecketriangle/hecke_triangle_groups.py +1426 -0
  135. sage/modular/modform_hecketriangle/readme.py +1214 -0
  136. sage/modular/modform_hecketriangle/series_constructor.py +580 -0
  137. sage/modular/modform_hecketriangle/space.py +1037 -0
  138. sage/modular/modform_hecketriangle/subspace.py +423 -0
  139. sage/modular/modsym/all.py +17 -0
  140. sage/modular/modsym/ambient.py +3844 -0
  141. sage/modular/modsym/boundary.py +1420 -0
  142. sage/modular/modsym/element.py +336 -0
  143. sage/modular/modsym/g1list.py +178 -0
  144. sage/modular/modsym/ghlist.py +182 -0
  145. sage/modular/modsym/hecke_operator.py +73 -0
  146. sage/modular/modsym/manin_symbol.cpython-314t-darwin.so +0 -0
  147. sage/modular/modsym/manin_symbol.pxd +5 -0
  148. sage/modular/modsym/manin_symbol.pyx +497 -0
  149. sage/modular/modsym/manin_symbol_list.py +1291 -0
  150. sage/modular/modsym/modsym.py +400 -0
  151. sage/modular/modsym/modular_symbols.py +384 -0
  152. sage/modular/modsym/p1list_nf.py +1241 -0
  153. sage/modular/modsym/relation_matrix.py +591 -0
  154. sage/modular/modsym/relation_matrix_pyx.cpython-314t-darwin.so +0 -0
  155. sage/modular/modsym/relation_matrix_pyx.pyx +108 -0
  156. sage/modular/modsym/space.py +2468 -0
  157. sage/modular/modsym/subspace.py +455 -0
  158. sage/modular/modsym/tests.py +376 -0
  159. sage/modular/multiple_zeta.py +2635 -0
  160. sage/modular/multiple_zeta_F_algebra.py +789 -0
  161. sage/modular/overconvergent/all.py +6 -0
  162. sage/modular/overconvergent/genus0.py +1879 -0
  163. sage/modular/overconvergent/hecke_series.py +1187 -0
  164. sage/modular/overconvergent/weightspace.py +776 -0
  165. sage/modular/pollack_stevens/all.py +4 -0
  166. sage/modular/pollack_stevens/distributions.py +874 -0
  167. sage/modular/pollack_stevens/fund_domain.py +1572 -0
  168. sage/modular/pollack_stevens/manin_map.py +856 -0
  169. sage/modular/pollack_stevens/modsym.py +1590 -0
  170. sage/modular/pollack_stevens/padic_lseries.py +417 -0
  171. sage/modular/pollack_stevens/sigma0.py +534 -0
  172. sage/modular/pollack_stevens/space.py +1078 -0
  173. sage/modular/quasimodform/all.py +3 -0
  174. sage/modular/quasimodform/element.py +846 -0
  175. sage/modular/quasimodform/ring.py +826 -0
  176. sage/modular/quatalg/all.py +3 -0
  177. sage/modular/quatalg/brandt.py +1642 -0
  178. sage/modular/ssmod/all.py +8 -0
  179. sage/modular/ssmod/ssmod.py +827 -0
  180. sage/rings/all__sagemath_schemes.py +1 -0
  181. sage/rings/polynomial/all__sagemath_schemes.py +1 -0
  182. sage/rings/polynomial/binary_form_reduce.py +585 -0
  183. sage/schemes/all.py +41 -0
  184. sage/schemes/berkovich/all.py +6 -0
  185. sage/schemes/berkovich/berkovich_cp_element.py +2582 -0
  186. sage/schemes/berkovich/berkovich_space.py +700 -0
  187. sage/schemes/curves/affine_curve.py +2924 -0
  188. sage/schemes/curves/all.py +33 -0
  189. sage/schemes/curves/closed_point.py +434 -0
  190. sage/schemes/curves/constructor.py +397 -0
  191. sage/schemes/curves/curve.py +542 -0
  192. sage/schemes/curves/plane_curve_arrangement.py +1283 -0
  193. sage/schemes/curves/point.py +463 -0
  194. sage/schemes/curves/projective_curve.py +3203 -0
  195. sage/schemes/curves/weighted_projective_curve.py +106 -0
  196. sage/schemes/curves/zariski_vankampen.py +1931 -0
  197. sage/schemes/cyclic_covers/all.py +2 -0
  198. sage/schemes/cyclic_covers/charpoly_frobenius.py +320 -0
  199. sage/schemes/cyclic_covers/constructor.py +137 -0
  200. sage/schemes/cyclic_covers/cycliccover_finite_field.py +1309 -0
  201. sage/schemes/cyclic_covers/cycliccover_generic.py +310 -0
  202. sage/schemes/elliptic_curves/BSD.py +991 -0
  203. sage/schemes/elliptic_curves/Qcurves.py +592 -0
  204. sage/schemes/elliptic_curves/addition_formulas_ring.py +94 -0
  205. sage/schemes/elliptic_curves/all.py +49 -0
  206. sage/schemes/elliptic_curves/cardinality.py +609 -0
  207. sage/schemes/elliptic_curves/cm.py +1103 -0
  208. sage/schemes/elliptic_curves/constructor.py +1530 -0
  209. sage/schemes/elliptic_curves/ec_database.py +175 -0
  210. sage/schemes/elliptic_curves/ell_curve_isogeny.py +3971 -0
  211. sage/schemes/elliptic_curves/ell_egros.py +457 -0
  212. sage/schemes/elliptic_curves/ell_field.py +2837 -0
  213. sage/schemes/elliptic_curves/ell_finite_field.py +3249 -0
  214. sage/schemes/elliptic_curves/ell_generic.py +3760 -0
  215. sage/schemes/elliptic_curves/ell_local_data.py +1207 -0
  216. sage/schemes/elliptic_curves/ell_modular_symbols.py +775 -0
  217. sage/schemes/elliptic_curves/ell_number_field.py +4220 -0
  218. sage/schemes/elliptic_curves/ell_padic_field.py +107 -0
  219. sage/schemes/elliptic_curves/ell_point.py +4944 -0
  220. sage/schemes/elliptic_curves/ell_rational_field.py +7184 -0
  221. sage/schemes/elliptic_curves/ell_tate_curve.py +671 -0
  222. sage/schemes/elliptic_curves/ell_torsion.py +436 -0
  223. sage/schemes/elliptic_curves/ell_wp.py +352 -0
  224. sage/schemes/elliptic_curves/formal_group.py +760 -0
  225. sage/schemes/elliptic_curves/gal_reps.py +1459 -0
  226. sage/schemes/elliptic_curves/gal_reps_number_field.py +1663 -0
  227. sage/schemes/elliptic_curves/gp_simon.py +152 -0
  228. sage/schemes/elliptic_curves/heegner.py +7328 -0
  229. sage/schemes/elliptic_curves/height.py +2108 -0
  230. sage/schemes/elliptic_curves/hom.py +1788 -0
  231. sage/schemes/elliptic_curves/hom_composite.py +1084 -0
  232. sage/schemes/elliptic_curves/hom_fractional.py +544 -0
  233. sage/schemes/elliptic_curves/hom_frobenius.py +522 -0
  234. sage/schemes/elliptic_curves/hom_scalar.py +531 -0
  235. sage/schemes/elliptic_curves/hom_sum.py +681 -0
  236. sage/schemes/elliptic_curves/hom_velusqrt.py +1290 -0
  237. sage/schemes/elliptic_curves/homset.py +271 -0
  238. sage/schemes/elliptic_curves/isogeny_class.py +1523 -0
  239. sage/schemes/elliptic_curves/isogeny_small_degree.py +2797 -0
  240. sage/schemes/elliptic_curves/jacobian.py +247 -0
  241. sage/schemes/elliptic_curves/kodaira_symbol.py +344 -0
  242. sage/schemes/elliptic_curves/kraus.py +1014 -0
  243. sage/schemes/elliptic_curves/lseries_ell.py +915 -0
  244. sage/schemes/elliptic_curves/mod5family.py +105 -0
  245. sage/schemes/elliptic_curves/mod_poly.py +197 -0
  246. sage/schemes/elliptic_curves/mod_sym_num.cpython-314t-darwin.so +0 -0
  247. sage/schemes/elliptic_curves/mod_sym_num.pyx +3796 -0
  248. sage/schemes/elliptic_curves/modular_parametrization.py +305 -0
  249. sage/schemes/elliptic_curves/padic_lseries.py +1793 -0
  250. sage/schemes/elliptic_curves/padics.py +1816 -0
  251. sage/schemes/elliptic_curves/period_lattice.py +2234 -0
  252. sage/schemes/elliptic_curves/period_lattice_region.cpython-314t-darwin.so +0 -0
  253. sage/schemes/elliptic_curves/period_lattice_region.pyx +722 -0
  254. sage/schemes/elliptic_curves/saturation.py +716 -0
  255. sage/schemes/elliptic_curves/sha_tate.py +1158 -0
  256. sage/schemes/elliptic_curves/weierstrass_morphism.py +1117 -0
  257. sage/schemes/elliptic_curves/weierstrass_transform.py +200 -0
  258. sage/schemes/hyperelliptic_curves/all.py +6 -0
  259. sage/schemes/hyperelliptic_curves/constructor.py +369 -0
  260. sage/schemes/hyperelliptic_curves/hyperelliptic_finite_field.py +1948 -0
  261. sage/schemes/hyperelliptic_curves/hyperelliptic_g2.py +192 -0
  262. sage/schemes/hyperelliptic_curves/hyperelliptic_generic.py +936 -0
  263. sage/schemes/hyperelliptic_curves/hyperelliptic_padic_field.py +1332 -0
  264. sage/schemes/hyperelliptic_curves/hyperelliptic_rational_field.py +84 -0
  265. sage/schemes/hyperelliptic_curves/invariants.py +410 -0
  266. sage/schemes/hyperelliptic_curves/jacobian_endomorphism_utils.py +312 -0
  267. sage/schemes/hyperelliptic_curves/jacobian_g2.py +32 -0
  268. sage/schemes/hyperelliptic_curves/jacobian_generic.py +437 -0
  269. sage/schemes/hyperelliptic_curves/jacobian_homset.py +186 -0
  270. sage/schemes/hyperelliptic_curves/jacobian_morphism.py +878 -0
  271. sage/schemes/hyperelliptic_curves/kummer_surface.py +99 -0
  272. sage/schemes/hyperelliptic_curves/mestre.py +302 -0
  273. sage/schemes/hyperelliptic_curves/monsky_washnitzer.py +3863 -0
  274. sage/schemes/jacobians/abstract_jacobian.py +277 -0
  275. sage/schemes/jacobians/all.py +2 -0
  276. sage/schemes/overview.py +161 -0
  277. sage/schemes/plane_conics/all.py +22 -0
  278. sage/schemes/plane_conics/con_field.py +1296 -0
  279. sage/schemes/plane_conics/con_finite_field.py +158 -0
  280. sage/schemes/plane_conics/con_number_field.py +456 -0
  281. sage/schemes/plane_conics/con_rational_field.py +406 -0
  282. sage/schemes/plane_conics/con_rational_function_field.py +581 -0
  283. sage/schemes/plane_conics/constructor.py +249 -0
  284. sage/schemes/plane_quartics/all.py +2 -0
  285. sage/schemes/plane_quartics/quartic_constructor.py +71 -0
  286. sage/schemes/plane_quartics/quartic_generic.py +53 -0
  287. sage/schemes/riemann_surfaces/all.py +1 -0
  288. sage/schemes/riemann_surfaces/riemann_surface.py +4177 -0
  289. sage_wheels/share/cremona/cremona_mini.db +0 -0
  290. sage_wheels/share/ellcurves/rank0 +30427 -0
  291. sage_wheels/share/ellcurves/rank1 +31871 -0
  292. sage_wheels/share/ellcurves/rank10 +6 -0
  293. sage_wheels/share/ellcurves/rank11 +6 -0
  294. sage_wheels/share/ellcurves/rank12 +1 -0
  295. sage_wheels/share/ellcurves/rank14 +1 -0
  296. sage_wheels/share/ellcurves/rank15 +1 -0
  297. sage_wheels/share/ellcurves/rank17 +1 -0
  298. sage_wheels/share/ellcurves/rank19 +1 -0
  299. sage_wheels/share/ellcurves/rank2 +2388 -0
  300. sage_wheels/share/ellcurves/rank20 +1 -0
  301. sage_wheels/share/ellcurves/rank21 +1 -0
  302. sage_wheels/share/ellcurves/rank22 +1 -0
  303. sage_wheels/share/ellcurves/rank23 +1 -0
  304. sage_wheels/share/ellcurves/rank24 +1 -0
  305. sage_wheels/share/ellcurves/rank28 +1 -0
  306. sage_wheels/share/ellcurves/rank3 +836 -0
  307. sage_wheels/share/ellcurves/rank4 +10 -0
  308. sage_wheels/share/ellcurves/rank5 +5 -0
  309. sage_wheels/share/ellcurves/rank6 +5 -0
  310. sage_wheels/share/ellcurves/rank7 +5 -0
  311. sage_wheels/share/ellcurves/rank8 +6 -0
  312. sage_wheels/share/ellcurves/rank9 +7 -0
@@ -0,0 +1,727 @@
1
+ # sage_setup: distribution = sagemath-schemes
2
+ """
3
+ Dokchitser's `L`-functions calculator
4
+
5
+ .. TODO::
6
+
7
+ - add more examples from SAGE_EXTCODE/pari/dokchitser that illustrate
8
+ use with Eisenstein series, number fields, etc.
9
+
10
+ - plug this code into number fields and modular forms code (elliptic
11
+ curves are done).
12
+
13
+ AUTHORS:
14
+
15
+ - Tim Dokchitser (2002): original PARI code and algorithm (and the
16
+ documentation below is based on Dokchitser's docs).
17
+
18
+ - William Stein (2006-03-08): Sage interface
19
+ """
20
+
21
+ # ****************************************************************************
22
+ # Copyright (C) 2006 William Stein <wstein@gmail.com>
23
+ #
24
+ # Distributed under the terms of the GNU General Public License (GPL)
25
+ # as published by the Free Software Foundation; either version 2 of
26
+ # the License, or (at your option) any later version.
27
+ # https://www.gnu.org/licenses/
28
+ # ****************************************************************************
29
+
30
+ import copy
31
+ import os
32
+ import re
33
+ import string
34
+
35
+ from sage.structure.sage_object import SageObject
36
+ from sage.rings.complex_mpfr import ComplexField
37
+ from sage.rings.integer import Integer
38
+ from sage.misc.verbose import verbose
39
+ import sage.interfaces.gp
40
+ from sage.env import SAGE_EXTCODE
41
+
42
+
43
+ class Dokchitser(SageObject):
44
+ r"""
45
+ Dokchitser's `L`-functions Calculator.
46
+
47
+ PARI code can be found on
48
+ `Dokchitser's homepage <https://people.maths.bris.ac.uk/~matyd/computel>`_.
49
+
50
+ Create a Dokchitser `L`-series with
51
+
52
+ Dokchitser(conductor, gammaV, weight, eps, poles, residues, init,
53
+ prec)
54
+
55
+ where
56
+
57
+ - ``conductor`` -- integer; the conductor
58
+
59
+ - ``gammaV`` -- list of Gamma-factor parameters, e.g. [0] for
60
+ Riemann zeta, [0,1] for ell.curves, (see examples)
61
+
62
+ - ``weight`` -- positive real number, usually an integer e.g. 1 for
63
+ Riemann zeta, 2 for `H^1` of curves/`\QQ`
64
+
65
+ - ``eps`` -- complex number; sign in functional equation
66
+
67
+ - ``poles`` -- (default: ``[]``) list of points where `L^*(s)` has
68
+ (simple) poles; only poles with `Re(s)>weight/2` should be
69
+ included
70
+
71
+ - ``residues`` -- vector of residues of `L^*(s)` in those poles or
72
+ set ``residues='automatic'`` (default)
73
+
74
+ - ``prec`` -- integer (default: 53); number of *bits* of precision
75
+
76
+ RIEMANN ZETA FUNCTION:
77
+
78
+ We compute with the Riemann Zeta function. ::
79
+
80
+ sage: L = Dokchitser(conductor=1, gammaV=[0], weight=1, eps=1, poles=[1], residues=[-1], init='1')
81
+ sage: L
82
+ Dokchitser L-series of conductor 1 and weight 1
83
+ sage: L(1)
84
+ Traceback (most recent call last):
85
+ ...
86
+ ArithmeticError
87
+ sage: L(2)
88
+ 1.64493406684823
89
+ sage: L(2, 1.1)
90
+ 1.64493406684823
91
+ sage: L.derivative(2)
92
+ -0.937548254315844
93
+ sage: h = RR('0.0000000000001')
94
+ sage: (zeta(2+h) - zeta(2.))/h
95
+ -0.937028232783632
96
+ sage: L.taylor_series(2, k=5)
97
+ 1.64493406684823 - 0.937548254315844*z + 0.994640117149451*z^2 - 1.00002430047384*z^3 + 1.00006193307...*z^4 + O(z^5)
98
+
99
+ RANK 1 ELLIPTIC CURVE:
100
+
101
+ We compute with the `L`-series of a rank `1` curve. ::
102
+
103
+ sage: # needs database_cremona_mini_ellcurve
104
+ sage: E = EllipticCurve('37a')
105
+ sage: L = E.lseries().dokchitser(algorithm='pari'); L
106
+ PARI L-function associated to Elliptic Curve defined by y^2 + y = x^3 - x over Rational Field
107
+ sage: L(1)
108
+ 0.000000000000000
109
+ sage: L.derivative(1)
110
+ 0.305999773834052
111
+ sage: L.derivative(1,2)
112
+ 0.373095594536324
113
+ sage: L.cost()
114
+ 50
115
+ sage: L.taylor_series(1,4)
116
+ 0.000000000000000 + 0.305999773834052*z + 0.186547797268162*z^2 - 0.136791463097188*z^3 + O(z^4)
117
+ sage: L.check_functional_equation() # abs tol 1e-17
118
+ 6.04442711160669e-18
119
+
120
+ RANK 2 ELLIPTIC CURVE:
121
+
122
+ We compute the leading coefficient and Taylor expansion of the
123
+ `L`-series of a rank `2` elliptic curve. ::
124
+
125
+ sage: # needs database_cremona_mini_ellcurve
126
+ sage: E = EllipticCurve('389a')
127
+ sage: L = E.lseries().dokchitser(algorithm='pari')
128
+ sage: L.cost()
129
+ 163
130
+ sage: L.derivative(1,E.rank())
131
+ 1.51863300057685
132
+ sage: L.taylor_series(1,4)
133
+ ...e-19 + (...e-19)*z + 0.759316500288427*z^2 - 0.430302337583362*z^3 + O(z^4)
134
+
135
+ NUMBER FIELD:
136
+
137
+ We compute with the Dedekind zeta function of a number field. ::
138
+
139
+ sage: x = polygen(QQ, 'x')
140
+ sage: K = NumberField(x**4 - x**2 - 1,'a')
141
+ sage: L = K.zeta_function(algorithm='gp')
142
+ sage: L.conductor
143
+ 400
144
+ sage: L.cost()
145
+ 313
146
+ sage: L(2)
147
+ 1.10398438736918
148
+ sage: L.taylor_series(2,3)
149
+ 1.10398438736918 - 0.215822638498759*z + 0.279836437522536*z^2 + O(z^3)
150
+
151
+ RAMANUJAN DELTA L-FUNCTION:
152
+
153
+ The coefficients are given by Ramanujan's tau function::
154
+
155
+ sage: L = Dokchitser(conductor=1, gammaV=[0,1], weight=12, eps=1)
156
+ sage: pari_precode = 'tau(n)=(5*sigma(n,3)+7*sigma(n,5))*n/12 - 35*sum(k=1,n-1,(6*k-4*(n-k))*sigma(k,3)*sigma(n-k,5))'
157
+ sage: L.init_coeffs('tau(k)', pari_precode=pari_precode)
158
+
159
+ We redefine the default bound on the coefficients: Deligne's
160
+ estimate on tau(n) is better than the default
161
+ coefgrow(n)= `(4n)^{11/2}` (by a factor 1024), so
162
+ re-defining coefgrow() improves efficiency (slightly faster). ::
163
+
164
+ sage: L.cost()
165
+ 12
166
+ sage: L.set_coeff_growth('2*n^(11/2)')
167
+ sage: L.cost()
168
+ 11
169
+
170
+ Now we're ready to evaluate, etc. ::
171
+
172
+ sage: L(1)
173
+ 0.0374412812685155
174
+ sage: L(1, 1.1)
175
+ 0.0374412812685155
176
+ sage: L.taylor_series(1,3)
177
+ 0.0374412812685155 + 0.0709221123619322*z + 0.0380744761270520*z^2 + O(z^3)
178
+ """
179
+
180
+ __gp = None
181
+ __globals = set()
182
+ # set of global variables defined in a run of the
183
+ # computel.gp script that are replaced by indexed copies
184
+ # in the computel.gp.template
185
+
186
+ __globals_re = None
187
+ __instance = 0 # Monotonically increasing unique instance ID
188
+ __n_instances = 0 # Number of currently allocated instances
189
+ __template_filename = os.path.join(SAGE_EXTCODE, 'pari', 'dokchitser',
190
+ 'computel.gp.template')
191
+ __init = False
192
+
193
+ def __new__(cls, *args, **kwargs):
194
+ inst = super().__new__(cls, *args, **kwargs)
195
+ inst.__instance = cls.__instance
196
+ cls.__n_instances += 1
197
+ cls.__instance += 1
198
+ return inst
199
+
200
+ def __init__(self, conductor, gammaV, weight, eps,
201
+ poles=None, residues='automatic', prec=53,
202
+ init=None):
203
+ """
204
+ Initialization of Dokchitser calculator EXAMPLES::
205
+
206
+ sage: L = Dokchitser(conductor=1, gammaV=[0], weight=1, eps=1, poles=[1], residues=[-1], init='1')
207
+ sage: L.cost()
208
+ 4
209
+ """
210
+ self.conductor = conductor
211
+ self.gammaV = gammaV
212
+ self.weight = weight
213
+ self.eps = eps
214
+ self.poles = poles if poles is not None else []
215
+ self.residues = residues
216
+ self.prec = prec
217
+ self.__CC = ComplexField(self.prec)
218
+ self.__RR = self.__CC._real_field()
219
+ self.__initialized = False
220
+ if init is not None:
221
+ self.init_coeffs(init)
222
+
223
+ def __reduce__(self):
224
+ D = copy.copy(self.__dict__)
225
+ if '_Dokchitser__gp' in D:
226
+ del D['_Dokchitser__gp']
227
+ return reduce_load_dokchitser, (D, )
228
+
229
+ def _repr_(self) -> str:
230
+ return "Dokchitser L-series of conductor %s and weight %s" % (
231
+ self.conductor, self.weight)
232
+
233
+ def __del__(self):
234
+ self._teardown_gp(self.__instance)
235
+
236
+ def gp(self):
237
+ """
238
+ Return the gp interpreter that is used to implement this Dokchitser
239
+ `L`-function.
240
+ """
241
+ if self.__gp is None:
242
+ self._instantiate_gp()
243
+ elif self.__initialized:
244
+ return self.__gp
245
+
246
+ self.__initialized = True
247
+
248
+ with open(self.__template_filename) as tf:
249
+ template = string.Template(tf.read())
250
+
251
+ from tempfile import NamedTemporaryFile
252
+ with NamedTemporaryFile(suffix='.gp', mode='w+t') as f:
253
+ f.write(template.substitute(i=str(self.__instance)))
254
+ f.flush()
255
+ self.__gp.read(f.name)
256
+
257
+ self._gp_eval('default(realprecision, %s)' % (self.prec // 3 + 2))
258
+ self._gp_set_inst('conductor', self.conductor)
259
+ self._gp_set_inst('gammaV', self.gammaV)
260
+ self._gp_set_inst('weight', self.weight)
261
+ self._gp_set_inst('sgn', self.eps)
262
+ self._gp_set_inst('Lpoles', self.poles)
263
+ self._gp_set_inst('Lresidues', self.residues)
264
+ return self.__gp
265
+
266
+ @classmethod
267
+ def _instantiate_gp(cls):
268
+ from sage.env import DOT_SAGE
269
+ logfile = os.path.join(DOT_SAGE, 'dokchitser.log')
270
+ cls.__gp = sage.interfaces.gp.Gp(script_subdirectory='dokchitser',
271
+ logfile=logfile)
272
+ # Read the script template and parse out all indexed global variables
273
+ # (easy because they all end in "_$i" and there's nothing else in the
274
+ # script that uses $)
275
+ global_re = re.compile(r'([a-zA-Z0-9]+)_\$i')
276
+ with open(cls.__template_filename) as f:
277
+ for line in f:
278
+ for m in global_re.finditer(line):
279
+ cls.__globals.add(m.group(1))
280
+
281
+ cls.__globals_re = re.compile(
282
+ '([^a-zA-Z0-9_]|^)(%s)([^a-zA-Z0-9_]|$)' % '|'.join(cls.__globals))
283
+
284
+ @classmethod
285
+ def _teardown_gp(cls, instance=None):
286
+ cls.__n_instances -= 1
287
+ if cls.__n_instances == 0:
288
+ cls.__gp.quit()
289
+ elif instance is not None:
290
+ # Clean up all global variables created by this instance
291
+ for varname in cls.__globals:
292
+ cls.__gp.eval('kill(%s_%s)' % (varname, instance))
293
+
294
+ def _gp_call_inst(self, func, *args):
295
+ """
296
+ Call the specified PARI function in the GP interpreter, with the
297
+ instance number of this `Dokchitser` instance automatically appended.
298
+
299
+ For example, ``self._gp_call_inst('L', 1)`` is equivalent to
300
+ ``self.gp().eval('L_N(1)')`` where ``N`` is ``self.__instance``.
301
+ """
302
+
303
+ cmd = '%s_%d(%s)' % (func, self.__instance,
304
+ ','.join(str(a) for a in args))
305
+ return self._gp_eval(cmd)
306
+
307
+ def _gp_set_inst(self, varname, value):
308
+ """
309
+ Like ``_gp_call_inst`` but sets the variable given by ``varname`` to
310
+ the given value, appending ``_N`` to the variable name.
311
+
312
+ If ``varname`` is a function (e.g. ``'func(n)'``) then this sets
313
+ ``func_N(n)``).
314
+ """
315
+
316
+ if '(' in varname:
317
+ funcname, args = varname.split('(', 1)
318
+ varname = '%s_%s(%s' % (funcname, self.__instance, args)
319
+ else:
320
+ varname = '%s_%s' % (varname, self.__instance)
321
+
322
+ cmd = '%s = %s' % (varname, value)
323
+ return self._gp_eval(cmd)
324
+
325
+ def _gp_eval(self, s):
326
+ try:
327
+ t = self.gp().eval(s)
328
+ except (RuntimeError, TypeError):
329
+ raise RuntimeError("unable to create L-series, due to precision or other limits in PARI")
330
+ if not self.__init and '***' in t:
331
+ # After init_coeffs is called, future calls to this method should
332
+ # return the full output for further parsing
333
+ raise RuntimeError("unable to create L-series, due to precision or other limits in PARI")
334
+ t = t.replace(" *** _^_: Warning: normalizing a series with 0 leading term.\n", "")
335
+ return t
336
+
337
+ def __check_init(self):
338
+ if not self.__init:
339
+ raise ValueError("you must call init_coeffs on the L-function first")
340
+
341
+ def cost(self, T=1):
342
+ """
343
+ Return the number of coefficients `a_n` that are needed in
344
+ order to perform most relevant `L`-function computations to
345
+ the desired precision.
346
+
347
+ EXAMPLES::
348
+
349
+ sage: # needs database_cremona_mini_ellcurve
350
+ sage: E = EllipticCurve('11a')
351
+ sage: L = E.lseries().dokchitser(algorithm='pari')
352
+ sage: L.cost()
353
+ 27
354
+ sage: E = EllipticCurve('5077a')
355
+ sage: L = E.lseries().dokchitser(algorithm='pari')
356
+ sage: L.cost()
357
+ 591
358
+ sage: L = Dokchitser(conductor=1, gammaV=[0], weight=1, eps=1, poles=[1], residues=[-1], init='1')
359
+ sage: L.cost()
360
+ 4
361
+
362
+ Verify that ``cost`` works with non-real spectral
363
+ parameters, e.g. for the `L`-function of the level 10 Maass form
364
+ with eigenvalue 2.7341055592527126::
365
+
366
+ sage: ev = 2.7341055592527126
367
+ sage: L = Dokchitser(conductor=10, gammaV=[ev*i, -ev*i],weight=2,eps=1)
368
+ sage: L.cost()
369
+ 26
370
+ """
371
+ return Integer(self._gp_call_inst('cflength', T))
372
+
373
+ num_coeffs = cost
374
+
375
+ def init_coeffs(self, v, cutoff=1,
376
+ w=None,
377
+ pari_precode='',
378
+ max_imaginary_part=0,
379
+ max_asymp_coeffs=40):
380
+ """
381
+ Set the coefficients `a_n` of the `L`-series.
382
+
383
+ If `L(s)` is not equal to its dual, pass the coefficients of
384
+ the dual as the second optional argument.
385
+
386
+ INPUT:
387
+
388
+ - ``v`` -- list of complex numbers or string (pari function of k)
389
+
390
+ - ``cutoff`` -- real number (default: 1)
391
+
392
+ - ``w`` -- list of complex numbers or string (pari function of k)
393
+
394
+ - ``pari_precode`` -- some code to execute in pari
395
+ before calling initLdata
396
+
397
+ - ``max_imaginary_part`` -- (default: 0) redefine if
398
+ you want to compute L(s) for s having large imaginary part
399
+
400
+ - ``max_asymp_coeffs`` -- (default: 40) at most this
401
+ many terms are generated in asymptotic series for phi(t) and G(s,t)
402
+
403
+ EXAMPLES::
404
+
405
+ sage: L = Dokchitser(conductor=1, gammaV=[0,1], weight=12, eps=1)
406
+ sage: pari_precode = 'tau(n)=(5*sigma(n,3)+7*sigma(n,5))*n/12 - 35*sum(k=1,n-1,(6*k-4*(n-k))*sigma(k,3)*sigma(n-k,5))'
407
+ sage: L.init_coeffs('tau(k)', pari_precode=pari_precode)
408
+
409
+ Evaluate the resulting `L`-function at a point, and compare with
410
+ the answer that one gets "by definition" (of `L`-function
411
+ attached to a modular form)::
412
+
413
+ sage: L(14)
414
+ 0.998583063162746
415
+ sage: a = delta_qexp(1000)
416
+ sage: sum(a[n]/float(n)^14 for n in reversed(range(1,1000)))
417
+ 0.9985830631627461
418
+
419
+ Illustrate that one can give a list of complex numbers for v
420
+ (see :issue:`10937`)::
421
+
422
+ sage: L2 = Dokchitser(conductor=1, gammaV=[0,1], weight=12, eps=1)
423
+ sage: L2.init_coeffs(list(delta_qexp(1000))[1:])
424
+ sage: L2(14)
425
+ 0.998583063162746
426
+
427
+ TESTS:
428
+
429
+ Verify that setting the `w` parameter does not raise an error
430
+ (see :issue:`10937`). Note that the meaning of `w` does not seem to
431
+ be documented anywhere in Dokchitser's package yet, so there is
432
+ no claim that the example below is meaningful! ::
433
+
434
+ sage: L2 = Dokchitser(conductor=1, gammaV=[0,1], weight=12, eps=1)
435
+ sage: L2.init_coeffs(list(delta_qexp(1000))[1:], w=[1..1000])
436
+ """
437
+ if isinstance(v, tuple) and w is None:
438
+ v, cutoff, w, pari_precode, max_imaginary_part, max_asymp_coeffs = v
439
+
440
+ if pari_precode:
441
+ # Must have __globals_re instantiated
442
+ if self.__gp is None:
443
+ self._instantiate_gp()
444
+
445
+ def repl(m):
446
+ return '%s%s_%d%s' % (m.group(1), m.group(2), self.__instance,
447
+ m.group(3))
448
+
449
+ # If any of the pre-code contains references to some of the
450
+ # templated global variables we must replace those as well
451
+ pari_precode = self.__globals_re.sub(repl, pari_precode)
452
+
453
+ if pari_precode != '':
454
+ self._gp_eval(pari_precode)
455
+ RR = self.__CC._real_field()
456
+ cutoff = RR(cutoff)
457
+ if isinstance(v, str):
458
+ if w is None:
459
+ self._gp_call_inst('initLdata', '"%s"' % v, cutoff)
460
+ else:
461
+ self._gp_call_inst('initLdata', '"%s"' % v, cutoff, '"%s"' % w)
462
+ elif not isinstance(v, (list, tuple)):
463
+ raise TypeError("v (=%s) must be a list, tuple, or string" % v)
464
+ else:
465
+ CC = self.__CC
466
+ v = ','.join(CC(a)._pari_init_() for a in v)
467
+ self._gp_eval('Avec = [%s]' % v)
468
+ if w is None:
469
+ self._gp_call_inst('initLdata', '"Avec[k]"', cutoff)
470
+ else:
471
+ w = ','.join(CC(a)._pari_init_() for a in w)
472
+ self._gp_eval('Bvec = [%s]' % w)
473
+ self._gp_call_inst('initLdata', '"Avec[k]"', cutoff,
474
+ '"Bvec[k]"')
475
+ self.__init = (v, cutoff, w, pari_precode, max_imaginary_part,
476
+ max_asymp_coeffs)
477
+
478
+ def _clear_value_cache(self):
479
+ del self.__values
480
+
481
+ def __call__(self, s, c=None):
482
+ r"""
483
+ INPUT:
484
+
485
+ - ``s`` -- complex number
486
+
487
+ - ``c`` -- internal parameter, call with `c>1` to get the same value
488
+ with a different cutoff point (`c` close to `1`); should return the
489
+ same answer, good to check if everything works with right precision
490
+
491
+ .. NOTE::
492
+
493
+ Evaluation of the function takes a long time, so each
494
+ evaluation is cached. Call ``self._clear_value_cache()`` to
495
+ clear the evaluation cache.
496
+
497
+ EXAMPLES::
498
+
499
+ sage: # needs database_cremona_mini_ellcurve
500
+ sage: E = EllipticCurve('5077a')
501
+ sage: L = E.lseries().dokchitser(100, algorithm='pari')
502
+ sage: L(1)
503
+ 0.00000000000000000000000000000
504
+ sage: L(1+I)
505
+ -1.3085436607849493358323930438 + 0.81298000036784359634835412129*I
506
+ """
507
+ self.__check_init()
508
+ s = self.__CC(s)
509
+ try:
510
+ return self.__values[s, c]
511
+ except AttributeError:
512
+ self.__values = {}
513
+ except KeyError:
514
+ pass
515
+ if c is None:
516
+ z = self._gp_call_inst('L', s)
517
+ else:
518
+ z = self._gp_call_inst('L', s, c)
519
+ CC = self.__CC
520
+ if 'pole' in z:
521
+ print(z)
522
+ raise ArithmeticError
523
+ elif '***' in z:
524
+ print(z)
525
+ raise RuntimeError
526
+ elif 'Warning' in z:
527
+ i = z.rfind('\n')
528
+ msg = z[:i].replace('digits', 'decimal digits')
529
+ verbose(msg, level=-1)
530
+ ans = CC(z[i + 1:])
531
+ self.__values[s, c] = ans
532
+ return ans
533
+ ans = CC(z)
534
+ self.__values[s, c] = ans
535
+ return ans
536
+
537
+ def derivative(self, s, k=1):
538
+ r"""
539
+ Return the `k`-th derivative of the `L`-series at `s`.
540
+
541
+ .. WARNING::
542
+
543
+ If `k` is greater than the order of vanishing of
544
+ `L` at `s` you may get nonsense.
545
+
546
+ EXAMPLES::
547
+
548
+ sage: # needs database_cremona_mini_ellcurve
549
+ sage: E = EllipticCurve('389a')
550
+ sage: L = E.lseries().dokchitser(algorithm='pari')
551
+ sage: L.derivative(1,E.rank())
552
+ 1.51863300057685
553
+ """
554
+ self.__check_init()
555
+ s = self.__CC(s)
556
+ k = Integer(k)
557
+ z = self._gp_call_inst('L', s, '', k)
558
+ if 'pole' in z:
559
+ raise ArithmeticError(z)
560
+ elif 'Warning' in z:
561
+ i = z.rfind('\n')
562
+ msg = z[:i].replace('digits', 'decimal digits')
563
+ verbose(msg, level=-1)
564
+ return self.__CC(z[i:])
565
+ return self.__CC(z)
566
+
567
+ def taylor_series(self, a=0, k=6, var='z'):
568
+ r"""
569
+ Return the first `k` terms of the Taylor series expansion
570
+ of the `L`-series about `a`.
571
+
572
+ This is returned as a series in ``var``, where you
573
+ should view ``var`` as equal to `s-a`. Thus
574
+ this function returns the formal power series whose coefficients
575
+ are `L^{(n)}(a)/n!`.
576
+
577
+ INPUT:
578
+
579
+ - ``a`` -- complex number (default: 0); point about which to expand
580
+
581
+ - ``k`` -- integer (default: 6); series is `O(\texttt{var}^k)`
582
+
583
+ - ``var`` -- string (default: ``'z'``); variable of power series
584
+
585
+ EXAMPLES::
586
+
587
+ sage: L = Dokchitser(conductor=1, gammaV=[0], weight=1, eps=1, poles=[1], residues=[-1], init='1')
588
+ sage: L.taylor_series(2, 3)
589
+ 1.64493406684823 - 0.937548254315844*z + 0.994640117149451*z^2 + O(z^3)
590
+
591
+ sage: # needs database_cremona_mini_ellcurve
592
+ sage: E = EllipticCurve('37a')
593
+ sage: L = E.lseries().dokchitser(algorithm='pari')
594
+ sage: L.taylor_series(1)
595
+ 0.000000000000000 + 0.305999773834052*z + 0.186547797268162*z^2 - 0.136791463097188*z^3 + 0.0161066468496401*z^4 + 0.0185955175398802*z^5 + O(z^6)
596
+
597
+ We compute a Taylor series where each coefficient is to high
598
+ precision. ::
599
+
600
+ sage: # needs database_cremona_mini_ellcurve
601
+ sage: E = EllipticCurve('389a')
602
+ sage: L = E.lseries().dokchitser(200, algorithm='pari')
603
+ sage: L.taylor_series(1,3)
604
+ ...e-63 + (...e-63)*z + 0.75931650028842677023019260789472201907809751649492435158581*z^2 + O(z^3)
605
+
606
+ Check that :issue:`25402` is fixed::
607
+
608
+ sage: # needs database_cremona_mini_ellcurve
609
+ sage: L = EllipticCurve("24a1").modular_form().lseries()
610
+ sage: L.taylor_series(-1, 3)
611
+ 0.000000000000000 - 0.702565506265199*z + 0.638929001045535*z^2 + O(z^3)
612
+
613
+ Check that :issue:`25965` is fixed::
614
+
615
+ sage: # needs database_cremona_mini_ellcurve
616
+ sage: L2 = EllipticCurve("37a1").modular_form().lseries(); L2
617
+ L-series associated to the cusp form q - 2*q^2 - 3*q^3 + 2*q^4 - 2*q^5 + O(q^6)
618
+ sage: L2.taylor_series(0,4)
619
+ 0.000000000000000 - 0.357620466127498*z + 0.273373112603865*z^2 + 0.303362857047671*z^3 + O(z^4)
620
+ sage: L2.taylor_series(0,1)
621
+ O(z^1)
622
+ sage: L2(0)
623
+ 0.000000000000000
624
+ """
625
+ self.__check_init()
626
+ a = self.__CC(a)
627
+ k = Integer(k)
628
+ try:
629
+ z = self._gp_call_inst('Lseries', a, '', k - 1)
630
+ z = self.gp()('Vecrev(Pol(%s))' % z)
631
+ except TypeError as msg:
632
+ raise RuntimeError("%s\nUnable to compute Taylor expansion (try lowering the number of terms)" % msg)
633
+ r = repr(z)
634
+ if 'pole' in r:
635
+ raise ArithmeticError(r)
636
+ elif 'Warning' in r:
637
+ i = r.rfind('\n')
638
+ msg = r[:i].replace('digits', 'decimal digits')
639
+ verbose(msg, level=-1)
640
+ v = list(z)
641
+ K = self.__CC
642
+ v = [K(repr(x)) for x in v]
643
+ R = self.__CC[[var]]
644
+ return R(v, k)
645
+
646
+ def check_functional_equation(self, T=1.2):
647
+ r"""
648
+ Verifies how well numerically the functional equation is satisfied,
649
+ and also determines the residues if ``self.poles !=
650
+ []`` and residues='automatic'.
651
+
652
+ More specifically: for `T>1` (default: 1.2),
653
+ ``self.check_functional_equation(T)`` should ideally
654
+ return 0 (to the current precision).
655
+
656
+ - if what this function returns does not look like 0 at all,
657
+ probably the functional equation is wrong (i.e. some of the
658
+ parameters gammaV, conductor etc., or the coefficients are wrong),
659
+
660
+ - if checkfeq(T) is to be used, more coefficients have to be
661
+ generated (approximately T times more), e.g. call cflength(1.3),
662
+ initLdata("a(k)",1.3), checkfeq(1.3)
663
+
664
+ - T=1 always (!) returns 0, so T has to be away from 1
665
+
666
+ - default value `T=1.2` seems to give a reasonable
667
+ balance
668
+
669
+ - if you don't have to verify the functional equation or the
670
+ L-values, call cost(1) and initLdata("a(k)",1), you need
671
+ slightly less coefficients.
672
+
673
+ EXAMPLES::
674
+
675
+ sage: L = Dokchitser(conductor=1, gammaV=[0], weight=1, eps=1, poles=[1], residues=[-1], init='1')
676
+ sage: L.check_functional_equation() # abs tol 1e-19
677
+ -2.71050543121376e-20
678
+
679
+ If we choose the sign in functional equation for the
680
+ `\zeta` function incorrectly, the functional equation
681
+ doesn't check out. ::
682
+
683
+ sage: L = Dokchitser(conductor=1, gammaV=[0], weight=1, eps=-11, poles=[1], residues=[-1], init='1')
684
+ sage: L.check_functional_equation()
685
+ -9.73967861488124
686
+ """
687
+ self.__check_init()
688
+ z = self._gp_call_inst('checkfeq', T)
689
+ z = z.replace(' ', '')
690
+ return self.__CC(z)
691
+
692
+ def set_coeff_growth(self, coefgrow):
693
+ r"""
694
+ You might have to redefine the coefficient growth function if the
695
+ `a_n` of the `L`-series are not given by the
696
+ following PARI function::
697
+
698
+ coefgrow(n) = if(length(Lpoles),
699
+ 1.5*n^(vecmax(real(Lpoles))-1),
700
+ sqrt(4*n)^(weight-1));
701
+
702
+
703
+ INPUT:
704
+
705
+ - ``coefgrow`` -- string that evaluates to a PARI function of n that
706
+ defines a coefgrow function
707
+
708
+ EXAMPLES::
709
+
710
+ sage: L = Dokchitser(conductor=1, gammaV=[0,1], weight=12, eps=1)
711
+ sage: pari_precode = 'tau(n)=(5*sigma(n,3)+7*sigma(n,5))*n/12 - 35*sum(k=1,n-1,(6*k-4*(n-k))*sigma(k,3)*sigma(n-k,5))'
712
+ sage: L.init_coeffs('tau(k)', pari_precode=pari_precode)
713
+ sage: L.set_coeff_growth('2*n^(11/2)')
714
+ sage: L(1)
715
+ 0.0374412812685155
716
+ """
717
+ if not isinstance(coefgrow, str):
718
+ raise TypeError("coefgrow must be a string")
719
+
720
+ self._gp_set_inst('coefgrow(n)', coefgrow.replace('\n', ' '))
721
+
722
+
723
+ def reduce_load_dokchitser(D):
724
+ X = Dokchitser(1, 1, 1, 1)
725
+ X.__dict__ = D
726
+ X.init_coeffs(X._Dokchitser__init)
727
+ return X