passagemath-schemes 10.6.38__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.

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.21.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.38.dist-info/METADATA +204 -0
  7. passagemath_schemes-10.6.38.dist-info/METADATA.bak +205 -0
  8. passagemath_schemes-10.6.38.dist-info/RECORD +314 -0
  9. passagemath_schemes-10.6.38.dist-info/WHEEL +6 -0
  10. passagemath_schemes-10.6.38.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-314t-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-314t-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-314t-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-314t-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-314t-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-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 +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-314t-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-314t-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-314t-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-314t-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-314t-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-314t-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,780 @@
1
+ # sage_setup: distribution = sagemath-schemes
2
+ # sage.doctest: needs sage.libs.flint sage.libs.pari
3
+ """
4
+ Hecke operators
5
+ """
6
+ # ****************************************************************************
7
+ # Copyright (C) 2004 William Stein <wstein@gmail.com>
8
+ #
9
+ # Distributed under the terms of the GNU General Public License (GPL)
10
+ #
11
+ # This code is distributed in the hope that it will be useful,
12
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
+ # General Public License for more details.
15
+ #
16
+ # The full text of the GPL is available at:
17
+ #
18
+ # https://www.gnu.org/licenses/
19
+ # ****************************************************************************
20
+ from sage.structure.element import AlgebraElement
21
+ from sage.structure.richcmp import richcmp, rich_to_bool
22
+ from sage.categories.homset import End
23
+ import sage.arith.all as arith
24
+ from sage.rings.integer import Integer
25
+
26
+ from . import algebra
27
+ from . import morphism
28
+
29
+
30
+ def is_HeckeOperator(x):
31
+ r"""
32
+ Return ``True`` if x is of type HeckeOperator.
33
+
34
+ EXAMPLES::
35
+
36
+ sage: from sage.modular.hecke.hecke_operator import is_HeckeOperator
37
+ sage: M = ModularSymbols(Gamma0(7), 4)
38
+ sage: is_HeckeOperator(M.T(3))
39
+ doctest:warning...
40
+ DeprecationWarning: the function is_HeckeOperator is deprecated;
41
+ use 'isinstance(..., HeckeOperator)' instead
42
+ See https://github.com/sagemath/sage/issues/37895 for details.
43
+ True
44
+ sage: is_HeckeOperator(M.T(3) + M.T(5))
45
+ False
46
+ """
47
+ from sage.misc.superseded import deprecation
48
+ deprecation(37895, "the function is_HeckeOperator is deprecated; use 'isinstance(..., HeckeOperator)' instead")
49
+ return isinstance(x, HeckeOperator)
50
+
51
+
52
+ def is_HeckeAlgebraElement(x):
53
+ r"""
54
+ Return ``True`` if x is of type HeckeAlgebraElement.
55
+
56
+ EXAMPLES::
57
+
58
+ sage: from sage.modular.hecke.hecke_operator import is_HeckeAlgebraElement
59
+ sage: M = ModularSymbols(Gamma0(7), 4)
60
+ sage: is_HeckeAlgebraElement(M.T(3))
61
+ doctest:warning...
62
+ DeprecationWarning: the function is_HeckeAlgebraElement is deprecated;
63
+ use 'isinstance(..., HeckeAlgebraElement)' instead
64
+ See https://github.com/sagemath/sage/issues/37895 for details.
65
+ True
66
+ sage: is_HeckeAlgebraElement(M.T(3) + M.T(5))
67
+ True
68
+ """
69
+ from sage.misc.superseded import deprecation
70
+ deprecation(37895, "the function is_HeckeAlgebraElement is deprecated; use 'isinstance(..., HeckeAlgebraElement)' instead")
71
+ return isinstance(x, HeckeAlgebraElement)
72
+
73
+
74
+ class HeckeAlgebraElement(AlgebraElement):
75
+ r"""
76
+ Base class for elements of Hecke algebras.
77
+ """
78
+ def __init__(self, parent):
79
+ r"""
80
+ Create an element of a Hecke algebra.
81
+
82
+ EXAMPLES::
83
+
84
+ sage: R = ModularForms(Gamma0(7), 4).hecke_algebra()
85
+ sage: sage.modular.hecke.hecke_operator.HeckeAlgebraElement(R) # please don't do this!
86
+ Generic element of a structure
87
+ """
88
+ if not isinstance(parent, algebra.HeckeAlgebra_base):
89
+ raise TypeError("parent (=%s) must be a Hecke algebra" % parent)
90
+ AlgebraElement.__init__(self, parent)
91
+
92
+ def domain(self):
93
+ r"""
94
+ The domain of this operator. This is the Hecke module associated to the
95
+ parent Hecke algebra.
96
+
97
+ EXAMPLES::
98
+
99
+ sage: R = ModularForms(Gamma0(7), 4).hecke_algebra()
100
+ sage: sage.modular.hecke.hecke_operator.HeckeAlgebraElement(R).domain()
101
+ Modular Forms space of dimension 3 for Congruence Subgroup Gamma0(7)
102
+ of weight 4 over Rational Field
103
+ """
104
+ return self.parent().module()
105
+
106
+ def codomain(self):
107
+ r"""
108
+ The codomain of this operator. This is the Hecke module associated to the
109
+ parent Hecke algebra.
110
+
111
+ EXAMPLES::
112
+
113
+ sage: R = ModularForms(Gamma0(7), 4).hecke_algebra()
114
+ sage: sage.modular.hecke.hecke_operator.HeckeAlgebraElement(R).codomain()
115
+ Modular Forms space of dimension 3 for Congruence Subgroup Gamma0(7)
116
+ of weight 4 over Rational Field
117
+ """
118
+ return self.parent().module()
119
+
120
+ def hecke_module_morphism(self):
121
+ """
122
+ Return the endomorphism of Hecke modules defined by the matrix
123
+ attached to this Hecke operator.
124
+
125
+ EXAMPLES::
126
+
127
+ sage: M = ModularSymbols(Gamma1(13))
128
+ sage: t = M.hecke_operator(2)
129
+ sage: t
130
+ Hecke operator T_2 on Modular Symbols space of dimension 15 for Gamma_1(13)
131
+ of weight 2 with sign 0 over Rational Field
132
+ sage: t.hecke_module_morphism()
133
+ Hecke module morphism T_2 defined by the matrix
134
+ [ 2 0 0 0 0 0 0 1 0 0 1 0 0 0 0]
135
+ [ 0 2 0 1 0 1 0 0 -1 0 0 0 0 0 1]
136
+ [ 0 1 2 0 0 0 0 0 0 0 0 -1 1 0 0]
137
+ [ 1 0 0 2 0 -1 1 0 1 0 -1 1 -1 0 0]
138
+ [ 0 0 1 0 2 0 -1 0 0 0 0 0 0 0 0]
139
+ [ 0 0 0 0 0 0 0 0 0 0 0 1 -2 2 -1]
140
+ [ 0 0 0 0 0 2 -1 0 -1 0 0 0 0 1 0]
141
+ [ 0 0 0 0 1 0 0 2 0 0 0 0 0 0 -1]
142
+ [ 0 0 0 0 0 1 0 0 -1 0 2 -1 0 2 -1]
143
+ [ 0 0 0 0 0 1 1 0 0 -1 0 1 -1 2 0]
144
+ [ 0 0 0 0 0 2 0 0 -1 -1 1 -1 0 1 0]
145
+ [ 0 0 0 0 0 1 1 0 1 0 0 0 -1 1 0]
146
+ [ 0 0 0 0 0 1 1 0 0 1 0 0 0 0 0]
147
+ [ 0 0 0 0 0 1 0 0 1 -1 2 0 0 0 -1]
148
+ [ 0 0 0 0 0 0 0 0 0 1 0 -1 2 0 -1]
149
+ Domain: Modular Symbols space of dimension 15 for Gamma_1(13) of weight ...
150
+ Codomain: Modular Symbols space of dimension 15 for Gamma_1(13) of weight ...
151
+ """
152
+ try:
153
+ return self.__hecke_module_morphism
154
+ except AttributeError:
155
+ T = self.matrix()
156
+ M = self.domain()
157
+ H = End(M)
158
+ if isinstance(self, HeckeOperator):
159
+ name = "T_%s" % self.index()
160
+ else:
161
+ name = ""
162
+ self.__hecke_module_morphism = morphism.HeckeModuleMorphism_matrix(H, T, name)
163
+ return self.__hecke_module_morphism
164
+
165
+ def _add_(self, other):
166
+ """
167
+ Add ``self`` to ``other``.
168
+
169
+ EXAMPLES::
170
+
171
+ sage: M = ModularSymbols(11)
172
+ sage: t = M.hecke_operator(2)
173
+ sage: t
174
+ Hecke operator T_2 on Modular Symbols space of dimension 3 for Gamma_0(11) of weight 2 with sign 0 over Rational Field
175
+ sage: t + t # indirect doctest
176
+ Hecke operator on Modular Symbols space of dimension 3 for Gamma_0(11) of weight 2 with sign 0 over Rational Field defined by:
177
+ [ 6 0 -2]
178
+ [ 0 -4 0]
179
+ [ 0 0 -4]
180
+
181
+ We can also add Hecke operators with different indexes::
182
+
183
+ sage: M = ModularSymbols(Gamma1(6),4)
184
+ sage: t2 = M.hecke_operator(2); t3 = M.hecke_operator(3)
185
+ sage: t2 + t3
186
+ Hecke operator on Modular Symbols space of dimension 6 for Gamma_1(6) of weight 4 with sign 0 over Rational Field defined by:
187
+ [ 35 0 0 8/5 8/5 -16/5]
188
+ [ 4 28 0 -19/5 -19/5 38/5]
189
+ [ 18 0 9 -6 8 -2]
190
+ [ 0 18 4 -23/5 -13/5 46/5]
191
+ [ 0 18 4 2/5 -38/5 46/5]
192
+ [ 0 18 4 2/5 -13/5 21/5]
193
+ sage: (t2 - t3).charpoly('x')
194
+ x^6 + 36*x^5 + 104*x^4 - 3778*x^3 + 7095*x^2 - 3458*x
195
+ """
196
+ return self.parent()(self.matrix() + other.matrix(), check=False)
197
+
198
+ def __call__(self, x):
199
+ """
200
+ Apply this Hecke operator to `x`.
201
+
202
+ EXAMPLES::
203
+
204
+ sage: M = ModularSymbols(11); t2 = M.hecke_operator(2)
205
+ sage: t2(M.gen(0))
206
+ 3*(1,0) - (1,9)
207
+
208
+ ::
209
+
210
+ sage: t2 = M.hecke_operator(2); t3 = M.hecke_operator(3)
211
+ sage: t3(t2(M.gen(0)))
212
+ 12*(1,0) - 2*(1,9)
213
+ sage: (t3*t2)(M.gen(0))
214
+ 12*(1,0) - 2*(1,9)
215
+ """
216
+ T = self.hecke_module_morphism()
217
+ return T(x)
218
+
219
+ def __rmul__(self, left):
220
+ """
221
+ EXAMPLES::
222
+
223
+ sage: M = ModularSymbols(11); t2 = M.hecke_operator(2)
224
+ sage: 2*t2
225
+ Hecke operator on Modular Symbols space of dimension 3 for Gamma_0(11) of weight 2 with sign 0 over Rational Field defined by:
226
+ [ 6 0 -2]
227
+ [ 0 -4 0]
228
+ [ 0 0 -4]
229
+ """
230
+ return self.parent()(left * self.matrix())
231
+
232
+ def _sub_(self, other):
233
+ """
234
+ Compute the difference of ``self`` and ``other``, where ``other`` has
235
+ already been coerced into the parent of ``self``.
236
+
237
+ EXAMPLES::
238
+
239
+ sage: M = ModularSymbols(Gamma1(6),4)
240
+ sage: t2 = M.hecke_operator(2); t3 = M.hecke_operator(3)
241
+ sage: t2 - t3 # indirect doctest
242
+ Hecke operator on Modular Symbols space of dimension 6 for Gamma_1(6) of weight 4 with sign 0 over Rational Field defined by:
243
+ [ -19 0 0 -4/5 -4/5 8/5]
244
+ [ 4 -26 0 17/5 17/5 -34/5]
245
+ [ -18 0 7 -18/5 12/5 6/5]
246
+ [ 0 -18 4 3/5 23/5 -26/5]
247
+ [ 0 -18 4 -2/5 28/5 -26/5]
248
+ [ 0 -18 4 -2/5 23/5 -21/5]
249
+ """
250
+ return self.parent()(self.matrix() - other.matrix(), check=False)
251
+
252
+ def apply_sparse(self, x):
253
+ """
254
+ Apply this Hecke operator to x, where we avoid computing the matrix
255
+ of x if possible.
256
+
257
+ EXAMPLES::
258
+
259
+ sage: M = ModularSymbols(11)
260
+ sage: T = M.hecke_operator(23)
261
+ sage: T.apply_sparse(M.gen(0))
262
+ 24*(1,0) - 5*(1,9)
263
+ """
264
+ if x not in self.domain():
265
+ raise TypeError("x (=%s) must be in %s" % (x, self.domain()))
266
+ # Generic implementation which doesn't actually do anything
267
+ # special regarding sparseness. Override this for speed.
268
+ T = self.hecke_module_morphism()
269
+ return T(x)
270
+
271
+ def charpoly(self, var='x'):
272
+ """
273
+ Return the characteristic polynomial of this Hecke operator.
274
+
275
+ INPUT:
276
+
277
+ - ``var`` -- string (default: ``'x'``)
278
+
279
+ OUTPUT: a monic polynomial in the given variable
280
+
281
+ EXAMPLES::
282
+
283
+ sage: M = ModularSymbols(Gamma1(6),4)
284
+ sage: M.hecke_operator(2).charpoly('x')
285
+ x^6 - 14*x^5 + 29*x^4 + 172*x^3 - 124*x^2 - 320*x + 256
286
+ """
287
+ return self.matrix().charpoly(var)
288
+
289
+ def decomposition(self):
290
+ """
291
+ Decompose the Hecke module under the action of this Hecke
292
+ operator.
293
+
294
+ EXAMPLES::
295
+
296
+ sage: M = ModularSymbols(11)
297
+ sage: t2 = M.hecke_operator(2)
298
+ sage: t2.decomposition()
299
+ [Modular Symbols subspace of dimension 1 of Modular Symbols space of dimension 3 for Gamma_0(11) of weight 2 with sign 0 over Rational Field,
300
+ Modular Symbols subspace of dimension 2 of Modular Symbols space of dimension 3 for Gamma_0(11) of weight 2 with sign 0 over Rational Field]
301
+
302
+ ::
303
+
304
+ sage: M = ModularSymbols(33, sign=1).new_submodule()
305
+ sage: T = M.hecke_operator(2)
306
+ sage: T.decomposition()
307
+ [Modular Symbols subspace of dimension 1 of Modular Symbols space of dimension 6 for Gamma_0(33) of weight 2 with sign 1 over Rational Field,
308
+ Modular Symbols subspace of dimension 1 of Modular Symbols space of dimension 6 for Gamma_0(33) of weight 2 with sign 1 over Rational Field]
309
+ """
310
+ try:
311
+ return self.__decomposition
312
+ except AttributeError:
313
+ pass
314
+ if isinstance(self, HeckeOperator) and \
315
+ arith.gcd(self.index(), self.domain().level()) == 1:
316
+ D = self.hecke_module_morphism().decomposition(is_diagonalizable=True)
317
+ else:
318
+ # TODO: There are other weaker hypotheses that imply diagonalizability.
319
+ D = self.hecke_module_morphism().decomposition()
320
+ D.sort()
321
+ D.set_immutable()
322
+ self.__decomposition = D
323
+ return D
324
+
325
+ def det(self):
326
+ """
327
+ Return the determinant of this Hecke operator.
328
+
329
+ EXAMPLES::
330
+
331
+ sage: M = ModularSymbols(23)
332
+ sage: T = M.hecke_operator(3)
333
+ sage: T.det()
334
+ 100
335
+ """
336
+ return self.hecke_module_morphism().det()
337
+
338
+ def fcp(self, var='x'):
339
+ """
340
+ Return the factorization of the characteristic polynomial of this
341
+ Hecke operator.
342
+
343
+ EXAMPLES::
344
+
345
+ sage: M = ModularSymbols(23)
346
+ sage: T = M.hecke_operator(3)
347
+ sage: T.fcp('x')
348
+ (x - 4) * (x^2 - 5)^2
349
+ """
350
+ return self.hecke_module_morphism().fcp(var)
351
+
352
+ def image(self):
353
+ """
354
+ Return the image of this Hecke operator.
355
+
356
+ EXAMPLES::
357
+
358
+ sage: M = ModularSymbols(23)
359
+ sage: T = M.hecke_operator(3)
360
+ sage: T.fcp('x')
361
+ (x - 4) * (x^2 - 5)^2
362
+ sage: T.image()
363
+ Modular Symbols subspace of dimension 5 of Modular Symbols space of dimension 5 for Gamma_0(23) of weight 2 with sign 0 over Rational Field
364
+ sage: (T-4).image()
365
+ Modular Symbols subspace of dimension 4 of Modular Symbols space of dimension 5 for Gamma_0(23) of weight 2 with sign 0 over Rational Field
366
+ sage: (T**2-5).image()
367
+ Modular Symbols subspace of dimension 1 of Modular Symbols space of dimension 5 for Gamma_0(23) of weight 2 with sign 0 over Rational Field
368
+ """
369
+ return self.hecke_module_morphism().image()
370
+
371
+ def kernel(self):
372
+ """
373
+ Return the kernel of this Hecke operator.
374
+
375
+ EXAMPLES::
376
+
377
+ sage: M = ModularSymbols(23)
378
+ sage: T = M.hecke_operator(3)
379
+ sage: T.fcp('x')
380
+ (x - 4) * (x^2 - 5)^2
381
+ sage: T.kernel()
382
+ Modular Symbols subspace of dimension 0 of Modular Symbols space of dimension 5 for Gamma_0(23) of weight 2 with sign 0 over Rational Field
383
+ sage: (T-4).kernel()
384
+ Modular Symbols subspace of dimension 1 of Modular Symbols space of dimension 5 for Gamma_0(23) of weight 2 with sign 0 over Rational Field
385
+ sage: (T**2-5).kernel()
386
+ Modular Symbols subspace of dimension 4 of Modular Symbols space of dimension 5 for Gamma_0(23) of weight 2 with sign 0 over Rational Field
387
+ """
388
+ return self.hecke_module_morphism().kernel()
389
+
390
+ def trace(self):
391
+ """
392
+ Return the trace of this Hecke operator.
393
+
394
+ ::
395
+
396
+ sage: M = ModularSymbols(1,12)
397
+ sage: T = M.hecke_operator(2)
398
+ sage: T.trace()
399
+ 2001
400
+ """
401
+ return self.hecke_module_morphism().trace()
402
+
403
+ def __getitem__(self, ij):
404
+ """
405
+ EXAMPLES::
406
+
407
+ sage: M = ModularSymbols(1,12)
408
+ sage: T = M.hecke_operator(2).matrix_form()
409
+ sage: T[0,0]
410
+ -24
411
+ """
412
+ return self.matrix()[ij]
413
+
414
+
415
+ class HeckeAlgebraElement_matrix(HeckeAlgebraElement):
416
+ r"""
417
+ An element of the Hecke algebra represented by a matrix.
418
+ """
419
+ def __init__(self, parent, A):
420
+ r"""
421
+ Initialise an element from a matrix. This *must* be over the base ring
422
+ of ``self`` and have the right size.
423
+
424
+ This is a bit overkill as similar checks will be performed by the call
425
+ and coerce methods of the parent of self, but it can't hurt to be
426
+ paranoid. Any fancy coercion / base_extension / etc happens there, not
427
+ here.
428
+
429
+ TESTS::
430
+
431
+ sage: T = ModularForms(Gamma0(7), 4).hecke_algebra()
432
+ sage: M = sage.modular.hecke.hecke_operator.HeckeAlgebraElement_matrix(T, matrix(QQ,3,[2,3,0,1,2,3,7,8,9])); M
433
+ Hecke operator on Modular Forms space of dimension 3 for Congruence Subgroup Gamma0(7) of weight 4 over Rational Field defined by:
434
+ [2 3 0]
435
+ [1 2 3]
436
+ [7 8 9]
437
+ sage: loads(dumps(M)) == M
438
+ True
439
+ sage: sage.modular.hecke.hecke_operator.HeckeAlgebraElement_matrix(T, matrix(Integers(2),3,[2,3,0,1,2,3,7,8,9]))
440
+ Traceback (most recent call last):
441
+ ...
442
+ TypeError: base ring of matrix (Ring of integers modulo 2) does not match base ring of space (Rational Field)
443
+ sage: sage.modular.hecke.hecke_operator.HeckeAlgebraElement_matrix(T, matrix(QQ,2,[2,3,0,1]))
444
+ Traceback (most recent call last):
445
+ ...
446
+ TypeError: A must be a square matrix of rank 3
447
+ """
448
+ HeckeAlgebraElement.__init__(self, parent)
449
+ from sage.structure.element import Matrix
450
+ if not isinstance(A, Matrix):
451
+ raise TypeError("A must be a matrix")
452
+ if not A.base_ring() == self.parent().base_ring():
453
+ raise TypeError("base ring of matrix (%s) does not match base ring of space (%s)" % (A.base_ring(), self.parent().base_ring()))
454
+ if not A.nrows() == A.ncols() == self.parent().module().rank():
455
+ raise TypeError("A must be a square matrix of rank %s" % self.parent().module().rank())
456
+ self.__matrix = A
457
+
458
+ def _richcmp_(self, other, op):
459
+ r"""
460
+ Compare ``self`` to ``other``, where the coercion model has already ensured
461
+ that ``other`` has the same parent as ``self``.
462
+
463
+ EXAMPLES::
464
+
465
+ sage: T = ModularForms(SL2Z, 12).hecke_algebra()
466
+ sage: m = T(matrix(QQ, 2, [1,2,0,1]), check=False); n = T.hecke_operator(14)
467
+ sage: m == n
468
+ False
469
+ sage: m == n.matrix_form()
470
+ False
471
+ sage: n.matrix_form() == T(matrix(QQ, 2, [401856,0,0,4051542498456]), check=False)
472
+ True
473
+ """
474
+ if not isinstance(other, HeckeAlgebraElement_matrix):
475
+ if isinstance(other, HeckeOperator):
476
+ return richcmp(self, other.matrix_form(), op)
477
+ else:
478
+ raise RuntimeError("Bug in coercion code") # can't get here
479
+
480
+ return richcmp(self.__matrix, other.__matrix, op)
481
+
482
+ def _repr_(self):
483
+ r"""
484
+ String representation of ``self``.
485
+
486
+ EXAMPLES::
487
+
488
+ sage: M = ModularSymbols(1,12)
489
+ sage: M.hecke_operator(2).matrix_form()._repr_()
490
+ 'Hecke operator on Modular Symbols space of dimension 3 for Gamma_0(1) of weight 12 with sign 0 over Rational Field defined by:\n[ -24 0 0]\n[ 0 -24 0]\n[4860 0 2049]'
491
+ sage: ModularForms(Gamma0(100)).hecke_operator(4).matrix_form()._repr_()
492
+ 'Hecke operator on Modular Forms space of dimension 24 for Congruence Subgroup Gamma0(100) of weight 2 over Rational Field defined by:\n24 x 24 dense matrix over Rational Field'
493
+ """
494
+ return "Hecke operator on %s defined by:\n%r" % (self.parent().module(), self.__matrix)
495
+
496
+ def _latex_(self):
497
+ r"""
498
+ Latex representation of ``self`` (just prints the matrix).
499
+
500
+ EXAMPLES::
501
+
502
+ sage: M = ModularSymbols(1,12)
503
+ sage: M.hecke_operator(2).matrix_form()._latex_()
504
+ '\\left(\\begin{array}{rrr}\n-24 & 0 & 0 \\\\\n0 & -24 & 0 \\\\\n4860 & 0 & 2049\n\\end{array}\\right)'
505
+ """
506
+ return self.__matrix._latex_()
507
+
508
+ def matrix(self):
509
+ """
510
+ Return the matrix that defines this Hecke algebra element.
511
+
512
+ EXAMPLES::
513
+
514
+ sage: M = ModularSymbols(1,12)
515
+ sage: T = M.hecke_operator(2).matrix_form()
516
+ sage: T.matrix()
517
+ [ -24 0 0]
518
+ [ 0 -24 0]
519
+ [4860 0 2049]
520
+ """
521
+ return self.__matrix
522
+
523
+ def _mul_(self, other):
524
+ r"""
525
+ Multiply ``self`` by ``other`` (which has already been coerced into an element
526
+ of the parent of ``self``).
527
+
528
+ EXAMPLES::
529
+
530
+ sage: M = ModularSymbols(1,12)
531
+ sage: T = M.hecke_operator(2).matrix_form()
532
+ sage: T * T # indirect doctest
533
+ Hecke operator on Modular Symbols space of dimension 3 for Gamma_0(1) of weight 12 with sign 0 over Rational Field defined by:
534
+ [ 576 0 0]
535
+ [ 0 576 0]
536
+ [9841500 0 4198401]
537
+ """
538
+ return self.parent()(other.matrix() * self.matrix(), check=False)
539
+
540
+
541
+ class DiamondBracketOperator(HeckeAlgebraElement_matrix):
542
+ r"""
543
+ The diamond bracket operator `\langle d \rangle` for some `d \in \ZZ /
544
+ N\ZZ` (which need not be a unit, although if it is not, the operator will
545
+ be zero).
546
+ """
547
+ def __init__(self, parent, d):
548
+ r"""
549
+ Standard init function.
550
+
551
+ EXAMPLES::
552
+
553
+ sage: M = ModularSymbols(Gamma1(5),6)
554
+ sage: d = M.diamond_bracket_operator(2); d # indirect doctest
555
+ Diamond bracket operator <2> on Modular Symbols space of dimension 10 for Gamma_1(5) of weight 6 with sign 0 over Rational Field
556
+ sage: type(d)
557
+ <class 'sage.modular.hecke.hecke_operator.DiamondBracketOperator'>
558
+ sage: d.matrix()
559
+ [ 0 1 0 0 0 0 0 0 0 0]
560
+ [ 1 0 0 0 0 0 0 0 0 0]
561
+ [ 0 0 0 0 0 0 1 0 0 0]
562
+ [ 0 0 0 0 0 0 0 0 0 1]
563
+ [ 0 0 0 0 0 0 0 1 0 0]
564
+ [ 0 0 17/16 11/16 -3/4 -1 17/16 -3/4 0 11/16]
565
+ [ 0 0 1 0 0 0 0 0 0 0]
566
+ [ 0 0 0 0 1 0 0 0 0 0]
567
+ [ 0 0 -1/2 1/2 1 0 -1/2 1 -1 1/2]
568
+ [ 0 0 0 1 0 0 0 0 0 0]
569
+ sage: d**4 == 1
570
+ True
571
+ """
572
+ self.__d = d
573
+ A = parent.diamond_bracket_matrix(d)
574
+ HeckeAlgebraElement_matrix.__init__(self, parent, A)
575
+
576
+ def _repr_(self):
577
+ r"""
578
+ EXAMPLES::
579
+
580
+ sage: ModularSymbols(Gamma1(5), 6).diamond_bracket_operator(2)._repr_()
581
+ 'Diamond bracket operator <2> on Modular Symbols space of dimension 10 for Gamma_1(5) of weight 6 with sign 0 over Rational Field'
582
+ """
583
+ return "Diamond bracket operator <%s> on %s" % (self.__d, self.domain())
584
+
585
+ def _latex_(self):
586
+ r"""
587
+ EXAMPLES::
588
+
589
+ sage: latex(ModularSymbols(Gamma1(5), 12).diamond_bracket_operator(2)) # indirect doctest
590
+ \langle 2 \rangle
591
+ """
592
+ return r"\langle %s \rangle" % self.__d
593
+
594
+
595
+ class HeckeOperator(HeckeAlgebraElement):
596
+ r"""
597
+ The Hecke operator `T_n` for some `n` (which need not be coprime to the
598
+ level). The matrix is not computed until it is needed.
599
+ """
600
+ def __init__(self, parent, n):
601
+ """
602
+ EXAMPLES::
603
+
604
+ sage: M = ModularSymbols(11)
605
+ sage: H = M.hecke_operator(2005); H
606
+ Hecke operator T_2005 on Modular Symbols space of dimension 3 for Gamma_0(11) of weight 2 with sign 0 over Rational Field
607
+ sage: H == loads(dumps(H))
608
+ True
609
+
610
+ We create a Hecke operator of large index (greater than 32 bits)::
611
+
612
+ sage: M1 = ModularSymbols(21,2)
613
+ sage: M1.hecke_operator(13^9)
614
+ Hecke operator T_10604499373 on Modular Symbols space of dimension 5 for Gamma_0(21) of weight 2 with sign 0 over Rational Field
615
+ """
616
+ HeckeAlgebraElement.__init__(self, parent)
617
+ if not isinstance(n, (int, Integer)):
618
+ raise TypeError("n must be an int")
619
+ self.__n = int(n)
620
+
621
+ def _richcmp_(self, other, op):
622
+ r"""
623
+ Compare ``self`` and ``other`` (where the coercion model has already ensured
624
+ that ``self`` and ``other`` have the same parent). Hecke operators on the same
625
+ space compare as equal if and only if their matrices are equal, so we
626
+ check if the indices are the same and if not we compute the matrices
627
+ (which is potentially expensive).
628
+
629
+ EXAMPLES::
630
+
631
+ sage: M = ModularSymbols(Gamma0(7), 4)
632
+ sage: m = M.hecke_operator(3)
633
+ sage: m == m
634
+ True
635
+ sage: m == 2*m
636
+ False
637
+ sage: m == M.hecke_operator(5)
638
+ False
639
+
640
+ These last two tests involve a coercion::
641
+
642
+ sage: m == m.matrix_form()
643
+ True
644
+ sage: m == m.matrix()
645
+ False
646
+ """
647
+ if not isinstance(other, HeckeOperator):
648
+ if isinstance(other, HeckeAlgebraElement_matrix):
649
+ return richcmp(self.matrix_form(), other, op)
650
+ else:
651
+ raise RuntimeError("Bug in coercion code") # can't get here
652
+
653
+ if self.__n == other.__n:
654
+ return rich_to_bool(op, 0)
655
+ return richcmp(self.matrix(), other.matrix(), op)
656
+
657
+ def _repr_(self):
658
+ r"""
659
+ String representation of ``self``.
660
+
661
+ EXAMPLES::
662
+
663
+ sage: ModularSymbols(Gamma0(7), 4).hecke_operator(6)._repr_()
664
+ 'Hecke operator T_6 on Modular Symbols space of dimension 4 for Gamma_0(7) of weight 4 with sign 0 over Rational Field'
665
+ """
666
+ return "Hecke operator T_%s on %s" % (self.__n, self.domain())
667
+
668
+ def _latex_(self):
669
+ r"""
670
+ LaTeX representation of ``self``.
671
+
672
+ EXAMPLES::
673
+
674
+ sage: ModularSymbols(Gamma0(7), 4).hecke_operator(6)._latex_()
675
+ 'T_{6}'
676
+ """
677
+ return "T_{%s}" % self.__n
678
+
679
+ def _mul_(self, other):
680
+ r"""
681
+ Multiply this Hecke operator by another element of the same algebra.
682
+
683
+ If the other element is of the form `T_m` for some m, we check
684
+ whether the product is equal to `T_{mn}` and return that; if
685
+ the product is not (easily seen to be) of the form `T_{mn}`,
686
+ then we calculate the product of the two matrices and return a
687
+ Hecke algebra element defined by that.
688
+
689
+ EXAMPLES: We create the space of modular symbols of level
690
+ `11` and weight `2`, then compute `T_2`
691
+ and `T_3` on it, along with their composition.
692
+
693
+ ::
694
+
695
+ sage: M = ModularSymbols(11)
696
+ sage: t2 = M.hecke_operator(2); t3 = M.hecke_operator(3)
697
+ sage: t2*t3 # indirect doctest
698
+ Hecke operator T_6 on Modular Symbols space of dimension 3 for Gamma_0(11) of weight 2 with sign 0 over Rational Field
699
+ sage: t3.matrix() * t2.matrix()
700
+ [12 0 -2]
701
+ [ 0 2 0]
702
+ [ 0 0 2]
703
+ sage: (t2*t3).matrix()
704
+ [12 0 -2]
705
+ [ 0 2 0]
706
+ [ 0 0 2]
707
+
708
+ When we compute `T_2^5` the result is not (easily seen to
709
+ be) a Hecke operator of the form `T_n`, so it is returned
710
+ as a Hecke module homomorphism defined as a matrix::
711
+
712
+ sage: t2**5
713
+ Hecke operator on Modular Symbols space of dimension 3 for Gamma_0(11) of weight 2 with sign 0 over Rational Field defined by:
714
+ [243 0 -55]
715
+ [ 0 -32 0]
716
+ [ 0 0 -32]
717
+ """
718
+ if isinstance(other, HeckeOperator) and other.parent() == self.parent():
719
+ n = None
720
+ if arith.gcd(self.__n, other.__n) == 1:
721
+ n = self.__n * other.__n
722
+ else:
723
+ P = set(arith.prime_divisors(self.domain().level()))
724
+ if P.issubset(set(arith.prime_divisors(self.__n))) and \
725
+ P.issubset(set(arith.prime_divisors(other.__n))):
726
+ n = self.__n * other.__n
727
+ if n:
728
+ return HeckeOperator(self.parent(), n)
729
+ # otherwise
730
+ return self.matrix_form() * other
731
+
732
+ def index(self):
733
+ """
734
+ Return the index of this Hecke operator, i.e., if this Hecke
735
+ operator is `T_n`, return the int `n`.
736
+
737
+ EXAMPLES::
738
+
739
+ sage: T = ModularSymbols(11).hecke_operator(17)
740
+ sage: T.index()
741
+ 17
742
+ """
743
+ return self.__n
744
+
745
+ def matrix(self, *args, **kwds):
746
+ """
747
+ Return the matrix underlying this Hecke operator.
748
+
749
+ EXAMPLES::
750
+
751
+ sage: T = ModularSymbols(11).hecke_operator(17)
752
+ sage: T.matrix()
753
+ [18 0 -4]
754
+ [ 0 -2 0]
755
+ [ 0 0 -2]
756
+ """
757
+ try:
758
+ return self.__matrix
759
+ except AttributeError:
760
+ self.__matrix = self.parent().hecke_matrix(self.__n, *args, **kwds)
761
+ return self.__matrix
762
+
763
+ def matrix_form(self):
764
+ """
765
+ Return the matrix form of this element of a Hecke algebra.
766
+
767
+ ::
768
+
769
+ sage: T = ModularSymbols(11).hecke_operator(17)
770
+ sage: T.matrix_form()
771
+ Hecke operator on Modular Symbols space of dimension 3 for Gamma_0(11) of weight 2 with sign 0 over Rational Field defined by:
772
+ [18 0 -4]
773
+ [ 0 -2 0]
774
+ [ 0 0 -2]
775
+ """
776
+ try:
777
+ return self.__matrix_form
778
+ except AttributeError:
779
+ self.__matrix_form = self.parent()(self.matrix(), check=False)
780
+ return self.__matrix_form