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