passagemath-schemes 10.6.38__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.

Potentially problematic release.


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

Files changed (314) hide show
  1. passagemath_schemes/.dylibs/libflint.21.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.38.dist-info/METADATA +204 -0
  7. passagemath_schemes-10.6.38.dist-info/METADATA.bak +205 -0
  8. passagemath_schemes-10.6.38.dist-info/RECORD +314 -0
  9. passagemath_schemes-10.6.38.dist-info/WHEEL +6 -0
  10. passagemath_schemes-10.6.38.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-314t-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-314t-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-314t-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-314t-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-314t-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-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 +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-314t-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-314t-darwin.so +0 -0
  148. sage/modular/modsym/manin_symbol.pxd +5 -0
  149. sage/modular/modsym/manin_symbol.pyx +497 -0
  150. sage/modular/modsym/manin_symbol_list.py +1295 -0
  151. sage/modular/modsym/modsym.py +400 -0
  152. sage/modular/modsym/modular_symbols.py +384 -0
  153. sage/modular/modsym/p1list.cpython-314t-darwin.so +0 -0
  154. sage/modular/modsym/p1list.pxd +29 -0
  155. sage/modular/modsym/p1list.pyx +1372 -0
  156. sage/modular/modsym/p1list_nf.py +1241 -0
  157. sage/modular/modsym/relation_matrix.py +591 -0
  158. sage/modular/modsym/relation_matrix_pyx.cpython-314t-darwin.so +0 -0
  159. sage/modular/modsym/relation_matrix_pyx.pyx +108 -0
  160. sage/modular/modsym/space.py +2468 -0
  161. sage/modular/modsym/subspace.py +455 -0
  162. sage/modular/modsym/tests.py +375 -0
  163. sage/modular/multiple_zeta.py +2632 -0
  164. sage/modular/multiple_zeta_F_algebra.py +786 -0
  165. sage/modular/overconvergent/all.py +6 -0
  166. sage/modular/overconvergent/genus0.py +1878 -0
  167. sage/modular/overconvergent/hecke_series.py +1187 -0
  168. sage/modular/overconvergent/weightspace.py +778 -0
  169. sage/modular/pollack_stevens/all.py +4 -0
  170. sage/modular/pollack_stevens/distributions.py +874 -0
  171. sage/modular/pollack_stevens/fund_domain.py +1572 -0
  172. sage/modular/pollack_stevens/manin_map.py +859 -0
  173. sage/modular/pollack_stevens/modsym.py +1593 -0
  174. sage/modular/pollack_stevens/padic_lseries.py +417 -0
  175. sage/modular/pollack_stevens/sigma0.py +534 -0
  176. sage/modular/pollack_stevens/space.py +1076 -0
  177. sage/modular/quasimodform/all.py +3 -0
  178. sage/modular/quasimodform/element.py +845 -0
  179. sage/modular/quasimodform/ring.py +828 -0
  180. sage/modular/quatalg/all.py +3 -0
  181. sage/modular/quatalg/brandt.py +1642 -0
  182. sage/modular/ssmod/all.py +8 -0
  183. sage/modular/ssmod/ssmod.py +827 -0
  184. sage/rings/all__sagemath_schemes.py +1 -0
  185. sage/rings/polynomial/all__sagemath_schemes.py +1 -0
  186. sage/rings/polynomial/binary_form_reduce.py +585 -0
  187. sage/schemes/all.py +41 -0
  188. sage/schemes/berkovich/all.py +6 -0
  189. sage/schemes/berkovich/berkovich_cp_element.py +2582 -0
  190. sage/schemes/berkovich/berkovich_space.py +748 -0
  191. sage/schemes/curves/affine_curve.py +2928 -0
  192. sage/schemes/curves/all.py +33 -0
  193. sage/schemes/curves/closed_point.py +434 -0
  194. sage/schemes/curves/constructor.py +381 -0
  195. sage/schemes/curves/curve.py +542 -0
  196. sage/schemes/curves/plane_curve_arrangement.py +1283 -0
  197. sage/schemes/curves/point.py +463 -0
  198. sage/schemes/curves/projective_curve.py +3026 -0
  199. sage/schemes/curves/zariski_vankampen.py +1932 -0
  200. sage/schemes/cyclic_covers/all.py +2 -0
  201. sage/schemes/cyclic_covers/charpoly_frobenius.py +320 -0
  202. sage/schemes/cyclic_covers/constructor.py +137 -0
  203. sage/schemes/cyclic_covers/cycliccover_finite_field.py +1309 -0
  204. sage/schemes/cyclic_covers/cycliccover_generic.py +310 -0
  205. sage/schemes/elliptic_curves/BSD.py +1036 -0
  206. sage/schemes/elliptic_curves/Qcurves.py +592 -0
  207. sage/schemes/elliptic_curves/addition_formulas_ring.py +94 -0
  208. sage/schemes/elliptic_curves/all.py +49 -0
  209. sage/schemes/elliptic_curves/cardinality.py +609 -0
  210. sage/schemes/elliptic_curves/cm.py +1102 -0
  211. sage/schemes/elliptic_curves/constructor.py +1552 -0
  212. sage/schemes/elliptic_curves/ec_database.py +175 -0
  213. sage/schemes/elliptic_curves/ell_curve_isogeny.py +3972 -0
  214. sage/schemes/elliptic_curves/ell_egros.py +459 -0
  215. sage/schemes/elliptic_curves/ell_field.py +2836 -0
  216. sage/schemes/elliptic_curves/ell_finite_field.py +3359 -0
  217. sage/schemes/elliptic_curves/ell_generic.py +3760 -0
  218. sage/schemes/elliptic_curves/ell_local_data.py +1207 -0
  219. sage/schemes/elliptic_curves/ell_modular_symbols.py +775 -0
  220. sage/schemes/elliptic_curves/ell_number_field.py +4220 -0
  221. sage/schemes/elliptic_curves/ell_padic_field.py +107 -0
  222. sage/schemes/elliptic_curves/ell_point.py +4787 -0
  223. sage/schemes/elliptic_curves/ell_rational_field.py +7368 -0
  224. sage/schemes/elliptic_curves/ell_tate_curve.py +671 -0
  225. sage/schemes/elliptic_curves/ell_torsion.py +436 -0
  226. sage/schemes/elliptic_curves/ell_wp.py +352 -0
  227. sage/schemes/elliptic_curves/formal_group.py +760 -0
  228. sage/schemes/elliptic_curves/gal_reps.py +1459 -0
  229. sage/schemes/elliptic_curves/gal_reps_number_field.py +1669 -0
  230. sage/schemes/elliptic_curves/gp_simon.py +152 -0
  231. sage/schemes/elliptic_curves/heegner.py +7335 -0
  232. sage/schemes/elliptic_curves/height.py +2109 -0
  233. sage/schemes/elliptic_curves/hom.py +1406 -0
  234. sage/schemes/elliptic_curves/hom_composite.py +934 -0
  235. sage/schemes/elliptic_curves/hom_frobenius.py +522 -0
  236. sage/schemes/elliptic_curves/hom_scalar.py +531 -0
  237. sage/schemes/elliptic_curves/hom_sum.py +682 -0
  238. sage/schemes/elliptic_curves/hom_velusqrt.py +1290 -0
  239. sage/schemes/elliptic_curves/homset.py +271 -0
  240. sage/schemes/elliptic_curves/isogeny_class.py +1521 -0
  241. sage/schemes/elliptic_curves/isogeny_small_degree.py +2797 -0
  242. sage/schemes/elliptic_curves/jacobian.py +237 -0
  243. sage/schemes/elliptic_curves/kodaira_symbol.py +344 -0
  244. sage/schemes/elliptic_curves/kraus.py +1014 -0
  245. sage/schemes/elliptic_curves/lseries_ell.py +943 -0
  246. sage/schemes/elliptic_curves/mod5family.py +105 -0
  247. sage/schemes/elliptic_curves/mod_poly.py +197 -0
  248. sage/schemes/elliptic_curves/mod_sym_num.cpython-314t-darwin.so +0 -0
  249. sage/schemes/elliptic_curves/mod_sym_num.pyx +3796 -0
  250. sage/schemes/elliptic_curves/modular_parametrization.py +305 -0
  251. sage/schemes/elliptic_curves/padic_lseries.py +1793 -0
  252. sage/schemes/elliptic_curves/padics.py +1816 -0
  253. sage/schemes/elliptic_curves/period_lattice.py +2234 -0
  254. sage/schemes/elliptic_curves/period_lattice_region.cpython-314t-darwin.so +0 -0
  255. sage/schemes/elliptic_curves/period_lattice_region.pyx +722 -0
  256. sage/schemes/elliptic_curves/saturation.py +715 -0
  257. sage/schemes/elliptic_curves/sha_tate.py +1158 -0
  258. sage/schemes/elliptic_curves/weierstrass_morphism.py +1117 -0
  259. sage/schemes/elliptic_curves/weierstrass_transform.py +200 -0
  260. sage/schemes/hyperelliptic_curves/all.py +6 -0
  261. sage/schemes/hyperelliptic_curves/constructor.py +291 -0
  262. sage/schemes/hyperelliptic_curves/hyperelliptic_finite_field.py +1914 -0
  263. sage/schemes/hyperelliptic_curves/hyperelliptic_g2.py +192 -0
  264. sage/schemes/hyperelliptic_curves/hyperelliptic_generic.py +954 -0
  265. sage/schemes/hyperelliptic_curves/hyperelliptic_padic_field.py +1332 -0
  266. sage/schemes/hyperelliptic_curves/hyperelliptic_rational_field.py +84 -0
  267. sage/schemes/hyperelliptic_curves/invariants.py +410 -0
  268. sage/schemes/hyperelliptic_curves/jacobian_endomorphism_utils.py +315 -0
  269. sage/schemes/hyperelliptic_curves/jacobian_g2.py +32 -0
  270. sage/schemes/hyperelliptic_curves/jacobian_generic.py +419 -0
  271. sage/schemes/hyperelliptic_curves/jacobian_homset.py +186 -0
  272. sage/schemes/hyperelliptic_curves/jacobian_morphism.py +875 -0
  273. sage/schemes/hyperelliptic_curves/kummer_surface.py +99 -0
  274. sage/schemes/hyperelliptic_curves/mestre.py +302 -0
  275. sage/schemes/hyperelliptic_curves/monsky_washnitzer.py +3871 -0
  276. sage/schemes/jacobians/abstract_jacobian.py +277 -0
  277. sage/schemes/jacobians/all.py +2 -0
  278. sage/schemes/overview.py +161 -0
  279. sage/schemes/plane_conics/all.py +22 -0
  280. sage/schemes/plane_conics/con_field.py +1296 -0
  281. sage/schemes/plane_conics/con_finite_field.py +158 -0
  282. sage/schemes/plane_conics/con_number_field.py +456 -0
  283. sage/schemes/plane_conics/con_rational_field.py +406 -0
  284. sage/schemes/plane_conics/con_rational_function_field.py +580 -0
  285. sage/schemes/plane_conics/constructor.py +249 -0
  286. sage/schemes/plane_quartics/all.py +2 -0
  287. sage/schemes/plane_quartics/quartic_constructor.py +71 -0
  288. sage/schemes/plane_quartics/quartic_generic.py +73 -0
  289. sage/schemes/riemann_surfaces/all.py +1 -0
  290. sage/schemes/riemann_surfaces/riemann_surface.py +4117 -0
  291. sage_wheels/share/cremona/cremona_mini.db +0 -0
  292. sage_wheels/share/ellcurves/rank0 +30427 -0
  293. sage_wheels/share/ellcurves/rank1 +31871 -0
  294. sage_wheels/share/ellcurves/rank10 +6 -0
  295. sage_wheels/share/ellcurves/rank11 +6 -0
  296. sage_wheels/share/ellcurves/rank12 +1 -0
  297. sage_wheels/share/ellcurves/rank14 +1 -0
  298. sage_wheels/share/ellcurves/rank15 +1 -0
  299. sage_wheels/share/ellcurves/rank17 +1 -0
  300. sage_wheels/share/ellcurves/rank19 +1 -0
  301. sage_wheels/share/ellcurves/rank2 +2388 -0
  302. sage_wheels/share/ellcurves/rank20 +1 -0
  303. sage_wheels/share/ellcurves/rank21 +1 -0
  304. sage_wheels/share/ellcurves/rank22 +1 -0
  305. sage_wheels/share/ellcurves/rank23 +1 -0
  306. sage_wheels/share/ellcurves/rank24 +1 -0
  307. sage_wheels/share/ellcurves/rank28 +1 -0
  308. sage_wheels/share/ellcurves/rank3 +836 -0
  309. sage_wheels/share/ellcurves/rank4 +10 -0
  310. sage_wheels/share/ellcurves/rank5 +5 -0
  311. sage_wheels/share/ellcurves/rank6 +5 -0
  312. sage_wheels/share/ellcurves/rank7 +5 -0
  313. sage_wheels/share/ellcurves/rank8 +6 -0
  314. sage_wheels/share/ellcurves/rank9 +7 -0
