passagemath-schemes 10.6.47__cp312-cp312-macosx_13_0_arm64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (311) hide show
  1. passagemath_schemes/.dylibs/libflint.22.0.dylib +0 -0
  2. passagemath_schemes/.dylibs/libgmp.10.dylib +0 -0
  3. passagemath_schemes/.dylibs/libgmpxx.4.dylib +0 -0
  4. passagemath_schemes/.dylibs/libmpfr.6.dylib +0 -0
  5. passagemath_schemes/__init__.py +3 -0
  6. passagemath_schemes-10.6.47.dist-info/METADATA +204 -0
  7. passagemath_schemes-10.6.47.dist-info/METADATA.bak +205 -0
  8. passagemath_schemes-10.6.47.dist-info/RECORD +311 -0
  9. passagemath_schemes-10.6.47.dist-info/WHEEL +6 -0
  10. passagemath_schemes-10.6.47.dist-info/top_level.txt +3 -0
  11. sage/all__sagemath_schemes.py +23 -0
  12. sage/databases/all__sagemath_schemes.py +7 -0
  13. sage/databases/cremona.py +1723 -0
  14. sage/dynamics/all__sagemath_schemes.py +2 -0
  15. sage/dynamics/arithmetic_dynamics/affine_ds.py +1083 -0
  16. sage/dynamics/arithmetic_dynamics/all.py +14 -0
  17. sage/dynamics/arithmetic_dynamics/berkovich_ds.py +1101 -0
  18. sage/dynamics/arithmetic_dynamics/dynamical_semigroup.py +1543 -0
  19. sage/dynamics/arithmetic_dynamics/endPN_automorphism_group.py +2426 -0
  20. sage/dynamics/arithmetic_dynamics/endPN_minimal_model.py +1169 -0
  21. sage/dynamics/arithmetic_dynamics/generic_ds.py +663 -0
  22. sage/dynamics/arithmetic_dynamics/product_projective_ds.py +339 -0
  23. sage/dynamics/arithmetic_dynamics/projective_ds.py +9558 -0
  24. sage/dynamics/arithmetic_dynamics/projective_ds_helper.cpython-312-darwin.so +0 -0
  25. sage/dynamics/arithmetic_dynamics/projective_ds_helper.pyx +301 -0
  26. sage/dynamics/arithmetic_dynamics/wehlerK3.py +2576 -0
  27. sage/lfunctions/all.py +18 -0
  28. sage/lfunctions/dokchitser.py +745 -0
  29. sage/lfunctions/pari.py +818 -0
  30. sage/lfunctions/zero_sums.cpython-312-darwin.so +0 -0
  31. sage/lfunctions/zero_sums.pyx +1847 -0
  32. sage/modular/abvar/abvar.py +5135 -0
  33. sage/modular/abvar/abvar_ambient_jacobian.py +413 -0
  34. sage/modular/abvar/abvar_newform.py +244 -0
  35. sage/modular/abvar/all.py +8 -0
  36. sage/modular/abvar/constructor.py +186 -0
  37. sage/modular/abvar/cuspidal_subgroup.py +371 -0
  38. sage/modular/abvar/finite_subgroup.py +896 -0
  39. sage/modular/abvar/homology.py +720 -0
  40. sage/modular/abvar/homspace.py +998 -0
  41. sage/modular/abvar/lseries.py +415 -0
  42. sage/modular/abvar/morphism.py +935 -0
  43. sage/modular/abvar/torsion_point.py +274 -0
  44. sage/modular/abvar/torsion_subgroup.py +740 -0
  45. sage/modular/all.py +43 -0
  46. sage/modular/arithgroup/all.py +20 -0
  47. sage/modular/arithgroup/arithgroup_element.cpython-312-darwin.so +0 -0
  48. sage/modular/arithgroup/arithgroup_element.pyx +474 -0
  49. sage/modular/arithgroup/arithgroup_generic.py +1402 -0
  50. sage/modular/arithgroup/arithgroup_perm.py +2692 -0
  51. sage/modular/arithgroup/congroup.cpython-312-darwin.so +0 -0
  52. sage/modular/arithgroup/congroup.pyx +334 -0
  53. sage/modular/arithgroup/congroup_gamma.py +363 -0
  54. sage/modular/arithgroup/congroup_gamma0.py +692 -0
  55. sage/modular/arithgroup/congroup_gamma1.py +653 -0
  56. sage/modular/arithgroup/congroup_gammaH.py +1469 -0
  57. sage/modular/arithgroup/congroup_generic.py +628 -0
  58. sage/modular/arithgroup/congroup_sl2z.py +267 -0
  59. sage/modular/arithgroup/farey_symbol.cpython-312-darwin.so +0 -0
  60. sage/modular/arithgroup/farey_symbol.pyx +1066 -0
  61. sage/modular/arithgroup/tests.py +418 -0
  62. sage/modular/btquotients/all.py +4 -0
  63. sage/modular/btquotients/btquotient.py +3753 -0
  64. sage/modular/btquotients/pautomorphicform.py +2570 -0
  65. sage/modular/buzzard.py +100 -0
  66. sage/modular/congroup.py +29 -0
  67. sage/modular/congroup_element.py +13 -0
  68. sage/modular/cusps.py +1109 -0
  69. sage/modular/cusps_nf.py +1270 -0
  70. sage/modular/dims.py +569 -0
  71. sage/modular/dirichlet.py +3310 -0
  72. sage/modular/drinfeld_modform/all.py +2 -0
  73. sage/modular/drinfeld_modform/element.py +446 -0
  74. sage/modular/drinfeld_modform/ring.py +773 -0
  75. sage/modular/drinfeld_modform/tutorial.py +236 -0
  76. sage/modular/etaproducts.py +1065 -0
  77. sage/modular/hecke/algebra.py +746 -0
  78. sage/modular/hecke/all.py +20 -0
  79. sage/modular/hecke/ambient_module.py +1019 -0
  80. sage/modular/hecke/degenmap.py +119 -0
  81. sage/modular/hecke/element.py +325 -0
  82. sage/modular/hecke/hecke_operator.py +780 -0
  83. sage/modular/hecke/homspace.py +206 -0
  84. sage/modular/hecke/module.py +1767 -0
  85. sage/modular/hecke/morphism.py +174 -0
  86. sage/modular/hecke/submodule.py +989 -0
  87. sage/modular/hypergeometric_misc.cpython-312-darwin.so +0 -0
  88. sage/modular/hypergeometric_misc.pxd +4 -0
  89. sage/modular/hypergeometric_misc.pyx +166 -0
  90. sage/modular/hypergeometric_motive.py +2017 -0
  91. sage/modular/local_comp/all.py +2 -0
  92. sage/modular/local_comp/liftings.py +292 -0
  93. sage/modular/local_comp/local_comp.py +1071 -0
  94. sage/modular/local_comp/smoothchar.py +1825 -0
  95. sage/modular/local_comp/type_space.py +748 -0
  96. sage/modular/modform/all.py +30 -0
  97. sage/modular/modform/ambient.py +815 -0
  98. sage/modular/modform/ambient_R.py +177 -0
  99. sage/modular/modform/ambient_eps.py +306 -0
  100. sage/modular/modform/ambient_g0.py +124 -0
  101. sage/modular/modform/ambient_g1.py +204 -0
  102. sage/modular/modform/constructor.py +545 -0
  103. sage/modular/modform/cuspidal_submodule.py +708 -0
  104. sage/modular/modform/defaults.py +14 -0
  105. sage/modular/modform/eis_series.py +505 -0
  106. sage/modular/modform/eisenstein_submodule.py +663 -0
  107. sage/modular/modform/element.py +4131 -0
  108. sage/modular/modform/find_generators.py +59 -0
  109. sage/modular/modform/half_integral.py +154 -0
  110. sage/modular/modform/hecke_operator_on_qexp.py +247 -0
  111. sage/modular/modform/j_invariant.py +47 -0
  112. sage/modular/modform/l_series_gross_zagier.py +133 -0
  113. sage/modular/modform/l_series_gross_zagier_coeffs.cpython-312-darwin.so +0 -0
  114. sage/modular/modform/l_series_gross_zagier_coeffs.pyx +177 -0
  115. sage/modular/modform/notes.py +45 -0
  116. sage/modular/modform/numerical.py +514 -0
  117. sage/modular/modform/periods.py +14 -0
  118. sage/modular/modform/ring.py +1257 -0
  119. sage/modular/modform/space.py +1860 -0
  120. sage/modular/modform/submodule.py +118 -0
  121. sage/modular/modform/tests.py +64 -0
  122. sage/modular/modform/theta.py +110 -0
  123. sage/modular/modform/vm_basis.py +381 -0
  124. sage/modular/modform/weight1.py +220 -0
  125. sage/modular/modform_hecketriangle/abstract_ring.py +1932 -0
  126. sage/modular/modform_hecketriangle/abstract_space.py +2528 -0
  127. sage/modular/modform_hecketriangle/all.py +30 -0
  128. sage/modular/modform_hecketriangle/analytic_type.py +590 -0
  129. sage/modular/modform_hecketriangle/constructor.py +416 -0
  130. sage/modular/modform_hecketriangle/element.py +351 -0
  131. sage/modular/modform_hecketriangle/functors.py +752 -0
  132. sage/modular/modform_hecketriangle/graded_ring.py +541 -0
  133. sage/modular/modform_hecketriangle/graded_ring_element.py +2225 -0
  134. sage/modular/modform_hecketriangle/hecke_triangle_group_element.py +3352 -0
  135. sage/modular/modform_hecketriangle/hecke_triangle_groups.py +1432 -0
  136. sage/modular/modform_hecketriangle/readme.py +1214 -0
  137. sage/modular/modform_hecketriangle/series_constructor.py +580 -0
  138. sage/modular/modform_hecketriangle/space.py +1037 -0
  139. sage/modular/modform_hecketriangle/subspace.py +423 -0
  140. sage/modular/modsym/all.py +17 -0
  141. sage/modular/modsym/ambient.py +3846 -0
  142. sage/modular/modsym/boundary.py +1420 -0
  143. sage/modular/modsym/element.py +336 -0
  144. sage/modular/modsym/g1list.py +178 -0
  145. sage/modular/modsym/ghlist.py +182 -0
  146. sage/modular/modsym/hecke_operator.py +73 -0
  147. sage/modular/modsym/manin_symbol.cpython-312-darwin.so +0 -0
  148. sage/modular/modsym/manin_symbol.pxd +5 -0
  149. sage/modular/modsym/manin_symbol.pyx +497 -0
  150. sage/modular/modsym/manin_symbol_list.py +1295 -0
  151. sage/modular/modsym/modsym.py +400 -0
  152. sage/modular/modsym/modular_symbols.py +384 -0
  153. sage/modular/modsym/p1list_nf.py +1241 -0
  154. sage/modular/modsym/relation_matrix.py +591 -0
  155. sage/modular/modsym/relation_matrix_pyx.cpython-312-darwin.so +0 -0
  156. sage/modular/modsym/relation_matrix_pyx.pyx +108 -0
  157. sage/modular/modsym/space.py +2468 -0
  158. sage/modular/modsym/subspace.py +455 -0
  159. sage/modular/modsym/tests.py +375 -0
  160. sage/modular/multiple_zeta.py +2632 -0
  161. sage/modular/multiple_zeta_F_algebra.py +786 -0
  162. sage/modular/overconvergent/all.py +6 -0
  163. sage/modular/overconvergent/genus0.py +1878 -0
  164. sage/modular/overconvergent/hecke_series.py +1187 -0
  165. sage/modular/overconvergent/weightspace.py +778 -0
  166. sage/modular/pollack_stevens/all.py +4 -0
  167. sage/modular/pollack_stevens/distributions.py +874 -0
  168. sage/modular/pollack_stevens/fund_domain.py +1572 -0
  169. sage/modular/pollack_stevens/manin_map.py +859 -0
  170. sage/modular/pollack_stevens/modsym.py +1593 -0
  171. sage/modular/pollack_stevens/padic_lseries.py +417 -0
  172. sage/modular/pollack_stevens/sigma0.py +534 -0
  173. sage/modular/pollack_stevens/space.py +1076 -0
  174. sage/modular/quasimodform/all.py +3 -0
  175. sage/modular/quasimodform/element.py +845 -0
  176. sage/modular/quasimodform/ring.py +828 -0
  177. sage/modular/quatalg/all.py +3 -0
  178. sage/modular/quatalg/brandt.py +1642 -0
  179. sage/modular/ssmod/all.py +8 -0
  180. sage/modular/ssmod/ssmod.py +827 -0
  181. sage/rings/all__sagemath_schemes.py +1 -0
  182. sage/rings/polynomial/all__sagemath_schemes.py +1 -0
  183. sage/rings/polynomial/binary_form_reduce.py +585 -0
  184. sage/schemes/all.py +41 -0
  185. sage/schemes/berkovich/all.py +6 -0
  186. sage/schemes/berkovich/berkovich_cp_element.py +2582 -0
  187. sage/schemes/berkovich/berkovich_space.py +748 -0
  188. sage/schemes/curves/affine_curve.py +2928 -0
  189. sage/schemes/curves/all.py +33 -0
  190. sage/schemes/curves/closed_point.py +434 -0
  191. sage/schemes/curves/constructor.py +381 -0
  192. sage/schemes/curves/curve.py +542 -0
  193. sage/schemes/curves/plane_curve_arrangement.py +1283 -0
  194. sage/schemes/curves/point.py +463 -0
  195. sage/schemes/curves/projective_curve.py +3026 -0
  196. sage/schemes/curves/zariski_vankampen.py +1932 -0
  197. sage/schemes/cyclic_covers/all.py +2 -0
  198. sage/schemes/cyclic_covers/charpoly_frobenius.py +320 -0
  199. sage/schemes/cyclic_covers/constructor.py +137 -0
  200. sage/schemes/cyclic_covers/cycliccover_finite_field.py +1309 -0
  201. sage/schemes/cyclic_covers/cycliccover_generic.py +310 -0
  202. sage/schemes/elliptic_curves/BSD.py +1036 -0
  203. sage/schemes/elliptic_curves/Qcurves.py +592 -0
  204. sage/schemes/elliptic_curves/addition_formulas_ring.py +94 -0
  205. sage/schemes/elliptic_curves/all.py +49 -0
  206. sage/schemes/elliptic_curves/cardinality.py +609 -0
  207. sage/schemes/elliptic_curves/cm.py +1102 -0
  208. sage/schemes/elliptic_curves/constructor.py +1552 -0
  209. sage/schemes/elliptic_curves/ec_database.py +175 -0
  210. sage/schemes/elliptic_curves/ell_curve_isogeny.py +3972 -0
  211. sage/schemes/elliptic_curves/ell_egros.py +459 -0
  212. sage/schemes/elliptic_curves/ell_field.py +2836 -0
  213. sage/schemes/elliptic_curves/ell_finite_field.py +3359 -0
  214. sage/schemes/elliptic_curves/ell_generic.py +3760 -0
  215. sage/schemes/elliptic_curves/ell_local_data.py +1207 -0
  216. sage/schemes/elliptic_curves/ell_modular_symbols.py +775 -0
  217. sage/schemes/elliptic_curves/ell_number_field.py +4220 -0
  218. sage/schemes/elliptic_curves/ell_padic_field.py +107 -0
  219. sage/schemes/elliptic_curves/ell_point.py +4787 -0
  220. sage/schemes/elliptic_curves/ell_rational_field.py +7368 -0
  221. sage/schemes/elliptic_curves/ell_tate_curve.py +671 -0
  222. sage/schemes/elliptic_curves/ell_torsion.py +436 -0
  223. sage/schemes/elliptic_curves/ell_wp.py +352 -0
  224. sage/schemes/elliptic_curves/formal_group.py +760 -0
  225. sage/schemes/elliptic_curves/gal_reps.py +1459 -0
  226. sage/schemes/elliptic_curves/gal_reps_number_field.py +1669 -0
  227. sage/schemes/elliptic_curves/gp_simon.py +152 -0
  228. sage/schemes/elliptic_curves/heegner.py +7335 -0
  229. sage/schemes/elliptic_curves/height.py +2109 -0
  230. sage/schemes/elliptic_curves/hom.py +1406 -0
  231. sage/schemes/elliptic_curves/hom_composite.py +934 -0
  232. sage/schemes/elliptic_curves/hom_frobenius.py +522 -0
  233. sage/schemes/elliptic_curves/hom_scalar.py +531 -0
  234. sage/schemes/elliptic_curves/hom_sum.py +682 -0
  235. sage/schemes/elliptic_curves/hom_velusqrt.py +1290 -0
  236. sage/schemes/elliptic_curves/homset.py +271 -0
  237. sage/schemes/elliptic_curves/isogeny_class.py +1521 -0
  238. sage/schemes/elliptic_curves/isogeny_small_degree.py +2797 -0
  239. sage/schemes/elliptic_curves/jacobian.py +237 -0
  240. sage/schemes/elliptic_curves/kodaira_symbol.py +344 -0
  241. sage/schemes/elliptic_curves/kraus.py +1014 -0
  242. sage/schemes/elliptic_curves/lseries_ell.py +943 -0
  243. sage/schemes/elliptic_curves/mod5family.py +105 -0
  244. sage/schemes/elliptic_curves/mod_poly.py +197 -0
  245. sage/schemes/elliptic_curves/mod_sym_num.cpython-312-darwin.so +0 -0
  246. sage/schemes/elliptic_curves/mod_sym_num.pyx +3796 -0
  247. sage/schemes/elliptic_curves/modular_parametrization.py +305 -0
  248. sage/schemes/elliptic_curves/padic_lseries.py +1793 -0
  249. sage/schemes/elliptic_curves/padics.py +1816 -0
  250. sage/schemes/elliptic_curves/period_lattice.py +2234 -0
  251. sage/schemes/elliptic_curves/period_lattice_region.cpython-312-darwin.so +0 -0
  252. sage/schemes/elliptic_curves/period_lattice_region.pyx +722 -0
  253. sage/schemes/elliptic_curves/saturation.py +715 -0
  254. sage/schemes/elliptic_curves/sha_tate.py +1158 -0
  255. sage/schemes/elliptic_curves/weierstrass_morphism.py +1117 -0
  256. sage/schemes/elliptic_curves/weierstrass_transform.py +200 -0
  257. sage/schemes/hyperelliptic_curves/all.py +6 -0
  258. sage/schemes/hyperelliptic_curves/constructor.py +291 -0
  259. sage/schemes/hyperelliptic_curves/hyperelliptic_finite_field.py +1914 -0
  260. sage/schemes/hyperelliptic_curves/hyperelliptic_g2.py +192 -0
  261. sage/schemes/hyperelliptic_curves/hyperelliptic_generic.py +954 -0
  262. sage/schemes/hyperelliptic_curves/hyperelliptic_padic_field.py +1332 -0
  263. sage/schemes/hyperelliptic_curves/hyperelliptic_rational_field.py +84 -0
  264. sage/schemes/hyperelliptic_curves/invariants.py +410 -0
  265. sage/schemes/hyperelliptic_curves/jacobian_endomorphism_utils.py +315 -0
  266. sage/schemes/hyperelliptic_curves/jacobian_g2.py +32 -0
  267. sage/schemes/hyperelliptic_curves/jacobian_generic.py +419 -0
  268. sage/schemes/hyperelliptic_curves/jacobian_homset.py +186 -0
  269. sage/schemes/hyperelliptic_curves/jacobian_morphism.py +875 -0
  270. sage/schemes/hyperelliptic_curves/kummer_surface.py +99 -0
  271. sage/schemes/hyperelliptic_curves/mestre.py +302 -0
  272. sage/schemes/hyperelliptic_curves/monsky_washnitzer.py +3871 -0
  273. sage/schemes/jacobians/abstract_jacobian.py +277 -0
  274. sage/schemes/jacobians/all.py +2 -0
  275. sage/schemes/overview.py +161 -0
  276. sage/schemes/plane_conics/all.py +22 -0
  277. sage/schemes/plane_conics/con_field.py +1296 -0
  278. sage/schemes/plane_conics/con_finite_field.py +158 -0
  279. sage/schemes/plane_conics/con_number_field.py +456 -0
  280. sage/schemes/plane_conics/con_rational_field.py +406 -0
  281. sage/schemes/plane_conics/con_rational_function_field.py +580 -0
  282. sage/schemes/plane_conics/constructor.py +249 -0
  283. sage/schemes/plane_quartics/all.py +2 -0
  284. sage/schemes/plane_quartics/quartic_constructor.py +71 -0
  285. sage/schemes/plane_quartics/quartic_generic.py +73 -0
  286. sage/schemes/riemann_surfaces/all.py +1 -0
  287. sage/schemes/riemann_surfaces/riemann_surface.py +4117 -0
  288. sage_wheels/share/cremona/cremona_mini.db +0 -0
  289. sage_wheels/share/ellcurves/rank0 +30427 -0
  290. sage_wheels/share/ellcurves/rank1 +31871 -0
  291. sage_wheels/share/ellcurves/rank10 +6 -0
  292. sage_wheels/share/ellcurves/rank11 +6 -0
  293. sage_wheels/share/ellcurves/rank12 +1 -0
  294. sage_wheels/share/ellcurves/rank14 +1 -0
  295. sage_wheels/share/ellcurves/rank15 +1 -0
  296. sage_wheels/share/ellcurves/rank17 +1 -0
  297. sage_wheels/share/ellcurves/rank19 +1 -0
  298. sage_wheels/share/ellcurves/rank2 +2388 -0
  299. sage_wheels/share/ellcurves/rank20 +1 -0
  300. sage_wheels/share/ellcurves/rank21 +1 -0
  301. sage_wheels/share/ellcurves/rank22 +1 -0
  302. sage_wheels/share/ellcurves/rank23 +1 -0
  303. sage_wheels/share/ellcurves/rank24 +1 -0
  304. sage_wheels/share/ellcurves/rank28 +1 -0
  305. sage_wheels/share/ellcurves/rank3 +836 -0
  306. sage_wheels/share/ellcurves/rank4 +10 -0
  307. sage_wheels/share/ellcurves/rank5 +5 -0
  308. sage_wheels/share/ellcurves/rank6 +5 -0
  309. sage_wheels/share/ellcurves/rank7 +5 -0
  310. sage_wheels/share/ellcurves/rank8 +6 -0
  311. sage_wheels/share/ellcurves/rank9 +7 -0
