passagemath-schemes 10.6.40__cp314-cp314-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.

Potentially problematic release.


This version of passagemath-schemes might be problematic. Click here for more details.

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