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,989 @@
1
+ # sage_setup: distribution = sagemath-schemes
2
+ # sage.doctest: needs sage.libs.flint sage.libs.pari
3
+ """
4
+ Submodules of Hecke modules
5
+ """
6
+ # ****************************************************************************
7
+ # Sage: Open Source Mathematical Software
8
+ #
9
+ # Copyright (C) 2005 William Stein <wstein@gmail.com>
10
+ #
11
+ # Distributed under the terms of the GNU General Public License (GPL)
12
+ #
13
+ # This code is distributed in the hope that it will be useful,
14
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
+ # General Public License for more details.
17
+ #
18
+ # The full text of the GPL is available at:
19
+ #
20
+ # https://www.gnu.org/licenses/
21
+ # ****************************************************************************
22
+
23
+ import sage.arith.all as arith
24
+ from sage.misc.verbose import verbose
25
+ from sage.misc.cachefunc import cached_method
26
+ from sage.modules.free_module import FreeModule_generic
27
+ from sage.structure.richcmp import richcmp_method, richcmp_not_equal
28
+
29
+ from . import module
30
+
31
+
32
+ def is_HeckeSubmodule(x):
33
+ r"""
34
+ Return ``True`` if x is of type HeckeSubmodule.
35
+
36
+ EXAMPLES::
37
+
38
+ sage: sage.modular.hecke.submodule.is_HeckeSubmodule(ModularForms(1, 12))
39
+ doctest:warning...
40
+ DeprecationWarning: the function is_HeckeSubmodule is deprecated;
41
+ use 'isinstance(..., HeckeSubmodule)' instead
42
+ See https://github.com/sagemath/sage/issues/37895 for details.
43
+ False
44
+ sage: sage.modular.hecke.submodule.is_HeckeSubmodule(CuspForms(1, 12))
45
+ True
46
+ """
47
+ from sage.misc.superseded import deprecation
48
+ deprecation(37895, "the function is_HeckeSubmodule is deprecated; use 'isinstance(..., HeckeSubmodule)' instead")
49
+ return isinstance(x, HeckeSubmodule)
50
+
51
+
52
+ @richcmp_method
53
+ class HeckeSubmodule(module.HeckeModule_free_module):
54
+ """
55
+ Submodule of a Hecke module.
56
+ """
57
+ def __init__(self, ambient, submodule, dual_free_module=None, check=True):
58
+ r"""
59
+ Initialise a submodule of an ambient Hecke module.
60
+
61
+ INPUT:
62
+
63
+ - ``ambient`` -- an ambient Hecke module
64
+
65
+ - ``submodule`` -- a free module over the base ring which is a submodule
66
+ of the free module attached to the ambient Hecke module. This should
67
+ be invariant under all Hecke operators.
68
+
69
+ - ``dual_free_module`` -- the submodule of the dual of the ambient
70
+ module corresponding to this submodule (or ``None``)
71
+
72
+ - ``check`` -- whether or not to explicitly check that the submodule is
73
+ Hecke equivariant
74
+
75
+ EXAMPLES::
76
+
77
+ sage: CuspForms(1,60) # indirect doctest
78
+ Cuspidal subspace of dimension 5 of Modular Forms space of dimension 6 for Modular Group SL(2,Z) of weight 60 over Rational Field
79
+
80
+ sage: M = ModularForms(4,10)
81
+ sage: S = sage.modular.hecke.submodule.HeckeSubmodule(M, M.submodule(M.basis()[:3]).free_module())
82
+ sage: S
83
+ Rank 3 submodule of a Hecke module of level 4
84
+
85
+ sage: S == loads(dumps(S))
86
+ True
87
+ """
88
+ from . import ambient_module
89
+ if not isinstance(ambient, ambient_module.AmbientHeckeModule):
90
+ raise TypeError("ambient must be an ambient Hecke module")
91
+ if not isinstance(submodule, FreeModule_generic):
92
+ raise TypeError("submodule must be a free module")
93
+ if not submodule.is_submodule(ambient.free_module()):
94
+ raise ValueError("submodule must be a submodule of the ambient free module")
95
+
96
+ if check:
97
+ if not ambient._is_hecke_equivariant_free_module(submodule):
98
+ raise ValueError("The submodule must be invariant under all Hecke operators.")
99
+
100
+ self.__ambient = ambient
101
+ self.__submodule = submodule
102
+ module.HeckeModule_free_module.__init__(self, ambient.base_ring(),
103
+ ambient.level(),
104
+ ambient.weight())
105
+ if dual_free_module is not None:
106
+ if not isinstance(dual_free_module, FreeModule_generic):
107
+ raise TypeError("dual_free_module must be a free module")
108
+ if dual_free_module.rank() != submodule.rank():
109
+ raise ArithmeticError("dual_free_module must have the same rank as submodule")
110
+ self.dual_free_module.set_cache(dual_free_module)
111
+
112
+ def _repr_(self):
113
+ r"""
114
+ String representation of ``self``.
115
+
116
+ EXAMPLES::
117
+
118
+ sage: M = ModularForms(4,10)
119
+ sage: S = sage.modular.hecke.submodule.HeckeSubmodule(M, M.submodule(M.basis()[:3]).free_module())
120
+ sage: S._repr_()
121
+ 'Rank 3 submodule of a Hecke module of level 4'
122
+ """
123
+ return "Rank %s submodule of a Hecke module of level %s" % (
124
+ self.rank(), self.level())
125
+
126
+ def __add__(self, other):
127
+ r"""
128
+ Sum of ``self`` and ``other`` (as submodules of a common ambient
129
+ module).
130
+
131
+ EXAMPLES::
132
+
133
+ sage: M = ModularForms(4,10)
134
+ sage: S = sage.modular.hecke.submodule.HeckeSubmodule(M, M.submodule(M.basis()[:3]).free_module())
135
+ sage: E = sage.modular.hecke.submodule.HeckeSubmodule(M, M.submodule(M.basis()[3:]).free_module())
136
+ sage: S + E # indirect doctest
137
+ Modular Forms subspace of dimension 6 of Modular Forms space of dimension 6 for Congruence Subgroup Gamma0(4) of weight 10 over Rational Field
138
+ """
139
+ if not isinstance(other, module.HeckeModule_free_module):
140
+ raise TypeError("other (=%s) must be a Hecke module." % other)
141
+ if self.ambient() != other.ambient():
142
+ raise ArithmeticError("sum only defined for submodules of a common ambient space")
143
+ if other.is_ambient():
144
+ return other
145
+ # Neither is ambient
146
+ M = self.free_module() + other.free_module()
147
+ return self.ambient().submodule(M, check=False)
148
+
149
+ def _element_constructor_(self, x, check=True):
150
+ """
151
+ Coerce x into the ambient module and checks that x is in this
152
+ submodule.
153
+
154
+ EXAMPLES::
155
+
156
+ sage: M = ModularSymbols(37)
157
+ sage: S = M.cuspidal_submodule()
158
+ sage: M([0,oo])
159
+ -(1,0)
160
+ sage: S([0,oo])
161
+ Traceback (most recent call last):
162
+ ...
163
+ TypeError: x does not coerce to an element of this Hecke module
164
+ sage: S([-1/23,0])
165
+ (1,23)
166
+ """
167
+ z = self.ambient_hecke_module()(x).element()
168
+ if check and z not in self.__submodule:
169
+ raise TypeError("x does not coerce to an element of this Hecke module")
170
+ return self.element_class(self, z)
171
+
172
+ def __richcmp__(self, other, op):
173
+ """
174
+ Compare ``self`` to ``other``.
175
+
176
+ EXAMPLES::
177
+
178
+ sage: M = ModularSymbols(12,6)
179
+ sage: S = sage.modular.hecke.submodule.HeckeSubmodule(M, M.cuspidal_submodule().free_module())
180
+ sage: T = sage.modular.hecke.submodule.HeckeSubmodule(M, M.new_submodule().free_module())
181
+ sage: S
182
+ Rank 14 submodule of a Hecke module of level 12
183
+ sage: T
184
+ Rank 0 submodule of a Hecke module of level 12
185
+ sage: S > T
186
+ True
187
+ sage: T < S
188
+ True
189
+ sage: S == S
190
+ True
191
+ """
192
+ if not isinstance(other, module.HeckeModule_free_module):
193
+ return NotImplemented
194
+ lx = self.ambient()
195
+ rx = other.ambient()
196
+ if lx != rx:
197
+ return richcmp_not_equal(lx, rx, op)
198
+ return self.free_module()._echelon_matrix_richcmp(other.free_module(), op)
199
+
200
+ ################################
201
+ # Semi-Private functions
202
+ ################################
203
+ def _compute_dual_hecke_matrix(self, n):
204
+ """
205
+ Compute the matrix for the `n`-th Hecke operator acting on
206
+ the dual of ``self``.
207
+
208
+ EXAMPLES::
209
+
210
+ sage: M = ModularForms(4,10)
211
+ sage: S = sage.modular.hecke.submodule.HeckeSubmodule(M, M.submodule(M.basis()[:3]).free_module())
212
+ sage: S._compute_dual_hecke_matrix(3)
213
+ [ 0 0 1]
214
+ [ 0 -156 0]
215
+ [35568 0 72]
216
+ sage: CuspForms(4,10).dual_hecke_matrix(3)
217
+ [ 0 0 1]
218
+ [ 0 -156 0]
219
+ [35568 0 72]
220
+ """
221
+ A = self.ambient_hecke_module().dual_hecke_matrix(n)
222
+ check = arith.gcd(self.level(), n) != 1
223
+ return A.restrict(self.dual_free_module(), check=check)
224
+
225
+ def _compute_hecke_matrix(self, n):
226
+ r"""
227
+ Compute the matrix of the `n`-th Hecke operator acting on this space, by
228
+ calling the corresponding function for the ambient space and
229
+ restricting. If `n` is not coprime to the level, we check that the
230
+ restriction is well-defined.
231
+
232
+ EXAMPLES::
233
+
234
+ sage: R.<q> = QQ[[]]
235
+ sage: M = ModularForms(2, 12)
236
+ sage: f = M(q^2 - 24*q^4 + O(q^6))
237
+ sage: A = M.submodule(M.free_module().span([f.element()]),check=False)
238
+ sage: sage.modular.hecke.submodule.HeckeSubmodule._compute_hecke_matrix(A, 3)
239
+ [252]
240
+ sage: sage.modular.hecke.submodule.HeckeSubmodule._compute_hecke_matrix(A, 4)
241
+ Traceback (most recent call last):
242
+ ...
243
+ ArithmeticError: subspace is not invariant under matrix
244
+ """
245
+ A = self.ambient_hecke_module().hecke_matrix(n)
246
+ check = arith.gcd(self.level(), n) != 1
247
+ return A.restrict(self.free_module(), check=check)
248
+
249
+ def _compute_diamond_matrix(self, d):
250
+ r"""
251
+ EXAMPLES::
252
+
253
+ sage: f = ModularSymbols(Gamma1(13),2,sign=1).cuspidal_subspace().decomposition()[0]
254
+ sage: a = f.diamond_bracket_operator(2).matrix() # indirect doctest
255
+ sage: a.charpoly()
256
+ x^2 - x + 1
257
+ sage: a^12
258
+ [1 0]
259
+ [0 1]
260
+ """
261
+ return self.ambient_hecke_module().diamond_bracket_matrix(d).restrict(self.free_module(), check=False)
262
+
263
+ def _compute_atkin_lehner_matrix(self, d):
264
+ """
265
+ Compute the Atkin-Lehner matrix corresponding to the
266
+ divisor d of the level of ``self``.
267
+
268
+ EXAMPLES::
269
+
270
+ sage: M = ModularSymbols(4,10)
271
+ sage: S = sage.modular.hecke.submodule.HeckeSubmodule(M, M.cuspidal_submodule().free_module())
272
+ sage: S
273
+ Rank 6 submodule of a Hecke module of level 4
274
+ sage: S._compute_atkin_lehner_matrix(1)
275
+ [1 0 0 0 0 0]
276
+ [0 1 0 0 0 0]
277
+ [0 0 1 0 0 0]
278
+ [0 0 0 1 0 0]
279
+ [0 0 0 0 1 0]
280
+ [0 0 0 0 0 1]
281
+ """
282
+ A = self.ambient_hecke_module()._compute_atkin_lehner_matrix(d)
283
+ return A.restrict(self.free_module(), check=True)
284
+
285
+ def _set_dual_free_module(self, V):
286
+ """
287
+ Set the dual free module of ``self`` to V. Here V must be a vector
288
+ space of the same dimension as ``self``, embedded in a space of
289
+ the same dimension as the ambient space of ``self``.
290
+
291
+ EXAMPLES::
292
+
293
+ sage: M = ModularSymbols(4,10)
294
+ sage: S = sage.modular.hecke.submodule.HeckeSubmodule(M, M.cuspidal_submodule().free_module())
295
+ sage: S._set_dual_free_module(M.cuspidal_submodule().dual_free_module())
296
+ sage: S._set_dual_free_module(S)
297
+ """
298
+ if V.degree() != self.ambient_hecke_module().rank():
299
+ raise ArithmeticError("The degree of V must equal the rank of the ambient space.")
300
+ if V.rank() != self.rank():
301
+ raise ArithmeticError("The rank of V must equal the rank of self.")
302
+ self.dual_free_module.set_cache(V)
303
+
304
+ ################################
305
+ # Public functions
306
+ ################################
307
+
308
+ def ambient_hecke_module(self):
309
+ r"""
310
+ Return the ambient Hecke module of which this is a submodule.
311
+
312
+ EXAMPLES::
313
+
314
+ sage: CuspForms(2, 12).ambient_hecke_module()
315
+ Modular Forms space of dimension 4 for Congruence Subgroup Gamma0(2) of weight 12 over Rational Field
316
+ """
317
+ return self.__ambient
318
+
319
+ def ambient(self):
320
+ r"""
321
+ Synonym for ambient_hecke_module.
322
+
323
+ EXAMPLES::
324
+
325
+ sage: CuspForms(2, 12).ambient()
326
+ Modular Forms space of dimension 4 for Congruence Subgroup Gamma0(2) of weight 12 over Rational Field
327
+ """
328
+ return self.__ambient
329
+
330
+ @cached_method
331
+ def complement(self, bound=None):
332
+ """
333
+ Return the largest Hecke-stable complement of this space.
334
+
335
+ EXAMPLES::
336
+
337
+ sage: M = ModularSymbols(15, 6).cuspidal_subspace()
338
+ sage: M.complement()
339
+ Modular Symbols subspace of dimension 4 of
340
+ Modular Symbols space of dimension 20 for Gamma_0(15) of weight 6 with sign 0 over Rational Field
341
+
342
+ sage: # needs database_cremona_mini_ellcurve
343
+ sage: E = EllipticCurve("128a")
344
+ sage: ME = E.modular_symbol_space()
345
+ sage: ME.complement()
346
+ Modular Symbols subspace of dimension 17 of
347
+ Modular Symbols space of dimension 18 for Gamma_0(128) of weight 2 with sign 1 over Rational Field
348
+ """
349
+
350
+ if self.dual_free_module.is_in_cache():
351
+ D = self.dual_free_module()
352
+ V = D.basis_matrix().right_kernel()
353
+ return self.submodule(V, check=False)
354
+
355
+ if self.is_ambient():
356
+ return self.ambient_hecke_module().zero_submodule()
357
+
358
+ if self.is_zero():
359
+ return self.ambient_hecke_module()
360
+
361
+ if self.is_full_hecke_module():
362
+ anemic = False
363
+ else:
364
+ anemic = True
365
+
366
+ # TODO: optimize in some cases by computing image of
367
+ # complementary factor instead of kernel...?
368
+ verbose("computing")
369
+ N = self.level()
370
+ A = self.ambient_hecke_module()
371
+ V = A.free_module()
372
+ p = 2
373
+ if bound is None:
374
+ bound = A.hecke_bound()
375
+ while True:
376
+ if anemic:
377
+ while N % p == 0:
378
+ p = arith.next_prime(p)
379
+ verbose("using T_%s" % p)
380
+ f = self.hecke_polynomial(p)
381
+ T = A.hecke_matrix(p)
382
+ g = T.charpoly('x')
383
+ V = T.kernel_on(V, poly=g // f, check=False)
384
+ if V.rank() + self.rank() <= A.rank():
385
+ break
386
+ p = arith.next_prime(p)
387
+ if p > bound: # to avoid computing Hecke bound unless necessary
388
+ break
389
+
390
+ if V.rank() + self.rank() == A.rank():
391
+ return A.submodule(V, check=False)
392
+
393
+ # first attempt to compute the complement failed, we now try
394
+ # the following naive approach: decompose the ambient space,
395
+ # decompose self, and sum the pieces of ambient that are not
396
+ # subspaces of self
397
+ verbose("falling back on naive algorithm")
398
+ D = A.decomposition()
399
+ C = A.zero_submodule()
400
+ for X in D:
401
+ if self.intersection(X).dimension() == 0:
402
+ C = C + X
403
+ if C.rank() + self.rank() == A.rank():
404
+ return C
405
+
406
+ # failed miserably
407
+ raise RuntimeError("Computation of complementary space failed (cut down to rank %s, but should have cut down to rank %s)." % (
408
+ V.rank(), A.rank() - self.rank()))
409
+
410
+ def degeneracy_map(self, level, t=1):
411
+ """
412
+ The `t`-th degeneracy map from ``self`` to the space of ambient modular
413
+ symbols of the given level. The level of ``self`` must be a divisor or
414
+ multiple of level, and `t` must be a divisor of the quotient.
415
+
416
+ INPUT:
417
+
418
+ - ``level`` -- positive integer; the level of the codomain of the
419
+ map
420
+
421
+ - ``t`` -- integer; the parameter of the degeneracy map,
422
+ i.e., the map is related to `f(q)` - `f(q^t)`
423
+
424
+ OUTPUT:
425
+
426
+ A linear function from ``self`` to the space of modular symbols of given
427
+ level with the same weight, character, sign, etc., as this space.
428
+
429
+ EXAMPLES::
430
+
431
+ sage: D = ModularSymbols(10,4).cuspidal_submodule().decomposition(); D
432
+ [Modular Symbols subspace of dimension 2 of Modular Symbols space of dimension 10 for Gamma_0(10) of weight 4 with sign 0 over Rational Field,
433
+ Modular Symbols subspace of dimension 4 of Modular Symbols space of dimension 10 for Gamma_0(10) of weight 4 with sign 0 over Rational Field]
434
+ sage: d = D[1].degeneracy_map(5); d
435
+ Hecke module morphism defined by the matrix
436
+ [ 0 0 -1 1]
437
+ [ 0 1/2 3/2 -2]
438
+ [ 0 -1 1 0]
439
+ [ 0 -3/4 -1/4 1]
440
+ Domain: Modular Symbols subspace of dimension 4 of Modular Symbols space ...
441
+ Codomain: Modular Symbols space of dimension 4 for Gamma_0(5) of weight ...
442
+
443
+ ::
444
+
445
+ sage: d.rank()
446
+ 2
447
+ sage: d.kernel()
448
+ Modular Symbols subspace of dimension 2 of Modular Symbols space of dimension 10 for Gamma_0(10) of weight 4 with sign 0 over Rational Field
449
+ sage: d.image()
450
+ Modular Symbols subspace of dimension 2 of Modular Symbols space of dimension 4 for Gamma_0(5) of weight 4 with sign 0 over Rational Field
451
+ """
452
+ d = self.ambient_hecke_module().degeneracy_map(level, t)
453
+ return d.restrict_domain(self)
454
+
455
+ @cached_method
456
+ def dual_free_module(self, bound=None, anemic=True, use_star=True):
457
+ r"""
458
+ Compute embedded dual free module if possible.
459
+
460
+ In general this will not be possible, e.g., if this space is
461
+ not Hecke equivariant, possibly if it is not cuspidal, or if
462
+ the characteristic is not 0. In all these cases we raise a
463
+ :exc:`RuntimeError` exception.
464
+
465
+ If ``use_star`` is ``True`` (which is the default), we also use the +/-
466
+ eigenspaces for the star operator to find the dual free module of ``self``.
467
+ If ``self`` does not have a star involution, ``use_star`` will automatically be
468
+ set to ``False``.
469
+
470
+ EXAMPLES::
471
+
472
+ sage: M = ModularSymbols(11, 2)
473
+ sage: M.dual_free_module()
474
+ Vector space of dimension 3 over Rational Field
475
+ sage: Mpc = M.plus_submodule().cuspidal_submodule()
476
+ sage: Mcp = M.cuspidal_submodule().plus_submodule()
477
+ sage: Mcp.dual_free_module() == Mpc.dual_free_module()
478
+ True
479
+ sage: Mpc.dual_free_module()
480
+ Vector space of degree 3 and dimension 1 over Rational Field
481
+ Basis matrix:
482
+ [ 1 5/2 5]
483
+
484
+ sage: M = ModularSymbols(35,2).cuspidal_submodule()
485
+ sage: M.dual_free_module(use_star=False)
486
+ Vector space of degree 9 and dimension 6 over Rational Field
487
+ Basis matrix:
488
+ [ 1 0 0 0 -1 0 0 4 -2]
489
+ [ 0 1 0 0 0 0 0 -1/2 1/2]
490
+ [ 0 0 1 0 0 0 0 -1/2 1/2]
491
+ [ 0 0 0 1 -1 0 0 1 0]
492
+ [ 0 0 0 0 0 1 0 -2 1]
493
+ [ 0 0 0 0 0 0 1 -2 1]
494
+
495
+ sage: M = ModularSymbols(40,2)
496
+ sage: Mmc = M.minus_submodule().cuspidal_submodule()
497
+ sage: Mcm = M.cuspidal_submodule().minus_submodule()
498
+ sage: Mcm.dual_free_module() == Mmc.dual_free_module()
499
+ True
500
+ sage: Mcm.dual_free_module()
501
+ Vector space of degree 13 and dimension 3 over Rational Field
502
+ Basis matrix:
503
+ [ 0 1 0 0 0 0 1 0 -1 -1 1 -1 0]
504
+ [ 0 0 1 0 -1 0 -1 0 1 0 0 0 0]
505
+ [ 0 0 0 0 0 1 1 0 -1 0 0 0 0]
506
+
507
+ sage: M = ModularSymbols(43).cuspidal_submodule()
508
+ sage: S = M[0].plus_submodule() + M[1].minus_submodule()
509
+ sage: S.dual_free_module(use_star=False)
510
+ Traceback (most recent call last):
511
+ ...
512
+ RuntimeError: Computation of complementary space failed (cut down to rank 7, but should have cut down to rank 4).
513
+ sage: S.dual_free_module().dimension() == S.dimension()
514
+ True
515
+
516
+ We test that :issue:`5080` is fixed::
517
+
518
+ sage: EllipticCurve('128a').congruence_number() # needs sympow
519
+ 32
520
+ """
521
+
522
+ # if we know the complement we can read off the dual module
523
+ if self.complement.is_in_cache():
524
+ verbose('This module knows its complement already -- cheating in dual_free_module')
525
+ C = self.complement()
526
+ return C.basis_matrix().right_kernel()
527
+
528
+ verbose("computing dual")
529
+
530
+ A = self.ambient_hecke_module()
531
+
532
+ if self.dimension() == 0:
533
+ return A.zero_submodule()
534
+
535
+ if A.dimension() == self.dimension():
536
+ return A.free_module()
537
+
538
+ # ALGORITHM: Compute the char poly of each Hecke operator on
539
+ # the submodule, then use it to cut out a submodule of the
540
+ # dual. If the dimension cuts down to the dimension of self
541
+ # terminate with success. If it stays larger beyond the Sturm
542
+ # bound, raise a RuntimeError exception.
543
+
544
+ # In the case that the sign of self is not 1, we need to use
545
+ # the star involution as well as the Hecke operators in order
546
+ # to find the dual of self.
547
+ #
548
+ # Note that one needs to comment out the line caching the
549
+ # result of this computation below in order to get meaningful
550
+ # timings.
551
+
552
+ # If the star involution doesn't make sense for self, then we
553
+ # can't use it.
554
+ if not hasattr(self, 'star_eigenvalues'):
555
+ use_star = False
556
+
557
+ if use_star:
558
+ # If the star involution has both + and - eigenspaces on self,
559
+ # then we compute the dual on each eigenspace, then put them
560
+ # together.
561
+ if len(self.star_eigenvalues()) == 2:
562
+ V = self.plus_submodule(compute_dual=False).dual_free_module() + \
563
+ self.minus_submodule(compute_dual=False).dual_free_module()
564
+ return V
565
+
566
+ # At this point, we know that self is an eigenspace for star.
567
+ V = A.sign_submodule(self.sign()).dual_free_module()
568
+ else:
569
+ V = A.free_module()
570
+
571
+ N = self.level()
572
+ p = 2
573
+ if bound is None:
574
+ bound = A.hecke_bound()
575
+ while True:
576
+ if anemic:
577
+ while N % p == 0:
578
+ p = arith.next_prime(p)
579
+ verbose("using T_%s" % p)
580
+ f = self.hecke_polynomial(p)
581
+ T = A.dual_hecke_matrix(p)
582
+ V = T.kernel_on(V, poly=f, check=False)
583
+ if V.dimension() <= self.dimension():
584
+ break
585
+ p = arith.next_prime(p)
586
+ if p > bound:
587
+ break
588
+
589
+ if V.rank() == self.rank():
590
+ return V
591
+
592
+ # Failed to reduce V to the appropriate dimension
593
+ W = self.complement()
594
+ V2 = W.basis_matrix().right_kernel()
595
+ if V2.rank() == self.rank():
596
+ return V2
597
+
598
+ raise RuntimeError("Computation of embedded dual vector space failed "
599
+ "(cut down to rank %s, but should have cut down to rank %s)." % (V.rank(), self.rank()))
600
+
601
+ def free_module(self):
602
+ """
603
+ Return the free module corresponding to ``self``.
604
+
605
+ EXAMPLES::
606
+
607
+ sage: M = ModularSymbols(33,2).cuspidal_subspace() ; M
608
+ Modular Symbols subspace of dimension 6 of Modular Symbols space of dimension 9 for Gamma_0(33) of weight 2 with sign 0 over Rational Field
609
+ sage: M.free_module()
610
+ Vector space of degree 9 and dimension 6 over Rational Field
611
+ Basis matrix:
612
+ [ 0 1 0 0 0 0 0 -1 1]
613
+ [ 0 0 1 0 0 0 0 -1 1]
614
+ [ 0 0 0 1 0 0 0 -1 1]
615
+ [ 0 0 0 0 1 0 0 -1 1]
616
+ [ 0 0 0 0 0 1 0 -1 1]
617
+ [ 0 0 0 0 0 0 1 -1 0]
618
+ """
619
+ return self.__submodule
620
+
621
+ def module(self):
622
+ r"""
623
+ Alias for \code{self.free_module()}.
624
+
625
+ EXAMPLES::
626
+
627
+ sage: M = ModularSymbols(17,4).cuspidal_subspace()
628
+ sage: M.free_module() is M.module()
629
+ True
630
+ """
631
+ return self.free_module()
632
+
633
+ def intersection(self, other):
634
+ """
635
+ Return the intersection of ``self`` and ``other``, which must both lie in
636
+ a common ambient space of modular symbols.
637
+
638
+ EXAMPLES::
639
+
640
+ sage: M = ModularSymbols(43, sign=1)
641
+ sage: A = M[0] + M[1]
642
+ sage: B = M[1] + M[2]
643
+ sage: A.dimension(), B.dimension()
644
+ (2, 3)
645
+ sage: C = A.intersection(B); C.dimension()
646
+ 1
647
+
648
+ TESTS::
649
+
650
+ sage: M = ModularSymbols(1,80)
651
+ sage: M.plus_submodule().cuspidal_submodule().sign() # indirect doctest
652
+ 1
653
+ """
654
+ if self.ambient_hecke_module() != other.ambient_hecke_module():
655
+ raise ArithmeticError("intersection only defined for subspaces of"
656
+ " a common ambient modular symbols space")
657
+ if other.is_ambient():
658
+ return self
659
+ if self.is_ambient():
660
+ return other
661
+
662
+ # Neither is ambient
663
+ V = self.free_module().intersection(other.free_module())
664
+ M = self.ambient_hecke_module().submodule(V, check=False)
665
+
666
+ # if sign is nonzero, the intersection will be, too
667
+ # this only makes sense for modular symbols spaces (and hence shouldn't really be in this file)
668
+ try:
669
+ if self.sign():
670
+ M._set_sign(self.sign())
671
+ elif other.sign():
672
+ M._set_sign(other.sign())
673
+ except AttributeError:
674
+ pass
675
+
676
+ return M
677
+
678
+ def is_ambient(self) -> bool:
679
+ r"""
680
+ Return ``True`` if ``self`` is an ambient space of modular symbols.
681
+
682
+ EXAMPLES::
683
+
684
+ sage: M = ModularSymbols(17,4)
685
+ sage: M.cuspidal_subspace().is_ambient()
686
+ False
687
+ sage: A = M.ambient_hecke_module()
688
+ sage: S = A.submodule(A.basis())
689
+ sage: sage.modular.hecke.submodule.HeckeSubmodule.is_ambient(S)
690
+ True
691
+ """
692
+ return self.free_module() == self.ambient_hecke_module().free_module()
693
+
694
+ def is_new(self, p=None) -> bool:
695
+ """
696
+ Return ``True`` if this Hecke module is `p`-new. If `p` is None,
697
+ returns ``True`` if it is new.
698
+
699
+ EXAMPLES::
700
+
701
+ sage: M = ModularSymbols(1,16)
702
+ sage: S = sage.modular.hecke.submodule.HeckeSubmodule(M, M.cuspidal_submodule().free_module())
703
+ sage: S.is_new()
704
+ True
705
+ """
706
+ try:
707
+ return self.__is_new[p]
708
+ except AttributeError:
709
+ self.__is_new = {}
710
+ except KeyError:
711
+ pass
712
+ N = self.ambient_hecke_module().new_submodule(p)
713
+ self.__is_new[p] = self.is_submodule(N)
714
+ return self.__is_new[p]
715
+
716
+ def is_old(self, p=None) -> bool:
717
+ """
718
+ Return ``True`` if this Hecke module is `p`-old. If `p` is ``None``,
719
+ returns ``True`` if it is old.
720
+
721
+ EXAMPLES::
722
+
723
+ sage: M = ModularSymbols(50,2)
724
+ sage: S = sage.modular.hecke.submodule.HeckeSubmodule(M, M.old_submodule().free_module())
725
+ sage: S.is_old()
726
+ True
727
+ sage: S = sage.modular.hecke.submodule.HeckeSubmodule(M, M.new_submodule().free_module())
728
+ sage: S.is_old()
729
+ False
730
+ """
731
+ try:
732
+ return self.__is_old[p]
733
+ except AttributeError:
734
+ self.__is_old = {}
735
+ except KeyError:
736
+ pass
737
+ O = self.ambient_hecke_module().old_submodule(p)
738
+ self.__is_old[p] = self.is_submodule(O)
739
+ return self.__is_old[p]
740
+
741
+ def is_submodule(self, V) -> bool:
742
+ """
743
+ Return ``True`` if and only if ``self`` is a submodule of V.
744
+
745
+ EXAMPLES::
746
+
747
+ sage: M = ModularSymbols(30,4)
748
+ sage: S = sage.modular.hecke.submodule.HeckeSubmodule(M, M.cuspidal_submodule().free_module())
749
+ sage: S.is_submodule(M)
750
+ True
751
+ sage: SS = sage.modular.hecke.submodule.HeckeSubmodule(M, M.old_submodule().free_module())
752
+ sage: S.is_submodule(SS)
753
+ False
754
+ """
755
+ if not isinstance(V, module.HeckeModule_free_module):
756
+ return False
757
+ return self.ambient_hecke_module() == V.ambient_hecke_module() and \
758
+ self.free_module().is_subspace(V.free_module())
759
+
760
+ def linear_combination_of_basis(self, v):
761
+ """
762
+ Return the linear combination of the basis of ``self`` given
763
+ by the entries of `v`.
764
+
765
+ The result can be of different types, and is printed
766
+ accordingly, depending on the type of submodule.
767
+
768
+ EXAMPLES::
769
+
770
+ sage: M = ModularForms(Gamma0(2),12)
771
+
772
+ sage: S = sage.modular.hecke.submodule.HeckeSubmodule(M, M.cuspidal_submodule().free_module())
773
+ sage: S.basis()
774
+ ((1, 0, 0, 0), (0, 1, 0, 0))
775
+ sage: S.linear_combination_of_basis([3, 10])
776
+ (3, 10, 0, 0)
777
+
778
+ sage: S = M.cuspidal_submodule()
779
+ sage: S.basis()
780
+ [q + 252*q^3 - 2048*q^4 + 4830*q^5 + O(q^6), q^2 - 24*q^4 + O(q^6)]
781
+ sage: S.linear_combination_of_basis([3, 10])
782
+ 3*q + 10*q^2 + 756*q^3 - 6384*q^4 + 14490*q^5 + O(q^6)
783
+ """
784
+ x = self.free_module().linear_combination_of_basis(v)
785
+ return self(x)
786
+
787
+ def new_submodule(self, p=None):
788
+ """
789
+ Return the new or `p`-new submodule of this space of modular
790
+ symbols.
791
+
792
+ EXAMPLES::
793
+
794
+ sage: M = ModularSymbols(20,4)
795
+ sage: M.new_submodule()
796
+ Modular Symbols subspace of dimension 2 of Modular Symbols space of dimension 18 for Gamma_0(20) of weight 4 with sign 0 over Rational Field
797
+ sage: S = sage.modular.hecke.submodule.HeckeSubmodule(M, M.cuspidal_submodule().free_module())
798
+ sage: S
799
+ Rank 12 submodule of a Hecke module of level 20
800
+ sage: S.new_submodule()
801
+ Modular Symbols subspace of dimension 2 of Modular Symbols space of dimension 18 for Gamma_0(20) of weight 4 with sign 0 over Rational Field
802
+ """
803
+ try:
804
+ if self.__is_new[p]:
805
+ return self
806
+ except AttributeError:
807
+ self.__is_new = {}
808
+ except KeyError:
809
+ pass
810
+
811
+ if self.rank() == 0:
812
+ self.__is_new[p] = True
813
+ return self
814
+ try:
815
+ return self.__new_submodule[p]
816
+ except AttributeError:
817
+ self.__new_submodule = {}
818
+ except KeyError:
819
+ pass
820
+
821
+ S = self.ambient_hecke_module().new_submodule(p)
822
+ ns = S.intersection(self)
823
+ if ns.rank() == self.rank():
824
+ self.__is_new[p] = True
825
+ ns.__is_new = {p: True}
826
+ self.__new_submodule[p] = ns
827
+ return ns
828
+
829
+ def nonembedded_free_module(self):
830
+ """
831
+ Return the free module corresponding to ``self`` as an abstract
832
+ free module, i.e. not as an embedded vector space.
833
+
834
+ EXAMPLES::
835
+
836
+ sage: M = ModularSymbols(12,6)
837
+ sage: S = sage.modular.hecke.submodule.HeckeSubmodule(M, M.cuspidal_submodule().free_module())
838
+ sage: S
839
+ Rank 14 submodule of a Hecke module of level 12
840
+ sage: S.nonembedded_free_module()
841
+ Vector space of dimension 14 over Rational Field
842
+ """
843
+ return self.free_module().nonembedded_free_module()
844
+
845
+ def old_submodule(self, p=None):
846
+ r"""
847
+ Return the old or `p`-old submodule of this space of modular
848
+ symbols.
849
+
850
+ EXAMPLES: We compute the old and new submodules of
851
+ `\mathbf{S}_2(\Gamma_0(33))`.
852
+
853
+ ::
854
+
855
+ sage: M = ModularSymbols(33); S = M.cuspidal_submodule(); S
856
+ Modular Symbols subspace of dimension 6 of Modular Symbols space of dimension 9 for Gamma_0(33) of weight 2 with sign 0 over Rational Field
857
+ sage: S.old_submodule()
858
+ Modular Symbols subspace of dimension 4 of Modular Symbols space of dimension 9 for Gamma_0(33) of weight 2 with sign 0 over Rational Field
859
+ sage: S.new_submodule()
860
+ Modular Symbols subspace of dimension 2 of Modular Symbols space of dimension 9 for Gamma_0(33) of weight 2 with sign 0 over Rational Field
861
+ """
862
+ try:
863
+ if self.__is_old[p]:
864
+ return self
865
+ except AttributeError:
866
+ self.__is_old = {}
867
+ except KeyError:
868
+ pass
869
+
870
+ if self.rank() == 0:
871
+ self.__is_old[p] = True
872
+ return self
873
+ try:
874
+ return self.__old_submodule[p]
875
+ except AttributeError:
876
+ self.__old_submodule = {}
877
+ except KeyError:
878
+ pass
879
+
880
+ S = self.ambient_hecke_module().old_submodule(p)
881
+ os = S.intersection(self)
882
+ if os.rank() == self.rank():
883
+ self.__is_old[p] = True
884
+ os.__is_old = {p: True}
885
+ self.__old_submodule[p] = os
886
+ return os
887
+
888
+ def rank(self):
889
+ r"""
890
+ Return the rank of ``self`` as a free module over the base ring.
891
+
892
+ EXAMPLES::
893
+
894
+ sage: ModularSymbols(6, 4).cuspidal_subspace().rank()
895
+ 2
896
+ sage: ModularSymbols(6, 4).cuspidal_subspace().dimension()
897
+ 2
898
+ """
899
+ return self.__submodule.rank()
900
+
901
+ def submodule(self, M, Mdual=None, check=True):
902
+ """
903
+ Construct a submodule of ``self`` from the free module M, which
904
+ must be a subspace of ``self``.
905
+
906
+ EXAMPLES::
907
+
908
+ sage: M = ModularSymbols(18,4)
909
+ sage: S = sage.modular.hecke.submodule.HeckeSubmodule(M, M.cuspidal_submodule().free_module())
910
+ sage: S[0]
911
+ Modular Symbols subspace of dimension 2 of Modular Symbols space of dimension 18 for Gamma_0(18) of weight 4 with sign 0 over Rational Field
912
+ sage: S.submodule(S[0].free_module())
913
+ Modular Symbols subspace of dimension 2 of Modular Symbols space of dimension 18 for Gamma_0(18) of weight 4 with sign 0 over Rational Field
914
+ """
915
+ if not isinstance(M, FreeModule_generic):
916
+ V = self.ambient_module().free_module()
917
+ if isinstance(M, (list, tuple)):
918
+ M = V.span([V(x.element()) for x in M])
919
+ else:
920
+ M = V.span(M)
921
+
922
+ if check:
923
+ if not M.is_submodule(self.free_module()):
924
+ raise TypeError("M (=%s) must be a submodule of the free module (=%s) associated to this module." % (M, self.free_module()))
925
+
926
+ return self.ambient().submodule(M, Mdual, check=check)
927
+
928
+ def submodule_from_nonembedded_module(self, V, Vdual=None, check=True):
929
+ """
930
+ Construct a submodule of ``self`` from V. Here V should be a
931
+ subspace of a vector space whose dimension is the same as that
932
+ of ``self``.
933
+
934
+ INPUT:
935
+
936
+ - ``V`` -- submodule of ambient free module of the same
937
+ rank as the rank of ``self``
938
+
939
+ - ``check`` -- whether to check that V is Hecke
940
+ equivariant
941
+
942
+ OUTPUT: Hecke submodule of self
943
+
944
+ EXAMPLES::
945
+
946
+ sage: M = ModularSymbols(37,2)
947
+ sage: S = sage.modular.hecke.submodule.HeckeSubmodule(M, M.cuspidal_submodule().free_module())
948
+ sage: V = (QQ**4).subspace([[1,-1,0,1/2],[0,0,1,-1/2]])
949
+ sage: S.submodule_from_nonembedded_module(V)
950
+ Modular Symbols subspace of dimension 2 of Modular Symbols space of dimension 5 for Gamma_0(37) of weight 2 with sign 0 over Rational Field
951
+ """
952
+ E = self.free_module()
953
+ M_V = V.matrix()
954
+ M_E = E.matrix()
955
+ # We encode the operation of taking the linear combinations of
956
+ # the basis of E given by the basis of V as a single matrix
957
+ # multiplication, since matrix multiplication is (presumed to be)
958
+ # so fast, and their are asymptotically fast algorithms.
959
+ A = M_V * M_E
960
+ V = A.row_space()
961
+ if Vdual is not None:
962
+ E = self.dual_free_module()
963
+ M_Vdual = Vdual.matrix()
964
+ M_E = E.matrix()
965
+ A = M_Vdual * M_E
966
+ Vdual = A.row_space()
967
+ return self.ambient_hecke_module().submodule(V, Vdual, check=check)
968
+
969
+ def hecke_bound(self):
970
+ r"""
971
+ Compute the Hecke bound for ``self``.
972
+
973
+ This is a number `n` such that the `T_m` for `m \leq n`
974
+ generate the Hecke algebra.
975
+
976
+ EXAMPLES::
977
+
978
+ sage: M = ModularSymbols(24,8)
979
+ sage: M.hecke_bound()
980
+ 53
981
+ sage: M.cuspidal_submodule().hecke_bound()
982
+ 32
983
+ sage: M.eisenstein_submodule().hecke_bound()
984
+ 53
985
+ """
986
+ if self.is_cuspidal():
987
+ return self.sturm_bound()
988
+ else:
989
+ return self.ambient_hecke_module().hecke_bound()