@@ -0,0 +1,1037 @@
1
+ # sage_setup: distribution = sagemath-schemes
2
+ # sage.doctest: needs sage.combinat sage.graphs
3
+ r"""
4
+ Modular forms for Hecke triangle groups
5
+
6
+ AUTHORS:
7
+
8
+ - Jonas Jermann (2013): initial version
9
+ """
10
+ # ****************************************************************************
11
+ # Copyright (C) 2013-2014 Jonas Jermann <jjermann2@gmail.com>
12
+ #
13
+ # Distributed under the terms of the GNU General Public License (GPL)
14
+ # as published by the Free Software Foundation; either version 2 of
15
+ # the License, or (at your option) any later version.
16
+ # https://www.gnu.org/licenses/
17
+ # ****************************************************************************
18
+
19
+ from sage.rings.integer_ring import ZZ
20
+ from sage.rings.rational_field import QQ
21
+ from sage.rings.infinity import infinity
22
+
23
+ from sage.modules.module import Module
24
+ from sage.modules.free_module import FreeModule
25
+ from sage.modules.free_module_element import vector
26
+ from sage.structure.unique_representation import UniqueRepresentation
27
+ from sage.misc.cachefunc import cached_method
28
+
29
+ from .hecke_triangle_groups import HeckeTriangleGroup
30
+ from .abstract_space import FormsSpace_abstract
31
+
32
+
33
+ def canonical_parameters(group, base_ring, k, ep, n=None):
34
+ r"""
35
+ Return a canonical version of the parameters.
36
+
37
+ EXAMPLES::
38
+
39
+ sage: from sage.modular.modform_hecketriangle.space import canonical_parameters
40
+ sage: canonical_parameters(5, ZZ, 20/3, int(1))
41
+ (Hecke triangle group for n = 5, Integer Ring, 20/3, 1, 5)
42
+
43
+ sage: canonical_parameters(infinity, ZZ, 2, int(-1))
44
+ (Hecke triangle group for n = +Infinity, Integer Ring, 2, -1, +Infinity)
45
+ """
46
+ if n is not None:
47
+ group = n
48
+
49
+ if group == infinity:
50
+ group = HeckeTriangleGroup(infinity)
51
+ else:
52
+ try:
53
+ group = HeckeTriangleGroup(ZZ(group))
54
+ except TypeError:
55
+ group = HeckeTriangleGroup(group.n())
56
+
57
+ n = group.n()
58
+ k = QQ(k)
59
+ if ep is None:
60
+ if n == infinity:
61
+ ep = (-1)**(k / 2)
62
+ elif ZZ(2).divides(n):
63
+ ep = (-1)**(k*ZZ(n-2)/ZZ(4))
64
+ else:
65
+ ep = (-1)**(k*ZZ(n-2)/ZZ(2))
66
+ ep = ZZ(ep)
67
+
68
+ if n == infinity:
69
+ num = (k-(1-ep)) / ZZ(4)
70
+ else:
71
+ num = (k-(1-ep)*n/(n-2)) * (n-2) / ZZ(4)
72
+
73
+ try:
74
+ num = ZZ(num)
75
+ except TypeError:
76
+ raise ValueError(f"Invalid or non-occurring weight k={k}, ep={ep}!")
77
+
78
+ return (group, base_ring, k, ep, n)
79
+
80
+
81
+ class QuasiMeromorphicModularForms(FormsSpace_abstract, Module, UniqueRepresentation):
82
+ r"""
83
+ Module of (Hecke) quasi meromorphic modular forms
84
+ for the given group, base ring, weight and multiplier
85
+ """
86
+
87
+ @staticmethod
88
+ def __classcall__(cls, group=HeckeTriangleGroup(3), base_ring=ZZ, k=QQ(0), ep=None, n=None):
89
+ r"""
90
+ Return a (cached) instance with canonical parameters.
91
+
92
+ EXAMPLES::
93
+
94
+ sage: from sage.modular.modform_hecketriangle.space import (canonical_parameters, QuasiMeromorphicModularForms)
95
+ sage: (group, base_ring, k, ep, n) = canonical_parameters(5, ZZ, 20/3, int(1))
96
+ sage: QuasiMeromorphicModularForms(5, ZZ, 20/3, int(1)) == QuasiMeromorphicModularForms(group, base_ring, k, ep, n)
97
+ True
98
+ """
99
+ (group, base_ring, k, ep, n) = canonical_parameters(group, base_ring, k, ep, n)
100
+ return super().__classcall__(cls, group=group, base_ring=base_ring, k=k, ep=ep, n=n)
101
+
102
+ def __init__(self, group, base_ring, k, ep, n):
103
+ r"""
104
+ Return the Module of (Hecke) quasi meromorphic modular forms
105
+ of weight ``k`` with multiplier ``ep`` for the given ``group`` and ``base_ring``.
106
+
107
+ EXAMPLES::
108
+
109
+ sage: from sage.modular.modform_hecketriangle.space import QuasiMeromorphicModularForms
110
+ sage: MF = QuasiMeromorphicModularForms(5, ZZ, 20/3, 1)
111
+ sage: MF
112
+ QuasiMeromorphicModularForms(n=5, k=20/3, ep=1) over Integer Ring
113
+ sage: MF.analytic_type()
114
+ quasi meromorphic modular
115
+ sage: MF.category()
116
+ Category of modules over Integer Ring
117
+ sage: MF in MF.category()
118
+ True
119
+ sage: MF.ambient_space() == MF
120
+ True
121
+ """
122
+ FormsSpace_abstract.__init__(self, group=group, base_ring=base_ring, k=k, ep=ep, n=n)
123
+ Module.__init__(self, base=base_ring)
124
+ self._analytic_type = self.AT(["quasi", "mero"])
125
+
126
+
127
+ class QuasiWeakModularForms(FormsSpace_abstract, Module, UniqueRepresentation):
128
+ r"""
129
+ Module of (Hecke) quasi weakly holomorphic modular forms
130
+ for the given group, base ring, weight and multiplier
131
+ """
132
+
133
+ @staticmethod
134
+ def __classcall__(cls, group=HeckeTriangleGroup(3), base_ring=ZZ, k=QQ(0), ep=None, n=None):
135
+ r"""
136
+ Return a (cached) instance with canonical parameters.
137
+
138
+ EXAMPLES::
139
+
140
+ sage: from sage.modular.modform_hecketriangle.space import (canonical_parameters, QuasiWeakModularForms)
141
+ sage: (group, base_ring, k, ep, n) = canonical_parameters(4, ZZ, 8, -1)
142
+ sage: QuasiWeakModularForms(4, ZZ, 8, -1) == QuasiWeakModularForms(group, base_ring, k, ep, n)
143
+ True
144
+ """
145
+
146
+ (group, base_ring, k, ep, n) = canonical_parameters(group, base_ring, k, ep, n)
147
+ return super().__classcall__(cls, group=group, base_ring=base_ring, k=k, ep=ep, n=n)
148
+
149
+ def __init__(self, group, base_ring, k, ep, n):
150
+ r"""
151
+ Return the Module of (Hecke) quasi weakly holomorphic modular forms
152
+ of weight ``k`` with multiplier ``ep`` for the given ``group`` and ``base_ring``.
153
+
154
+ EXAMPLES::
155
+
156
+ sage: from sage.modular.modform_hecketriangle.space import QuasiWeakModularForms
157
+ sage: MF = QuasiWeakModularForms(4, ZZ, 8, 1)
158
+ sage: MF
159
+ QuasiWeakModularForms(n=4, k=8, ep=1) over Integer Ring
160
+ sage: MF.analytic_type()
161
+ quasi weakly holomorphic modular
162
+ sage: MF.category()
163
+ Category of modules over Integer Ring
164
+ sage: MF in MF.category()
165
+ True
166
+ sage: MF.is_ambient()
167
+ True
168
+ """
169
+ FormsSpace_abstract.__init__(self, group=group, base_ring=base_ring, k=k, ep=ep, n=n)
170
+ Module.__init__(self, base=base_ring)
171
+ self._analytic_type = self.AT(["quasi", "weak"])
172
+
173
+
174
+ class QuasiModularForms(FormsSpace_abstract, Module, UniqueRepresentation):
175
+ r"""
176
+ Module of (Hecke) quasi modular forms
177
+ for the given group, base ring, weight and multiplier
178
+ """
179
+
180
+ @staticmethod
181
+ def __classcall__(cls, group=HeckeTriangleGroup(3), base_ring=ZZ, k=QQ(0), ep=None, n=None):
182
+ r"""
183
+ Return a (cached) instance with canonical parameters.
184
+
185
+ EXAMPLES::
186
+
187
+ sage: from sage.modular.modform_hecketriangle.space import (canonical_parameters, QuasiModularForms)
188
+ sage: (group, base_ring, k, ep, n) = canonical_parameters(5, ZZ, 10/3, -1)
189
+ sage: QuasiModularForms(5, ZZ, 10/3) == QuasiModularForms(group, base_ring, k, ep, n)
190
+ True
191
+ """
192
+
193
+ (group, base_ring, k, ep, n) = canonical_parameters(group, base_ring, k, ep, n)
194
+ return super().__classcall__(cls, group=group, base_ring=base_ring, k=k, ep=ep, n=n)
195
+
196
+ def __init__(self, group, base_ring, k, ep, n):
197
+ r"""
198
+ Return the Module of (Hecke) quasi modular forms
199
+ of weight ``k`` with multiplier ``ep`` for the given ``group`` and ``base_ring``.
200
+
201
+ EXAMPLES::
202
+
203
+ sage: from sage.modular.modform_hecketriangle.space import QuasiModularForms
204
+ sage: MF = QuasiModularForms(5, ZZ, 20/3, 1)
205
+ sage: MF
206
+ QuasiModularForms(n=5, k=20/3, ep=1) over Integer Ring
207
+ sage: MF.analytic_type()
208
+ quasi modular
209
+ sage: MF.category()
210
+ Category of modules over Integer Ring
211
+ sage: MF in MF.category()
212
+ True
213
+ sage: MF.is_ambient()
214
+ True
215
+ """
216
+
217
+ FormsSpace_abstract.__init__(self, group=group, base_ring=base_ring, k=k, ep=ep, n=n)
218
+ Module.__init__(self, base=base_ring)
219
+ self._analytic_type = self.AT(["quasi", "holo"])
220
+ self._module = FreeModule(self.coeff_ring(), self.dimension())
221
+
222
+ @cached_method
223
+ def gens(self) -> tuple:
224
+ r"""
225
+ Return a basis of ``self`` as a tuple of basis elements.
226
+
227
+ EXAMPLES::
228
+
229
+ sage: from sage.modular.modform_hecketriangle.space import QuasiModularForms
230
+ sage: MF = QuasiModularForms(n=5, k=6, ep=-1)
231
+ sage: MF.default_prec(2)
232
+ sage: MF.gens()
233
+ (1 - 37/(200*d)*q + O(q^2),
234
+ 1 + 33/(200*d)*q + O(q^2),
235
+ 1 - 27/(200*d)*q + O(q^2))
236
+
237
+ sage: MF = QuasiModularForms(n=infinity, k=2, ep=-1)
238
+ sage: MF.default_prec(2)
239
+ sage: MF.gens()
240
+ (1 - 24*q + O(q^2), 1 - 8*q + O(q^2))
241
+ """
242
+ return self.quasi_part_gens()
243
+
244
+ @cached_method
245
+ def dimension(self):
246
+ r"""
247
+ Return the dimension of ``self``.
248
+
249
+ EXAMPLES::
250
+
251
+ sage: from sage.modular.modform_hecketriangle.space import QuasiModularForms
252
+ sage: MF = QuasiModularForms(n=5, k=6, ep=-1)
253
+ sage: MF.dimension()
254
+ 3
255
+ sage: len(MF.gens()) == MF.dimension()
256
+ True
257
+ """
258
+ return self.quasi_part_dimension()
259
+
260
+ @cached_method
261
+ def coordinate_vector(self, v):
262
+ r"""
263
+ Return the coordinate vector of ``v`` with respect to
264
+ the basis ``self.gens()``.
265
+
266
+ INPUT:
267
+
268
+ - ``v`` -- an element of ``self``
269
+
270
+ OUTPUT:
271
+
272
+ An element of ``self.module()``, namely the
273
+ corresponding coordinate vector of ``v`` with respect
274
+ to the basis ``self.gens()``.
275
+
276
+ The module is the free module over the coefficient
277
+ ring of ``self`` with the dimension of ``self``.
278
+
279
+ EXAMPLES::
280
+
281
+ sage: from sage.modular.modform_hecketriangle.space import QuasiModularForms
282
+ sage: MF = QuasiModularForms(n=6, k=20, ep=1)
283
+ sage: MF.dimension()
284
+ 22
285
+ sage: el = MF(MF.E4()^2*MF.E6()^2 + MF.E4()*MF.E2()^2*MF.Delta() + MF.E2()^3*MF.E4()^2*MF.E6())
286
+ sage: el
287
+ 2 + 25*q - 2478*q^2 - 82731*q^3 - 448484*q^4 + O(q^5)
288
+ sage: vec = el.coordinate_vector() # long time
289
+ sage: vec # long time
290
+ (1, 1/(9*d), -11/(81*d^2), -4499/(104976*d^3), 0, 0, 0, 0, 1, 1/(2*d), 1, 5/(18*d), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
291
+ sage: vec.parent() # long time
292
+ Vector space of dimension 22 over Fraction Field of Univariate Polynomial Ring in d over Integer Ring
293
+ sage: vec.parent() == MF.module() # long time
294
+ True
295
+ sage: el == MF(sum([vec[l]*MF.gen(l) for l in range(0,22)])) # long time
296
+ True
297
+ sage: el == MF.element_from_coordinates(vec) # long time
298
+ True
299
+ sage: MF.gen(1).coordinate_vector() == vector([0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]) # long time
300
+ True
301
+
302
+ sage: MF = QuasiModularForms(n=infinity, k=4, ep=1)
303
+ sage: el2 = MF.E4() + MF.E2()^2
304
+ sage: el2
305
+ 2 + 160*q^2 + 512*q^3 + 1632*q^4 + O(q^5)
306
+ sage: el2.coordinate_vector()
307
+ (1, 1/(4*d), 0, 1)
308
+ sage: el2 == MF.element_from_coordinates(el2.coordinate_vector())
309
+ True
310
+ """
311
+ x, y, z, d = self.pol_ring().gens()
312
+ k = self._weight
313
+ rmax = (QQ(k) / 2).floor()
314
+ partlist = v.rat().numerator().polynomial(z).list()
315
+ denom = self.coeff_ring()(v.rat().denominator())
316
+ partlist = [part / denom for part in partlist]
317
+ parts = partlist + [0] * (rmax + 1 - len(partlist))
318
+ E2 = self.E2()
319
+ coord_vector = []
320
+
321
+ for r in range(rmax + 1):
322
+ gens = [v / E2**r for v in self.quasi_part_gens(r)]
323
+
324
+ if gens:
325
+ ambient_space = self.graded_ring().reduce_type("holo", degree=(gens[0].weight(), gens[0].ep()))
326
+ subspace = ambient_space.subspace(gens)
327
+ vector_part_in_subspace = subspace(parts[r])
328
+ coord_part = list(vector_part_in_subspace.coordinate_vector())
329
+ coord_vector += coord_part
330
+
331
+ return self._module(vector(self.coeff_ring(), coord_vector))
332
+
333
+
334
+ class QuasiCuspForms(FormsSpace_abstract, Module, UniqueRepresentation):
335
+ r"""
336
+ Module of (Hecke) quasi cusp forms
337
+ for the given group, base ring, weight and multiplier
338
+ """
339
+
340
+ @staticmethod
341
+ def __classcall__(cls, group=HeckeTriangleGroup(3), base_ring=ZZ, k=QQ(0), ep=None, n=None):
342
+ r"""
343
+ Return a (cached) instance with canonical parameters.
344
+
345
+ EXAMPLES::
346
+
347
+ sage: from sage.modular.modform_hecketriangle.space import (canonical_parameters, QuasiCuspForms)
348
+ sage: (group, base_ring, k, ep, n) = canonical_parameters(8, ZZ, 16/3, None)
349
+ sage: QuasiCuspForms(8, ZZ, 16/3) == QuasiCuspForms(group, base_ring, k, ep, n)
350
+ True
351
+ """
352
+
353
+ (group, base_ring, k, ep, n) = canonical_parameters(group, base_ring, k, ep, n)
354
+ return super().__classcall__(cls, group=group, base_ring=base_ring, k=k, ep=ep, n=n)
355
+
356
+ def __init__(self, group, base_ring, k, ep, n):
357
+ r"""
358
+ Return the Module of (Hecke) quasi cusp forms
359
+ of weight ``k`` with multiplier ``ep`` for the given ``group`` and ``base_ring``.
360
+
361
+ EXAMPLES::
362
+
363
+ sage: from sage.modular.modform_hecketriangle.space import QuasiCuspForms
364
+ sage: MF = QuasiCuspForms(8, ZZ, 16/3)
365
+ sage: MF
366
+ QuasiCuspForms(n=8, k=16/3, ep=1) over Integer Ring
367
+ sage: MF.analytic_type()
368
+ quasi cuspidal
369
+ sage: MF.category()
370
+ Category of modules over Integer Ring
371
+ sage: MF in MF.category()
372
+ True
373
+ sage: MF.is_ambient()
374
+ True
375
+
376
+ sage: QuasiCuspForms(n=infinity)
377
+ QuasiCuspForms(n=+Infinity, k=0, ep=1) over Integer Ring
378
+ """
379
+
380
+ FormsSpace_abstract.__init__(self, group=group, base_ring=base_ring, k=k, ep=ep, n=n)
381
+ Module.__init__(self, base=base_ring)
382
+ self._analytic_type = self.AT(["quasi", "cusp"])
383
+ self._module = FreeModule(self.coeff_ring(), self.dimension())
384
+
385
+ @cached_method
386
+ def gens(self) -> tuple:
387
+ r"""
388
+ Return a basis of ``self`` as a tuple of basis elements.
389
+
390
+ EXAMPLES::
391
+
392
+ sage: from sage.modular.modform_hecketriangle.space import QuasiCuspForms
393
+ sage: MF = QuasiCuspForms(n=8, k=46/3, ep=-1)
394
+ sage: MF.default_prec(4)
395
+ sage: MF.dimension()
396
+ 7
397
+ sage: MF.gens()
398
+ (q - 17535/(262144*d^2)*q^3 + O(q^4),
399
+ q^2 - 47/(128*d)*q^3 + O(q^4),
400
+ q - 9/(128*d)*q^2 + 15633/(262144*d^2)*q^3 + O(q^4),
401
+ q^2 - 7/(128*d)*q^3 + O(q^4),
402
+ q - 23/(64*d)*q^2 - 3103/(262144*d^2)*q^3 + O(q^4),
403
+ q - 3/(64*d)*q^2 - 4863/(262144*d^2)*q^3 + O(q^4),
404
+ q - 27/(64*d)*q^2 + 17217/(262144*d^2)*q^3 + O(q^4))
405
+
406
+ sage: MF = QuasiCuspForms(n=infinity, k=10, ep=-1)
407
+ sage: MF.gens()
408
+ (q - 16*q^2 - 156*q^3 - 256*q^4 + O(q^5), q - 60*q^3 - 256*q^4 + O(q^5))
409
+ """
410
+ return self.quasi_part_gens()
411
+
412
+ @cached_method
413
+ def dimension(self):
414
+ r"""
415
+ Return the dimension of ``self``.
416
+
417
+ EXAMPLES::
418
+
419
+ sage: from sage.modular.modform_hecketriangle.space import QuasiCuspForms
420
+ sage: MF = QuasiCuspForms(n=8, k=46/3, ep=-1)
421
+ sage: MF.default_prec(3)
422
+ sage: MF.dimension()
423
+ 7
424
+ sage: len(MF.gens()) == MF.dimension()
425
+ True
426
+
427
+ sage: QuasiCuspForms(n=infinity, k=10, ep=-1).dimension()
428
+ 2
429
+ """
430
+
431
+ return self.quasi_part_dimension()
432
+
433
+ @cached_method
434
+ def coordinate_vector(self, v):
435
+ r"""
436
+ Return the coordinate vector of ``v`` with respect to
437
+ the basis ``self.gens()``.
438
+
439
+ INPUT:
440
+
441
+ - ``v`` -- an element of ``self``
442
+
443
+ OUTPUT:
444
+
445
+ An element of ``self.module()``, namely the
446
+ corresponding coordinate vector of ``v`` with respect
447
+ to the basis ``self.gens()``.
448
+
449
+ The module is the free module over the coefficient
450
+ ring of ``self`` with the dimension of ``self``.
451
+
452
+ EXAMPLES::
453
+
454
+ sage: from sage.modular.modform_hecketriangle.space import QuasiCuspForms
455
+ sage: MF = QuasiCuspForms(n=6, k=20, ep=1)
456
+ sage: MF.dimension()
457
+ 12
458
+ sage: el = MF(MF.E4()^2*MF.Delta() + MF.E4()*MF.E2()^2*MF.Delta())
459
+ sage: el
460
+ 2*q + 120*q^2 + 3402*q^3 + 61520*q^4 + O(q^5)
461
+ sage: vec = el.coordinate_vector() # long time
462
+ sage: vec # long time
463
+ (1, 13/(18*d), 103/(432*d^2), 0, 0, 1, 1/(2*d), 0, 0, 0, 0, 0)
464
+ sage: vec.parent() # long time
465
+ Vector space of dimension 12 over Fraction Field of Univariate Polynomial Ring in d over Integer Ring
466
+ sage: vec.parent() == MF.module() # long time
467
+ True
468
+ sage: el == MF(sum([vec[l]*MF.gen(l) for l in range(0,12)])) # long time
469
+ True
470
+ sage: el == MF.element_from_coordinates(vec) # long time
471
+ True
472
+ sage: MF.gen(1).coordinate_vector() == vector([0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]) # long time
473
+ True
474
+
475
+ sage: MF = QuasiCuspForms(n=infinity, k=10, ep=-1)
476
+ sage: el2 = MF(MF.E4()*MF.f_inf()*(MF.f_i() - MF.E2()))
477
+ sage: el2.coordinate_vector()
478
+ (1, -1)
479
+ sage: el2 == MF.element_from_coordinates(el2.coordinate_vector())
480
+ True
481
+ """
482
+ x, y, z, d = self.pol_ring().gens()
483
+ k = self._weight
484
+ rmax = (QQ(k) / 2).floor()
485
+ partlist = v.rat().numerator().polynomial(z).list()
486
+ denom = self.coeff_ring()(v.rat().denominator())
487
+ partlist = [part / denom for part in partlist]
488
+ parts = partlist + [0] * (rmax + 1 - len(partlist))
489
+ E2 = self.E2()
490
+ coord_vector = []
491
+
492
+ for r in range(rmax + 1):
493
+ gens = [v / E2**r for v in self.quasi_part_gens(r)]
494
+
495
+ if gens:
496
+ ambient_space = self.graded_ring().reduce_type("cusp", degree=(gens[0].weight(), gens[0].ep()))
497
+ subspace = ambient_space.subspace(gens)
498
+ vector_part_in_subspace = subspace(parts[r])
499
+ coord_part = list(vector_part_in_subspace.coordinate_vector())
500
+ coord_vector += coord_part
501
+
502
+ return self._module(vector(self.coeff_ring(), coord_vector))
503
+
504
+
505
+ class MeromorphicModularForms(FormsSpace_abstract, Module, UniqueRepresentation):
506
+ r"""
507
+ Module of (Hecke) meromorphic modular forms
508
+ for the given group, base ring, weight and multiplier
509
+ """
510
+
511
+ @staticmethod
512
+ def __classcall__(cls, group=HeckeTriangleGroup(3), base_ring=ZZ, k=QQ(0), ep=None, n=None):
513
+ r"""
514
+ Return a (cached) instance with canonical parameters.
515
+
516
+ EXAMPLES::
517
+
518
+ sage: from sage.modular.modform_hecketriangle.space import (canonical_parameters, MeromorphicModularForms)
519
+ sage: (group, base_ring, k, ep, n) = canonical_parameters(3, ZZ, 0, 1)
520
+ sage: MeromorphicModularForms() == MeromorphicModularForms(group, base_ring, k, ep, n)
521
+ True
522
+ """
523
+
524
+ (group, base_ring, k, ep, n) = canonical_parameters(group, base_ring, k, ep, n)
525
+ return super().__classcall__(cls, group=group, base_ring=base_ring, k=k, ep=ep, n=n)
526
+
527
+ def __init__(self, group, base_ring, k, ep, n):
528
+ r"""
529
+ Return the Module of (Hecke) meromorphic modular forms
530
+ of weight ``k`` with multiplier ``ep`` for the given ``group`` and ``base_ring``.
531
+
532
+ EXAMPLES::
533
+
534
+ sage: from sage.modular.modform_hecketriangle.space import MeromorphicModularForms
535
+ sage: MF = MeromorphicModularForms()
536
+ sage: MF
537
+ MeromorphicModularForms(n=3, k=0, ep=1) over Integer Ring
538
+ sage: MF.analytic_type()
539
+ meromorphic modular
540
+ sage: MF.category()
541
+ Category of modules over Integer Ring
542
+ sage: MF in MF.category()
543
+ True
544
+ sage: MF.is_ambient()
545
+ True
546
+ """
547
+
548
+ FormsSpace_abstract.__init__(self, group=group, base_ring=base_ring, k=k, ep=ep, n=n)
549
+ Module.__init__(self, base=base_ring)
550
+ self._analytic_type = self.AT(["mero"])
551
+
552
+
553
+ class WeakModularForms(FormsSpace_abstract, Module, UniqueRepresentation):
554
+ r"""
555
+ Module of (Hecke) weakly holomorphic modular forms
556
+ for the given group, base ring, weight and multiplier
557
+ """
558
+
559
+ @staticmethod
560
+ def __classcall__(cls, group=HeckeTriangleGroup(3), base_ring=ZZ, k=QQ(0), ep=None, n=None):
561
+ r"""
562
+ Return a (cached) instance with canonical parameters.
563
+
564
+ EXAMPLES::
565
+
566
+ sage: from sage.modular.modform_hecketriangle.space import (canonical_parameters, WeakModularForms)
567
+ sage: (group, base_ring, k, ep, n) = canonical_parameters(5, CC, 20/3, None)
568
+ sage: WeakModularForms(5, CC, 20/3) == WeakModularForms(group, base_ring, k, ep, n)
569
+ True
570
+ """
571
+
572
+ (group, base_ring, k, ep, n) = canonical_parameters(group, base_ring, k, ep, n)
573
+ return super().__classcall__(cls, group=group, base_ring=base_ring, k=k, ep=ep, n=n)
574
+
575
+ def __init__(self, group, base_ring, k, ep, n):
576
+ r"""
577
+ Return the Module of (Hecke) weakly holomorphic modular forms
578
+ of weight ``k`` with multiplier ``ep`` for the given ``group`` and ``base_ring``.
579
+
580
+ EXAMPLES::
581
+
582
+ sage: from sage.modular.modform_hecketriangle.space import WeakModularForms
583
+ sage: MF = WeakModularForms(5, CC, 20/3)
584
+ sage: MF
585
+ WeakModularForms(n=5, k=20/3, ep=1) over Complex Field with 53 bits of precision
586
+ sage: MF.analytic_type()
587
+ weakly holomorphic modular
588
+ sage: MF.category()
589
+ Category of vector spaces over Complex Field with 53 bits of precision
590
+ sage: MF in MF.category()
591
+ True
592
+ """
593
+ FormsSpace_abstract.__init__(self, group=group, base_ring=base_ring, k=k, ep=ep, n=n)
594
+ Module.__init__(self, base=base_ring)
595
+ self._analytic_type = self.AT(["weak"])
596
+
597
+
598
+ class ModularForms(FormsSpace_abstract, Module, UniqueRepresentation):
599
+ r"""
600
+ Module of (Hecke) modular forms
601
+ for the given group, base ring, weight and multiplier
602
+ """
603
+
604
+ @staticmethod
605
+ def __classcall__(cls, group=HeckeTriangleGroup(3), base_ring=ZZ, k=QQ(0), ep=None, n=None):
606
+ r"""
607
+ Return a (cached) instance with canonical parameters.
608
+
609
+ EXAMPLES::
610
+
611
+ sage: from sage.modular.modform_hecketriangle.space import (canonical_parameters, ModularForms)
612
+ sage: (group, base_ring, k, ep, n) = canonical_parameters(3, ZZ, 0, None)
613
+ sage: ModularForms() == ModularForms(group, base_ring, k, ep, n)
614
+ True
615
+ """
616
+
617
+ (group, base_ring, k, ep, n) = canonical_parameters(group, base_ring, k, ep, n)
618
+ return super().__classcall__(cls, group=group, base_ring=base_ring, k=k, ep=ep, n=n)
619
+
620
+ def __init__(self, group, base_ring, k, ep, n):
621
+ r"""
622
+ Return the Module of (Hecke) modular forms
623
+ of weight ``k`` with multiplier ``ep`` for the given ``group`` and ``base_ring``.
624
+
625
+ EXAMPLES::
626
+
627
+ sage: from sage.modular.modform_hecketriangle.space import ModularForms
628
+ sage: MF = ModularForms()
629
+ sage: MF
630
+ ModularForms(n=3, k=0, ep=1) over Integer Ring
631
+ sage: MF.analytic_type()
632
+ modular
633
+ sage: MF.category()
634
+ Category of modules over Integer Ring
635
+ sage: MF in MF.category()
636
+ True
637
+ sage: MF.module()
638
+ Vector space of dimension 1 over Fraction Field of Univariate Polynomial Ring in d over Integer Ring
639
+ sage: MF.ambient_module() == MF.module()
640
+ True
641
+ sage: MF.is_ambient()
642
+ True
643
+
644
+ sage: MF = ModularForms(n=infinity, k=8)
645
+ sage: MF
646
+ ModularForms(n=+Infinity, k=8, ep=1) over Integer Ring
647
+ sage: MF.analytic_type()
648
+ modular
649
+ sage: MF.category()
650
+ Category of modules over Integer Ring
651
+ sage: MF in MF.category()
652
+ True
653
+ """
654
+
655
+ FormsSpace_abstract.__init__(self, group=group, base_ring=base_ring, k=k, ep=ep, n=n)
656
+ Module.__init__(self, base=base_ring)
657
+ self._analytic_type = self.AT(["holo"])
658
+ self._module = FreeModule(self.coeff_ring(), self.dimension())
659
+
660
+ @cached_method
661
+ def gens(self) -> tuple:
662
+ r"""
663
+ Return a basis of ``self`` as a tuple of basis elements.
664
+
665
+ EXAMPLES::
666
+
667
+ sage: from sage.modular.modform_hecketriangle.space import ModularForms
668
+ sage: MF = ModularForms(n=6, k=20, ep=1)
669
+ sage: MF.dimension()
670
+ 4
671
+ sage: MF.gens()
672
+ (1 + 360360*q^4 + O(q^5),
673
+ q + 21742*q^4 + O(q^5),
674
+ q^2 + 702*q^4 + O(q^5),
675
+ q^3 - 6*q^4 + O(q^5))
676
+
677
+ sage: ModularForms(n=infinity, k=4).gens()
678
+ (1 + 240*q^2 + 2160*q^4 + O(q^5),
679
+ q - 8*q^2 + 28*q^3 - 64*q^4 + O(q^5))
680
+ """
681
+ return tuple(self.F_basis(m) for m in range(self.dimension()))
682
+
683
+ @cached_method
684
+ def dimension(self):
685
+ r"""
686
+ Return the dimension of ``self``.
687
+
688
+ EXAMPLES::
689
+
690
+ sage: from sage.modular.modform_hecketriangle.space import ModularForms
691
+ sage: MF = ModularForms(n=6, k=20, ep=1)
692
+ sage: MF.dimension()
693
+ 4
694
+ sage: len(MF.gens()) == MF.dimension()
695
+ True
696
+
697
+ sage: ModularForms(n=infinity, k=8).dimension()
698
+ 3
699
+ """
700
+ return max(self._l1 + 1, ZZ.zero())
701
+
702
+ @cached_method
703
+ def coordinate_vector(self, v):
704
+ r"""
705
+ Return the coordinate vector of ``v`` with respect to
706
+ the basis ``self.gens()``.
707
+
708
+ INPUT:
709
+
710
+ - ``v`` -- an element of ``self``
711
+
712
+ OUTPUT:
713
+
714
+ An element of ``self.module()``, namely the
715
+ corresponding coordinate vector of ``v`` with respect
716
+ to the basis ``self.gens()``.
717
+
718
+ The module is the free module over the coefficient
719
+ ring of ``self`` with the dimension of ``self``.
720
+
721
+ EXAMPLES::
722
+
723
+ sage: from sage.modular.modform_hecketriangle.space import ModularForms
724
+ sage: MF = ModularForms(n=6, k=20, ep=1)
725
+ sage: MF.dimension()
726
+ 4
727
+ sage: el = MF.E4()^2*MF.Delta()
728
+ sage: el
729
+ q + 78*q^2 + 2781*q^3 + 59812*q^4 + O(q^5)
730
+ sage: vec = el.coordinate_vector()
731
+ sage: vec
732
+ (0, 1, 13/(18*d), 103/(432*d^2))
733
+ sage: vec.parent()
734
+ Vector space of dimension 4 over Fraction Field of Univariate Polynomial Ring in d over Integer Ring
735
+ sage: vec.parent() == MF.module()
736
+ True
737
+ sage: el == vec[0]*MF.gen(0) + vec[1]*MF.gen(1) + vec[2]*MF.gen(2) + vec[3]*MF.gen(3)
738
+ True
739
+ sage: el == MF.element_from_coordinates(vec)
740
+ True
741
+
742
+ sage: MF = ModularForms(n=infinity, k=8, ep=1)
743
+ sage: (MF.E4()^2).coordinate_vector()
744
+ (1, 1/(2*d), 15/(128*d^2))
745
+ """
746
+
747
+ vec = v.q_expansion_vector(min_exp=0, max_exp=self.degree() - 1)
748
+ return self._module(vec)
749
+
750
+
751
+ class CuspForms(FormsSpace_abstract, Module, UniqueRepresentation):
752
+ r"""
753
+ Module of (Hecke) cusp forms
754
+ for the given group, base ring, weight and multiplier
755
+ """
756
+
757
+ @staticmethod
758
+ def __classcall__(cls, group=HeckeTriangleGroup(3), base_ring=ZZ, k=QQ(0), ep=None, n=None):
759
+ r"""
760
+ Return a (cached) instance with canonical parameters.
761
+
762
+ EXAMPLES::
763
+
764
+ sage: from sage.modular.modform_hecketriangle.space import (canonical_parameters, CuspForms)
765
+ sage: (group, base_ring, k, ep, n) = canonical_parameters(6, ZZ, 6, 1)
766
+ sage: CuspForms(6, ZZ, 6, 1) == CuspForms(group, base_ring, k, ep, n)
767
+ True
768
+ """
769
+ (group, base_ring, k, ep, n) = canonical_parameters(group, base_ring, k, ep, n)
770
+ return super().__classcall__(cls, group=group, base_ring=base_ring, k=k, ep=ep, n=n)
771
+
772
+ def __init__(self, group, base_ring, k, ep, n):
773
+ r"""
774
+ Return the Module of (Hecke) cusp forms
775
+ of weight ``k`` with multiplier ``ep`` for the given ``group`` and ``base_ring``.
776
+
777
+ EXAMPLES::
778
+
779
+ sage: from sage.modular.modform_hecketriangle.space import CuspForms
780
+ sage: MF = CuspForms(6, ZZ, 6, 1)
781
+ sage: MF
782
+ CuspForms(n=6, k=6, ep=1) over Integer Ring
783
+ sage: MF.analytic_type()
784
+ cuspidal
785
+ sage: MF.category()
786
+ Category of modules over Integer Ring
787
+ sage: MF in MF.category()
788
+ True
789
+ sage: MF.module()
790
+ Vector space of dimension 1 over Fraction Field of Univariate Polynomial Ring in d over Integer Ring
791
+ sage: MF.ambient_module() == MF.module()
792
+ True
793
+ sage: MF.is_ambient()
794
+ True
795
+ """
796
+ FormsSpace_abstract.__init__(self, group=group, base_ring=base_ring, k=k, ep=ep, n=n)
797
+ Module.__init__(self, base=base_ring)
798
+ self._analytic_type = self.AT(["cusp"])
799
+ self._module = FreeModule(self.coeff_ring(), self.dimension())
800
+
801
+ @cached_method
802
+ def gens(self) -> tuple:
803
+ r"""
804
+ Return a basis of ``self`` as a tuple of basis elements.
805
+
806
+ EXAMPLES::
807
+
808
+ sage: from sage.modular.modform_hecketriangle.space import CuspForms
809
+ sage: MF=CuspForms(n=12, k=72/5, ep=1)
810
+ sage: MF
811
+ CuspForms(n=12, k=72/5, ep=1) over Integer Ring
812
+ sage: MF.dimension()
813
+ 3
814
+ sage: MF.gens()
815
+ (q + 296888795/(10319560704*d^3)*q^4 + O(q^5),
816
+ q^2 + 6629/(221184*d^2)*q^4 + O(q^5),
817
+ q^3 - 25/(96*d)*q^4 + O(q^5))
818
+
819
+ sage: MF = CuspForms(n=infinity, k=8, ep=1)
820
+ sage: MF.gen(0) == MF.E4()*MF.f_inf()
821
+ True
822
+ """
823
+ return tuple(self.F_basis(m, order_1=ZZ.one())
824
+ for m in range(1, self.dimension() + 1))
825
+
826
+ @cached_method
827
+ def dimension(self):
828
+ r"""
829
+ Return the dimension of ``self``.
830
+
831
+ EXAMPLES::
832
+
833
+ sage: from sage.modular.modform_hecketriangle.space import CuspForms
834
+ sage: MF = CuspForms(n=12, k=72/5, ep=1)
835
+ sage: MF.dimension()
836
+ 3
837
+ sage: len(MF.gens()) == MF.dimension()
838
+ True
839
+
840
+ sage: CuspForms(n=infinity, k=8).dimension()
841
+ 1
842
+ """
843
+ if self.hecke_n() == infinity:
844
+ return max(self._l1 - 1, ZZ.zero())
845
+ return max(self._l1, ZZ.zero())
846
+
847
+ @cached_method
848
+ def coordinate_vector(self, v):
849
+ r"""
850
+ Return the coordinate vector of ``v`` with respect to
851
+ the basis ``self.gens()``.
852
+
853
+ INPUT:
854
+
855
+ - ``v`` -- an element of ``self``
856
+
857
+ OUTPUT:
858
+
859
+ An element of ``self.module()``, namely the
860
+ corresponding coordinate vector of ``v`` with respect
861
+ to the basis ``self.gens()``.
862
+
863
+ The module is the free module over the coefficient
864
+ ring of ``self`` with the dimension of ``self``.
865
+
866
+ EXAMPLES::
867
+
868
+ sage: from sage.modular.modform_hecketriangle.space import CuspForms
869
+ sage: MF = CuspForms(n=12, k=72/5, ep=-1)
870
+ sage: MF.default_prec(4)
871
+ sage: MF.dimension()
872
+ 2
873
+ sage: el = MF(MF.f_i()*MF.Delta())
874
+ sage: el
875
+ q - 1/(288*d)*q^2 - 96605/(1327104*d^2)*q^3 + O(q^4)
876
+ sage: vec = el.coordinate_vector()
877
+ sage: vec
878
+ (1, -1/(288*d))
879
+ sage: vec.parent()
880
+ Vector space of dimension 2 over Fraction Field of Univariate Polynomial Ring in d over Integer Ring
881
+ sage: vec.parent() == MF.module()
882
+ True
883
+ sage: el == vec[0]*MF.gen(0) + vec[1]*MF.gen(1)
884
+ True
885
+ sage: el == MF.element_from_coordinates(vec)
886
+ True
887
+
888
+ sage: MF = CuspForms(n=infinity, k=16)
889
+ sage: el2 = MF(MF.Delta()*MF.E4())
890
+ sage: vec2 = el2.coordinate_vector()
891
+ sage: vec2
892
+ (1, 5/(8*d), 187/(1024*d^2))
893
+ sage: el2 == MF.element_from_coordinates(vec2)
894
+ True
895
+ """
896
+
897
+ vec = v.q_expansion_vector(min_exp=1, max_exp=self.degree())
898
+ return self._module(vec)
899
+
900
+
901
+ class ZeroForm(FormsSpace_abstract, Module, UniqueRepresentation):
902
+ r"""
903
+ Zero Module for the zero form for the given group, base ring
904
+ weight and multiplier
905
+ """
906
+
907
+ @staticmethod
908
+ def __classcall__(cls, group=HeckeTriangleGroup(3), base_ring=ZZ, k=QQ(0), ep=None, n=None):
909
+ r"""
910
+ Return a (cached) instance with canonical parameters.
911
+
912
+ EXAMPLES::
913
+
914
+ sage: from sage.modular.modform_hecketriangle.space import (canonical_parameters, ZeroForm)
915
+ sage: (group, base_ring, k, ep, n) = canonical_parameters(6, CC, 3, -1)
916
+ sage: ZeroForm(6, CC, 3, -1) == ZeroForm(group, base_ring, k, ep, n)
917
+ True
918
+ """
919
+ (group, base_ring, k, ep, n) = canonical_parameters(group, base_ring, k, ep, n)
920
+ return super().__classcall__(cls, group=group, base_ring=base_ring, k=k, ep=ep, n=n)
921
+
922
+ def __init__(self, group, base_ring, k, ep, n):
923
+ r"""
924
+ Return the zero Module for the zero form of weight ``k`` with multiplier ``ep``
925
+ for the given ``group`` and ``base_ring``.
926
+
927
+ The ZeroForm space coerces into any forms space or ring with a compatible group.
928
+
929
+ EXAMPLES::
930
+
931
+ sage: from sage.modular.modform_hecketriangle.space import ZeroForm
932
+ sage: MF = ZeroForm(6, CC, 3, -1)
933
+ sage: MF
934
+ ZeroForms(n=6, k=3, ep=-1) over Complex Field with 53 bits of precision
935
+ sage: MF.analytic_type()
936
+ zero
937
+ sage: MF.category()
938
+ Category of vector spaces over Complex Field with 53 bits of precision
939
+ sage: MF in MF.category()
940
+ True
941
+ sage: MF.module()
942
+ Vector space of dimension 0 over Fraction Field of Univariate Polynomial Ring in d over Complex Field with 53 bits of precision
943
+ sage: MF.ambient_module() == MF.module()
944
+ True
945
+ sage: MF.is_ambient()
946
+ True
947
+ """
948
+
949
+ FormsSpace_abstract.__init__(self, group=group, base_ring=base_ring, k=k, ep=ep, n=n)
950
+ Module.__init__(self, base=base_ring)
951
+ self._analytic_type = self.AT([])
952
+ self._module = FreeModule(self.coeff_ring(), self.dimension())
953
+
954
+ def _change_degree(self, k, ep):
955
+ r"""
956
+ Return the Zeroform space with a different weight ``k`` and multiplier ``ep``
957
+ for the same group and base_ring.
958
+
959
+ All those spaces coerce into each other.
960
+
961
+ INPUT:
962
+
963
+ - ``k`` -- a rational number; the weight
964
+
965
+ - ``ep`` -- ``1`` or ``-1``; the multiplier
966
+
967
+ EXAMPLES::
968
+
969
+ sage: from sage.modular.modform_hecketriangle.space import ZeroForm
970
+ sage: MF = ZeroForm()
971
+ sage: MF
972
+ ZeroForms(n=3, k=0, ep=1) over Integer Ring
973
+ sage: MF._change_degree(14, -1)
974
+ ZeroForms(n=3, k=14, ep=-1) over Integer Ring
975
+ """
976
+ return ZeroForm(group=self.group(), base_ring=self.base_ring(),
977
+ k=k, ep=ep)
978
+
979
+ @cached_method
980
+ def gens(self) -> tuple:
981
+ r"""
982
+ Return a basis of ``self`` as a tuple of basis elements.
983
+
984
+ Since this is the zero module an empty tuple is returned.
985
+
986
+ EXAMPLES::
987
+
988
+ sage: from sage.modular.modform_hecketriangle.space import ZeroForm
989
+ sage: ZeroForm(6, CC, 3, -1).gens()
990
+ ()
991
+ """
992
+ return ()
993
+
994
+ @cached_method
995
+ def dimension(self):
996
+ r"""
997
+ Return the dimension of ``self``.
998
+ Since this is the zero module ``0`` is returned.
999
+
1000
+ EXAMPLES::
1001
+
1002
+ sage: from sage.modular.modform_hecketriangle.space import ZeroForm
1003
+ sage: ZeroForm(6, CC, 3, -1).dimension()
1004
+ 0
1005
+ """
1006
+ return 0
1007
+
1008
+ @cached_method
1009
+ def coordinate_vector(self, v):
1010
+ r"""
1011
+ Return the coordinate vector of ``v`` with respect to
1012
+ the basis ``self.gens()``.
1013
+
1014
+ Since this is the zero module which only contains
1015
+ the zero form the trivial vector in the trivial
1016
+ module of dimension ``0`` is returned.
1017
+
1018
+ INPUT:
1019
+
1020
+ - ``v`` -- an element of ``self``, i.e. in this case the zero vector
1021
+
1022
+ EXAMPLES::
1023
+
1024
+ sage: from sage.modular.modform_hecketriangle.space import ZeroForm
1025
+ sage: MF = ZeroForm(6, QQ, 3, -1)
1026
+ sage: el = MF(0)
1027
+ sage: el
1028
+ O(q^5)
1029
+ sage: vec = el.coordinate_vector()
1030
+ sage: vec
1031
+ ()
1032
+ sage: vec.parent()
1033
+ Vector space of dimension 0 over Fraction Field of Univariate Polynomial Ring in d over Rational Field
1034
+ sage: vec.parent() == MF.module()
1035
+ True
1036
+ """
1037
+ return self._module(vector(self.coeff_ring(), []))