passagemath-schemes 10.8.1a4__cp314-cp314t-macosx_13_0_arm64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (312) hide show
  1. passagemath_schemes/.dylibs/libflint.22.0.dylib +0 -0
  2. passagemath_schemes/.dylibs/libgmp.10.dylib +0 -0
  3. passagemath_schemes/.dylibs/libgmpxx.4.dylib +0 -0
  4. passagemath_schemes/.dylibs/libmpfr.6.dylib +0 -0
  5. passagemath_schemes/__init__.py +3 -0
  6. passagemath_schemes-10.8.1a4.dist-info/METADATA +203 -0
  7. passagemath_schemes-10.8.1a4.dist-info/METADATA.bak +204 -0
  8. passagemath_schemes-10.8.1a4.dist-info/RECORD +312 -0
  9. passagemath_schemes-10.8.1a4.dist-info/WHEEL +6 -0
  10. passagemath_schemes-10.8.1a4.dist-info/top_level.txt +3 -0
  11. sage/all__sagemath_schemes.py +23 -0
  12. sage/databases/all__sagemath_schemes.py +7 -0
  13. sage/databases/cremona.py +1723 -0
  14. sage/dynamics/all__sagemath_schemes.py +2 -0
  15. sage/dynamics/arithmetic_dynamics/affine_ds.py +1083 -0
  16. sage/dynamics/arithmetic_dynamics/all.py +14 -0
  17. sage/dynamics/arithmetic_dynamics/berkovich_ds.py +1101 -0
  18. sage/dynamics/arithmetic_dynamics/dynamical_semigroup.py +1543 -0
  19. sage/dynamics/arithmetic_dynamics/endPN_automorphism_group.py +2426 -0
  20. sage/dynamics/arithmetic_dynamics/endPN_minimal_model.py +1169 -0
  21. sage/dynamics/arithmetic_dynamics/generic_ds.py +663 -0
  22. sage/dynamics/arithmetic_dynamics/product_projective_ds.py +339 -0
  23. sage/dynamics/arithmetic_dynamics/projective_ds.py +9556 -0
  24. sage/dynamics/arithmetic_dynamics/projective_ds_helper.cpython-314t-darwin.so +0 -0
  25. sage/dynamics/arithmetic_dynamics/projective_ds_helper.pyx +301 -0
  26. sage/dynamics/arithmetic_dynamics/wehlerK3.py +2578 -0
  27. sage/lfunctions/all.py +18 -0
  28. sage/lfunctions/dokchitser.py +727 -0
  29. sage/lfunctions/pari.py +971 -0
  30. sage/lfunctions/zero_sums.cpython-314t-darwin.so +0 -0
  31. sage/lfunctions/zero_sums.pyx +1847 -0
  32. sage/modular/abvar/abvar.py +5132 -0
  33. sage/modular/abvar/abvar_ambient_jacobian.py +414 -0
  34. sage/modular/abvar/abvar_newform.py +246 -0
  35. sage/modular/abvar/all.py +8 -0
  36. sage/modular/abvar/constructor.py +187 -0
  37. sage/modular/abvar/cuspidal_subgroup.py +371 -0
  38. sage/modular/abvar/finite_subgroup.py +896 -0
  39. sage/modular/abvar/homology.py +721 -0
  40. sage/modular/abvar/homspace.py +989 -0
  41. sage/modular/abvar/lseries.py +415 -0
  42. sage/modular/abvar/morphism.py +935 -0
  43. sage/modular/abvar/torsion_point.py +274 -0
  44. sage/modular/abvar/torsion_subgroup.py +741 -0
  45. sage/modular/all.py +43 -0
  46. sage/modular/arithgroup/all.py +20 -0
  47. sage/modular/arithgroup/arithgroup_element.cpython-314t-darwin.so +0 -0
  48. sage/modular/arithgroup/arithgroup_element.pyx +474 -0
  49. sage/modular/arithgroup/arithgroup_generic.py +1406 -0
  50. sage/modular/arithgroup/arithgroup_perm.py +2692 -0
  51. sage/modular/arithgroup/congroup.cpython-314t-darwin.so +0 -0
  52. sage/modular/arithgroup/congroup.pyx +334 -0
  53. sage/modular/arithgroup/congroup_gamma.py +361 -0
  54. sage/modular/arithgroup/congroup_gamma0.py +692 -0
  55. sage/modular/arithgroup/congroup_gamma1.py +659 -0
  56. sage/modular/arithgroup/congroup_gammaH.py +1491 -0
  57. sage/modular/arithgroup/congroup_generic.py +630 -0
  58. sage/modular/arithgroup/congroup_sl2z.py +266 -0
  59. sage/modular/arithgroup/farey_symbol.cpython-314t-darwin.so +0 -0
  60. sage/modular/arithgroup/farey_symbol.pyx +1067 -0
  61. sage/modular/arithgroup/tests.py +425 -0
  62. sage/modular/btquotients/all.py +4 -0
  63. sage/modular/btquotients/btquotient.py +3736 -0
  64. sage/modular/btquotients/pautomorphicform.py +2564 -0
  65. sage/modular/buzzard.py +100 -0
  66. sage/modular/congroup.py +29 -0
  67. sage/modular/congroup_element.py +13 -0
  68. sage/modular/cusps.py +1107 -0
  69. sage/modular/cusps_nf.py +1270 -0
  70. sage/modular/dims.py +571 -0
  71. sage/modular/dirichlet.py +3310 -0
  72. sage/modular/drinfeld_modform/all.py +2 -0
  73. sage/modular/drinfeld_modform/element.py +446 -0
  74. sage/modular/drinfeld_modform/ring.py +773 -0
  75. sage/modular/drinfeld_modform/tutorial.py +236 -0
  76. sage/modular/etaproducts.py +1076 -0
  77. sage/modular/hecke/algebra.py +725 -0
  78. sage/modular/hecke/all.py +19 -0
  79. sage/modular/hecke/ambient_module.py +994 -0
  80. sage/modular/hecke/degenmap.py +119 -0
  81. sage/modular/hecke/element.py +302 -0
  82. sage/modular/hecke/hecke_operator.py +736 -0
  83. sage/modular/hecke/homspace.py +185 -0
  84. sage/modular/hecke/module.py +1744 -0
  85. sage/modular/hecke/morphism.py +139 -0
  86. sage/modular/hecke/submodule.py +970 -0
  87. sage/modular/hypergeometric_misc.cpython-314t-darwin.so +0 -0
  88. sage/modular/hypergeometric_misc.pxd +4 -0
  89. sage/modular/hypergeometric_misc.pyx +166 -0
  90. sage/modular/hypergeometric_motive.py +2020 -0
  91. sage/modular/local_comp/all.py +2 -0
  92. sage/modular/local_comp/liftings.py +292 -0
  93. sage/modular/local_comp/local_comp.py +1070 -0
  94. sage/modular/local_comp/smoothchar.py +1825 -0
  95. sage/modular/local_comp/type_space.py +748 -0
  96. sage/modular/modform/all.py +30 -0
  97. sage/modular/modform/ambient.py +817 -0
  98. sage/modular/modform/ambient_R.py +177 -0
  99. sage/modular/modform/ambient_eps.py +306 -0
  100. sage/modular/modform/ambient_g0.py +120 -0
  101. sage/modular/modform/ambient_g1.py +199 -0
  102. sage/modular/modform/constructor.py +545 -0
  103. sage/modular/modform/cuspidal_submodule.py +708 -0
  104. sage/modular/modform/defaults.py +14 -0
  105. sage/modular/modform/eis_series.py +487 -0
  106. sage/modular/modform/eisenstein_submodule.py +663 -0
  107. sage/modular/modform/element.py +4105 -0
  108. sage/modular/modform/half_integral.py +154 -0
  109. sage/modular/modform/hecke_operator_on_qexp.py +247 -0
  110. sage/modular/modform/j_invariant.py +47 -0
  111. sage/modular/modform/l_series_gross_zagier.py +127 -0
  112. sage/modular/modform/l_series_gross_zagier_coeffs.cpython-314t-darwin.so +0 -0
  113. sage/modular/modform/l_series_gross_zagier_coeffs.pyx +177 -0
  114. sage/modular/modform/notes.py +45 -0
  115. sage/modular/modform/numerical.py +514 -0
  116. sage/modular/modform/periods.py +14 -0
  117. sage/modular/modform/ring.py +1257 -0
  118. sage/modular/modform/space.py +1859 -0
  119. sage/modular/modform/submodule.py +118 -0
  120. sage/modular/modform/tests.py +64 -0
  121. sage/modular/modform/theta.py +110 -0
  122. sage/modular/modform/vm_basis.py +380 -0
  123. sage/modular/modform/weight1.py +221 -0
  124. sage/modular/modform_hecketriangle/abstract_ring.py +1932 -0
  125. sage/modular/modform_hecketriangle/abstract_space.py +2527 -0
  126. sage/modular/modform_hecketriangle/all.py +30 -0
  127. sage/modular/modform_hecketriangle/analytic_type.py +590 -0
  128. sage/modular/modform_hecketriangle/constructor.py +416 -0
  129. sage/modular/modform_hecketriangle/element.py +351 -0
  130. sage/modular/modform_hecketriangle/functors.py +752 -0
  131. sage/modular/modform_hecketriangle/graded_ring.py +541 -0
  132. sage/modular/modform_hecketriangle/graded_ring_element.py +2225 -0
  133. sage/modular/modform_hecketriangle/hecke_triangle_group_element.py +3349 -0
  134. sage/modular/modform_hecketriangle/hecke_triangle_groups.py +1426 -0
  135. sage/modular/modform_hecketriangle/readme.py +1214 -0
  136. sage/modular/modform_hecketriangle/series_constructor.py +580 -0
  137. sage/modular/modform_hecketriangle/space.py +1037 -0
  138. sage/modular/modform_hecketriangle/subspace.py +423 -0
  139. sage/modular/modsym/all.py +17 -0
  140. sage/modular/modsym/ambient.py +3844 -0
  141. sage/modular/modsym/boundary.py +1420 -0
  142. sage/modular/modsym/element.py +336 -0
  143. sage/modular/modsym/g1list.py +178 -0
  144. sage/modular/modsym/ghlist.py +182 -0
  145. sage/modular/modsym/hecke_operator.py +73 -0
  146. sage/modular/modsym/manin_symbol.cpython-314t-darwin.so +0 -0
  147. sage/modular/modsym/manin_symbol.pxd +5 -0
  148. sage/modular/modsym/manin_symbol.pyx +497 -0
  149. sage/modular/modsym/manin_symbol_list.py +1291 -0
  150. sage/modular/modsym/modsym.py +400 -0
  151. sage/modular/modsym/modular_symbols.py +384 -0
  152. sage/modular/modsym/p1list_nf.py +1241 -0
  153. sage/modular/modsym/relation_matrix.py +591 -0
  154. sage/modular/modsym/relation_matrix_pyx.cpython-314t-darwin.so +0 -0
  155. sage/modular/modsym/relation_matrix_pyx.pyx +108 -0
  156. sage/modular/modsym/space.py +2468 -0
  157. sage/modular/modsym/subspace.py +455 -0
  158. sage/modular/modsym/tests.py +376 -0
  159. sage/modular/multiple_zeta.py +2635 -0
  160. sage/modular/multiple_zeta_F_algebra.py +789 -0
  161. sage/modular/overconvergent/all.py +6 -0
  162. sage/modular/overconvergent/genus0.py +1879 -0
  163. sage/modular/overconvergent/hecke_series.py +1187 -0
  164. sage/modular/overconvergent/weightspace.py +776 -0
  165. sage/modular/pollack_stevens/all.py +4 -0
  166. sage/modular/pollack_stevens/distributions.py +874 -0
  167. sage/modular/pollack_stevens/fund_domain.py +1572 -0
  168. sage/modular/pollack_stevens/manin_map.py +856 -0
  169. sage/modular/pollack_stevens/modsym.py +1590 -0
  170. sage/modular/pollack_stevens/padic_lseries.py +417 -0
  171. sage/modular/pollack_stevens/sigma0.py +534 -0
  172. sage/modular/pollack_stevens/space.py +1078 -0
  173. sage/modular/quasimodform/all.py +3 -0
  174. sage/modular/quasimodform/element.py +846 -0
  175. sage/modular/quasimodform/ring.py +826 -0
  176. sage/modular/quatalg/all.py +3 -0
  177. sage/modular/quatalg/brandt.py +1642 -0
  178. sage/modular/ssmod/all.py +8 -0
  179. sage/modular/ssmod/ssmod.py +827 -0
  180. sage/rings/all__sagemath_schemes.py +1 -0
  181. sage/rings/polynomial/all__sagemath_schemes.py +1 -0
  182. sage/rings/polynomial/binary_form_reduce.py +585 -0
  183. sage/schemes/all.py +41 -0
  184. sage/schemes/berkovich/all.py +6 -0
  185. sage/schemes/berkovich/berkovich_cp_element.py +2582 -0
  186. sage/schemes/berkovich/berkovich_space.py +700 -0
  187. sage/schemes/curves/affine_curve.py +2924 -0
  188. sage/schemes/curves/all.py +33 -0
  189. sage/schemes/curves/closed_point.py +434 -0
  190. sage/schemes/curves/constructor.py +397 -0
  191. sage/schemes/curves/curve.py +542 -0
  192. sage/schemes/curves/plane_curve_arrangement.py +1283 -0
  193. sage/schemes/curves/point.py +463 -0
  194. sage/schemes/curves/projective_curve.py +3203 -0
  195. sage/schemes/curves/weighted_projective_curve.py +106 -0
  196. sage/schemes/curves/zariski_vankampen.py +1931 -0
  197. sage/schemes/cyclic_covers/all.py +2 -0
  198. sage/schemes/cyclic_covers/charpoly_frobenius.py +320 -0
  199. sage/schemes/cyclic_covers/constructor.py +137 -0
  200. sage/schemes/cyclic_covers/cycliccover_finite_field.py +1309 -0
  201. sage/schemes/cyclic_covers/cycliccover_generic.py +310 -0
  202. sage/schemes/elliptic_curves/BSD.py +991 -0
  203. sage/schemes/elliptic_curves/Qcurves.py +592 -0
  204. sage/schemes/elliptic_curves/addition_formulas_ring.py +94 -0
  205. sage/schemes/elliptic_curves/all.py +49 -0
  206. sage/schemes/elliptic_curves/cardinality.py +609 -0
  207. sage/schemes/elliptic_curves/cm.py +1103 -0
  208. sage/schemes/elliptic_curves/constructor.py +1530 -0
  209. sage/schemes/elliptic_curves/ec_database.py +175 -0
  210. sage/schemes/elliptic_curves/ell_curve_isogeny.py +3971 -0
  211. sage/schemes/elliptic_curves/ell_egros.py +457 -0
  212. sage/schemes/elliptic_curves/ell_field.py +2837 -0
  213. sage/schemes/elliptic_curves/ell_finite_field.py +3249 -0
  214. sage/schemes/elliptic_curves/ell_generic.py +3760 -0
  215. sage/schemes/elliptic_curves/ell_local_data.py +1207 -0
  216. sage/schemes/elliptic_curves/ell_modular_symbols.py +775 -0
  217. sage/schemes/elliptic_curves/ell_number_field.py +4220 -0
  218. sage/schemes/elliptic_curves/ell_padic_field.py +107 -0
  219. sage/schemes/elliptic_curves/ell_point.py +4944 -0
  220. sage/schemes/elliptic_curves/ell_rational_field.py +7184 -0
  221. sage/schemes/elliptic_curves/ell_tate_curve.py +671 -0
  222. sage/schemes/elliptic_curves/ell_torsion.py +436 -0
  223. sage/schemes/elliptic_curves/ell_wp.py +352 -0
  224. sage/schemes/elliptic_curves/formal_group.py +760 -0
  225. sage/schemes/elliptic_curves/gal_reps.py +1459 -0
  226. sage/schemes/elliptic_curves/gal_reps_number_field.py +1663 -0
  227. sage/schemes/elliptic_curves/gp_simon.py +152 -0
  228. sage/schemes/elliptic_curves/heegner.py +7328 -0
  229. sage/schemes/elliptic_curves/height.py +2108 -0
  230. sage/schemes/elliptic_curves/hom.py +1788 -0
  231. sage/schemes/elliptic_curves/hom_composite.py +1084 -0
  232. sage/schemes/elliptic_curves/hom_fractional.py +544 -0
  233. sage/schemes/elliptic_curves/hom_frobenius.py +522 -0
  234. sage/schemes/elliptic_curves/hom_scalar.py +531 -0
  235. sage/schemes/elliptic_curves/hom_sum.py +681 -0
  236. sage/schemes/elliptic_curves/hom_velusqrt.py +1290 -0
  237. sage/schemes/elliptic_curves/homset.py +271 -0
  238. sage/schemes/elliptic_curves/isogeny_class.py +1523 -0
  239. sage/schemes/elliptic_curves/isogeny_small_degree.py +2797 -0
  240. sage/schemes/elliptic_curves/jacobian.py +247 -0
  241. sage/schemes/elliptic_curves/kodaira_symbol.py +344 -0
  242. sage/schemes/elliptic_curves/kraus.py +1014 -0
  243. sage/schemes/elliptic_curves/lseries_ell.py +915 -0
  244. sage/schemes/elliptic_curves/mod5family.py +105 -0
  245. sage/schemes/elliptic_curves/mod_poly.py +197 -0
  246. sage/schemes/elliptic_curves/mod_sym_num.cpython-314t-darwin.so +0 -0
  247. sage/schemes/elliptic_curves/mod_sym_num.pyx +3796 -0
  248. sage/schemes/elliptic_curves/modular_parametrization.py +305 -0
  249. sage/schemes/elliptic_curves/padic_lseries.py +1793 -0
  250. sage/schemes/elliptic_curves/padics.py +1816 -0
  251. sage/schemes/elliptic_curves/period_lattice.py +2234 -0
  252. sage/schemes/elliptic_curves/period_lattice_region.cpython-314t-darwin.so +0 -0
  253. sage/schemes/elliptic_curves/period_lattice_region.pyx +722 -0
  254. sage/schemes/elliptic_curves/saturation.py +716 -0
  255. sage/schemes/elliptic_curves/sha_tate.py +1158 -0
  256. sage/schemes/elliptic_curves/weierstrass_morphism.py +1117 -0
  257. sage/schemes/elliptic_curves/weierstrass_transform.py +200 -0
  258. sage/schemes/hyperelliptic_curves/all.py +6 -0
  259. sage/schemes/hyperelliptic_curves/constructor.py +369 -0
  260. sage/schemes/hyperelliptic_curves/hyperelliptic_finite_field.py +1948 -0
  261. sage/schemes/hyperelliptic_curves/hyperelliptic_g2.py +192 -0
  262. sage/schemes/hyperelliptic_curves/hyperelliptic_generic.py +936 -0
  263. sage/schemes/hyperelliptic_curves/hyperelliptic_padic_field.py +1332 -0
  264. sage/schemes/hyperelliptic_curves/hyperelliptic_rational_field.py +84 -0
  265. sage/schemes/hyperelliptic_curves/invariants.py +410 -0
  266. sage/schemes/hyperelliptic_curves/jacobian_endomorphism_utils.py +312 -0
  267. sage/schemes/hyperelliptic_curves/jacobian_g2.py +32 -0
  268. sage/schemes/hyperelliptic_curves/jacobian_generic.py +437 -0
  269. sage/schemes/hyperelliptic_curves/jacobian_homset.py +186 -0
  270. sage/schemes/hyperelliptic_curves/jacobian_morphism.py +878 -0
  271. sage/schemes/hyperelliptic_curves/kummer_surface.py +99 -0
  272. sage/schemes/hyperelliptic_curves/mestre.py +302 -0
  273. sage/schemes/hyperelliptic_curves/monsky_washnitzer.py +3863 -0
  274. sage/schemes/jacobians/abstract_jacobian.py +277 -0
  275. sage/schemes/jacobians/all.py +2 -0
  276. sage/schemes/overview.py +161 -0
  277. sage/schemes/plane_conics/all.py +22 -0
  278. sage/schemes/plane_conics/con_field.py +1296 -0
  279. sage/schemes/plane_conics/con_finite_field.py +158 -0
  280. sage/schemes/plane_conics/con_number_field.py +456 -0
  281. sage/schemes/plane_conics/con_rational_field.py +406 -0
  282. sage/schemes/plane_conics/con_rational_function_field.py +581 -0
  283. sage/schemes/plane_conics/constructor.py +249 -0
  284. sage/schemes/plane_quartics/all.py +2 -0
  285. sage/schemes/plane_quartics/quartic_constructor.py +71 -0
  286. sage/schemes/plane_quartics/quartic_generic.py +53 -0
  287. sage/schemes/riemann_surfaces/all.py +1 -0
  288. sage/schemes/riemann_surfaces/riemann_surface.py +4177 -0
  289. sage_wheels/share/cremona/cremona_mini.db +0 -0
  290. sage_wheels/share/ellcurves/rank0 +30427 -0
  291. sage_wheels/share/ellcurves/rank1 +31871 -0
  292. sage_wheels/share/ellcurves/rank10 +6 -0
  293. sage_wheels/share/ellcurves/rank11 +6 -0
  294. sage_wheels/share/ellcurves/rank12 +1 -0
  295. sage_wheels/share/ellcurves/rank14 +1 -0
  296. sage_wheels/share/ellcurves/rank15 +1 -0
  297. sage_wheels/share/ellcurves/rank17 +1 -0
  298. sage_wheels/share/ellcurves/rank19 +1 -0
  299. sage_wheels/share/ellcurves/rank2 +2388 -0
  300. sage_wheels/share/ellcurves/rank20 +1 -0
  301. sage_wheels/share/ellcurves/rank21 +1 -0
  302. sage_wheels/share/ellcurves/rank22 +1 -0
  303. sage_wheels/share/ellcurves/rank23 +1 -0
  304. sage_wheels/share/ellcurves/rank24 +1 -0
  305. sage_wheels/share/ellcurves/rank28 +1 -0
  306. sage_wheels/share/ellcurves/rank3 +836 -0
  307. sage_wheels/share/ellcurves/rank4 +10 -0
  308. sage_wheels/share/ellcurves/rank5 +5 -0
  309. sage_wheels/share/ellcurves/rank6 +5 -0
  310. sage_wheels/share/ellcurves/rank7 +5 -0
  311. sage_wheels/share/ellcurves/rank8 +6 -0
  312. sage_wheels/share/ellcurves/rank9 +7 -0
