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,1402 @@
1
+ # sage_setup: distribution = sagemath-schemes
2
+ # sage.doctest: needs sage.libs.pari
3
+ r"""
4
+ Arithmetic subgroups, finite index subgroups of `\SL_2(\ZZ)`
5
+ """
6
+ ################################################################################
7
+ #
8
+ # Copyright (C) 2009, The Sage Group -- https://www.sagemath.org/
9
+ #
10
+ # Distributed under the terms of the GNU General Public License (GPL)
11
+ #
12
+ # The full text of the GPL is available at:
13
+ #
14
+ # https://www.gnu.org/licenses/
15
+ #
16
+ ################################################################################
17
+
18
+ from sage.groups.group import Group
19
+ from sage.categories.groups import Groups
20
+ from sage.rings.integer_ring import ZZ
21
+ from sage.arith.functions import lcm
22
+ from sage.misc.cachefunc import cached_method
23
+ from copy import copy # for making copies of lists of cusps
24
+ from sage.modular.modsym.p1list import lift_to_sl2z
25
+ from sage.modular.cusps import Cusp
26
+
27
+ from sage.misc.lazy_import import lazy_import
28
+ lazy_import('sage.modular.arithgroup.congroup_sl2z', 'SL2Z')
29
+ from sage.structure.element import parent
30
+
31
+ from .arithgroup_element import ArithmeticSubgroupElement, M2Z as Mat2Z
32
+
33
+
34
+ def is_ArithmeticSubgroup(x) -> bool:
35
+ r"""
36
+ Return ``True`` if ``x`` is of type :class:`ArithmeticSubgroup`.
37
+
38
+ EXAMPLES::
39
+
40
+ sage: from sage.modular.arithgroup.all import is_ArithmeticSubgroup
41
+ sage: is_ArithmeticSubgroup(GL(2, GF(7)))
42
+ doctest:warning...
43
+ DeprecationWarning: The function is_ArithmeticSubgroup is deprecated; use 'isinstance(..., ArithmeticSubgroup)' instead.
44
+ See https://github.com/sagemath/sage/issues/38035 for details.
45
+ False
46
+ sage: is_ArithmeticSubgroup(Gamma0(4))
47
+ True
48
+ """
49
+ from sage.misc.superseded import deprecation
50
+ deprecation(38035, "The function is_ArithmeticSubgroup is deprecated; use 'isinstance(..., ArithmeticSubgroup)' instead.")
51
+ return isinstance(x, ArithmeticSubgroup)
52
+
53
+
54
+ class ArithmeticSubgroup(Group):
55
+ r"""
56
+ Base class for arithmetic subgroups of `\SL_2(\ZZ)`. Not
57
+ intended to be used directly, but still includes quite a few
58
+ general-purpose routines which compute data about an arithmetic subgroup
59
+ assuming that it has a working element testing routine.
60
+ """
61
+
62
+ Element = ArithmeticSubgroupElement
63
+
64
+ def __init__(self) -> None:
65
+ r"""
66
+ Standard init routine.
67
+
68
+ EXAMPLES::
69
+
70
+ sage: G = Gamma1(7)
71
+ sage: G.category() # indirect doctest
72
+ Category of infinite groups
73
+ """
74
+ Group.__init__(self, category=Groups().Infinite())
75
+
76
+ def _repr_(self) -> str:
77
+ r"""
78
+ Return the string representation of ``self``.
79
+
80
+ .. NOTE:: This function should be overridden by all subclasses.
81
+
82
+ EXAMPLES::
83
+
84
+ sage: sage.modular.arithgroup.arithgroup_generic.ArithmeticSubgroup()._repr_()
85
+ 'Generic arithmetic subgroup of SL2Z'
86
+ """
87
+ return "Generic arithmetic subgroup of SL2Z"
88
+
89
+ def _repr_option(self, key):
90
+ """
91
+ Metadata about the :meth:`_repr_` output.
92
+
93
+ See :meth:`sage.structure.parent._repr_option` for details.
94
+
95
+ EXAMPLES::
96
+
97
+ sage: Gamma1(7)._repr_option('element_ascii_art')
98
+ True
99
+ """
100
+ if key == 'element_ascii_art':
101
+ return True
102
+ return super()._repr_option(key)
103
+
104
+ def __reduce__(self):
105
+ r"""
106
+ Used for pickling ``self``.
107
+
108
+ .. NOTE:: This function should be overridden by all subclasses.
109
+
110
+ EXAMPLES::
111
+
112
+ sage: sage.modular.arithgroup.arithgroup_generic.ArithmeticSubgroup().__reduce__()
113
+ Traceback (most recent call last):
114
+ ...
115
+ NotImplementedError: all subclasses must define a __reduce__ method
116
+ """
117
+ raise NotImplementedError("all subclasses must define a __reduce__ method")
118
+
119
+ def _element_constructor_(self, x, check=True):
120
+ r"""
121
+ Create an element of this congruence subgroup from x.
122
+
123
+ If the optional flag check is ``True`` (default), check whether
124
+ x actually gives an element of ``self``.
125
+
126
+ EXAMPLES::
127
+
128
+ sage: G = Gamma(5)
129
+ sage: G([1, 0, -10, 1]) # indirect doctest
130
+ [ 1 0]
131
+ [-10 1]
132
+ sage: G(matrix(ZZ, 2, [26, 5, 5, 1]))
133
+ [26 5]
134
+ [ 5 1]
135
+ sage: G([1, 1, 6, 7])
136
+ Traceback (most recent call last):
137
+ ...
138
+ TypeError: matrix [1 1]
139
+ [6 7] is not an element of Congruence Subgroup Gamma(5)
140
+ """
141
+ # Do not override this function! Derived classes should override
142
+ # _contains_sl2.
143
+ x = SL2Z(x, check)
144
+ if not check or x in self:
145
+ return x
146
+ raise TypeError("matrix %s is not an element of %s" % (x, self))
147
+
148
+ def __contains__(self, x):
149
+ r"""
150
+ Test if x is an element of this group.
151
+
152
+ This checks that x defines (is?) a 2x2 integer matrix of determinant 1, and
153
+ then hands over to the routine ``_contains_sl2``, which derived classes should implement.
154
+
155
+ EXAMPLES::
156
+
157
+ sage: [1,2] in SL2Z # indirect doctest
158
+ False
159
+ sage: [1,2,0,1] in SL2Z # indirect doctest
160
+ True
161
+ sage: SL2Z([1,2,0,1]) in Gamma(3) # indirect doctest
162
+ False
163
+ sage: -1 in SL2Z
164
+ True
165
+ sage: 2 in SL2Z
166
+ False
167
+ """
168
+ # Do not override this function! Derived classes should override
169
+ # _contains_sl2.
170
+ if isinstance(x, list) and len(x) == 4:
171
+ if not all(y in ZZ for y in x):
172
+ return False
173
+ a, b, c, d = map(ZZ, x)
174
+ if a*d - b*c != 1:
175
+ return False
176
+ return self._contains_sl2(a, b, c, d)
177
+ else:
178
+ if parent(x) is not SL2Z:
179
+ try:
180
+ y = SL2Z(x)
181
+ except TypeError:
182
+ return False
183
+ x = y
184
+ return self._contains_sl2(x.a(), x.b(), x.c(), x.d())
185
+
186
+ def _contains_sl2(self, a, b, c, d):
187
+ r"""
188
+ Test whether the matrix [a,b;c,d], which may be assumed to have
189
+ determinant 1, is an element of ``self``.
190
+
191
+ This must be overridden by all subclasses.
192
+
193
+ EXAMPLES::
194
+
195
+ sage: G = sage.modular.arithgroup.arithgroup_generic.ArithmeticSubgroup()
196
+ sage: 1 in G
197
+ Traceback (most recent call last):
198
+ ...
199
+ NotImplementedError: Please implement _contains_sl2 for <class 'sage.modular.arithgroup.arithgroup_generic.ArithmeticSubgroup_with_category'>
200
+ """
201
+ raise NotImplementedError("Please implement _contains_sl2 for %s" % self.__class__)
202
+
203
+ def __hash__(self):
204
+ r"""
205
+ Return a hash of ``self``.
206
+
207
+ EXAMPLES::
208
+
209
+ sage: h = hash(Gamma0(11))
210
+ sage: h = hash(Gamma1(11))
211
+
212
+ TESTS:
213
+
214
+ We test that :issue:`18743` is fixed::
215
+
216
+ sage: G1 = GammaH(37,[4]); G1
217
+ Congruence Subgroup Gamma_H(37) with H generated by [4]
218
+ sage: G2 = GammaH(37,[4,16]); G2
219
+ Congruence Subgroup Gamma_H(37) with H generated by [4, 7]
220
+ sage: G1 == G2
221
+ True
222
+ sage: hash(G1) == hash(G2)
223
+ True
224
+ sage: set([G1,G2])
225
+ {Congruence Subgroup Gamma_H(37) with H generated by [4]}
226
+ """
227
+ return hash((self.level(), self.index()))
228
+
229
+ def matrix_space(self):
230
+ """
231
+ Return the parent space of the matrices, which is always
232
+ ``MatrixSpace(ZZ, 2)``.
233
+
234
+ EXAMPLES::
235
+
236
+ sage: Gamma(3).matrix_space()
237
+ Full MatrixSpace of 2 by 2 dense matrices over Integer Ring
238
+ """
239
+ return Mat2Z
240
+
241
+ def is_parent_of(self, x) -> bool:
242
+ r"""
243
+ Check whether this group is a valid parent for the element x.
244
+
245
+ Required by Sage's testing framework.
246
+
247
+ EXAMPLES::
248
+
249
+ sage: Gamma(3).is_parent_of(ZZ(1))
250
+ False
251
+ sage: Gamma(3).is_parent_of([1,0,0,1])
252
+ False
253
+ sage: Gamma(3).is_parent_of(SL2Z([1,1,0,1]))
254
+ False
255
+ sage: Gamma(3).is_parent_of(SL2Z(1))
256
+ True
257
+ """
258
+ return parent(x) == SL2Z and x in self
259
+
260
+ def coset_reps(self, G=None):
261
+ r"""
262
+ Return right coset representatives for ``self \\ G``, where `G` is
263
+ another arithmetic subgroup that contains ``self``. If ``G == None``,
264
+ default to ``G = SL2Z``.
265
+
266
+ For generic arithmetic subgroups `G` this is carried out by Todd-Coxeter
267
+ enumeration; here `G` is treated as a black box, implementing nothing but
268
+ membership testing.
269
+
270
+ EXAMPLES::
271
+
272
+ sage: sage.modular.arithgroup.arithgroup_generic.ArithmeticSubgroup().coset_reps()
273
+ Traceback (most recent call last):
274
+ ...
275
+ NotImplementedError: Please implement _contains_sl2 for <class 'sage.modular.arithgroup.arithgroup_generic.ArithmeticSubgroup_with_category'>
276
+ sage: sage.modular.arithgroup.arithgroup_generic.ArithmeticSubgroup.coset_reps(Gamma0(3))
277
+ [
278
+ [1 0] [ 0 -1] [ 0 -1] [ 0 -1]
279
+ [0 1], [ 1 0], [ 1 1], [ 1 2]
280
+ ]
281
+ """
282
+ return self.todd_coxeter(G)[0]
283
+
284
+ @cached_method
285
+ def todd_coxeter(self, G=None, on_right=True):
286
+ r"""
287
+ Compute coset representatives for ``self \\ G`` and action of standard
288
+ generators on them via Todd-Coxeter enumeration.
289
+
290
+ If ``G`` is ``None``, default to ``SL2Z``. The method also computes
291
+ generators of the subgroup at same time.
292
+
293
+ INPUT:
294
+
295
+ - ``G`` -- intermediate subgroup (currently not implemented if different
296
+ from SL(2,Z))
297
+
298
+ - ``on_right`` -- boolean (default: ``True``); if ``True`` return right
299
+ coset enumeration, if ``False`` return left one
300
+
301
+ This is *extremely* slow in general.
302
+
303
+ OUTPUT: list of coset representatives
304
+
305
+ - a list of generators for the group
306
+
307
+ - ``l`` -- list of integers that correspond to the action of the
308
+ standard parabolic element [[1,1],[0,1]] of `SL(2,\ZZ)` on the cosets
309
+ of ``self``.
310
+
311
+ - ``s`` -- list of integers that correspond to the action of the standard
312
+ element of order `2` [[0,-1],[1,0]] on the cosets of ``self``
313
+
314
+ EXAMPLES::
315
+
316
+ sage: L = SL2Z([1,1,0,1])
317
+ sage: S = SL2Z([0,-1,1,0])
318
+
319
+ sage: G = Gamma(2)
320
+ sage: reps, gens, l, s = G.todd_coxeter()
321
+ sage: len(reps) == G.index()
322
+ True
323
+ sage: all(reps[i] * L * ~reps[l[i]] in G for i in range(6))
324
+ True
325
+ sage: all(reps[i] * S * ~reps[s[i]] in G for i in range(6))
326
+ True
327
+
328
+ sage: G = Gamma0(7)
329
+ sage: reps, gens, l, s = G.todd_coxeter()
330
+ sage: len(reps) == G.index()
331
+ True
332
+ sage: all(reps[i] * L * ~reps[l[i]] in G for i in range(8))
333
+ True
334
+ sage: all(reps[i] * S * ~reps[s[i]] in G for i in range(8))
335
+ True
336
+
337
+ sage: G = Gamma1(3)
338
+ sage: reps, gens, l, s = G.todd_coxeter(on_right=False)
339
+ sage: len(reps) == G.index()
340
+ True
341
+ sage: all(~reps[l[i]] * L * reps[i] in G for i in range(8))
342
+ True
343
+ sage: all(~reps[s[i]] * S * reps[i] in G for i in range(8))
344
+ True
345
+
346
+ sage: G = Gamma0(5)
347
+ sage: reps, gens, l, s = G.todd_coxeter(on_right=False)
348
+ sage: len(reps) == G.index()
349
+ True
350
+ sage: all(~reps[l[i]] * L * reps[i] in G for i in range(6))
351
+ True
352
+ sage: all(~reps[s[i]] * S * reps[i] in G for i in range(6))
353
+ True
354
+ """
355
+ if G is None:
356
+ G = SL2Z
357
+ if G != SL2Z:
358
+ raise NotImplementedError("Don't know how to compute coset reps for subgroups yet")
359
+
360
+ one = SL2Z.one()
361
+ l = SL2Z([1, 1, 0, 1])
362
+ s = SL2Z([0, -1, 1, 0])
363
+
364
+ reps = [one] # coset representatives
365
+ reps_inv = {one: 0} # coset representatives index
366
+
367
+ l_wait_back = [one] # rep with no incoming s_edge
368
+ s_wait_back = [one] # rep with no incoming l_edge
369
+ l_wait = [one] # rep with no outgoing l_edge
370
+ s_wait = [one] # rep with no outgoing s_edge
371
+
372
+ l_edges = [None] # edges for l
373
+ s_edges = [None] # edges for s
374
+
375
+ gens = []
376
+
377
+ while l_wait or s_wait:
378
+ if l_wait:
379
+ x = l_wait.pop(0)
380
+ y = x
381
+ not_end = True
382
+ while not_end:
383
+ if on_right:
384
+ y = y*l
385
+ else:
386
+ y = l*y
387
+ for i in range(len(l_wait_back)):
388
+ v = l_wait_back[i]
389
+ if on_right:
390
+ yy = y*~v
391
+ else:
392
+ yy = ~v*y
393
+ if yy in self:
394
+ l_edges[reps_inv[x]] = reps_inv[v]
395
+ del l_wait_back[i]
396
+ if yy != one:
397
+ gens.append(self(yy))
398
+ not_end = False
399
+ break
400
+ else:
401
+ reps_inv[y] = len(reps)
402
+ l_edges[reps_inv[x]] = len(reps)
403
+ reps.append(y)
404
+ l_edges.append(None)
405
+ s_edges.append(None)
406
+ s_wait_back.append(y)
407
+ s_wait.append(y)
408
+ x = y
409
+
410
+ if s_wait:
411
+ x = s_wait.pop(0)
412
+ y = x
413
+ not_end = True
414
+ while not_end:
415
+ if on_right:
416
+ y = y*s
417
+ else:
418
+ y = s*y
419
+ for i in range(len(s_wait_back)):
420
+ v = s_wait_back[i]
421
+ if on_right:
422
+ yy = y*~v
423
+ else:
424
+ yy = ~v*y
425
+ if yy in self:
426
+ s_edges[reps_inv[x]] = reps_inv[v]
427
+ del s_wait_back[i]
428
+ if yy != one:
429
+ gens.append(self(yy))
430
+ not_end = False
431
+ break
432
+ else:
433
+ reps_inv[y] = len(reps)
434
+ s_edges[reps_inv[x]] = len(reps)
435
+ reps.append(y)
436
+ l_edges.append(None)
437
+ s_edges.append(None)
438
+ l_wait_back.append(y)
439
+ l_wait.append(y)
440
+ x = y
441
+
442
+ return reps, gens, l_edges, s_edges
443
+
444
+ def nu2(self) -> int:
445
+ r"""
446
+ Return the number of orbits of elliptic points of order 2 for this
447
+ arithmetic subgroup.
448
+
449
+ EXAMPLES::
450
+
451
+ sage: sage.modular.arithgroup.arithgroup_generic.ArithmeticSubgroup().nu2()
452
+ Traceback (most recent call last):
453
+ ...
454
+ NotImplementedError: Please implement _contains_sl2 for <class 'sage.modular.arithgroup.arithgroup_generic.ArithmeticSubgroup_with_category'>
455
+ sage: sage.modular.arithgroup.arithgroup_generic.ArithmeticSubgroup.nu2(Gamma0(1105)) == 8
456
+ True
457
+ """
458
+
459
+ # Subgroups not containing -1 have no elliptic points of order 2.
460
+
461
+ if not self.is_even():
462
+ return 0
463
+
464
+ # Cheap trick: if self is a subgroup of something with no elliptic points,
465
+ # then self has no elliptic points either.
466
+
467
+ from .all import Gamma0, CongruenceSubgroupBase
468
+ if isinstance(self, CongruenceSubgroupBase):
469
+ if self.is_subgroup(Gamma0(self.level())) and Gamma0(self.level()).nu2() == 0:
470
+ return 0
471
+
472
+ # Otherwise, the number of elliptic points is the number of g in self \
473
+ # SL2Z such that the stabiliser of g * i in self is not trivial. (Note
474
+ # that the points g*i for g in the coset reps are not distinct, but it
475
+ # still works, since the failure of these points to be distinct happens
476
+ # precisely when the preimages are not elliptic.)
477
+
478
+ count = 0
479
+ mati = SL2Z([0, 1, -1, 0])
480
+ for g in self.coset_reps():
481
+ if g * mati * (~g) in self:
482
+ count += 1
483
+ return count
484
+
485
+ def nu3(self):
486
+ r"""
487
+ Return the number of orbits of elliptic points of order 3 for this
488
+ arithmetic subgroup.
489
+
490
+ EXAMPLES::
491
+
492
+ sage: sage.modular.arithgroup.arithgroup_generic.ArithmeticSubgroup().nu3()
493
+ Traceback (most recent call last):
494
+ ...
495
+ NotImplementedError: Please implement _contains_sl2 for <class 'sage.modular.arithgroup.arithgroup_generic.ArithmeticSubgroup_with_category'>
496
+ sage: sage.modular.arithgroup.arithgroup_generic.ArithmeticSubgroup.nu3(Gamma0(1729)) == 8
497
+ True
498
+
499
+ We test that a bug in handling of subgroups not containing -1 is fixed::
500
+
501
+ sage: sage.modular.arithgroup.arithgroup_generic.ArithmeticSubgroup.nu3(GammaH(7, [2]))
502
+ 2
503
+ """
504
+
505
+ # Cheap trick: if self is a subgroup of something with no elliptic points,
506
+ # then self has no elliptic points either.
507
+
508
+ from .all import Gamma0, CongruenceSubgroupBase
509
+ if isinstance(self, CongruenceSubgroupBase):
510
+ if self.is_subgroup(Gamma0(self.level())) and Gamma0(self.level()).nu3() == 0:
511
+ return 0
512
+
513
+ count = 0
514
+ matj = SL2Z([0, 1, -1, -1])
515
+ for g in self.coset_reps():
516
+ if g * matj * (~g) in self:
517
+ count += 1
518
+
519
+ return count if self.is_even() else count // 2
520
+
521
+ def is_abelian(self) -> bool:
522
+ r"""
523
+ Return ``True`` if this arithmetic subgroup is abelian.
524
+
525
+ Since arithmetic subgroups are always nonabelian, this always
526
+ returns ``False``.
527
+
528
+ EXAMPLES::
529
+
530
+ sage: SL2Z.is_abelian()
531
+ False
532
+ sage: Gamma0(3).is_abelian()
533
+ False
534
+ sage: Gamma1(12).is_abelian()
535
+ False
536
+ sage: GammaH(4, [3]).is_abelian()
537
+ False
538
+ """
539
+ return False
540
+
541
+ def is_finite(self) -> bool:
542
+ r"""
543
+ Return ``True`` if this arithmetic subgroup is finite.
544
+
545
+ Since arithmetic subgroups are always infinite, this always
546
+ returns ``False``.
547
+
548
+ EXAMPLES::
549
+
550
+ sage: SL2Z.is_finite()
551
+ False
552
+ sage: Gamma0(3).is_finite()
553
+ False
554
+ sage: Gamma1(12).is_finite()
555
+ False
556
+ sage: GammaH(4, [3]).is_finite()
557
+ False
558
+ """
559
+ return False
560
+
561
+ def is_subgroup(self, right) -> bool:
562
+ r"""
563
+ Return ``True`` if ``self`` is a subgroup of right, and ``False`` otherwise.
564
+
565
+ For generic arithmetic subgroups this is done by the absurdly
566
+ slow algorithm of checking all of the generators of ``self``
567
+ to see if they are in ``right``.
568
+
569
+ EXAMPLES::
570
+
571
+ sage: sage.modular.arithgroup.arithgroup_generic.ArithmeticSubgroup().is_subgroup(SL2Z)
572
+ Traceback (most recent call last):
573
+ ...
574
+ NotImplementedError: Please implement _contains_sl2 for <class 'sage.modular.arithgroup.arithgroup_generic.ArithmeticSubgroup_with_category'>
575
+ sage: sage.modular.arithgroup.arithgroup_generic.ArithmeticSubgroup.is_subgroup(Gamma1(18), Gamma0(6))
576
+ True
577
+ """
578
+ # ridiculously slow generic algorithm
579
+ return all(g in right for g in self.gens())
580
+
581
+ def is_normal(self) -> bool:
582
+ r"""
583
+ Return ``True`` precisely if this subgroup is a normal subgroup of
584
+ ``SL2Z``.
585
+
586
+ EXAMPLES::
587
+
588
+ sage: Gamma(3).is_normal()
589
+ True
590
+ sage: Gamma1(3).is_normal()
591
+ False
592
+ """
593
+ for x in self.gens():
594
+ for y in SL2Z.gens():
595
+ if y * SL2Z(x) * (~y) not in self:
596
+ return False
597
+ return True
598
+
599
+ def is_odd(self) -> bool:
600
+ r"""
601
+ Return ``True`` precisely if this subgroup does not contain the
602
+ matrix -1.
603
+
604
+ EXAMPLES::
605
+
606
+ sage: SL2Z.is_odd()
607
+ False
608
+ sage: Gamma0(20).is_odd()
609
+ False
610
+ sage: Gamma1(5).is_odd()
611
+ True
612
+ sage: GammaH(11, [3]).is_odd()
613
+ True
614
+ """
615
+ return not self.is_even()
616
+
617
+ def is_even(self) -> bool:
618
+ r"""
619
+ Return ``True`` precisely if this subgroup contains the matrix -1.
620
+
621
+ EXAMPLES::
622
+
623
+ sage: SL2Z.is_even()
624
+ True
625
+ sage: Gamma0(20).is_even()
626
+ True
627
+ sage: Gamma1(5).is_even()
628
+ False
629
+ sage: GammaH(11, [3]).is_even()
630
+ False
631
+ """
632
+ return [-1, 0, 0, -1] in self
633
+
634
+ def to_even_subgroup(self):
635
+ r"""
636
+ Return the smallest even subgroup of `SL(2, \ZZ)` containing ``self``.
637
+
638
+ EXAMPLES::
639
+
640
+ sage: sage.modular.arithgroup.arithgroup_generic.ArithmeticSubgroup().to_even_subgroup()
641
+ Traceback (most recent call last):
642
+ ...
643
+ NotImplementedError: Please implement _contains_sl2 for <class 'sage.modular.arithgroup.arithgroup_generic.ArithmeticSubgroup_with_category'>
644
+ """
645
+ if self.is_even():
646
+ return self
647
+ else:
648
+ raise NotImplementedError
649
+
650
+ def order(self):
651
+ r"""
652
+ Return the number of elements in this arithmetic subgroup.
653
+
654
+ Since arithmetic subgroups are always infinite, this always returns
655
+ infinity.
656
+
657
+ EXAMPLES::
658
+
659
+ sage: SL2Z.order()
660
+ +Infinity
661
+ sage: Gamma0(5).order()
662
+ +Infinity
663
+ sage: Gamma1(2).order()
664
+ +Infinity
665
+ sage: GammaH(12, [5]).order()
666
+ +Infinity
667
+ """
668
+ from sage.rings.infinity import infinity
669
+ return infinity
670
+
671
+ def reduce_cusp(self, c):
672
+ r"""
673
+ Given a cusp `c \in \mathbb{P}^1(\QQ)`, return the unique reduced cusp
674
+ equivalent to c under the action of self, where a reduced cusp is an
675
+ element `\tfrac{r}{s}` with r,s coprime nonnegative integers, s as
676
+ small as possible, and r as small as possible for that s.
677
+
678
+ .. NOTE:: This function should be overridden by all subclasses.
679
+
680
+ EXAMPLES::
681
+
682
+ sage: sage.modular.arithgroup.arithgroup_generic.ArithmeticSubgroup().reduce_cusp(1/4)
683
+ Traceback (most recent call last):
684
+ ...
685
+ NotImplementedError
686
+ """
687
+ raise NotImplementedError
688
+
689
+ def cusps(self, algorithm='default'):
690
+ r"""
691
+ Return a sorted list of inequivalent cusps for ``self``, i.e. a set of
692
+ representatives for the orbits of ``self`` on `\mathbb{P}^1(\QQ)`.
693
+
694
+ These should be returned in a reduced form where this makes sense.
695
+
696
+ INPUT:
697
+
698
+ - ``algorithm`` -- which algorithm to use to compute the cusps of ``self``.
699
+ ``'default'`` finds representatives for a known complete set of
700
+ cusps. ``'modsym'`` computes the boundary map on the space of weight
701
+ two modular symbols associated to ``self``, which finds the cusps for
702
+ ``self`` in the process.
703
+
704
+ EXAMPLES::
705
+
706
+ sage: Gamma0(36).cusps()
707
+ [0, 1/18, 1/12, 1/9, 1/6, 1/4, 1/3, 5/12, 1/2, 2/3, 5/6, Infinity]
708
+ sage: Gamma0(36).cusps(algorithm='modsym') == Gamma0(36).cusps() # needs sage.libs.flint
709
+ True
710
+ sage: GammaH(36, [19,29]).cusps() == Gamma0(36).cusps()
711
+ True
712
+ sage: Gamma0(1).cusps()
713
+ [Infinity]
714
+ """
715
+ try:
716
+ return copy(self._cusp_list[algorithm])
717
+ except (AttributeError, KeyError):
718
+ self._cusp_list = {}
719
+
720
+ from .congroup_sl2z import SL2Z_class
721
+ if algorithm == 'default':
722
+ if isinstance(self, SL2Z_class):
723
+ s = [Cusp(1, 0)]
724
+ else:
725
+ s = self._find_cusps()
726
+ elif algorithm == 'modsym':
727
+ s = sorted(self.reduce_cusp(c)
728
+ for c in self.modular_symbols().cusps())
729
+ else:
730
+ raise ValueError("unknown algorithm: %s" % algorithm)
731
+
732
+ self._cusp_list[algorithm] = s
733
+ return copy(s)
734
+
735
+ def _find_cusps(self):
736
+ r"""
737
+ Calculate a list of inequivalent cusps.
738
+
739
+ EXAMPLES::
740
+
741
+ sage: sage.modular.arithgroup.congroup_generic.CongruenceSubgroup(5)._find_cusps()
742
+ Traceback (most recent call last):
743
+ ...
744
+ NotImplementedError
745
+
746
+ .. NOTE::
747
+
748
+ There is a generic algorithm implemented at the top level that
749
+ uses the coset representatives of ``self``. This is *very slow* and for all
750
+ the standard congruence subgroups there is a quicker way of doing it,
751
+ so this should usually be overridden in subclasses; but it doesn't have
752
+ to be.
753
+ """
754
+ i = Cusp([1, 0])
755
+ L = [i]
756
+ for a in self.coset_reps():
757
+ ai = i.apply([a.a(), a.b(), a.c(), a.d()])
758
+ new = 1
759
+ for v in L:
760
+ if self.are_equivalent(ai, v):
761
+ new = 0
762
+ break
763
+ if new == 1:
764
+ L.append(ai)
765
+ return L
766
+
767
+ def are_equivalent(self, x, y, trans=False):
768
+ r"""
769
+ Test whether or not cusps `x` and `y` are equivalent modulo ``self``.
770
+
771
+ If ``self`` has a ``reduce_cusp()`` method, use that; otherwise do a
772
+ slow explicit test.
773
+
774
+ If ``trans == False``, returns ``True`` or ``False``. If
775
+ ``trans == True``, then return either ``False`` or an element of
776
+ ``self`` mapping `x` onto `y`.
777
+
778
+ EXAMPLES::
779
+
780
+ sage: Gamma0(7).are_equivalent(Cusp(1/3), Cusp(0), trans=True)
781
+ [ 3 -1]
782
+ [-14 5]
783
+ sage: Gamma0(7).are_equivalent(Cusp(1/3), Cusp(1/7))
784
+ False
785
+ """
786
+ x = Cusp(x)
787
+ y = Cusp(y)
788
+ if not trans:
789
+ try:
790
+ xr = self.reduce_cusp(x)
791
+ yr = self.reduce_cusp(y)
792
+ if xr != yr:
793
+ return False
794
+ if xr == yr:
795
+ return True
796
+ except NotImplementedError:
797
+ pass
798
+
799
+ vx = lift_to_sl2z(x.numerator(),x.denominator(), 0)
800
+ dx = SL2Z([vx[2], -vx[0], vx[3], -vx[1]])
801
+ vy = lift_to_sl2z(y.numerator(),y.denominator(), 0)
802
+ dy = SL2Z([vy[2], -vy[0], vy[3], -vy[1]])
803
+
804
+ for i in range(self.index()):
805
+ # Note that the width of any cusp is bounded above by the index of self.
806
+ # If self is congruence, then the level of self is a much better bound, but
807
+ # this method is written to work with non-congruence subgroups as well,
808
+ if dy * SL2Z([1,i,0,1])*(~dx) in self:
809
+ if trans:
810
+ return dy * SL2Z([1,i,0,1]) * ~dx
811
+ else:
812
+ return True
813
+ elif (self.is_odd() and dy * SL2Z([-1,-i,0,-1]) * ~dx in self):
814
+ if trans:
815
+ return dy * SL2Z([-1,-i,0,-1]) * ~dx
816
+ else:
817
+ return True
818
+ return False
819
+
820
+ def cusp_data(self, c) -> tuple:
821
+ r"""
822
+ Return a triple `(g, w, t)` where `g` is an element of ``self``
823
+ generating the stabiliser of the given cusp, `w` is the width of the
824
+ cusp, and `t` is 1 if the cusp is regular and -1 if not.
825
+
826
+ EXAMPLES::
827
+
828
+ sage: Gamma1(4).cusp_data(Cusps(1/2))
829
+ (
830
+ [ 1 -1]
831
+ [ 4 -3], 1, -1
832
+ )
833
+ """
834
+ c = Cusp(c)
835
+
836
+ # first find an element of SL2Z sending infinity to the given cusp
837
+ w = lift_to_sl2z(c.denominator(), c.numerator(), 0)
838
+ g = SL2Z([w[3], w[1], w[2], w[0]])
839
+
840
+ for d in range(1,1+self.index()):
841
+ if g * SL2Z([1, d, 0, 1]) * (~g) in self:
842
+ return (g * SL2Z([1,d,0,1]) * (~g), d, 1)
843
+ elif g * SL2Z([-1, -d, 0, -1]) * (~g) in self:
844
+ return (g * SL2Z([-1, -d, 0, -1]) * (~g), d, -1)
845
+ raise ArithmeticError("Can't get here!")
846
+
847
+ def is_regular_cusp(self, c) -> bool:
848
+ r"""
849
+ Return ``True`` if the orbit of the given cusp is a regular cusp for
850
+ ``self``, otherwise ``False``.
851
+
852
+ This is automatically true if -1 is in ``self``.
853
+
854
+ EXAMPLES::
855
+
856
+ sage: Gamma1(4).is_regular_cusp(Cusps(1/2))
857
+ False
858
+ sage: Gamma1(4).is_regular_cusp(Cusps(oo))
859
+ True
860
+ """
861
+ if self.is_even():
862
+ return True
863
+ return self.cusp_data(c)[2] == 1
864
+
865
+ def cusp_width(self, c):
866
+ r"""
867
+ Return the width of the orbit of cusps represented by c.
868
+
869
+ EXAMPLES::
870
+
871
+ sage: Gamma0(11).cusp_width(Cusps(oo))
872
+ 1
873
+ sage: Gamma0(11).cusp_width(0)
874
+ 11
875
+ sage: [Gamma0(100).cusp_width(c) for c in Gamma0(100).cusps()]
876
+ [100, 1, 4, 1, 1, 1, 4, 25, 1, 1, 4, 1, 25, 4, 1, 4, 1, 1]
877
+ """
878
+ return self.cusp_data(c)[1]
879
+
880
+ def index(self):
881
+ r"""
882
+ Return the index of ``self`` in the full modular group.
883
+
884
+ EXAMPLES::
885
+
886
+ sage: Gamma0(17).index()
887
+ 18
888
+ sage: sage.modular.arithgroup.congroup_generic.CongruenceSubgroup(5).index()
889
+ Traceback (most recent call last):
890
+ ...
891
+ NotImplementedError
892
+ """
893
+ return len(list(self.coset_reps()))
894
+
895
+ def generalised_level(self):
896
+ r"""
897
+ Return the generalised level of ``self``, i.e., the least common multiple of
898
+ the widths of all cusps.
899
+
900
+ If ``self`` is *even*, Wohlfart's theorem tells us that this is equal to
901
+ the (conventional) level of ``self`` when ``self`` is a congruence subgroup.
902
+ This can fail if ``self`` is odd, but the actual level is at most twice the
903
+ generalised level. See the paper by Kiming, Schuett and Verrill for
904
+ more examples.
905
+
906
+ EXAMPLES::
907
+
908
+ sage: Gamma0(18).generalised_level()
909
+ 18
910
+ sage: from sage.modular.arithgroup.arithgroup_perm import HsuExample18 # needs sage.groups
911
+ sage: HsuExample18().generalised_level() # needs sage.groups
912
+ 24
913
+
914
+ In the following example, the actual level is twice the generalised
915
+ level. This is the group `G_2` from Example 17 of K-S-V.
916
+
917
+ ::
918
+
919
+ sage: G = CongruenceSubgroup(8, [ [1,1,0,1], [3,-1,4,-1] ])
920
+ sage: G.level()
921
+ 8
922
+ sage: G.generalised_level()
923
+ 4
924
+ """
925
+ return lcm([self.cusp_width(c) for c in self.cusps()])
926
+
927
+ def projective_index(self):
928
+ r"""
929
+ Return the index of the image of ``self`` in `\PSL_2(\ZZ)`. This is equal
930
+ to the index of ``self`` if ``self`` contains -1, and half of this otherwise.
931
+
932
+ This is equal to the degree of the natural map from the modular curve
933
+ of ``self`` to the `j`-line.
934
+
935
+ EXAMPLES::
936
+
937
+ sage: Gamma0(5).projective_index()
938
+ 6
939
+ sage: Gamma1(5).projective_index()
940
+ 12
941
+ """
942
+ if self.is_even():
943
+ return self.index()
944
+ else:
945
+ return self.index() // 2
946
+
947
+ def is_congruence(self) -> bool:
948
+ r"""
949
+ Return ``True`` if ``self`` is a congruence subgroup.
950
+
951
+ EXAMPLES::
952
+
953
+ sage: Gamma0(5).is_congruence()
954
+ True
955
+ sage: sage.modular.arithgroup.arithgroup_generic.ArithmeticSubgroup().is_congruence()
956
+ Traceback (most recent call last):
957
+ ...
958
+ NotImplementedError
959
+ """
960
+ raise NotImplementedError
961
+
962
+ def genus(self):
963
+ r"""
964
+ Return the genus of the modular curve of ``self``.
965
+
966
+ EXAMPLES::
967
+
968
+ sage: Gamma1(5).genus()
969
+ 0
970
+ sage: Gamma1(31).genus()
971
+ 26
972
+ sage: from sage.modular.dims import dimension_cusp_forms
973
+ sage: Gamma1(157).genus() == dimension_cusp_forms(Gamma1(157), 2)
974
+ True
975
+ sage: GammaH(7, [2]).genus()
976
+ 0
977
+ sage: [Gamma0(n).genus() for n in [1..23]]
978
+ [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 2, 2]
979
+ sage: [n for n in [1..200] if Gamma0(n).genus() == 1]
980
+ [11, 14, 15, 17, 19, 20, 21, 24, 27, 32, 36, 49]
981
+ """
982
+ return ZZ(1 + (self.projective_index()) / ZZ(12) - (self.nu2())/ZZ(4) - (self.nu3())/ZZ(3) - self.ncusps()/ZZ(2))
983
+
984
+ def farey_symbol(self):
985
+ r"""
986
+ Return the Farey symbol associated to this subgroup.
987
+
988
+ See the :mod:`~sage.modular.arithgroup.farey_symbol` module for more
989
+ information.
990
+
991
+ EXAMPLES::
992
+
993
+ sage: Gamma1(4).farey_symbol()
994
+ FareySymbol(Congruence Subgroup Gamma1(4))
995
+ """
996
+ from .farey_symbol import Farey
997
+ return Farey(self)
998
+
999
+ @cached_method
1000
+ def generators(self, algorithm='farey'):
1001
+ r"""
1002
+ Return a list of generators for this congruence subgroup. The result is cached.
1003
+
1004
+ INPUT:
1005
+
1006
+ - ``algorithm`` -- string; either ``farey`` or ``todd-coxeter``
1007
+
1008
+ If ``algorithm`` is set to ``'farey'``, then the generators will be
1009
+ calculated using Farey symbols, which will always return a *minimal*
1010
+ generating set. See :mod:`~sage.modular.arithgroup.farey_symbol` for
1011
+ more information.
1012
+
1013
+ If ``algorithm`` is set to ``'todd-coxeter'``, a simpler algorithm
1014
+ based on Todd-Coxeter enumeration will be used. This is *exceedingly*
1015
+ slow for general subgroups, and the list of generators will be far from
1016
+ minimal (indeed it may contain repetitions).
1017
+
1018
+ EXAMPLES::
1019
+
1020
+ sage: Gamma(2).generators()
1021
+ [
1022
+ [1 2] [ 3 -2] [-1 0]
1023
+ [0 1], [ 2 -1], [ 0 -1]
1024
+ ]
1025
+ sage: Gamma(2).generators(algorithm='todd-coxeter')
1026
+ [
1027
+ [1 2] [-1 0] [ 1 0] [-1 0] [-1 2] [-1 0] [1 0]
1028
+ [0 1], [ 0 -1], [-2 1], [ 0 -1], [-2 3], [ 2 -1], [2 1]
1029
+ ]
1030
+ """
1031
+ if algorithm == "farey":
1032
+ return self.farey_symbol().generators()
1033
+ elif algorithm == "todd-coxeter":
1034
+ return self.todd_coxeter()[1]
1035
+ else:
1036
+ raise ValueError("Unknown algorithm '%s' (should be either 'farey' or 'todd-coxeter')" % algorithm)
1037
+
1038
+ def gens(self, *args, **kwds) -> tuple:
1039
+ r"""
1040
+ Return a tuple of generators for this congruence subgroup.
1041
+
1042
+ The generators need not be minimal. For arguments, see :meth:`~generators`.
1043
+
1044
+ EXAMPLES::
1045
+
1046
+ sage: SL2Z.gens()
1047
+ (
1048
+ [ 0 -1] [1 1]
1049
+ [ 1 0], [0 1]
1050
+ )
1051
+ """
1052
+ return tuple(self.generators(*args, **kwds))
1053
+
1054
+ def gen(self, i):
1055
+ r"""
1056
+ Return the `i`-th generator of self, i.e. the `i`-th element of the
1057
+ tuple ``self.gens()``.
1058
+
1059
+ EXAMPLES::
1060
+
1061
+ sage: SL2Z.gen(1)
1062
+ [1 1]
1063
+ [0 1]
1064
+ """
1065
+ return self.generators()[i]
1066
+
1067
+ def ngens(self):
1068
+ r"""
1069
+ Return the size of the minimal generating set of ``self`` returned by
1070
+ :meth:`generators`.
1071
+
1072
+ EXAMPLES::
1073
+
1074
+ sage: Gamma0(22).ngens()
1075
+ 8
1076
+ sage: Gamma1(14).ngens()
1077
+ 13
1078
+ sage: GammaH(11, [3]).ngens()
1079
+ 3
1080
+ sage: SL2Z.ngens()
1081
+ 2
1082
+ """
1083
+ return len(self.generators())
1084
+
1085
+ def ncusps(self):
1086
+ r"""
1087
+ Return the number of cusps of this arithmetic subgroup.
1088
+
1089
+ This is provided as a separate function since for dimension
1090
+ formulae in even weight all we need to know is the number of
1091
+ cusps, and this can be calculated very quickly, while
1092
+ enumerating all cusps is much slower.
1093
+
1094
+ EXAMPLES::
1095
+
1096
+ sage: sage.modular.arithgroup.arithgroup_generic.ArithmeticSubgroup.ncusps(Gamma0(7))
1097
+ 2
1098
+ """
1099
+ return ZZ(len(self.cusps()))
1100
+
1101
+ def nregcusps(self):
1102
+ r"""
1103
+ Return the number of cusps of ``self`` that are "regular", i.e. their
1104
+ stabiliser has a generator with both eigenvalues +1 rather than -1.
1105
+
1106
+ If the group contains -1, every cusp is clearly regular.
1107
+
1108
+ EXAMPLES::
1109
+
1110
+ sage: sage.modular.arithgroup.arithgroup_generic.ArithmeticSubgroup.nregcusps(Gamma1(4))
1111
+ 2
1112
+ """
1113
+ return self.ncusps() - self.nirregcusps()
1114
+
1115
+ def nirregcusps(self):
1116
+ r"""
1117
+ Return the number of cusps of ``self`` that are "irregular", i.e. their
1118
+ stabiliser can only be generated by elements with both eigenvalues -1
1119
+ rather than +1.
1120
+
1121
+ If the group contains -1, every cusp is clearly regular.
1122
+
1123
+ EXAMPLES::
1124
+
1125
+ sage: sage.modular.arithgroup.arithgroup_generic.ArithmeticSubgroup.nirregcusps(Gamma1(4))
1126
+ 1
1127
+ """
1128
+ if self.is_even():
1129
+ return ZZ.zero()
1130
+ return ZZ(len([1 for c in self.cusps() if not self.is_regular_cusp(c)]))
1131
+
1132
+ def dimension_modular_forms(self, k=2):
1133
+ r"""
1134
+ Return the dimension of the space of weight k modular forms for this
1135
+ group.
1136
+
1137
+ This is given by a standard formula in terms of k and various
1138
+ invariants of the group; see Diamond + Shurman, "A First Course in
1139
+ Modular Forms", section 3.5 and 3.6. If k is not given, defaults to k =
1140
+ 2.
1141
+
1142
+ For dimensions of spaces of modular forms with character for Gamma1, use
1143
+ the dimension_modular_forms method of the Gamma1 class, or the standalone
1144
+ function dimension_modular_forms().
1145
+
1146
+ For weight 1 modular forms this generic implementation only works in
1147
+ cases where one can prove solely via Riemann-Roch theory that there
1148
+ aren't any cusp forms (i.e. when the number of regular cusps is
1149
+ strictly greater than the degree of the canonical divisor). Otherwise a
1150
+ :exc:`NotImplementedError` is raised.
1151
+
1152
+ EXAMPLES::
1153
+
1154
+ sage: Gamma1(31).dimension_modular_forms(2)
1155
+ 55
1156
+ sage: Gamma1(3).dimension_modular_forms(1)
1157
+ 1
1158
+ sage: Gamma1(4).dimension_modular_forms(1) # irregular cusp
1159
+ 1
1160
+ sage: Gamma(13).dimension_modular_forms(1)
1161
+ Traceback (most recent call last):
1162
+ ...
1163
+ NotImplementedError: Computation of dimensions of weight 1 cusp forms spaces not implemented in general
1164
+ """
1165
+ return self.dimension_cusp_forms(k) + self.dimension_eis(k)
1166
+
1167
+ def dimension_cusp_forms(self, k=2):
1168
+ r"""
1169
+ Return the dimension of the space of weight k cusp forms for this
1170
+ group.
1171
+
1172
+ For `k \ge 2`, this is given by a standard formula in terms of k
1173
+ and various invariants of the group; see Diamond + Shurman, "A First
1174
+ Course in Modular Forms", section 3.5 and 3.6. If k is not given,
1175
+ default to k = 2.
1176
+
1177
+ For dimensions of spaces of cusp forms with character for Gamma1, use
1178
+ the dimension_cusp_forms method of the Gamma1 class, or the standalone
1179
+ function dimension_cusp_forms().
1180
+
1181
+ For weight 1 cusp forms this generic implementation only works in cases
1182
+ where one can prove solely via Riemann-Roch theory that there aren't
1183
+ any cusp forms (i.e. when the number of regular cusps is strictly
1184
+ greater than the degree of the canonical divisor). Otherwise a
1185
+ :exc:`NotImplementedError` is raised.
1186
+
1187
+ EXAMPLES::
1188
+
1189
+ sage: Gamma1(31).dimension_cusp_forms(2)
1190
+ 26
1191
+ sage: Gamma(5).dimension_cusp_forms(1)
1192
+ 0
1193
+ sage: Gamma1(4).dimension_cusp_forms(1) # irregular cusp
1194
+ 0
1195
+ sage: Gamma(13).dimension_cusp_forms(1)
1196
+ Traceback (most recent call last):
1197
+ ...
1198
+ NotImplementedError: Computation of dimensions of weight 1 cusp forms spaces not implemented in general
1199
+ """
1200
+ k = ZZ(k)
1201
+ if k <= 0:
1202
+ return ZZ.zero()
1203
+
1204
+ if not (k % 2):
1205
+ # k even
1206
+
1207
+ if k == 2:
1208
+ return self.genus()
1209
+
1210
+ else:
1211
+ return (k-1) * (self.genus() - 1) + (k // ZZ(4))*self.nu2() + (k // ZZ(3))*self.nu3() + (k // ZZ(2) - 1)*self.ncusps()
1212
+
1213
+ else:
1214
+ # k odd
1215
+
1216
+ if self.is_even():
1217
+ return ZZ.zero()
1218
+
1219
+ else:
1220
+ e_reg = self.nregcusps()
1221
+ e_irr = self.nirregcusps()
1222
+
1223
+ if k > 1:
1224
+ return (k-1)*(self.genus()-1) + (k // ZZ(3)) * self.nu3() + (k-2)/ZZ(2) * e_reg + (k-1)/ZZ(2) * e_irr
1225
+ else:
1226
+ if e_reg > 2*self.genus() - 2:
1227
+ return ZZ.zero()
1228
+ else:
1229
+ raise NotImplementedError("Computation of dimensions of weight 1 cusp forms spaces not implemented in general")
1230
+
1231
+ def dimension_eis(self, k=2):
1232
+ r"""
1233
+ Return the dimension of the space of weight k Eisenstein series for
1234
+ this group, which is a subspace of the space of modular forms
1235
+ complementary to the space of cusp forms.
1236
+
1237
+ INPUT:
1238
+
1239
+ - ``k`` -- integer (default: 2)
1240
+
1241
+ EXAMPLES::
1242
+
1243
+ sage: GammaH(33,[2]).dimension_eis()
1244
+ 7
1245
+ sage: GammaH(33,[2]).dimension_eis(3)
1246
+ 0
1247
+ sage: GammaH(33, [2,5]).dimension_eis(2)
1248
+ 3
1249
+ sage: GammaH(33, [4]).dimension_eis(1)
1250
+ 4
1251
+ """
1252
+ if k < 0:
1253
+ return ZZ.zero()
1254
+ if k == 0:
1255
+ return ZZ.one()
1256
+
1257
+ if not (k % 2): # k even
1258
+ if k > 2:
1259
+ return self.ncusps()
1260
+ else: # k = 2
1261
+ return self.ncusps() - 1
1262
+
1263
+ else: # k odd
1264
+ if self.is_even():
1265
+ return ZZ.zero()
1266
+ if k > 1:
1267
+ return self.nregcusps()
1268
+ else: # k = 1
1269
+ return ZZ(self.nregcusps() // ZZ(2))
1270
+
1271
+ def as_permutation_group(self):
1272
+ r"""
1273
+ Return ``self`` as an arithmetic subgroup defined in terms of the
1274
+ permutation action of `SL(2,\ZZ)` on its right cosets.
1275
+
1276
+ This method uses Todd-Coxeter enumeration (via the method
1277
+ :meth:`~todd_coxeter`) which can be extremely slow for arithmetic
1278
+ subgroups with relatively large index in `SL(2,\ZZ)`.
1279
+
1280
+ EXAMPLES::
1281
+
1282
+ sage: # needs sage.groups
1283
+ sage: G = Gamma(3)
1284
+ sage: P = G.as_permutation_group(); P
1285
+ Arithmetic subgroup of index 24
1286
+ sage: G.ncusps() == P.ncusps()
1287
+ True
1288
+ sage: G.nu2() == P.nu2()
1289
+ True
1290
+ sage: G.nu3() == P.nu3()
1291
+ True
1292
+ sage: G.an_element() in P
1293
+ True
1294
+ sage: P.an_element() in G
1295
+ True
1296
+ """
1297
+ _, _, l_edges, s2_edges = self.todd_coxeter()
1298
+ n = len(l_edges)
1299
+ s3_edges = [None] * n
1300
+ r_edges = [None] * n
1301
+ for i in range(n):
1302
+ ii = s2_edges[l_edges[i]]
1303
+ s3_edges[ii] = i
1304
+ r_edges[ii] = s2_edges[i]
1305
+ if self.is_even():
1306
+ from sage.modular.arithgroup.arithgroup_perm import EvenArithmeticSubgroup_Permutation
1307
+ g = EvenArithmeticSubgroup_Permutation(S2=s2_edges,S3=s3_edges,L=l_edges,R=r_edges)
1308
+ else:
1309
+ from sage.modular.arithgroup.arithgroup_perm import OddArithmeticSubgroup_Permutation
1310
+ g = OddArithmeticSubgroup_Permutation(S2=s2_edges,S3=s3_edges,L=l_edges,R=r_edges)
1311
+ g.relabel()
1312
+ return g
1313
+
1314
+ def sturm_bound(self, weight=2):
1315
+ r"""
1316
+ Return the Sturm bound for modular forms of the given weight and level
1317
+ this subgroup.
1318
+
1319
+ INPUT:
1320
+
1321
+ - ``weight`` -- integer `\geq 2` (default: 2)
1322
+
1323
+ EXAMPLES::
1324
+
1325
+ sage: Gamma0(11).sturm_bound(2)
1326
+ 2
1327
+ sage: Gamma0(389).sturm_bound(2)
1328
+ 65
1329
+ sage: Gamma0(1).sturm_bound(12)
1330
+ 1
1331
+ sage: Gamma0(100).sturm_bound(2)
1332
+ 30
1333
+ sage: Gamma0(1).sturm_bound(36)
1334
+ 3
1335
+ sage: Gamma0(11).sturm_bound()
1336
+ 2
1337
+ sage: Gamma0(13).sturm_bound()
1338
+ 3
1339
+ sage: Gamma0(16).sturm_bound()
1340
+ 4
1341
+ sage: GammaH(16,[13]).sturm_bound()
1342
+ 8
1343
+ sage: GammaH(16,[15]).sturm_bound()
1344
+ 16
1345
+ sage: Gamma1(16).sturm_bound()
1346
+ 32
1347
+ sage: Gamma1(13).sturm_bound()
1348
+ 28
1349
+ sage: Gamma1(13).sturm_bound(5)
1350
+ 70
1351
+
1352
+ FURTHER DETAILS: This function returns a positive integer
1353
+ `n` such that the Hecke operators
1354
+ `T_1,\ldots, T_n` acting on *cusp forms* generate the
1355
+ Hecke algebra as a `\ZZ`-module when the character
1356
+ is trivial or quadratic. Otherwise, `T_1,\ldots,T_n`
1357
+ generate the Hecke algebra at least as a
1358
+ `\ZZ[\varepsilon]`-module, where
1359
+ `\ZZ[\varepsilon]` is the ring generated by the
1360
+ values of the Dirichlet character `\varepsilon`.
1361
+ Alternatively, this is a bound such that if two cusp forms
1362
+ associated to this space of modular symbols are congruent modulo
1363
+ `(\lambda, q^n)`, then they are congruent modulo
1364
+ `\lambda`.
1365
+
1366
+ REFERENCES:
1367
+
1368
+ - See the Agashe-Stein appendix to Lario and Schoof,
1369
+ *Some computations with Hecke rings and deformation rings*,
1370
+ Experimental Math., 11 (2002), no. 2, 303-311.
1371
+
1372
+ - This result originated in the paper Sturm,
1373
+ *On the congruence of modular forms*,
1374
+ Springer LNM 1240, 275-280, 1987.
1375
+
1376
+ REMARK: Kevin Buzzard pointed out to me (William Stein) in Fall
1377
+ 2002 that the above bound is fine for `\Gamma_1(N)` with
1378
+ character, as one sees by taking a power of `f`. More
1379
+ precisely, if `f \cong 0 \pmod{p}` for first
1380
+ `s` coefficients, then `f^r \cong 0 \pmod{p}` for
1381
+ first `sr` coefficients. Since the weight of `f^r`
1382
+ is `r\cdot k(f)`, it follows that if
1383
+ `s \geq b`, where `b` is the Sturm bound for
1384
+ `\Gamma_0(N)` at weight `k(f)`, then `f^r`
1385
+ has valuation large enough to be forced to be `0` at
1386
+ `r*k(f)` by Sturm bound (which is valid if we choose
1387
+ `r` correctly). Thus `f \cong 0 \pmod{p}`.
1388
+ Conclusion: For `\Gamma_1(N)` with fixed character, the
1389
+ Sturm bound is *exactly* the same as for `\Gamma_0(N)`.
1390
+
1391
+ A key point is that we are finding
1392
+ `\ZZ[\varepsilon]` generators for the Hecke algebra
1393
+ here, not `\ZZ`-generators. So if one wants
1394
+ generators for the Hecke algebra over `\ZZ`, this
1395
+ bound must be suitably modified (and I'm not sure what the
1396
+ modification is).
1397
+
1398
+ AUTHORS:
1399
+
1400
+ - William Stein
1401
+ """
1402
+ return ZZ((self.index() * weight / ZZ(12)).ceil())