passagemath-schemes 10.6.47__cp312-cp312-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 (311) 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.47.dist-info/METADATA +204 -0
  7. passagemath_schemes-10.6.47.dist-info/METADATA.bak +205 -0
  8. passagemath_schemes-10.6.47.dist-info/RECORD +311 -0
  9. passagemath_schemes-10.6.47.dist-info/WHEEL +6 -0
  10. passagemath_schemes-10.6.47.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-312-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-312-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-312-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-312-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-312-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-312-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-312-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-312-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_nf.py +1241 -0
  154. sage/modular/modsym/relation_matrix.py +591 -0
  155. sage/modular/modsym/relation_matrix_pyx.cpython-312-darwin.so +0 -0
  156. sage/modular/modsym/relation_matrix_pyx.pyx +108 -0
  157. sage/modular/modsym/space.py +2468 -0
  158. sage/modular/modsym/subspace.py +455 -0
  159. sage/modular/modsym/tests.py +375 -0
  160. sage/modular/multiple_zeta.py +2632 -0
  161. sage/modular/multiple_zeta_F_algebra.py +786 -0
  162. sage/modular/overconvergent/all.py +6 -0
  163. sage/modular/overconvergent/genus0.py +1878 -0
  164. sage/modular/overconvergent/hecke_series.py +1187 -0
  165. sage/modular/overconvergent/weightspace.py +778 -0
  166. sage/modular/pollack_stevens/all.py +4 -0
  167. sage/modular/pollack_stevens/distributions.py +874 -0
  168. sage/modular/pollack_stevens/fund_domain.py +1572 -0
  169. sage/modular/pollack_stevens/manin_map.py +859 -0
  170. sage/modular/pollack_stevens/modsym.py +1593 -0
  171. sage/modular/pollack_stevens/padic_lseries.py +417 -0
  172. sage/modular/pollack_stevens/sigma0.py +534 -0
  173. sage/modular/pollack_stevens/space.py +1076 -0
  174. sage/modular/quasimodform/all.py +3 -0
  175. sage/modular/quasimodform/element.py +845 -0
  176. sage/modular/quasimodform/ring.py +828 -0
  177. sage/modular/quatalg/all.py +3 -0
  178. sage/modular/quatalg/brandt.py +1642 -0
  179. sage/modular/ssmod/all.py +8 -0
  180. sage/modular/ssmod/ssmod.py +827 -0
  181. sage/rings/all__sagemath_schemes.py +1 -0
  182. sage/rings/polynomial/all__sagemath_schemes.py +1 -0
  183. sage/rings/polynomial/binary_form_reduce.py +585 -0
  184. sage/schemes/all.py +41 -0
  185. sage/schemes/berkovich/all.py +6 -0
  186. sage/schemes/berkovich/berkovich_cp_element.py +2582 -0
  187. sage/schemes/berkovich/berkovich_space.py +748 -0
  188. sage/schemes/curves/affine_curve.py +2928 -0
  189. sage/schemes/curves/all.py +33 -0
  190. sage/schemes/curves/closed_point.py +434 -0
  191. sage/schemes/curves/constructor.py +381 -0
  192. sage/schemes/curves/curve.py +542 -0
  193. sage/schemes/curves/plane_curve_arrangement.py +1283 -0
  194. sage/schemes/curves/point.py +463 -0
  195. sage/schemes/curves/projective_curve.py +3026 -0
  196. sage/schemes/curves/zariski_vankampen.py +1932 -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 +1036 -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 +1102 -0
  208. sage/schemes/elliptic_curves/constructor.py +1552 -0
  209. sage/schemes/elliptic_curves/ec_database.py +175 -0
  210. sage/schemes/elliptic_curves/ell_curve_isogeny.py +3972 -0
  211. sage/schemes/elliptic_curves/ell_egros.py +459 -0
  212. sage/schemes/elliptic_curves/ell_field.py +2836 -0
  213. sage/schemes/elliptic_curves/ell_finite_field.py +3359 -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 +4787 -0
  220. sage/schemes/elliptic_curves/ell_rational_field.py +7368 -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 +1669 -0
  227. sage/schemes/elliptic_curves/gp_simon.py +152 -0
  228. sage/schemes/elliptic_curves/heegner.py +7335 -0
  229. sage/schemes/elliptic_curves/height.py +2109 -0
  230. sage/schemes/elliptic_curves/hom.py +1406 -0
  231. sage/schemes/elliptic_curves/hom_composite.py +934 -0
  232. sage/schemes/elliptic_curves/hom_frobenius.py +522 -0
  233. sage/schemes/elliptic_curves/hom_scalar.py +531 -0
  234. sage/schemes/elliptic_curves/hom_sum.py +682 -0
  235. sage/schemes/elliptic_curves/hom_velusqrt.py +1290 -0
  236. sage/schemes/elliptic_curves/homset.py +271 -0
  237. sage/schemes/elliptic_curves/isogeny_class.py +1521 -0
  238. sage/schemes/elliptic_curves/isogeny_small_degree.py +2797 -0
  239. sage/schemes/elliptic_curves/jacobian.py +237 -0
  240. sage/schemes/elliptic_curves/kodaira_symbol.py +344 -0
  241. sage/schemes/elliptic_curves/kraus.py +1014 -0
  242. sage/schemes/elliptic_curves/lseries_ell.py +943 -0
  243. sage/schemes/elliptic_curves/mod5family.py +105 -0
  244. sage/schemes/elliptic_curves/mod_poly.py +197 -0
  245. sage/schemes/elliptic_curves/mod_sym_num.cpython-312-darwin.so +0 -0
  246. sage/schemes/elliptic_curves/mod_sym_num.pyx +3796 -0
  247. sage/schemes/elliptic_curves/modular_parametrization.py +305 -0
  248. sage/schemes/elliptic_curves/padic_lseries.py +1793 -0
  249. sage/schemes/elliptic_curves/padics.py +1816 -0
  250. sage/schemes/elliptic_curves/period_lattice.py +2234 -0
  251. sage/schemes/elliptic_curves/period_lattice_region.cpython-312-darwin.so +0 -0
  252. sage/schemes/elliptic_curves/period_lattice_region.pyx +722 -0
  253. sage/schemes/elliptic_curves/saturation.py +715 -0
  254. sage/schemes/elliptic_curves/sha_tate.py +1158 -0
  255. sage/schemes/elliptic_curves/weierstrass_morphism.py +1117 -0
  256. sage/schemes/elliptic_curves/weierstrass_transform.py +200 -0
  257. sage/schemes/hyperelliptic_curves/all.py +6 -0
  258. sage/schemes/hyperelliptic_curves/constructor.py +291 -0
  259. sage/schemes/hyperelliptic_curves/hyperelliptic_finite_field.py +1914 -0
  260. sage/schemes/hyperelliptic_curves/hyperelliptic_g2.py +192 -0
  261. sage/schemes/hyperelliptic_curves/hyperelliptic_generic.py +954 -0
  262. sage/schemes/hyperelliptic_curves/hyperelliptic_padic_field.py +1332 -0
  263. sage/schemes/hyperelliptic_curves/hyperelliptic_rational_field.py +84 -0
  264. sage/schemes/hyperelliptic_curves/invariants.py +410 -0
  265. sage/schemes/hyperelliptic_curves/jacobian_endomorphism_utils.py +315 -0
  266. sage/schemes/hyperelliptic_curves/jacobian_g2.py +32 -0
  267. sage/schemes/hyperelliptic_curves/jacobian_generic.py +419 -0
  268. sage/schemes/hyperelliptic_curves/jacobian_homset.py +186 -0
  269. sage/schemes/hyperelliptic_curves/jacobian_morphism.py +875 -0
  270. sage/schemes/hyperelliptic_curves/kummer_surface.py +99 -0
  271. sage/schemes/hyperelliptic_curves/mestre.py +302 -0
  272. sage/schemes/hyperelliptic_curves/monsky_washnitzer.py +3871 -0
  273. sage/schemes/jacobians/abstract_jacobian.py +277 -0
  274. sage/schemes/jacobians/all.py +2 -0
  275. sage/schemes/overview.py +161 -0
  276. sage/schemes/plane_conics/all.py +22 -0
  277. sage/schemes/plane_conics/con_field.py +1296 -0
  278. sage/schemes/plane_conics/con_finite_field.py +158 -0
  279. sage/schemes/plane_conics/con_number_field.py +456 -0
  280. sage/schemes/plane_conics/con_rational_field.py +406 -0
  281. sage/schemes/plane_conics/con_rational_function_field.py +580 -0
  282. sage/schemes/plane_conics/constructor.py +249 -0
  283. sage/schemes/plane_quartics/all.py +2 -0
  284. sage/schemes/plane_quartics/quartic_constructor.py +71 -0
  285. sage/schemes/plane_quartics/quartic_generic.py +73 -0
  286. sage/schemes/riemann_surfaces/all.py +1 -0
  287. sage/schemes/riemann_surfaces/riemann_surface.py +4117 -0
  288. sage_wheels/share/cremona/cremona_mini.db +0 -0
  289. sage_wheels/share/ellcurves/rank0 +30427 -0
  290. sage_wheels/share/ellcurves/rank1 +31871 -0
  291. sage_wheels/share/ellcurves/rank10 +6 -0
  292. sage_wheels/share/ellcurves/rank11 +6 -0
  293. sage_wheels/share/ellcurves/rank12 +1 -0
  294. sage_wheels/share/ellcurves/rank14 +1 -0
  295. sage_wheels/share/ellcurves/rank15 +1 -0
  296. sage_wheels/share/ellcurves/rank17 +1 -0
  297. sage_wheels/share/ellcurves/rank19 +1 -0
  298. sage_wheels/share/ellcurves/rank2 +2388 -0
  299. sage_wheels/share/ellcurves/rank20 +1 -0
  300. sage_wheels/share/ellcurves/rank21 +1 -0
  301. sage_wheels/share/ellcurves/rank22 +1 -0
  302. sage_wheels/share/ellcurves/rank23 +1 -0
  303. sage_wheels/share/ellcurves/rank24 +1 -0
  304. sage_wheels/share/ellcurves/rank28 +1 -0
  305. sage_wheels/share/ellcurves/rank3 +836 -0
  306. sage_wheels/share/ellcurves/rank4 +10 -0
  307. sage_wheels/share/ellcurves/rank5 +5 -0
  308. sage_wheels/share/ellcurves/rank6 +5 -0
  309. sage_wheels/share/ellcurves/rank7 +5 -0
  310. sage_wheels/share/ellcurves/rank8 +6 -0
  311. sage_wheels/share/ellcurves/rank9 +7 -0