@@ -0,0 +1,1879 @@
1
+ # sage_setup: distribution = sagemath-schemes
2
+ # sage.doctest: needs sage.libs.pari sage.rings.padics
3
+ r"""
4
+ Overconvergent `p`-adic modular forms for small primes
5
+
6
+ This module implements computations of Hecke operators and `U_p`-eigenfunctions
7
+ on `p`-adic overconvergent modular forms of tame level 1, where `p` is one of
8
+ the primes `\{2, 3, 5, 7, 13\}`, using the algorithms described in [Loe2007]_.
9
+
10
+ - [Loe2007]_
11
+
12
+ AUTHORS:
13
+
14
+ - David Loeffler (August 2008): initial version
15
+ - David Loeffler (March 2009): extensively reworked
16
+ - Lloyd Kilford (May 2009): add
17
+ :meth:`~sage.modular.overconvergent.genus0.OverconvergentModularFormsSpace.slopes`
18
+ method
19
+ - David Loeffler (June 2009): miscellaneous bug fixes and usability improvements
20
+
21
+ The Theory
22
+ ~~~~~~~~~~
23
+
24
+ Let `p` be one of the above primes, so `X_0(p)` has genus 0, and let
25
+
26
+ .. MATH::
27
+
28
+ f_p = \sqrt[p-1]{\frac{\Delta(pz)}{\Delta(z)}}
29
+
30
+ (an `\eta`-product of level `p` -- see module :mod:`sage.modular.etaproducts`).
31
+ Then one can show that `f_p` gives an isomorphism `X_0(p) \to \mathbb{P}^1`.
32
+ Furthermore, if we work over `\CC_p`, the `r`-overconvergent locus on `X_0(p)`
33
+ (or of `X_0(1)`, via the canonical subgroup lifting), corresponds to the
34
+ `p`-adic disc
35
+
36
+ .. MATH::
37
+
38
+ |f_p|_p \le p^{\frac{12r}{p-1}}.
39
+
40
+ (This is Theorem 1 of [Loe2007]_.)
41
+
42
+ Hence if we fix an element `c` with `|c| = p^{-\frac{12r}{p-1}}`, the space
43
+ `S_k^\dagger(1, r)` of overconvergent `p`-adic modular forms has an orthonormal
44
+ basis given by the functions `(cf)^n`. So any element can be written in the
45
+ form `E_k \times \sum_{n \ge 0} a_n (cf)^n`, where `a_n \to 0` as `N \to
46
+ \infty`, and any such sequence `a_n` defines a unique overconvergent form.
47
+
48
+ One can now find the matrix of Hecke operators in this basis, either by
49
+ calculating `q`-expansions, or (for the special case of `U_p`) using a
50
+ recurrence formula due to Kolberg.
51
+
52
+ An Extended Example
53
+ ~~~~~~~~~~~~~~~~~~~
54
+
55
+ We create a space of 3-adic modular forms::
56
+
57
+ sage: M = OverconvergentModularForms(3, 8, 1/6, prec=60)
58
+
59
+ Creating an element directly as a linear combination of basis vectors.
60
+
61
+ .. link
62
+
63
+ ::
64
+
65
+ sage: f1 = M.3 + M.5; f1.q_expansion()
66
+ 27*q^3 + 1055916/1093*q^4 + 19913121/1093*q^5 + 268430112/1093*q^6 + ...
67
+ sage: f1.coordinates(8)
68
+ [0, 0, 0, 1, 0, 1, 0, 0]
69
+
70
+ We can coerce from elements of classical spaces of modular forms:
71
+
72
+ .. link
73
+
74
+ ::
75
+
76
+ sage: f2 = M(CuspForms(3, 8).0); f2
77
+ 3-adic overconvergent modular form of weight-character 8 with q-expansion
78
+ q + 6*q^2 - 27*q^3 - 92*q^4 + 390*q^5 - 162*q^6 ...
79
+
80
+ We express this in a basis, and see that the coefficients go to zero very fast:
81
+
82
+ .. link
83
+
84
+ ::
85
+
86
+ sage: [x.valuation(3) for x in f2.coordinates(60)]
87
+ [+Infinity, -1, 3, 6, 10, 13, 18, 20, 24, 27, 31, 34, 39, 41, 45, 48, 52, 55, 61,
88
+ 62, 66, 69, 73, 76, 81, 83, 87, 90, 94, 97, 102, 104, 108, 111, 115, 118, 124, 125,
89
+ 129, 132, 136, 139, 144, 146, 150, 153, 157, 160, 165, 167, 171, 174, 178, 181,
90
+ 188, 188, 192, 195, 199, 202]
91
+
92
+ This form has more level at `p`, and hence is less overconvergent:
93
+
94
+ .. link
95
+
96
+ ::
97
+
98
+ sage: f3 = M(CuspForms(9, 8).0); [x.valuation(3) for x in f3.coordinates(60)]
99
+ [+Infinity, -1, -1, 0, -4, -4, -2, -3, 0, 0, -1, -1, 1, 0, 3, 3, 3, 3, 5, 3, 7, 7,
100
+ 6, 6, 8, 7, 10, 10, 8, 8, 10, 9, 12, 12, 12, 12, 14, 12, 17, 16, 15, 15, 17, 16,
101
+ 19, 19, 18, 18, 20, 19, 22, 22, 22, 22, 24, 21, 25, 26, 24, 24]
102
+
103
+ An error will be raised for forms which are not sufficiently overconvergent:
104
+
105
+ .. link
106
+
107
+ ::
108
+
109
+ sage: M(CuspForms(27, 8).0)
110
+ Traceback (most recent call last):
111
+ ...
112
+ ValueError: Form is not overconvergent enough (form is only 1/12-overconvergent)
113
+
114
+ Let's compute some Hecke operators. Note that the coefficients of this matrix are `p`-adically tiny:
115
+
116
+ .. link
117
+
118
+ ::
119
+
120
+ sage: M.hecke_matrix(3, 4).change_ring(Qp(3, prec=1))
121
+ [ 1 + O(3) 0 0 0]
122
+ [ 0 2*3^3 + O(3^4) 2*3^3 + O(3^4) 3^2 + O(3^3)]
123
+ [ 0 2*3^7 + O(3^8) 2*3^8 + O(3^9) 3^6 + O(3^7)]
124
+ [ 0 2*3^10 + O(3^11) 2*3^10 + O(3^11) 2*3^9 + O(3^10)]
125
+
126
+ We compute the eigenfunctions of a 4x4 truncation:
127
+
128
+ .. link
129
+
130
+ ::
131
+
132
+ sage: efuncs = M.eigenfunctions(4)
133
+ sage: for i in [1..3]:
134
+ ....: print(efuncs[i].q_expansion(prec=4).change_ring(Qp(3, prec=20)))
135
+ (1 + O(3^20))*q
136
+ + (2*3 + 3^15 + 3^16 + 3^17 + 2*3^19 + 2*3^20 + O(3^21))*q^2
137
+ + (2*3^3 + 2*3^4 + 2*3^5 + 2*3^6 + 2*3^7 + 2*3^8 + 2*3^9
138
+ + 2*3^10 + 2*3^11 + 2*3^12 + 2*3^13 + 2*3^14 + 2*3^15
139
+ + 2*3^16 + 3^17 + 2*3^18 + 2*3^19 + 3^21 + 3^22 + O(3^23))*q^3
140
+ + O(q^4)
141
+ (1 + O(3^20))*q
142
+ + (3 + 2*3^2 + 3^3 + 3^4 + 3^12 + 3^13 + 2*3^14
143
+ + 3^15 + 2*3^17 + 3^18 + 3^19 + 3^20 + O(3^21))*q^2
144
+ + (3^7 + 3^13 + 2*3^14 + 2*3^15 + 3^16 + 3^17 + 2*3^18
145
+ + 3^20 + 2*3^21 + 2*3^22 + 2*3^23 + 2*3^25 + O(3^27))*q^3
146
+ + O(q^4)
147
+ (1 + O(3^20))*q
148
+ + (2*3 + 3^3 + 2*3^4 + 3^6 + 2*3^8 + 3^9 + 3^10
149
+ + 2*3^11 + 2*3^13 + 3^16 + 3^18 + 3^19 + 3^20 + O(3^21))*q^2
150
+ + (3^9 + 2*3^12 + 3^15 + 3^17 + 3^18 + 3^19 + 3^20
151
+ + 2*3^22 + 2*3^23 + 2*3^27 + 2*3^28 + O(3^29))*q^3
152
+ + O(q^4)
153
+
154
+ The first eigenfunction is a classical cusp form of level 3:
155
+
156
+ .. link
157
+
158
+ ::
159
+
160
+ sage: (efuncs[1] - M(CuspForms(3, 8).0)).valuation()
161
+ 13
162
+
163
+ The second is an Eisenstein series!
164
+
165
+ .. link
166
+
167
+ ::
168
+
169
+ sage: (efuncs[2] - M(EisensteinForms(3, 8).1)).valuation()
170
+ 10
171
+
172
+ The third is a genuinely new thing (not a classical modular form at all); the
173
+ coefficients are almost certainly not algebraic over `\QQ`. Note that the slope
174
+ is 9, so Coleman's classicality criterion (forms of slope `< k-1` are
175
+ classical) does not apply.
176
+
177
+ .. link
178
+
179
+ ::
180
+
181
+ sage: a3 = efuncs[3].q_expansion()[3]; a3
182
+ 3^9 + 2*3^12 + 3^15 + 3^17 + 3^18 + 3^19 + 3^20 + 2*3^22 + 2*3^23 + 2*3^27
183
+ + 2*3^28 + 3^32 + 3^33 + 2*3^34 + 3^38 + 2*3^39 + 3^40 + 2*3^41 + 3^44 + 3^45
184
+ + 3^46 + 2*3^47 + 2*3^48 + 3^49 + 3^50 + 2*3^51 + 2*3^52 + 3^53 + 2*3^54 + 3^55
185
+ + 3^56 + 3^57 + 2*3^58 + 2*3^59 + 3^60 + 2*3^61 + 2*3^63 + 2*3^64 + 3^65 + 2*3^67
186
+ + 3^68 + 2*3^69 + 2*3^71 + 3^72 + 2*3^74 + 3^75 + 3^76 + 3^79 + 3^80 + 2*3^83
187
+ + 2*3^84 + 3^85 + 2*3^87 + 3^88 + 2*3^89 + 2*3^90 + 2*3^91 + 3^92 + O(3^98)
188
+ sage: efuncs[3].slope()
189
+ 9
190
+ """
191
+ # ****************************************************************************
192
+ # Copyright (C) 2008 William Stein <wstein@gmail.com>
193
+ # 2008-9 David Loeffler <d.loeffler.01@cantab.net>
194
+ #
195
+ # Distributed under the terms of the GNU General Public License (GPL)
196
+ # https://www.gnu.org/licenses/
197
+ # ****************************************************************************
198
+ from collections.abc import Iterator
199
+
200
+ import weakref
201
+
202
+ import sage.rings.abc
203
+
204
+ from sage.matrix.constructor import matrix
205
+ from sage.matrix.matrix_space import MatrixSpace
206
+ from sage.matrix.special import diagonal_matrix
207
+ from sage.misc.cachefunc import cached_method
208
+ from sage.misc.lazy_import import lazy_import
209
+ from sage.misc.verbose import verbose
210
+ from sage.modular.arithgroup.congroup_gamma0 import Gamma0_class
211
+ from sage.modular.arithgroup.congroup_gamma1 import Gamma1_class
212
+ from sage.modular.dirichlet import trivial_character
213
+ from sage.modular.etaproducts import EtaProduct
214
+ from sage.modular.modform.element import ModularFormElement
215
+ from sage.modular.modform.hecke_operator_on_qexp import hecke_operator_on_qexp
216
+ from sage.modules.free_module_element import vector
217
+ from sage.modules.module import Module
218
+ from sage.rings.big_oh import O
219
+ from sage.rings.infinity import Infinity
220
+ from sage.rings.integer_ring import ZZ
221
+ from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing
222
+ from sage.rings.power_series_ring import PowerSeriesRing
223
+ from sage.rings.rational_field import QQ
224
+ from sage.structure.element import Vector, ModuleElement
225
+ from sage.structure.richcmp import richcmp
226
+ from .weightspace import WeightSpace_constructor as WeightSpace, WeightCharacter
227
+
228
+ lazy_import('sage.modular.modform.j_invariant', 'j_invariant_qexp')
229
+ lazy_import('sage.rings.padics.factory', 'Qp', as_='pAdicField')
230
+
231
+
232
+ __ocmfdict = {}
233
+
234
+
235
+ ####################
236
+ # Factory function #
237
+ ####################
238
+
239
+ def OverconvergentModularForms(prime, weight, radius, base_ring=QQ, prec=20, char=None):
240
+ r"""
241
+ Create a space of overconvergent `p`-adic modular forms of level
242
+ `\Gamma_0(p)`, over the given base ring. The base ring need not be a
243
+ `p`-adic ring (the spaces we compute with typically have bases over
244
+ `\QQ`).
245
+
246
+ INPUT:
247
+
248
+ - ``prime`` -- a prime number `p`, which must be one of the primes `\{2, 3,
249
+ 5, 7, 13\}`, or the congruence subgroup `\Gamma_0(p)` where `p` is one of
250
+ these primes
251
+
252
+ - ``weight`` -- integer (which at present must be 0 or `\ge 2`), the
253
+ weight
254
+
255
+ - ``radius`` -- a rational number in the interval `\left( 0, \frac{p}{p+1}
256
+ \right)`, the radius of overconvergence
257
+
258
+ - ``base_ring`` -- (default: `\QQ`), a ring over which to compute; this
259
+ need not be a `p`-adic ring
260
+
261
+ - ``prec`` -- integer (default: 20); the number of `q`-expansion terms to
262
+ compute
263
+
264
+ - ``char`` -- a Dirichlet character modulo `p` or ``None`` (the default);
265
+ here ``None`` is interpreted as the trivial character modulo `p`
266
+
267
+ The character `\chi` and weight `k` must satisfy `(-1)^k = \chi(-1)`, and
268
+ the base ring must contain an element `v` such that
269
+ `{\rm ord}_p(v) = \frac{12 r}{p-1}` where `r` is the radius of
270
+ overconvergence (and `{\rm ord}_p` is normalised so `{\rm ord}_p(p) = 1`).
271
+
272
+ EXAMPLES::
273
+
274
+ sage: OverconvergentModularForms(3, 0, 1/2)
275
+ Space of 3-adic 1/2-overconvergent modular forms
276
+ of weight-character 0 over Rational Field
277
+ sage: OverconvergentModularForms(3, 16, 1/2)
278
+ Space of 3-adic 1/2-overconvergent modular forms
279
+ of weight-character 16 over Rational Field
280
+ sage: OverconvergentModularForms(3, 3, 1/2, char=DirichletGroup(3,QQ).0)
281
+ Space of 3-adic 1/2-overconvergent modular forms
282
+ of weight-character (3, 3, [-1]) over Rational Field
283
+ """
284
+ if isinstance(prime, (Gamma0_class, Gamma1_class)):
285
+ prime = prime.level()
286
+ else:
287
+ prime = ZZ(prime)
288
+ if char is None:
289
+ char = trivial_character(prime, base_ring=QQ)
290
+ if int(prime) not in [2, 3, 5, 7, 13]:
291
+ raise ValueError("p must be one of {2, 3, 5, 7, 13}")
292
+ key = (prime, weight, radius, base_ring, prec, char)
293
+ if key in __ocmfdict:
294
+ w = __ocmfdict[key]
295
+ M = w()
296
+ if M is not None:
297
+ return M
298
+ M = OverconvergentModularFormsSpace(*key)
299
+ __ocmfdict[key] = weakref.ref(M)
300
+ return M
301
+
302
+
303
+ #########################
304
+ # Main class definition #
305
+ #########################
306
+
307
+ class OverconvergentModularFormsSpace(Module):
308
+ r"""
309
+ A space of overconvergent modular forms of level `\Gamma_0(p)`,
310
+ where `p` is a prime such that `X_0(p)` has genus 0.
311
+
312
+ Elements are represented as power series, with a formal power series `F`
313
+ corresponding to the modular form `E_k^\ast \times F(g)` where `E_k^\ast`
314
+ is the `p`-deprived Eisenstein series of weight-character `k`, and `g` is a
315
+ uniformiser of `X_0(p)` normalised so that the `r`-overconvergent region
316
+ `X_0(p)_{\ge r}` corresponds to `|g| \le 1`.
317
+
318
+ TESTS::
319
+
320
+ sage: x = polygen(ZZ, 'x')
321
+ sage: K.<w> = Qp(13).extension(x^2 - 13); M = OverconvergentModularForms(13, 20, radius=1/2, base_ring=K)
322
+ sage: M is loads(dumps(M))
323
+ True
324
+ """
325
+
326
+ ###############
327
+ # Init script #
328
+ ###############
329
+
330
+ def __init__(self, prime, weight, radius, base_ring, prec, char):
331
+ r"""
332
+ Create a space of overconvergent `p`-adic modular forms of level
333
+ `\Gamma_0(p)`, over the given base ring.
334
+
335
+ The base ring need not be a
336
+ `p`-adic ring (the spaces we compute with typically have bases over
337
+ `\QQ`).
338
+
339
+ EXAMPLES::
340
+
341
+ sage: M = OverconvergentModularForms(3, 0, 1/2); M
342
+ Space of 3-adic 1/2-overconvergent modular forms of weight-character 0 over Rational Field
343
+ sage: TestSuite(M).run()
344
+ """
345
+ self._p = prime
346
+
347
+ if not (base_ring == QQ or isinstance(base_ring, sage.rings.abc.pAdicField)):
348
+ raise TypeError("Base ring must be QQ or a p-adic field")
349
+
350
+ if base_ring != QQ and base_ring.prime() != self._p:
351
+ raise TypeError("Residue characteristic of base ring (=%s) must be %s" % (base_ring, self._p))
352
+
353
+ if isinstance(weight, WeightCharacter):
354
+ self._wtchar = weight
355
+ else:
356
+ self._wtchar = WeightSpace(prime, base_ring=char.base_ring())(weight, char, algebraic=True)
357
+
358
+ if not self._wtchar.is_even():
359
+ raise ValueError("Weight-character must be even")
360
+
361
+ Module.__init__(self, base_ring)
362
+
363
+ self._prec = prec
364
+
365
+ self._qsr = PowerSeriesRing(base_ring, 'q', prec) # q-series ring
366
+ self._gsr = PowerSeriesRing(base_ring, 'g', prec) # g-adic expansions, g = c*f
367
+
368
+ self._cached_recurrence_matrix = None
369
+ self._set_radius(radius)
370
+ self._basis_cache = [self._wtchar.pAdicEisensteinSeries(self._qsr, self.prec())]
371
+ self._uniformiser = self._qsr(EtaProduct(prime, {prime: 24/ZZ(prime-1), ZZ(1): -24/ZZ(prime-1)}).qexp(self.prec()))
372
+
373
+ for i in range(1, self.prec()):
374
+ self._basis_cache.append(self._basis_cache[-1] * self._uniformiser * self._const)
375
+
376
+ #####################################
377
+ # Methods called by the init script #
378
+ #####################################
379
+
380
+ def _set_radius(self, radius):
381
+ r"""
382
+ Set the radius of overconvergence to be `r`, where `r` is a rational
383
+ number in the interval `0 < r < \frac{p}{p+1}`.
384
+
385
+ This only makes sense if the base ring contains an element of
386
+ normalised valuation `\frac{12r}{p-1}`. If this valuation is an
387
+ integer, we use the appropriate power of `p`. Otherwise, we assume the
388
+ base ring has a ``uniformiser`` method and take an appropriate power of
389
+ the uniformiser, raising an error if no such element exists.
390
+
391
+ EXAMPLES::
392
+
393
+ sage: M = OverconvergentModularForms(3, 2, 1/2) # indirect doctest
394
+ sage: M._set_radius(1/3); M
395
+ Space of 3-adic 1/3-overconvergent modular forms of weight-character 2
396
+ over Rational Field
397
+
398
+ sage: x = polygen(ZZ, 'x')
399
+ sage: L.<w> = Qp(3).extension(x^5 - 3)
400
+ sage: OverconvergentModularForms(3, 2, 1/30, base_ring=L).normalising_factor() # indirect doctest
401
+ w + O(w^101)
402
+
403
+ sage: OverconvergentModularForms(3, 2, 1/40, base_ring=L)
404
+ Traceback (most recent call last):
405
+ ...
406
+ ValueError: no element of base ring (=3-adic Eisenstein Extension ...)
407
+ has normalised valuation 3/20
408
+ """
409
+
410
+ p = ZZ(self.prime())
411
+
412
+ if (radius < 0 or radius > p/(p+1)):
413
+ raise ValueError("radius (=%s) must be between 0 and p/(p+1)" % radius)
414
+ d = 12/(p-1)*radius
415
+ if d.is_integral():
416
+ self._const = p ** ZZ(d)
417
+ self._radius = radius
418
+ else:
419
+ try:
420
+ pi = self.base_ring().uniformiser()
421
+ e = d / pi.normalized_valuation()
422
+ except AttributeError: # base ring isn't a p-adic ring
423
+ pi = p
424
+ e = d
425
+ if not e.is_integral():
426
+ raise ValueError("no element of base ring (=%s) has normalised valuation %s" % (self.base_ring(), radius * 12 / (p-1)))
427
+ self._radius = radius
428
+ self._const = pi ** ZZ(e)
429
+
430
+ ##############################################
431
+ # Boring functions that access internal data #
432
+ ##############################################
433
+
434
+ def is_exact(self) -> bool:
435
+ r"""
436
+ Return ``True`` if elements of this space are represented exactly.
437
+
438
+ This would mean that there is no precision loss when doing arithmetic.
439
+ As this is never true for overconvergent modular forms spaces,
440
+ this method returns ``False``.
441
+
442
+ EXAMPLES::
443
+
444
+ sage: OverconvergentModularForms(13, 12, 0).is_exact()
445
+ False
446
+ """
447
+ return False
448
+
449
+ def change_ring(self, ring):
450
+ r"""
451
+ Return the space corresponding to ``self`` but over the given base ring.
452
+
453
+ EXAMPLES::
454
+
455
+ sage: M = OverconvergentModularForms(2, 0, 1/2)
456
+ sage: M.change_ring(Qp(2))
457
+ Space of 2-adic 1/2-overconvergent modular forms of weight-character 0
458
+ over 2-adic Field with ...
459
+ """
460
+ return OverconvergentModularForms(self.prime(), self.weight(), self.radius(), ring, self.prec(), self.character())
461
+
462
+ def base_extend(self, ring):
463
+ r"""
464
+ Return the base extension of ``self`` to the given base ring.
465
+
466
+ There must be a canonical map to this ring from the current
467
+ base ring, otherwise a :exc:`TypeError` will be raised.
468
+
469
+ EXAMPLES::
470
+
471
+ sage: M = OverconvergentModularForms(2, 0, 1/2, base_ring=Qp(2))
472
+ sage: x = polygen(ZZ, 'x')
473
+ sage: M.base_extend(Qp(2).extension(x^2 - 2, names='w'))
474
+ Space of 2-adic 1/2-overconvergent modular forms of weight-character 0
475
+ over 2-adic Eisenstein Extension ...
476
+ sage: M.base_extend(QQ)
477
+ Traceback (most recent call last):
478
+ ...
479
+ TypeError: Base extension of self (over '2-adic Field with capped
480
+ relative precision 20') to ring 'Rational Field' not defined.
481
+ """
482
+ if ring.has_coerce_map_from(self.base_ring()):
483
+ return self.change_ring(ring)
484
+ else:
485
+ raise TypeError("Base extension of self (over '%s') to ring '%s' not defined." % (self.base_ring(), ring))
486
+
487
+ def _an_element_(self):
488
+ r"""
489
+ Return an element of this space (used by the coercion machinery).
490
+
491
+ EXAMPLES::
492
+
493
+ sage: OverconvergentModularForms(3, 2, 1/3, prec=4).an_element() # indirect doctest
494
+ 3-adic overconvergent modular form of weight-character 2
495
+ with q-expansion 9*q + 216*q^2 + 2430*q^3 + O(q^4)
496
+ """
497
+ return self.element_class(self, self._gsr.an_element())
498
+
499
+ def character(self):
500
+ r"""
501
+ Return the character of ``self``.
502
+
503
+ For overconvergent forms, the weight and the character are unified into
504
+ the concept of a weight-character, so this returns exactly the same
505
+ thing as :meth:`weight`.
506
+
507
+ EXAMPLES::
508
+
509
+ sage: OverconvergentModularForms(3, 0, 1/2).character()
510
+ 0
511
+ sage: type(OverconvergentModularForms(3, 0, 1/2).character())
512
+ <class '...weightspace.AlgebraicWeight'>
513
+ sage: OverconvergentModularForms(3, 3, 1/2, char=DirichletGroup(3,QQ).0).character()
514
+ (3, 3, [-1])
515
+ """
516
+ return self._wtchar
517
+
518
+ def weight(self):
519
+ r"""
520
+ Return the weight of ``self``.
521
+
522
+ For overconvergent forms, the weight and the character are unified into
523
+ the concept of a weight-character, so this returns exactly the same
524
+ thing as :meth:`character`.
525
+
526
+ EXAMPLES::
527
+
528
+ sage: OverconvergentModularForms(3, 0, 1/2).weight()
529
+ 0
530
+ sage: type(OverconvergentModularForms(3, 0, 1/2).weight())
531
+ <class '...weightspace.AlgebraicWeight'>
532
+ sage: OverconvergentModularForms(3, 3, 1/2, char=DirichletGroup(3,QQ).0).weight()
533
+ (3, 3, [-1])
534
+ """
535
+ return self._wtchar
536
+
537
+ def normalising_factor(self):
538
+ r"""
539
+ Return the normalising factor of ``self``.
540
+
541
+ The normalising factor `c` such that `g = c f` is a parameter for the
542
+ `r`-overconvergent disc in `X_0(p)`, where `f` is the standard
543
+ uniformiser.
544
+
545
+ EXAMPLES::
546
+
547
+ sage: x = polygen(ZZ, 'x')
548
+ sage: L.<w> = Qp(7).extension(x^2 - 7)
549
+ sage: OverconvergentModularForms(7, 0, 1/4, base_ring=L).normalising_factor()
550
+ w + O(w^41)
551
+ """
552
+ return self._const
553
+
554
+ def __eq__(self, other):
555
+ r"""
556
+ Check whether ``self`` is equal to ``other``.
557
+
558
+ EXAMPLES::
559
+
560
+ sage: OverconvergentModularForms(3, 12, 1/2) == ModularForms(3, 12)
561
+ False
562
+ sage: OverconvergentModularForms(3, 0, 1/2) == OverconvergentModularForms(3, 0, 1/3)
563
+ False
564
+ sage: OverconvergentModularForms(3, 0, 1/2) == OverconvergentModularForms(3, 0, 1/2, base_ring=Qp(3))
565
+ False
566
+ sage: OverconvergentModularForms(3, 0, 1/2) == OverconvergentModularForms(3, 0, 1/2)
567
+ True
568
+ """
569
+ if not isinstance(other, OverconvergentModularFormsSpace):
570
+ return False
571
+ else:
572
+ return self._params() == other._params()
573
+
574
+ def __ne__(self, other):
575
+ """
576
+ Check whether ``self`` is not equal to ``other``.
577
+
578
+ EXAMPLES::
579
+
580
+ sage: OverconvergentModularForms(3, 12, 1/2) != ModularForms(3, 12)
581
+ True
582
+ sage: OverconvergentModularForms(3, 0, 1/2) != OverconvergentModularForms(3, 0, 1/3)
583
+ True
584
+ sage: OverconvergentModularForms(3, 0, 1/2) != OverconvergentModularForms(3, 0, 1/2, base_ring=Qp(3))
585
+ True
586
+ sage: OverconvergentModularForms(3, 0, 1/2) != OverconvergentModularForms(3, 0, 1/2)
587
+ False
588
+ """
589
+ return not (self == other)
590
+
591
+ def __hash__(self):
592
+ """
593
+ Return the hash of ``self``.
594
+
595
+ EXAMPLES::
596
+
597
+ sage: h1 = hash(OverconvergentModularForms(3, 12, 1/2))
598
+ sage: h2 = hash(OverconvergentModularForms(3, 12, 1/2))
599
+ sage: h3 = hash(OverconvergentModularForms(3, 0, 1/2))
600
+ sage: h1 == h2 and h1 != h3
601
+ True
602
+ """
603
+ return hash(self._params())
604
+
605
+ def _params(self):
606
+ r"""
607
+ Return the parameters that define this module uniquely: prime, weight,
608
+ character, radius of overconvergence and base ring. Mostly used for
609
+ pickling.
610
+
611
+ EXAMPLES::
612
+
613
+ sage: x = polygen(ZZ, 'x')
614
+ sage: L.<w> = Qp(7).extension(x^2 - 7)
615
+ sage: OverconvergentModularForms(7, 0, 1/4, base_ring=L)._params()
616
+ (7,
617
+ 0,
618
+ 1/4,
619
+ 7-adic Eisenstein Extension Field in w defined by x^2 - 7,
620
+ 20,
621
+ Dirichlet character modulo 7 of conductor 1 mapping 3 |--> 1)
622
+ """
623
+ return (self.prime(), self.weight().k(), self.radius(), self.base_ring(), self.prec(), self.weight().chi())
624
+
625
+ def __reduce__(self):
626
+ r"""
627
+ Return the function and arguments used to construct ``self``. Used for pickling.
628
+
629
+ EXAMPLES::
630
+
631
+ sage: x = polygen(ZZ, 'x')
632
+ sage: L.<w> = Qp(7).extension(x^2 - 7)
633
+ sage: OverconvergentModularForms(7, 0, 1/4, base_ring=L).__reduce__()
634
+ (<function OverconvergentModularForms at ...>,
635
+ (7,
636
+ 0,
637
+ 1/4,
638
+ 7-adic Eisenstein Extension Field in w defined by x^2 - 7,
639
+ 20,
640
+ Dirichlet character modulo 7 of conductor 1 mapping 3 |--> 1))
641
+ """
642
+ return (OverconvergentModularForms, self._params())
643
+
644
+ def gen(self, i):
645
+ r"""
646
+ Return the `i`-th module generator of ``self``.
647
+
648
+ EXAMPLES::
649
+
650
+ sage: M = OverconvergentModularForms(3, 2, 1/2, prec=4)
651
+ sage: M.gen(0)
652
+ 3-adic overconvergent modular form of weight-character 2
653
+ with q-expansion 1 + 12*q + 36*q^2 + 12*q^3 + O(q^4)
654
+ sage: M.gen(1)
655
+ 3-adic overconvergent modular form of weight-character 2
656
+ with q-expansion 27*q + 648*q^2 + 7290*q^3 + O(q^4)
657
+ sage: M.gen(30)
658
+ 3-adic overconvergent modular form of weight-character 2
659
+ with q-expansion O(q^4)
660
+ """
661
+
662
+ return OverconvergentModularFormElement(self, gexp=self._gsr.gen()**i)
663
+
664
+ def _repr_(self):
665
+ r"""
666
+ Return a string representation of ``self``.
667
+
668
+ EXAMPLES::
669
+
670
+ sage: OverconvergentModularForms(3, 0, 1/2)._repr_()
671
+ 'Space of 3-adic 1/2-overconvergent modular forms of weight-character 0 over Rational Field'
672
+ """
673
+ return "Space of %s-adic %s-overconvergent modular forms of weight-character %s over %s" % (self.prime(), self.radius(), self.weight(), self.base_ring())
674
+
675
+ def prime(self):
676
+ r"""
677
+ Return the residue characteristic of ``self``.
678
+
679
+ This is the prime `p` such that this is a `p`-adic space.
680
+
681
+ EXAMPLES::
682
+
683
+ sage: OverconvergentModularForms(5, 12, 1/3).prime()
684
+ 5
685
+ """
686
+ return self._p
687
+
688
+ def radius(self):
689
+ r"""
690
+ The radius of overconvergence of this space.
691
+
692
+ EXAMPLES::
693
+
694
+ sage: OverconvergentModularForms(3, 0, 1/3).radius()
695
+ 1/3
696
+ """
697
+ return self._radius
698
+
699
+ def gens(self) -> Iterator:
700
+ r"""
701
+ Return a generator object that iterates over the (infinite) set of
702
+ basis vectors of ``self``.
703
+
704
+ EXAMPLES::
705
+
706
+ sage: o = OverconvergentModularForms(3, 12, 1/2)
707
+ sage: t = o.gens()
708
+ sage: next(t)
709
+ 3-adic overconvergent modular form of weight-character 12 with q-expansion
710
+ 1 - 32760/61203943*q - 67125240/61203943*q^2 - ...
711
+ sage: next(t)
712
+ 3-adic overconvergent modular form of weight-character 12 with q-expansion
713
+ 27*q + 19829193012/61203943*q^2 + 146902585770/61203943*q^3 + ...
714
+ """
715
+ i = 0
716
+ while True:
717
+ yield self.gen(i)
718
+ i += 1
719
+
720
+ def prec(self):
721
+ r"""
722
+ Return the series precision of ``self``.
723
+
724
+ Note that this is different from the `p`-adic precision of the base ring.
725
+
726
+ EXAMPLES::
727
+
728
+ sage: OverconvergentModularForms(3, 0, 1/2).prec()
729
+ 20
730
+ sage: OverconvergentModularForms(3, 0, 1/2, prec=40).prec()
731
+ 40
732
+ """
733
+ return self._prec
734
+
735
+ #####################################
736
+ # Element construction and coercion #
737
+ #####################################
738
+
739
+ def _element_constructor_(self, input):
740
+ r"""
741
+ Create an element of this space. Allowable inputs are:
742
+
743
+ - elements of compatible spaces of modular forms or overconvergent
744
+ modular forms
745
+
746
+ - arbitrary power series in `q`
747
+
748
+ - lists of elements of the base ring (interpreted as vectors in the
749
+ basis given by :meth:`gens`).
750
+
751
+ Precision may be specified by padding lists at the end with zeros;
752
+ inputs with a higher precision than the set precision of this space
753
+ will be rounded.
754
+
755
+ EXAMPLES:
756
+
757
+ From a `q`-expansion::
758
+
759
+ sage: M = OverconvergentModularForms(3, 0, 1/2, prec=5)
760
+ sage: R.<q> = QQ[[]]
761
+ sage: f = M(q + q^2 - q^3 + O(q^16)); f
762
+ 3-adic overconvergent modular form of weight-character 0 with q-expansion q + q^2 - q^3 + O(q^5)
763
+ sage: M.coordinate_vector(f)
764
+ (0, 1/27, -11/729, 173/19683, -3172/531441)
765
+
766
+ From a list or a vector::
767
+
768
+ sage: M([1,0,1])
769
+ 3-adic overconvergent modular form of weight-character 0 with q-expansion 1 + 729*q^2 + O(q^3)
770
+ sage: M([1,0,1,0,0])
771
+ 3-adic overconvergent modular form of weight-character 0 with q-expansion 1 + 729*q^2 + 17496*q^3 + 236196*q^4 + O(q^5)
772
+ sage: f = M([1,0,1,0,0]); v = M.coordinate_vector(f); v
773
+ (1, 0, 1, 0, 0)
774
+ sage: M(v) == f
775
+ True
776
+
777
+ From a classical modular form::
778
+
779
+ sage: f = CuspForms(Gamma0(3), 12).0; f
780
+ q - 176*q^4 + 2430*q^5 + O(q^6)
781
+ sage: fdag = OverconvergentModularForms(3, 12, 1/3, prec=8)(f); fdag
782
+ 3-adic overconvergent modular form of weight-character 12 with q-expansion q - 176*q^4 + 2430*q^5 - 5832*q^6 - 19336*q^7 + O(q^8)
783
+ sage: fdag.parent().coordinate_vector(f)*(1 + O(3^2))
784
+ (0, 3^-2 + O(3^0), 2*3^-3 + 2*3^-2 + O(3^-1), 3^-4 + 3^-3 + O(3^-2), 2 + 3 + O(3^2), 2*3 + 3^2 + O(3^3), 2*3^4 + 2*3^5 + O(3^6), 3^5 + 3^6 + O(3^7))
785
+ sage: OverconvergentModularForms(3, 6, 1/3)(f)
786
+ Traceback (most recent call last):
787
+ ...
788
+ TypeError: Cannot create an element of 'Space of 3-adic ...' from element of incompatible space 'Cuspidal subspace ...'
789
+
790
+ We test that zero elements are handled properly::
791
+
792
+ sage: M(0)
793
+ 3-adic overconvergent modular form of weight-character 0 with q-expansion O(q^5)
794
+ sage: M(O(q^3))
795
+ 3-adic overconvergent modular form of weight-character 0 with q-expansion O(q^3)
796
+
797
+ We test coercion between spaces of different precision::
798
+
799
+ sage: M10 = OverconvergentModularForms(3, 0, 1/2, prec=10)
800
+ sage: f = M10.1
801
+ sage: M(f)
802
+ 3-adic overconvergent modular form of weight-character 0 with q-expansion 27*q + 324*q^2 + 2430*q^3 + 13716*q^4 + O(q^5)
803
+ sage: M10(M(f))
804
+ 3-adic overconvergent modular form of weight-character 0 with q-expansion 27*q + 324*q^2 + 2430*q^3 + 13716*q^4 + O(q^5)
805
+ """
806
+ if isinstance(input, int):
807
+ input = ZZ(input)
808
+
809
+ if isinstance(input, OverconvergentModularFormElement):
810
+ return self._coerce_from_ocmf(input)
811
+
812
+ elif isinstance(input, ModularFormElement):
813
+ if ((input.level() == 1 or input.level().prime_factors() == [self.prime()])
814
+ and input.weight() == self.weight().k()
815
+ and input.character().primitive_character() == self.weight().chi().primitive_character()):
816
+ p = ZZ(self.prime())
817
+ nu = (input.level() == 1 and p/(p+1)) or (1 / (p + 1) * p**(2 - input.level().valuation(p)))
818
+ if self.radius() > nu:
819
+ raise ValueError("Form is not overconvergent enough (form is only %s-overconvergent)" % nu)
820
+ else:
821
+ return self(self._qsr(input.q_expansion(self.prec())))
822
+ else:
823
+ raise TypeError("Cannot create an element of '%s' from element of incompatible space '%s'" % (self, input.parent()))
824
+
825
+ elif isinstance(input, (list, tuple, Vector)):
826
+ v = list(input)
827
+ n = len(v)
828
+ return OverconvergentModularFormElement(self, gexp=self._gsr(v).add_bigoh(n), qexp=None)
829
+
830
+ elif self._qsr.has_coerce_map_from(input.parent()):
831
+ return OverconvergentModularFormElement(self, gexp=None, qexp=self._qsr(input))
832
+
833
+ else:
834
+ raise TypeError("Don't know how to create an overconvergent modular form from %s" % input)
835
+
836
+ @cached_method
837
+ def zero(self):
838
+ """
839
+ Return the zero of this space.
840
+
841
+ EXAMPLES::
842
+
843
+ sage: x = polygen(ZZ, 'x')
844
+ sage: K.<w> = Qp(13).extension(x^2 - 13)
845
+ sage: M = OverconvergentModularForms(13, 20, radius=1/2, base_ring=K)
846
+ sage: K.zero()
847
+ 0
848
+ """
849
+ return self(0)
850
+
851
+ def _coerce_from_ocmf(self, f):
852
+ r"""
853
+ Try to convert the overconvergent modular form `f` into an element of ``self``.
854
+
855
+ An error will be raised if this is obviously nonsense.
856
+
857
+ EXAMPLES::
858
+
859
+ sage: M = OverconvergentModularForms(3, 0, 1/2)
860
+ sage: MM = M.base_extend(Qp(3))
861
+ sage: R.<q> = Qp(3)[[]]; f = MM(q + O(q^2)); f
862
+ 3-adic overconvergent modular form of weight-character 0 with q-expansion (1 + O(3^20))*q + O(q^2)
863
+ sage: M._coerce_from_ocmf(f)
864
+ 3-adic overconvergent modular form of weight-character 0 with q-expansion q + O(q^2)
865
+ sage: f in M # indirect doctest
866
+ True
867
+ """
868
+ prime, weight, radius, base_ring, prec, char = f.parent()._params()
869
+ if (prime, weight, char) != (self.prime(), self.weight().k(), self.weight().chi()):
870
+ raise TypeError("Cannot create an element of '%s' from element of incompatible space '%s'" % (self, input.parent()))
871
+ return self(self._qsr(f.q_expansion()))
872
+
873
+ def _coerce_map_from_(self, other):
874
+ r"""
875
+ Canonical coercion of ``x`` into ``self``.
876
+
877
+ Here the possibilities for ``x`` are more restricted.
878
+
879
+ TESTS::
880
+
881
+ sage: M = OverconvergentModularForms(3, 0, 1/2)
882
+ sage: MM = M.base_extend(Qp(3))
883
+ sage: MM.has_coerce_map_from(M) # indirect doctest
884
+ True
885
+ sage: MM.coerce(M.1)
886
+ 3-adic overconvergent modular form of weight-character 0 with q-expansion (3^3 + O(3^23))*q + (3^4 + 3^5 + O(3^24))*q^2 ...
887
+ sage: M.has_coerce_map_from(MM)
888
+ False
889
+ sage: M.coerce(1)
890
+ 3-adic overconvergent modular form of weight-character 0 with q-expansion 1 + O(q^20)
891
+ """
892
+ if (isinstance(other, OverconvergentModularFormsSpace) and
893
+ self.base_ring().has_coerce_map_from(other.base_ring())):
894
+ return True
895
+ return self.base_ring().has_coerce_map_from(other)
896
+
897
+ def coordinate_vector(self, x):
898
+ r"""
899
+ Write ``x`` as a vector with respect to the basis given by ``self.basis()``.
900
+
901
+ Here ``x`` must be an element of this space or something that can be
902
+ converted into one. If ``x`` has precision less than the default precision
903
+ of ``self``, then the returned vector will be shorter.
904
+
905
+ EXAMPLES::
906
+
907
+ sage: M = OverconvergentModularForms(Gamma0(3), 0, 1/3, prec=4)
908
+ sage: M.coordinate_vector(M.gen(2))
909
+ (0, 0, 1, 0)
910
+ sage: q = QQ[['q']].gen(); M.coordinate_vector(q - q^2 + O(q^4))
911
+ (0, 1/9, -13/81, 74/243)
912
+ sage: M.coordinate_vector(q - q^2 + O(q^3))
913
+ (0, 1/9, -13/81)
914
+ """
915
+ if hasattr(x, 'base_ring') and x.base_ring() != self.base_ring():
916
+ return self.base_extend(x.base_ring()).coordinate_vector(x)
917
+
918
+ if x.parent() != self:
919
+ x = self(x)
920
+
921
+ return vector(self.base_ring(), x.gexp().padded_list(x.gexp().prec()))
922
+
923
+ ##########################################################
924
+ # Pointless routines required by parent class definition #
925
+ ##########################################################
926
+
927
+ def ngens(self):
928
+ r"""
929
+ The number of generators of ``self`` (as a module over its base ring), i.e. infinity.
930
+
931
+ EXAMPLES::
932
+
933
+ sage: M = OverconvergentModularForms(2, 4, 1/6)
934
+ sage: M.ngens()
935
+ +Infinity
936
+ """
937
+ return Infinity
938
+
939
+ #####################################
940
+ # Routines with some actual content #
941
+ #####################################
942
+
943
+ def hecke_operator(self, f, m):
944
+ r"""
945
+ Given an element `f` and an integer `m`, calculates the Hecke operator
946
+ `T_m` acting on `f`.
947
+
948
+ The input may be either a "bare" power series, or an
949
+ :class:`OverconvergentModularFormElement` object; the return value will be of
950
+ the same type.
951
+
952
+ EXAMPLES::
953
+
954
+ sage: M = OverconvergentModularForms(3, 0, 1/2)
955
+ sage: f = M.1
956
+ sage: M.hecke_operator(f, 3)
957
+ 3-adic overconvergent modular form of weight-character 0 with q-expansion
958
+ 2430*q + 265356*q^2 + 10670373*q^3 + 249948828*q^4 + 4113612864*q^5
959
+ + 52494114852*q^6 + O(q^7)
960
+ sage: M.hecke_operator(f.q_expansion(), 3)
961
+ 2430*q + 265356*q^2 + 10670373*q^3 + 249948828*q^4 + 4113612864*q^5
962
+ + 52494114852*q^6 + O(q^7)
963
+ """
964
+
965
+ # This should just be an instance of hecke_operator_on_qexp but that
966
+ # won't accept arbitrary power series as input, although it's clearly
967
+ # supposed to, which seems rather to defy the point but never mind...
968
+
969
+ if f.parent() is self:
970
+ return self(self.hecke_operator(f.q_expansion(), m))
971
+ elif isinstance(f, OverconvergentModularFormElement):
972
+ if f.parent() is self.base_extend(f.parent().base_ring()):
973
+ return f.parent().hecke_operator(f, m)
974
+ else:
975
+ raise TypeError("Not an element of this space")
976
+ else:
977
+ return hecke_operator_on_qexp(f, m, self.weight().k(), eps=self.weight().chi())
978
+
979
+ def _convert_to_basis(self, qexp):
980
+ r"""
981
+ Given a `q`-expansion, converts it to a vector in the basis of this
982
+ space, to the maximum possible precision (which is the minimum of the
983
+ `q`-adic precision of the `q`-expansion and the precision of ``self``).
984
+
985
+ EXAMPLES::
986
+
987
+ sage: M = OverconvergentModularForms(2, 0, 1/2)
988
+ sage: R.<q> = QQ[[]]
989
+ sage: M._convert_to_basis(q + q^2 + O(q^4))
990
+ 1/64*g - 23/4096*g^2 + 201/65536*g^3 + O(g^4)
991
+ """
992
+ n = min(qexp.prec(), self.prec())
993
+ x = qexp
994
+ g = self._gsr.gen()
995
+ answer = self._gsr(0)
996
+ for i in range(n):
997
+ assert x.valuation() >= i
998
+ answer += (x[i] / self._basis_cache[i][i]) * g**i
999
+ x = x - self._basis_cache[i] * answer[i]
1000
+ return answer + O(g**n)
1001
+
1002
+ def hecke_matrix(self, m, n, use_recurrence=False, exact_arith=False, side='left'):
1003
+ r"""
1004
+ Calculate the matrix of the `T_m` operator, truncated to `n \times n`.
1005
+
1006
+ INPUT:
1007
+
1008
+ - ``m`` -- integer; determines the operator `T_m`
1009
+
1010
+ - ``n`` -- integer; truncate the matrix in the basis of this space
1011
+ to an `n \times n` matrix
1012
+
1013
+ - ``use_recurrence`` -- boolean (default: ``False``); whether to use
1014
+ Kolberg style recurrences. If ``False``, use naive `q`-expansion
1015
+ arguments.
1016
+
1017
+ - ``exact_arith`` -- boolean (default: ``True``); whether to do the
1018
+ computation to be done with rational arithmetic, even if the base ring
1019
+ is an inexact `p`-adic ring.
1020
+
1021
+ This is useful as there can be precision loss issues (particularly
1022
+ with ``use_recurrence=False``).
1023
+
1024
+ - ``side`` -- ``'left'`` (default) or ``'right'``; if ``'left'``, the
1025
+ operator acts on the left on column vectors
1026
+
1027
+ EXAMPLES::
1028
+
1029
+ sage: OverconvergentModularForms(2, 0, 1/2).hecke_matrix(2, 4)
1030
+ [ 1 0 0 0]
1031
+ [ 0 24 64 0]
1032
+ [ 0 32 1152 4608]
1033
+ [ 0 0 3072 61440]
1034
+ sage: o = OverconvergentModularForms(2, 12, 1/2, base_ring=pAdicField(2))
1035
+ sage: o.hecke_matrix(2, 3) * (1 + O(2^2))
1036
+ [ 1 + O(2^2) 0 0]
1037
+ [ 0 2^3 + O(2^5) 2^6 + O(2^8)]
1038
+ [ 0 2^4 + O(2^6) 2^7 + 2^8 + O(2^9)]
1039
+ sage: o = OverconvergentModularForms(2, 12, 1/2, base_ring=pAdicField(2))
1040
+ sage: o.hecke_matrix(2, 3, exact_arith=True)
1041
+ [ 1 0 0]
1042
+ [ 0 33881928/1414477 64]
1043
+ [ 0 -192898739923312/2000745183529 1626332544/1414477]
1044
+
1045
+ Side switch::
1046
+
1047
+ sage: OverconvergentModularForms(2, 0, 1/2).hecke_matrix(2, 4, side='right')
1048
+ [ 1 0 0 0]
1049
+ [ 0 24 32 0]
1050
+ [ 0 64 1152 3072]
1051
+ [ 0 0 4608 61440]
1052
+ """
1053
+ if exact_arith and not self.base_ring().is_exact():
1054
+ return self.change_ring(QQ).hecke_matrix(m, n, use_recurrence, side=side)
1055
+
1056
+ M = MatrixSpace(self.base_ring(), n)
1057
+ mat = M(0)
1058
+ for j in range(min(n, self.prime())):
1059
+ l = self._convert_to_basis(self.hecke_operator(self._basis_cache[j], m))
1060
+ for i in range(n):
1061
+ try:
1062
+ mat[i, j] = l[i]
1063
+ except IndexError:
1064
+ if not self.weight().is_zero():
1065
+ raise ValueError("n is too large for current precision")
1066
+ else:
1067
+ if i <= self.prime() * j:
1068
+ raise ValueError("n is too large computing initial conds: can't work out u[%s, %s]" % (i, j))
1069
+ else:
1070
+ mat[i, j] = 0 # computations are exact for weight 0, and we know these terms are zero
1071
+ if use_recurrence:
1072
+ if m != self.prime():
1073
+ raise ValueError("Recurrence method not valid when m != p")
1074
+ for j in range(self.prime(), n):
1075
+ # can only apply recurrence if have i,j both >= p.
1076
+ if j >= self.prec():
1077
+ for i in range(self.prime()):
1078
+ if self.weight() != 0:
1079
+ raise ValueError("n is too large for current precision")
1080
+ else:
1081
+ if j <= self.prime() * i:
1082
+ raise ValueError("n is too large computing initial conds: can't work out u[%s,%s]" % (i, j))
1083
+ mat[i, j] = 0
1084
+
1085
+ else:
1086
+ l = self._convert_to_basis(self.hecke_operator(self._basis_cache[j], m))
1087
+ for i in range(self.prime()):
1088
+ mat[i, j] = l[i]
1089
+ for i in range(self.prime(), n):
1090
+ for u in range(self.prime()):
1091
+ for v in range(self.prime()):
1092
+ mat[i, j] = mat[i, j] + mat[i-u-1, j-v-1]*self.recurrence_matrix()[u, v]
1093
+
1094
+ else:
1095
+ if n * self.prime() > self.prec():
1096
+ raise ValueError("n is too large")
1097
+ for j in range(self.prime(), n):
1098
+ l = self._convert_to_basis(self.hecke_operator(self._basis_cache[j], m))
1099
+ for i in range(n):
1100
+ mat[i, j] = l[i]
1101
+
1102
+ if side == 'right':
1103
+ return mat.transpose()
1104
+
1105
+ return mat
1106
+
1107
+ def slopes(self, n, use_recurrence=False):
1108
+ r"""
1109
+ Compute the slopes of the `U_p` operator acting on ``self``, using an `n\times n` matrix.
1110
+
1111
+ EXAMPLES::
1112
+
1113
+ sage: OverconvergentModularForms(5, 2, 1/3, base_ring=Qp(5), prec=100).slopes(5)
1114
+ [0, 2, 5, 6, 9]
1115
+ sage: OverconvergentModularForms(2, 1, 1/3, char=DirichletGroup(4,QQ).0).slopes(5)
1116
+ [0, 2, 4, 6, 8]
1117
+ """
1118
+ if self.base_ring() == QQ:
1119
+ slopelist = self.cps_u(n).truncate().newton_slopes(self.prime())
1120
+ elif isinstance(self.base_ring(), sage.rings.abc.pAdicField):
1121
+ slopelist = self.cps_u(n).truncate().newton_slopes()
1122
+ else:
1123
+ print("slopes are only defined for base field QQ or a p-adic field")
1124
+ return [-i for i in slopelist]
1125
+
1126
+ def eigenfunctions(self, n, F=None, exact_arith=True):
1127
+ """
1128
+ Calculate approximations to eigenfunctions of ``self``.
1129
+
1130
+ These are the eigenfunctions of ``self.hecke_matrix(p, n)``, which
1131
+ are approximations to the true eigenfunctions. Returns a list
1132
+ of :class:`OverconvergentModularFormElement` objects, in increasing
1133
+ order of slope.
1134
+
1135
+ INPUT:
1136
+
1137
+ - ``n`` -- integer; the size of the matrix to use
1138
+
1139
+ - ``F`` -- either ``None`` or a field over which to calculate eigenvalues. If the
1140
+ field is ``None``, the current base ring is used. If the base ring is not
1141
+ a `p`-adic ring, an error will be raised.
1142
+
1143
+ - ``exact_arith`` -- boolean (default: ``True``); if ``True``, use exact
1144
+ rational arithmetic to calculate the matrix of the `U` operator and its
1145
+ characteristic power series, even when the base ring is an inexact
1146
+ `p`-adic ring. This is typically slower, but more numerically stable.
1147
+
1148
+ NOTE: Try using ``set_verbose(1, 'sage/modular/overconvergent')`` to
1149
+ get more feedback on what is going on in this algorithm. For even more
1150
+ feedback, use 2 instead of 1.
1151
+
1152
+ EXAMPLES::
1153
+
1154
+ sage: X = OverconvergentModularForms(2, 2, 1/6).eigenfunctions(8, Qp(2, 100))
1155
+ sage: X[1]
1156
+ 2-adic overconvergent modular form of weight-character 2 with q-expansion
1157
+ (1 + O(2^74))*q
1158
+ + (2^4 + 2^5 + 2^9 + 2^10 + 2^12 + 2^13 + 2^15 + 2^17 + 2^19 + 2^20
1159
+ + 2^21 + 2^23 + 2^28 + 2^30 + 2^31 + 2^32 + 2^34 + 2^36 + 2^37
1160
+ + 2^39 + 2^40 + 2^43 + 2^44 + 2^45 + 2^47 + 2^48 + 2^52 + 2^53
1161
+ + 2^54 + 2^55 + 2^56 + 2^58 + 2^59 + 2^60 + 2^61 + 2^67 + 2^68
1162
+ + 2^70 + 2^71 + 2^72 + 2^74 + 2^76 + O(2^78))*q^2
1163
+ + (2^2 + 2^7 + 2^8 + 2^9 + 2^12 + 2^13 + 2^16 + 2^17 + 2^21 + 2^23
1164
+ + 2^25 + 2^28 + 2^33 + 2^34 + 2^36 + 2^37 + 2^42 + 2^45 + 2^47
1165
+ + 2^49 + 2^50 + 2^51 + 2^54 + 2^55 + 2^58 + 2^60 + 2^61 + 2^67
1166
+ + 2^71 + 2^72 + O(2^76))*q^3
1167
+ + (2^8 + 2^11 + 2^14 + 2^19 + 2^21 + 2^22 + 2^24 + 2^25 + 2^26
1168
+ + 2^27 + 2^28 + 2^29 + 2^32 + 2^33 + 2^35 + 2^36 + 2^44 + 2^45
1169
+ + 2^46 + 2^47 + 2^49 + 2^50 + 2^53 + 2^54 + 2^55 + 2^56 + 2^57
1170
+ + 2^60 + 2^63 + 2^66 + 2^67 + 2^69 + 2^74 + 2^76 + 2^79 + 2^80
1171
+ + 2^81 + O(2^82))*q^4
1172
+ + (2 + 2^2 + 2^9 + 2^13 + 2^15 + 2^17 + 2^19 + 2^21 + 2^23 + 2^26
1173
+ + 2^27 + 2^28 + 2^30 + 2^33 + 2^34 + 2^35 + 2^36 + 2^37 + 2^38
1174
+ + 2^39 + 2^41 + 2^42 + 2^43 + 2^45 + 2^58 + 2^59 + 2^60 + 2^61
1175
+ + 2^62 + 2^63 + 2^65 + 2^66 + 2^68 + 2^69 + 2^71 + 2^72 + O(2^75))*q^5
1176
+ + (2^6 + 2^7 + 2^15 + 2^16 + 2^21 + 2^24 + 2^25 + 2^28 + 2^29 + 2^33
1177
+ + 2^34 + 2^37 + 2^44 + 2^45 + 2^48 + 2^50 + 2^51 + 2^54 + 2^55
1178
+ + 2^57 + 2^58 + 2^59 + 2^60 + 2^64 + 2^69 + 2^71 + 2^73 + 2^75
1179
+ + 2^78 + O(2^80))*q^6 + (2^3 + 2^8 + 2^9 + 2^10 + 2^11 + 2^12
1180
+ + 2^14 + 2^15 + 2^17 + 2^19 + 2^20 + 2^21 + 2^23 + 2^25 + 2^26
1181
+ + 2^34 + 2^37 + 2^38 + 2^39 + 2^40 + 2^41 + 2^45 + 2^47 + 2^49
1182
+ + 2^51 + 2^53 + 2^54 + 2^55 + 2^57 + 2^58 + 2^59 + 2^60 + 2^61
1183
+ + 2^66 + 2^69 + 2^70 + 2^71 + 2^74 + 2^76 + O(2^77))*q^7
1184
+ + O(q^8)
1185
+ sage: [x.slope() for x in X]
1186
+ [0, 4, 8, 14, 16, 18, 26, 30]
1187
+ """
1188
+
1189
+ if F is None:
1190
+ F = self.base_ring()
1191
+
1192
+ if F.is_exact():
1193
+ # raise TypeError("cannot calculate eigenfunctions over exact base fields")
1194
+ F = pAdicField(self.prime(), 100) # noqa:F821
1195
+
1196
+ m = self.hecke_matrix(self.prime(), n, use_recurrence=True, exact_arith=exact_arith)
1197
+ cp = m.charpoly()
1198
+ eigenvalues = cp.roots(F)
1199
+ eigenfunctions = []
1200
+ verbose("Expected %s eigenvalues, got %s" % (n, len(eigenvalues)))
1201
+ for (r, d) in eigenvalues:
1202
+ if d != 1:
1203
+ continue
1204
+
1205
+ mr = m.__pari__() - r.__pari__()
1206
+ # Annoying thing: r isn't quite as precise as it claims to be
1207
+ # (bug reported to sage-support list)
1208
+ while F(mr.matdet()) != 0:
1209
+ verbose("p-adic solver returned wrong result in slope %s; refining" % r.valuation(), level=2)
1210
+ r = r - cp(r)/cp.derivative()(r)
1211
+ mr2 = m.__pari__() - r.__pari__()
1212
+ if mr2.matdet().valuation(self.prime()) > mr.matdet().valuation(self.prime()):
1213
+ mr = mr2
1214
+ else:
1215
+ mr = None
1216
+ break
1217
+
1218
+ if mr is None:
1219
+ verbose("Unable to calculate exact root in slope %s" % r.valuation())
1220
+ continue
1221
+
1222
+ # now calculate the kernel using PARI
1223
+
1224
+ v = mr.matker()
1225
+
1226
+ if repr(v) == "[;]":
1227
+ verbose("PARI returned empty eigenspace in slope %s" % r.valuation())
1228
+ continue
1229
+ # Can't happen? Does PARI always return a
1230
+ # nonempty kernel for matrices that have det
1231
+ # indistinguishable from 0?
1232
+
1233
+ if v.ncols() != 1:
1234
+ verbose("PARI returned non-simple eigenspace in slope %s" % r.valuation())
1235
+ continue
1236
+
1237
+ gexp = self._gsr(0)
1238
+ for i in range(v.nrows()):
1239
+ gexp += self._gsr.gen()**i * F(v[i, 0])
1240
+ gexp = gexp + O(self._gsr.gen()**int(v.nrows()))
1241
+
1242
+ if gexp[0] != 0:
1243
+ gexp = gexp/gexp[0]
1244
+ elif gexp[1] != 0:
1245
+ gexp = gexp/gexp[1]/self._const
1246
+ # This is slightly subtle. We want all eigenfunctions to have q-exps in Z_p.
1247
+ # Normalising the q-term to be 1 doesn't work for the Eisenstein series if
1248
+ # we're in the 0 component of weight-character space. But normalising the const term
1249
+ # to 1 works as *none of the small primes we deal with are irregular*! :-)
1250
+ else:
1251
+ raise ValueError("Constant and linear terms both zero!")
1252
+ # if this gets called something is very wrong.
1253
+
1254
+ efunc = OverconvergentModularFormElement(self.base_extend(F), gexp=gexp)
1255
+ efunc._notify_eigen(r)
1256
+ assert efunc.is_integral()
1257
+ # This sometimes fails if n is too large -- last row of matrix fills
1258
+ # up with garbage. I don't know why. XXX FIX THIS XXX
1259
+ eigenfunctions.append((r.valuation(), efunc))
1260
+
1261
+ eigenfunctions.sort() # sort by slope
1262
+ return [f for _, f in eigenfunctions]
1263
+
1264
+ def recurrence_matrix(self, use_smithline=True):
1265
+ r"""
1266
+ Return the recurrence matrix satisfied by the coefficients of `U`.
1267
+
1268
+ This is a matrix `R =(r_{rs})_{r,s=1,\dots,p}` such that `u_{ij} =
1269
+ \sum_{r,s=1}^p r_{rs} u_{i-r, j-s}`.
1270
+
1271
+ Uses an elegant construction which the author believes to be due
1272
+ to Smithline. See [Loe2007]_.
1273
+
1274
+ EXAMPLES::
1275
+
1276
+ sage: OverconvergentModularForms(2, 0, 0).recurrence_matrix()
1277
+ [ 48 1]
1278
+ [4096 0]
1279
+ sage: OverconvergentModularForms(2, 0, 1/2).recurrence_matrix()
1280
+ [48 64]
1281
+ [64 0]
1282
+ sage: OverconvergentModularForms(3, 0, 0).recurrence_matrix()
1283
+ [ 270 36 1]
1284
+ [ 26244 729 0]
1285
+ [531441 0 0]
1286
+ sage: OverconvergentModularForms(5, 0, 0).recurrence_matrix()
1287
+ [ 1575 1300 315 30 1]
1288
+ [ 162500 39375 3750 125 0]
1289
+ [ 4921875 468750 15625 0 0]
1290
+ [ 58593750 1953125 0 0 0]
1291
+ [244140625 0 0 0 0]
1292
+ sage: OverconvergentModularForms(7, 0, 0).recurrence_matrix()
1293
+ [ 4018 8624 5915 1904 322 28 1]
1294
+ [ 422576 289835 93296 15778 1372 49 0]
1295
+ [ 14201915 4571504 773122 67228 2401 0 0]
1296
+ [ 224003696 37882978 3294172 117649 0 0 0]
1297
+ [ 1856265922 161414428 5764801 0 0 0 0]
1298
+ [ 7909306972 282475249 0 0 0 0 0]
1299
+ [13841287201 0 0 0 0 0 0]
1300
+ sage: OverconvergentModularForms(13, 0, 0).recurrence_matrix()
1301
+ [ 15145 124852 354536 ...
1302
+ """
1303
+
1304
+ if self._cached_recurrence_matrix is not None:
1305
+ return self._cached_recurrence_matrix
1306
+
1307
+ MM = OverconvergentModularForms(self.prime(), 0, 0, base_ring=QQ)
1308
+ m = MM._discover_recurrence_matrix(use_smithline=True).base_extend(self.base_ring())
1309
+
1310
+ r = diagonal_matrix([self._const**i for i in range(self.prime())])
1311
+ self._cached_recurrence_matrix = (r**(-1)) * m * r
1312
+ self._cached_recurrence_matrix.set_immutable()
1313
+ return self._cached_recurrence_matrix
1314
+
1315
+ def _discover_recurrence_matrix(self, use_smithline=True):
1316
+ r"""
1317
+ Do the hard work of calculating the recurrence matrix, which is cached
1318
+ to avoid doing this every time.
1319
+
1320
+ EXAMPLES::
1321
+
1322
+ sage: o = OverconvergentModularForms(3,12,0)
1323
+ sage: o._discover_recurrence_matrix() == o.recurrence_matrix()
1324
+ True
1325
+ """
1326
+
1327
+ (f_ring, f) = PolynomialRing(self.base_ring(), "f").objgen()
1328
+
1329
+ if use_smithline:
1330
+ # Compute Smithline's polynomial H_p
1331
+ jq = self._qsr(j_invariant_qexp(1 + self.prime()).shift(1).power_series()) # noqa:F821
1332
+
1333
+ # avoid dividing by q so as not to instantiate a Laurent series
1334
+ h = self._uniformiser.shift(-1) * jq
1335
+ fi = self._qsr(1)
1336
+ coeffs = []
1337
+ for i in range(self.prime() + 2):
1338
+ if not h.valuation() >= i:
1339
+ raise ValueError("Something strange is happening here")
1340
+
1341
+ coeffs.append(h[i] / fi[i])
1342
+ h = h - coeffs[-1] * fi
1343
+ fi = fi*self._uniformiser
1344
+ SmiH = f_ring(coeffs)
1345
+ assert SmiH.degree() == self.prime() + 1
1346
+ xyring = PolynomialRing(self.base_ring(), ["x", "y"], 2)
1347
+ x, y = xyring.gens()
1348
+ cc = self.prime() ** (-12/(self.prime() - 1))
1349
+ bigI = x*SmiH(y*cc) - y*cc*SmiH(x)
1350
+ smallI = xyring(bigI / (x - cc*y))
1351
+ r = matrix(ZZ, self.prime(), self.prime())
1352
+ for i in range(self.prime()):
1353
+ for j in range(self.prime()):
1354
+ r[i, j] = -smallI[i+1, j+1]
1355
+ return r
1356
+ else:
1357
+ # compute from U(f^j) for small j via Newton's identities
1358
+ # to be implemented when I can remember Newton's identities!
1359
+ raise NotImplementedError
1360
+
1361
+ def cps_u(self, n, use_recurrence=False):
1362
+ r"""
1363
+ Compute the characteristic power series of `U_p` acting on ``self``, using
1364
+ an `n\times n` matrix.
1365
+
1366
+ EXAMPLES::
1367
+
1368
+ sage: OverconvergentModularForms(3, 16, 1/2, base_ring=Qp(3)).cps_u(4)
1369
+ 1 + O(3^20)
1370
+ + (2 + 2*3 + 2*3^2 + 2*3^4 + 3^5 + 3^6 + 3^7
1371
+ + 3^11 + 3^12 + 2*3^14 + 3^16 + 3^18 + O(3^19))*T
1372
+ + (2*3^3 + 3^5 + 3^6 + 3^7 + 2*3^8 + 2*3^9 + 2*3^10
1373
+ + 3^11 + 3^12 + 2*3^13 + 2*3^16 + 2*3^18 + O(3^19))*T^2
1374
+ + (2*3^15 + 2*3^16 + 2*3^19 + 2*3^20 + 2*3^21 + O(3^22))*T^3
1375
+ + (3^17 + 2*3^18 + 3^19 + 3^20 + 3^22 + 2*3^23 + 2*3^25 + 3^26 + O(3^27))*T^4
1376
+ sage: OverconvergentModularForms(3, 16, 1/2, base_ring=Qp(3), prec=30).cps_u(10)
1377
+ 1 + O(3^20)
1378
+ + (2 + 2*3 + 2*3^2 + 2*3^4 + 3^5 + 3^6 + 3^7 + 2*3^15 + O(3^16))*T
1379
+ + (2*3^3 + 3^5 + 3^6 + 3^7 + 2*3^8 + 2*3^9 + 2*3^10
1380
+ + 2*3^11 + 2*3^12 + 2*3^13 + 3^14 + 3^15 + O(3^16))*T^2
1381
+ + (3^14 + 2*3^15 + 2*3^16 + 3^17 + 3^18 + O(3^19))*T^3
1382
+ + (3^17 + 2*3^18 + 3^19 + 3^20 + 3^21 + O(3^24))*T^4
1383
+ + (3^29 + 2*3^32 + O(3^33))*T^5
1384
+ + (2*3^44 + O(3^45))*T^6
1385
+ + (2*3^59 + O(3^60))*T^7
1386
+ + (2*3^78 + O(3^79))*T^8
1387
+
1388
+ .. NOTE::
1389
+
1390
+ Uses the Hessenberg form of the Hecke matrix to compute
1391
+ the characteristic polynomial. Because of the use of
1392
+ relative precision here this tends to give better
1393
+ precision in the `p`-adic coefficients.
1394
+ """
1395
+ m = self.hecke_matrix(self.prime(), n, use_recurrence)
1396
+ A = PowerSeriesRing(self.base_ring(), 'T')
1397
+
1398
+ # From a conversation with David Loeffler, apparently self.base_ring()
1399
+ # is either the field of rational numbers or some p-adic field. In the
1400
+ # first case we want to use the linbox algorithm, and in the second
1401
+ # case the Hessenberg form algorithm.
1402
+ #
1403
+ if self.base_ring().is_exact():
1404
+ g = A(m.charpoly('T').reverse())
1405
+ else:
1406
+ g = A(m.charpoly('T', "hessenberg").reverse())
1407
+
1408
+ return g
1409
+
1410
+
1411
+ class OverconvergentModularFormElement(ModuleElement):
1412
+ r"""
1413
+ A class representing an element of a space of overconvergent modular forms.
1414
+
1415
+ EXAMPLES::
1416
+
1417
+ sage: x = polygen(ZZ, 'x')
1418
+ sage: K.<w> = Qp(5).extension(x^7 - 5)
1419
+ sage: s = OverconvergentModularForms(5, 6, 1/21, base_ring=K).0
1420
+ sage: s == loads(dumps(s))
1421
+ True
1422
+ """
1423
+
1424
+ def __init__(self, parent, gexp=None, qexp=None):
1425
+ r"""
1426
+ Create an element of this space.
1427
+
1428
+ EXAMPLES::
1429
+
1430
+ sage: OverconvergentModularForms(3, 2, 1/6,prec=5).an_element() # indirect doctest
1431
+ 3-adic overconvergent modular form of weight-character 2
1432
+ with q-expansion 3*q + 72*q^2 + 810*q^3 + 6096*q^4 + O(q^5)
1433
+ """
1434
+ ModuleElement.__init__(self, parent)
1435
+
1436
+ self._p = self.parent().prime()
1437
+ # self.weight = self.parent().weight
1438
+ if (gexp is None and qexp is None) or (gexp is not None and qexp is not None):
1439
+ raise ValueError("Must supply exactly one of a q-expansion and a g-expansion")
1440
+ if gexp is not None:
1441
+ self._gexp = gexp.add_bigoh(self.parent().prec())
1442
+ self._qexp = sum([self.parent()._basis_cache[i] * gexp[i] for i in range(min(gexp.prec(), self.parent().prec()))])
1443
+ self._qexp = self._qexp.add_bigoh(self._gexp.prec())
1444
+ else: # qexp is not None
1445
+ self._qexp = qexp.add_bigoh(self.parent().prec())
1446
+ self._gexp = self.parent()._convert_to_basis(self._qexp)
1447
+
1448
+ self._is_eigen = False
1449
+ self._eigenvalue = None
1450
+ self._slope = None
1451
+
1452
+ def _add_(self, other):
1453
+ r"""
1454
+ Add ``self`` to ``other``.
1455
+
1456
+ Here ``other`` has the same parent as ``self``.
1457
+
1458
+ EXAMPLES::
1459
+
1460
+ sage: M = OverconvergentModularForms(2, 12, 1/6)
1461
+ sage: f = M.0
1462
+ sage: f + f # indirect doctest
1463
+ 2-adic overconvergent modular form of weight-character 12 with q-expansion 2 - 131040/1414477*q ...
1464
+ """
1465
+ return OverconvergentModularFormElement(self.parent(), gexp=self.gexp() + other.gexp())
1466
+
1467
+ def _lmul_(self, x):
1468
+ r"""
1469
+ Left multiplication by other.
1470
+
1471
+ EXAMPLES::
1472
+
1473
+ sage: M = OverconvergentModularForms(2, 12, 1/6)
1474
+ sage: f = M.0
1475
+ sage: 2*f # indirect doctest
1476
+ 2-adic overconvergent modular form of weight-character 12 with q-expansion 2 - 131040/1414477*q ...
1477
+ """
1478
+ return OverconvergentModularFormElement(self.parent(), gexp=x * self.gexp())
1479
+
1480
+ def _rmul_(self, x):
1481
+ r"""
1482
+ Right multiplication by other.
1483
+
1484
+ EXAMPLES::
1485
+
1486
+ sage: M = OverconvergentModularForms(2, 12, 1/6)
1487
+ sage: f = M.0
1488
+ sage: f * 3 # indirect doctest
1489
+ 2-adic overconvergent modular form of weight-character 12 with q-expansion 3 - 196560/1414477*q ...
1490
+ """
1491
+ return OverconvergentModularFormElement(self.parent(), gexp=x * self.gexp())
1492
+
1493
+ def prec(self):
1494
+ r"""
1495
+ Return the series expansion precision of this overconvergent modular form.
1496
+
1497
+ This is not the same as the `p`-adic precision of the coefficients.
1498
+
1499
+ EXAMPLES::
1500
+
1501
+ sage: OverconvergentModularForms(5, 6, 1/3, prec=15).gen(1).prec()
1502
+ 15
1503
+ """
1504
+ return self.gexp().prec()
1505
+
1506
+ def is_eigenform(self) -> bool:
1507
+ r"""
1508
+ Return ``True`` if this is an eigenform.
1509
+
1510
+ At present this returns ``False`` unless this element was explicitly
1511
+ flagged as an eigenform, using the method :meth:`_notify_eigen`.
1512
+
1513
+ EXAMPLES::
1514
+
1515
+ sage: M = OverconvergentModularForms(3, 0, 1/2)
1516
+ sage: f = M.eigenfunctions(3)[1]
1517
+ sage: f.is_eigenform()
1518
+ True
1519
+ sage: M.gen(4).is_eigenform()
1520
+ False
1521
+ """
1522
+ return self._is_eigen
1523
+
1524
+ def slope(self):
1525
+ r"""
1526
+ Return the slope of this eigenform.
1527
+
1528
+ This is the valuation of its `U_p`-eigenvalue.
1529
+
1530
+ Raises an error unless this element was explicitly
1531
+ flagged as an eigenform, using the method :meth:`_notify_eigen`.
1532
+
1533
+ EXAMPLES::
1534
+
1535
+ sage: M = OverconvergentModularForms(3, 0, 1/2)
1536
+ sage: f = M.eigenfunctions(3)[1]
1537
+ sage: f.slope()
1538
+ 2
1539
+ sage: M.gen(4).slope()
1540
+ Traceback (most recent call last):
1541
+ ...
1542
+ TypeError: slope only defined for eigenfunctions
1543
+ """
1544
+ if not self.is_eigenform():
1545
+ raise TypeError("slope only defined for eigenfunctions")
1546
+ return self._slope
1547
+
1548
+ def eigenvalue(self):
1549
+ r"""
1550
+ Return the `U_p`-eigenvalue of this eigenform.
1551
+
1552
+ This raises an error unless this element was explicitly flagged
1553
+ as an eigenform, using the method :meth:`_notify_eigen`.
1554
+
1555
+ EXAMPLES::
1556
+
1557
+ sage: M = OverconvergentModularForms(3, 0, 1/2)
1558
+ sage: f = M.eigenfunctions(3)[1]
1559
+ sage: f.eigenvalue()
1560
+ 3^2 + 3^4 + 2*3^6 + 3^7 + 3^8 + 2*3^9 + 2*3^10 + 3^12 + 3^16 + 2*3^17
1561
+ + 3^18 + 3^20 + 2*3^21 + 3^22 + 2*3^23 + 3^25 + 3^26 + 2*3^27 + 2*3^29
1562
+ + 3^30 + 3^31 + 3^32 + 3^33 + 3^34 + 3^36 + 3^40 + 2*3^41 + 3^43 + 3^44
1563
+ + 3^45 + 3^46 + 3^48 + 3^49 + 3^50 + 2*3^51 + 3^52 + 3^54 + 2*3^57
1564
+ + 2*3^59 + 3^60 + 3^61 + 2*3^63 + 2*3^66 + 2*3^67 + 3^69 + 2*3^72
1565
+ + 3^74 + 2*3^75 + 3^76 + 2*3^77 + 2*3^78 + 2*3^80 + 3^81 + 2*3^82
1566
+ + 3^84 + 2*3^85 + 2*3^86 + 3^87 + 3^88 + 2*3^89 + 2*3^91 + 3^93 + 3^94
1567
+ + 3^95 + 3^96 + 3^98 + 2*3^99 + O(3^100)
1568
+ sage: M.gen(4).eigenvalue()
1569
+ Traceback (most recent call last):
1570
+ ...
1571
+ TypeError: eigenvalue only defined for eigenfunctions
1572
+ """
1573
+ if not self.is_eigenform():
1574
+ raise TypeError("eigenvalue only defined for eigenfunctions")
1575
+ return self._eigenvalue
1576
+
1577
+ def q_expansion(self, prec=None):
1578
+ r"""
1579
+ Return the `q`-expansion of ``self``, to as high precision as it is known.
1580
+
1581
+ EXAMPLES::
1582
+
1583
+ sage: OverconvergentModularForms(3, 4, 1/2).gen(0).q_expansion()
1584
+ 1 - 120/13*q - 1080/13*q^2 - 120/13*q^3 - 8760/13*q^4 - 15120/13*q^5
1585
+ - 1080/13*q^6 - 41280/13*q^7 - 5400*q^8 - 120/13*q^9 - 136080/13*q^10
1586
+ - 159840/13*q^11 - 8760/13*q^12 - 263760/13*q^13 - 371520/13*q^14
1587
+ - 15120/13*q^15 - 561720/13*q^16 - 45360*q^17 - 1080/13*q^18
1588
+ - 823200/13*q^19 + O(q^20)
1589
+ """
1590
+ if prec is None:
1591
+ return self._qexp
1592
+ elif prec > self.prec():
1593
+ raise ValueError
1594
+ else:
1595
+ return self._qexp.add_bigoh(prec)
1596
+
1597
+ def gexp(self):
1598
+ r"""
1599
+ Return the formal power series in `g` corresponding to ``self``.
1600
+
1601
+ If this overconvergent modular form is `E_k^\ast \times F(g)`
1602
+ where `g` is the appropriately normalised parameter of `X_0(p)`,
1603
+ the result is `F`.
1604
+
1605
+ EXAMPLES::
1606
+
1607
+ sage: M = OverconvergentModularForms(3, 0, 1/2)
1608
+ sage: f = M.eigenfunctions(3)[1]
1609
+ sage: f.gexp()
1610
+ (3^-3 + O(3^95))*g
1611
+ + (3^-1 + 1 + 2*3 + 3^2 + 2*3^3 + 3^5 + 3^7 + 3^10 + 3^11 + 3^14 + 3^15
1612
+ + 3^16 + 2*3^19 + 3^21 + 3^22 + 2*3^23 + 2*3^24 + 3^26 + 2*3^27
1613
+ + 3^29 + 3^31 + 3^34 + 2*3^35 + 2*3^36 + 3^38 + 2*3^39 + 3^41 + 2*3^42
1614
+ + 2*3^43 + 2*3^44 + 2*3^46 + 2*3^47 + 3^48 + 2*3^49 + 2*3^50 + 3^51
1615
+ + 2*3^54 + 2*3^55 + 2*3^56 + 3^57 + 2*3^58 + 2*3^59 + 2*3^60 + 3^61
1616
+ + 3^62 + 3^63 + 3^64 + 2*3^65 + 3^67 + 3^68 + 2*3^69 + 3^70 + 2*3^71
1617
+ + 2*3^74 + 3^76 + 2*3^77 + 3^78 + 2*3^79 + 2*3^80 + 3^84 + 2*3^85
1618
+ + 2*3^86 + 3^88 + 2*3^89 + 3^91 + 3^92 + 2*3^94 + 3^95 + O(3^97))*g^2
1619
+ + O(g^3)
1620
+ """
1621
+ return self._gexp
1622
+
1623
+ def coordinates(self, prec=None):
1624
+ r"""
1625
+ Return the coordinates of this modular form in terms of the basis of this space.
1626
+
1627
+ EXAMPLES::
1628
+
1629
+ sage: M = OverconvergentModularForms(3, 0, 1/2, prec=15)
1630
+ sage: f = (M.0 + M.3); f.coordinates()
1631
+ [1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
1632
+ sage: f.coordinates(6)
1633
+ [1, 0, 0, 1, 0, 0]
1634
+ sage: OverconvergentModularForms(3, 0, 1/6)(f).coordinates(6)
1635
+ [1, 0, 0, 729, 0, 0]
1636
+ sage: f.coordinates(100)
1637
+ Traceback (most recent call last):
1638
+ ...
1639
+ ValueError: Precision too large for space
1640
+ """
1641
+ if prec > self.prec():
1642
+ raise ValueError("Precision too large for space")
1643
+ if prec is None:
1644
+ prec = self.prec()
1645
+ return self._gexp.padded_list(prec)
1646
+
1647
+ def prime(self):
1648
+ r"""
1649
+ If this is a `p`-adic modular form, return `p`.
1650
+
1651
+ EXAMPLES::
1652
+
1653
+ sage: OverconvergentModularForms(2, 0, 1/2).an_element().prime()
1654
+ 2
1655
+ """
1656
+ return self._p
1657
+
1658
+ def _notify_eigen(self, eigenvalue):
1659
+ """
1660
+ Flag this element as an eigenform.
1661
+
1662
+ It then remembers some extra data.
1663
+
1664
+ EXAMPLES::
1665
+
1666
+ sage: OverconvergentModularForms(3, 16, 1/3).eigenfunctions(4) # indirect doctest
1667
+ [...]
1668
+ """
1669
+ self._is_eigen = True
1670
+ self._eigenvalue = eigenvalue
1671
+ self._slope = eigenvalue.normalized_valuation()
1672
+
1673
+ def is_integral(self) -> bool:
1674
+ r"""
1675
+ Test whether this element has `q`-expansion coefficients that are `p`-adically integral.
1676
+
1677
+ This should always be the case with eigenfunctions, but sometimes
1678
+ if `n` is very large this breaks down for unknown reasons!
1679
+
1680
+ EXAMPLES::
1681
+
1682
+ sage: M = OverconvergentModularForms(2, 0, 1/3)
1683
+ sage: q = QQ[['q']].gen()
1684
+ sage: M(q - 17*q^2 + O(q^3)).is_integral()
1685
+ True
1686
+ sage: M(q - q^2/2 + 6*q^7 + O(q^9)).is_integral()
1687
+ False
1688
+ """
1689
+ for co in self.q_expansion().list():
1690
+ if (co * (1 + O(self.prime()))).valuation() < 0: # have to force it into ZZ_p
1691
+ return False
1692
+ return True
1693
+
1694
+ def _repr_(self) -> str:
1695
+ r"""
1696
+ String representation of ``self``.
1697
+
1698
+ EXAMPLES::
1699
+
1700
+ sage: o = OverconvergentModularForms(3, 0, 1/2)
1701
+ sage: o([1, 0, 1, 3])._repr_()
1702
+ '3-adic overconvergent modular form of weight-character 0 with q-expansion 1 + 729*q^2 + 76545*q^3 + O(q^4)'
1703
+ """
1704
+ return "%s-adic overconvergent modular form of weight-character %s with q-expansion %s" % (self.prime(), self.weight(), self.q_expansion())
1705
+
1706
+ def _richcmp_(self, other, op):
1707
+ r"""
1708
+ Compare ``self`` to ``other``.
1709
+
1710
+ EXAMPLES::
1711
+
1712
+ sage: o = OverconvergentModularForms(3, 0, 1/2)
1713
+ sage: o([1, 1, 1, 0, 0, 0, 0]) == o([2, 1, 0])
1714
+ False
1715
+ sage: o([1, 1, 1, 0, 0, 0, 0]) == o([1,1])
1716
+ True
1717
+ """
1718
+ return richcmp(self.gexp(), other.gexp(), op)
1719
+
1720
+ def r_ord(self, r):
1721
+ r"""
1722
+ The `p`-adic valuation of the norm of ``self`` on the `r`-overconvergent region.
1723
+
1724
+ EXAMPLES::
1725
+
1726
+ sage: o = OverconvergentModularForms(3, 0, 1/2)
1727
+ sage: t = o([1, 1, 1/3])
1728
+ sage: t.r_ord(1/2)
1729
+ 1
1730
+ sage: t.r_ord(2/3)
1731
+ 3
1732
+ """
1733
+ ord = -Infinity
1734
+ p = self.prime()
1735
+ s = self.parent().radius()
1736
+
1737
+ F = self.parent().base_ring()
1738
+ if not isinstance(F, sage.rings.abc.pAdicField):
1739
+ F = pAdicField(p) # noqa:F821
1740
+
1741
+ for i in range(self.prec()):
1742
+ ord = max(ord, 12/ZZ(p - 1)*i*(r - s) - F(self.gexp()[i]).normalized_valuation())
1743
+
1744
+ return ord
1745
+
1746
+ def valuation(self):
1747
+ r"""
1748
+ Return the `p`-adic valuation of this form.
1749
+
1750
+ This is the minimum of the `p`-adic valuations of its coordinates.
1751
+
1752
+ EXAMPLES::
1753
+
1754
+ sage: M = OverconvergentModularForms(3, 0, 1/2)
1755
+ sage: (M.7).valuation()
1756
+ 0
1757
+ sage: (3^18 * (M.2)).valuation()
1758
+ 18
1759
+ """
1760
+ if isinstance(self.parent().base_ring(), sage.rings.abc.pAdicField):
1761
+ v = lambda u: u.normalized_valuation()
1762
+ else:
1763
+ v = lambda u: u.valuation(self.parent().prime())
1764
+ return min([v(x) for x in self.gexp().list()])
1765
+
1766
+ def governing_term(self, r):
1767
+ r"""
1768
+ The degree of the series term with largest norm on the `r`-overconvergent region.
1769
+
1770
+ EXAMPLES::
1771
+
1772
+ sage: o = OverconvergentModularForms(3, 0, 1/2)
1773
+ sage: f = o.eigenfunctions(10)[1]
1774
+ sage: f.governing_term(1/2)
1775
+ 1
1776
+ """
1777
+ p = self.prime()
1778
+ F = self.parent().base_ring()
1779
+ if not isinstance(F, sage.rings.abc.pAdicField):
1780
+ F = pAdicField(p) # noqa:F821
1781
+ s = self.parent().radius()
1782
+ p = self.prime()
1783
+
1784
+ for i in range(self.gexp().prec()):
1785
+ if 12/ZZ(p - 1)*i*(r - s) - F(self.gexp()[i]).normalized_valuation() == self.r_ord(r):
1786
+ return i
1787
+ raise RuntimeError("Can't get here")
1788
+
1789
+ def valuation_plot(self, rmax=None):
1790
+ r"""
1791
+ Draw a graph depicting the growth of the norm of this overconvergent
1792
+ modular form as it approaches the boundary of the overconvergent
1793
+ region.
1794
+
1795
+ EXAMPLES::
1796
+
1797
+ sage: o = OverconvergentModularForms(3, 0, 1/2)
1798
+ sage: f = o.eigenfunctions(4)[1]
1799
+ sage: f.valuation_plot() # needs sage.plot
1800
+ Graphics object consisting of 1 graphics primitive
1801
+ """
1802
+ from sage.plot.plot import plot
1803
+
1804
+ if rmax is None:
1805
+ rmax = ZZ(self.prime()) / ZZ(1 + self.prime())
1806
+ return plot(self.r_ord, (0, rmax))
1807
+
1808
+ def weight(self):
1809
+ r"""
1810
+ Return the weight of this overconvergent modular form.
1811
+
1812
+ EXAMPLES::
1813
+
1814
+ sage: x = polygen(ZZ, 'x')
1815
+ sage: R = Qp(13).extension(x^2 - 13, names='a')
1816
+ sage: M = OverconvergentModularForms(13, 10, 1/2, base_ring=R)
1817
+ sage: M.gen(0).weight()
1818
+ 10
1819
+ """
1820
+ return self.parent().weight()
1821
+
1822
+ def additive_order(self):
1823
+ r"""
1824
+ Return the additive order of this element.
1825
+
1826
+ This implements a required method for all
1827
+ elements deriving from :class:`sage.modules.ModuleElement`.
1828
+
1829
+ EXAMPLES::
1830
+
1831
+ sage: x = polygen(ZZ, 'x')
1832
+ sage: R = Qp(13).extension(x^2 - 13, names='a')
1833
+ sage: M = OverconvergentModularForms(13, 10, 1/2, base_ring=R)
1834
+ sage: M.gen(0).additive_order()
1835
+ +Infinity
1836
+ sage: M(0).additive_order()
1837
+ 1
1838
+ """
1839
+ from sage.rings.infinity import Infinity
1840
+ if self.is_zero():
1841
+ return ZZ(1)
1842
+ else:
1843
+ return Infinity
1844
+
1845
+ def base_extend(self, R):
1846
+ r"""
1847
+ Return a copy of ``self`` but with coefficients in the given ring.
1848
+
1849
+ EXAMPLES::
1850
+
1851
+ sage: M = OverconvergentModularForms(7, 10, 1/2, prec=5)
1852
+ sage: f = M.1
1853
+ sage: f.base_extend(Qp(7, 4))
1854
+ 7-adic overconvergent modular form of weight-character 10 with q-expansion
1855
+ (7 + O(7^5))*q + (6*7 + 4*7^2 + 7^3 + 6*7^4 + O(7^5))*q^2
1856
+ + (5*7 + 5*7^2 + 7^4 + O(7^5))*q^3 + (7^2 + 4*7^3 + 3*7^4 + 2*7^5
1857
+ + O(7^6))*q^4 + O(q^5)
1858
+ """
1859
+ S = self.parent().base_extend(R)
1860
+ return S(self)
1861
+
1862
+ def __pari__(self):
1863
+ r"""
1864
+ Return the Pari object corresponding to ``self``.
1865
+
1866
+ This is just the `q`-expansion of ``self`` as a formal power series.
1867
+
1868
+ EXAMPLES::
1869
+
1870
+ sage: f = OverconvergentModularForms(3, 0, 1/2).1
1871
+ sage: pari(f) # indirect doctest
1872
+ 27*q + 324*q^2 + 2430*q^3 + 13716*q^4 + 64557*q^5 + 265356*q^6 + 983556*q^7 + 3353076*q^8 + 10670373*q^9 + 32031288*q^10 + 91455804*q^11 + 249948828*q^12 + 657261999*q^13 + 1669898592*q^14 + 4113612864*q^15 + 9853898292*q^16 + 23010586596*q^17 + 52494114852*q^18 + 117209543940*q^19 + O(q^20)
1873
+ sage: pari(f.base_extend(Qp(3))) # indirect doctest
1874
+ (3^3 + O(3^23))*q + (3^4 + 3^5 + O(3^24))*q^2 + (3^5 + 3^7 + O(3^25))*q^3 + (3^3 + 3^4 + 2*3^5 + 2*3^8 + O(3^23))*q^4 + (2*3^4 + 3^5 + 3^6 + 2*3^7 + 3^10 + O(3^24))*q^5 + (3^6 + 3^7 + 3^8 + 3^9 + 3^10 + 3^11 + O(3^26))*q^6 + (2*3^3 + 3^4 + 2*3^6 + 2*3^7 + 2*3^8 + 3^9 + 3^10 + 2*3^11 + 3^12 + O(3^23))*q^7 + (2*3^4 + 3^5 + 3^8 + 2*3^9 + 2*3^10 + 2*3^13 + O(3^24))*q^8 + (3^7 + 2*3^9 + 2*3^12 + 2*3^14 + O(3^27))*q^9 + (2*3^5 + 3^8 + 3^9 + 2*3^10 + 2*3^13 + 2*3^15 + O(3^25))*q^10 + (3^4 + 2*3^5 + 2*3^6 + 3^8 + 2*3^9 + 3^12 + 3^14 + 2*3^16 + O(3^24))*q^11 + (3^5 + 3^6 + 2*3^8 + 2*3^9 + 2*3^10 + 2*3^12 + 3^14 + 2*3^15 + 2*3^16 + 3^17 + O(3^25))*q^12 + (2*3^3 + 2*3^4 + 2*3^5 + 3^8 + 2*3^9 + 2*3^11 + 3^13 + 2*3^14 + 2*3^17 + 3^18 + O(3^23))*q^13 + (2*3^4 + 2*3^6 + 2*3^7 + 3^8 + 2*3^9 + 3^10 + 3^12 + 3^14 + 2*3^15 + 2*3^16 + 3^18 + 3^19 + O(3^24))*q^14 + (2*3^6 + 3^7 + 3^9 + 3^10 + 3^11 + 2*3^14 + 3^15 + 2*3^16 + 3^17 + 3^18 + 3^20 + O(3^26))*q^15 + (3^3 + 2*3^4 + 2*3^7 + 2*3^8 + 3^9 + 3^10 + 2*3^11 + 3^12 + 2*3^14 + 2*3^15 + 3^17 + 3^18 + 2*3^19 + 2*3^20 + O(3^23))*q^16 + (2*3^5 + 2*3^7 + 2*3^8 + 3^10 + 3^11 + 2*3^12 + 2*3^13 + 3^14 + 3^15 + 3^17 + 2*3^18 + 3^19 + 2*3^21 + O(3^25))*q^17 + (3^8 + 3^9 + 2*3^10 + 2*3^11 + 3^12 + 3^14 + 3^15 + 3^16 + 3^17 + 2*3^21 + 3^22 + O(3^28))*q^18 + (2*3^3 + 3^5 + 2*3^6 + 2*3^8 + 2*3^9 + 3^11 + 2*3^12 + 3^13 + 3^14 + 2*3^15 + 3^16 + 3^17 + 2*3^18 + 3^19 + 2*3^21 + O(3^23))*q^19 + O(q^20)
1875
+ """
1876
+ return self.q_expansion().__pari__()
1877
+
1878
+
1879
+ OverconvergentModularFormsSpace.Element = OverconvergentModularFormElement