passagemath-schemes 10.6.40__cp314-cp314-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.

Potentially problematic release.


This version of passagemath-schemes might be problematic. Click here for more details.

Files changed (314) 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.40.dist-info/METADATA +204 -0
  7. passagemath_schemes-10.6.40.dist-info/METADATA.bak +205 -0
  8. passagemath_schemes-10.6.40.dist-info/RECORD +314 -0
  9. passagemath_schemes-10.6.40.dist-info/WHEEL +6 -0
  10. passagemath_schemes-10.6.40.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-314-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-314-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-314-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-314-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-314-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-314-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-314-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-314-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.cpython-314-darwin.so +0 -0
  154. sage/modular/modsym/p1list.pxd +29 -0
  155. sage/modular/modsym/p1list.pyx +1372 -0
  156. sage/modular/modsym/p1list_nf.py +1241 -0
  157. sage/modular/modsym/relation_matrix.py +591 -0
  158. sage/modular/modsym/relation_matrix_pyx.cpython-314-darwin.so +0 -0
  159. sage/modular/modsym/relation_matrix_pyx.pyx +108 -0
  160. sage/modular/modsym/space.py +2468 -0
  161. sage/modular/modsym/subspace.py +455 -0
  162. sage/modular/modsym/tests.py +375 -0
  163. sage/modular/multiple_zeta.py +2632 -0
  164. sage/modular/multiple_zeta_F_algebra.py +786 -0
  165. sage/modular/overconvergent/all.py +6 -0
  166. sage/modular/overconvergent/genus0.py +1878 -0
  167. sage/modular/overconvergent/hecke_series.py +1187 -0
  168. sage/modular/overconvergent/weightspace.py +778 -0
  169. sage/modular/pollack_stevens/all.py +4 -0
  170. sage/modular/pollack_stevens/distributions.py +874 -0
  171. sage/modular/pollack_stevens/fund_domain.py +1572 -0
  172. sage/modular/pollack_stevens/manin_map.py +859 -0
  173. sage/modular/pollack_stevens/modsym.py +1593 -0
  174. sage/modular/pollack_stevens/padic_lseries.py +417 -0
  175. sage/modular/pollack_stevens/sigma0.py +534 -0
  176. sage/modular/pollack_stevens/space.py +1076 -0
  177. sage/modular/quasimodform/all.py +3 -0
  178. sage/modular/quasimodform/element.py +845 -0
  179. sage/modular/quasimodform/ring.py +828 -0
  180. sage/modular/quatalg/all.py +3 -0
  181. sage/modular/quatalg/brandt.py +1642 -0
  182. sage/modular/ssmod/all.py +8 -0
  183. sage/modular/ssmod/ssmod.py +827 -0
  184. sage/rings/all__sagemath_schemes.py +1 -0
  185. sage/rings/polynomial/all__sagemath_schemes.py +1 -0
  186. sage/rings/polynomial/binary_form_reduce.py +585 -0
  187. sage/schemes/all.py +41 -0
  188. sage/schemes/berkovich/all.py +6 -0
  189. sage/schemes/berkovich/berkovich_cp_element.py +2582 -0
  190. sage/schemes/berkovich/berkovich_space.py +748 -0
  191. sage/schemes/curves/affine_curve.py +2928 -0
  192. sage/schemes/curves/all.py +33 -0
  193. sage/schemes/curves/closed_point.py +434 -0
  194. sage/schemes/curves/constructor.py +381 -0
  195. sage/schemes/curves/curve.py +542 -0
  196. sage/schemes/curves/plane_curve_arrangement.py +1283 -0
  197. sage/schemes/curves/point.py +463 -0
  198. sage/schemes/curves/projective_curve.py +3026 -0
  199. sage/schemes/curves/zariski_vankampen.py +1932 -0
  200. sage/schemes/cyclic_covers/all.py +2 -0
  201. sage/schemes/cyclic_covers/charpoly_frobenius.py +320 -0
  202. sage/schemes/cyclic_covers/constructor.py +137 -0
  203. sage/schemes/cyclic_covers/cycliccover_finite_field.py +1309 -0
  204. sage/schemes/cyclic_covers/cycliccover_generic.py +310 -0
  205. sage/schemes/elliptic_curves/BSD.py +1036 -0
  206. sage/schemes/elliptic_curves/Qcurves.py +592 -0
  207. sage/schemes/elliptic_curves/addition_formulas_ring.py +94 -0
  208. sage/schemes/elliptic_curves/all.py +49 -0
  209. sage/schemes/elliptic_curves/cardinality.py +609 -0
  210. sage/schemes/elliptic_curves/cm.py +1102 -0
  211. sage/schemes/elliptic_curves/constructor.py +1552 -0
  212. sage/schemes/elliptic_curves/ec_database.py +175 -0
  213. sage/schemes/elliptic_curves/ell_curve_isogeny.py +3972 -0
  214. sage/schemes/elliptic_curves/ell_egros.py +459 -0
  215. sage/schemes/elliptic_curves/ell_field.py +2836 -0
  216. sage/schemes/elliptic_curves/ell_finite_field.py +3359 -0
  217. sage/schemes/elliptic_curves/ell_generic.py +3760 -0
  218. sage/schemes/elliptic_curves/ell_local_data.py +1207 -0
  219. sage/schemes/elliptic_curves/ell_modular_symbols.py +775 -0
  220. sage/schemes/elliptic_curves/ell_number_field.py +4220 -0
  221. sage/schemes/elliptic_curves/ell_padic_field.py +107 -0
  222. sage/schemes/elliptic_curves/ell_point.py +4787 -0
  223. sage/schemes/elliptic_curves/ell_rational_field.py +7368 -0
  224. sage/schemes/elliptic_curves/ell_tate_curve.py +671 -0
  225. sage/schemes/elliptic_curves/ell_torsion.py +436 -0
  226. sage/schemes/elliptic_curves/ell_wp.py +352 -0
  227. sage/schemes/elliptic_curves/formal_group.py +760 -0
  228. sage/schemes/elliptic_curves/gal_reps.py +1459 -0
  229. sage/schemes/elliptic_curves/gal_reps_number_field.py +1669 -0
  230. sage/schemes/elliptic_curves/gp_simon.py +152 -0
  231. sage/schemes/elliptic_curves/heegner.py +7335 -0
  232. sage/schemes/elliptic_curves/height.py +2109 -0
  233. sage/schemes/elliptic_curves/hom.py +1406 -0
  234. sage/schemes/elliptic_curves/hom_composite.py +934 -0
  235. sage/schemes/elliptic_curves/hom_frobenius.py +522 -0
  236. sage/schemes/elliptic_curves/hom_scalar.py +531 -0
  237. sage/schemes/elliptic_curves/hom_sum.py +682 -0
  238. sage/schemes/elliptic_curves/hom_velusqrt.py +1290 -0
  239. sage/schemes/elliptic_curves/homset.py +271 -0
  240. sage/schemes/elliptic_curves/isogeny_class.py +1521 -0
  241. sage/schemes/elliptic_curves/isogeny_small_degree.py +2797 -0
  242. sage/schemes/elliptic_curves/jacobian.py +237 -0
  243. sage/schemes/elliptic_curves/kodaira_symbol.py +344 -0
  244. sage/schemes/elliptic_curves/kraus.py +1014 -0
  245. sage/schemes/elliptic_curves/lseries_ell.py +943 -0
  246. sage/schemes/elliptic_curves/mod5family.py +105 -0
  247. sage/schemes/elliptic_curves/mod_poly.py +197 -0
  248. sage/schemes/elliptic_curves/mod_sym_num.cpython-314-darwin.so +0 -0
  249. sage/schemes/elliptic_curves/mod_sym_num.pyx +3796 -0
  250. sage/schemes/elliptic_curves/modular_parametrization.py +305 -0
  251. sage/schemes/elliptic_curves/padic_lseries.py +1793 -0
  252. sage/schemes/elliptic_curves/padics.py +1816 -0
  253. sage/schemes/elliptic_curves/period_lattice.py +2234 -0
  254. sage/schemes/elliptic_curves/period_lattice_region.cpython-314-darwin.so +0 -0
  255. sage/schemes/elliptic_curves/period_lattice_region.pyx +722 -0
  256. sage/schemes/elliptic_curves/saturation.py +715 -0
  257. sage/schemes/elliptic_curves/sha_tate.py +1158 -0
  258. sage/schemes/elliptic_curves/weierstrass_morphism.py +1117 -0
  259. sage/schemes/elliptic_curves/weierstrass_transform.py +200 -0
  260. sage/schemes/hyperelliptic_curves/all.py +6 -0
  261. sage/schemes/hyperelliptic_curves/constructor.py +291 -0
  262. sage/schemes/hyperelliptic_curves/hyperelliptic_finite_field.py +1914 -0
  263. sage/schemes/hyperelliptic_curves/hyperelliptic_g2.py +192 -0
  264. sage/schemes/hyperelliptic_curves/hyperelliptic_generic.py +954 -0
  265. sage/schemes/hyperelliptic_curves/hyperelliptic_padic_field.py +1332 -0
  266. sage/schemes/hyperelliptic_curves/hyperelliptic_rational_field.py +84 -0
  267. sage/schemes/hyperelliptic_curves/invariants.py +410 -0
  268. sage/schemes/hyperelliptic_curves/jacobian_endomorphism_utils.py +315 -0
  269. sage/schemes/hyperelliptic_curves/jacobian_g2.py +32 -0
  270. sage/schemes/hyperelliptic_curves/jacobian_generic.py +419 -0
  271. sage/schemes/hyperelliptic_curves/jacobian_homset.py +186 -0
  272. sage/schemes/hyperelliptic_curves/jacobian_morphism.py +875 -0
  273. sage/schemes/hyperelliptic_curves/kummer_surface.py +99 -0
  274. sage/schemes/hyperelliptic_curves/mestre.py +302 -0
  275. sage/schemes/hyperelliptic_curves/monsky_washnitzer.py +3871 -0
  276. sage/schemes/jacobians/abstract_jacobian.py +277 -0
  277. sage/schemes/jacobians/all.py +2 -0
  278. sage/schemes/overview.py +161 -0
  279. sage/schemes/plane_conics/all.py +22 -0
  280. sage/schemes/plane_conics/con_field.py +1296 -0
  281. sage/schemes/plane_conics/con_finite_field.py +158 -0
  282. sage/schemes/plane_conics/con_number_field.py +456 -0
  283. sage/schemes/plane_conics/con_rational_field.py +406 -0
  284. sage/schemes/plane_conics/con_rational_function_field.py +580 -0
  285. sage/schemes/plane_conics/constructor.py +249 -0
  286. sage/schemes/plane_quartics/all.py +2 -0
  287. sage/schemes/plane_quartics/quartic_constructor.py +71 -0
  288. sage/schemes/plane_quartics/quartic_generic.py +73 -0
  289. sage/schemes/riemann_surfaces/all.py +1 -0
  290. sage/schemes/riemann_surfaces/riemann_surface.py +4117 -0
  291. sage_wheels/share/cremona/cremona_mini.db +0 -0
  292. sage_wheels/share/ellcurves/rank0 +30427 -0
  293. sage_wheels/share/ellcurves/rank1 +31871 -0
  294. sage_wheels/share/ellcurves/rank10 +6 -0
  295. sage_wheels/share/ellcurves/rank11 +6 -0
  296. sage_wheels/share/ellcurves/rank12 +1 -0
  297. sage_wheels/share/ellcurves/rank14 +1 -0
  298. sage_wheels/share/ellcurves/rank15 +1 -0
  299. sage_wheels/share/ellcurves/rank17 +1 -0
  300. sage_wheels/share/ellcurves/rank19 +1 -0
  301. sage_wheels/share/ellcurves/rank2 +2388 -0
  302. sage_wheels/share/ellcurves/rank20 +1 -0
  303. sage_wheels/share/ellcurves/rank21 +1 -0
  304. sage_wheels/share/ellcurves/rank22 +1 -0
  305. sage_wheels/share/ellcurves/rank23 +1 -0
  306. sage_wheels/share/ellcurves/rank24 +1 -0
  307. sage_wheels/share/ellcurves/rank28 +1 -0
  308. sage_wheels/share/ellcurves/rank3 +836 -0
  309. sage_wheels/share/ellcurves/rank4 +10 -0
  310. sage_wheels/share/ellcurves/rank5 +5 -0
  311. sage_wheels/share/ellcurves/rank6 +5 -0
  312. sage_wheels/share/ellcurves/rank7 +5 -0
  313. sage_wheels/share/ellcurves/rank8 +6 -0
  314. sage_wheels/share/ellcurves/rank9 +7 -0
