passagemath-schemes 10.8.1a4__cp314-cp314t-macosx_13_0_arm64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (312) hide show
  1. passagemath_schemes/.dylibs/libflint.22.0.dylib +0 -0
  2. passagemath_schemes/.dylibs/libgmp.10.dylib +0 -0
  3. passagemath_schemes/.dylibs/libgmpxx.4.dylib +0 -0
  4. passagemath_schemes/.dylibs/libmpfr.6.dylib +0 -0
  5. passagemath_schemes/__init__.py +3 -0
  6. passagemath_schemes-10.8.1a4.dist-info/METADATA +203 -0
  7. passagemath_schemes-10.8.1a4.dist-info/METADATA.bak +204 -0
  8. passagemath_schemes-10.8.1a4.dist-info/RECORD +312 -0
  9. passagemath_schemes-10.8.1a4.dist-info/WHEEL +6 -0
  10. passagemath_schemes-10.8.1a4.dist-info/top_level.txt +3 -0
  11. sage/all__sagemath_schemes.py +23 -0
  12. sage/databases/all__sagemath_schemes.py +7 -0
  13. sage/databases/cremona.py +1723 -0
  14. sage/dynamics/all__sagemath_schemes.py +2 -0
  15. sage/dynamics/arithmetic_dynamics/affine_ds.py +1083 -0
  16. sage/dynamics/arithmetic_dynamics/all.py +14 -0
  17. sage/dynamics/arithmetic_dynamics/berkovich_ds.py +1101 -0
  18. sage/dynamics/arithmetic_dynamics/dynamical_semigroup.py +1543 -0
  19. sage/dynamics/arithmetic_dynamics/endPN_automorphism_group.py +2426 -0
  20. sage/dynamics/arithmetic_dynamics/endPN_minimal_model.py +1169 -0
  21. sage/dynamics/arithmetic_dynamics/generic_ds.py +663 -0
  22. sage/dynamics/arithmetic_dynamics/product_projective_ds.py +339 -0
  23. sage/dynamics/arithmetic_dynamics/projective_ds.py +9556 -0
  24. sage/dynamics/arithmetic_dynamics/projective_ds_helper.cpython-314t-darwin.so +0 -0
  25. sage/dynamics/arithmetic_dynamics/projective_ds_helper.pyx +301 -0
  26. sage/dynamics/arithmetic_dynamics/wehlerK3.py +2578 -0
  27. sage/lfunctions/all.py +18 -0
  28. sage/lfunctions/dokchitser.py +727 -0
  29. sage/lfunctions/pari.py +971 -0
  30. sage/lfunctions/zero_sums.cpython-314t-darwin.so +0 -0
  31. sage/lfunctions/zero_sums.pyx +1847 -0
  32. sage/modular/abvar/abvar.py +5132 -0
  33. sage/modular/abvar/abvar_ambient_jacobian.py +414 -0
  34. sage/modular/abvar/abvar_newform.py +246 -0
  35. sage/modular/abvar/all.py +8 -0
  36. sage/modular/abvar/constructor.py +187 -0
  37. sage/modular/abvar/cuspidal_subgroup.py +371 -0
  38. sage/modular/abvar/finite_subgroup.py +896 -0
  39. sage/modular/abvar/homology.py +721 -0
  40. sage/modular/abvar/homspace.py +989 -0
  41. sage/modular/abvar/lseries.py +415 -0
  42. sage/modular/abvar/morphism.py +935 -0
  43. sage/modular/abvar/torsion_point.py +274 -0
  44. sage/modular/abvar/torsion_subgroup.py +741 -0
  45. sage/modular/all.py +43 -0
  46. sage/modular/arithgroup/all.py +20 -0
  47. sage/modular/arithgroup/arithgroup_element.cpython-314t-darwin.so +0 -0
  48. sage/modular/arithgroup/arithgroup_element.pyx +474 -0
  49. sage/modular/arithgroup/arithgroup_generic.py +1406 -0
  50. sage/modular/arithgroup/arithgroup_perm.py +2692 -0
  51. sage/modular/arithgroup/congroup.cpython-314t-darwin.so +0 -0
  52. sage/modular/arithgroup/congroup.pyx +334 -0
  53. sage/modular/arithgroup/congroup_gamma.py +361 -0
  54. sage/modular/arithgroup/congroup_gamma0.py +692 -0
  55. sage/modular/arithgroup/congroup_gamma1.py +659 -0
  56. sage/modular/arithgroup/congroup_gammaH.py +1491 -0
  57. sage/modular/arithgroup/congroup_generic.py +630 -0
  58. sage/modular/arithgroup/congroup_sl2z.py +266 -0
  59. sage/modular/arithgroup/farey_symbol.cpython-314t-darwin.so +0 -0
  60. sage/modular/arithgroup/farey_symbol.pyx +1067 -0
  61. sage/modular/arithgroup/tests.py +425 -0
  62. sage/modular/btquotients/all.py +4 -0
  63. sage/modular/btquotients/btquotient.py +3736 -0
  64. sage/modular/btquotients/pautomorphicform.py +2564 -0
  65. sage/modular/buzzard.py +100 -0
  66. sage/modular/congroup.py +29 -0
  67. sage/modular/congroup_element.py +13 -0
  68. sage/modular/cusps.py +1107 -0
  69. sage/modular/cusps_nf.py +1270 -0
  70. sage/modular/dims.py +571 -0
  71. sage/modular/dirichlet.py +3310 -0
  72. sage/modular/drinfeld_modform/all.py +2 -0
  73. sage/modular/drinfeld_modform/element.py +446 -0
  74. sage/modular/drinfeld_modform/ring.py +773 -0
  75. sage/modular/drinfeld_modform/tutorial.py +236 -0
  76. sage/modular/etaproducts.py +1076 -0
  77. sage/modular/hecke/algebra.py +725 -0
  78. sage/modular/hecke/all.py +19 -0
  79. sage/modular/hecke/ambient_module.py +994 -0
  80. sage/modular/hecke/degenmap.py +119 -0
  81. sage/modular/hecke/element.py +302 -0
  82. sage/modular/hecke/hecke_operator.py +736 -0
  83. sage/modular/hecke/homspace.py +185 -0
  84. sage/modular/hecke/module.py +1744 -0
  85. sage/modular/hecke/morphism.py +139 -0
  86. sage/modular/hecke/submodule.py +970 -0
  87. sage/modular/hypergeometric_misc.cpython-314t-darwin.so +0 -0
  88. sage/modular/hypergeometric_misc.pxd +4 -0
  89. sage/modular/hypergeometric_misc.pyx +166 -0
  90. sage/modular/hypergeometric_motive.py +2020 -0
  91. sage/modular/local_comp/all.py +2 -0
  92. sage/modular/local_comp/liftings.py +292 -0
  93. sage/modular/local_comp/local_comp.py +1070 -0
  94. sage/modular/local_comp/smoothchar.py +1825 -0
  95. sage/modular/local_comp/type_space.py +748 -0
  96. sage/modular/modform/all.py +30 -0
  97. sage/modular/modform/ambient.py +817 -0
  98. sage/modular/modform/ambient_R.py +177 -0
  99. sage/modular/modform/ambient_eps.py +306 -0
  100. sage/modular/modform/ambient_g0.py +120 -0
  101. sage/modular/modform/ambient_g1.py +199 -0
  102. sage/modular/modform/constructor.py +545 -0
  103. sage/modular/modform/cuspidal_submodule.py +708 -0
  104. sage/modular/modform/defaults.py +14 -0
  105. sage/modular/modform/eis_series.py +487 -0
  106. sage/modular/modform/eisenstein_submodule.py +663 -0
  107. sage/modular/modform/element.py +4105 -0
  108. sage/modular/modform/half_integral.py +154 -0
  109. sage/modular/modform/hecke_operator_on_qexp.py +247 -0
  110. sage/modular/modform/j_invariant.py +47 -0
  111. sage/modular/modform/l_series_gross_zagier.py +127 -0
  112. sage/modular/modform/l_series_gross_zagier_coeffs.cpython-314t-darwin.so +0 -0
  113. sage/modular/modform/l_series_gross_zagier_coeffs.pyx +177 -0
  114. sage/modular/modform/notes.py +45 -0
  115. sage/modular/modform/numerical.py +514 -0
  116. sage/modular/modform/periods.py +14 -0
  117. sage/modular/modform/ring.py +1257 -0
  118. sage/modular/modform/space.py +1859 -0
  119. sage/modular/modform/submodule.py +118 -0
  120. sage/modular/modform/tests.py +64 -0
  121. sage/modular/modform/theta.py +110 -0
  122. sage/modular/modform/vm_basis.py +380 -0
  123. sage/modular/modform/weight1.py +221 -0
  124. sage/modular/modform_hecketriangle/abstract_ring.py +1932 -0
  125. sage/modular/modform_hecketriangle/abstract_space.py +2527 -0
  126. sage/modular/modform_hecketriangle/all.py +30 -0
  127. sage/modular/modform_hecketriangle/analytic_type.py +590 -0
  128. sage/modular/modform_hecketriangle/constructor.py +416 -0
  129. sage/modular/modform_hecketriangle/element.py +351 -0
  130. sage/modular/modform_hecketriangle/functors.py +752 -0
  131. sage/modular/modform_hecketriangle/graded_ring.py +541 -0
  132. sage/modular/modform_hecketriangle/graded_ring_element.py +2225 -0
  133. sage/modular/modform_hecketriangle/hecke_triangle_group_element.py +3349 -0
  134. sage/modular/modform_hecketriangle/hecke_triangle_groups.py +1426 -0
  135. sage/modular/modform_hecketriangle/readme.py +1214 -0
  136. sage/modular/modform_hecketriangle/series_constructor.py +580 -0
  137. sage/modular/modform_hecketriangle/space.py +1037 -0
  138. sage/modular/modform_hecketriangle/subspace.py +423 -0
  139. sage/modular/modsym/all.py +17 -0
  140. sage/modular/modsym/ambient.py +3844 -0
  141. sage/modular/modsym/boundary.py +1420 -0
  142. sage/modular/modsym/element.py +336 -0
  143. sage/modular/modsym/g1list.py +178 -0
  144. sage/modular/modsym/ghlist.py +182 -0
  145. sage/modular/modsym/hecke_operator.py +73 -0
  146. sage/modular/modsym/manin_symbol.cpython-314t-darwin.so +0 -0
  147. sage/modular/modsym/manin_symbol.pxd +5 -0
  148. sage/modular/modsym/manin_symbol.pyx +497 -0
  149. sage/modular/modsym/manin_symbol_list.py +1291 -0
  150. sage/modular/modsym/modsym.py +400 -0
  151. sage/modular/modsym/modular_symbols.py +384 -0
  152. sage/modular/modsym/p1list_nf.py +1241 -0
  153. sage/modular/modsym/relation_matrix.py +591 -0
  154. sage/modular/modsym/relation_matrix_pyx.cpython-314t-darwin.so +0 -0
  155. sage/modular/modsym/relation_matrix_pyx.pyx +108 -0
  156. sage/modular/modsym/space.py +2468 -0
  157. sage/modular/modsym/subspace.py +455 -0
  158. sage/modular/modsym/tests.py +376 -0
  159. sage/modular/multiple_zeta.py +2635 -0
  160. sage/modular/multiple_zeta_F_algebra.py +789 -0
  161. sage/modular/overconvergent/all.py +6 -0
  162. sage/modular/overconvergent/genus0.py +1879 -0
  163. sage/modular/overconvergent/hecke_series.py +1187 -0
  164. sage/modular/overconvergent/weightspace.py +776 -0
  165. sage/modular/pollack_stevens/all.py +4 -0
  166. sage/modular/pollack_stevens/distributions.py +874 -0
  167. sage/modular/pollack_stevens/fund_domain.py +1572 -0
  168. sage/modular/pollack_stevens/manin_map.py +856 -0
  169. sage/modular/pollack_stevens/modsym.py +1590 -0
  170. sage/modular/pollack_stevens/padic_lseries.py +417 -0
  171. sage/modular/pollack_stevens/sigma0.py +534 -0
  172. sage/modular/pollack_stevens/space.py +1078 -0
  173. sage/modular/quasimodform/all.py +3 -0
  174. sage/modular/quasimodform/element.py +846 -0
  175. sage/modular/quasimodform/ring.py +826 -0
  176. sage/modular/quatalg/all.py +3 -0
  177. sage/modular/quatalg/brandt.py +1642 -0
  178. sage/modular/ssmod/all.py +8 -0
  179. sage/modular/ssmod/ssmod.py +827 -0
  180. sage/rings/all__sagemath_schemes.py +1 -0
  181. sage/rings/polynomial/all__sagemath_schemes.py +1 -0
  182. sage/rings/polynomial/binary_form_reduce.py +585 -0
  183. sage/schemes/all.py +41 -0
  184. sage/schemes/berkovich/all.py +6 -0
  185. sage/schemes/berkovich/berkovich_cp_element.py +2582 -0
  186. sage/schemes/berkovich/berkovich_space.py +700 -0
  187. sage/schemes/curves/affine_curve.py +2924 -0
  188. sage/schemes/curves/all.py +33 -0
  189. sage/schemes/curves/closed_point.py +434 -0
  190. sage/schemes/curves/constructor.py +397 -0
  191. sage/schemes/curves/curve.py +542 -0
  192. sage/schemes/curves/plane_curve_arrangement.py +1283 -0
  193. sage/schemes/curves/point.py +463 -0
  194. sage/schemes/curves/projective_curve.py +3203 -0
  195. sage/schemes/curves/weighted_projective_curve.py +106 -0
  196. sage/schemes/curves/zariski_vankampen.py +1931 -0
  197. sage/schemes/cyclic_covers/all.py +2 -0
  198. sage/schemes/cyclic_covers/charpoly_frobenius.py +320 -0
  199. sage/schemes/cyclic_covers/constructor.py +137 -0
  200. sage/schemes/cyclic_covers/cycliccover_finite_field.py +1309 -0
  201. sage/schemes/cyclic_covers/cycliccover_generic.py +310 -0
  202. sage/schemes/elliptic_curves/BSD.py +991 -0
  203. sage/schemes/elliptic_curves/Qcurves.py +592 -0
  204. sage/schemes/elliptic_curves/addition_formulas_ring.py +94 -0
  205. sage/schemes/elliptic_curves/all.py +49 -0
  206. sage/schemes/elliptic_curves/cardinality.py +609 -0
  207. sage/schemes/elliptic_curves/cm.py +1103 -0
  208. sage/schemes/elliptic_curves/constructor.py +1530 -0
  209. sage/schemes/elliptic_curves/ec_database.py +175 -0
  210. sage/schemes/elliptic_curves/ell_curve_isogeny.py +3971 -0
  211. sage/schemes/elliptic_curves/ell_egros.py +457 -0
  212. sage/schemes/elliptic_curves/ell_field.py +2837 -0
  213. sage/schemes/elliptic_curves/ell_finite_field.py +3249 -0
  214. sage/schemes/elliptic_curves/ell_generic.py +3760 -0
  215. sage/schemes/elliptic_curves/ell_local_data.py +1207 -0
  216. sage/schemes/elliptic_curves/ell_modular_symbols.py +775 -0
  217. sage/schemes/elliptic_curves/ell_number_field.py +4220 -0
  218. sage/schemes/elliptic_curves/ell_padic_field.py +107 -0
  219. sage/schemes/elliptic_curves/ell_point.py +4944 -0
  220. sage/schemes/elliptic_curves/ell_rational_field.py +7184 -0
  221. sage/schemes/elliptic_curves/ell_tate_curve.py +671 -0
  222. sage/schemes/elliptic_curves/ell_torsion.py +436 -0
  223. sage/schemes/elliptic_curves/ell_wp.py +352 -0
  224. sage/schemes/elliptic_curves/formal_group.py +760 -0
  225. sage/schemes/elliptic_curves/gal_reps.py +1459 -0
  226. sage/schemes/elliptic_curves/gal_reps_number_field.py +1663 -0
  227. sage/schemes/elliptic_curves/gp_simon.py +152 -0
  228. sage/schemes/elliptic_curves/heegner.py +7328 -0
  229. sage/schemes/elliptic_curves/height.py +2108 -0
  230. sage/schemes/elliptic_curves/hom.py +1788 -0
  231. sage/schemes/elliptic_curves/hom_composite.py +1084 -0
  232. sage/schemes/elliptic_curves/hom_fractional.py +544 -0
  233. sage/schemes/elliptic_curves/hom_frobenius.py +522 -0
  234. sage/schemes/elliptic_curves/hom_scalar.py +531 -0
  235. sage/schemes/elliptic_curves/hom_sum.py +681 -0
  236. sage/schemes/elliptic_curves/hom_velusqrt.py +1290 -0
  237. sage/schemes/elliptic_curves/homset.py +271 -0
  238. sage/schemes/elliptic_curves/isogeny_class.py +1523 -0
  239. sage/schemes/elliptic_curves/isogeny_small_degree.py +2797 -0
  240. sage/schemes/elliptic_curves/jacobian.py +247 -0
  241. sage/schemes/elliptic_curves/kodaira_symbol.py +344 -0
  242. sage/schemes/elliptic_curves/kraus.py +1014 -0
  243. sage/schemes/elliptic_curves/lseries_ell.py +915 -0
  244. sage/schemes/elliptic_curves/mod5family.py +105 -0
  245. sage/schemes/elliptic_curves/mod_poly.py +197 -0
  246. sage/schemes/elliptic_curves/mod_sym_num.cpython-314t-darwin.so +0 -0
  247. sage/schemes/elliptic_curves/mod_sym_num.pyx +3796 -0
  248. sage/schemes/elliptic_curves/modular_parametrization.py +305 -0
  249. sage/schemes/elliptic_curves/padic_lseries.py +1793 -0
  250. sage/schemes/elliptic_curves/padics.py +1816 -0
  251. sage/schemes/elliptic_curves/period_lattice.py +2234 -0
  252. sage/schemes/elliptic_curves/period_lattice_region.cpython-314t-darwin.so +0 -0
  253. sage/schemes/elliptic_curves/period_lattice_region.pyx +722 -0
  254. sage/schemes/elliptic_curves/saturation.py +716 -0
  255. sage/schemes/elliptic_curves/sha_tate.py +1158 -0
  256. sage/schemes/elliptic_curves/weierstrass_morphism.py +1117 -0
  257. sage/schemes/elliptic_curves/weierstrass_transform.py +200 -0
  258. sage/schemes/hyperelliptic_curves/all.py +6 -0
  259. sage/schemes/hyperelliptic_curves/constructor.py +369 -0
  260. sage/schemes/hyperelliptic_curves/hyperelliptic_finite_field.py +1948 -0
  261. sage/schemes/hyperelliptic_curves/hyperelliptic_g2.py +192 -0
  262. sage/schemes/hyperelliptic_curves/hyperelliptic_generic.py +936 -0
  263. sage/schemes/hyperelliptic_curves/hyperelliptic_padic_field.py +1332 -0
  264. sage/schemes/hyperelliptic_curves/hyperelliptic_rational_field.py +84 -0
  265. sage/schemes/hyperelliptic_curves/invariants.py +410 -0
  266. sage/schemes/hyperelliptic_curves/jacobian_endomorphism_utils.py +312 -0
  267. sage/schemes/hyperelliptic_curves/jacobian_g2.py +32 -0
  268. sage/schemes/hyperelliptic_curves/jacobian_generic.py +437 -0
  269. sage/schemes/hyperelliptic_curves/jacobian_homset.py +186 -0
  270. sage/schemes/hyperelliptic_curves/jacobian_morphism.py +878 -0
  271. sage/schemes/hyperelliptic_curves/kummer_surface.py +99 -0
  272. sage/schemes/hyperelliptic_curves/mestre.py +302 -0
  273. sage/schemes/hyperelliptic_curves/monsky_washnitzer.py +3863 -0
  274. sage/schemes/jacobians/abstract_jacobian.py +277 -0
  275. sage/schemes/jacobians/all.py +2 -0
  276. sage/schemes/overview.py +161 -0
  277. sage/schemes/plane_conics/all.py +22 -0
  278. sage/schemes/plane_conics/con_field.py +1296 -0
  279. sage/schemes/plane_conics/con_finite_field.py +158 -0
  280. sage/schemes/plane_conics/con_number_field.py +456 -0
  281. sage/schemes/plane_conics/con_rational_field.py +406 -0
  282. sage/schemes/plane_conics/con_rational_function_field.py +581 -0
  283. sage/schemes/plane_conics/constructor.py +249 -0
  284. sage/schemes/plane_quartics/all.py +2 -0
  285. sage/schemes/plane_quartics/quartic_constructor.py +71 -0
  286. sage/schemes/plane_quartics/quartic_generic.py +53 -0
  287. sage/schemes/riemann_surfaces/all.py +1 -0
  288. sage/schemes/riemann_surfaces/riemann_surface.py +4177 -0
  289. sage_wheels/share/cremona/cremona_mini.db +0 -0
  290. sage_wheels/share/ellcurves/rank0 +30427 -0
  291. sage_wheels/share/ellcurves/rank1 +31871 -0
  292. sage_wheels/share/ellcurves/rank10 +6 -0
  293. sage_wheels/share/ellcurves/rank11 +6 -0
  294. sage_wheels/share/ellcurves/rank12 +1 -0
  295. sage_wheels/share/ellcurves/rank14 +1 -0
  296. sage_wheels/share/ellcurves/rank15 +1 -0
  297. sage_wheels/share/ellcurves/rank17 +1 -0
  298. sage_wheels/share/ellcurves/rank19 +1 -0
  299. sage_wheels/share/ellcurves/rank2 +2388 -0
  300. sage_wheels/share/ellcurves/rank20 +1 -0
  301. sage_wheels/share/ellcurves/rank21 +1 -0
  302. sage_wheels/share/ellcurves/rank22 +1 -0
  303. sage_wheels/share/ellcurves/rank23 +1 -0
  304. sage_wheels/share/ellcurves/rank24 +1 -0
  305. sage_wheels/share/ellcurves/rank28 +1 -0
  306. sage_wheels/share/ellcurves/rank3 +836 -0
  307. sage_wheels/share/ellcurves/rank4 +10 -0
  308. sage_wheels/share/ellcurves/rank5 +5 -0
  309. sage_wheels/share/ellcurves/rank6 +5 -0
  310. sage_wheels/share/ellcurves/rank7 +5 -0
  311. sage_wheels/share/ellcurves/rank8 +6 -0
  312. sage_wheels/share/ellcurves/rank9 +7 -0
