passagemath-schemes 10.8.1a4__cp314-cp314t-macosx_13_0_arm64.whl

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