@@ -0,0 +1,998 @@
1
+ # sage_setup: distribution = sagemath-schemes
2
+ # sage.doctest: needs sage.libs.flint sage.libs.pari
3
+ """
4
+ Spaces of homomorphisms between modular abelian varieties
5
+
6
+ EXAMPLES:
7
+
8
+ First, we consider J0(37). This Jacobian has two simple factors,
9
+ corresponding to distinct newforms. These two intersect
10
+ nontrivially in J0(37).
11
+
12
+ ::
13
+
14
+ sage: J = J0(37)
15
+ sage: D = J.decomposition() ; D
16
+ [Simple abelian subvariety 37a(1,37) of dimension 1 of J0(37),
17
+ Simple abelian subvariety 37b(1,37) of dimension 1 of J0(37)]
18
+ sage: D[0].intersection(D[1])
19
+ (Finite subgroup with invariants [2, 2] over QQ of
20
+ Simple abelian subvariety 37a(1,37) of dimension 1 of J0(37),
21
+ Simple abelian subvariety of dimension 0 of J0(37))
22
+
23
+ As an abstract product, since these newforms are distinct, the
24
+ corresponding simple abelian varieties are not isogenous, and so
25
+ there are no maps between them. The endomorphism ring of the
26
+ corresponding product is thus isomorphic to the direct sum of the
27
+ endomorphism rings for each factor. Since the factors correspond to
28
+ abelian varieties of dimension 1, these endomorphism rings are each
29
+ isomorphic to ZZ.
30
+
31
+ ::
32
+
33
+ sage: Hom(D[0],D[1]).gens()
34
+ ()
35
+ sage: A = D[0] * D[1] ; A
36
+ Abelian subvariety of dimension 2 of J0(37) x J0(37)
37
+ sage: A.endomorphism_ring().gens()
38
+ (Abelian variety endomorphism of Abelian subvariety of dimension 2 of J0(37) x J0(37),
39
+ Abelian variety endomorphism of Abelian subvariety of dimension 2 of J0(37) x J0(37))
40
+ sage: [ x.matrix() for x in A.endomorphism_ring().gens() ]
41
+ [
42
+ [1 0 0 0] [0 0 0 0]
43
+ [0 1 0 0] [0 0 0 0]
44
+ [0 0 0 0] [0 0 1 0]
45
+ [0 0 0 0], [0 0 0 1]
46
+ ]
47
+
48
+ However, these two newforms have a congruence between them modulo
49
+ 2, which gives rise to interesting endomorphisms of J0(37).
50
+
51
+ ::
52
+
53
+ sage: E = J.endomorphism_ring()
54
+ sage: E.gens()
55
+ (Abelian variety endomorphism of Abelian variety J0(37) of dimension 2,
56
+ Abelian variety endomorphism of Abelian variety J0(37) of dimension 2)
57
+ sage: [ x.matrix() for x in E.gens() ]
58
+ [
59
+ [1 0 0 0] [ 0 1 1 -1]
60
+ [0 1 0 0] [ 1 0 1 0]
61
+ [0 0 1 0] [ 0 0 -1 1]
62
+ [0 0 0 1], [ 0 0 0 1]
63
+ ]
64
+ sage: (-1*E.gens()[0] + E.gens()[1]).matrix()
65
+ [-1 1 1 -1]
66
+ [ 1 -1 1 0]
67
+ [ 0 0 -2 1]
68
+ [ 0 0 0 0]
69
+
70
+ Of course, these endomorphisms will be reflected in the Hecke
71
+ algebra, which is in fact the full endomorphism ring of J0(37) in
72
+ this case::
73
+
74
+ sage: J.hecke_operator(2).matrix()
75
+ [-1 1 1 -1]
76
+ [ 1 -1 1 0]
77
+ [ 0 0 -2 1]
78
+ [ 0 0 0 0]
79
+ sage: T = E.image_of_hecke_algebra()
80
+ sage: T.gens()
81
+ (Abelian variety endomorphism of Abelian variety J0(37) of dimension 2,
82
+ Abelian variety endomorphism of Abelian variety J0(37) of dimension 2)
83
+ sage: [ x.matrix() for x in T.gens() ]
84
+ [
85
+ [1 0 0 0] [ 0 1 1 -1]
86
+ [0 1 0 0] [ 1 0 1 0]
87
+ [0 0 1 0] [ 0 0 -1 1]
88
+ [0 0 0 1], [ 0 0 0 1]
89
+ ]
90
+ sage: T.index_in(E)
91
+ 1
92
+
93
+ Next, we consider J0(33). In this case, we have both oldforms and
94
+ newforms. There are two copies of J0(11), one for each degeneracy
95
+ map from J0(11) to J0(33). There is also one newform at level 33.
96
+ The images of the two degeneracy maps are, of course, isogenous.
97
+
98
+ ::
99
+
100
+ sage: J = J0(33)
101
+ sage: D = J.decomposition()
102
+ sage: D
103
+ [Simple abelian subvariety 11a(1,33) of dimension 1 of J0(33),
104
+ Simple abelian subvariety 11a(3,33) of dimension 1 of J0(33),
105
+ Simple abelian subvariety 33a(1,33) of dimension 1 of J0(33)]
106
+ sage: Hom(D[0],D[1]).gens()
107
+ (Abelian variety morphism:
108
+ From: Simple abelian subvariety 11a(1,33) of dimension 1 of J0(33)
109
+ To: Simple abelian subvariety 11a(3,33) of dimension 1 of J0(33),)
110
+ sage: Hom(D[0],D[1]).gens()[0].matrix()
111
+ [ 0 1]
112
+ [-1 0]
113
+
114
+ Then this gives that the component corresponding to the sum of the
115
+ oldforms will have a rank 4 endomorphism ring. We also have a rank
116
+ one endomorphism ring for the newform 33a (since it is again
117
+ 1-dimensional), which gives a rank 5 endomorphism ring for J0(33).
118
+
119
+ ::
120
+
121
+ sage: DD = J.decomposition(simple=False) ; DD
122
+ [Abelian subvariety of dimension 2 of J0(33),
123
+ Abelian subvariety of dimension 1 of J0(33)]
124
+ sage: A, B = DD
125
+ sage: A == D[0] + D[1]
126
+ True
127
+ sage: A.endomorphism_ring().gens()
128
+ (Abelian variety endomorphism of Abelian subvariety of dimension 2 of J0(33),
129
+ Abelian variety endomorphism of Abelian subvariety of dimension 2 of J0(33),
130
+ Abelian variety endomorphism of Abelian subvariety of dimension 2 of J0(33),
131
+ Abelian variety endomorphism of Abelian subvariety of dimension 2 of J0(33))
132
+ sage: B.endomorphism_ring().gens()
133
+ (Abelian variety endomorphism of Abelian subvariety of dimension 1 of J0(33),)
134
+ sage: E = J.endomorphism_ring() ; E.gens() # long time (3s on sage.math, 2011)
135
+ (Abelian variety endomorphism of Abelian variety J0(33) of dimension 3,
136
+ Abelian variety endomorphism of Abelian variety J0(33) of dimension 3,
137
+ Abelian variety endomorphism of Abelian variety J0(33) of dimension 3,
138
+ Abelian variety endomorphism of Abelian variety J0(33) of dimension 3,
139
+ Abelian variety endomorphism of Abelian variety J0(33) of dimension 3)
140
+
141
+ In this case, the image of the Hecke algebra will only have rank 3,
142
+ so that it is of infinite index in the full endomorphism ring.
143
+ However, if we call this image T, we can still ask about the index
144
+ of T in its saturation, which is 1 in this case.
145
+
146
+ ::
147
+
148
+ sage: # long time
149
+ sage: T = E.image_of_hecke_algebra()
150
+ sage: T.gens()
151
+ (Abelian variety endomorphism of Abelian variety J0(33) of dimension 3,
152
+ Abelian variety endomorphism of Abelian variety J0(33) of dimension 3,
153
+ Abelian variety endomorphism of Abelian variety J0(33) of dimension 3)
154
+ sage: T.index_in(E)
155
+ +Infinity
156
+ sage: T.index_in_saturation()
157
+ 1
158
+
159
+ AUTHORS:
160
+
161
+ - William Stein (2007-03)
162
+
163
+ - Craig Citro, Robert Bradshaw (2008-03): Rewrote with modabvar overhaul
164
+ """
165
+
166
+ # ****************************************************************************
167
+ # Copyright (C) 2007 William Stein <wstein@gmail.com>
168
+ #
169
+ # This program is free software: you can redistribute it and/or modify
170
+ # it under the terms of the GNU General Public License as published by
171
+ # the Free Software Foundation, either version 2 of the License, or
172
+ # (at your option) any later version.
173
+ # https://www.gnu.org/licenses/
174
+ # ****************************************************************************
175
+
176
+
177
+ from copy import copy
178
+
179
+ from sage.categories.homset import HomsetWithBase
180
+ from sage.structure.all import parent
181
+ from sage.structure.parent import Parent
182
+ from sage.misc.lazy_attribute import lazy_attribute
183
+
184
+
185
+ from sage.modular.abvar import morphism
186
+
187
+ from sage.rings.infinity import Infinity
188
+
189
+ from sage.matrix.matrix_space import MatrixSpace
190
+ from sage.matrix.constructor import matrix, identity_matrix
191
+ from sage.structure.element import Matrix
192
+
193
+ from sage.rings.integer_ring import ZZ
194
+
195
+
196
+ class Homspace(HomsetWithBase):
197
+ """
198
+ A space of homomorphisms between two modular abelian varieties.
199
+ """
200
+ Element = morphism.Morphism
201
+
202
+ def __init__(self, domain, codomain, cat):
203
+ """
204
+ Create a homspace.
205
+
206
+ INPUT:
207
+
208
+ - ``domain, codomain`` -- modular abelian varieties
209
+
210
+ - ``cat`` -- category
211
+
212
+ EXAMPLES::
213
+
214
+ sage: H = Hom(J0(11), J0(22)); H
215
+ Space of homomorphisms from Abelian variety J0(11) of dimension 1
216
+ to Abelian variety J0(22) of dimension 2
217
+ sage: Hom(J0(11), J0(11))
218
+ Endomorphism ring of Abelian variety J0(11) of dimension 1
219
+ sage: type(H)
220
+ <class 'sage.modular.abvar.homspace.Homspace_with_category'>
221
+ sage: H.homset_category()
222
+ Category of modular abelian varieties over Rational Field
223
+ """
224
+ from .abvar import ModularAbelianVariety_abstract
225
+ if not isinstance(domain, ModularAbelianVariety_abstract):
226
+ raise TypeError("domain must be a modular abelian variety")
227
+ if not isinstance(codomain, ModularAbelianVariety_abstract):
228
+ raise TypeError("codomain must be a modular abelian variety")
229
+ self._gens = None
230
+ HomsetWithBase.__init__(self, domain, codomain, category=cat)
231
+
232
+ def identity(self):
233
+ """
234
+ Return the identity endomorphism.
235
+
236
+ EXAMPLES::
237
+
238
+ sage: E = End(J0(11))
239
+ sage: E.identity()
240
+ Abelian variety endomorphism of Abelian variety J0(11) of dimension 1
241
+ sage: E.one()
242
+ Abelian variety endomorphism of Abelian variety J0(11) of dimension 1
243
+
244
+ sage: H = Hom(J0(11), J0(22))
245
+ sage: H.identity()
246
+ Traceback (most recent call last):
247
+ ...
248
+ TypeError: the identity map is only defined for endomorphisms
249
+ """
250
+ if self.domain() is not self.codomain():
251
+ raise TypeError("the identity map is only defined for endomorphisms")
252
+ M = self.matrix_space().one()
253
+ return self.element_class(self, M)
254
+
255
+ @lazy_attribute
256
+ def _matrix_space(self):
257
+ """
258
+ Return the matrix space of ``self``.
259
+
260
+ .. WARNING::
261
+
262
+ During unpickling, the domain and codomain may be unable to
263
+ provide the necessary information. This is why this is a lazy
264
+ attribute. See :issue:`14793`.
265
+
266
+ EXAMPLES::
267
+
268
+ sage: Hom(J0(11), J0(22))._matrix_space
269
+ Full MatrixSpace of 2 by 4 dense matrices over Integer Ring
270
+ """
271
+ return MatrixSpace(ZZ, 2*self.domain().dimension(), 2*self.codomain().dimension())
272
+
273
+ def _element_constructor_from_element_class(self, *args, **keywords):
274
+ """
275
+ Used in the coercion framework. Unfortunately, the default method
276
+ would get the order of parent and data different from what is expected
277
+ in ``MatrixMorphism.__init__``.
278
+
279
+ EXAMPLES::
280
+
281
+ sage: H = Hom(J0(11), J0(22))
282
+ sage: phi = H(matrix(ZZ,2,4,[5..12])); phi # indirect doctest
283
+ Abelian variety morphism:
284
+ From: Abelian variety J0(11) of dimension 1
285
+ To: Abelian variety J0(22) of dimension 2
286
+ """
287
+ return self.element_class(self, *args, **keywords)
288
+
289
+ def __call__(self, M, **kwds):
290
+ r"""
291
+ Create a homomorphism in this space from M. M can be any of the
292
+ following:
293
+
294
+ - a Morphism of abelian varieties
295
+
296
+ - a matrix of the appropriate size
297
+ (i.e. 2\*self.domain().dimension() x
298
+ 2\*self.codomain().dimension()) whose entries are coercible
299
+ into self.base_ring()
300
+
301
+ - anything that can be coerced into self.matrix_space()
302
+
303
+ EXAMPLES::
304
+
305
+ sage: H = Hom(J0(11), J0(22))
306
+ sage: phi = H(matrix(ZZ,2,4,[5..12])) ; phi
307
+ Abelian variety morphism:
308
+ From: Abelian variety J0(11) of dimension 1
309
+ To: Abelian variety J0(22) of dimension 2
310
+ sage: phi.matrix()
311
+ [ 5 6 7 8]
312
+ [ 9 10 11 12]
313
+ sage: phi.matrix().parent()
314
+ Full MatrixSpace of 2 by 4 dense matrices over Integer Ring
315
+
316
+ ::
317
+
318
+ sage: H = J0(22).Hom(J0(11)*J0(11))
319
+ sage: m1 = J0(22).degeneracy_map(11,1).matrix() ; m1
320
+ [ 0 1]
321
+ [-1 1]
322
+ [-1 0]
323
+ [ 0 -1]
324
+ sage: m2 = J0(22).degeneracy_map(11,2).matrix() ; m2
325
+ [ 1 -2]
326
+ [ 0 -2]
327
+ [ 1 -1]
328
+ [ 0 -1]
329
+ sage: m = m1.transpose().stack(m2.transpose()).transpose() ; m
330
+ [ 0 1 1 -2]
331
+ [-1 1 0 -2]
332
+ [-1 0 1 -1]
333
+ [ 0 -1 0 -1]
334
+ sage: phi = H(m) ; phi
335
+ Abelian variety morphism:
336
+ From: Abelian variety J0(22) of dimension 2
337
+ To: Abelian variety J0(11) x J0(11) of dimension 2
338
+ sage: phi.matrix()
339
+ [ 0 1 1 -2]
340
+ [-1 1 0 -2]
341
+ [-1 0 1 -1]
342
+ [ 0 -1 0 -1]
343
+ """
344
+ side = kwds.get("side", "left")
345
+ if isinstance(M, morphism.Morphism):
346
+ if M.parent() is self:
347
+ return M
348
+ elif M.domain() == self.domain() and M.codomain() == self.codomain():
349
+ M = M.matrix()
350
+ else:
351
+ raise ValueError("cannot convert %s into %s" % (M, self))
352
+ elif isinstance(M, Matrix):
353
+ if M.base_ring() != ZZ:
354
+ M = M.change_ring(ZZ)
355
+ if side == "left":
356
+ if M.nrows() != 2*self.domain().dimension() or M.ncols() != 2*self.codomain().dimension():
357
+ raise TypeError("matrix has wrong dimension")
358
+ else:
359
+ if M.ncols() != 2*self.domain().dimension() or M.nrows() != 2*self.codomain().dimension():
360
+ raise TypeError("matrix has wrong dimension")
361
+ elif self.matrix_space().has_coerce_map_from(parent(M)):
362
+ M = self.matrix_space()(M)
363
+ else:
364
+ raise TypeError("can only coerce in matrices or morphisms")
365
+ return self.element_class(self, M, side)
366
+
367
+ def _coerce_impl(self, x):
368
+ """
369
+ Coerce x into self, if possible.
370
+
371
+ EXAMPLES::
372
+
373
+ sage: J = J0(37) ; J.Hom(J)._coerce_impl(matrix(ZZ,4,[5..20]))
374
+ Abelian variety endomorphism of Abelian variety J0(37) of dimension 2
375
+ sage: K = J0(11) * J0(11) ; J.Hom(K)._coerce_impl(matrix(ZZ,4,[5..20]))
376
+ Abelian variety morphism:
377
+ From: Abelian variety J0(37) of dimension 2
378
+ To: Abelian variety J0(11) x J0(11) of dimension 2
379
+ """
380
+ if self.matrix_space().has_coerce_map_from(parent(x)):
381
+ return self(x)
382
+ else:
383
+ return HomsetWithBase._coerce_impl(self, x)
384
+
385
+ def _repr_(self):
386
+ """
387
+ String representation of a modular abelian variety homspace.
388
+
389
+ EXAMPLES::
390
+
391
+ sage: J = J0(11)
392
+ sage: End(J)._repr_()
393
+ 'Endomorphism ring of Abelian variety J0(11) of dimension 1'
394
+ """
395
+ return "Space of homomorphisms from %s to %s" %\
396
+ (self.domain(), self.codomain())
397
+
398
+ def _get_matrix(self, g):
399
+ """
400
+ Given an object g, try to return a matrix corresponding to g with
401
+ dimensions the same as those of self.matrix_space().
402
+
403
+ INPUT:
404
+
405
+ - ``g`` -- a matrix or morphism or object with a list method
406
+
407
+ OUTPUT: a matrix
408
+
409
+ EXAMPLES::
410
+
411
+ sage: E = End(J0(11))
412
+ sage: E._get_matrix(matrix(QQ,2,[1,2,3,4]))
413
+ [1 2]
414
+ [3 4]
415
+ sage: E._get_matrix(J0(11).hecke_operator(2))
416
+ [-2 0]
417
+ [ 0 -2]
418
+
419
+ ::
420
+
421
+ sage: H = Hom(J0(11) * J0(17), J0(22))
422
+ sage: H._get_matrix(tuple([8..23]))
423
+ [ 8 9 10 11]
424
+ [12 13 14 15]
425
+ [16 17 18 19]
426
+ [20 21 22 23]
427
+ sage: H._get_matrix(tuple([8..23]))
428
+ [ 8 9 10 11]
429
+ [12 13 14 15]
430
+ [16 17 18 19]
431
+ [20 21 22 23]
432
+ sage: H._get_matrix([8..23])
433
+ [ 8 9 10 11]
434
+ [12 13 14 15]
435
+ [16 17 18 19]
436
+ [20 21 22 23]
437
+ """
438
+ try:
439
+ if g.parent() is self.matrix_space():
440
+ return g
441
+ except AttributeError:
442
+ pass
443
+
444
+ if isinstance(g, morphism.Morphism):
445
+ return g.matrix()
446
+ elif hasattr(g, 'list'):
447
+ return self.matrix_space()(g.list())
448
+ else:
449
+ return self.matrix_space()(g)
450
+
451
+ def free_module(self):
452
+ r"""
453
+ Return this endomorphism ring as a free submodule of a big
454
+ `\ZZ^{4nm}`, where `n` is the dimension of
455
+ the domain abelian variety and `m` the dimension of the
456
+ codomain.
457
+
458
+ OUTPUT: free module
459
+
460
+ EXAMPLES::
461
+
462
+ sage: E = Hom(J0(11), J0(22))
463
+ sage: E.free_module()
464
+ Free module of degree 8 and rank 2 over Integer Ring
465
+ Echelon basis matrix:
466
+ [ 1 0 -3 1 1 1 -1 -1]
467
+ [ 0 1 -3 1 1 1 -1 0]
468
+ """
469
+ self.calculate_generators()
470
+ V = ZZ**(4*self.domain().dimension() * self.codomain().dimension())
471
+ return V.submodule([V(m.matrix().list()) for m in self.gens()])
472
+
473
+ def gen(self, i=0):
474
+ """
475
+ Return `i`-th generator of ``self``.
476
+
477
+ INPUT:
478
+
479
+ - ``i`` -- integer
480
+
481
+ OUTPUT: a morphism
482
+
483
+ EXAMPLES::
484
+
485
+ sage: E = End(J0(22))
486
+ sage: E.gen(0).matrix()
487
+ [1 0 0 0]
488
+ [0 1 0 0]
489
+ [0 0 1 0]
490
+ [0 0 0 1]
491
+ """
492
+ self.calculate_generators()
493
+ if i > self.ngens():
494
+ raise ValueError("self only has %s generators" % self.ngens())
495
+ return self.element_class(self, self._gens[i])
496
+
497
+ def ngens(self):
498
+ """
499
+ Return number of generators of ``self``.
500
+
501
+ OUTPUT: integer
502
+
503
+ EXAMPLES::
504
+
505
+ sage: E = End(J0(22))
506
+ sage: E.ngens()
507
+ 4
508
+ """
509
+ self.calculate_generators()
510
+ return len(self._gens)
511
+
512
+ def gens(self) -> tuple:
513
+ """
514
+ Return tuple of generators for this endomorphism ring.
515
+
516
+ EXAMPLES::
517
+
518
+ sage: E = End(J0(22))
519
+ sage: E.gens()
520
+ (Abelian variety endomorphism of Abelian variety J0(22) of dimension 2,
521
+ Abelian variety endomorphism of Abelian variety J0(22) of dimension 2,
522
+ Abelian variety endomorphism of Abelian variety J0(22) of dimension 2,
523
+ Abelian variety endomorphism of Abelian variety J0(22) of dimension 2)
524
+ """
525
+ try:
526
+ return self._gen_morphisms
527
+ except AttributeError:
528
+ self.calculate_generators()
529
+ self._gen_morphisms = tuple([self.gen(i) for i in range(self.ngens())])
530
+ return self._gen_morphisms
531
+
532
+ def matrix_space(self):
533
+ """
534
+ Return the underlying matrix space that we view this endomorphism
535
+ ring as being embedded into.
536
+
537
+ EXAMPLES::
538
+
539
+ sage: E = End(J0(22))
540
+ sage: E.matrix_space()
541
+ Full MatrixSpace of 4 by 4 dense matrices over Integer Ring
542
+ """
543
+ return self._matrix_space
544
+
545
+ def calculate_generators(self):
546
+ """
547
+ If generators haven't already been computed, calculate generators
548
+ for this homspace. If they have been computed, do nothing.
549
+
550
+ EXAMPLES::
551
+
552
+ sage: E = End(J0(11))
553
+ sage: E.calculate_generators()
554
+ """
555
+
556
+ if self._gens is not None:
557
+ return
558
+
559
+ if (self.domain() == self.codomain()) and (self.domain().dimension() == 1):
560
+ self._gens = (identity_matrix(ZZ, 2),)
561
+ return
562
+
563
+ phi = self.domain()._isogeny_to_product_of_powers()
564
+ psi = self.codomain()._isogeny_to_product_of_powers()
565
+
566
+ H_simple = phi.codomain().Hom(psi.codomain())
567
+ im_gens = H_simple._calculate_product_gens()
568
+
569
+ M = phi.matrix()
570
+ Mt = psi.complementary_isogeny().matrix()
571
+
572
+ R = ZZ**(4*self.domain().dimension()*self.codomain().dimension())
573
+ gens = R.submodule([(M*self._get_matrix(g)*Mt).list()
574
+ for g in im_gens]).saturation().basis()
575
+ self._gens = tuple([self._get_matrix(g) for g in gens])
576
+
577
+ def _calculate_product_gens(self):
578
+ """
579
+ For internal use.
580
+
581
+ Calculate generators for ``self``, assuming that ``self`` is a product
582
+ of simple factors.
583
+
584
+ EXAMPLES::
585
+
586
+ sage: E = End(J0(37))
587
+ sage: E.gens()
588
+ (Abelian variety endomorphism of Abelian variety J0(37) of dimension 2,
589
+ Abelian variety endomorphism of Abelian variety J0(37) of dimension 2)
590
+ sage: [ x.matrix() for x in E.gens() ]
591
+ [
592
+ [1 0 0 0] [ 0 1 1 -1]
593
+ [0 1 0 0] [ 1 0 1 0]
594
+ [0 0 1 0] [ 0 0 -1 1]
595
+ [0 0 0 1], [ 0 0 0 1]
596
+ ]
597
+ sage: E._calculate_product_gens()
598
+ [
599
+ [1 0 0 0] [0 0 0 0]
600
+ [0 1 0 0] [0 0 0 0]
601
+ [0 0 0 0] [0 0 1 0]
602
+ [0 0 0 0], [0 0 0 1]
603
+ ]
604
+ """
605
+ Afactors = self.domain().decomposition(simple=False)
606
+ Bfactors = self.codomain().decomposition(simple=False)
607
+ if len(Afactors) == 1 and len(Bfactors) == 1:
608
+ Asimples = Afactors[0].decomposition()
609
+ Bsimples = Bfactors[0].decomposition()
610
+ if len(Asimples) == 1 and len(Bsimples) == 1:
611
+ # Handle the base case of A, B simple
612
+ gens = self._calculate_simple_gens()
613
+
614
+ else:
615
+ # Handle the case of A, B simple powers
616
+ gens = []
617
+ phi_matrix = Afactors[0]._isogeny_to_product_of_simples().matrix()
618
+ psi_t_matrix = Bfactors[0]._isogeny_to_product_of_simples().complementary_isogeny().matrix()
619
+ for i in range(len(Asimples)):
620
+ for j in range(len(Bsimples)):
621
+ hom_gens = Asimples[i].Hom(Bsimples[j]).gens()
622
+ for sub_gen in hom_gens:
623
+ sub_mat = sub_gen.matrix()
624
+ M = copy(self.matrix_space().zero_matrix())
625
+ M.set_block(sub_mat.nrows()*i, sub_mat.ncols()*j, sub_mat)
626
+ gens.append(phi_matrix * M * psi_t_matrix)
627
+
628
+ else:
629
+ # Handle the case of A, B generic
630
+ gens = []
631
+ cur_row = 0
632
+ for Afactor in Afactors:
633
+ cur_row += Afactor.dimension() * 2
634
+ cur_col = 0
635
+ for Bfactor in Bfactors:
636
+ cur_col += Bfactor.dimension() * 2
637
+ Asimple = Afactor[0]
638
+ Bsimple = Bfactor[0]
639
+ if Asimple.newform_label() == Bsimple.newform_label():
640
+ for sub_gen in Afactor.Hom(Bfactor).gens():
641
+ sub_mat = sub_gen.matrix()
642
+ M = copy(self.matrix_space().zero_matrix())
643
+ M.set_block(cur_row - sub_mat.nrows(),
644
+ cur_col - sub_mat.ncols(),
645
+ sub_mat)
646
+ gens.append(M)
647
+
648
+ return gens
649
+
650
+ def _calculate_simple_gens(self):
651
+ """
652
+ Calculate generators for ``self``, where both the domain and codomain
653
+ for ``self`` are assumed to be simple abelian varieties.
654
+
655
+ The saturation of the span of these generators in ``self``
656
+ will be the full space of homomorphisms from the domain of
657
+ ``self`` to its codomain.
658
+
659
+ EXAMPLES::
660
+
661
+ sage: H = Hom(J0(11), J0(22)[0])
662
+ sage: H._calculate_simple_gens()
663
+ [
664
+ [1 0]
665
+ [1 1]
666
+ ]
667
+ sage: J = J0(11) * J0(33) ; J.decomposition()
668
+ [Simple abelian subvariety 11a(1,11) of dimension 1 of J0(11) x J0(33),
669
+ Simple abelian subvariety 11a(1,33) of dimension 1 of J0(11) x J0(33),
670
+ Simple abelian subvariety 11a(3,33) of dimension 1 of J0(11) x J0(33),
671
+ Simple abelian subvariety 33a(1,33) of dimension 1 of J0(11) x J0(33)]
672
+ sage: J[0].Hom(J[1])._calculate_simple_gens()
673
+ [
674
+ [ 0 -1]
675
+ [ 1 -1]
676
+ ]
677
+ sage: J[0].Hom(J[2])._calculate_simple_gens()
678
+ [
679
+ [-1 0]
680
+ [-1 -1]
681
+ ]
682
+ sage: J[0].Hom(J[0])._calculate_simple_gens()
683
+ [
684
+ [1 0]
685
+ [0 1]
686
+ ]
687
+ sage: J[1].Hom(J[2])._calculate_simple_gens()
688
+ [
689
+ [ 0 -4]
690
+ [ 4 0]
691
+ ]
692
+
693
+ ::
694
+
695
+ sage: J = J0(23) ; J.decomposition()
696
+ [Simple abelian variety J0(23) of dimension 2]
697
+ sage: J[0].Hom(J[0])._calculate_simple_gens()
698
+ [
699
+ [1 0 0 0] [ 0 1 -1 0]
700
+ [0 1 0 0] [ 0 1 -1 1]
701
+ [0 0 1 0] [-1 2 -2 1]
702
+ [0 0 0 1], [-1 1 0 -1]
703
+ ]
704
+ sage: J.hecke_operator(2).matrix()
705
+ [ 0 1 -1 0]
706
+ [ 0 1 -1 1]
707
+ [-1 2 -2 1]
708
+ [-1 1 0 -1]
709
+
710
+ ::
711
+
712
+ sage: H = Hom(J0(11), J0(22)[0])
713
+ sage: H._calculate_simple_gens()
714
+ [
715
+ [1 0]
716
+ [1 1]
717
+ ]
718
+ """
719
+ A = self.domain()
720
+ B = self.codomain()
721
+
722
+ if A.newform_label() != B.newform_label():
723
+ return []
724
+
725
+ f = A._isogeny_to_newform_abelian_variety()
726
+ g = B._isogeny_to_newform_abelian_variety().complementary_isogeny()
727
+
728
+ Af = f.codomain()
729
+ ls = Af._calculate_endomorphism_generators()
730
+
731
+ Mf = f.matrix()
732
+ Mg = g.matrix()
733
+
734
+ return [Mf * self._get_matrix(e) * Mg for e in ls]
735
+
736
+
737
+ # NOTE/WARNING/TODO: Below in the __init__, etc. we do *not* check
738
+ # that the input gens are give something that spans a sub*ring*, as opposed
739
+ # to just a subgroup.
740
+ class EndomorphismSubring(Homspace):
741
+
742
+ def __init__(self, A, gens=None, category=None):
743
+ """
744
+ A subring of the endomorphism ring.
745
+
746
+ INPUT:
747
+
748
+ - ``A`` -- an abelian variety
749
+
750
+ - ``gens`` -- (default: ``None``) if given
751
+ should be a tuple of the generators as matrices
752
+
753
+ EXAMPLES::
754
+
755
+ sage: J0(23).endomorphism_ring()
756
+ Endomorphism ring of Abelian variety J0(23) of dimension 2
757
+ sage: sage.modular.abvar.homspace.EndomorphismSubring(J0(25))
758
+ Endomorphism ring of Abelian variety J0(25) of dimension 0
759
+ sage: E = J0(11).endomorphism_ring()
760
+ sage: type(E)
761
+ <class 'sage.modular.abvar.homspace.EndomorphismSubring_with_category'>
762
+ sage: E.homset_category()
763
+ Category of modular abelian varieties over Rational Field
764
+ sage: E.category()
765
+ Category of endsets of modular abelian varieties over Rational Field
766
+ sage: E in Rings()
767
+ True
768
+ sage: TestSuite(E).run(skip=["_test_prod"])
769
+
770
+ TESTS:
771
+
772
+ The following tests against a problem on 32 bit machines that
773
+ occurred while working on :issue:`9944`::
774
+
775
+ sage: sage.modular.abvar.homspace.EndomorphismSubring(J1(12345))
776
+ Endomorphism ring of Abelian variety J1(12345) of dimension 5405473
777
+
778
+ :issue:`16275` removed the custom ``__reduce__`` method, since
779
+ :meth:`Homset.__reduce__` already implements appropriate
780
+ unpickling by construction::
781
+
782
+ sage: E.__reduce__.__module__
783
+ 'sage.categories.homset'
784
+ sage: E.__reduce__()
785
+ (<function Hom at ...>,
786
+ (Abelian variety J0(11) of dimension 1,
787
+ Abelian variety J0(11) of dimension 1,
788
+ Category of modular abelian varieties over Rational Field,
789
+ False))
790
+ """
791
+ self._J = A.ambient_variety()
792
+ self._A = A
793
+
794
+ # Initialise self with the correct category.
795
+ if category is None:
796
+ homset_cat = A.category()
797
+ else:
798
+ homset_cat = category
799
+ # Remark: Parent.__init__ will automatically form the join
800
+ # of the category of rings and of homset_cat
801
+ Parent.__init__(self, A.base_ring(), category=homset_cat.Endsets())
802
+ Homspace.__init__(self, A, A, cat=homset_cat)
803
+ if gens is None:
804
+ self._gens = None
805
+ else:
806
+ self._gens = tuple([self._get_matrix(g) for g in gens])
807
+ self._is_full_ring = gens is None
808
+
809
+ def _repr_(self):
810
+ """
811
+ Return the string representation of ``self``.
812
+
813
+ EXAMPLES::
814
+
815
+ sage: J0(31).endomorphism_ring()._repr_()
816
+ 'Endomorphism ring of Abelian variety J0(31) of dimension 2'
817
+ sage: J0(31).endomorphism_ring().image_of_hecke_algebra()._repr_()
818
+ 'Subring of endomorphism ring of Abelian variety J0(31) of dimension 2'
819
+ """
820
+ if self._is_full_ring:
821
+ return "Endomorphism ring of %s" % self._A
822
+ else:
823
+ return "Subring of endomorphism ring of %s" % self._A
824
+
825
+ def abelian_variety(self):
826
+ """
827
+ Return the abelian variety that this endomorphism ring is attached
828
+ to.
829
+
830
+ EXAMPLES::
831
+
832
+ sage: J0(11).endomorphism_ring().abelian_variety()
833
+ Abelian variety J0(11) of dimension 1
834
+ """
835
+ return self._A
836
+
837
+ def index_in(self, other, check=True):
838
+ """
839
+ Return the index of ``self`` in ``other``.
840
+
841
+ INPUT:
842
+
843
+ - ``other`` -- another endomorphism subring of the
844
+ same abelian variety
845
+
846
+ - ``check`` -- boolean (default: ``True``); whether to do some
847
+ type and other consistency checks
848
+
849
+ EXAMPLES::
850
+
851
+ sage: R = J0(33).endomorphism_ring()
852
+ sage: R.index_in(R)
853
+ 1
854
+ sage: J = J0(37) ; E = J.endomorphism_ring() ; T = E.image_of_hecke_algebra()
855
+ sage: T.index_in(E)
856
+ 1
857
+ sage: J = J0(22) ; E = J.endomorphism_ring() ; T = E.image_of_hecke_algebra()
858
+ sage: T.index_in(E)
859
+ +Infinity
860
+ """
861
+ if check:
862
+ if not isinstance(other, EndomorphismSubring):
863
+ raise ValueError("other must be a subring of an endomorphism ring of an abelian variety.")
864
+ if not (self.abelian_variety() == other.abelian_variety()):
865
+ raise ValueError("self and other must be endomorphisms of the same abelian variety")
866
+
867
+ M = self.free_module()
868
+ N = other.free_module()
869
+ if M.rank() < N.rank():
870
+ return Infinity
871
+ return M.index_in(N)
872
+
873
+ def index_in_saturation(self):
874
+ """
875
+ Given a Hecke algebra T, compute its index in its saturation.
876
+
877
+ EXAMPLES::
878
+
879
+ sage: End(J0(23)).image_of_hecke_algebra().index_in_saturation()
880
+ 1
881
+ sage: End(J0(44)).image_of_hecke_algebra().index_in_saturation()
882
+ 2
883
+ """
884
+ A = self.abelian_variety()
885
+ d = A.dimension()
886
+ M = ZZ**(4*d**2)
887
+ gens = [x.matrix().list() for x in self.gens()]
888
+ R = M.submodule(gens)
889
+ return R.index_in_saturation()
890
+
891
+ def discriminant(self):
892
+ """
893
+ Return the discriminant of this ring, which is the discriminant of
894
+ the trace pairing.
895
+
896
+ .. NOTE::
897
+
898
+ One knows that for modular abelian varieties, the
899
+ endomorphism ring should be isomorphic to an order in a
900
+ number field. However, the discriminant returned by this
901
+ function will be `2^n` ( `n =`
902
+ self.dimension()) times the discriminant of that order,
903
+ since the elements are represented as 2d x 2d
904
+ matrices. Notice, for example, that the case of a one
905
+ dimensional abelian variety, whose endomorphism ring must
906
+ be ZZ, has discriminant 2, as in the example below.
907
+
908
+ EXAMPLES::
909
+
910
+ sage: J0(33).endomorphism_ring().discriminant()
911
+ -64800
912
+ sage: J0(46).endomorphism_ring().discriminant() # long time (6s on sage.math, 2011)
913
+ 24200000000
914
+ sage: J0(11).endomorphism_ring().discriminant()
915
+ 2
916
+ """
917
+ g = self.gens()
918
+ M = matrix(ZZ, len(g), [(g[i]*g[j]).trace()
919
+ for i in range(len(g)) for j in range(len(g))])
920
+ return M.determinant()
921
+
922
+ def image_of_hecke_algebra(self, check_every=1):
923
+ """
924
+ Compute the image of the Hecke algebra inside this endomorphism
925
+ subring.
926
+
927
+ We simply calculate Hecke operators up to the Sturm bound, and look
928
+ at the submodule spanned by them. While computing, we can check to
929
+ see if the submodule spanned so far is saturated and of maximal
930
+ dimension, in which case we may be done. The optional argument
931
+ check_every determines how many Hecke operators we add in before
932
+ checking to see if this condition is met.
933
+
934
+ INPUT:
935
+
936
+ - ``check_every`` -- integer (default: 1); if this integer is positive,
937
+ this integer determines how many Hecke operators we add in before
938
+ checking to see if the submodule spanned so far is maximal and
939
+ saturated
940
+
941
+ OUTPUT: the image of the Hecke algebra as a subring of ``self``
942
+
943
+ EXAMPLES::
944
+
945
+ sage: E = J0(33).endomorphism_ring()
946
+ sage: E.image_of_hecke_algebra()
947
+ Subring of endomorphism ring of Abelian variety J0(33) of dimension 3
948
+ sage: E.image_of_hecke_algebra().gens()
949
+ (Abelian variety endomorphism of Abelian variety J0(33) of dimension 3,
950
+ Abelian variety endomorphism of Abelian variety J0(33) of dimension 3,
951
+ Abelian variety endomorphism of Abelian variety J0(33) of dimension 3)
952
+ sage: [ x.matrix() for x in E.image_of_hecke_algebra().gens() ]
953
+ [
954
+ [1 0 0 0 0 0] [ 0 2 0 -1 1 -1] [ 0 0 1 -1 1 -1]
955
+ [0 1 0 0 0 0] [-1 -2 2 -1 2 -1] [ 0 -1 1 0 1 -1]
956
+ [0 0 1 0 0 0] [ 0 0 1 -1 3 -1] [ 0 0 1 0 2 -2]
957
+ [0 0 0 1 0 0] [-2 2 0 1 1 -1] [-2 0 1 1 1 -1]
958
+ [0 0 0 0 1 0] [-1 1 0 2 0 -3] [-1 0 1 1 0 -1]
959
+ [0 0 0 0 0 1], [-1 1 -1 1 1 -2], [-1 0 0 1 0 -1]
960
+ ]
961
+ sage: J0(33).hecke_operator(2).matrix()
962
+ [-1 0 1 -1 1 -1]
963
+ [ 0 -2 1 0 1 -1]
964
+ [ 0 0 0 0 2 -2]
965
+ [-2 0 1 0 1 -1]
966
+ [-1 0 1 1 -1 -1]
967
+ [-1 0 0 1 0 -2]
968
+ """
969
+ try:
970
+ return self.__hecke_algebra_image
971
+ except AttributeError:
972
+ pass
973
+
974
+ A = self.abelian_variety()
975
+ if not A.is_hecke_stable():
976
+ raise ValueError("ambient variety is not Hecke stable")
977
+
978
+ M = A.modular_symbols()
979
+
980
+ d = A.dimension()
981
+ EndVecZ = ZZ**(4*d**2)
982
+
983
+ if d == 1:
984
+ self.__hecke_algebra_image = EndomorphismSubring(A, [[1, 0, 0, 1]])
985
+ return self.__hecke_algebra_image
986
+
987
+ V = EndVecZ.submodule([A.hecke_operator(1).matrix().list()])
988
+
989
+ for n in range(2, M.sturm_bound()+1):
990
+ if (check_every > 0 and
991
+ n % check_every == 0 and
992
+ V.dimension() == d and
993
+ V.index_in_saturation() == 1):
994
+ break
995
+ V += EndVecZ.submodule([A.hecke_operator(n).matrix().list()])
996
+
997
+ self.__hecke_algebra_image = EndomorphismSubring(A, V.basis())
998
+ return self.__hecke_algebra_image