@@ -0,0 +1,1187 @@
1
+ # sage_setup: distribution = sagemath-schemes
2
+ # sage.doctest: needs sage.libs.flint sage.libs.pari
3
+ r"""
4
+ Atkin/Hecke series for overconvergent modular forms
5
+
6
+ This file contains a function :func:`~hecke_series` to compute the
7
+ characteristic series `P(t)` modulo `p^m` of the Atkin/Hecke operator `U_p`
8
+ upon the space of `p`-adic overconvergent modular forms of level `\Gamma_0(N)`.
9
+ The input weight ``k`` can also be a list ``klist`` of weights which must all
10
+ be congruent modulo `(p-1)`.
11
+
12
+ Two optional parameters ``modformsring`` and ``weightbound`` can be specified,
13
+ and in most cases for levels `N > 1` they can be used to obtain the output more
14
+ quickly. When `m \le k-1` the output `P(t)` is also equal modulo `p^m` to the
15
+ reverse characteristic polynomial of the Atkin operator `U_p` on the space of
16
+ classical modular forms of weight `k` and level `\Gamma_0(Np)`. In addition,
17
+ provided `m \le (k-2)/2` the output `P(t)` is equal modulo `p^m` to the reverse
18
+ characteristic polynomial of the Hecke operator `T_p` on the space of classical
19
+ modular forms of weight `k` and level `\Gamma_0(N)`. The function is based upon
20
+ the main algorithm in [Lau2011]_, and has linear running time in the logarithm of
21
+ the weight `k`.
22
+
23
+ AUTHORS:
24
+
25
+ - Alan G.B. Lauder (2011-11-10): original implementation.
26
+ - David Loeffler (2011-12): minor optimizations in review stage.
27
+
28
+ EXAMPLES:
29
+
30
+ The characteristic series of the `U_{11}` operator modulo `11^{10}` on the space of 11-adic overconvergent
31
+ modular forms of level 1 and weight 10000::
32
+
33
+ sage: hecke_series(11, 1, 10000, 10)
34
+ 10009319650*x^4 + 25618839103*x^3 + 6126165716*x^2 + 10120524732*x + 1
35
+
36
+ The characteristic series of the U_5 operator modulo 5^5 on the space of 5-adic overconvergent
37
+ modular forms of level 3 and weight 1000::
38
+
39
+ sage: hecke_series(5, 3, 1000, 5)
40
+ 1875*x^6 + 1250*x^5 + 1200*x^4 + 1385*x^3 + 1131*x^2 + 2533*x + 1
41
+
42
+ The characteristic series of the `U_7` operator modulo `7^5` on the space of 7-adic overconvergent
43
+ modular forms of level 5 and weight 1000. Here the optional parameter ``modformsring`` is set to ``True``::
44
+
45
+ sage: hecke_series(7, 5, 1000, 5, modformsring=True) # long time (21s on sage.math, 2012)
46
+ 12005*x^7 + 10633*x^6 + 6321*x^5 + 6216*x^4 + 5412*x^3 + 4927*x^2 + 4906*x + 1
47
+
48
+ The characteristic series of the `U_{13}` operator modulo `13^5` on the space of 13-adic overconvergent
49
+ modular forms of level 2 and weight 10000. Here the optional parameter ``weightbound`` is set to 4::
50
+
51
+ sage: hecke_series(13, 2, 10000, 5, weightbound=4) # long time (17s on sage.math, 2012)
52
+ 325156*x^5 + 109681*x^4 + 188617*x^3 + 220858*x^2 + 269566*x + 1
53
+
54
+ A list containing the characteristic series of the `U_{23}` operator modulo `23^{10}` on the spaces of
55
+ 23-adic overconvergent modular forms of level 1 and weights 1000 and 1022, respectively.
56
+
57
+ ::
58
+
59
+ sage: hecke_series(23, 1, [1000, 1022], 10)
60
+ [7204610645852*x^6 + 2117949463923*x^5 + 24152587827773*x^4 + 31270783576528*x^3 + 30336366679797*x^2
61
+ + 29197235447073*x + 1, 32737396672905*x^4 + 36141830902187*x^3 + 16514246534976*x^2 + 38886059530878*x + 1]
62
+ """
63
+
64
+ # ****************************************************************************
65
+ # Copyright (C) 2011 Alan Lauder <lauder@maths.ox.ac.uk>
66
+ #
67
+ # This program is free software: you can redistribute it and/or modify
68
+ # it under the terms of the GNU General Public License as published by
69
+ # the Free Software Foundation, either version 2 of the License, or
70
+ # (at your option) any later version.
71
+ # https://www.gnu.org/licenses/
72
+ # ****************************************************************************
73
+
74
+ from sage.arith.misc import valuation
75
+ from sage.functions.other import floor, ceil
76
+ from sage.matrix.constructor import matrix, random_matrix
77
+ from sage.matrix.matrix_space import MatrixSpace
78
+ from sage.misc.functional import dimension, transpose, charpoly
79
+ from sage.misc.timing import cputime
80
+ from sage.misc.verbose import verbose
81
+ from sage.modular.dims import dimension_modular_forms
82
+ from sage.modular.modform.all import ModularForms, ModularFormsRing, delta_qexp, eisenstein_series_qexp
83
+ from sage.rings.finite_rings.finite_field_constructor import GF
84
+ from sage.rings.finite_rings.integer_mod_ring import Zmod
85
+ from sage.rings.infinity import Infinity
86
+ from sage.rings.integer import Integer
87
+ from sage.rings.integer_ring import ZZ
88
+
89
+ # AUXILIARY CODE: SPACES OF MODULAR FORMS AND LINEAR ALGEBRA
90
+
91
+
92
+ def compute_G(p, F):
93
+ r"""
94
+ Given a power series `F \in R[[q]]^\times`, for some ring `R`, and an
95
+ integer `p`, compute the quotient
96
+
97
+ .. MATH::
98
+
99
+ \frac{F(q)}{F(q^p)}.
100
+
101
+ Used by :func:`level1_UpGj` and by :func:`higher_level_UpGj`, with `F` equal
102
+ to the Eisenstein series `E_{p-1}`.
103
+
104
+ INPUT:
105
+
106
+ - ``p`` -- integer
107
+ - ``F`` -- power series (with invertible constant term)
108
+
109
+ OUTPUT:
110
+
111
+ the power series `F(q) / F(q^p)`, to the same precision as `F`
112
+
113
+ EXAMPLES::
114
+
115
+ sage: E = sage.modular.overconvergent.hecke_series.eisenstein_series_qexp(2, 12, Zmod(9),normalization='constant')
116
+ sage: sage.modular.overconvergent.hecke_series.compute_G(3, E)
117
+ 1 + 3*q + 3*q^4 + 6*q^7 + O(q^12)
118
+ """
119
+ Fp = (F.truncate_powerseries(ceil(F.prec() / ZZ(p)))).V(p)
120
+ return F / Fp
121
+
122
+
123
+ def low_weight_bases(N, p, m, NN, weightbound):
124
+ r"""
125
+ Return a list of integral bases of modular forms of level `N` and (even)
126
+ weight at most ``weightbound``, as `q`-expansions modulo `(p^m,q^{NN})`.
127
+
128
+ These forms are obtained by reduction mod `p^m` from an integral basis in
129
+ Hermite normal form (so they are not necessarily in reduced row echelon
130
+ form mod `p^m`, but they are not far off).
131
+
132
+ INPUT:
133
+
134
+ - ``N`` -- positive integer (level)
135
+ - ``p`` -- prime
136
+ - ``m``, ``NN`` -- positive integers
137
+ - ``weightbound`` -- (even) positive integer
138
+
139
+ OUTPUT: list of lists of `q`-expansions modulo `(p^m,q^{NN})`
140
+
141
+ EXAMPLES::
142
+
143
+ sage: from sage.modular.overconvergent.hecke_series import low_weight_bases
144
+ sage: low_weight_bases(2, 5, 3, 5, 6)
145
+ [[1 + 24*q + 24*q^2 + 96*q^3 + 24*q^4 + O(q^5)],
146
+ [1 + 115*q^2 + 35*q^4 + O(q^5), q + 8*q^2 + 28*q^3 + 64*q^4 + O(q^5)],
147
+ [1 + 121*q^2 + 118*q^4 + O(q^5), q + 32*q^2 + 119*q^3 + 24*q^4 + O(q^5)]]
148
+ """
149
+ generators = []
150
+
151
+ for k in range(2,weightbound + 2, 2):
152
+ b = ModularForms(N, k, base_ring=Zmod(p ** m)).q_expansion_basis(prec=NN)
153
+ generators.append(list(b))
154
+ return generators
155
+
156
+
157
+ def random_low_weight_bases(N, p, m, NN, weightbound):
158
+ r"""
159
+ Return list of random integral bases of modular forms of level `N` and
160
+ (even) weight at most weightbound with coefficients reduced modulo
161
+ `(p^m,q^{NN})`.
162
+
163
+ INPUT:
164
+
165
+ - ``N`` -- positive integer (level)
166
+ - ``p`` -- prime
167
+ - ``m``, ``NN`` -- positive integers
168
+ - ``weightbound`` -- (even) positive integer
169
+
170
+ OUTPUT: list of lists of `q`-expansions modulo `(p^m,q^{NN})`
171
+
172
+ EXAMPLES::
173
+
174
+ sage: from sage.modular.overconvergent.hecke_series import random_low_weight_bases
175
+ sage: S = random_low_weight_bases(3, 7, 2, 5, 6); S # random
176
+ [[4 + 48*q + 46*q^2 + 48*q^3 + 42*q^4 + O(q^5)],
177
+ [3 + 5*q + 45*q^2 + 22*q^3 + 22*q^4 + O(q^5),
178
+ 1 + 3*q + 27*q^2 + 27*q^3 + 23*q^4 + O(q^5)],
179
+ [2*q + 4*q^2 + 16*q^3 + 48*q^4 + O(q^5),
180
+ 2 + 6*q + q^2 + 3*q^3 + 43*q^4 + O(q^5),
181
+ 1 + 2*q + 6*q^2 + 14*q^3 + 4*q^4 + O(q^5)]]
182
+ sage: S[0][0].parent()
183
+ Power Series Ring in q over Ring of integers modulo 49
184
+ sage: S[0][0].prec()
185
+ 5
186
+ """
187
+ LWB = low_weight_bases(N,p,m,NN,weightbound)
188
+ # this is "approximately" row reduced (it's the mod p^n reduction of a
189
+ # matrix over ZZ in Hermite form)
190
+ RandomLWB = []
191
+ for i in range(len(LWB)):
192
+ n = len(LWB[i])
193
+ c = random_matrix(Zmod(p ** m), n)
194
+ while c.det() % p == 0:
195
+ c = random_matrix(Zmod(p ** m), n)
196
+ RandomLWB.append([ sum([c[j, k] * LWB[i][k] for k in range(n)]) for j in range(n) ])
197
+
198
+ return RandomLWB
199
+
200
+
201
+ def low_weight_generators(N, p, m, NN):
202
+ r"""
203
+ Return a list of lists of modular forms, and an even natural number.
204
+
205
+ The first output is a list of lists of modular forms reduced modulo
206
+ `(p^m,q^{NN})` which generate the `(\ZZ / p^m \ZZ)`-algebra of mod `p^m`
207
+ modular forms of weight at most 8, and the second output is the largest
208
+ weight among the forms in the generating set.
209
+
210
+ We (Alan Lauder and David Loeffler, the author and reviewer of this patch)
211
+ conjecture that forms of weight at most 8 are always sufficient to generate
212
+ the algebra of mod `p^m` modular forms of all weights. (We believe 6 to be
213
+ sufficient, and we can prove that 4 is sufficient when there are no
214
+ elliptic points, but using weights up to 8 acts as a consistency check.)
215
+
216
+ INPUT:
217
+
218
+ - ``N`` -- positive integer (level)
219
+ - ``p`` -- prime
220
+ - ``m``, ``NN`` -- positive integers
221
+
222
+ OUTPUT: a tuple consisting of:
223
+
224
+ - a list of lists of `q`-expansions modulo `(p^m,q^{NN})`,
225
+ - an even natural number (twice the length of the list).
226
+
227
+ EXAMPLES::
228
+
229
+ sage: from sage.modular.overconvergent.hecke_series import low_weight_generators
230
+ sage: low_weight_generators(3, 7, 3, 10) # needs sage.combinat
231
+ ([[1 + 12*q + 36*q^2 + 12*q^3 + 84*q^4 + 72*q^5 + 36*q^6 + 96*q^7 + 180*q^8 + 12*q^9 + O(q^10)],
232
+ [1 + 240*q^3 + 102*q^6 + 203*q^9 + O(q^10)],
233
+ [1 + 182*q^3 + 175*q^6 + 161*q^9 + O(q^10)]], 6)
234
+ sage: low_weight_generators(11, 5, 3, 10) # needs sage.combinat
235
+ ([[1 + 12*q^2 + 12*q^3 + 12*q^4 + 12*q^5 + 24*q^6 + 24*q^7 + 36*q^8 + 36*q^9 + O(q^10),
236
+ q + 123*q^2 + 124*q^3 + 2*q^4 + q^5 + 2*q^6 + 123*q^7 + 123*q^9 + O(q^10)],
237
+ [q + 116*q^4 + 115*q^5 + 102*q^6 + 121*q^7 + 96*q^8 + 106*q^9 + O(q^10)]], 4)
238
+ """
239
+ M = ModularFormsRing(N, base_ring=Zmod(p))
240
+ b = M.gen_forms(maxweight=8)
241
+ weightbound = max(f.weight() for f in b)
242
+ generators = [[f.qexp(NN).change_ring(Zmod(p ** m))
243
+ for f in b if f.weight() == k]
244
+ for k in range(2, weightbound + 2, 2)]
245
+ return generators, weightbound
246
+
247
+
248
+ def random_solution(B, K):
249
+ r"""
250
+ Return a random solution in nonnegative integers to the equation `a_1 + 2
251
+ a_2 + 3 a_3 + ... + B a_B = K`, using a greedy algorithm.
252
+
253
+ Note that this is *much* faster than using
254
+ ``WeightedIntegerVectors.random_element()``.
255
+
256
+ INPUT:
257
+
258
+ - ``B``, ``K`` -- nonnegative integers
259
+
260
+ OUTPUT: list
261
+
262
+ EXAMPLES::
263
+
264
+ sage: from sage.modular.overconvergent.hecke_series import random_solution
265
+ sage: s = random_solution(5, 10)
266
+ sage: sum(s[i] * (i + 1) for i in range(5))
267
+ 10
268
+ sage: S = set()
269
+ sage: while len(S) != 30:
270
+ ....: s = random_solution(5, 10)
271
+ ....: assert sum(s[i] * (i + 1) for i in range(5)) == 10
272
+ ....: S.add(tuple(s))
273
+ """
274
+ a = []
275
+ for i in range(B,1,-1):
276
+ ai = ZZ.random_element((K // i) + 1)
277
+ a.append(ai)
278
+ K = K - ai*i
279
+ a.append(K)
280
+ a.reverse()
281
+
282
+ return a
283
+
284
+
285
+ # AUXILIARY CODE: ECHELON FORM
286
+
287
+ def ech_form(A, p):
288
+ r"""
289
+ Return echelon form of matrix ``A`` over the ring of integers modulo
290
+ `p^m`, for some prime `p` and `m \ge 1`.
291
+
292
+ .. TODO::
293
+
294
+ This should be moved to :mod:`sage.matrix.matrix_modn_dense` at some
295
+ point.
296
+
297
+ INPUT:
298
+
299
+ - ``A`` -- matrix over ``Zmod(p^m)`` for some m
300
+ - ``p`` -- prime p
301
+
302
+ OUTPUT: matrix over ``Zmod(p^m)``
303
+
304
+ EXAMPLES::
305
+
306
+ sage: from sage.modular.overconvergent.hecke_series import ech_form
307
+ sage: A = MatrixSpace(Zmod(5 ** 3), 3)([1, 2, 3, 4, 5, 6, 7, 8, 9])
308
+ sage: ech_form(A, 5)
309
+ [1 2 3]
310
+ [0 1 2]
311
+ [0 0 0]
312
+ """
313
+ S = A[0, 0].parent()
314
+ a = A.nrows()
315
+ b = A.ncols()
316
+
317
+ k = 0 # position pivoting row will be swapped to
318
+ for j in range(b):
319
+ if k < a:
320
+ pivj = k # find new pivot
321
+ for i in range(k + 1, a):
322
+ if valuation(A[i, j], p) < valuation(A[pivj, j], p):
323
+ pivj = i
324
+ if valuation(A[pivj, j], p) < +Infinity: # else column already reduced
325
+ A.swap_rows(pivj, k)
326
+ A.set_row_to_multiple_of_row(k, k, S(ZZ(A[k, j])/(p ** valuation(A[k, j], p))) ** (-1))
327
+ for i in range(k + 1, a):
328
+ A.add_multiple_of_row(i, k, S(-ZZ(A[i, j]) / ZZ(A[k, j])))
329
+ k = k + 1
330
+
331
+ return A
332
+
333
+
334
+ # *** COMPLEMENTARY SPACES FOR LEVEL N > 1 ***
335
+
336
+ def random_new_basis_modp(N, p, k, LWBModp, TotalBasisModp, elldash, bound):
337
+ r"""
338
+ Return a list of lists of lists ``[j, a]`` encoding a choice of basis for
339
+ the `i`-th complementary space `W_i`, as explained in the documentation for the
340
+ function :func:`complementary_spaces_modp`.
341
+
342
+ INPUT:
343
+
344
+ - ``N`` -- positive integer at least 2 and not divisible by `p` (level)
345
+ - ``p`` -- prime at least 5
346
+ - ``k`` -- nonnegative integer
347
+ - ``LWBModp`` -- list of list of `q`-expansions modulo `(p,q^\text{elldash})`
348
+ - ``TotalBasisModp`` -- matrix over `\mathrm{GF}(p)`
349
+ - ``elldash`` -- positive integer
350
+ - ``bound`` -- positive even integer (twice the length of the list ``LWBModp``)
351
+
352
+ OUTPUT: list of lists of lists ``[j, a]``
353
+
354
+ .. NOTE::
355
+
356
+ As well as having a non-trivial return value, this function also
357
+ modifies the input matrix ``TotalBasisModp``.
358
+
359
+ EXAMPLES::
360
+
361
+ sage: from sage.modular.overconvergent.hecke_series import random_low_weight_bases, complementary_spaces_modp
362
+ sage: LWB = random_low_weight_bases(2, 5, 2, 4, 6)
363
+ sage: LWBModp = [ [f.change_ring(GF(5)) for f in x] for x in LWB]
364
+ sage: complementary_spaces_modp(2, 5, 2, 3, 4, LWBModp, 4) # random, indirect doctest
365
+ [[[[0, 0]]], [[[0, 0], [1, 1]]], [[[0, 0], [1, 0], [1, 1]]], [[[0, 0], [1, 0], [1, 1], [1, 1]]]]
366
+ """
367
+
368
+ R = LWBModp[0][0].parent()
369
+
370
+ # Case k0 + i(p-1) = 0 + 0(p-1) = 0
371
+
372
+ if k == 0:
373
+ TotalBasisModp[0,0] = 1
374
+ return [[]]
375
+
376
+ # Case k = k0 + i(p-1) > 0
377
+
378
+ di = dimension_modular_forms(N, k)
379
+ diminus1 = dimension_modular_forms(N, k - (p - 1))
380
+ mi = di - diminus1
381
+
382
+ NewBasisCode = []
383
+ rk = diminus1
384
+ for i in range(1, mi + 1):
385
+ while (rk < diminus1 + i):
386
+ # take random product of basis elements
387
+ exps = random_solution(bound // 2, k // 2)
388
+ TotalBasisi = R(1)
389
+ TotalBasisiCode = []
390
+ for j in range(len(exps)):
391
+ for l in range(exps[j]):
392
+ a = ZZ.random_element(len(LWBModp[j]))
393
+ TotalBasisi = TotalBasisi * LWBModp[j][a]
394
+ TotalBasisiCode.append([j, a])
395
+ TotalBasisModp[rk] = [TotalBasisi[j] for j in range(elldash)]
396
+ TotalBasisModp.echelonize()
397
+ rk = TotalBasisModp.rank()
398
+ NewBasisCode.append(TotalBasisiCode) # this choice increased the rank
399
+
400
+ return NewBasisCode
401
+
402
+
403
+ def complementary_spaces_modp(N, p, k0, n, elldash, LWBModp, bound):
404
+ r"""
405
+ Return a list of lists of lists of lists ``[j, a]``. The pairs ``[j, a]``
406
+ encode the choice of the `a`-th element in the `j`-th list of the input
407
+ ``LWBModp``, i.e., the `a`-th element in a particular basis modulo
408
+ `(p,q^\text{elldash})` for the space of modular forms of level
409
+ `\Gamma_0(N)` and weight `2(j+1)`. The list ``[[j_1, a_1], ...,[j_r, a_r]]``
410
+ then encodes the product of the r modular forms associated to each
411
+ ``[j_i, a_i]``; this has weight `k + (p-1)i` for some `0 \le i \le n`; here
412
+ the `i` is such that this *list of lists* occurs in the `i`-th list of the
413
+ output. The `i`-th list of the output thus encodes a choice of basis for the
414
+ complementary space `W_i` which occurs in Step 2 of Algorithm 2 in [Lau2011]_.
415
+ The idea is that one searches for this space `W_i` first modulo
416
+ `(p,q^\text{elldash})` and then, having found the correct products of
417
+ generating forms, one can reconstruct these spaces modulo
418
+ `(p^\text{mdash},q^\text{elldashp})` using the output of this function.
419
+ (This idea is based upon a suggestion of John Voight.)
420
+
421
+ INPUT:
422
+
423
+ - ``N`` -- positive integer at least 2 and not divisible by `p` (level)
424
+ - ``p`` -- prime at least 5
425
+ - ``k0`` -- integer in range 0 to `p-1`
426
+ - ``n``, ``elldash`` -- positive integers
427
+ - ``LWBModp`` -- list of lists of `q`-expansions over `GF(p)`
428
+ - ``bound`` -- positive even integer (twice the length of the list ``LWBModp``)
429
+
430
+ OUTPUT: list of list of list of lists
431
+
432
+ EXAMPLES::
433
+
434
+ sage: from sage.modular.overconvergent.hecke_series import random_low_weight_bases, complementary_spaces_modp
435
+ sage: LWB = random_low_weight_bases(2, 5, 2, 4, 6)
436
+ sage: LWBModp = [[f.change_ring(Zmod(5)) for f in x] for x in LWB]
437
+ sage: complementary_spaces_modp(2, 5, 0, 3, 4, LWBModp, 6) # random, indirect doctest
438
+ [[[]], [[[0, 0], [0, 0]]], [[[0, 0], [2, 1]]], [[[0, 0], [0, 0], [0, 0], [2, 1]]]]
439
+ """
440
+ CompSpacesCode = []
441
+ ell = dimension_modular_forms(N, k0 + n * (p - 1))
442
+ TotalBasisModp = matrix(GF(p), ell, elldash) # zero matrix
443
+
444
+ for i in range(n + 1):
445
+ NewBasisCodemi = random_new_basis_modp(N, p, k0 + i * (p - 1), LWBModp, TotalBasisModp, elldash, bound)
446
+ # TotalBasisModp is passed by reference and updated in function
447
+ CompSpacesCode.append(NewBasisCodemi)
448
+
449
+ return CompSpacesCode
450
+
451
+
452
+ def complementary_spaces(N, p, k0, n, mdash, elldashp, elldash, modformsring, bound):
453
+ r"""
454
+ Return a list ``Ws``, each element in which is a list ``Wi`` of
455
+ `q`-expansions modulo `(p^\text{mdash},q^\text{elldashp})`. The list ``Wi`` is
456
+ a basis for a choice of complementary space in level `\Gamma_0(N)` and
457
+ weight `k` to the image of weight `k - (p-1)` forms under multiplication by
458
+ the Eisenstein series `E_{p-1}`.
459
+
460
+ The lists ``Wi`` play the same role as `W_i` in Step 2 of Algorithm 2 in
461
+ [Lau2011]_. (The parameters ``k0, n, mdash, elldash, elldashp = elldash * p`` are
462
+ defined as in Step 1 of that algorithm when this function is used in
463
+ :func:`hecke_series`.) However, the complementary spaces are computed in a
464
+ different manner, combining a suggestion of David Loeffler with one of John
465
+ Voight. That is, one builds these spaces recursively using random products
466
+ of forms in low weight, first searching for suitable products modulo
467
+ `(p,q^\text{elldash})`, and then later reconstructing only the required
468
+ products to the full precision modulo `(p^\text{mdash},q^\text{elldashp})`. The
469
+ forms in low weight are chosen from either bases of all forms up to weight
470
+ ``bound`` or from a (tentative) generating set for the ring of all modular
471
+ forms, according to whether ``modformsring`` is ``False`` or ``True``.
472
+
473
+ INPUT:
474
+
475
+ - ``N`` -- positive integer at least 2 and not divisible by p (level)
476
+ - ``p`` -- prime at least 5
477
+ - ``k0`` -- integer in range 0 to `p - 1`
478
+ - ``n``, ``mdash``, ``elldashp``, ``elldash`` -- positive integers
479
+ - ``modformsring`` -- boolean
480
+ - ``bound`` -- positive (even) integer (ignored if ``modformsring`` is True)
481
+
482
+ OUTPUT:
483
+
484
+ - list of lists of `q`-expansions modulo
485
+ `(p^\text{mdash},q^\text{elldashp})`.
486
+
487
+ EXAMPLES::
488
+
489
+ sage: from sage.modular.overconvergent.hecke_series import complementary_spaces
490
+ sage: complementary_spaces(2, 5, 0, 3, 2, 5, 4, True, 6) # random # needs sage.combinat
491
+ [[1],
492
+ [1 + 23*q + 24*q^2 + 19*q^3 + 7*q^4 + O(q^5)],
493
+ [1 + 21*q + 2*q^2 + 17*q^3 + 14*q^4 + O(q^5)],
494
+ [1 + 19*q + 9*q^2 + 11*q^3 + 9*q^4 + O(q^5)]]
495
+ sage: complementary_spaces(2, 5, 0, 3, 2, 5, 4, False, 6) # random # needs sage.combinat
496
+ [[1],
497
+ [3 + 4*q + 2*q^2 + 12*q^3 + 11*q^4 + O(q^5)],
498
+ [2 + 2*q + 14*q^2 + 19*q^3 + 18*q^4 + O(q^5)],
499
+ [6 + 8*q + 10*q^2 + 23*q^3 + 4*q^4 + O(q^5)]]
500
+ """
501
+ if not modformsring:
502
+ LWB = random_low_weight_bases(N, p, mdash, elldashp, bound)
503
+ else:
504
+ LWB, bound = low_weight_generators(N, p, mdash, elldashp)
505
+
506
+ LWBModp = [ [ f.change_ring(GF(p)).truncate_powerseries(elldash) for f in x] for x in LWB]
507
+
508
+ CompSpacesCode = complementary_spaces_modp(N, p, k0, n, elldash, LWBModp, bound)
509
+
510
+ Ws = []
511
+ Epm1 = eisenstein_series_qexp(p - 1, prec=elldashp, K=Zmod(p**mdash), normalization='constant')
512
+ for i in range(n + 1):
513
+ CompSpacesCodemi = CompSpacesCode[i]
514
+ Wi = []
515
+ for k in range(len(CompSpacesCodemi)):
516
+ CompSpacesCodemik = CompSpacesCodemi[k]
517
+ Wik = Epm1.parent()(1)
518
+ for j in range(len(CompSpacesCodemik)):
519
+ l = CompSpacesCodemik[j][0]
520
+ index = CompSpacesCodemik[j][1]
521
+ Wik = Wik*LWB[l][index]
522
+ Wi.append(Wik)
523
+ Ws.append(Wi)
524
+
525
+ return Ws
526
+
527
+ # AUXILIARY CODE: KATZ EXPANSIONS
528
+
529
+
530
+ def higher_level_katz_exp(p, N, k0, m, mdash, elldash, elldashp, modformsring, bound):
531
+ r"""
532
+ Return a matrix `e` of size ``ell x elldashp`` over the integers modulo
533
+ `p^\text{mdash}`, and the Eisenstein series `E_{p-1} = 1 + .\dots \bmod
534
+ (p^\text{mdash},q^\text{elldashp})`. The matrix `e` contains the coefficients
535
+ of the elements `e_{i,s}` in the Katz expansions basis in Step 3 of
536
+ Algorithm 2 in [Lau2011]_ when one takes as input to that algorithm
537
+ `p, N, m` and `k` and define ``k0``, ``mdash``, ``n``, ``elldash``,
538
+ ``elldashp = ell * dashp`` as in Step 1.
539
+
540
+ INPUT:
541
+
542
+ - ``p`` -- prime at least 5
543
+ - ``N`` -- positive integer at least 2 and not divisible by `p` (level)
544
+ - ``k0`` -- integer in range 0 to `p-1`
545
+ - ``m``, ``mdash, ``elldash``, ``elldashp`` -- positive integers
546
+ - ``modformsring`` -- boolean
547
+ - ``bound`` -- positive (even) integer
548
+
549
+ OUTPUT: matrix and `q`-expansion
550
+
551
+ EXAMPLES::
552
+
553
+ sage: # needs sage.combinat
554
+ sage: from sage.modular.overconvergent.hecke_series import higher_level_katz_exp
555
+ sage: e, Ep1 = higher_level_katz_exp(5, 2, 0, 1, 2, 4, 20, True, 6)
556
+ sage: e
557
+ [ 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
558
+ [ 0 1 18 23 19 6 9 9 17 7 3 17 12 8 22 8 11 19 1 5]
559
+ [ 0 0 1 11 20 16 0 8 4 0 18 15 24 6 15 23 5 18 7 15]
560
+ [ 0 0 0 1 4 16 23 13 6 5 23 5 2 16 4 18 10 23 5 15]
561
+ sage: Ep1
562
+ 1 + 15*q + 10*q^2 + 20*q^3 + 20*q^4 + 15*q^5 + 5*q^6 + 10*q^7 +
563
+ 5*q^9 + 10*q^10 + 5*q^11 + 10*q^12 + 20*q^13 + 15*q^14 + 20*q^15 + 15*q^16 +
564
+ 10*q^17 + 20*q^18 + O(q^20)
565
+ """
566
+ ordr = 1 / (p + 1)
567
+ S = Zmod(p ** mdash)
568
+ Ep1 = eisenstein_series_qexp(p - 1, prec=elldashp, K=S, normalization='constant')
569
+
570
+ n = floor(((p + 1) / (p - 1)) * (m + 1))
571
+ Wjs = complementary_spaces(N, p, k0, n, mdash, elldashp, elldash, modformsring, bound)
572
+
573
+ Basis = []
574
+ for j in range(n + 1):
575
+ Wj = Wjs[j]
576
+ dimj = len(Wj)
577
+ Ep1minusj = Ep1 ** (-j)
578
+ for i in range(dimj):
579
+ wji = Wj[i]
580
+ b = p ** floor(ordr * j) * wji * Ep1minusj
581
+ Basis.append(b)
582
+
583
+ # extract basis as a matrix
584
+
585
+ ell = len(Basis)
586
+ M = matrix(S, ell, elldashp)
587
+ for i in range(ell):
588
+ for j in range(elldashp):
589
+ M[i, j] = Basis[i][j]
590
+
591
+ ech_form(M, p) # put it into echelon form
592
+
593
+ return M, Ep1
594
+
595
+
596
+ def compute_elldash(p, N, k0, n):
597
+ r"""
598
+ Return the "Sturm bound" for the space of modular forms of level
599
+ `\Gamma_0(N)` and weight `k_0 + n(p-1)`.
600
+
601
+ .. SEEALSO::
602
+
603
+ :meth:`~sage.modular.modform.space.ModularFormsSpace.sturm_bound`
604
+
605
+ INPUT:
606
+
607
+ - ``p`` -- prime
608
+ - ``N`` -- positive integer (level)
609
+ - ``k0``, ``n`` -- nonnegative integers not both zero
610
+
611
+ OUTPUT: positive integer
612
+
613
+ EXAMPLES::
614
+
615
+ sage: from sage.modular.overconvergent.hecke_series import compute_elldash
616
+ sage: compute_elldash(11, 5, 4, 10)
617
+ 53
618
+ """
619
+
620
+ return ModularForms(N, k0 + n * (p - 1)).sturm_bound()
621
+
622
+ # *** DEGREE BOUND ON HECKE SERIES ***
623
+
624
+
625
+ def hecke_series_degree_bound(p, N, k, m):
626
+ r"""
627
+ Return the ``Wan bound`` on the degree of the characteristic series of the
628
+ Atkin operator on `p`-adic overconvergent modular forms of level
629
+ `\Gamma_0(N)` and weight `k` when reduced modulo `p^m`.
630
+
631
+ This bound depends only upon `p, k \pmod{p-1}`, and `N`. It uses Lemma 3.1 in
632
+ [Wan1998]_.
633
+
634
+ INPUT:
635
+
636
+ - ``p`` -- prime at least 5
637
+ - ``N`` -- positive integer not divisible by `p`
638
+ - ``k`` -- even integer
639
+ - ``m`` -- positive integer
640
+
641
+ OUTPUT: nonnegative integer
642
+
643
+ EXAMPLES::
644
+
645
+ sage: from sage.modular.overconvergent.hecke_series import hecke_series_degree_bound
646
+ sage: hecke_series_degree_bound(13,11,100,5)
647
+ 39
648
+ """
649
+ k0 = k % (p - 1)
650
+ ds = [dimension_modular_forms(N, k0)]
651
+ ms = [ds[0]]
652
+ sum = 0
653
+ u = 1
654
+
655
+ ord = 0
656
+ while ord < m:
657
+ ds.append(dimension_modular_forms(N, k0 + u * (p - 1)))
658
+ ms.append(ds[u] - ds[u - 1])
659
+ sum = sum + u * ms[u]
660
+ ord = floor(((p - 1) / (p + 1)) * sum - ds[u])
661
+ u = u + 1
662
+
663
+ return (ds[u - 1] - 1)
664
+
665
+ # *** MAIN FUNCTION FOR LEVEL > 1 ***
666
+
667
+ # Returns matrix A modulo p^m from Step 6 of Algorithm 2.
668
+
669
+
670
+ def higher_level_UpGj(p, N, klist, m, modformsring, bound, extra_data=False):
671
+ r"""
672
+ Return a list ``[A_k]`` of square matrices over ``IntegerRing(p^m)``
673
+ parameterised by the weights `k` in ``klist``.
674
+
675
+ The matrix `A_k` is the finite square matrix which occurs on input
676
+ `p, k, N` and `m` in Step 6 of Algorithm 2 in [Lau2011]_.
677
+
678
+ Notational change from paper: In Step 1 following Wan we defined
679
+ `j` by `k = k_0 + j(p-1)` with `0 \le k_0 < p-1`. Here we replace `j` by
680
+ ``kdiv`` so that we may use `j` as a column index for matrices.)
681
+
682
+ INPUT:
683
+
684
+ - ``p`` -- prime at least 5
685
+ - ``N`` -- integer at least 2 and not divisible by `p` (level)
686
+ - ``klist`` -- list of integers all congruent modulo `(p-1)` (the weights)
687
+ - ``m`` -- positive integer
688
+ - ``modformsring`` -- boolean
689
+ - ``bound`` -- (even) positive integer
690
+ - ``extra_data`` -- boolean (default: ``False``)
691
+
692
+ OUTPUT:
693
+
694
+ - list of square matrices. If ``extra_data`` is ``True``, return also
695
+ extra intermediate data, namely the matrix `E` in [Lau2011]_ and
696
+ the integers ``elldash`` and ``mdash``.
697
+
698
+ EXAMPLES::
699
+
700
+ sage: # needs sage.combinat
701
+ sage: from sage.modular.overconvergent.hecke_series import higher_level_UpGj
702
+ sage: A = Matrix([
703
+ ....: [1, 0, 0, 0, 0, 0],
704
+ ....: [0, 1, 0, 0, 0, 0],
705
+ ....: [0, 7, 0, 0, 0, 0],
706
+ ....: [0, 5, 10, 20, 0, 0],
707
+ ....: [0, 7, 20, 0, 20, 0],
708
+ ....: [0, 1, 24, 0, 20, 0]])
709
+ sage: B = Matrix([
710
+ ....: [1, 0, 0, 0, 0, 0],
711
+ ....: [0, 1, 0, 0, 0, 0],
712
+ ....: [0, 7, 0, 0, 0, 0],
713
+ ....: [0, 19, 0, 20, 0, 0],
714
+ ....: [0, 7, 20, 0, 20, 0],
715
+ ....: [0, 1, 24, 0, 20, 0]])
716
+ sage: C = higher_level_UpGj(5, 3, [4], 2, True, 6)
717
+ sage: len(C)
718
+ 1
719
+ sage: C[0] in (A, B)
720
+ True
721
+ sage: len(higher_level_UpGj(5, 3, [4], 2, True, 6, extra_data=True))
722
+ 4
723
+ """
724
+ t = cputime()
725
+ # Step 1
726
+
727
+ k0 = klist[0] % (p - 1)
728
+ n = floor(((p + 1) / (p - 1)) * (m + 1))
729
+ elldash = compute_elldash(p, N, k0, n)
730
+ elldashp = elldash * p
731
+ mdash = m + ceil(n / (p + 1))
732
+
733
+ verbose("done step 1", t)
734
+ t = cputime()
735
+ # Steps 2 and 3
736
+
737
+ e, Ep1 = higher_level_katz_exp(p, N, k0, m, mdash, elldash, elldashp,
738
+ modformsring, bound)
739
+ ell = dimension(transpose(e)[0].parent())
740
+ S = e[0, 0].parent()
741
+
742
+ verbose("done steps 2+3", t)
743
+ t = cputime()
744
+ # Step 4
745
+
746
+ R = Ep1.parent()
747
+ G = compute_G(p, Ep1)
748
+ Alist = []
749
+
750
+ verbose("done step 4a", t)
751
+ t = cputime()
752
+ for k in klist:
753
+ k = ZZ(k) # convert to sage integer
754
+ kdiv = k // (p - 1)
755
+ Gkdiv = G ** kdiv
756
+
757
+ T = matrix(S, ell, elldash)
758
+ for i in range(ell):
759
+ ei = R(e[i].list())
760
+ Gkdivei = Gkdiv * ei # act by G^kdiv
761
+ for j in range(elldash):
762
+ T[i, j] = Gkdivei[p * j]
763
+
764
+ verbose("done steps 4b and 5", t)
765
+ t = cputime()
766
+
767
+ # Step 6: solve T = AE using fact E is upper triangular.
768
+ # Warning: assumes that T = AE (rather than pT = AE) has
769
+ # a solution over Z/(p^mdash). This has always been the case in
770
+ # examples computed by the author, see Note 3.1.
771
+
772
+ A = matrix(S, ell, ell)
773
+ verbose("solving a square matrix problem of dimension %s" % ell)
774
+ verbose("elldash is %s" % elldash)
775
+
776
+ for i in range(ell):
777
+ Ti = T[i]
778
+ for j in range(ell):
779
+ ej = Ti.parent()([e[j][l] for l in range(elldash)])
780
+ ejleadpos = ej.nonzero_positions()[0]
781
+ lj = ZZ(ej[ejleadpos])
782
+ A[i, j] = S(ZZ(Ti[j]) / lj)
783
+ Ti = Ti - A[i, j] * ej
784
+
785
+ Alist.append(MatrixSpace(Zmod(p ** m), ell, ell)(A))
786
+ verbose("done step 6", t)
787
+
788
+ if extra_data:
789
+ return Alist, e, elldash, mdash
790
+ else:
791
+ return Alist
792
+
793
+
794
+ # *** LEVEL 1 CODE ***
795
+
796
+ def compute_Wi(k, p, h, hj, E4, E6):
797
+ r"""
798
+ This function computes a list `W_i` of `q`-expansions, together with an
799
+ auxiliary quantity `h^j` (see below) which is to be used on the next
800
+ call of this function. (The precision is that of input `q`-expansions.)
801
+
802
+ The list `W_i` is a certain subset of a basis of the modular forms of
803
+ weight `k` and level 1. Suppose `(a, b)` is the pair of nonnegative
804
+ integers with `4a + 6b = k` and `a` minimal among such pairs. Then this
805
+ space has a basis given by
806
+
807
+ .. MATH::
808
+
809
+ \{ \Delta^j E_6^{b - 2j} E_4^a : 0 \le j < d\}
810
+
811
+ where `d` is the dimension.
812
+
813
+ What this function returns is the subset of the above basis corresponding
814
+ to `e \le j < d` where `e` is the dimension of the space of modular forms
815
+ of weight `k - (p-1)`. This set is a basis for the complement of the image
816
+ of the weight `k - (p-1)` forms under multiplication by `E_{p-1}`.
817
+
818
+ This function is used repeatedly in the construction of the Katz expansion
819
+ basis. Hence considerable care is taken to reuse steps in the computation
820
+ wherever possible: we keep track of powers of the form `h = \Delta /
821
+ E_6^2`.
822
+
823
+ INPUT:
824
+
825
+ - ``k`` -- nonnegative integer
826
+ - ``p`` -- prime at least 5
827
+ - ``h`` -- `q`-expansion of `h` (to some finite precision)
828
+ - ``hj`` -- `q`-expansion of `h^j` where `j` is the dimension of the space of
829
+ modular forms of level 1 and weight `k - (p-1)` (to same finite
830
+ precision)
831
+ - ``E4`` -- `q`-expansion of `E_4` (to same finite precision)
832
+ - ``E6`` -- `q`-expansion of `E_6` (to same finite precision)
833
+
834
+ The Eisenstein series `q`-expansions should be normalized to have constant
835
+ term 1.
836
+
837
+ OUTPUT:
838
+
839
+ - list of `q`-expansions (to same finite precision), and `q`-expansion.
840
+
841
+ EXAMPLES::
842
+
843
+ sage: from sage.modular.overconvergent.hecke_series import compute_Wi
844
+ sage: p = 17
845
+ sage: prec = 10
846
+ sage: k = 24
847
+ sage: S = Zmod(17^3)
848
+ sage: E4 = eisenstein_series_qexp(4, prec, K=S, normalization='constant')
849
+ sage: E6 = eisenstein_series_qexp(6, prec, K=S, normalization='constant')
850
+ sage: h = delta_qexp(prec, K=S) / E6^2
851
+ sage: from sage.modular.dims import dimension_modular_forms
852
+ sage: j = dimension_modular_forms(1, k - (p - 1))
853
+ sage: hj = h ** j
854
+ sage: c = compute_Wi(k, p, h, hj, E4, E6); c
855
+ ([q + 3881*q^2 + 4459*q^3 + 4665*q^4 + 2966*q^5 + 1902*q^6 + 1350*q^7 + 3836*q^8 + 1752*q^9 + O(q^10), q^2 + 4865*q^3 + 1080*q^4 + 4612*q^5 + 1343*q^6 + 1689*q^7 + 3876*q^8 + 1381*q^9 + O(q^10)], q^3 + 2952*q^4 + 1278*q^5 + 3225*q^6 + 1286*q^7 + 589*q^8 + 122*q^9 + O(q^10))
856
+ sage: c == ([delta_qexp(10) * E6^2, delta_qexp(10)^2], h**3)
857
+ True
858
+ """
859
+
860
+ # Define a and b
861
+ a = k % 3
862
+ b = (k // 2) % 2
863
+
864
+ # Compute dimensions required for Miller basis
865
+ d = dimension_modular_forms(1, k) - 1
866
+ e = dimension_modular_forms(1, k - (p - 1)) - 1
867
+
868
+ # This next line is a bit of a bottleneck, particularly when m is large but
869
+ # p is small. It would be good to reuse values calculated on the previous
870
+ # call here somehow.
871
+ r = E6 ** (2 * d + b) * E4 ** a
872
+
873
+ prec = E4.prec() # everything gets truncated to this precision
874
+
875
+ # Construct basis for Wi
876
+ Wi = []
877
+ for j in range(e + 1,d + 1):
878
+ # compute aj = delta^j*E6^(2*(d-j) + b)*E4^a
879
+ verbose("k = %s, computing Delta^%s E6^%s E4^%s" % (k, j, 2 * (d - j) + b, a), level=2)
880
+ aj = (hj * r).truncate_powerseries(prec)
881
+ hj = (hj * h).truncate_powerseries(prec)
882
+ Wi.append(aj)
883
+
884
+ return Wi, hj
885
+
886
+
887
+ def katz_expansions(k0, p, ellp, mdash, n):
888
+ r"""
889
+ Return a list `e` of `q`-expansions, and the Eisenstein series `E_{p-1} = 1 +
890
+ \dots`, all modulo `(p^\text{mdash},q^\text{ellp})`. The list `e` contains
891
+ the elements `e_{i,s}` in the Katz expansions basis in Step 3 of Algorithm
892
+ 1 in [Lau2011]_ when one takes as input to that algorithm `p,m` and `k` and define
893
+ ``k0``, ``mdash``, ``n``, ``ellp = ell * p`` as in Step 1.
894
+
895
+ INPUT:
896
+
897
+ - ``k0`` -- integer in range 0 to `p - 1`
898
+ - ``p`` -- prime at least 5
899
+ - ``ellp``, ``mdash``, ``n`` -- positive integers
900
+
901
+ OUTPUT:
902
+
903
+ - list of `q`-expansions and the Eisenstein series `E_{p-1}` modulo
904
+ `(p^\text{mdash},q^\text{ellp})`.
905
+
906
+ EXAMPLES::
907
+
908
+ sage: from sage.modular.overconvergent.hecke_series import katz_expansions
909
+ sage: katz_expansions(0, 5, 10, 3, 4)
910
+ ([1 + O(q^10), q + 6*q^2 + 27*q^3 + 98*q^4 + 65*q^5 + 37*q^6 + 81*q^7 + 85*q^8 + 62*q^9 + O(q^10)],
911
+ 1 + 115*q + 35*q^2 + 95*q^3 + 20*q^4 + 115*q^5 + 105*q^6 + 60*q^7 + 25*q^8 + 55*q^9 + O(q^10))
912
+ """
913
+ S = Zmod(p ** mdash)
914
+
915
+ Ep1 = eisenstein_series_qexp(p - 1, ellp, K=S, normalization='constant')
916
+ E4 = eisenstein_series_qexp(4, ellp, K=S, normalization='constant')
917
+ E6 = eisenstein_series_qexp(6, ellp, K=S, normalization='constant')
918
+
919
+ delta = delta_qexp(ellp, K=S)
920
+ h = delta / E6 ** 2
921
+ hj = delta.parent()(1)
922
+ e = []
923
+
924
+ # We compute negative powers of E_(p-1) successively (this saves a great
925
+ # deal of time). The effect is that Ep1mi = Ep1 ** (-i).
926
+ Ep1m1 = ~Ep1
927
+ Ep1mi = 1
928
+ for i in range(0,n + 1):
929
+ Wi,hj = compute_Wi(k0 + i * (p - 1), p, h, hj, E4, E6)
930
+ for bis in Wi:
931
+ eis = p ** floor(i / (p + 1)) * Ep1mi * bis
932
+ e.append(eis)
933
+ Ep1mi = Ep1mi * Ep1m1
934
+
935
+ return e, Ep1
936
+
937
+ # *** MAIN FUNCTION FOR LEVEL 1 ***
938
+
939
+
940
+ def level1_UpGj(p, klist, m, extra_data=False):
941
+ r"""
942
+ Return a list `[A_k]` of square matrices over ``IntegerRing(p^m)``
943
+ parameterised by the weights `k` in ``klist``.
944
+
945
+ The matrix `A_k` is the finite square matrix which occurs on input
946
+ `p, k` and `m` in Step 6 of Algorithm 1 in [Lau2011]_.
947
+
948
+ Notational change from paper: In Step 1 following Wan we defined
949
+ `j` by `k = k_0 + j(p-1)` with `0 \le k_0 < p-1`. Here we replace `j` by
950
+ ``kdiv`` so that we may use `j` as a column index for matrices.
951
+
952
+ INPUT:
953
+
954
+ - ``p`` -- prime at least 5
955
+ - ``klist`` -- list of integers congruent modulo `(p-1)` (the weights)
956
+ - ``m`` -- positive integer
957
+ - ``extra_data`` -- boolean (default: ``False``)
958
+
959
+ OUTPUT:
960
+
961
+ - list of square matrices. If ``extra_data`` is ``True``, return also
962
+ extra intermediate data, namely the matrix `E` in [Lau2011]_ and
963
+ the integers ``elldash`` and ``mdash``.
964
+
965
+ EXAMPLES::
966
+
967
+ sage: from sage.modular.overconvergent.hecke_series import level1_UpGj
968
+ sage: level1_UpGj(7, [100], 5)
969
+ [
970
+ [ 1 980 4802 0 0]
971
+ [ 0 13727 14406 0 0]
972
+ [ 0 13440 7203 0 0]
973
+ [ 0 1995 4802 0 0]
974
+ [ 0 9212 14406 0 0]
975
+ ]
976
+ sage: len(level1_UpGj(7, [100], 5, extra_data=True))
977
+ 4
978
+ """
979
+ # Step 1
980
+ t = cputime()
981
+
982
+ k0 = klist[0] % (p - 1)
983
+ n = floor(((p + 1) / (p - 1)) * (m + 1))
984
+ ell = dimension_modular_forms(1, k0 + n * (p - 1))
985
+ ellp = ell * p
986
+ mdash = m + ceil(n / (p + 1))
987
+
988
+ verbose("done step 1", t)
989
+ t = cputime()
990
+ # Steps 2 and 3
991
+
992
+ e, Ep1 = katz_expansions(k0, p, ellp, mdash, n)
993
+
994
+ verbose("done steps 2+3", t)
995
+ t = cputime()
996
+ # Step 4
997
+
998
+ G = compute_G(p, Ep1)
999
+ Alist = []
1000
+
1001
+ verbose("done step 4a", t)
1002
+ t = cputime()
1003
+ for k in klist:
1004
+ k = ZZ(k) # convert to sage integer
1005
+ kdiv = k // (p - 1)
1006
+ Gkdiv = G ** kdiv
1007
+ u = []
1008
+ for i in range(0, ell):
1009
+ ei = e[i]
1010
+ ui = Gkdiv * ei
1011
+ u.append(ui)
1012
+
1013
+ verbose("done step 4b", t)
1014
+ t = cputime()
1015
+ # Step 5 and computation of T in Step 6
1016
+
1017
+ S = e[0][0].parent()
1018
+ T = matrix(S, ell, ell)
1019
+
1020
+ for i in range(0, ell):
1021
+ for j in range(0, ell):
1022
+ T[i, j] = u[i][p * j]
1023
+
1024
+ verbose("done step 5", t)
1025
+ t = cputime()
1026
+ # Step 6: solve T = AE using fact E is upper triangular.
1027
+ # Warning: assumes that T = AE (rather than pT = AE) has
1028
+ # a solution over Z/(p^mdash). This has always been the case in
1029
+ # examples computed by the author, see Note 3.1.
1030
+
1031
+ A = matrix(S, ell, ell)
1032
+ verbose("solving a square matrix problem of dimension %s" % ell, t)
1033
+
1034
+ for i in range(0, ell):
1035
+ Ti = T[i]
1036
+ for j in range(0,ell):
1037
+ ej = Ti.parent()([e[j][l] for l in range(0, ell)])
1038
+ lj = ZZ(ej[j])
1039
+ A[i, j] = S(ZZ(Ti[j]) / lj)
1040
+ Ti = Ti - A[i, j] * ej
1041
+
1042
+ Alist.append(MatrixSpace(Zmod(p ** m), ell, ell)(A))
1043
+ verbose("done step 6", t)
1044
+
1045
+ if extra_data:
1046
+ return Alist, e, ell, mdash
1047
+ else:
1048
+ return Alist
1049
+
1050
+ # *** CODE FOR GENERAL LEVEL ***
1051
+
1052
+
1053
+ def is_valid_weight_list(klist, p) -> None:
1054
+ r"""
1055
+ This function checks that ``klist`` is a nonempty list of integers all of
1056
+ which are congruent modulo `(p-1)`. Otherwise, it will raise a
1057
+ :exc:`ValueError`.
1058
+
1059
+ INPUT:
1060
+
1061
+ - ``klist`` -- list of integers
1062
+ - ``p`` -- prime
1063
+
1064
+ EXAMPLES::
1065
+
1066
+ sage: from sage.modular.overconvergent.hecke_series import is_valid_weight_list
1067
+ sage: is_valid_weight_list([10, 20, 30],11)
1068
+ sage: is_valid_weight_list([-3, 1], 5)
1069
+ sage: is_valid_weight_list([], 3)
1070
+ Traceback (most recent call last):
1071
+ ...
1072
+ ValueError: List of weights must be non-empty
1073
+ sage: is_valid_weight_list([-3, 2], 5)
1074
+ Traceback (most recent call last):
1075
+ ...
1076
+ ValueError: List of weights must be all congruent modulo p-1 = 4, but given list contains -3 and 2 which are not congruent
1077
+ """
1078
+ if len(klist) == 0:
1079
+ raise ValueError("List of weights must be non-empty")
1080
+ k0 = klist[0] % (p - 1)
1081
+ for i in range(1, len(klist)):
1082
+ if (klist[i] % (p-1)) != k0:
1083
+ raise ValueError("List of weights must be all congruent modulo p-1 = %s, but given list contains %s and %s which are not congruent" % (p - 1, klist[0], klist[i]))
1084
+
1085
+
1086
+ def hecke_series(p, N, klist, m, modformsring=False, weightbound=6):
1087
+ r"""
1088
+ Return the characteristic series modulo `p^m` of the Atkin operator `U_p`
1089
+ acting upon the space of `p`-adic overconvergent modular forms of level
1090
+ `\Gamma_0(N)` and weight ``klist``.
1091
+
1092
+ The input ``klist`` may also be a list of weights congruent modulo `(p-1)`,
1093
+ in which case the output is the corresponding list of characteristic series
1094
+ for each `k` in ``klist``; this is faster than performing the computation
1095
+ separately for each `k`, since intermediate steps in the computation may be
1096
+ reused.
1097
+
1098
+ If ``modformsring`` is ``True``, then for `N > 1` the algorithm computes at one
1099
+ step ``ModularFormsRing(N).generators()``. This will often be faster but
1100
+ the algorithm will default to ``modformsring=False`` if the generators
1101
+ found are not `p`-adically integral. Note that ``modformsring`` is ignored
1102
+ for `N = 1` and the ring structure of modular forms is *always* used in
1103
+ this case.
1104
+
1105
+ When ``modformsring`` is ``False`` and `N > 1`, ``weightbound`` is a bound set on
1106
+ the weight of generators for a certain subspace of modular forms. The
1107
+ algorithm will often be faster if ``weightbound=4``, but it may fail to
1108
+ terminate for certain exceptional small values of `N`, when this bound is
1109
+ too small.
1110
+
1111
+ The algorithm is based upon that described in [Lau2011]_.
1112
+
1113
+ INPUT:
1114
+
1115
+ - ``p`` -- a prime greater than or equal to 5
1116
+ - ``N`` -- positive integer not divisible by `p`
1117
+ - ``klist`` -- either a list of integers congruent modulo `(p-1)`, or a single integer
1118
+ - ``m`` -- positive integer
1119
+ - ``modformsring`` -- boolean (default: ``False``); ignored if `N = 1`
1120
+ - ``weightbound`` -- a positive even integer (default: 6). Ignored
1121
+ if `N = 1` or ``modformsring`` is ``True``
1122
+
1123
+ OUTPUT: either a list of polynomials or a single polynomial over the integers modulo `p^m`
1124
+
1125
+ EXAMPLES::
1126
+
1127
+ sage: hecke_series(5, 7, 10000, 5, modformsring=True) # long time (3.4s)
1128
+ 250*x^6 + 1825*x^5 + 2500*x^4 + 2184*x^3 + 1458*x^2 + 1157*x + 1
1129
+ sage: hecke_series(7, 3, 10000, 3, weightbound=4)
1130
+ 196*x^4 + 294*x^3 + 197*x^2 + 341*x + 1
1131
+ sage: hecke_series(19, 1, [10000, 10018], 5)
1132
+ [1694173*x^4 + 2442526*x^3 + 1367943*x^2 + 1923654*x + 1,
1133
+ 130321*x^4 + 958816*x^3 + 2278233*x^2 + 1584827*x + 1]
1134
+
1135
+ Check that silly weights are handled correctly::
1136
+
1137
+ sage: hecke_series(5, 7, [2, 3], 5)
1138
+ Traceback (most recent call last):
1139
+ ...
1140
+ ValueError: List of weights must be all congruent modulo p-1 = 4, but given list contains 2 and 3 which are not congruent
1141
+ sage: hecke_series(5, 7, [3], 5)
1142
+ [1]
1143
+ sage: hecke_series(5, 7, 3, 5)
1144
+ 1
1145
+ """
1146
+ # convert to sage integers
1147
+ p = ZZ(p)
1148
+ N = ZZ(N)
1149
+ m = ZZ(m)
1150
+ weightbound = ZZ(weightbound)
1151
+
1152
+ oneweight = False
1153
+ # convert single weight to list
1154
+ if isinstance(klist, (int, Integer)):
1155
+ klist = [klist]
1156
+ oneweight = True # input is single weight
1157
+
1158
+ # algorithm may finish with false output unless:
1159
+ is_valid_weight_list(klist, p)
1160
+ if not p.is_prime():
1161
+ raise ValueError("p (=%s) is not prime" % p)
1162
+ if p < 5:
1163
+ raise ValueError("p = 2 and p = 3 not supported")
1164
+ if not N % p:
1165
+ raise ValueError("Level (=%s) should be prime to p (=%s)" % (N, p))
1166
+
1167
+ # return all 1 list for odd weights
1168
+ if klist[0] % 2 == 1:
1169
+ if oneweight:
1170
+ return 1
1171
+ else:
1172
+ return [1 for i in range(len(klist))]
1173
+
1174
+ if N == 1:
1175
+ Alist = level1_UpGj(p, klist, m)
1176
+ else:
1177
+ Alist = higher_level_UpGj(p, N, klist, m, modformsring, weightbound)
1178
+
1179
+ Plist = []
1180
+ for A in Alist:
1181
+ P = charpoly(A).reverse()
1182
+ Plist.append(P)
1183
+
1184
+ if oneweight:
1185
+ return Plist[0]
1186
+ else:
1187
+ return Plist