@@ -0,0 +1,1590 @@
1
+ # sage_setup: distribution = sagemath-schemes
2
+ # sage.doctest: needs eclib
3
+ r"""
4
+ Element class for Pollack-Stevens' modular symbols
5
+
6
+ This is the class of elements in the spaces of Pollack-Steven's modular symbols as described in [PS2011]_.
7
+
8
+ EXAMPLES::
9
+
10
+ sage: E = EllipticCurve('11a')
11
+ sage: phi = E.pollack_stevens_modular_symbol(); phi
12
+ Modular symbol of level 11 with values in Sym^0 Q^2
13
+ sage: phi.weight() # Note that weight k=2 of a modular form corresponds here to weight 0
14
+ 0
15
+ sage: phi.values()
16
+ [-1/5, 1, 0]
17
+ sage: phi.is_ordinary(11)
18
+ True
19
+ sage: phi_lift = phi.lift(11, 5, eigensymbol = True) # long time
20
+ sage: phi_lift.padic_lseries().series(5) # long time
21
+ O(11^5) + (10 + 3*11 + 6*11^2 + 9*11^3 + O(11^4))*T + (6 + 3*11 + 2*11^2 + O(11^3))*T^2 + (2 + 2*11 + O(11^2))*T^3 + (5 + O(11))*T^4 + O(T^5)
22
+
23
+ ::
24
+
25
+ sage: A = ModularSymbols(Gamma1(8),4).decomposition()[0].plus_submodule().new_subspace()
26
+ sage: from sage.modular.pollack_stevens.space import ps_modsym_from_simple_modsym_space
27
+ sage: phi = ps_modsym_from_simple_modsym_space(A)
28
+ sage: phi.values()
29
+ [(-1, 0, 0), (1, 0, 0), (-9, -6, -4)]
30
+ """
31
+ # ****************************************************************************
32
+ # Copyright (C) 2012 Robert Pollack <rpollack@math.bu.edu>
33
+ #
34
+ # Distributed under the terms of the GNU General Public License (GPL)
35
+ # as published by the Free Software Foundation; either version 2 of
36
+ # the License, or (at your option) any later version.
37
+ # https://www.gnu.org/licenses/
38
+ # *****************************************************************************
39
+
40
+ import operator
41
+ from typing import Self
42
+
43
+ from sage.arith.misc import gcd, kronecker, next_prime
44
+ from sage.categories.action import Action
45
+ from sage.misc.cachefunc import cached_method
46
+ from sage.misc.lazy_import import lazy_import
47
+ from sage.misc.verbose import verbose
48
+ from sage.rings.integer_ring import ZZ
49
+ from sage.rings.padics.precision_error import PrecisionError
50
+ from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing
51
+ from sage.rings.rational_field import QQ
52
+ from sage.structure.element import ModuleElement
53
+ from sage.structure.richcmp import op_EQ, op_NE
54
+
55
+ lazy_import('sage.rings.padics.factory', 'Qp')
56
+ lazy_import('sage.rings.padics.padic_generic', 'pAdicGeneric')
57
+
58
+ from .fund_domain import M2Z
59
+ from .manin_map import ManinMap
60
+ from .sigma0 import Sigma0
61
+
62
+ minusproj = [1, 0, 0, -1]
63
+
64
+
65
+ def _iterate_Up(Phi, p, M, ap, q, aq, check):
66
+ r"""
67
+ Return an overconvergent Hecke-eigensymbol lifting ``self`` -- ``self``
68
+ must be a `p`-ordinary eigensymbol.
69
+
70
+ INPUT:
71
+
72
+ - ``p`` -- prime
73
+
74
+ - ``M`` -- integer equal to the number of moments
75
+
76
+ - ``ap`` -- Hecke eigenvalue at `p`
77
+
78
+ - ``q`` -- prime
79
+
80
+ - ``aq`` -- Hecke eigenvalue at `q`
81
+
82
+ OUTPUT: Hecke-eigenvalue overconvergent modular symbol lifting ``self``
83
+
84
+ EXAMPLES::
85
+
86
+ sage: E = EllipticCurve('57a')
87
+ sage: p = 5
88
+ sage: prec = 4
89
+ sage: phi = E.pollack_stevens_modular_symbol()
90
+ sage: phi_stabilized = phi.p_stabilize(p,M = prec)
91
+ sage: Phi = phi_stabilized.lift(p,prec) # indirect doctest
92
+ """
93
+ if ap.valuation(p) > 0:
94
+ raise ValueError("Lifting non-ordinary eigensymbols not implemented (issue #20)")
95
+
96
+ # Act by Hecke to ensure values are in D and not D^dag after solving difference equation
97
+ verbose("Applying Hecke", level=2)
98
+
99
+ apinv = ~ap
100
+ Phi = apinv * Phi.hecke(p)
101
+
102
+ # Killing eisenstein part
103
+ verbose("Killing eisenstein part with q = %s" % q, level=2)
104
+ k = Phi.parent().weight()
105
+ Phi = ((q ** (k + 1) + 1) * Phi - Phi.hecke(q))
106
+
107
+ # Iterating U_p
108
+ verbose("Iterating U_p", level=2)
109
+ Psi = apinv * Phi.hecke(p)
110
+
111
+ for attempts in range(M - 1):
112
+ verbose("%s attempt (val = %s/%s)" % (attempts + 1, (Phi - Psi).valuation(), M), level=2)
113
+ Phi = Psi
114
+ Psi = apinv * Phi.hecke(p)
115
+ Psi._normalize()
116
+ return ~(q ** (k + 1) + 1 - aq) * Phi
117
+
118
+
119
+ class PSModSymAction(Action):
120
+ def __init__(self, actor, MSspace) -> None:
121
+ r"""
122
+ Create the action.
123
+
124
+ EXAMPLES::
125
+
126
+ sage: E = EllipticCurve('11a')
127
+ sage: phi = E.pollack_stevens_modular_symbol()
128
+ sage: g = phi._map._codomain._act._Sigma0(matrix(ZZ,2,2,[1,2,3,4]))
129
+ sage: phi * g # indirect doctest
130
+ Modular symbol of level 11 with values in Sym^0 Q^2
131
+ """
132
+
133
+ Action.__init__(self, actor, MSspace, False, operator.mul)
134
+
135
+ def _act_(self, g, sym):
136
+ r"""
137
+ Return the result of ``sym * g``.
138
+
139
+ EXAMPLES::
140
+
141
+ sage: E = EllipticCurve('11a')
142
+ sage: phi = E.pollack_stevens_modular_symbol()
143
+ sage: g = phi._map._codomain._act._Sigma0(matrix(ZZ,2,2,[2,1,5,-1]))
144
+ sage: phi * g # indirect doctest
145
+ Modular symbol of level 11 with values in Sym^0 Q^2
146
+ """
147
+
148
+ return sym.__class__(sym._map * g, sym.parent(), construct=True)
149
+
150
+
151
+ class PSModularSymbolElement(ModuleElement):
152
+ def __init__(self, map_data, parent, construct=False):
153
+ r"""
154
+ Initialize a modular symbol.
155
+
156
+ EXAMPLES::
157
+
158
+ sage: E = EllipticCurve('37a')
159
+ sage: phi = E.pollack_stevens_modular_symbol()
160
+ """
161
+ ModuleElement.__init__(self, parent)
162
+ if construct:
163
+ self._map = map_data
164
+ else:
165
+ self._map = ManinMap(parent._coefficients, parent._source, map_data)
166
+
167
+ def _repr_(self):
168
+ r"""
169
+ Return the string representation of the symbol.
170
+
171
+ EXAMPLES::
172
+
173
+ sage: E = EllipticCurve('11a')
174
+ sage: phi = E.pollack_stevens_modular_symbol()
175
+ sage: phi._repr_()
176
+ 'Modular symbol of level 11 with values in Sym^0 Q^2'
177
+ """
178
+ return "Modular symbol of level %s with values in %s" % (self.parent().level(), self.parent().coefficient_module())
179
+
180
+ def dict(self):
181
+ r"""
182
+ Return dictionary on the modular symbol ``self``, where keys are
183
+ generators and values are the corresponding values of ``self`` on
184
+ generators.
185
+
186
+ EXAMPLES::
187
+
188
+ sage: E = EllipticCurve('11a')
189
+ sage: phi = E.pollack_stevens_modular_symbol()
190
+ sage: Set([x.moment(0) for x in phi.dict().values()]) == Set([-1/5, 1, 0])
191
+ True
192
+ """
193
+ D = {}
194
+ for g in self.parent().source().gens():
195
+ D[g] = self._map[g]
196
+ return D
197
+
198
+ def weight(self):
199
+ r"""
200
+ Return the weight of this Pollack-Stevens modular symbol.
201
+
202
+ This is `k-2`, where `k` is the usual notion of weight for modular
203
+ forms!
204
+
205
+ EXAMPLES::
206
+
207
+ sage: E = EllipticCurve('11a')
208
+ sage: phi = E.pollack_stevens_modular_symbol()
209
+ sage: phi.weight()
210
+ 0
211
+ """
212
+ return self.parent().weight()
213
+
214
+ def values(self):
215
+ r"""
216
+ Return the values of the symbol ``self`` on our chosen generators.
217
+
218
+ The generators are listed in ``self.dict()``.
219
+
220
+ EXAMPLES::
221
+
222
+ sage: E = EllipticCurve('11a')
223
+ sage: phi = E.pollack_stevens_modular_symbol()
224
+ sage: phi.values()
225
+ [-1/5, 1, 0]
226
+ sage: sorted(phi.dict())
227
+ [
228
+ [-1 -1] [ 0 -1] [1 0]
229
+ [ 3 2], [ 1 3], [0 1]
230
+ ]
231
+ sage: sorted(phi.values()) == sorted(phi.dict().values())
232
+ True
233
+ """
234
+ return [self._map[g] for g in self.parent().source().gens()]
235
+
236
+ def _normalize(self, **kwds) -> Self:
237
+ """
238
+ Normalize all of the values of the symbol ``self``.
239
+
240
+ EXAMPLES::
241
+
242
+ sage: E = EllipticCurve('11a')
243
+ sage: phi = E.pollack_stevens_modular_symbol()
244
+ sage: phi._normalize()
245
+ Modular symbol of level 11 with values in Sym^0 Q^2
246
+ sage: phi._normalize().values()
247
+ [-1/5, 1, 0]
248
+ """
249
+ for val in self._map:
250
+ val.normalize(**kwds)
251
+ return self
252
+
253
+ def _richcmp_(self, other, op):
254
+ """
255
+ Check if ``self == other``.
256
+
257
+ Here ``self`` and ``other`` have the same parent.
258
+
259
+ EXAMPLES::
260
+
261
+ sage: E = EllipticCurve('11a')
262
+ sage: phi = E.pollack_stevens_modular_symbol()
263
+ sage: phi == phi
264
+ True
265
+ sage: phi == 2*phi
266
+ False
267
+ sage: psi = EllipticCurve('37a').pollack_stevens_modular_symbol()
268
+ sage: psi == phi
269
+ False
270
+ """
271
+ if op not in [op_EQ, op_NE]:
272
+ return NotImplemented
273
+
274
+ b = all(self._map[g] == other._map[g]
275
+ for g in self.parent().source().gens())
276
+
277
+ return b == (op == op_EQ)
278
+
279
+ def _add_(self, right):
280
+ """
281
+ Return ``self + right``.
282
+
283
+ EXAMPLES::
284
+
285
+ sage: E = EllipticCurve('11a')
286
+ sage: phi = E.pollack_stevens_modular_symbol()
287
+ sage: phi.values()
288
+ [-1/5, 1, 0]
289
+ sage: phi + phi
290
+ Modular symbol of level 11 with values in Sym^0 Q^2
291
+ sage: (phi + phi).values()
292
+ [-2/5, 2, 0]
293
+ """
294
+ return self.__class__(self._map + right._map, self.parent(), construct=True)
295
+
296
+ def _lmul_(self, right):
297
+ """
298
+ Return ``self * right``.
299
+
300
+ EXAMPLES::
301
+
302
+ sage: E = EllipticCurve('11a')
303
+ sage: phi = E.pollack_stevens_modular_symbol()
304
+ sage: phi.values()
305
+ [-1/5, 1, 0]
306
+ sage: 2*phi
307
+ Modular symbol of level 11 with values in Sym^0 Q^2
308
+ sage: (2*phi).values()
309
+ [-2/5, 2, 0]
310
+ """
311
+ return self.__class__(self._map * right, self.parent(), construct=True)
312
+
313
+ def _rmul_(self, right):
314
+ """
315
+ Return ``self * right``.
316
+
317
+ EXAMPLES::
318
+
319
+ sage: E = EllipticCurve('11a')
320
+ sage: phi = E.pollack_stevens_modular_symbol()
321
+ sage: phi.values()
322
+ [-1/5, 1, 0]
323
+ sage: phi*2
324
+ Modular symbol of level 11 with values in Sym^0 Q^2
325
+ sage: (phi*2).values()
326
+ [-2/5, 2, 0]
327
+ """
328
+ return self.__class__(self._map * right, self.parent(), construct=True)
329
+
330
+ def _sub_(self, right):
331
+ """
332
+ Return ``self - right``.
333
+
334
+ EXAMPLES::
335
+
336
+ sage: E = EllipticCurve('11a')
337
+ sage: phi = E.pollack_stevens_modular_symbol()
338
+ sage: phi.values()
339
+ [-1/5, 1, 0]
340
+ sage: phi - phi
341
+ Modular symbol of level 11 with values in Sym^0 Q^2
342
+ sage: (phi - phi).values()
343
+ [0, 0, 0]
344
+ """
345
+ return self.__class__(self._map - right._map, self.parent(), construct=True)
346
+
347
+ def _get_prime(self, p=None, alpha=None, allow_none=False):
348
+ """
349
+ Combine a prime specified by the user with the prime from the parent.
350
+
351
+ INPUT:
352
+
353
+ - ``p`` -- integer or ``None`` (default: ``None``); if specified
354
+ needs to match the prime of the parent
355
+
356
+ - ``alpha`` -- an element or None (default: ``None``); if `p`-adic
357
+ can contribute a prime
358
+
359
+ - ``allow_none`` -- boolean (default: ``False``); whether to allow
360
+ no prime to be specified
361
+
362
+ OUTPUT:
363
+
364
+ - a prime or ``None``. If ``allow_none`` is ``False`` then a
365
+ :exc:`ValueError` will be raised rather than returning ``None``
366
+ if no prime can be determined.
367
+
368
+ EXAMPLES::
369
+
370
+ sage: from sage.modular.pollack_stevens.distributions import Symk
371
+ sage: D = OverconvergentDistributions(0, 5, 10)
372
+ sage: M = PollackStevensModularSymbols(Gamma0(5), coefficients=D)
373
+ sage: f = M(1); f._get_prime()
374
+ 5
375
+ sage: f._get_prime(5)
376
+ 5
377
+ sage: f._get_prime(7)
378
+ Traceback (most recent call last):
379
+ ...
380
+ ValueError: inconsistent prime
381
+ sage: f._get_prime(alpha=Qp(5)(1))
382
+ 5
383
+ sage: D = Symk(0)
384
+ sage: M = PollackStevensModularSymbols(Gamma0(2), coefficients=D)
385
+ sage: f = M(1); f._get_prime(allow_none=True) is None
386
+ True
387
+ sage: f._get_prime(alpha=Qp(7)(1))
388
+ 7
389
+ sage: f._get_prime(7,alpha=Qp(7)(1))
390
+ 7
391
+ sage: f._get_prime()
392
+ Traceback (most recent call last):
393
+ ...
394
+ ValueError: you must specify a prime
395
+ """
396
+ pp = self.parent().prime()
397
+ ppp = ((alpha is not None) and hasattr(alpha.parent(), 'prime')
398
+ and alpha.parent().prime()) or None
399
+ p = ZZ(p) or pp or ppp
400
+ if not p:
401
+ if not allow_none:
402
+ raise ValueError("you must specify a prime")
403
+ elif (pp and p != pp) or (ppp and p != ppp):
404
+ raise ValueError("inconsistent prime")
405
+ return p
406
+
407
+ def plus_part(self):
408
+ r"""
409
+ Return the plus part of ``self`` -- i.e.
410
+ ``self + self | [1,0,0,-1]``.
411
+
412
+ Note that we haven't divided by 2. Is this a problem?
413
+
414
+ EXAMPLES::
415
+
416
+ sage: E = EllipticCurve('11a')
417
+ sage: phi = E.pollack_stevens_modular_symbol()
418
+ sage: phi.values()
419
+ [-1/5, 1, 0]
420
+ sage: (phi.plus_part()+phi.minus_part()) == 2 * phi
421
+ True
422
+ """
423
+ S0N = Sigma0(self.parent().level())
424
+ return self + self * S0N(minusproj)
425
+
426
+ def minus_part(self):
427
+ r"""
428
+ Return the minus part of self -- i.e. self - self | [1,0,0,-1]
429
+
430
+ Note that we haven't divided by 2. Is this a problem?
431
+
432
+ OUTPUT:
433
+
434
+ - self -- self | [1,0,0,-1]
435
+
436
+ EXAMPLES::
437
+
438
+ sage: E = EllipticCurve('11a')
439
+ sage: phi = E.pollack_stevens_modular_symbol()
440
+ sage: phi.values()
441
+ [-1/5, 1, 0]
442
+ sage: (phi.plus_part()+phi.minus_part()) == phi * 2
443
+ True
444
+ """
445
+ S0N = Sigma0(self.parent().level())
446
+ return self - self * S0N(minusproj)
447
+
448
+ def hecke(self, ell, algorithm='prep'):
449
+ r"""
450
+ Return ``self`` | `T_{\ell}` by making use of the precomputations in
451
+ ``self.prep_hecke()``.
452
+
453
+ INPUT:
454
+
455
+ - ``ell`` -- a prime
456
+
457
+ - ``algorithm`` -- string, either 'prep' (default) or
458
+ 'naive'
459
+
460
+ OUTPUT:
461
+
462
+ - The image of this element under the Hecke operator
463
+ `T_{\ell}`
464
+
465
+ ALGORITHMS:
466
+
467
+ - If ``algorithm == 'prep'``, precomputes a list of matrices
468
+ that only depend on the level, then uses them to speed up
469
+ the action.
470
+
471
+ - If ``algorithm == 'naive'``, just acts by the matrices
472
+ defining the Hecke operator. That is, it computes
473
+ sum_a self | [1,a,0,ell] + self | [ell,0,0,1],
474
+ the last term occurring only if the level is prime to ell.
475
+
476
+ EXAMPLES::
477
+
478
+ sage: E = EllipticCurve('11a')
479
+ sage: phi = E.pollack_stevens_modular_symbol()
480
+ sage: phi.values()
481
+ [-1/5, 1, 0]
482
+ sage: phi.hecke(2) == phi * E.ap(2)
483
+ True
484
+ sage: phi.hecke(3) == phi * E.ap(3)
485
+ True
486
+ sage: phi.hecke(5) == phi * E.ap(5)
487
+ True
488
+ sage: phi.hecke(101) == phi * E.ap(101)
489
+ True
490
+
491
+ sage: all(phi.hecke(p, algorithm='naive') == phi * E.ap(p) for p in [2,3,5,101]) # long time
492
+ True
493
+ """
494
+ return self.__class__(self._map.hecke(ell, algorithm),
495
+ self.parent(), construct=True)
496
+
497
+ def valuation(self, p=None):
498
+ r"""
499
+ Return the valuation of ``self`` at `p`.
500
+
501
+ Here the valuation is the minimum of the valuations of the
502
+ values of ``self``.
503
+
504
+ INPUT:
505
+
506
+ - ``p`` -- prime
507
+
508
+ OUTPUT: the valuation of ``self`` at `p`
509
+
510
+ EXAMPLES::
511
+
512
+ sage: E = EllipticCurve('11a')
513
+ sage: phi = E.pollack_stevens_modular_symbol()
514
+ sage: phi.values()
515
+ [-1/5, 1, 0]
516
+ sage: phi.valuation(2)
517
+ 0
518
+ sage: phi.valuation(3)
519
+ 0
520
+ sage: phi.valuation(5)
521
+ -1
522
+ sage: phi.valuation(7)
523
+ 0
524
+ sage: phi.valuation()
525
+ Traceback (most recent call last):
526
+ ...
527
+ ValueError: you must specify a prime
528
+
529
+ sage: phi2 = phi.lift(11, M=2)
530
+ sage: phi2.valuation()
531
+ 0
532
+ sage: phi2.valuation(3)
533
+ Traceback (most recent call last):
534
+ ...
535
+ ValueError: inconsistent prime
536
+ sage: phi2.valuation(11)
537
+ 0
538
+ """
539
+ q = self._get_prime(p)
540
+ return min([val.valuation(q) for val in self._map])
541
+
542
+ def diagonal_valuation(self, p):
543
+ """
544
+ Return the minimum of the diagonal valuation on the values of ``self``.
545
+
546
+ INPUT:
547
+
548
+ - ``p`` -- a positive integral prime
549
+
550
+ EXAMPLES::
551
+
552
+ sage: E = EllipticCurve('11a')
553
+ sage: phi = E.pollack_stevens_modular_symbol()
554
+ sage: phi.values()
555
+ [-1/5, 1, 0]
556
+ sage: phi.diagonal_valuation(2)
557
+ 0
558
+ sage: phi.diagonal_valuation(3)
559
+ 0
560
+ sage: phi.diagonal_valuation(5)
561
+ -1
562
+ sage: phi.diagonal_valuation(7)
563
+ 0
564
+ """
565
+ return min([val.diagonal_valuation(p) for val in self._map])
566
+
567
+ @cached_method
568
+ def is_Tq_eigensymbol(self, q, p=None, M=None):
569
+ r"""
570
+ Determine if ``self`` is an eigenvector for `T_q` modulo `p^M`.
571
+
572
+ INPUT:
573
+
574
+ - ``q`` -- prime of the Hecke operator
575
+
576
+ - ``p`` -- prime we are working modulo
577
+
578
+ - ``M`` -- degree of accuracy of approximation
579
+
580
+ OUTPUT: boolean
581
+
582
+ EXAMPLES::
583
+
584
+ sage: E = EllipticCurve('11a')
585
+ sage: phi = E.pollack_stevens_modular_symbol()
586
+ sage: phi.values()
587
+ [-1/5, 1, 0]
588
+ sage: phi_ord = phi.p_stabilize(p = 3, ap = E.ap(3), M = 10, ordinary = True)
589
+ sage: phi_ord.is_Tq_eigensymbol(2,3,10)
590
+ True
591
+ sage: phi_ord.is_Tq_eigensymbol(2,3,100)
592
+ False
593
+ sage: phi_ord.is_Tq_eigensymbol(2,3,1000)
594
+ False
595
+ sage: phi_ord.is_Tq_eigensymbol(3,3,10)
596
+ True
597
+ sage: phi_ord.is_Tq_eigensymbol(3,3,100)
598
+ False
599
+ """
600
+ try:
601
+ self.Tq_eigenvalue(q, p, M)
602
+ return True
603
+ except ValueError:
604
+ return False
605
+
606
+ # what happens if a cached method raises an error? Is it
607
+ # recomputed each time?
608
+ @cached_method
609
+ def Tq_eigenvalue(self, q, p=None, M=None, check=True):
610
+ r"""
611
+ Eigenvalue of `T_q` modulo `p^M`.
612
+
613
+ INPUT:
614
+
615
+ - ``q`` -- prime of the Hecke operator
616
+
617
+ - ``p`` -- prime we are working modulo (default: ``None``)
618
+
619
+ - ``M`` -- degree of accuracy of approximation (default: ``None``)
620
+
621
+ - ``check`` -- check that ``self`` is an eigensymbol
622
+
623
+ OUTPUT:
624
+
625
+ - Constant `c` such that `self|T_q - c * self` has valuation greater than
626
+ or equal to `M` (if it exists), otherwise raises ValueError
627
+
628
+ EXAMPLES::
629
+
630
+ sage: E = EllipticCurve('11a')
631
+ sage: phi = E.pollack_stevens_modular_symbol()
632
+ sage: phi.values()
633
+ [-1/5, 1, 0]
634
+ sage: phi_ord = phi.p_stabilize(p = 3, ap = E.ap(3), M = 10, ordinary = True)
635
+ sage: phi_ord.Tq_eigenvalue(2,3,10) + 2
636
+ O(3^10)
637
+
638
+ sage: phi_ord.Tq_eigenvalue(3,3,10)
639
+ 2 + 3^2 + 2*3^3 + 2*3^4 + 2*3^6 + 3^8 + 2*3^9 + O(3^10)
640
+ sage: phi_ord.Tq_eigenvalue(3,3,100)
641
+ Traceback (most recent call last):
642
+ ...
643
+ ValueError: result not determined to high enough precision
644
+ """
645
+ qhecke = self.hecke(q)
646
+ gens = self.parent().source().gens()
647
+ if p is None:
648
+ p = self.parent().prime()
649
+ i = 0
650
+
651
+ g = gens[i]
652
+ verbose("Computing eigenvalue", level=2)
653
+ while self._map[g].moment(0).is_zero():
654
+ if not qhecke._map[g].moment(0).is_zero():
655
+ raise ValueError("not a scalar multiple")
656
+ i += 1
657
+ try:
658
+ g = gens[i]
659
+ except IndexError:
660
+ raise ValueError("self is zero")
661
+ aq = self.parent().base_ring()(self._map[g].find_scalar_from_zeroth_moment(qhecke._map[g], p, M, check))
662
+
663
+ verbose("Found eigenvalues of %s" % aq, level=2)
664
+ if check:
665
+ verbose("Checking that this is actually an eigensymbol", level=2)
666
+ if p is None or M is None or not ZZ(p).is_prime():
667
+ for g in gens[1:]:
668
+ try:
669
+ if not (qhecke._map[g] - aq * self._map[g]).is_zero():
670
+ # using != did not work
671
+ raise ValueError("not a scalar multiple")
672
+ except PrecisionError:
673
+ if qhecke._map[g] != aq * self._map[g]:
674
+ raise ValueError("not a scalar multiple")
675
+ else:
676
+ verbose('p = %s, M = %s' % (p, M), level=2)
677
+ if qhecke != aq * self:
678
+ raise ValueError("not a scalar multiple")
679
+ # if not aq.parent().is_exact() and M is not None:
680
+ # aq.add_bigoh(M)
681
+ return aq
682
+
683
+ def is_ordinary(self, p=None, P=None) -> bool:
684
+ r"""
685
+ Return ``True`` if the `p`-th eigenvalue is a `p`-adic unit.
686
+
687
+ INPUT:
688
+
689
+ - ``p`` -- a positive integral prime, or ``None`` (default: ``None``)
690
+ - ``P`` -- a prime of the base ring above `p`, or ``None``.
691
+ This is ignored unless the base ring is a number field
692
+
693
+ OUTPUT: boolean
694
+
695
+ EXAMPLES::
696
+
697
+ sage: E = EllipticCurve('11a1')
698
+ sage: phi = E.pollack_stevens_modular_symbol()
699
+ sage: phi.is_ordinary(2)
700
+ False
701
+ sage: E.ap(2)
702
+ -2
703
+ sage: phi.is_ordinary(3)
704
+ True
705
+ sage: E.ap(3)
706
+ -1
707
+ sage: phip = phi.p_stabilize(3,20)
708
+ sage: phip.is_ordinary()
709
+ True
710
+
711
+ A number field example. Here there are multiple primes above `p`, and
712
+ `\phi` is ordinary at one but not the other.::
713
+
714
+ sage: from sage.modular.pollack_stevens.space import ps_modsym_from_simple_modsym_space
715
+ sage: f = Newforms(32, 8, names='a')[1]
716
+ sage: phi = ps_modsym_from_simple_modsym_space(f.modular_symbols(1))
717
+ sage: (p1, _), (p2, _) = phi.base_ring().ideal(3).factor()
718
+ sage: phi.is_ordinary(p1) != phi.is_ordinary(p2)
719
+ True
720
+ sage: phi.is_ordinary(3)
721
+ Traceback (most recent call last):
722
+ ...
723
+ TypeError: P must be an ideal
724
+ """
725
+ # q is the prime below p, if base is a number field; q = p otherwise
726
+ if p is None:
727
+ if self.parent().prime() == 0:
728
+ raise ValueError("need to specify a prime")
729
+ q = p = self.parent().prime()
730
+ elif p in ZZ:
731
+ q = p
732
+ else:
733
+ q = p.smallest_integer()
734
+ if not q.is_prime():
735
+ raise ValueError("p is not prime")
736
+ if (self.parent().prime() != q) and (self.parent().prime() != 0):
737
+ raise ValueError("prime does not match coefficient module's prime")
738
+ aq = self.Tq_eigenvalue(q)
739
+ return aq.valuation(p) == 0
740
+
741
+ def evaluate_twisted(self, a, chi):
742
+ r"""
743
+ Return `\Phi_{\chi}(\{a/p\}-\{\infty\})` where `\Phi` is ``self`` and
744
+ `\chi` is a quadratic character
745
+
746
+ INPUT:
747
+
748
+ - ``a`` -- integer in the range range(p)
749
+ - ``chi`` -- the modulus of a quadratic character
750
+
751
+ OUTPUT:
752
+
753
+ The distribution `\Phi_{\chi}(\{a/p\}-\{\infty\})`.
754
+
755
+ EXAMPLES::
756
+
757
+ sage: E = EllipticCurve('17a1')
758
+ sage: L = E.padic_lseries(5, implementation='pollackstevens', precision=4) #long time
759
+ sage: D = L.quadratic_twist() # long time
760
+ sage: L.symbol().evaluate_twisted(1,D) # long time
761
+ (1 + 5 + 3*5^2 + 5^3 + O(5^4), 5^2 + O(5^3), 1 + O(5^2), 2 + O(5))
762
+
763
+ sage: E = EllipticCurve('40a4')
764
+ sage: L = E.padic_lseries(7, implementation='pollackstevens', precision=4) #long time
765
+ sage: D = L.quadratic_twist() # long time
766
+ sage: L.symbol().evaluate_twisted(1,D) # long time
767
+ (4 + 6*7 + 3*7^2 + O(7^4), 6*7 + 6*7^2 + O(7^3), 6 + O(7^2), 1 + O(7))
768
+
769
+ TESTS:
770
+
771
+ Check for :issue:`32878`::
772
+
773
+ sage: E = EllipticCurve('11a1')
774
+ sage: L = E.padic_lseries(3, implementation='pollackstevens', precision=4)
775
+ sage: D = 5
776
+ sage: L.symbol().evaluate_twisted(1, D)
777
+ (2 + 3 + 2*3^2 + O(3^4), 2 + 3 + O(3^3), 2 + 3 + O(3^2), 2 + O(3))
778
+ """
779
+ p = self.parent().prime()
780
+ S0p = Sigma0(p)
781
+ Dists = self.parent().coefficient_module()
782
+ M = Dists.precision_cap()
783
+ p = Dists.prime()
784
+ twisted_dist = Dists.zero()
785
+ m_map = self._map
786
+ for b in range(1, abs(chi) + 1):
787
+ if gcd(b, chi) == 1:
788
+ M1 = S0p([1, (b / abs(chi)) % p**M, 0, 1])
789
+ new_dist = m_map(M2Z([a * abs(chi) + p * b,
790
+ 1, p * abs(chi), 0])) * M1
791
+ new_dist = new_dist.scale(kronecker(chi, b)).normalize()
792
+ twisted_dist += new_dist
793
+ return twisted_dist.normalize()
794
+
795
+ def _consistency_check(self):
796
+ """
797
+ Check that the map really does satisfy the Manin relations loop (for debugging).
798
+ The two and three torsion relations are checked and it is checked that the symbol
799
+ adds up correctly around the fundamental domain
800
+
801
+ EXAMPLES::
802
+
803
+ sage: E = EllipticCurve('37a1')
804
+ sage: phi = E.pollack_stevens_modular_symbol()
805
+ sage: phi._consistency_check()
806
+ This modular symbol satisfies the Manin relations
807
+ """
808
+ f = self._map
809
+ MR = self._map._manin
810
+ # Test two torsion relations
811
+ for g in MR.reps_with_two_torsion():
812
+ gamg = MR.two_torsion_matrix(g)
813
+ if not (f[g] * gamg + f[g]).is_zero():
814
+ raise ValueError("Two torsion relation failed with", g)
815
+
816
+ # Test three torsion relations
817
+ for g in MR.reps_with_three_torsion():
818
+ gamg = MR.three_torsion_matrix(g)
819
+ if not (f[g] * (gamg ** 2) + f[g] * gamg + f[g]).is_zero():
820
+ raise ValueError("Three torsion relation failed with", g)
821
+
822
+ # Test that the symbol adds to 0 around the boundary of the
823
+ # fundamental domain
824
+ t = self.parent().coefficient_module().zero()
825
+ for g in MR.gens()[1:]:
826
+ if not (g in MR.reps_with_two_torsion()
827
+ or g in MR.reps_with_three_torsion()):
828
+ t += f[g] * MR.gammas[g] - f[g]
829
+ elif g in MR.reps_with_two_torsion():
830
+ t -= f[g]
831
+ else:
832
+ t -= f[g] # what ?? same thing ??
833
+
834
+ id = MR.gens()[0]
835
+ if f[id] * MR.gammas[id] - f[id] != -t:
836
+ print(t)
837
+ print(f[id] * MR.gammas[id] - f[id])
838
+ raise ValueError("does not add up correctly around loop")
839
+
840
+ print("This modular symbol satisfies the Manin relations")
841
+
842
+
843
+ class PSModularSymbolElement_symk(PSModularSymbolElement):
844
+ def _find_alpha(self, p, k, M=None, ap=None, new_base_ring=None, ordinary=True, check=True, find_extraprec=True):
845
+ r"""
846
+ Find `\alpha`, a `U_p` eigenvalue, which is found as a root of
847
+ the polynomial `x^2 - a_p * x + p^{k+1} \chi(p)`.
848
+
849
+ INPUT:
850
+
851
+ - ``p`` -- prime
852
+
853
+ - ``k`` -- Pollack-Stevens weight
854
+
855
+ - ``M`` -- precision (default: ``None``); of `\QQ_p`
856
+
857
+ - ``ap`` -- Hecke eigenvalue at `p` (default: ``None``)
858
+
859
+ - ``new_base_ring`` -- field of definition of `\alpha` (default: ``None``)
860
+
861
+ - ``ordinary`` -- ``True`` if the prime is ordinary (default: ``True``)
862
+
863
+ - ``check`` -- check to see if the prime is ordinary (default: ``True``)
864
+
865
+ - ``find_extraprec`` -- setting this to ``True`` finds extra precision
866
+ (default: ``True``)
867
+
868
+ OUTPUT:
869
+
870
+ The output is a tuple (``alpha``, ``new_base_ring``, ``newM``,
871
+ ``eisenloss``, ``q``,``aq``), with
872
+
873
+ - ``alpha`` -- `U_p` eigenvalue
874
+
875
+ - ``new_base_ring`` -- field of definition of `\alpha` with precision at least ``newM``
876
+
877
+ - ``newM`` -- new precision
878
+
879
+ - ``eisenloss`` -- loss of precision
880
+
881
+ - ``q`` -- a prime not equal to `p` which was used to find extra precision
882
+
883
+ - ``aq`` -- the Hecke eigenvalue `a_q` corresponding to `q`
884
+
885
+ EXAMPLES::
886
+
887
+ sage: E = EllipticCurve('11a')
888
+ sage: p = 5
889
+ sage: M = 10
890
+ sage: k = 0
891
+ sage: phi = E.pollack_stevens_modular_symbol()
892
+ sage: phi._find_alpha(p,k,M)
893
+ (1 + 4*5 + 3*5^2 + 2*5^3 + 4*5^4 + 4*5^5 + 4*5^6 + 3*5^7 + 2*5^8 + 3*5^9 + 3*5^10 + 3*5^12 + 2*5^13 + O(5^14), 5-adic Field with capped relative precision 14, 13, 1, 2, -2)
894
+ """
895
+ if ap is None:
896
+ ap = self.Tq_eigenvalue(p, check=check)
897
+ if check and ap.valuation(p) > 0:
898
+ raise ValueError("p is not ordinary")
899
+
900
+ chi = self._map._codomain._character
901
+ if chi is not None:
902
+ eps = chi(p)
903
+ else:
904
+ eps = 1
905
+ poly = PolynomialRing(ap.parent(), 'x')([p ** (k + 1) * eps, -ap, 1])
906
+ if new_base_ring is None:
907
+ # These should actually be completions of disc.parent()
908
+ if p == 2:
909
+ # is this the right precision adjustment for p=2?
910
+ new_base_ring = Qp(2, M + 1)
911
+ else:
912
+ new_base_ring = Qp(p, M)
913
+ set_padicbase = True
914
+ else:
915
+ set_padicbase = False
916
+ try:
917
+ verbose("finding alpha: rooting %s in %s" % (poly, new_base_ring), level=2)
918
+ poly = poly.change_ring(new_base_ring)
919
+ (v0, e0), (v1, e1) = poly.roots()
920
+ except (TypeError, ValueError):
921
+ raise ValueError("new base ring must contain a root of x^2 - ap * x + p^(k+1)")
922
+ if v0.valuation(p) > 0:
923
+ v0, v1 = v1, v0
924
+ if ordinary:
925
+ alpha = v0
926
+ else:
927
+ alpha = v1
928
+ if find_extraprec:
929
+ newM, eisenloss, q, aq = self._find_extraprec(p, M, alpha, check)
930
+ else:
931
+ newM, eisenloss, q, aq = M, None, None, None
932
+ if set_padicbase:
933
+ # We want to ensure that the relative precision of alpha
934
+ # and (alpha-1) are both at least *newM*, where newM is
935
+ # obtained from self._find_extraprec
936
+ prec_cap = None
937
+ verbose("testing prec_rel: newM = %s, alpha = %s" % (newM, alpha),
938
+ level=2)
939
+ if alpha.precision_relative() < newM:
940
+ prec_cap = newM + alpha.valuation(p) + (1 if p == 2 else 0)
941
+ if ordinary:
942
+ a1val = (alpha - 1).valuation(p)
943
+ verbose("a1val = %s" % a1val, level=2)
944
+ if a1val > 0 and ap != 1 + p ** (k + 1):
945
+ # if ap = 1 + p**(k+1) then alpha=1 and we need to give up.
946
+ if prec_cap is None:
947
+ prec_cap = newM + a1val + (1 if p == 2 else 0)
948
+ else:
949
+ prec_cap = max(prec_cap, newM + a1val + (1 if p == 2 else 0))
950
+ verbose("prec_cap = %s" % prec_cap, level=2)
951
+ if prec_cap is not None:
952
+ new_base_ring = Qp(p, prec_cap)
953
+ return self._find_alpha(p=p, k=k, M=M, ap=ap, new_base_ring=new_base_ring, ordinary=ordinary, check=False, find_extraprec=find_extraprec)
954
+ return alpha, new_base_ring, newM, eisenloss, q, aq
955
+
956
+ def p_stabilize(self, p=None, M=20, alpha=None, ap=None, new_base_ring=None, ordinary=True, check=True):
957
+ r"""
958
+ Return the `p`-stabilization of ``self`` to level `N p` on which `U_p`
959
+ acts by `\alpha`.
960
+
961
+ Note that since `\alpha` is `p`-adic, the resulting symbol
962
+ is just an approximation to the true `p`-stabilization
963
+ (depending on how well `\alpha` is approximated).
964
+
965
+ INPUT:
966
+
967
+ - ``p`` -- prime not dividing the level of self
968
+
969
+ - ``M`` -- (default: 20) precision of `\QQ_p`
970
+
971
+ - ``alpha`` -- `U_p` eigenvalue
972
+
973
+ - ``ap`` -- Hecke eigenvalue
974
+
975
+ - ``new_base_ring`` -- change of base ring
976
+
977
+ - ``ordinary`` -- boolean (default: ``True``); whether to return the
978
+ ordinary (at ``p``) eigensymbol
979
+
980
+ - ``check`` -- boolean (default: ``True``); whether to perform extra
981
+ sanity checks
982
+
983
+ OUTPUT:
984
+
985
+ A modular symbol with the same Hecke eigenvalues as
986
+ ``self`` away from `p` and eigenvalue `\alpha` at `p`.
987
+ The eigenvalue `\alpha` depends on the parameter ``ordinary``.
988
+
989
+ If ``ordinary`` == True: the unique modular symbol of level
990
+ `N p` with the same Hecke eigenvalues as ``self`` away from
991
+ `p` and unit eigenvalue at `p`; else the unique modular
992
+ symbol of level `N p` with the same Hecke eigenvalues as
993
+ ``self`` away from `p` and non-unit eigenvalue at `p`.
994
+
995
+ EXAMPLES::
996
+
997
+ sage: E = EllipticCurve('11a')
998
+ sage: p = 5
999
+ sage: prec = 4
1000
+ sage: phi = E.pollack_stevens_modular_symbol()
1001
+ sage: phis = phi.p_stabilize(p,M = prec)
1002
+ sage: phis
1003
+ Modular symbol of level 55 with values in Sym^0 Q_5^2
1004
+ sage: phis.hecke(7) == phis*E.ap(7)
1005
+ True
1006
+ sage: phis.hecke(5) == phis*E.ap(5)
1007
+ False
1008
+ sage: phis.hecke(3) == phis*E.ap(3)
1009
+ True
1010
+ sage: phis.Tq_eigenvalue(5)
1011
+ 1 + 4*5 + 3*5^2 + 2*5^3 + O(5^4)
1012
+ sage: phis.Tq_eigenvalue(5,M = 3)
1013
+ 1 + 4*5 + 3*5^2 + O(5^3)
1014
+
1015
+ sage: phis = phi.p_stabilize(p,M = prec,ordinary=False)
1016
+ sage: phis.Tq_eigenvalue(5)
1017
+ 5 + 5^2 + 2*5^3 + O(5^5)
1018
+
1019
+ A complicated example (with nontrivial character)::
1020
+
1021
+ sage: chi = DirichletGroup(24)([-1, -1, -1])
1022
+ sage: f = Newforms(chi,names='a')[0]
1023
+ sage: from sage.modular.pollack_stevens.space import ps_modsym_from_simple_modsym_space
1024
+ sage: phi = ps_modsym_from_simple_modsym_space(f.modular_symbols(1))
1025
+ sage: phi11, h11 = phi.completions(11,20)[0]
1026
+ sage: phi11s = phi11.p_stabilize()
1027
+ sage: phi11s.is_Tq_eigensymbol(11) # long time
1028
+ True
1029
+ """
1030
+ if check:
1031
+ p = self._get_prime(p, alpha)
1032
+ k = self.parent().weight()
1033
+ M = ZZ(M)
1034
+ verbose("p stabilizing: M = %s" % M, level=2)
1035
+ if alpha is None:
1036
+ alpha, new_base_ring, newM, eisenloss, q, aq = self._find_alpha(p, k, M + 1, ap, new_base_ring, ordinary, check, find_extraprec=False)
1037
+ new_base_ring = Qp(p, M) if p != 2 else Qp(p, M + 1)
1038
+ else:
1039
+ if new_base_ring is None:
1040
+ new_base_ring = alpha.parent()
1041
+ if check:
1042
+ if ap is None:
1043
+ ap = self.base_ring()(alpha + p ** (k + 1) / alpha)
1044
+ elif alpha ** 2 - ap * alpha + p ** (k + 1) != 0:
1045
+ raise ValueError("alpha must be a root of x^2 - a_p*x + p^(k+1)")
1046
+ if self.hecke(p) != ap * self:
1047
+ raise ValueError("alpha must be a root of x^2 - a_p*x + p^(k+1)")
1048
+ verbose("found alpha = %s" % alpha, level=2)
1049
+
1050
+ V = self.parent()._p_stabilize_parent_space(p, new_base_ring)
1051
+ return self.__class__(self._map.p_stabilize(p, alpha, V), V, construct=True)
1052
+
1053
+ def completions(self, p, M):
1054
+ r"""
1055
+ If `K` is the base_ring of self, this function takes all maps
1056
+ `K\to \QQ_p` and applies them to ``self`` return a list of
1057
+ (modular symbol,map: `K\to \QQ_p`) as map varies over all such maps.
1058
+
1059
+ .. NOTE::
1060
+
1061
+ This only returns all completions when `p` splits completely in `K`
1062
+
1063
+ INPUT:
1064
+
1065
+ - ``p`` -- prime
1066
+
1067
+ - ``M`` -- precision
1068
+
1069
+ OUTPUT:
1070
+
1071
+ - A list of tuples (modular symbol,map: `K\to \QQ_p`) as map varies over all such maps
1072
+
1073
+ EXAMPLES::
1074
+
1075
+ sage: from sage.modular.pollack_stevens.space import ps_modsym_from_simple_modsym_space
1076
+ sage: D = ModularSymbols(67,2,1).cuspidal_submodule().new_subspace().decomposition()[1]
1077
+ sage: f = ps_modsym_from_simple_modsym_space(D)
1078
+ sage: S = f.completions(41,10); S
1079
+ [(Modular symbol of level 67 with values in Sym^0 Q_41^2, Ring morphism:
1080
+ From: Number Field in alpha with defining polynomial x^2 + 3*x + 1
1081
+ To: 41-adic Field with capped relative precision 10
1082
+ Defn: alpha |--> 5 + 22*41 + 19*41^2 + 10*41^3 + 28*41^4 + 22*41^5 + 9*41^6 + 25*41^7 + 40*41^8 + 8*41^9 + O(41^10)), (Modular symbol of level 67 with values in Sym^0 Q_41^2, Ring morphism:
1083
+ From: Number Field in alpha with defining polynomial x^2 + 3*x + 1
1084
+ To: 41-adic Field with capped relative precision 10
1085
+ Defn: alpha |--> 33 + 18*41 + 21*41^2 + 30*41^3 + 12*41^4 + 18*41^5 + 31*41^6 + 15*41^7 + 32*41^9 + O(41^10))]
1086
+ sage: TestSuite(S[0][0]).run(skip=['_test_category'])
1087
+ """
1088
+ K = self.base_ring()
1089
+ R = Qp(p, M + 10)['x']
1090
+ x = R.gen()
1091
+ if K == QQ:
1092
+ f = x - 1
1093
+ else:
1094
+ f = K.defining_polynomial()
1095
+ v = R(f).roots()
1096
+ if len(v) == 0:
1097
+ L = Qp(p, M).extension(f, names='a')
1098
+ # a = L.gen()
1099
+ V = self.parent().change_ring(L)
1100
+ Dist = V.coefficient_module()
1101
+ psi = K.hom([K.gen()], L)
1102
+ embedded_sym = self.parent().element_class(self._map.apply(psi, codomain=Dist, to_moments=True), V, construct=True)
1103
+ return [embedded_sym, psi]
1104
+ else:
1105
+ roots = [r[0] for r in v]
1106
+ ans = []
1107
+ V = self.parent().change_ring(Qp(p, M))
1108
+ Dist = V.coefficient_module()
1109
+ for r in roots:
1110
+ psi = K.hom([r], Qp(p, M))
1111
+ embedded_sym = self.parent().element_class(self._map.apply(psi, codomain=Dist, to_moments=True), V, construct=True)
1112
+ ans.append((embedded_sym, psi))
1113
+ return ans
1114
+
1115
+ def lift(self, p=None, M=None, alpha=None, new_base_ring=None,
1116
+ algorithm=None, eigensymbol=False, check=True):
1117
+ r"""
1118
+ Return a (`p`-adic) overconvergent modular symbol with
1119
+ `M` moments which lifts ``self`` up to an Eisenstein error.
1120
+
1121
+ Here the Eisenstein error is a symbol whose system of Hecke
1122
+ eigenvalues equals `\ell+1` for `T_\ell` when `\ell`
1123
+ does not divide `Np` and 1 for `U_q` when `q` divides `Np`.
1124
+
1125
+ INPUT:
1126
+
1127
+ - ``p`` -- prime
1128
+
1129
+ - ``M`` -- integer equal to the number of moments
1130
+
1131
+ - ``alpha`` -- `U_p` eigenvalue
1132
+
1133
+ - ``new_base_ring`` -- change of base ring
1134
+
1135
+ - ``algorithm`` -- ``'stevens'`` or ``'greenberg'`` (default:
1136
+ ``'stevens'``)
1137
+
1138
+ - ``eigensymbol`` -- if ``True``, lifts to Hecke eigensymbol (self must
1139
+ be a `p`-ordinary eigensymbol)
1140
+
1141
+ (Note: ``eigensymbol = True`` does *not* just indicate to the code that
1142
+ ``self`` is an eigensymbol; it solves a wholly different problem, lifting
1143
+ an eigensymbol to an eigensymbol.)
1144
+
1145
+ OUTPUT:
1146
+
1147
+ An overconvergent modular symbol whose specialization equals self, up
1148
+ to some Eisenstein error if ``eigensymbol`` is False. If ``eigensymbol
1149
+ = True`` then the output will be an overconvergent Hecke eigensymbol
1150
+ (and it will lift the input exactly, the Eisenstein error disappears).
1151
+
1152
+ EXAMPLES::
1153
+
1154
+ sage: E = EllipticCurve('11a')
1155
+ sage: f = E.pollack_stevens_modular_symbol()
1156
+ sage: g = f.lift(11,4,algorithm='stevens',eigensymbol=True)
1157
+ sage: g.is_Tq_eigensymbol(2)
1158
+ True
1159
+ sage: g.Tq_eigenvalue(3)
1160
+ 10 + 10*11 + 10*11^2 + 10*11^3 + O(11^4)
1161
+ sage: g.Tq_eigenvalue(11)
1162
+ 1 + O(11^4)
1163
+
1164
+ We check that lifting and then specializing gives back the original symbol::
1165
+
1166
+ sage: g.specialize() == f
1167
+ True
1168
+
1169
+ Another example, which showed precision loss in an earlier version of the code::
1170
+
1171
+ sage: E = EllipticCurve('37a')
1172
+ sage: p = 5
1173
+ sage: prec = 4
1174
+ sage: phi = E.pollack_stevens_modular_symbol()
1175
+ sage: Phi = phi.p_stabilize_and_lift(p,prec, algorithm='stevens', eigensymbol=True) # long time
1176
+ sage: Phi.Tq_eigenvalue(5,M = 4) # long time
1177
+ 3 + 2*5 + 4*5^2 + 2*5^3 + O(5^4)
1178
+
1179
+ Another example::
1180
+
1181
+ sage: from sage.modular.pollack_stevens.padic_lseries import pAdicLseries
1182
+ sage: E = EllipticCurve('37a')
1183
+ sage: p = 5
1184
+ sage: prec = 6
1185
+ sage: phi = E.pollack_stevens_modular_symbol()
1186
+ sage: Phi = phi.p_stabilize_and_lift(p=p,M=prec,alpha=None,algorithm='stevens',eigensymbol=True) #long time
1187
+ sage: L = pAdicLseries(Phi) # long time
1188
+ sage: L.symbol() is Phi # long time
1189
+ True
1190
+
1191
+ Examples using Greenberg's algorithm::
1192
+
1193
+ sage: E = EllipticCurve('11a')
1194
+ sage: phi = E.pollack_stevens_modular_symbol()
1195
+ sage: Phi = phi.lift(11,8,algorithm='greenberg',eigensymbol=True)
1196
+ sage: Phi2 = phi.lift(11,8,algorithm='stevens',eigensymbol=True)
1197
+ sage: Phi == Phi2
1198
+ True
1199
+
1200
+ An example in higher weight::
1201
+
1202
+ sage: from sage.modular.pollack_stevens.space import ps_modsym_from_simple_modsym_space
1203
+ sage: f = ps_modsym_from_simple_modsym_space(Newforms(7, 4)[0].modular_symbols(1))
1204
+ sage: fs = f.p_stabilize(5)
1205
+ sage: FsG = fs.lift(M=6, eigensymbol=True,algorithm='greenberg') # long time
1206
+ sage: FsG.values()[0] # long time
1207
+ 5^-1 * (2*5 + 5^2 + 3*5^3 + 4*5^4 + O(5^7), O(5^6), 2*5^2 + 3*5^3 + O(5^5), O(5^4), 5^2 + O(5^3), O(5^2))
1208
+ sage: FsS = fs.lift(M=6, eigensymbol=True,algorithm='stevens') # long time
1209
+ sage: FsS == FsG # long time
1210
+ True
1211
+ """
1212
+ if p is None:
1213
+ p = self.parent().prime()
1214
+ if p == 0:
1215
+ raise ValueError("must specify a prime")
1216
+ elif (self.parent().prime() != 0) and p != self.parent().prime():
1217
+ raise ValueError("inconsistent prime")
1218
+ if M is None:
1219
+ M = self.parent().precision_cap() + 1
1220
+ elif M <= 1:
1221
+ raise ValueError("M must be at least 2")
1222
+ else:
1223
+ M = ZZ(M)
1224
+ if new_base_ring is None:
1225
+ if isinstance(self.parent().base_ring(), pAdicGeneric):
1226
+ new_base_ring = self.parent().base_ring()
1227
+ else:
1228
+ # We may need extra precision in solving the difference equation
1229
+ if algorithm == 'greenberg':
1230
+ extraprec = 0
1231
+ else:
1232
+ extraprec = (M - 1).exact_log(p) # DEBUG: was M-1
1233
+ # should eventually be a completion
1234
+ new_base_ring = Qp(p, M + extraprec)
1235
+ if algorithm is None:
1236
+ # The default algorithm is Greenberg's, if possible.
1237
+ algorithm = 'greenberg' if eigensymbol else 'stevens'
1238
+ elif algorithm == 'greenberg':
1239
+ if not eigensymbol:
1240
+ raise ValueError("Greenberg's algorithm only works"
1241
+ " for eigensymbols. Try 'stevens'")
1242
+ elif algorithm != 'stevens':
1243
+ raise ValueError("algorithm %s not recognized" % algorithm)
1244
+ if eigensymbol:
1245
+ # We need some extra precision due to the fact that solving
1246
+ # the difference equation can give denominators.
1247
+ if alpha is None:
1248
+ verbose('Finding alpha with M = %s' % M, level=2)
1249
+ alpha = self.Tq_eigenvalue(p, M=M + 1, check=check)
1250
+ newM, eisenloss, q, aq = self._find_extraprec(p, M + 1, alpha, check)
1251
+ Phi = self._lift_to_OMS(p, newM, new_base_ring, algorithm)
1252
+ Phi = _iterate_Up(Phi, p, newM, alpha, q, aq, check)
1253
+ Phi = Phi.reduce_precision(M)
1254
+ return Phi._normalize(include_zeroth_moment=True)
1255
+ else:
1256
+ return self._lift_to_OMS(p, M, new_base_ring, algorithm)
1257
+
1258
+ def _lift_to_OMS(self, p, M, new_base_ring, algorithm='greenberg'):
1259
+ r"""
1260
+ Return a (`p`-adic) overconvergent modular symbol with
1261
+ `M` moments which lifts ``self`` up to an Eisenstein error.
1262
+
1263
+ Here the Eisenstein error is a symbol whose system of Hecke
1264
+ eigenvalues equals `\ell+1` for `T_\ell` when `\ell`
1265
+ does not divide `Np` and 1 for `U_q` when `q` divides `Np`.
1266
+
1267
+ INPUT:
1268
+
1269
+ - ``p`` -- prime
1270
+
1271
+ - ``M`` -- integer equal to the number of moments
1272
+
1273
+ - ``new_base_ring`` -- new base ring
1274
+
1275
+ - ``algorithm`` -- string (default: ``'greenberg'``); either
1276
+ ``'greenberg'`` or ``'stevens'``, specifying whether to use
1277
+ the lifting algorithm of M.Greenberg or that of Pollack--Stevens.
1278
+ The latter one solves the difference equation, which is not needed. The
1279
+ option to use Pollack--Stevens' algorithm here is just for historical reasons.
1280
+
1281
+ OUTPUT:
1282
+
1283
+ An overconvergent modular symbol whose specialization
1284
+ equals ``self`` up to some Eisenstein error.
1285
+
1286
+ EXAMPLES::
1287
+
1288
+ sage: E = EllipticCurve('11a')
1289
+ sage: f = E.pollack_stevens_modular_symbol()
1290
+ sage: f._lift_to_OMS(11,4,Qp(11,4))
1291
+ Modular symbol of level 11 with values in Space of 11-adic distributions with k=0 action and precision cap 4
1292
+ """
1293
+ D = {}
1294
+ manin = self.parent().source()
1295
+ MSS = self.parent()._lift_parent_space(p, M, new_base_ring)
1296
+ if algorithm == 'greenberg':
1297
+ for g in manin.gens():
1298
+ D[g] = self._map[g].lift(p, M, new_base_ring)
1299
+ elif algorithm == 'stevens':
1300
+ half = ZZ(1) / ZZ(2)
1301
+ for g in manin.gens()[1:]:
1302
+ twotor = g in manin.reps_with_two_torsion()
1303
+ threetor = g in manin.reps_with_three_torsion()
1304
+ if twotor:
1305
+ # See [PS2011] section 4.1
1306
+ gam = manin.two_torsion_matrix(g)
1307
+ mu = self._map[g].lift(p, M, new_base_ring)
1308
+ D[g] = (mu - mu * gam) * half
1309
+ elif threetor:
1310
+ # See [PS2011] section 4.1
1311
+ gam = manin.three_torsion_matrix(g)
1312
+ mu = self._map[g].lift(p, M, new_base_ring)
1313
+ D[g] = (2 * mu - mu * gam - mu * (gam ** 2)) * half
1314
+ else:
1315
+ # no two or three torsion
1316
+ D[g] = self._map[g].lift(p, M, new_base_ring)
1317
+
1318
+ t = self.parent().coefficient_module().lift(p, M, new_base_ring).zero()
1319
+ # This loops adds up around the boundary of fundamental
1320
+ # domain except the two vertical lines
1321
+ for g in manin.gens()[1:]:
1322
+ twotor = g in manin.reps_with_two_torsion()
1323
+ threetor = g in manin.reps_with_three_torsion()
1324
+ if twotor or threetor:
1325
+ t = t - D[g]
1326
+ else:
1327
+ t += D[g] * manin.gammas[g] - D[g]
1328
+ # t now should be sum Phi(D_i) | (gamma_i - 1) - sum
1329
+ # Phi(D'_i) - sum Phi(D''_i)
1330
+
1331
+ # (Here I'm using the opposite sign convention of [PS2011]
1332
+ # regarding D'_i and D''_i)
1333
+
1334
+ D[manin.gen(0)] = -t.solve_difference_equation() # Check this!
1335
+ else:
1336
+ raise NotImplementedError
1337
+
1338
+ return MSS(D)
1339
+
1340
+ def _find_aq(self, p, M, check):
1341
+ r"""
1342
+ Helper function for finding Hecke eigenvalue `aq` for a prime `q`
1343
+ not equal to `p`. This is called in the case when `alpha = 1 (mod p^M)`
1344
+ (with `alpha` a `U_p`-eigenvalue), which creates the need to use
1345
+ other Hecke eigenvalues (and `alpha`s), because of division by `(alpha - 1)`.
1346
+
1347
+ INPUT:
1348
+
1349
+ - ``p`` -- working prime
1350
+
1351
+ - ``M`` -- precision
1352
+
1353
+ - ``check`` -- checks that ``self`` is a `T_q` eigensymbol
1354
+
1355
+ OUTPUT:
1356
+
1357
+ Tuple ``(q, aq, eisenloss)``, with
1358
+
1359
+ - ``q`` -- a prime not equal to `p`
1360
+
1361
+ - ``aq`` -- Hecke eigenvalue at `q`
1362
+
1363
+ - ``eisenloss`` -- the `p`-adic valuation of `a_q - q^{k+1} - 1`
1364
+
1365
+ EXAMPLES::
1366
+
1367
+ sage: E = EllipticCurve('11a')
1368
+ sage: f = E.pollack_stevens_modular_symbol()
1369
+ sage: f._find_aq(5,10,True)
1370
+ (2, -2, 1)
1371
+ """
1372
+ N = self.parent().level()
1373
+ q = ZZ(2)
1374
+ k = self.parent().weight()
1375
+ aq = self.Tq_eigenvalue(q, check=check)
1376
+ eisenloss = (aq - q ** (k + 1) - 1).valuation(p)
1377
+ while ((q == p) or (N % q == 0) or (eisenloss >= M)) and (q < 50):
1378
+ q = next_prime(q)
1379
+ aq = self.Tq_eigenvalue(q, check=check)
1380
+ if q != p:
1381
+ eisenloss = (aq - q ** (k + 1) - 1).valuation(p)
1382
+ else:
1383
+ eisenloss = (aq - 1).valuation(p)
1384
+ if q >= 50:
1385
+ raise ValueError("The symbol appears to be eisenstein -- "
1386
+ "not implemented yet")
1387
+ return q, aq, eisenloss
1388
+
1389
+ def _find_extraprec(self, p, M, alpha, check):
1390
+ r"""
1391
+ Find the extra precision needed to account for:
1392
+
1393
+ 1) The denominators in the Hecke eigenvalue
1394
+ 2) the denominators appearing when solving the difference equation,
1395
+ 3) those denominators who might be also present in ``self``.
1396
+
1397
+ INPUT:
1398
+
1399
+ - ``p`` -- working prime
1400
+ - ``M`` -- precision
1401
+ - ``alpha`` -- the Up-eigenvalue
1402
+ - ``check`` -- whether to check that ``self`` is a `T_q` eigensymbol
1403
+
1404
+ OUTPUT:
1405
+
1406
+ A tuple (newM, eisenloss, q, aq), where ``newM`` is the new precision, `q` is
1407
+ a prime different from `p`, and ``aq`` is the eigenvalue of `T_q` of the eigensymbol.
1408
+ The value ``eisenloss`` is the loss of precision accounted for in the denominators of the Hecke
1409
+ eigenvalue.
1410
+
1411
+ EXAMPLES::
1412
+
1413
+ sage: E = EllipticCurve('11a')
1414
+ sage: p = 5
1415
+ sage: M = 10
1416
+ sage: k = 0
1417
+ sage: phi = E.pollack_stevens_modular_symbol()
1418
+ sage: alpha = phi.Tq_eigenvalue(p)
1419
+ sage: phi._find_extraprec(p,M,alpha,True)
1420
+ (13, 1, 2, -2)
1421
+ """
1422
+ q, aq, eisenloss = self._find_aq(p, M, check)
1423
+ newM = M + eisenloss
1424
+ # We also need to add precision to account for denominators appearing while solving the difference equation.
1425
+ eplog = (newM - 1).exact_log(p)
1426
+ while eplog < (newM + eplog).exact_log(p):
1427
+ eplog = (newM + eplog).exact_log(p)
1428
+ verbose("M = %s, newM = %s, eplog=%s" % (M, newM, eplog), level=2)
1429
+ newM += eplog
1430
+
1431
+ # We also need to add precision to account for denominators that might be present in self
1432
+ s = self.valuation(p)
1433
+ if s < 0:
1434
+ newM += -s
1435
+ return newM, eisenloss, q, aq
1436
+
1437
+ def p_stabilize_and_lift(self, p, M, alpha=None, ap=None,
1438
+ new_base_ring=None,
1439
+ ordinary=True, algorithm='greenberg', eigensymbol=False,
1440
+ check=True):
1441
+ """
1442
+ `p`-stabilize and lift ``self``.
1443
+
1444
+ INPUT:
1445
+
1446
+ - ``p`` -- prime, not dividing the level of self
1447
+
1448
+ - ``M`` -- precision
1449
+
1450
+ - ``alpha`` -- (default: ``None``) the `U_p` eigenvalue, if known
1451
+
1452
+ - ``ap`` -- (default: ``None``) the Hecke eigenvalue at p (before
1453
+ stabilizing), if known
1454
+
1455
+ - ``new_base_ring`` -- (default: ``None``) if specified, force the
1456
+ resulting eigensymbol to take values in the given ring
1457
+
1458
+ - ``ordinary`` -- boolean (default: ``True``); whether to return the
1459
+ ordinary (at ``p``) eigensymbol
1460
+
1461
+ - ``algorithm`` -- string (default: ``'greenberg'``); either
1462
+ ``'greenberg'`` or ``'stevens'``, specifying whether to use
1463
+ the lifting algorithm of M.Greenberg or that of Pollack--Stevens.
1464
+ The latter one solves the difference equation, which is not needed.
1465
+ The option to use Pollack--Stevens' algorithm here is just for
1466
+ historical reasons.
1467
+
1468
+ - ``eigensymbol`` -- boolean (default: ``False``); if ``True``, return
1469
+ an overconvergent eigensymbol. Otherwise just perform a naive lift
1470
+
1471
+ - ``check`` -- boolean (default: ``True``); whether to perform extra
1472
+ sanity checks
1473
+
1474
+ OUTPUT: `p`-stabilized and lifted version of ``self``
1475
+
1476
+ EXAMPLES::
1477
+
1478
+ sage: E = EllipticCurve('11a')
1479
+ sage: f = E.pollack_stevens_modular_symbol()
1480
+ sage: g = f.p_stabilize_and_lift(3,10) # long time
1481
+ sage: g.Tq_eigenvalue(5) # long time
1482
+ 1 + O(3^10)
1483
+ sage: g.Tq_eigenvalue(7) # long time
1484
+ 1 + 2*3 + 2*3^2 + 2*3^3 + 2*3^4 + 2*3^5 + 2*3^6 + 2*3^7 + 2*3^8 + 2*3^9 + O(3^10)
1485
+ sage: g.Tq_eigenvalue(3) # long time
1486
+ 2 + 3^2 + 2*3^3 + 2*3^4 + 2*3^6 + 3^8 + 2*3^9 + O(3^10)
1487
+ """
1488
+ if check:
1489
+ p = self._get_prime(p, alpha)
1490
+ k = self.parent().weight()
1491
+ M = ZZ(M)
1492
+ # alpha will be the eigenvalue of Up
1493
+ M0 = M + 1
1494
+ if alpha is None:
1495
+ alpha, new_base_ring, newM, eisenloss, q, aq = self._find_alpha(p, k, M0, ap, new_base_ring, ordinary, check)
1496
+ if new_base_ring is None:
1497
+ new_base_ring = alpha.parent()
1498
+ newM, eisenloss, q, aq = self._find_extraprec(p, M0, alpha, check)
1499
+ if hasattr(new_base_ring, 'precision_cap') and newM > new_base_ring.precision_cap():
1500
+ raise ValueError("Not enough precision in new base ring")
1501
+
1502
+ # Now we can stabilize
1503
+ self = self.p_stabilize(p=p, alpha=alpha, ap=ap, M=newM,
1504
+ new_base_ring=new_base_ring, check=check)
1505
+ # And use the standard lifting function for eigensymbols
1506
+ Phi = self._lift_to_OMS(p, newM, new_base_ring, algorithm)
1507
+ Phi = _iterate_Up(Phi, p=p, M=newM, ap=alpha, q=q, aq=aq, check=check)
1508
+ Phi = Phi.reduce_precision(M)
1509
+ return Phi._normalize(include_zeroth_moment=True)
1510
+
1511
+
1512
+ class PSModularSymbolElement_dist(PSModularSymbolElement):
1513
+
1514
+ def reduce_precision(self, M):
1515
+ r"""
1516
+ Only hold on to `M` moments of each value of ``self``.
1517
+
1518
+ EXAMPLES::
1519
+
1520
+ sage: D = OverconvergentDistributions(0, 5, 10)
1521
+ sage: M = PollackStevensModularSymbols(Gamma0(5), coefficients=D)
1522
+ sage: f = M(1)
1523
+ sage: f.reduce_precision(1)
1524
+ Modular symbol of level 5 with values in Space of 5-adic distributions with k=0 action and precision cap 10
1525
+ """
1526
+ return self.__class__(self._map.reduce_precision(M), self.parent(),
1527
+ construct=True)
1528
+
1529
+ def precision_relative(self):
1530
+ r"""
1531
+ Return the number of moments of each value of ``self``.
1532
+
1533
+ EXAMPLES::
1534
+
1535
+ sage: D = OverconvergentDistributions(0, 5, 10)
1536
+ sage: M = PollackStevensModularSymbols(Gamma0(5), coefficients=D)
1537
+ sage: f = M(1)
1538
+ sage: f.precision_relative()
1539
+ 1
1540
+ """
1541
+ return min(len(a._moments) for a in self._map)
1542
+
1543
+ def specialize(self, new_base_ring=None):
1544
+ r"""
1545
+ Return the underlying classical symbol of weight `k`.
1546
+
1547
+ Namely, this applies the canonical map `D_k \to Sym^k` to all
1548
+ values of ``self``.
1549
+
1550
+ EXAMPLES::
1551
+
1552
+ sage: D = OverconvergentDistributions(0, 5, 10); M = PollackStevensModularSymbols(Gamma0(5), coefficients=D); M
1553
+ Space of overconvergent modular symbols for Congruence Subgroup Gamma0(5) with sign 0
1554
+ and values in Space of 5-adic distributions with k=0 action and precision cap 10
1555
+ sage: f = M(1)
1556
+ sage: f.specialize()
1557
+ Modular symbol of level 5 with values in Sym^0 Z_5^2
1558
+ sage: f.specialize().values()
1559
+ [1 + O(5), 1 + O(5), 1 + O(5)]
1560
+ sage: f.values()
1561
+ [1 + O(5), 1 + O(5), 1 + O(5)]
1562
+ sage: f.specialize().parent()
1563
+ Space of modular symbols for Congruence Subgroup Gamma0(5) with sign 0 and values in Sym^0 Z_5^2
1564
+ sage: f.specialize().parent().coefficient_module()
1565
+ Sym^0 Z_5^2
1566
+ sage: f.specialize().parent().coefficient_module().is_symk()
1567
+ True
1568
+ sage: f.specialize(Qp(5,20))
1569
+ Modular symbol of level 5 with values in Sym^0 Q_5^2
1570
+ """
1571
+ if new_base_ring is None:
1572
+ new_base_ring = self.base_ring()
1573
+ return self.__class__(self._map.specialize(new_base_ring),
1574
+ self.parent()._specialize_parent_space(new_base_ring), construct=True)
1575
+
1576
+ def padic_lseries(self, *args, **kwds):
1577
+ """
1578
+ Return the `p`-adic `L`-series of this modular symbol.
1579
+
1580
+ EXAMPLES::
1581
+
1582
+ sage: E = EllipticCurve('37a')
1583
+ sage: phi = E.pollack_stevens_modular_symbol()
1584
+ sage: L = phi.lift(37, M=6, eigensymbol=True).padic_lseries(); L # long time
1585
+ 37-adic L-series of Modular symbol of level 37 with values in Space of 37-adic distributions with k=0 action and precision cap 7
1586
+ sage: L.series(2) # long time
1587
+ O(37^6) + (4 + 37 + 36*37^2 + 19*37^3 + 21*37^4 + O(37^5))*T + O(T^2)
1588
+ """
1589
+ from sage.modular.pollack_stevens.padic_lseries import pAdicLseries
1590
+ return pAdicLseries(self, *args, **kwds)