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,896 @@
1
+ # sage_setup: distribution = sagemath-schemes
2
+ # sage.doctest: needs sage.libs.pari
3
+ r"""
4
+ Finite subgroups of modular abelian varieties
5
+
6
+ Sage can compute with fairly general finite subgroups of modular
7
+ abelian varieties. Elements of finite order are represented by
8
+ equivalence classes of elements in `H_1(A,\QQ)`
9
+ modulo `H_1(A,\ZZ)`. A finite subgroup can be
10
+ defined by giving generators and via various other constructions.
11
+ Given a finite subgroup, one can compute generators, as well as the
12
+ structure as an abstract group. Arithmetic on subgroups is also
13
+ supported, including adding two subgroups together, checking
14
+ inclusion, etc.
15
+
16
+ TODO: Intersection, action of Hecke operators.
17
+
18
+ AUTHORS:
19
+
20
+ - William Stein (2007-03)
21
+
22
+ EXAMPLES::
23
+
24
+ sage: J = J0(33)
25
+ sage: C = J.cuspidal_subgroup()
26
+ sage: C
27
+ Finite subgroup with invariants [10, 10] over QQ of Abelian variety J0(33) of dimension 3
28
+ sage: C.order()
29
+ 100
30
+ sage: C.gens()
31
+ ([(1/10, 0, 1/10, 1/10, 1/10, 3/10)], [(0, 1/5, 1/10, 0, 1/10, 9/10)], [(0, 0, 1/2, 0, 1/2, 1/2)])
32
+ sage: C.0 + C.1
33
+ [(1/10, 1/5, 1/5, 1/10, 1/5, 6/5)]
34
+ sage: 10*(C.0 + C.1)
35
+ [(0, 0, 0, 0, 0, 0)]
36
+ sage: G = C.subgroup([C.0 + C.1]); G
37
+ Finite subgroup with invariants [10] over QQbar of Abelian variety J0(33) of dimension 3
38
+ sage: G.gens()
39
+ ([(1/10, 1/5, 1/5, 1/10, 1/5, 1/5)],)
40
+ sage: G.order()
41
+ 10
42
+ sage: G <= C
43
+ True
44
+ sage: G >= C
45
+ False
46
+
47
+ We make a table of the order of the cuspidal subgroup for the first
48
+ few levels::
49
+
50
+ sage: for N in range(11,40):
51
+ ....: print("{} {}".format(N, J0(N).cuspidal_subgroup().order()))
52
+ 11 5
53
+ 12 1
54
+ 13 1
55
+ 14 6
56
+ 15 8
57
+ 16 1
58
+ 17 4
59
+ 18 1
60
+ 19 3
61
+ 20 6
62
+ 21 8
63
+ 22 25
64
+ 23 11
65
+ 24 8
66
+ 25 1
67
+ 26 21
68
+ 27 9
69
+ 28 36
70
+ 29 7
71
+ 30 192
72
+ 31 5
73
+ 32 8
74
+ 33 100
75
+ 34 48
76
+ 35 48
77
+ 36 12
78
+ 37 3
79
+ 38 135
80
+ 39 56
81
+
82
+ TESTS::
83
+
84
+ sage: G = J0(11).finite_subgroup([[1/3,0], [0,1/5]]); G
85
+ Finite subgroup with invariants [15] over QQbar of Abelian variety J0(11) of dimension 1
86
+ sage: loads(dumps(G)) == G
87
+ True
88
+ sage: loads(dumps(G.0)) == G.0
89
+ True
90
+ """
91
+
92
+ # ****************************************************************************
93
+ # Copyright (C) 2007 William Stein <wstein@gmail.com>
94
+ #
95
+ # This program is free software: you can redistribute it and/or modify
96
+ # it under the terms of the GNU General Public License as published by
97
+ # the Free Software Foundation, either version 2 of the License, or
98
+ # (at your option) any later version.
99
+ # https://www.gnu.org/licenses/
100
+ # ****************************************************************************
101
+
102
+ import sage.rings.abc
103
+
104
+ from sage.misc.lazy_import import lazy_import
105
+ from sage.modular.abvar.torsion_point import TorsionPoint
106
+ from sage.modules.module import Module
107
+ from sage.modules.free_module import FreeModule_generic
108
+ from sage.structure.gens_py import abelian_iterator
109
+ from sage.structure.sequence import Sequence
110
+ from sage.structure.richcmp import richcmp_method, richcmp
111
+ from sage.rings.integer import Integer
112
+ from sage.rings.integer_ring import ZZ
113
+ from sage.rings.rational_field import QQ
114
+ from sage.arith.functions import lcm
115
+ from sage.misc.misc_c import prod
116
+ from sage.structure.element import coercion_model
117
+
118
+
119
+ @richcmp_method
120
+ class FiniteSubgroup(Module):
121
+ r"""
122
+ A finite subgroup of a modular abelian variety.
123
+
124
+ INPUT:
125
+
126
+ - ``abvar`` -- a modular abelian variety
127
+
128
+ - ``field_of_definition`` -- a field over which this group is defined
129
+
130
+ EXAMPLES:
131
+
132
+ This is an abstract base class, so there are no instances of
133
+ this class itself::
134
+
135
+ sage: A = J0(37)
136
+ sage: G = A.torsion_subgroup(3); G
137
+ Finite subgroup with invariants [3, 3, 3, 3] over QQ of Abelian variety J0(37) of dimension 2
138
+ sage: type(G)
139
+ <class 'sage.modular.abvar.finite_subgroup.FiniteSubgroup_lattice_with_category'>
140
+ sage: from sage.modular.abvar.finite_subgroup import FiniteSubgroup
141
+ sage: isinstance(G, FiniteSubgroup)
142
+ True
143
+ """
144
+
145
+ Element = TorsionPoint
146
+
147
+ def __init__(self, abvar, field_of_definition=QQ):
148
+ """
149
+ Initialize ``self``.
150
+
151
+ TESTS::
152
+
153
+ sage: A = J0(11)
154
+ sage: G = A.torsion_subgroup(2)
155
+ sage: TestSuite(G).run() # long time
156
+ """
157
+ from sage.categories.category import Category
158
+ from sage.categories.fields import Fields
159
+ from sage.categories.finite_enumerated_sets import FiniteEnumeratedSets
160
+ from sage.categories.modules import Modules
161
+ from .abvar import ModularAbelianVariety_abstract
162
+ if field_of_definition not in Fields():
163
+ raise TypeError("field_of_definition must be a field")
164
+ if not isinstance(abvar, ModularAbelianVariety_abstract):
165
+ raise TypeError("abvar must be a modular abelian variety")
166
+ category = Category.join((Modules(ZZ), FiniteEnumeratedSets()))
167
+ Module.__init__(self, ZZ, category=category)
168
+ self.__abvar = abvar
169
+ self.__field_of_definition = field_of_definition
170
+
171
+ ################################################################
172
+ # DERIVED CLASS MUST OVERRIDE THE lattice METHOD
173
+ ################################################################
174
+ def lattice(self):
175
+ """
176
+ Return the lattice corresponding to this subgroup in the rational
177
+ homology of the modular Jacobian product. The elements of the
178
+ subgroup are represented by vectors in the ambient vector space
179
+ (the rational homology), and this returns the lattice they span.
180
+ EXAMPLES::
181
+
182
+ sage: J = J0(33); C = J[0].cuspidal_subgroup(); C
183
+ Finite subgroup with invariants [5] over QQ of
184
+ Simple abelian subvariety 11a(1,33) of dimension 1 of J0(33)
185
+ sage: C.lattice()
186
+ Free module of degree 6 and rank 2 over Integer Ring
187
+ Echelon basis matrix:
188
+ [ 1/5 13/5 -2 -4/5 2 -1/5]
189
+ [ 0 3 -2 -1 2 0]
190
+ """
191
+ raise NotImplementedError
192
+
193
+ def _relative_basis_matrix(self):
194
+ """
195
+ Return matrix of this finite subgroup, but relative to the homology
196
+ of the parent abelian variety.
197
+
198
+ EXAMPLES::
199
+
200
+ sage: A = J0(43)[1]; A
201
+ Simple abelian subvariety 43b(1,43) of dimension 2 of J0(43)
202
+ sage: C = A.cuspidal_subgroup(); C
203
+ Finite subgroup with invariants [7] over QQ of
204
+ Simple abelian subvariety 43b(1,43) of dimension 2 of J0(43)
205
+ sage: C._relative_basis_matrix()
206
+ [ 1 0 0 0]
207
+ [ 0 1/7 6/7 5/7]
208
+ [ 0 0 1 0]
209
+ [ 0 0 0 1]
210
+ """
211
+ try:
212
+ return self.__relative_basis_matrix
213
+ except AttributeError:
214
+ M = self.__abvar.lattice().coordinate_module(self.lattice()).basis_matrix()
215
+ self.__relative_basis_matrix = M
216
+ return M
217
+
218
+ # General functionality
219
+ def __richcmp__(self, other, op):
220
+ """
221
+ Compare ``self`` to ``other``.
222
+
223
+ If ``other`` is not a :class:`FiniteSubgroup`, then
224
+ ``NotImplemented`` is returned. If ``other`` is a
225
+ :class:`FiniteSubgroup` and the ambient abelian varieties are
226
+ not equal, then the ambient abelian varieties are compared.
227
+ If ``other`` is a :class:`FiniteSubgroup` and the ambient
228
+ abelian varieties are equal, then the subgroups are compared
229
+ via their corresponding lattices.
230
+
231
+ EXAMPLES:
232
+
233
+ We first compare two subgroups of `J_0(37)`::
234
+
235
+ sage: A = J0(37)
236
+ sage: G = A.torsion_subgroup(3); G.order()
237
+ 81
238
+ sage: H = A.cuspidal_subgroup(); H.order()
239
+ 3
240
+ sage: H < G
241
+ True
242
+ sage: H.is_subgroup(G)
243
+ True
244
+
245
+ The ambient varieties are compared::
246
+
247
+ sage: A[0].cuspidal_subgroup() > J0(11).cuspidal_subgroup()
248
+ True
249
+
250
+ Comparing subgroups sitting in different abelian varieties::
251
+
252
+ sage: A[0].cuspidal_subgroup() < A[1].cuspidal_subgroup()
253
+ True
254
+ """
255
+ if not isinstance(other, FiniteSubgroup):
256
+ return NotImplemented
257
+ A = self.abelian_variety()
258
+ B = other.abelian_variety()
259
+ if not A.in_same_ambient_variety(B):
260
+ return richcmp(A.ambient_variety(), B.ambient_variety(), op)
261
+ L = A.lattice() + B.lattice()
262
+ lx = other.lattice() + L
263
+ rx = self.lattice() + L
264
+ # order gets reversed in passing to lattices.
265
+ return lx._echelon_matrix_richcmp(rx, op)
266
+
267
+ def is_subgroup(self, other) -> bool:
268
+ """
269
+ Return ``True`` exactly if ``self`` is a subgroup of ``other``,
270
+ and both are defined as subgroups of the same ambient abelian variety.
271
+
272
+ EXAMPLES::
273
+
274
+ sage: C = J0(22).cuspidal_subgroup()
275
+ sage: H = C.subgroup([C.0])
276
+ sage: K = C.subgroup([C.1])
277
+ sage: H.is_subgroup(K)
278
+ False
279
+ sage: K.is_subgroup(H)
280
+ False
281
+ sage: K.is_subgroup(C)
282
+ True
283
+ sage: H.is_subgroup(C)
284
+ True
285
+ """
286
+ # We use that self is contained in other, whether other is
287
+ # either a finite group or an abelian variety, if and only
288
+ # if self doesn't shrink when intersected with other.
289
+ try:
290
+ return self.intersection(other).order() == self.order()
291
+ except TypeError:
292
+ return False
293
+
294
+ def __add__(self, other):
295
+ """
296
+ Return the sum of two subgroups.
297
+
298
+ EXAMPLES::
299
+
300
+ sage: C = J0(22).cuspidal_subgroup()
301
+ sage: C.gens()
302
+ ([(1/5, 1/5, 4/5, 0)], [(0, 0, 0, 1/5)])
303
+ sage: A = C.subgroup([C.0]); B = C.subgroup([C.1])
304
+ sage: A + B == C
305
+ True
306
+
307
+ An example where the parent abelian varieties are different::
308
+
309
+ sage: A = J0(48); A[0].cuspidal_subgroup() + A[1].cuspidal_subgroup()
310
+ Finite subgroup with invariants [2, 4, 4] over QQ of
311
+ Abelian subvariety of dimension 2 of J0(48)
312
+ """
313
+ if not isinstance(other, FiniteSubgroup):
314
+ raise TypeError("only addition of two finite subgroups is defined")
315
+ A = self.abelian_variety()
316
+ B = other.abelian_variety()
317
+ if not A.in_same_ambient_variety(B):
318
+ raise ValueError("self and other must be in the same ambient Jacobian")
319
+ K = coercion_model.common_parent(self.field_of_definition(), other.field_of_definition())
320
+ lattice = self.lattice() + other.lattice()
321
+ if A != B:
322
+ C = A + B
323
+ lattice += C.lattice()
324
+ return FiniteSubgroup_lattice(C, lattice, field_of_definition=K)
325
+ else:
326
+ return FiniteSubgroup_lattice(self.abelian_variety(), lattice, field_of_definition=K)
327
+
328
+ def exponent(self):
329
+ """
330
+ Return the exponent of this finite abelian group.
331
+
332
+ OUTPUT: integer
333
+
334
+ EXAMPLES::
335
+
336
+ sage: t = J0(33).hecke_operator(7)
337
+ sage: G = t.kernel()[0]; G
338
+ Finite subgroup with invariants [2, 2, 2, 2, 4, 4] over QQ of
339
+ Abelian variety J0(33) of dimension 3
340
+ sage: G.exponent()
341
+ 4
342
+ """
343
+ try:
344
+ return self.__exponent
345
+ except AttributeError:
346
+ e = lcm(self.invariants())
347
+ self.__exponent = e
348
+ return e
349
+
350
+ def intersection(self, other):
351
+ """
352
+ Return the intersection of the finite subgroups ``self`` and ``other``.
353
+
354
+ INPUT:
355
+
356
+ - ``other`` -- a finite group
357
+
358
+ OUTPUT: a finite group
359
+
360
+ EXAMPLES::
361
+
362
+ sage: E11a0, E11a1, B = J0(33)
363
+ sage: G = E11a0.torsion_subgroup(6); H = E11a0.torsion_subgroup(9)
364
+ sage: G.intersection(H)
365
+ Finite subgroup with invariants [3, 3] over QQ of
366
+ Simple abelian subvariety 11a(1,33) of dimension 1 of J0(33)
367
+ sage: W = E11a1.torsion_subgroup(15)
368
+ sage: G.intersection(W)
369
+ Finite subgroup with invariants [] over QQ of
370
+ Simple abelian subvariety 11a(1,33) of dimension 1 of J0(33)
371
+ sage: E11a0.intersection(E11a1)[0]
372
+ Finite subgroup with invariants [5] over QQ of
373
+ Simple abelian subvariety 11a(1,33) of dimension 1 of J0(33)
374
+
375
+ We intersect subgroups of different abelian varieties.
376
+
377
+ ::
378
+
379
+ sage: E11a0, E11a1, B = J0(33)
380
+ sage: G = E11a0.torsion_subgroup(5); H = E11a1.torsion_subgroup(5)
381
+ sage: G.intersection(H)
382
+ Finite subgroup with invariants [5] over QQ of
383
+ Simple abelian subvariety 11a(1,33) of dimension 1 of J0(33)
384
+ sage: E11a0.intersection(E11a1)[0]
385
+ Finite subgroup with invariants [5] over QQ of
386
+ Simple abelian subvariety 11a(1,33) of dimension 1 of J0(33)
387
+
388
+ We intersect abelian varieties with subgroups::
389
+
390
+ sage: t = J0(33).hecke_operator(7)
391
+ sage: G = t.kernel()[0]; G
392
+ Finite subgroup with invariants [2, 2, 2, 2, 4, 4] over QQ of
393
+ Abelian variety J0(33) of dimension 3
394
+ sage: A = J0(33).old_subvariety()
395
+ sage: A.intersection(G)
396
+ Finite subgroup with invariants [2, 2, 2, 2] over QQ of
397
+ Abelian subvariety of dimension 2 of J0(33)
398
+ sage: A.hecke_operator(7).kernel()[0]
399
+ Finite subgroup with invariants [2, 2, 2, 2] over QQ of
400
+ Abelian subvariety of dimension 2 of J0(33)
401
+ sage: B = J0(33).new_subvariety()
402
+ sage: B.intersection(G)
403
+ Finite subgroup with invariants [4, 4] over QQ of
404
+ Abelian subvariety of dimension 1 of J0(33)
405
+ sage: B.hecke_operator(7).kernel()[0]
406
+ Finite subgroup with invariants [4, 4] over QQ of
407
+ Abelian subvariety of dimension 1 of J0(33)
408
+ sage: A.intersection(B)[0]
409
+ Finite subgroup with invariants [3, 3] over QQ of
410
+ Abelian subvariety of dimension 2 of J0(33)
411
+ """
412
+ from .abvar import ModularAbelianVariety_abstract
413
+ A = self.abelian_variety()
414
+ if isinstance(other, ModularAbelianVariety_abstract):
415
+ amb = other
416
+ B = other
417
+ M = B.lattice().scale(Integer(1)/self.exponent())
418
+ K = coercion_model.common_parent(self.field_of_definition(), other.base_field())
419
+ else:
420
+ amb = A
421
+ if not isinstance(other, FiniteSubgroup):
422
+ raise TypeError("only intersection with a finite subgroup or "
423
+ "modular abelian variety is defined")
424
+ B = other.abelian_variety()
425
+ if A.ambient_variety() != B.ambient_variety():
426
+ raise TypeError("finite subgroups must be in the same ambient product Jacobian")
427
+ M = other.lattice()
428
+ K = coercion_model.common_parent(self.field_of_definition(), other.field_of_definition())
429
+
430
+ L = self.lattice()
431
+ if A != B:
432
+ # TODO: This might be way slower than what we could do if
433
+ # we think more carefully.
434
+ C = A + B
435
+ L = L + C.lattice()
436
+ M = M + C.lattice()
437
+ W = L.intersection(M).intersection(amb.vector_space())
438
+ return FiniteSubgroup_lattice(amb, W, field_of_definition=K)
439
+
440
+ def __mul__(self, right):
441
+ """
442
+ Multiply this subgroup by the rational number ``right``.
443
+
444
+ If ``right`` is an integer the result is a subgroup of ``self``. If
445
+ ``right`` is a rational number `n/m`, then this group is first
446
+ divided by `m` then multiplied by `n`.
447
+
448
+ INPUT:
449
+
450
+ - ``right`` -- a rational number
451
+
452
+ OUTPUT: a subgroup
453
+
454
+ EXAMPLES::
455
+
456
+ sage: J = J0(37)
457
+ sage: H = J.cuspidal_subgroup(); H.order()
458
+ 3
459
+ sage: G = H * 3; G.order()
460
+ 1
461
+ sage: G = H * (1/2); G.order()
462
+ 48
463
+ sage: J.torsion_subgroup(2) + H == G
464
+ True
465
+ sage: G = H*(3/2); G.order()
466
+ 16
467
+ sage: J = J0(42)
468
+ sage: G = J.cuspidal_subgroup(); factor(G.order())
469
+ 2^8 * 3^2
470
+ sage: (G * 3).order()
471
+ 256
472
+ sage: (G * 0).order()
473
+ 1
474
+ sage: (G * (1/5)).order()
475
+ 22500000000
476
+ """
477
+ lattice = self.lattice().scale(right)
478
+ return FiniteSubgroup_lattice(self.abelian_variety(), lattice,
479
+ field_of_definition=self.field_of_definition())
480
+
481
+ def __rmul__(self, left):
482
+ """
483
+ Multiply this finite subgroup on the left by an integer.
484
+
485
+ EXAMPLES::
486
+
487
+ sage: J = J0(42)
488
+ sage: G = J.cuspidal_subgroup(); factor(G.order())
489
+ 2^8 * 3^2
490
+ sage: H = G.__rmul__(2)
491
+ sage: H.order().factor()
492
+ 2^4 * 3^2
493
+ sage: 2*G
494
+ Finite subgroup with invariants [6, 24] over QQ of Abelian variety J0(42) of dimension 5
495
+ """
496
+ return self * left
497
+
498
+ def abelian_variety(self):
499
+ """
500
+ Return the abelian variety that this is a finite subgroup of.
501
+
502
+ EXAMPLES::
503
+
504
+ sage: J = J0(42)
505
+ sage: G = J.rational_torsion_subgroup(); G
506
+ Torsion subgroup of Abelian variety J0(42) of dimension 5
507
+ sage: G.abelian_variety()
508
+ Abelian variety J0(42) of dimension 5
509
+ """
510
+ return self.__abvar
511
+
512
+ def field_of_definition(self):
513
+ """
514
+ Return the field over which this finite modular abelian variety
515
+ subgroup is defined. This is a field over which this subgroup is
516
+ defined.
517
+
518
+ EXAMPLES::
519
+
520
+ sage: J = J0(42)
521
+ sage: G = J.rational_torsion_subgroup(); G
522
+ Torsion subgroup of Abelian variety J0(42) of dimension 5
523
+ sage: G.field_of_definition()
524
+ Rational Field
525
+ """
526
+ return self.__field_of_definition
527
+
528
+ def _repr_(self):
529
+ """
530
+ Return string representation of this finite subgroup.
531
+
532
+ EXAMPLES::
533
+
534
+ sage: J = J0(42)
535
+ sage: G = J.torsion_subgroup(3); G._repr_()
536
+ 'Finite subgroup with invariants [3, 3, 3, 3, 3, 3, 3, 3, 3, 3] over QQ of Abelian variety J0(42) of dimension 5'
537
+ """
538
+ K = self.__field_of_definition
539
+ if isinstance(K, sage.rings.abc.AlgebraicField):
540
+ field = "QQbar"
541
+ elif K == QQ:
542
+ field = "QQ"
543
+ else:
544
+ field = str(K)
545
+ return "Finite subgroup %sover %s of %s" % (self._invariants_repr(), field, self.__abvar)
546
+
547
+ def _invariants_repr(self):
548
+ """
549
+ The string representation of the 'invariants' part of this group.
550
+
551
+ We make this a separate function so it is possible to create finite
552
+ subgroups that don't print their invariants, since printing them
553
+ could be expensive.
554
+
555
+ EXAMPLES::
556
+
557
+ sage: J0(42).cuspidal_subgroup()._invariants_repr()
558
+ 'with invariants [2, 2, 12, 48] '
559
+ """
560
+ return 'with invariants %s ' % (self.invariants(), )
561
+
562
+ def order(self):
563
+ """
564
+ Return the order (number of elements) of this finite subgroup.
565
+
566
+ EXAMPLES::
567
+
568
+ sage: J = J0(42)
569
+ sage: C = J.cuspidal_subgroup()
570
+ sage: C.order()
571
+ 2304
572
+ """
573
+ try:
574
+ return self.__order
575
+ except AttributeError:
576
+ if self.__abvar.dimension() == 0:
577
+ self.__order = ZZ(1)
578
+ return self.__order
579
+ o = prod(self.invariants())
580
+ self.__order = o
581
+ return o
582
+
583
+ def gens(self) -> tuple:
584
+ """
585
+ Return a tuple of the generators for this finite subgroup.
586
+
587
+ EXAMPLES:
588
+
589
+ We list generators for several cuspidal subgroups::
590
+
591
+ sage: J0(11).cuspidal_subgroup().gens()
592
+ ([(0, 1/5)],)
593
+ sage: J0(37).cuspidal_subgroup().gens()
594
+ ([(0, 0, 0, 1/3)],)
595
+ sage: J0(43).cuspidal_subgroup().gens()
596
+ ([(0, 1/7, 0, 6/7, 0, 5/7)],)
597
+ sage: J1(13).cuspidal_subgroup().gens()
598
+ ([(1/19, 0, 9/19, 9/19)], [(0, 1/19, 0, 9/19)])
599
+ sage: J0(22).torsion_subgroup(6).gens()
600
+ ([(1/6, 0, 0, 0)], [(0, 1/6, 0, 0)], [(0, 0, 1/6, 0)], [(0, 0, 0, 1/6)])
601
+ """
602
+ try:
603
+ return self.__gens
604
+ except AttributeError:
605
+ pass
606
+
607
+ B = [self.element_class(self, v) for v in self.lattice().basis() if v.denominator() > 1]
608
+ self.__gens = tuple(B)
609
+ return self.__gens
610
+
611
+ def gen(self, n):
612
+ r"""
613
+ Return `n`-th generator of ``self``.
614
+
615
+ EXAMPLES::
616
+
617
+ sage: J = J0(23)
618
+ sage: C = J.torsion_subgroup(3)
619
+ sage: C.gens()
620
+ ([(1/3, 0, 0, 0)], [(0, 1/3, 0, 0)], [(0, 0, 1/3, 0)], [(0, 0, 0, 1/3)])
621
+ sage: C.gen(0)
622
+ [(1/3, 0, 0, 0)]
623
+ sage: C.gen(3)
624
+ [(0, 0, 0, 1/3)]
625
+ sage: C.gen(4)
626
+ Traceback (most recent call last):
627
+ ...
628
+ IndexError: tuple index out of range
629
+
630
+ Negative indices wrap around::
631
+
632
+ sage: C.gen(-1)
633
+ [(0, 0, 0, 1/3)]
634
+ """
635
+ return self.gens()[n]
636
+
637
+ def _element_constructor_(self, x, check=True):
638
+ r"""
639
+ Convert `x` into this finite subgroup.
640
+
641
+ This works when the abelian varieties that contain `x` and
642
+ ``self`` are the same, or if `x` is convertible into the
643
+ rational homology (viewed as an abstract `\QQ`-vector space).
644
+
645
+ EXAMPLES: We first construct the `11`-torsion subgroup of
646
+ `J_0(23)`::
647
+
648
+ sage: J = J0(23)
649
+ sage: G = J.torsion_subgroup(11)
650
+ sage: G.invariants()
651
+ [11, 11, 11, 11]
652
+
653
+ We also construct the cuspidal subgroup::
654
+
655
+ sage: C = J.cuspidal_subgroup()
656
+ sage: C.invariants()
657
+ [11]
658
+
659
+ sage: G(G.0) is G.0
660
+ True
661
+
662
+ We convert an element from the cuspidal subgroup into the
663
+ `11`-torsion subgroup::
664
+
665
+ sage: z = G(C.0); z
666
+ [(1/11, 10/11, 0, 8/11)]
667
+ sage: z.parent() == G
668
+ True
669
+
670
+ We convert a list, which defines an element of the underlying
671
+ ``full_module`` into `G`, and verify an equality::
672
+
673
+ sage: x = G([1/11, 1/11, 0, -1/11])
674
+ sage: x == G([1/11, 1/11, 0, 10/11])
675
+ True
676
+
677
+ Finally we attempt to convert some elements that shouldn't
678
+ work, since they are not in `G`::
679
+
680
+ sage: G(J.torsion_subgroup(3).0)
681
+ Traceback (most recent call last):
682
+ ...
683
+ TypeError: element [1/3, 0, 0, 0] is not in free module
684
+
685
+ sage: G(J0(27).cuspidal_subgroup()(0))
686
+ Traceback (most recent call last):
687
+ ...
688
+ ValueError: ambient abelian varieties are different
689
+ """
690
+ if isinstance(x, TorsionPoint):
691
+ if x.parent().abelian_variety() != self.abelian_variety():
692
+ raise ValueError('ambient abelian varieties are different')
693
+ x = x.element()
694
+ x = self.lattice()(x, check=check)
695
+ return self.element_class(self, x, check=False)
696
+
697
+ def __contains__(self, x):
698
+ """
699
+ Return ``True`` if ``x`` is contained in this finite subgroup.
700
+
701
+ EXAMPLES:
702
+
703
+ We define two distinct finite subgroups of `J_0(27)`::
704
+
705
+ sage: G1 = J0(27).rational_cusp_subgroup(); G1
706
+ Finite subgroup with invariants [3] over QQ of Abelian variety J0(27) of dimension 1
707
+ sage: G1.0
708
+ [(1/3, 0)]
709
+ sage: G2 = J0(27).cuspidal_subgroup(); G2
710
+ Finite subgroup with invariants [3, 3] over QQ of Abelian variety J0(27) of dimension 1
711
+ sage: G2.gens()
712
+ ([(1/3, 0)], [(0, 1/3)])
713
+
714
+ Now we check whether various elements are in `G_1` and `G_2`::
715
+
716
+ sage: G2.0 in G1
717
+ True
718
+ sage: G2.1 in G1
719
+ False
720
+ sage: G1.0 in G1
721
+ True
722
+ sage: G1.0 in G2
723
+ True
724
+
725
+ The integer `0` is in `G_1`::
726
+
727
+ sage: 0 in G1
728
+ True
729
+
730
+ Elements that have a completely different ambient product Jacobian
731
+ are never in `G`::
732
+
733
+ sage: J0(23).cuspidal_subgroup().0 in G1
734
+ False
735
+ sage: J0(23).cuspidal_subgroup()(0) in G1
736
+ False
737
+ """
738
+ try:
739
+ self(x)
740
+ except (TypeError, ValueError):
741
+ return False
742
+ return True
743
+
744
+ def subgroup(self, gens):
745
+ """
746
+ Return the subgroup of ``self`` spanned by the given
747
+ generators, which must all be elements of ``self``.
748
+
749
+ EXAMPLES::
750
+
751
+ sage: J = J0(23)
752
+ sage: G = J.torsion_subgroup(11); G
753
+ Finite subgroup with invariants [11, 11, 11, 11] over QQ of
754
+ Abelian variety J0(23) of dimension 2
755
+
756
+ We create the subgroup of the 11-torsion subgroup of `J_0(23)`
757
+ generated by the first `11`-torsion point::
758
+
759
+ sage: H = G.subgroup([G.0]); H
760
+ Finite subgroup with invariants [11] over QQbar of
761
+ Abelian variety J0(23) of dimension 2
762
+ sage: H.invariants()
763
+ [11]
764
+
765
+ We can also create a subgroup from a list of objects that can
766
+ be converted into the ambient rational homology::
767
+
768
+ sage: H == G.subgroup([[1/11,0,0,0]])
769
+ True
770
+ """
771
+ from sage.rings.qqbar import QQbar
772
+
773
+ if not isinstance(gens, (tuple, list)):
774
+ raise TypeError("gens must be a list or tuple")
775
+ A = self.abelian_variety()
776
+ lattice = A._ambient_lattice().span([self(g).element() for g in gens])
777
+ return FiniteSubgroup_lattice(self.abelian_variety(), lattice, field_of_definition=QQbar)
778
+
779
+ def invariants(self):
780
+ r"""
781
+ Return elementary invariants of this abelian group, by which we
782
+ mean a nondecreasing (immutable) sequence of integers
783
+ `n_i`, `1 \leq i \leq k`, with `n_i`
784
+ dividing `n_{i+1}`, and such that this group is abstractly
785
+ isomorphic to
786
+ `\ZZ/n_1\ZZ \times\cdots\times \ZZ/n_k\ZZ.`
787
+
788
+ EXAMPLES::
789
+
790
+ sage: J = J0(38)
791
+ sage: C = J.cuspidal_subgroup(); C
792
+ Finite subgroup with invariants [3, 45] over QQ of
793
+ Abelian variety J0(38) of dimension 4
794
+ sage: v = C.invariants(); v
795
+ [3, 45]
796
+ sage: v[0] = 5
797
+ Traceback (most recent call last):
798
+ ...
799
+ ValueError: object is immutable; please change a copy instead.
800
+ sage: type(v[0])
801
+ <class 'sage.rings.integer.Integer'>
802
+
803
+ ::
804
+
805
+ sage: C * 3
806
+ Finite subgroup with invariants [15] over QQ of
807
+ Abelian variety J0(38) of dimension 4
808
+
809
+ An example involving another cuspidal subgroup::
810
+
811
+ sage: C = J0(22).cuspidal_subgroup(); C
812
+ Finite subgroup with invariants [5, 5] over QQ of
813
+ Abelian variety J0(22) of dimension 2
814
+ sage: C.lattice()
815
+ Free module of degree 4 and rank 4 over Integer Ring
816
+ Echelon basis matrix:
817
+ [1/5 1/5 4/5 0]
818
+ [ 0 1 0 0]
819
+ [ 0 0 1 0]
820
+ [ 0 0 0 1/5]
821
+ sage: C.invariants()
822
+ [5, 5]
823
+ """
824
+ try:
825
+ return self.__invariants
826
+ except AttributeError:
827
+ pass
828
+ M = self.lattice().coordinate_module(self.abelian_variety().lattice())
829
+ E = M.basis_matrix().change_ring(ZZ).elementary_divisors()
830
+ v = [Integer(x) for x in E if x != 1]
831
+ I = Sequence(v)
832
+ I.sort()
833
+ I.set_immutable()
834
+ self.__invariants = I
835
+ return I
836
+
837
+ __iter__ = abelian_iterator
838
+
839
+
840
+ class FiniteSubgroup_lattice(FiniteSubgroup):
841
+ def __init__(self, abvar, lattice, field_of_definition=None, check=True):
842
+ """
843
+ A finite subgroup of a modular abelian variety that is defined by a
844
+ given lattice.
845
+
846
+ INPUT:
847
+
848
+ - ``abvar`` -- a modular abelian variety
849
+
850
+ - ``lattice`` -- a lattice that contains the lattice of abvar
851
+
852
+ - ``field_of_definition`` -- the field of definition
853
+ of this finite group scheme
854
+
855
+ - ``check`` -- boolean (default: ``True``); whether or not to
856
+ check that lattice contains the abvar lattice
857
+
858
+ EXAMPLES::
859
+
860
+ sage: J = J0(11)
861
+ sage: G = J.finite_subgroup([[1/3,0], [0,1/5]]); G
862
+ Finite subgroup with invariants [15] over QQbar of
863
+ Abelian variety J0(11) of dimension 1
864
+ """
865
+ if field_of_definition is None:
866
+ from sage.rings.qqbar import QQbar as field_of_definition
867
+ if check:
868
+ from .abvar import ModularAbelianVariety_abstract
869
+ if not isinstance(lattice, FreeModule_generic) or lattice.base_ring() != ZZ:
870
+ raise TypeError("lattice must be a free module over ZZ")
871
+ if not isinstance(abvar, ModularAbelianVariety_abstract):
872
+ raise TypeError("abvar must be a modular abelian variety")
873
+ if not abvar.lattice().is_submodule(lattice):
874
+ lattice += abvar.lattice()
875
+ if lattice.rank() != abvar.lattice().rank():
876
+ raise ValueError("lattice must contain the lattice of abvar with finite index")
877
+ FiniteSubgroup.__init__(self, abvar, field_of_definition)
878
+ self.__lattice = lattice
879
+
880
+ def lattice(self):
881
+ r"""
882
+ Return lattice that defines this finite subgroup.
883
+
884
+ EXAMPLES::
885
+
886
+ sage: J = J0(11)
887
+ sage: G = J.finite_subgroup([[1/3,0], [0,1/5]]); G
888
+ Finite subgroup with invariants [15] over QQbar of
889
+ Abelian variety J0(11) of dimension 1
890
+ sage: G.lattice()
891
+ Free module of degree 2 and rank 2 over Integer Ring
892
+ Echelon basis matrix:
893
+ [1/3 0]
894
+ [ 0 1/5]
895
+ """
896
+ return self.__lattice