@@ -0,0 +1,815 @@
1
+ # sage_setup: distribution = sagemath-schemes
2
+ # sage.doctest: needs sage.libs.pari
3
+ r"""
4
+ Ambient spaces of modular forms
5
+
6
+ EXAMPLES:
7
+
8
+ We compute a basis for the ambient space
9
+ `M_2(\Gamma_1(25),\chi)`, where `\chi` is
10
+ quadratic.
11
+
12
+ ::
13
+
14
+ sage: chi = DirichletGroup(25,QQ).0; chi
15
+ Dirichlet character modulo 25 of conductor 5 mapping 2 |--> -1
16
+ sage: n = ModularForms(chi,2); n
17
+ Modular Forms space of dimension 6, character [-1] and weight 2 over Rational Field
18
+ sage: type(n)
19
+ <class 'sage.modular.modform.ambient_eps.ModularFormsAmbient_eps_with_category'>
20
+
21
+ Compute a basis::
22
+
23
+ sage: n.basis()
24
+ [1 + O(q^6),
25
+ q + O(q^6),
26
+ q^2 + O(q^6),
27
+ q^3 + O(q^6),
28
+ q^4 + O(q^6),
29
+ q^5 + O(q^6)]
30
+
31
+ Compute the same basis but to higher precision::
32
+
33
+ sage: n.set_precision(20)
34
+ sage: n.basis()
35
+ [1 + 10*q^10 + 20*q^15 + O(q^20),
36
+ q + 5*q^6 + q^9 + 12*q^11 - 3*q^14 + 17*q^16 + 8*q^19 + O(q^20),
37
+ q^2 + 4*q^7 - q^8 + 8*q^12 + 2*q^13 + 10*q^17 - 5*q^18 + O(q^20),
38
+ q^3 + q^7 + 3*q^8 - q^12 + 5*q^13 + 3*q^17 + 6*q^18 + O(q^20),
39
+ q^4 - q^6 + 2*q^9 + 3*q^14 - 2*q^16 + 4*q^19 + O(q^20),
40
+ q^5 + q^10 + 2*q^15 + O(q^20)]
41
+
42
+ TESTS::
43
+
44
+ sage: m = ModularForms(Gamma1(20),2,GF(7))
45
+ sage: loads(dumps(m)) == m
46
+ True
47
+
48
+ ::
49
+
50
+ sage: m = ModularForms(GammaH(11,[3]), 2); m
51
+ Modular Forms space of dimension 2 for Congruence Subgroup Gamma_H(11) with H generated by [3] of weight 2 over Rational Field
52
+ sage: type(m)
53
+ <class 'sage.modular.modform.ambient_g1.ModularFormsAmbient_gH_Q_with_category'>
54
+ sage: m == loads(dumps(m))
55
+ True
56
+ """
57
+
58
+ # ****************************************************************************
59
+ # Copyright (C) 2006 William Stein <wstein@gmail.com>
60
+ #
61
+ # This program is free software: you can redistribute it and/or modify
62
+ # it under the terms of the GNU General Public License as published by
63
+ # the Free Software Foundation, either version 2 of the License, or
64
+ # (at your option) any later version.
65
+ # https://www.gnu.org/licenses/
66
+ # ****************************************************************************
67
+
68
+ from sage.arith.misc import is_prime, sigma
69
+ from sage.matrix.constructor import matrix
70
+ from sage.misc.cachefunc import cached_method
71
+ from sage.modular.arithgroup.all import CongruenceSubgroupBase, Gamma0_class, Gamma1_class
72
+ from sage.modular.dirichlet import TrivialCharacter
73
+ from sage.modular.hecke.ambient_module import AmbientHeckeModule
74
+ from sage.modular.modsym.modsym import ModularSymbols
75
+ from sage.modules.free_module import VectorSpace
76
+ from sage.rings.integer import Integer
77
+ from sage.structure.sequence import Sequence
78
+
79
+ from . import defaults
80
+ from . import eisenstein_submodule
81
+ from . import eis_series
82
+ from . import space
83
+ from . import submodule
84
+
85
+
86
+ class ModularFormsAmbient(space.ModularFormsSpace,
87
+ AmbientHeckeModule):
88
+ """
89
+ An ambient space of modular forms.
90
+ """
91
+ def __init__(self, group, weight, base_ring, character=None, eis_only=False):
92
+ """
93
+ Create an ambient space of modular forms.
94
+
95
+ EXAMPLES::
96
+
97
+ sage: m = ModularForms(Gamma1(20),20); m
98
+ Modular Forms space of dimension 238 for Congruence Subgroup Gamma1(20) of weight 20 over Rational Field
99
+ sage: m.is_ambient()
100
+ True
101
+ """
102
+ if not isinstance(group, CongruenceSubgroupBase):
103
+ raise TypeError('group (=%s) must be a congruence subgroup' % group)
104
+ weight = Integer(weight)
105
+
106
+ if character is None and isinstance(group, Gamma0_class):
107
+ character = TrivialCharacter(group.level(), base_ring)
108
+
109
+ self._eis_only = eis_only
110
+ space.ModularFormsSpace.__init__(self, group, weight, character, base_ring)
111
+ if eis_only:
112
+ d = self._dim_eisenstein()
113
+ else:
114
+ d = self.dimension()
115
+ AmbientHeckeModule.__init__(self, base_ring, d, group.level(), weight)
116
+
117
+ def _repr_(self):
118
+ """
119
+ Return string representation of ``self``.
120
+
121
+ EXAMPLES::
122
+
123
+ sage: m = ModularForms(Gamma1(20),100); m._repr_()
124
+ 'Modular Forms space of dimension 1198 for Congruence Subgroup Gamma1(20) of weight 100 over Rational Field'
125
+
126
+ The output of _repr_ is not affected by renaming the space::
127
+
128
+ sage: m.rename('A big modform space')
129
+ sage: m
130
+ A big modform space
131
+ sage: m._repr_()
132
+ 'Modular Forms space of dimension 1198 for Congruence Subgroup Gamma1(20) of weight 100 over Rational Field'
133
+ """
134
+ if self._eis_only:
135
+ return "Modular Forms space for %s of weight %s over %s" % (
136
+ self.group(), self.weight(), self.base_ring())
137
+ else:
138
+ return "Modular Forms space of dimension %s for %s of weight %s over %s" % (
139
+ self.dimension(), self.group(), self.weight(), self.base_ring())
140
+
141
+ def _submodule_class(self):
142
+ """
143
+ Return the Python class of submodules of this modular forms space.
144
+
145
+ EXAMPLES::
146
+
147
+ sage: m = ModularForms(Gamma0(20),2)
148
+ sage: m._submodule_class()
149
+ <class 'sage.modular.modform.submodule.ModularFormsSubmodule'>
150
+ """
151
+ return submodule.ModularFormsSubmodule
152
+
153
+ def change_ring(self, base_ring):
154
+ """
155
+ Change the base ring of this space of modular forms.
156
+
157
+ INPUT:
158
+
159
+ - ``R`` -- ring
160
+
161
+ EXAMPLES::
162
+
163
+ sage: M = ModularForms(Gamma0(37),2)
164
+ sage: M.basis()
165
+ [q + q^3 - 2*q^4 + O(q^6),
166
+ q^2 + 2*q^3 - 2*q^4 + q^5 + O(q^6),
167
+ 1 + 2/3*q + 2*q^2 + 8/3*q^3 + 14/3*q^4 + 4*q^5 + O(q^6)]
168
+
169
+ The basis after changing the base ring is the reduction modulo
170
+ `3` of an integral basis.
171
+
172
+ ::
173
+
174
+ sage: M3 = M.change_ring(GF(3))
175
+ sage: M3.basis()
176
+ [q + q^3 + q^4 + O(q^6),
177
+ q^2 + 2*q^3 + q^4 + q^5 + O(q^6),
178
+ 1 + q^3 + q^4 + 2*q^5 + O(q^6)]
179
+ """
180
+ from . import constructor
181
+ return constructor.ModularForms(self.group(), self.weight(),
182
+ base_ring, prec=self.prec(),
183
+ eis_only=self._eis_only)
184
+
185
+ @cached_method
186
+ def dimension(self):
187
+ """
188
+ Return the dimension of this ambient space of modular forms,
189
+ computed using a dimension formula (so it should be reasonably
190
+ fast).
191
+
192
+ EXAMPLES::
193
+
194
+ sage: m = ModularForms(Gamma1(20),20)
195
+ sage: m.dimension()
196
+ 238
197
+ """
198
+ return self._dim_eisenstein() + self._dim_cuspidal()
199
+
200
+ def hecke_module_of_level(self, N):
201
+ r"""
202
+ Return the Hecke module of level N corresponding to self, which is the
203
+ domain or codomain of a degeneracy map from ``self``. Here N must be either
204
+ a divisor or a multiple of the level of ``self``.
205
+
206
+ EXAMPLES::
207
+
208
+ sage: ModularForms(25, 6).hecke_module_of_level(5)
209
+ Modular Forms space of dimension 3 for Congruence Subgroup Gamma0(5) of weight 6 over Rational Field
210
+ sage: ModularForms(Gamma1(4), 3).hecke_module_of_level(8)
211
+ Modular Forms space of dimension 7 for Congruence Subgroup Gamma1(8) of weight 3 over Rational Field
212
+ sage: ModularForms(Gamma1(4), 3).hecke_module_of_level(9)
213
+ Traceback (most recent call last):
214
+ ...
215
+ ValueError: N (=9) must be a divisor or a multiple of the level of self (=4)
216
+ """
217
+ if not (N % self.level() == 0 or self.level() % N == 0):
218
+ raise ValueError("N (=%s) must be a divisor or a multiple of the level of self (=%s)" % (N, self.level()))
219
+ from . import constructor
220
+ return constructor.ModularForms(self.group()._new_group_from_level(N), self.weight(), self.base_ring(), prec=self.prec())
221
+
222
+ def _degeneracy_raising_matrix(self, M, t):
223
+ r"""
224
+ Calculate the matrix of the degeneracy map from ``self`` to M corresponding
225
+ to `f(q) \mapsto f(q^t)`. Here the level of M should be a multiple of
226
+ the level of self, and t should divide the quotient.
227
+
228
+ EXAMPLES::
229
+
230
+ sage: ModularForms(22, 2)._degeneracy_raising_matrix(ModularForms(44, 2), 1)
231
+ [ 1 0 -1 -2 0 0 0 0 0]
232
+ [ 0 1 0 -2 0 0 0 0 0]
233
+ [ 0 0 0 0 1 0 0 0 24]
234
+ [ 0 0 0 0 0 1 0 -2 21]
235
+ [ 0 0 0 0 0 0 1 3 -10]
236
+ sage: ModularForms(22, 2)._degeneracy_raising_matrix(ModularForms(44, 2), 2)
237
+ [0 1 0 0 0 0 0 0 0]
238
+ [0 0 0 1 0 0 0 0 0]
239
+ [0 0 0 0 1 0 0 0 0]
240
+ [0 0 0 0 0 0 1 0 0]
241
+ [0 0 0 0 0 0 0 1 0]
242
+ """
243
+ from sage.matrix.matrix_space import MatrixSpace
244
+ A = MatrixSpace(self.base_ring(), self.dimension(), M.dimension())
245
+ d = M.sturm_bound() + 1
246
+ q = self.an_element().qexp(d).parent().gen()
247
+ im_gens = []
248
+ for x in self.basis():
249
+ fq = x.qexp(d)
250
+ fqt = fq(q**t).add_bigoh(d) # silly workaround for trac #5367
251
+ im_gens.append(M(fqt))
252
+ return A([M.coordinate_vector(u) for u in im_gens])
253
+
254
+ def rank(self):
255
+ r"""
256
+ This is a synonym for ``self.dimension()``.
257
+
258
+ EXAMPLES::
259
+
260
+ sage: m = ModularForms(Gamma0(20),4)
261
+ sage: m.rank()
262
+ 12
263
+ sage: m.dimension()
264
+ 12
265
+ """
266
+ return self.dimension()
267
+
268
+ def ambient_space(self):
269
+ """
270
+ Return the ambient space that contains this ambient space. This is,
271
+ of course, just this space again.
272
+
273
+ EXAMPLES::
274
+
275
+ sage: m = ModularForms(Gamma0(3),30)
276
+ sage: m.ambient_space() is m
277
+ True
278
+ """
279
+ return self
280
+
281
+ def is_ambient(self) -> bool:
282
+ """
283
+ Return ``True`` if this an ambient space of modular forms.
284
+
285
+ This is an ambient space, so this function always returns ``True``.
286
+
287
+ EXAMPLES::
288
+
289
+ sage: ModularForms(11).is_ambient()
290
+ True
291
+ sage: CuspForms(11).is_ambient()
292
+ False
293
+ """
294
+ return True
295
+
296
+ @cached_method(key=lambda self, sign: Integer(sign)) # convert sign to an Integer before looking this up in the cache
297
+ def modular_symbols(self, sign=0):
298
+ """
299
+ Return the corresponding space of modular symbols with the given
300
+ sign.
301
+
302
+ EXAMPLES::
303
+
304
+ sage: S = ModularForms(11,2)
305
+ sage: S.modular_symbols()
306
+ Modular Symbols space of dimension 3 for Gamma_0(11) of weight 2 with sign 0 over Rational Field
307
+ sage: S.modular_symbols(sign=1)
308
+ Modular Symbols space of dimension 2 for Gamma_0(11) of weight 2 with sign 1 over Rational Field
309
+ sage: S.modular_symbols(sign=-1)
310
+ Modular Symbols space of dimension 1 for Gamma_0(11) of weight 2 with sign -1 over Rational Field
311
+
312
+ ::
313
+
314
+ sage: ModularForms(1,12).modular_symbols()
315
+ Modular Symbols space of dimension 3 for Gamma_0(1) of weight 12 with sign 0 over Rational Field
316
+ """
317
+ sign = Integer(sign)
318
+ return ModularSymbols(group=self.group(),
319
+ weight=self.weight(),
320
+ sign=sign,
321
+ base_ring=self.base_ring())
322
+
323
+ @cached_method
324
+ def module(self):
325
+ """
326
+ Return the underlying free module corresponding to this space
327
+ of modular forms.
328
+
329
+ EXAMPLES::
330
+
331
+ sage: m = ModularForms(Gamma1(13),10)
332
+ sage: m.free_module()
333
+ Vector space of dimension 69 over Rational Field
334
+ sage: ModularForms(Gamma1(13),4, GF(49,'b')).free_module()
335
+ Vector space of dimension 27 over Finite Field in b of size 7^2
336
+ """
337
+ d = self.dimension()
338
+ return VectorSpace(self.base_ring(), d)
339
+
340
+ # free_module -- stupid thing: there are functions in classes
341
+ # ModularFormsSpace and HeckeModule that both do much the same
342
+ # thing, and one has to override both of them!
343
+ def free_module(self):
344
+ """
345
+ Return the free module underlying this space of modular forms.
346
+
347
+ EXAMPLES::
348
+
349
+ sage: ModularForms(37).free_module()
350
+ Vector space of dimension 3 over Rational Field
351
+ """
352
+ return self.module()
353
+
354
+ def prec(self, new_prec=None):
355
+ """
356
+ Set or get default initial precision for printing modular forms.
357
+
358
+ INPUT:
359
+
360
+ - ``new_prec`` -- positive integer (default: ``None``)
361
+
362
+ OUTPUT: if ``new_prec`` is ``None``, returns the current precision
363
+
364
+ EXAMPLES::
365
+
366
+ sage: M = ModularForms(1,12, prec=3)
367
+ sage: M.prec()
368
+ 3
369
+
370
+ ::
371
+
372
+ sage: M.basis()
373
+ [q - 24*q^2 + O(q^3), 1 + 65520/691*q + 134250480/691*q^2 + O(q^3)]
374
+
375
+ ::
376
+
377
+ sage: M.prec(5)
378
+ 5
379
+ sage: M.basis()
380
+ [q - 24*q^2 + 252*q^3 - 1472*q^4 + O(q^5),
381
+ 1 + 65520/691*q + 134250480/691*q^2 + 11606736960/691*q^3 + 274945048560/691*q^4 + O(q^5)]
382
+ """
383
+ if new_prec:
384
+ self.__prec = new_prec
385
+ try:
386
+ return self.__prec
387
+ except AttributeError:
388
+ self.__prec = defaults.DEFAULT_PRECISION
389
+ return self.__prec
390
+
391
+ def set_precision(self, n):
392
+ """
393
+ Set the default precision for displaying elements of this space.
394
+
395
+ EXAMPLES::
396
+
397
+ sage: m = ModularForms(Gamma1(5),2)
398
+ sage: m.set_precision(10)
399
+ sage: m.basis()
400
+ [1 + 60*q^3 - 120*q^4 + 240*q^5 - 300*q^6 + 300*q^7 - 180*q^9 + O(q^10),
401
+ q + 6*q^3 - 9*q^4 + 27*q^5 - 28*q^6 + 30*q^7 - 11*q^9 + O(q^10),
402
+ q^2 - 4*q^3 + 12*q^4 - 22*q^5 + 30*q^6 - 24*q^7 + 5*q^8 + 18*q^9 + O(q^10)]
403
+ sage: m.set_precision(5)
404
+ sage: m.basis()
405
+ [1 + 60*q^3 - 120*q^4 + O(q^5),
406
+ q + 6*q^3 - 9*q^4 + O(q^5),
407
+ q^2 - 4*q^3 + 12*q^4 + O(q^5)]
408
+ """
409
+ if n < 0:
410
+ raise ValueError("n (=%s) must be >= 0" % n)
411
+ self.__prec = Integer(n)
412
+
413
+ ####################################################################
414
+ # Computation of Special Submodules
415
+ ####################################################################
416
+ @cached_method
417
+ def cuspidal_submodule(self):
418
+ """
419
+ Return the cuspidal submodule of this ambient module.
420
+
421
+ EXAMPLES::
422
+
423
+ sage: ModularForms(Gamma1(13)).cuspidal_submodule()
424
+ Cuspidal subspace of dimension 2 of Modular Forms space of dimension 13 for
425
+ Congruence Subgroup Gamma1(13) of weight 2 over Rational Field
426
+ """
427
+ from .cuspidal_submodule import CuspidalSubmodule
428
+ return CuspidalSubmodule(self)
429
+
430
+ @cached_method
431
+ def eisenstein_submodule(self):
432
+ """
433
+ Return the Eisenstein submodule of this ambient module.
434
+
435
+ EXAMPLES::
436
+
437
+ sage: m = ModularForms(Gamma1(13),2); m
438
+ Modular Forms space of dimension 13 for Congruence Subgroup Gamma1(13) of weight 2 over Rational Field
439
+ sage: m.eisenstein_submodule()
440
+ Eisenstein subspace of dimension 11 of Modular Forms space of dimension 13 for Congruence Subgroup Gamma1(13) of weight 2 over Rational Field
441
+ """
442
+ return eisenstein_submodule.EisensteinSubmodule(self)
443
+
444
+ @cached_method(key=lambda self, p: (Integer(p) if p is not None else p)) # convert p to an Integer before looking this up in the cache
445
+ def new_submodule(self, p=None):
446
+ """
447
+ Return the new or `p`-new submodule of this ambient
448
+ module.
449
+
450
+ INPUT:
451
+
452
+ - ``p`` -- (default: ``None``), if specified return only
453
+ the `p`-new submodule
454
+
455
+ EXAMPLES::
456
+
457
+ sage: m = ModularForms(Gamma0(33),2); m
458
+ Modular Forms space of dimension 6 for Congruence Subgroup Gamma0(33) of weight 2 over Rational Field
459
+ sage: m.new_submodule()
460
+ Modular Forms subspace of dimension 1 of Modular Forms space of dimension 6 for Congruence Subgroup Gamma0(33) of weight 2 over Rational Field
461
+
462
+ Another example::
463
+
464
+ sage: M = ModularForms(17,4)
465
+ sage: N = M.new_subspace(); N
466
+ Modular Forms subspace of dimension 4 of Modular Forms space of dimension 6 for Congruence Subgroup Gamma0(17) of weight 4 over Rational Field
467
+ sage: N.basis()
468
+ [q + 2*q^5 + O(q^6),
469
+ q^2 - 3/2*q^5 + O(q^6),
470
+ q^3 + O(q^6),
471
+ q^4 - 1/2*q^5 + O(q^6)]
472
+
473
+ ::
474
+
475
+ sage: ModularForms(12,4).new_submodule()
476
+ Modular Forms subspace of dimension 1 of Modular Forms space of dimension 9 for Congruence Subgroup Gamma0(12) of weight 4 over Rational Field
477
+
478
+ Unfortunately (TODO) - `p`-new submodules aren't yet
479
+ implemented::
480
+
481
+ sage: m.new_submodule(3) # not implemented
482
+ Traceback (most recent call last):
483
+ ...
484
+ NotImplementedError
485
+ sage: m.new_submodule(11) # not implemented
486
+ Traceback (most recent call last):
487
+ ...
488
+ NotImplementedError
489
+ """
490
+ if p is not None:
491
+ p = Integer(p)
492
+ if not p.is_prime():
493
+ raise ValueError("p (=%s) must be a prime or None." % p)
494
+ return self.cuspidal_submodule().new_submodule(p) + self.eisenstein_submodule().new_submodule(p)
495
+
496
+ def _q_expansion(self, element, prec):
497
+ r"""
498
+ Return the `q`-expansion of a particular element of this space of
499
+ modular forms, where the element should be a vector, list, or tuple
500
+ (not a ModularFormElement). Here element should have length =
501
+ self.dimension(). If element = [ a_i ] and self.basis() = [ v_i
502
+ ], then we return `\sum a_i v_i`.
503
+
504
+ INPUT:
505
+
506
+ - ``element`` -- vector, list or tuple
507
+
508
+ - ``prec`` -- desired precision of `q`-expansion
509
+
510
+ EXAMPLES::
511
+
512
+ sage: m = ModularForms(Gamma0(23),2); m
513
+ Modular Forms space of dimension 3 for Congruence Subgroup Gamma0(23) of weight 2 over Rational Field
514
+ sage: m.basis()
515
+ [q - q^3 - q^4 + O(q^6),
516
+ q^2 - 2*q^3 - q^4 + 2*q^5 + O(q^6),
517
+ 1 + 12/11*q + 36/11*q^2 + 48/11*q^3 + 84/11*q^4 + 72/11*q^5 + O(q^6)]
518
+ sage: m._q_expansion([1,2,0], 5)
519
+ q + 2*q^2 - 5*q^3 - 3*q^4 + O(q^5)
520
+ """
521
+ B = self.q_expansion_basis(prec)
522
+ f = self._q_expansion_zero()
523
+ for i in range(len(element)):
524
+ if element[i]:
525
+ f += element[i] * B[i]
526
+ return f
527
+
528
+ ####################################################################
529
+ # Computations of Dimensions
530
+ ####################################################################
531
+ @cached_method
532
+ def _dim_cuspidal(self):
533
+ r"""
534
+ Return the dimension of the cuspidal subspace of this ambient
535
+ modular forms space.
536
+
537
+ For weights `k \ge 2` this is computed using a
538
+ dimension formula. For weight 1, it will trigger a computation of a
539
+ basis of `q`-expansions using Schaeffer's algorithm, unless this space
540
+ is a space of Eisenstein forms only, in which case we just return 0.
541
+
542
+ EXAMPLES::
543
+
544
+ sage: m = ModularForms(GammaH(11,[3]), 2); m
545
+ Modular Forms space of dimension 2 for Congruence Subgroup Gamma_H(11) with H generated by [3] of weight 2 over Rational Field
546
+ sage: m._dim_cuspidal()
547
+ 1
548
+ sage: m = ModularForms(DirichletGroup(389,CyclotomicField(4)).0,3); m._dim_cuspidal()
549
+ 64
550
+ sage: m = ModularForms(GammaH(31, [7]), 1)
551
+ sage: m._dim_cuspidal()
552
+ 1
553
+ sage: m = ModularForms(GammaH(31, [7]), 1, eis_only=True)
554
+ sage: m._dim_cuspidal()
555
+ 0
556
+ """
557
+ if self._eis_only:
558
+ return 0
559
+ if isinstance(self.group(), Gamma1_class) and self.character() is not None:
560
+ return self.group().dimension_cusp_forms(self.weight(),
561
+ self.character())
562
+ else:
563
+ return self.group().dimension_cusp_forms(self.weight())
564
+
565
+ @cached_method
566
+ def _dim_eisenstein(self):
567
+ """
568
+ Return the dimension of the Eisenstein subspace of this modular
569
+ symbols space, computed using a dimension formula.
570
+
571
+ EXAMPLES::
572
+
573
+ sage: m = ModularForms(GammaH(13,[4]), 2); m
574
+ Modular Forms space of dimension 3 for Congruence Subgroup Gamma_H(13) with H generated by [4] of weight 2 over Rational Field
575
+ sage: m._dim_eisenstein()
576
+ 3
577
+
578
+ sage: m = ModularForms(DirichletGroup(13).0,7); m
579
+ Modular Forms space of dimension 8, character [zeta12] and weight 7 over Cyclotomic Field of order 12 and degree 4
580
+ sage: m._dim_eisenstein()
581
+ 2
582
+ sage: m._dim_cuspidal()
583
+ 6
584
+
585
+ Test that :issue:`24030` is fixed::
586
+
587
+ sage: ModularForms(GammaH(40, [21]), 1).dimension() # indirect doctest
588
+ 16
589
+ """
590
+ if isinstance(self.group(), Gamma1_class) and self.character() is not None:
591
+ return self.group().dimension_eis(self.weight(), self.character())
592
+ else:
593
+ return self.group().dimension_eis(self.weight())
594
+
595
+ @cached_method
596
+ def _dim_new_cuspidal(self):
597
+ """
598
+ Return the dimension of the new cuspidal subspace, computed using
599
+ dimension formulas.
600
+
601
+ EXAMPLES::
602
+
603
+ sage: m = ModularForms(GammaH(11,[2]), 2); m._dim_new_cuspidal()
604
+ 1
605
+ sage: m = ModularForms(DirichletGroup(33).0,7); m
606
+ Modular Forms space of dimension 26, character [-1, 1] and weight 7 over Rational Field
607
+ sage: m._dim_new_cuspidal()
608
+ 20
609
+ sage: m._dim_cuspidal()
610
+ 22
611
+ """
612
+ if isinstance(self.group(), Gamma1_class) and self.character() is not None:
613
+ return self.group().dimension_new_cusp_forms(self.weight(), self.character())
614
+ else:
615
+ return self.group().dimension_new_cusp_forms(self.weight())
616
+
617
+ @cached_method
618
+ def _dim_new_eisenstein(self):
619
+ """
620
+ Return the dimension of the new Eisenstein subspace, computed
621
+ by enumerating all Eisenstein series of the appropriate level.
622
+
623
+ EXAMPLES::
624
+
625
+ sage: m = ModularForms(Gamma0(11), 4)
626
+ sage: m._dim_new_eisenstein()
627
+ 0
628
+ sage: m = ModularForms(Gamma0(11), 2)
629
+ sage: m._dim_new_eisenstein()
630
+ 1
631
+ sage: m = ModularForms(DirichletGroup(36).0,5); m
632
+ Modular Forms space of dimension 28, character [-1, 1] and weight 5 over Rational Field
633
+ sage: m._dim_new_eisenstein()
634
+ 2
635
+ sage: m._dim_eisenstein()
636
+ 8
637
+ """
638
+ if isinstance(self.group(), Gamma0_class) and self.weight() == 2:
639
+ if is_prime(self.level()):
640
+ d = 1
641
+ else:
642
+ d = 0
643
+ else:
644
+ E = self.eisenstein_series()
645
+ d = len([g for g in E if g.new_level() == self.level()])
646
+ return d
647
+
648
+ ####################################################################
649
+ # Computations of all Eisenstein series in self
650
+ ####################################################################
651
+
652
+ @cached_method
653
+ def eisenstein_params(self):
654
+ """
655
+ Return parameters that define all Eisenstein series in ``self``.
656
+
657
+ OUTPUT: an immutable Sequence
658
+
659
+ EXAMPLES::
660
+
661
+ sage: m = ModularForms(Gamma0(22), 2)
662
+ sage: v = m.eisenstein_params(); v
663
+ [(Dirichlet character modulo 22 of conductor 1 mapping 13 |--> 1, Dirichlet character modulo 22 of conductor 1 mapping 13 |--> 1, 2), (Dirichlet character modulo 22 of conductor 1 mapping 13 |--> 1, Dirichlet character modulo 22 of conductor 1 mapping 13 |--> 1, 11), (Dirichlet character modulo 22 of conductor 1 mapping 13 |--> 1, Dirichlet character modulo 22 of conductor 1 mapping 13 |--> 1, 22)]
664
+ sage: type(v)
665
+ <class 'sage.structure.sequence.Sequence_generic'>
666
+ """
667
+ eps = self.character()
668
+ if eps is None:
669
+ if isinstance(self.group(), Gamma1_class):
670
+ eps = self.level()
671
+ else:
672
+ raise NotImplementedError
673
+ params = eis_series.compute_eisenstein_params(eps, self.weight())
674
+ return Sequence(params, immutable=True)
675
+
676
+ def eisenstein_series(self):
677
+ """
678
+ Return all Eisenstein series associated to this space.
679
+
680
+ ::
681
+
682
+ sage: ModularForms(27,2).eisenstein_series()
683
+ [q^3 + O(q^6),
684
+ q - 3*q^2 + 7*q^4 - 6*q^5 + O(q^6),
685
+ 1/12 + q + 3*q^2 + q^3 + 7*q^4 + 6*q^5 + O(q^6),
686
+ 1/3 + q + 3*q^2 + 4*q^3 + 7*q^4 + 6*q^5 + O(q^6),
687
+ 13/12 + q + 3*q^2 + 4*q^3 + 7*q^4 + 6*q^5 + O(q^6)]
688
+
689
+ ::
690
+
691
+ sage: ModularForms(Gamma1(5),3).eisenstein_series()
692
+ [-1/5*zeta4 - 2/5 + q + (4*zeta4 + 1)*q^2 + (-9*zeta4 + 1)*q^3 + (4*zeta4 - 15)*q^4 + q^5 + O(q^6),
693
+ q + (zeta4 + 4)*q^2 + (-zeta4 + 9)*q^3 + (4*zeta4 + 15)*q^4 + 25*q^5 + O(q^6),
694
+ 1/5*zeta4 - 2/5 + q + (-4*zeta4 + 1)*q^2 + (9*zeta4 + 1)*q^3 + (-4*zeta4 - 15)*q^4 + q^5 + O(q^6),
695
+ q + (-zeta4 + 4)*q^2 + (zeta4 + 9)*q^3 + (-4*zeta4 + 15)*q^4 + 25*q^5 + O(q^6)]
696
+
697
+ ::
698
+
699
+ sage: eps = DirichletGroup(13).0^2
700
+ sage: ModularForms(eps,2).eisenstein_series()
701
+ [-7/13*zeta6 - 11/13 + q + (2*zeta6 + 1)*q^2 + (-3*zeta6 + 1)*q^3 + (6*zeta6 - 3)*q^4 - 4*q^5 + O(q^6),
702
+ q + (zeta6 + 2)*q^2 + (-zeta6 + 3)*q^3 + (3*zeta6 + 3)*q^4 + 4*q^5 + O(q^6)]
703
+ """
704
+ return self.eisenstein_submodule().eisenstein_series()
705
+
706
+ def _compute_q_expansion_basis(self, prec):
707
+ """
708
+ EXAMPLES::
709
+
710
+ sage: m = ModularForms(11,4)
711
+ sage: m._compute_q_expansion_basis(5)
712
+ [q + 3*q^3 - 6*q^4 + O(q^5), q^2 - 4*q^3 + 2*q^4 + O(q^5), 1 + O(q^5), q + 9*q^2 + 28*q^3 + 73*q^4 + O(q^5)]
713
+ """
714
+ S = self.cuspidal_submodule()
715
+ E = self.eisenstein_submodule()
716
+ B_S = S._compute_q_expansion_basis(prec)
717
+ B_E = E._compute_q_expansion_basis(prec)
718
+ return B_S + B_E
719
+
720
+ def _compute_hecke_matrix(self, n):
721
+ """
722
+ Compute the matrix of the Hecke operator `T_n` acting on ``self``.
723
+
724
+ .. NOTE::
725
+
726
+ If ``self`` is a level 1 space, the much faster Victor Miller basis
727
+ is used for this computation.
728
+
729
+ EXAMPLES::
730
+
731
+ sage: M = ModularForms(11, 2)
732
+ sage: M._compute_hecke_matrix(6)
733
+ [ 2 0]
734
+ [ 0 12]
735
+
736
+ Check that :issue:`22780` is fixed::
737
+
738
+ sage: M = ModularForms(1, 12)
739
+ sage: M._compute_hecke_matrix(2)
740
+ [ -24 0]
741
+ [ 0 2049]
742
+ sage: ModularForms(1, 2).hecke_matrix(2)
743
+ []
744
+
745
+ TESTS:
746
+
747
+ The following Hecke matrix is 43x43 with very large integer entries.
748
+ We test it indirectly by computing the product and the sum of its
749
+ eigenvalues, and reducing these two integers modulo all the primes
750
+ less than 100::
751
+
752
+ sage: M = ModularForms(1, 512)
753
+ sage: t = M._compute_hecke_matrix(5) # long time (2s)
754
+ sage: t[-1, -1] == 1 + 5^511 # long time (0s, depends on above)
755
+ True
756
+ sage: f = t.charpoly() # long time (4s)
757
+ sage: [f[0]%p for p in prime_range(100)] # long time (0s, depends on above)
758
+ [0, 0, 0, 0, 1, 9, 2, 7, 0, 0, 0, 0, 1, 12, 9, 16, 37, 0, 21, 11, 70, 22, 0, 58, 76]
759
+ sage: [f[42]%p for p in prime_range(100)] # long time (0s, depends on above)
760
+ [0, 0, 4, 0, 10, 4, 4, 8, 12, 1, 23, 13, 10, 27, 20, 13, 16, 59, 53, 41, 11, 13, 12, 6, 82]
761
+ """
762
+ if self.level() == 1:
763
+ k = self.weight()
764
+ d = self.dimension()
765
+ if d == 0:
766
+ return matrix(self.base_ring(), 0, 0, [])
767
+ from sage.modular.all import victor_miller_basis, hecke_operator_on_basis
768
+ vmb = victor_miller_basis(k, prec=d * n + 1)[1:]
769
+ Tcusp = hecke_operator_on_basis(vmb, n, k)
770
+ return Tcusp.block_sum(matrix(self.base_ring(), 1, 1,
771
+ [sigma(n, k - 1)]))
772
+ else:
773
+ return space.ModularFormsSpace._compute_hecke_matrix(self, n)
774
+
775
+ def _compute_hecke_matrix_prime_power(self, p, r):
776
+ r"""
777
+ Compute the Hecke matrix `T_{p^r}`, where `p` is prime and `r \ge 2`.
778
+
779
+ This is an internal method. End users are encouraged to use the
780
+ method hecke_matrix() instead.
781
+
782
+ TESTS:
783
+
784
+ sage: M = ModularForms(1, 12)
785
+ sage: M._compute_hecke_matrix_prime_power(5, 3)
786
+ [ -359001100500 0]
787
+ [ 0 116415324211120654296876]
788
+ sage: delta_qexp(126)[125]
789
+ -359001100500
790
+ sage: eisenstein_series_qexp(12, 126)[125]
791
+ 116415324211120654296876
792
+ """
793
+ if self.level() == 1:
794
+ return self._compute_hecke_matrix(p**r)
795
+ else:
796
+ return space.ModularFormsSpace._compute_hecke_matrix_prime_power(self, p, r)
797
+
798
+ def hecke_polynomial(self, n, var='x'):
799
+ r"""
800
+ Compute the characteristic polynomial of the Hecke operator `T_n` acting
801
+ on this space. Except in level 1, this is computed via modular symbols,
802
+ and in particular is faster to compute than the matrix itself.
803
+
804
+ EXAMPLES::
805
+
806
+ sage: ModularForms(17,4).hecke_polynomial(2)
807
+ x^6 - 16*x^5 + 18*x^4 + 608*x^3 - 1371*x^2 - 4968*x + 7776
808
+
809
+ Check that this gives the same answer as computing the actual Hecke
810
+ matrix (which is generally slower)::
811
+
812
+ sage: ModularForms(17,4).hecke_matrix(2).charpoly()
813
+ x^6 - 16*x^5 + 18*x^4 + 608*x^3 - 1371*x^2 - 4968*x + 7776
814
+ """
815
+ return self.cuspidal_submodule().hecke_polynomial(n, var) * self.eisenstein_submodule().hecke_polynomial(n, var)