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,2564 @@
1
+ # sage_setup: distribution = sagemath-schemes
2
+ # sage.doctest: needs sage.graphs sage.libs.pari
3
+ #########################################################################
4
+ # Copyright (C) 2011 Cameron Franc and Marc Masdeu
5
+ #
6
+ # Distributed under the terms of the GNU General Public License (GPL)
7
+ #
8
+ # https://www.gnu.org/licenses/
9
+ #########################################################################
10
+ r"""
11
+ Spaces of `p`-adic automorphic forms
12
+
13
+ Compute with harmonic cocycles and `p`-adic automorphic forms, including
14
+ overconvergent `p`-adic automorphic forms.
15
+
16
+ For a discussion of nearly rigid analytic modular forms and
17
+ the rigid analytic Shimura-Maass operator, see [Fra2011]_. It is worth also
18
+ looking at [FM2014]_ for information on how these are implemented in this code.
19
+
20
+ EXAMPLES:
21
+
22
+ Create a quotient of the Bruhat-Tits tree::
23
+
24
+ sage: X = BruhatTitsQuotient(13, 11)
25
+
26
+ Declare the corresponding space of harmonic cocycles::
27
+
28
+ sage: H = X.harmonic_cocycles(2, prec=5)
29
+
30
+ And the space of `p`-adic automorphic forms::
31
+
32
+ sage: A = X.padic_automorphic_forms(2, prec=5, overconvergent=True) # needs sage.rings.padics
33
+
34
+ Harmonic cocycles, unlike `p`-adic automorphic forms, can be used to compute a basis::
35
+
36
+ sage: a = H.gen(0) # needs sage.rings.padics
37
+
38
+ This can then be lifted to an overconvergent `p`-adic modular form::
39
+
40
+ sage: A.lift(a) # long time # needs sage.rings.padics
41
+ p-adic automorphic form of cohomological weight 0
42
+ """
43
+
44
+ from copy import copy
45
+
46
+ import sage.modular.hecke.hecke_operator
47
+
48
+ from sage.matrix.constructor import Matrix, zero_matrix
49
+ from sage.matrix.matrix_space import MatrixSpace
50
+ from sage.misc.lazy_import import lazy_import
51
+ from sage.misc.verbose import verbose
52
+ from sage.modular.btquotients.btquotient import DoubleCosetReduction
53
+ from sage.modular.hecke.all import AmbientHeckeModule, HeckeModuleElement
54
+ from sage.modular.pollack_stevens.distributions import OverconvergentDistributions, Symk
55
+ from sage.modular.pollack_stevens.sigma0 import Sigma0ActionAdjuster
56
+ from sage.modules.module import Module
57
+ from sage.rings.infinity import Infinity
58
+ from sage.rings.integer import Integer
59
+ from sage.rings.integer_ring import ZZ
60
+ from sage.rings.laurent_series_ring import LaurentSeriesRing
61
+ from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing
62
+ from sage.rings.rational_field import QQ
63
+ from sage.rings.real_mpfr import RR
64
+ from sage.structure.element import ModuleElement
65
+ from sage.structure.richcmp import op_EQ, op_NE
66
+ from sage.structure.unique_representation import UniqueRepresentation
67
+
68
+ lazy_import('sage.rings.padics.factory', 'Qp')
69
+
70
+
71
+ # Need this to be pickleable
72
+
73
+
74
+ class _btquot_adjuster(Sigma0ActionAdjuster):
75
+ """
76
+ Callable object that turns matrices into 4-tuples.
77
+
78
+ Since the modular symbol and harmonic cocycle code use different
79
+ conventions for group actions, this function is used to make sure
80
+ that actions are correct for harmonic cocycle computations.
81
+
82
+ EXAMPLES::
83
+
84
+ sage: from sage.modular.btquotients.pautomorphicform import _btquot_adjuster
85
+ sage: adj = _btquot_adjuster()
86
+ sage: adj(matrix(ZZ,2,2,[1..4]))
87
+ (4, 2, 3, 1)
88
+ """
89
+
90
+ def __call__(self, g):
91
+ """
92
+ Turn matrices into 4-tuples.
93
+
94
+ INPUT:
95
+
96
+ - ``g`` -- a 2x2 matrix
97
+
98
+ OUTPUT: a 4-tuple encoding the entries of ``g``
99
+
100
+ EXAMPLES::
101
+
102
+ sage: from sage.modular.btquotients.pautomorphicform import _btquot_adjuster
103
+ sage: adj = _btquot_adjuster()
104
+ sage: adj(matrix(ZZ,2,2,[0, 1, 2, 3]))
105
+ (3, 1, 2, 0)
106
+ """
107
+ a, b, c, d = g.list()
108
+ return (d, b, c, a)
109
+
110
+
111
+ def eval_dist_at_powseries(phi, f):
112
+ """
113
+ Evaluate a distribution on a powerseries.
114
+
115
+ A distribution is an element in the dual of the Tate ring. The
116
+ elements of coefficient modules of overconvergent modular symbols
117
+ and overconvergent `p`-adic automorphic forms give examples of
118
+ distributions in Sage.
119
+
120
+ INPUT:
121
+
122
+ - ``phi`` -- a distribution
123
+
124
+ - ``f`` -- a power series over a ring coercible into a `p`-adic field
125
+
126
+ OUTPUT:
127
+
128
+ The value of ``phi`` evaluated at ``f``, which will be an element in the
129
+ ring of definition of ``f``
130
+
131
+ EXAMPLES::
132
+
133
+ sage: from sage.modular.btquotients.pautomorphicform import eval_dist_at_powseries
134
+ sage: R.<X> = PowerSeriesRing(ZZ,10)
135
+ sage: f = (1 - 7*X)^(-1)
136
+
137
+ sage: D = OverconvergentDistributions(0,7,10) # needs sage.rings.padics
138
+ sage: phi = D(list(range(1,11))) # needs sage.rings.padics
139
+ sage: eval_dist_at_powseries(phi,f) # needs sage.rings.padics
140
+ 1 + 2*7 + 3*7^2 + 4*7^3 + 5*7^4 + 6*7^5 + 2*7^7 + 3*7^8 + 4*7^9 + O(7^10)
141
+ """
142
+ nmoments = phi.parent().precision_cap()
143
+ K = f.parent().base_ring()
144
+ if K.is_exact():
145
+ K = phi.parent().base_ring()
146
+ return sum(a * K(phi.moment(i))
147
+ for a, i in zip(f.coefficients(), f.exponents())
148
+ if i >= 0 and i < nmoments)
149
+
150
+
151
+ class BruhatTitsHarmonicCocycleElement(HeckeModuleElement):
152
+ r"""
153
+ `\Gamma`-invariant harmonic cocycles on the Bruhat-Tits
154
+ tree. `\Gamma`-invariance is necessary so that the cocycle can be
155
+ stored in terms of a finite amount of data.
156
+
157
+ More precisely, given a ``BruhatTitsQuotient`` `T`, harmonic cocycles are stored as
158
+ a list of values in some coefficient module (e.g. for weight 2 forms
159
+ can take `\CC_p`) indexed by edges of a fundamental domain for `T` in the
160
+ Bruhat-Tits tree. Evaluate the cocycle at other edges using Gamma
161
+ invariance (although the values may not be equal over an orbit of
162
+ edges as the coefficient module action may be nontrivial).
163
+
164
+ EXAMPLES:
165
+
166
+ Harmonic cocycles form a vector space, so they can be added and/or
167
+ subtracted from each other::
168
+
169
+ sage: X = BruhatTitsQuotient(5,23)
170
+ sage: H = X.harmonic_cocycles(2, prec=10)
171
+ sage: v1 = H.basis()[0]; v2 = H.basis()[1] # indirect doctest
172
+ sage: v3 = v1 + v2
173
+ sage: v1 == v3 - v2
174
+ True
175
+
176
+ and rescaled::
177
+
178
+ sage: v4 = 2*v1
179
+ sage: v1 == v4 - v1
180
+ True
181
+
182
+ AUTHORS:
183
+
184
+ - Cameron Franc (2012-02-20)
185
+ - Marc Masdeu
186
+ """
187
+ def __init__(self, _parent, vec):
188
+ """
189
+ Create a harmonic cocycle element.
190
+
191
+ INPUT:
192
+
193
+ - ``_parent`` : the parent space of harmonic cocycles.
194
+ - ``vec`` : a list of elements in the coefficient module.
195
+
196
+ EXAMPLES::
197
+
198
+ sage: X = BruhatTitsQuotient(31,7)
199
+ sage: H = X.harmonic_cocycles(2,prec=10)
200
+ sage: v = H.basis()[0] # indirect doctest
201
+ sage: TestSuite(v).run()
202
+ """
203
+ HeckeModuleElement.__init__(self, _parent, None)
204
+ self._parent = _parent
205
+ assert type(vec) is list
206
+ assert all(v.parent() is _parent._U for v in vec)
207
+ self._R = _parent._U.base_ring()
208
+ self._wt = _parent._k
209
+ self._nE = len(_parent._E)
210
+ self._F = copy(vec)
211
+
212
+ def _add_(self, g):
213
+ r"""
214
+ Add two cocycles componentwise.
215
+
216
+ INPUT:
217
+
218
+ - ``g`` -- a harmonic cocycle
219
+
220
+ OUTPUT: a harmonic cocycle
221
+
222
+ EXAMPLES::
223
+
224
+ sage: X = BruhatTitsQuotient(5,23)
225
+ sage: H = X.harmonic_cocycles(2,prec=10)
226
+ sage: v1 = H.basis()[0]; v2 = H.basis()[1]
227
+ sage: v3 = v1+v2 # indirect doctest
228
+ sage: v1 == v3-v2
229
+ True
230
+ """
231
+ return self.parent()(self.element() + g.element())
232
+
233
+ def _sub_(self, g):
234
+ r"""
235
+ Compute the difference of two cocycles.
236
+
237
+ INPUT:
238
+
239
+ - ``g`` -- a harmonic cocycle
240
+
241
+ OUTPUT: a harmonic cocycle
242
+
243
+ EXAMPLES::
244
+
245
+ sage: X = BruhatTitsQuotient(5,11)
246
+ sage: H = X.harmonic_cocycles(2,prec=10)
247
+ sage: v1 = H.basis()[0]; v2 = H.basis()[1]
248
+ sage: v3 = v1-v2 # indirect doctest
249
+ sage: v1 == v3+v2
250
+ True
251
+ """
252
+ # Should ensure that self and g are modular forms of the same
253
+ # weight and on the same curve
254
+ return self.parent()(self.element() - g.element())
255
+
256
+ def _lmul_(self, a):
257
+ r"""
258
+ Multiply a cocycle by a scalar.
259
+
260
+ INPUT:
261
+
262
+ - ``a`` -- a ring element
263
+
264
+ OUTPUT: a harmonic cocycle
265
+
266
+ EXAMPLES::
267
+
268
+ sage: X = BruhatTitsQuotient(3,23)
269
+ sage: H = X.harmonic_cocycles(2,prec=10)
270
+ sage: v1 = H.basis()[0]
271
+ sage: v2 = 2*v1 # indirect doctest
272
+ sage: v1 == v2-v1
273
+ True
274
+ """
275
+ # Should ensure that 'a' is a scalar
276
+ return self.parent()(a * self.element())
277
+
278
+ def _richcmp_(self, other, op):
279
+ r"""
280
+ General comparison method for ``HarmonicCocycles``.
281
+
282
+ INPUT:
283
+
284
+ - ``other`` -- another harmonic cocycle
285
+
286
+ EXAMPLES::
287
+
288
+ sage: X = BruhatTitsQuotient(11,23)
289
+ sage: H = X.harmonic_cocycles(2,prec=10)
290
+ sage: v1 = H.basis()[0]
291
+ sage: v2 = 3*v1 # indirect doctest
292
+ sage: 2*v1 == v2-v1
293
+ True
294
+ """
295
+ if op not in [op_EQ, op_NE]:
296
+ return NotImplemented
297
+
298
+ b = all(self._F[e] == other._F[e] for e in range(self._nE))
299
+ if op == op_EQ:
300
+ return b
301
+ return not b
302
+
303
+ def _repr_(self):
304
+ r"""
305
+ Return a string describing the cocycle.
306
+
307
+ EXAMPLES::
308
+
309
+ sage: X = BruhatTitsQuotient(5,13)
310
+ sage: H = X.harmonic_cocycles(2,prec=10)
311
+ sage: H.basis()[0] # indirect doctest
312
+ Harmonic cocycle with values in Sym^0 Q_5^2
313
+ """
314
+ return 'Harmonic cocycle with values in %s' % self.parent()._U
315
+
316
+ def monomial_coefficients(self, copy=True):
317
+ r"""
318
+ Return a dictionary whose keys are indices of basis elements
319
+ in the support of ``self`` and whose values are the
320
+ corresponding coefficients.
321
+
322
+ EXAMPLES::
323
+
324
+ sage: M = BruhatTitsQuotient(3,5).harmonic_cocycles(2, prec=10)
325
+ sage: M.monomial_coefficients()
326
+ {}
327
+ """
328
+ return self.element().monomial_coefficients(copy=copy)
329
+
330
+ def print_values(self):
331
+ r"""
332
+ Print the values of the cocycle on all of the edges.
333
+
334
+ EXAMPLES::
335
+
336
+ sage: X = BruhatTitsQuotient(5,23)
337
+ sage: H = X.harmonic_cocycles(2,prec=10)
338
+ sage: H.basis()[0].print_values()
339
+ 0 |1 + O(5^10)
340
+ 1 |0
341
+ 2 |0
342
+ 3 |4 + 4*5 + 4*5^2 + 4*5^3 + 4*5^4 + 4*5^5 + 4*5^6 + 4*5^7 + 4*5^8 + 4*5^9 + O(5^10)
343
+ 4 |0
344
+ 5 |0
345
+ 6 |0
346
+ 7 |0
347
+ 8 |0
348
+ 9 |0
349
+ 10 |0
350
+ 11 |0
351
+ """
352
+ tmp = ''
353
+ for e in range(self._nE):
354
+ tmp += str(e) + '\t|' + str(self._F[e]) + '\n'
355
+ print(tmp[:-1])
356
+
357
+ def valuation(self):
358
+ r"""
359
+ Return the valuation of the cocycle, defined as the
360
+ minimum of the values it takes on a set of representatives.
361
+
362
+ OUTPUT: integer
363
+
364
+ EXAMPLES::
365
+
366
+ sage: X = BruhatTitsQuotient(3,17)
367
+ sage: H = X.harmonic_cocycles(2,prec=10)
368
+ sage: b1 = H.basis()[0]
369
+ sage: b2 = 3*b1
370
+ sage: b1.valuation()
371
+ 0
372
+ sage: b2.valuation()
373
+ 1
374
+ sage: H(0).valuation()
375
+ +Infinity
376
+ """
377
+ if self == 0:
378
+ return Infinity
379
+ else:
380
+ return min(self._F[e].valuation() for e in range(self._nE))
381
+
382
+ def _compute_element(self):
383
+ r"""
384
+ Express a harmonic cocycle in a coordinate vector.
385
+
386
+ OUTPUT:
387
+
388
+ A coordinate vector encoding ``self`` in terms of the ambient
389
+ basis in ``self.parent``
390
+
391
+ EXAMPLES::
392
+
393
+ sage: X = BruhatTitsQuotient(3,17)
394
+ sage: H = X.harmonic_cocycles(2,prec=10)
395
+ sage: H.basis()[0]._compute_element()
396
+ (1 + O(3^10), 0, 0)
397
+ sage: H.basis()[1]._compute_element()
398
+ (0, 1 + O(3^10), 0)
399
+ sage: H.basis()[2]._compute_element()
400
+ (0, 0, 1 + O(3^10))
401
+ """
402
+ R = self._R
403
+ A = self.parent().basis_matrix().transpose()
404
+ B = Matrix(R, self._nE * (self.parent()._k - 1), 1,
405
+ [self._F[e].moment(ii) for e in range(self._nE)
406
+ for ii in range(self.parent()._k - 1)])
407
+ try:
408
+ res = (A.solve_right(B)).transpose()
409
+ except ValueError:
410
+ rest = (A.transpose() * A).solve_right(A.transpose() * B)
411
+ err = A * rest - B
412
+ if err != 0:
413
+ try:
414
+ if hasattr(err.parent().base_ring().an_element(),
415
+ 'valuation'):
416
+ minval = min([o.valuation() for o in err.list()
417
+ if o != 0])
418
+ else:
419
+ minval = sum([RR(o.norm() ** 2) for o in err.list()])
420
+ verbose('Error = %s' % minval)
421
+ except AttributeError:
422
+ verbose('Warning: something did not work in the '
423
+ 'computation')
424
+ res = rest.transpose()
425
+ return self.parent().free_module()(res.row(0))
426
+
427
+ # In BruhatTitsHarmonicCocycle
428
+ def evaluate(self, e1):
429
+ r"""
430
+ Evaluate a harmonic cocycle on an edge of the Bruhat-Tits tree.
431
+
432
+ INPUT:
433
+
434
+ - ``e1`` -- a matrix corresponding to an edge of the
435
+ Bruhat-Tits tree
436
+
437
+ OUTPUT:
438
+
439
+ - An element of the coefficient module of the cocycle which
440
+ describes the value of the cocycle on ``e1``
441
+
442
+ EXAMPLES::
443
+
444
+ sage: X = BruhatTitsQuotient(5,17)
445
+ sage: e0 = X.get_edge_list()[0]
446
+ sage: e1 = X.get_edge_list()[1]
447
+ sage: H = X.harmonic_cocycles(2,prec=10)
448
+ sage: b = H.basis()[0]
449
+ sage: b.evaluate(e0.rep)
450
+ 1 + O(5^10)
451
+ sage: b.evaluate(e1.rep)
452
+ 4 + 4*5 + 4*5^2 + 4*5^3 + 4*5^4 + 4*5^5 + 4*5^6 + 4*5^7 + 4*5^8 + 4*5^9 + O(5^10)
453
+ """
454
+ X = self.parent()._X
455
+ p = X._p
456
+ u = DoubleCosetReduction(X, e1)
457
+ if u.label < self._nE:
458
+ val = self._F[u.label]
459
+ else:
460
+ val = -self._F[u.label - self._nE]
461
+
462
+ return u.igamma(self.parent().embed_quaternion, scale=p ** (-u.power)) * val
463
+
464
+ # In BruhatTitsHarmonicCocycle
465
+ def riemann_sum(self, f, center=1, level=0, E=None):
466
+ r"""
467
+ Evaluate the integral of the function ``f`` with respect
468
+ to the measure determined by ``self`` over `\mathbf{P}^1(\QQ_p)`.
469
+
470
+ INPUT:
471
+
472
+ - ``f`` -- a function on `\mathbf{P}^1(\QQ_p)`
473
+
474
+ - ``center`` -- integer (default: 1); Center of integration
475
+
476
+ - ``level`` -- integer (default: 0); Determines the size of
477
+ the covering when computing the Riemann sum. Runtime is
478
+ exponential in the level.
479
+
480
+ - ``E`` -- list of edges (default: ``None``); They should describe
481
+ a covering of `\mathbf{P}^1(\QQ_p)`
482
+
483
+ OUTPUT: a `p`-adic number
484
+
485
+ EXAMPLES::
486
+
487
+ sage: X = BruhatTitsQuotient(5,7)
488
+ sage: H = X.harmonic_cocycles(2,prec=10)
489
+ sage: b = H.basis()[0]
490
+ sage: R.<z> = PolynomialRing(QQ,1)
491
+ sage: f = z^2
492
+
493
+ Note that `f` has a pole at infinity, so that the result will
494
+ be meaningless::
495
+
496
+ sage: b.riemann_sum(f,level=0)
497
+ 1 + 5 + 2*5^3 + 4*5^4 + 2*5^5 + 3*5^6 + 3*5^7 + 2*5^8 + 4*5^9 + O(5^10)
498
+ """
499
+ R1 = LaurentSeriesRing(f.base_ring(), 'r1')
500
+ if E is None:
501
+ E = self.parent()._X._BT.get_balls(center, level)
502
+ else:
503
+ E = self.parent()._X._BT.subdivide(E, level)
504
+ value = 0
505
+ for e in E:
506
+ expansion = ((R1([e[1, 1], e[1, 0]]) ** (self.parent()._k - 2) * e.determinant() ** (-(self.parent()._k - 2) / 2)) * f(R1([e[0, 1], e[0, 0]]) / R1([e[1, 1], e[1, 0]]))).truncate(self.parent()._k - 1)
507
+ dist = self.parent()._Sigma0(e.inverse(), check=False) * self.evaluate(e)
508
+ value += eval_dist_at_powseries(dist, expansion)
509
+ return value
510
+
511
+ def modular_form(self, z=None, level=0):
512
+ r"""
513
+ Integrate Teitelbaum's `p`-adic Poisson kernel against
514
+ the measure corresponding to ``self`` to evaluate the associated
515
+ modular form at ``z``.
516
+
517
+ If ``z`` = None, a function is returned that encodes the modular form.
518
+
519
+ .. NOTE::
520
+
521
+ This function uses the integration method of Riemann
522
+ summation and is incredibly slow! It should only be used for
523
+ testing and bug-finding. Overconvergent methods are quicker.
524
+
525
+ INPUT:
526
+
527
+ - ``z`` -- an element in the quadratic unramified extension of
528
+ `\QQ_p` that is not contained in `\QQ_p` (default: ``None``)
529
+
530
+ - ``level`` -- integer; how fine of a mesh should the Riemann
531
+ sum use
532
+
533
+ OUTPUT: an element of the quadratic unramified extension of `\QQ_p`
534
+
535
+ EXAMPLES::
536
+
537
+ sage: X = BruhatTitsQuotient(3,23)
538
+ sage: H = X.harmonic_cocycles(2,prec = 8)
539
+ sage: b = H.basis()[0]
540
+ sage: R.<a> = Qq(9,prec=10)
541
+ sage: x1 = b.modular_form(a,level = 0); x1
542
+ a + (2*a + 1)*3 + (a + 1)*3^2 + (a + 1)*3^3 + 3^4 + (a + 2)*3^5 + a*3^7 + O(3^8)
543
+ sage: x2 = b.modular_form(a,level = 1); x2
544
+ a + (a + 2)*3 + (2*a + 1)*3^3 + (2*a + 1)*3^4 + 3^5 + (a + 2)*3^6 + a*3^7 + O(3^8)
545
+ sage: x3 = b.modular_form(a,level = 2); x3
546
+ a + (a + 2)*3 + (2*a + 2)*3^2 + 2*a*3^4 + (a + 1)*3^5 + 3^6 + O(3^8)
547
+ sage: x4 = b.modular_form(a,level = 3);x4
548
+ a + (a + 2)*3 + (2*a + 2)*3^2 + (2*a + 2)*3^3 + 2*a*3^5 + a*3^6 + (a + 2)*3^7 + O(3^8)
549
+ sage: (x4-x3).valuation()
550
+ 3
551
+
552
+ TESTS:
553
+
554
+ Check that :issue:`22634` is fixed::
555
+
556
+ sage: X = BruhatTitsQuotient(7,2)
557
+ sage: H = X.harmonic_cocycles(4,20)
558
+ sage: f0, g0 = H.basis()
559
+ sage: A = X.padic_automorphic_forms(4,20,overconvergent=True)
560
+ sage: f = A.lift(f0).modular_form(method='moments')
561
+ sage: T.<x> = Qq(7^2,20)
562
+ sage: a,b,c,d = X.embed_quaternion(X.get_units_of_order()[1]).change_ring(Qp(7,20)).list()
563
+ sage: (c*x + d)^4 * f(x) == f((a*x + b)/(c*x + d))
564
+ True
565
+ sage: g = A.lift(g0).modular_form(method='moments')
566
+ sage: (c*x + d)^4 * f(x) == f((a*x + b)/(c*x + d))
567
+ True
568
+ """
569
+ return self.derivative(z, level, order=0)
570
+
571
+ # In BruhatTitsHarmonicCocycle
572
+ def derivative(self, z=None, level=0, order=1):
573
+ r"""
574
+ Integrate Teitelbaum's `p`-adic Poisson kernel against
575
+ the measure corresponding to ``self`` to evaluate the rigid
576
+ analytic Shimura-Maass derivatives of the associated modular
577
+ form at `z`.
578
+
579
+ If ``z = None``, a function is returned that encodes the
580
+ derivative of the modular form.
581
+
582
+ .. NOTE::
583
+
584
+ This function uses the integration method of Riemann
585
+ summation and is incredibly slow! It should only be used for
586
+ testing and bug-finding. Overconvergent methods are quicker.
587
+
588
+ INPUT:
589
+
590
+ - ``z`` -- an element in the quadratic unramified extension of
591
+ `\QQ_p` that is not contained in `\QQ_p` (default: ``None``); if
592
+ ``z = None`` then a function encoding the derivative is returned.
593
+
594
+ - ``level`` -- integer; how fine of a mesh should the Riemann
595
+ sum use
596
+
597
+ - ``order`` -- integer; how many derivatives to take
598
+
599
+ OUTPUT:
600
+
601
+ An element of the quadratic unramified extension of `\QQ_p`, or
602
+ a function encoding the derivative.
603
+
604
+ EXAMPLES::
605
+
606
+ sage: X = BruhatTitsQuotient(3,23)
607
+ sage: H = X.harmonic_cocycles(2,prec=5)
608
+ sage: b = H.basis()[0]
609
+ sage: R.<a> = Qq(9,prec=10)
610
+ sage: b.modular_form(a,level=0) == b.derivative(a,level=0,order=0)
611
+ True
612
+ sage: b.derivative(a,level=1,order=1)
613
+ (2*a + 2)*3 + (a + 2)*3^2 + 2*a*3^3 + 2*3^4 + O(3^5)
614
+ sage: b.derivative(a,level=2,order=1)
615
+ (2*a + 2)*3 + 2*a*3^2 + 3^3 + a*3^4 + O(3^5)
616
+ """
617
+ def F(z):
618
+ R = PolynomialRing(z.parent(), 'x,y').fraction_field()
619
+ Rx = PolynomialRing(z.parent(), 'x1').fraction_field()
620
+ x1 = Rx.gen()
621
+ subst = R.hom([x1, z], codomain=Rx)
622
+ x, y = R.gens()
623
+ center = self.parent()._X._BT.find_containing_affinoid(z)
624
+ zbar = z.trace() - z
625
+ f = R(1) / (x - y)
626
+ k = self.parent()._k
627
+ V = [f]
628
+ for ii in range(order):
629
+ V = [v.derivative(y) for v in V] + [k / (y - zbar) * v
630
+ for v in V]
631
+ k += 2
632
+ return sum([self.riemann_sum(subst(v), center, level) for v in V])
633
+ if z is None:
634
+ return F
635
+ else:
636
+ return F(z)
637
+
638
+
639
+ class BruhatTitsHarmonicCocycles(AmbientHeckeModule, UniqueRepresentation):
640
+ r"""
641
+ Ensure unique representation.
642
+
643
+ EXAMPLES::
644
+
645
+ sage: X = BruhatTitsQuotient(3,5)
646
+ sage: M1 = X.harmonic_cocycles( 2, prec = 10)
647
+ sage: M2 = X.harmonic_cocycles( 2, 10)
648
+ sage: M1 is M2
649
+ True
650
+ """
651
+ Element = BruhatTitsHarmonicCocycleElement
652
+
653
+ @staticmethod
654
+ def __classcall__(cls, X, k, prec=None, basis_matrix=None, base_field=None):
655
+ r"""
656
+ Represent a space of Gamma invariant harmonic
657
+ cocycles valued in a coefficient module.
658
+
659
+ INPUT:
660
+
661
+ - ``X`` -- a BruhatTitsQuotient object
662
+
663
+ - ``k`` -- integer; the weight. It must be even.
664
+
665
+ - ``prec`` -- integer (default: ``None``); if specified, the
666
+ precision for the coefficient module
667
+
668
+ - ``basis_matrix`` -- a matrix (default: ``None``)
669
+
670
+ - ``base_field`` -- a ring (default: ``None``)
671
+
672
+ EXAMPLES::
673
+
674
+ sage: X = BruhatTitsQuotient(3,23)
675
+ sage: H = X.harmonic_cocycles(2,prec = 5)
676
+ sage: H.dimension()
677
+ 3
678
+ sage: X.genus()
679
+ 3
680
+
681
+ Higher even weights are implemented::
682
+
683
+ sage: H = X.harmonic_cocycles(8, prec = 10)
684
+ sage: H.dimension()
685
+ 26
686
+
687
+ AUTHORS:
688
+
689
+ - Cameron Franc (2012-02-20)
690
+ - Marc Masdeu
691
+ """
692
+ return super().__classcall__(cls, X, k, prec,
693
+ basis_matrix,
694
+ base_field)
695
+
696
+ def __init__(self, X, k, prec=None, basis_matrix=None, base_field=None):
697
+ """
698
+ Compute the space of harmonic cocycles.
699
+
700
+ EXAMPLES::
701
+
702
+ sage: X = BruhatTitsQuotient(3,37)
703
+ sage: H = X.harmonic_cocycles(4,prec=10)
704
+ sage: TestSuite(H).run()
705
+ """
706
+ self._k = k
707
+ self._X = X
708
+ self._E = self._X.get_edge_list()
709
+ self._V = self._X.get_vertex_list()
710
+
711
+ if base_field is not None and not base_field.is_exact():
712
+ prec = base_field.precision_cap()
713
+
714
+ if prec is None:
715
+ self._prec = None # Be careful!
716
+ if base_field is None:
717
+ try:
718
+ self._R = X.get_splitting_field()
719
+ except AttributeError:
720
+ raise ValueError("It looks like you are not using Magma as"
721
+ " backend...and still we don't know how "
722
+ "to compute splittings in that case!")
723
+ else:
724
+ pol = X.get_splitting_field().defining_polynomial().factor()[0][0]
725
+ self._R = base_field.extension(pol, pol.variable_name()).absolute_field(name='r')
726
+ else:
727
+ self._prec = prec
728
+ if base_field is None:
729
+ self._R = Qp(self._X._p, prec=prec)
730
+ else:
731
+ self._R = base_field
732
+
733
+ self._U = Symk(self._k - 2, base=self._R, act_on_left=True,
734
+ adjuster=_btquot_adjuster(),
735
+ dettwist=-ZZ((self._k - 2) // 2), act_padic=True)
736
+
737
+ if basis_matrix is None:
738
+ self.__rank = self._X.dimension_harmonic_cocycles(self._k)
739
+ else:
740
+ self.__rank = basis_matrix.nrows()
741
+ if basis_matrix is not None:
742
+ self.__matrix = basis_matrix
743
+ self.__matrix.set_immutable()
744
+ assert self.__rank == self.__matrix.nrows()
745
+
746
+ self._Sigma0 = self._U._act._Sigma0
747
+
748
+ AmbientHeckeModule.__init__(self, self._R, self.__rank,
749
+ self._X.prime() * self._X.Nplus() * self._X.Nminus(), weight=self._k)
750
+ self._populate_coercion_lists_()
751
+
752
+ def monomial_coefficients(self):
753
+ r"""
754
+ Void method to comply with pickling.
755
+
756
+ EXAMPLES::
757
+
758
+ sage: M = BruhatTitsQuotient(3,5).harmonic_cocycles(2,prec=10)
759
+ sage: M.monomial_coefficients()
760
+ {}
761
+ """
762
+ return {}
763
+
764
+ def base_extend(self, base_ring):
765
+ r"""
766
+ Extend the base ring of the coefficient module.
767
+
768
+ INPUT:
769
+
770
+ - ``base_ring`` -- a ring that has a coerce map from the
771
+ current base ring
772
+
773
+ OUTPUT: a new space of HarmonicCocycles with the base extended
774
+
775
+ EXAMPLES::
776
+
777
+ sage: X = BruhatTitsQuotient(3,19)
778
+ sage: H = X.harmonic_cocycles(2,10)
779
+ sage: H.base_ring()
780
+ 3-adic Field with capped relative precision 10
781
+ sage: H1 = H.base_extend(Qp(3,prec=15))
782
+ sage: H1.base_ring()
783
+ 3-adic Field with capped relative precision 15
784
+ """
785
+ if not base_ring.has_coerce_map_from(self.base_ring()):
786
+ raise ValueError("No coercion defined")
787
+ else:
788
+ return self.change_ring(base_ring)
789
+
790
+ def change_ring(self, new_base_ring):
791
+ r"""
792
+ Change the base ring of the coefficient module.
793
+
794
+ INPUT:
795
+
796
+ - ``new_base_ring`` -- a ring that has a coerce map from the
797
+ current base ring
798
+
799
+ OUTPUT: new space of HarmonicCocycles with different base ring
800
+
801
+ EXAMPLES::
802
+
803
+ sage: X = BruhatTitsQuotient(5,17)
804
+ sage: H = X.harmonic_cocycles(2,10)
805
+ sage: H.base_ring()
806
+ 5-adic Field with capped relative precision 10
807
+ sage: H1 = H.base_extend(Qp(5,prec=15)) # indirect doctest
808
+ sage: H1.base_ring()
809
+ 5-adic Field with capped relative precision 15
810
+ """
811
+ if not new_base_ring.has_coerce_map_from(self.base_ring()):
812
+ raise ValueError("No coercion defined")
813
+
814
+ basis_matrix = self.basis_matrix().change_ring(new_base_ring)
815
+ basis_matrix.set_immutable()
816
+ return self.__class__(self._X, self._k, prec=None,
817
+ basis_matrix=basis_matrix,
818
+ base_field=new_base_ring)
819
+
820
+ def rank(self):
821
+ r"""
822
+ Return the rank (dimension) of ``self``.
823
+
824
+ OUTPUT: integer
825
+
826
+ EXAMPLES::
827
+
828
+ sage: X = BruhatTitsQuotient(7,11)
829
+ sage: H = X.harmonic_cocycles(2,prec = 10)
830
+ sage: X.genus() == H.rank()
831
+ True
832
+ sage: H1 = X.harmonic_cocycles(4,prec = 10)
833
+ sage: H1.rank()
834
+ 16
835
+ """
836
+ return self.__rank
837
+
838
+ def submodule(self, v, check=False):
839
+ r"""
840
+ Return the submodule of ``self`` spanned by ``v``.
841
+
842
+ INPUT:
843
+
844
+ - ``v`` -- submodule of ``self.free_module()``
845
+
846
+ - ``check`` -- boolean (default: ``False``)
847
+
848
+ OUTPUT: subspace of harmonic cocycles
849
+
850
+ EXAMPLES::
851
+
852
+ sage: X = BruhatTitsQuotient(3,17)
853
+ sage: H = X.harmonic_cocycles(2,prec=10)
854
+ sage: H.rank()
855
+ 3
856
+ sage: v = H.gen(0)
857
+ sage: N = H.free_module().span([v.element()])
858
+ sage: H1 = H.submodule(N)
859
+ Traceback (most recent call last):
860
+ ...
861
+ NotImplementedError
862
+ """
863
+ # return BruhatTitsHarmonicCocyclesSubmodule(self, v)
864
+ raise NotImplementedError
865
+
866
+ def is_simple(self) -> bool:
867
+ r"""
868
+ Whether ``self`` is irreducible.
869
+
870
+ OUTPUT: boolean; ``True`` if and only if ``self`` is irreducible
871
+
872
+ EXAMPLES::
873
+
874
+ sage: X = BruhatTitsQuotient(3, 29)
875
+ sage: H = X.harmonic_cocycles(4, prec=10)
876
+ sage: H.rank()
877
+ 14
878
+ sage: H.is_simple()
879
+ False
880
+ sage: X = BruhatTitsQuotient(7, 2)
881
+ sage: H = X.harmonic_cocycles(2, prec=10)
882
+ sage: H.rank()
883
+ 1
884
+ sage: H.is_simple()
885
+ True
886
+ """
887
+ return self.rank() == 1
888
+
889
+ def _repr_(self):
890
+ r"""
891
+ This returns the representation of ``self`` as a string.
892
+
893
+ EXAMPLES::
894
+
895
+ sage: X = BruhatTitsQuotient(5,23)
896
+ sage: H = X.harmonic_cocycles(2,prec=10)
897
+ sage: H
898
+ Space of harmonic cocycles of weight 2 on Quotient of the Bruhat
899
+ Tits tree of GL_2(QQ_5) with discriminant 23 and level 1
900
+ """
901
+ return 'Space of harmonic cocycles of weight %s on %s' % (self._k,
902
+ self._X)
903
+
904
+ def _latex_(self):
905
+ r"""
906
+ A LaTeX representation of ``self``.
907
+
908
+ EXAMPLES::
909
+
910
+ sage: X = BruhatTitsQuotient(5,23)
911
+ sage: H = X.harmonic_cocycles(2,prec=10)
912
+ sage: latex(H) # indirect doctest
913
+ \text{Space of harmonic cocycles of weight } 2 \text{ on } X(5 \cdot 23,1)\otimes_{\Bold{Z}} \Bold{F}_{5}
914
+ """
915
+ s = '\\text{Space of harmonic cocycles of weight } '
916
+ s += (self._k)._latex_() + ' \\text{ on } ' + self._X._latex_()
917
+ return s
918
+
919
+ def _an_element_(self):
920
+ r"""
921
+ Return an element of the ambient space.
922
+
923
+ OUTPUT: a harmonic cocycle in self
924
+
925
+ EXAMPLES::
926
+
927
+ sage: X = BruhatTitsQuotient(5,23)
928
+ sage: H = X.harmonic_cocycles(2,prec=10)
929
+ sage: H.an_element() # indirect doctest
930
+ Harmonic cocycle with values in Sym^0 Q_5^2
931
+ """
932
+ return self.basis()[0]
933
+
934
+ def _coerce_map_from_(self, S):
935
+ r"""
936
+ Can coerce from other BruhatTitsHarmonicCocycles or from
937
+ pAdicAutomorphicForms, also from 0.
938
+
939
+ OUTPUT: boolean; ``True`` if and only if ``self`` is a space of
940
+ BruhatTitsHarmonicCocycles or pAdicAutomorphicForms
941
+
942
+ EXAMPLES::
943
+
944
+ sage: X = BruhatTitsQuotient(3,17)
945
+ sage: H = X.harmonic_cocycles(2,prec=10)
946
+ sage: A = X.padic_automorphic_forms(2,prec=10)
947
+ sage: A(H.basis()[0]) # indirect doctest
948
+ p-adic automorphic form of cohomological weight 0
949
+ """
950
+ if isinstance(S, (BruhatTitsHarmonicCocycles, pAdicAutomorphicForms)):
951
+ if S._k != self._k:
952
+ return False
953
+ return S._X == self._X
954
+ return False
955
+
956
+ def __eq__(self, other):
957
+ r"""
958
+ Test whether two BruhatTitsHarmonicCocycle spaces are equal.
959
+
960
+ INPUT:
961
+
962
+ - ``other`` -- a BruhatTitsHarmonicCocycles class
963
+
964
+ OUTPUT: boolean
965
+
966
+ EXAMPLES::
967
+
968
+ sage: X = BruhatTitsQuotient(5,7)
969
+ sage: H1 = X.harmonic_cocycles(2,prec=10)
970
+ sage: H2 = X.harmonic_cocycles(2,prec=10)
971
+ sage: H1 == H2
972
+ True
973
+ """
974
+ if not isinstance(other, BruhatTitsHarmonicCocycles):
975
+ return False
976
+
977
+ return (self.base_ring() == other.base_ring() and
978
+ self._X == other._X and
979
+ self._k == other._k)
980
+
981
+ def __ne__(self, other):
982
+ r"""
983
+ Test whether two BruhatTitsHarmonicCocycle spaces are not equal.
984
+
985
+ INPUT:
986
+
987
+ - ``other`` -- a BruhatTitsHarmonicCocycles class
988
+
989
+ OUTPUT: boolean
990
+
991
+ EXAMPLES::
992
+
993
+ sage: X = BruhatTitsQuotient(5,7)
994
+ sage: H1 = X.harmonic_cocycles(2,prec=10)
995
+ sage: H2 = X.harmonic_cocycles(2,prec=10)
996
+ sage: H1 != H2
997
+ False
998
+ """
999
+ return not self.__eq__(other)
1000
+
1001
+ def __hash__(self):
1002
+ """
1003
+ Return the hash of ``self``.
1004
+
1005
+ EXAMPLES::
1006
+
1007
+ sage: X = BruhatTitsQuotient(5,7)
1008
+ sage: H1 = X.harmonic_cocycles(2,prec=10)
1009
+ sage: H2 = X.harmonic_cocycles(2,prec=10)
1010
+ sage: hash(H1) == hash(H2)
1011
+ True
1012
+ """
1013
+ return hash((self.base_ring(), self._X, self._k))
1014
+
1015
+ def _element_constructor_(self, x):
1016
+ r"""
1017
+ Constructor for harmonic cocycles.
1018
+
1019
+ INPUT:
1020
+
1021
+ - ``x`` -- an object coercible into a harmonic cocycle
1022
+
1023
+ OUTPUT: a harmonic cocycle
1024
+
1025
+ EXAMPLES::
1026
+
1027
+ sage: X = BruhatTitsQuotient(3,17)
1028
+ sage: H = X.harmonic_cocycles(2,prec=10)
1029
+ sage: H(H.an_element()) # indirect doctest
1030
+ Harmonic cocycle with values in Sym^0 Q_3^2
1031
+ sage: H(0)
1032
+ Harmonic cocycle with values in Sym^0 Q_3^2
1033
+ """
1034
+ if type(x) is sage.modules.free_module_element.FreeModuleElement_generic_dense:
1035
+ vmat = MatrixSpace(self._R, 1, self.dimension())(x)
1036
+ tmp = (vmat * self.ambient_module().basis_matrix()).row(0)
1037
+ vec = [self._U(tmp[e * (self._k - 1):(e + 1) * (self._k - 1)])
1038
+ for e in range(len(self._E))]
1039
+ return self.element_class(self, vec)
1040
+
1041
+ if type(x) is list:
1042
+ return self.element_class(self, [self._U(o) for o in x])
1043
+
1044
+ if hasattr(x, 'parent'):
1045
+ parent = x.parent()
1046
+ if isinstance(parent, BruhatTitsHarmonicCocycles):
1047
+ return self.element_class(self, [self._U(o) for o in x._F])
1048
+ elif isinstance(parent, pAdicAutomorphicForms):
1049
+ tmp = [self._E[ii].rep * self._U(x._F[ii]) for ii in range(self._nE)]
1050
+ return self.element_class(self, tmp)
1051
+ if x == 0:
1052
+ tmp = [self._U([0] * (self.weight() - 1))] * self._X._num_edges
1053
+ return self.element_class(self, tmp)
1054
+ else:
1055
+ raise TypeError
1056
+
1057
+ def free_module(self):
1058
+ r"""
1059
+ Return the underlying free module.
1060
+
1061
+ OUTPUT: a free module
1062
+
1063
+ EXAMPLES::
1064
+
1065
+ sage: X = BruhatTitsQuotient(3,7)
1066
+ sage: H = X.harmonic_cocycles(2,prec=10)
1067
+ sage: H.free_module()
1068
+ Vector space of dimension 1 over 3-adic Field with
1069
+ capped relative precision 10
1070
+ """
1071
+ try:
1072
+ return self.__free_module
1073
+ except AttributeError:
1074
+ pass
1075
+ V = self.base_ring() ** self.dimension()
1076
+ self.__free_module = V
1077
+ return V
1078
+
1079
+ def character(self):
1080
+ r"""
1081
+ The trivial character.
1082
+
1083
+ OUTPUT: the identity map
1084
+
1085
+ EXAMPLES::
1086
+
1087
+ sage: X = BruhatTitsQuotient(3,7)
1088
+ sage: H = X.harmonic_cocycles(2,prec = 10)
1089
+ sage: f = H.character()
1090
+ sage: f(1)
1091
+ 1
1092
+ sage: f(2)
1093
+ 2
1094
+ """
1095
+ return lambda x: x
1096
+
1097
+ def embed_quaternion(self, g, scale=1, exact=None):
1098
+ r"""
1099
+ Embed the quaternion element ``g`` into the matrix algebra.
1100
+
1101
+ INPUT:
1102
+
1103
+ - ``g`` -- a quaternion, expressed as a 4x1 matrix
1104
+
1105
+ OUTPUT: a 2x2 matrix with `p`-adic entries
1106
+
1107
+ EXAMPLES::
1108
+
1109
+ sage: X = BruhatTitsQuotient(7,2)
1110
+ sage: q = X.get_stabilizers()[0][1][0]
1111
+ sage: H = X.harmonic_cocycles(2,prec = 5)
1112
+ sage: Hmat = H.embed_quaternion(q)
1113
+ sage: Hmat.matrix().trace() == X._conv(q).reduced_trace() and Hmat.matrix().determinant() == 1
1114
+ True
1115
+ """
1116
+ if exact is None:
1117
+ exact = self._R.is_exact()
1118
+ return self._Sigma0(scale * self._X.embed_quaternion(g, exact=exact,
1119
+ prec=self._prec),
1120
+ check=False)
1121
+
1122
+ def basis_matrix(self):
1123
+ r"""
1124
+ Return a basis of ``self`` in matrix form.
1125
+
1126
+ If the coefficient module `M` is of finite rank then the space
1127
+ of Gamma invariant `M` valued harmonic cocycles can be
1128
+ represented as a subspace of the finite rank space of all
1129
+ functions from the finitely many edges in the corresponding
1130
+ BruhatTitsQuotient into `M`. This function computes this
1131
+ representation of the space of cocycles.
1132
+
1133
+ OUTPUT:
1134
+
1135
+ - A basis matrix describing the cocycles in the spaced of all
1136
+ `M` valued Gamma invariant functions on the tree.
1137
+
1138
+ EXAMPLES::
1139
+
1140
+ sage: X = BruhatTitsQuotient(5,3)
1141
+ sage: M = X.harmonic_cocycles(4,prec = 20)
1142
+ sage: B = M.basis() # indirect doctest
1143
+ sage: len(B) == X.dimension_harmonic_cocycles(4)
1144
+ True
1145
+
1146
+ AUTHORS:
1147
+
1148
+ - Cameron Franc (2012-02-20)
1149
+ - Marc Masdeu (2012-02-20)
1150
+ """
1151
+ try:
1152
+ return self.__matrix
1153
+ except AttributeError:
1154
+ pass
1155
+ nV = len(self._V)
1156
+ nE = len(self._E)
1157
+ stab_conds = []
1158
+ S = self._X.get_edge_stabilizers()
1159
+ p = self._X._p
1160
+ d = self._k - 1
1161
+ for e in self._E:
1162
+ try:
1163
+ g = next(g for g in S[e.label] if g[2])
1164
+ C = self._U.acting_matrix(self._Sigma0(self.embed_quaternion(g[0])), d).transpose() # Warning - Need to allow the check = True
1165
+ C -= self._U.acting_matrix(self._Sigma0(Matrix(QQ, 2, 2, p ** g[1])), d).transpose() # Warning - Need to allow the check = True
1166
+ stab_conds.append([e.label, C])
1167
+ except StopIteration:
1168
+ pass
1169
+
1170
+ n_stab_conds = len(stab_conds)
1171
+ self._M = Matrix(self._R, (nV + n_stab_conds) * d, nE * d, 0,
1172
+ sparse=True)
1173
+ for v in self._V:
1174
+ for e in v.leaving_edges:
1175
+ if e.parity:
1176
+ continue
1177
+ C = sum([self._U.acting_matrix(self.embed_quaternion(x[0]), d)
1178
+ for x in e.links],
1179
+ Matrix(self._R, d, d, 0)).transpose()
1180
+ self._M.set_block(v.label * d, e.label * d, C)
1181
+ for e in v.entering_edges:
1182
+ if e.parity:
1183
+ continue
1184
+ C = sum([self._U.acting_matrix(self.embed_quaternion(x[0]), d)
1185
+ for x in e.opposite.links],
1186
+ Matrix(self._R, d, d, 0)).transpose()
1187
+ self._M.set_block(v.label * d, e.opposite.label * d, C)
1188
+
1189
+ for kk in range(n_stab_conds):
1190
+ v = stab_conds[kk]
1191
+ self._M.set_block((nV + kk) * d, v[0] * d, v[1])
1192
+
1193
+ x1 = self._M.right_kernel().matrix()
1194
+
1195
+ if x1.nrows() != self.rank():
1196
+ raise RuntimeError('The computed dimension does not agree with '
1197
+ 'the expectation. Consider increasing '
1198
+ 'precision!')
1199
+
1200
+ K = [c.list() for c in x1.rows()]
1201
+
1202
+ if not self._R.is_exact():
1203
+ for ii in range(len(K)):
1204
+ s = min([t.valuation() for t in K[ii]])
1205
+ for jj in range(len(K[ii])):
1206
+ K[ii][jj] = (p ** (-s)) * K[ii][jj]
1207
+
1208
+ self.__matrix = Matrix(self._R, len(K), nE * d, K)
1209
+ self.__matrix.set_immutable()
1210
+ return self.__matrix
1211
+
1212
+ def __apply_atkin_lehner(self, q, f):
1213
+ r"""
1214
+ Apply an Atkin-Lehner involution to a harmonic cocycle.
1215
+
1216
+ INPUT:
1217
+
1218
+ - ``q`` -- integer dividing the full level ``p*Nminus*Nplus``
1219
+
1220
+ - ``f`` -- a harmonic cocycle
1221
+
1222
+ OUTPUT:
1223
+
1224
+ The harmonic cocycle obtained by hitting ``f`` with the
1225
+ Atkin-Lehner at ``q``.
1226
+
1227
+ EXAMPLES::
1228
+
1229
+ sage: X = BruhatTitsQuotient(5,17)
1230
+ sage: H = X.harmonic_cocycles(2,prec = 10)
1231
+ sage: A = H.atkin_lehner_operator(5).matrix() # indirect doctest
1232
+ sage: A**2 == 1
1233
+ True
1234
+ """
1235
+ Data = self._X._get_atkin_lehner_data(q)
1236
+ p = self._X._p
1237
+ tmp = [self._U(0) for jj in range(len(self._E))]
1238
+ d1 = Data[1]
1239
+ mga = self.embed_quaternion(Data[0])
1240
+ nE = len(self._E)
1241
+ for jj in range(nE):
1242
+ t = d1[jj]
1243
+ if t.label < nE:
1244
+ tmp[jj] += mga * t.igamma(self.embed_quaternion, scale=p ** -t.power) * f._F[t.label]
1245
+ else:
1246
+ tmp[jj] += mga * t.igamma(self.embed_quaternion, scale=p ** -t.power) * (-f._F[t.label - nE])
1247
+
1248
+ return self(tmp)
1249
+
1250
+ def __apply_hecke_operator(self, l, f):
1251
+ r"""
1252
+ This function applies a Hecke operator to a harmonic cocycle.
1253
+
1254
+ INPUT:
1255
+
1256
+ - ``l`` -- integer
1257
+
1258
+ - ``f`` -- a harmonic cocycle
1259
+
1260
+ OUTPUT:
1261
+
1262
+ A harmonic cocycle which is the result of applying the `l`-th
1263
+ Hecke operator to ``f``.
1264
+
1265
+ EXAMPLES::
1266
+
1267
+ sage: X = BruhatTitsQuotient(5,17)
1268
+ sage: H = X.harmonic_cocycles(2,prec=50)
1269
+ sage: A = H.hecke_operator(7).matrix() # indirect doctest
1270
+ sage: [o.rational_reconstruction() for o in A.charpoly().coefficients()]
1271
+ [-8, -12, 12, 20, 8, 1]
1272
+ """
1273
+ HeckeData, alpha = self._X._get_hecke_data(l)
1274
+ if self.level() % l == 0:
1275
+ factor = QQ(l ** (Integer((self._k - 2) // 2)) / (l + 1))
1276
+ else:
1277
+ factor = QQ(l ** (Integer((self._k - 2) // 2)))
1278
+ p = self._X._p
1279
+ alphamat = self.embed_quaternion(alpha)
1280
+ tmp = [self._U(0) for jj in range(len(self._E))]
1281
+ for d0, d1 in HeckeData:
1282
+ mga = self.embed_quaternion(d0) * alphamat
1283
+ nE = len(self._E)
1284
+ for jj in range(nE):
1285
+ t = d1[jj]
1286
+ if t.label < nE:
1287
+ tmp[jj] += mga * t.igamma(self.embed_quaternion, scale=p ** -t.power) * f._F[t.label]
1288
+ else:
1289
+ tmp[jj] += mga * t.igamma(self.embed_quaternion, scale=p ** -t.power) * (-f._F[t.label - nE])
1290
+ return self([factor * x for x in tmp])
1291
+
1292
+ def _compute_atkin_lehner_matrix(self, d):
1293
+ r"""
1294
+ When the underlying coefficient module is finite, this
1295
+ function computes the matrix of an Atkin-Lehner involution in
1296
+ the basis provided by the function basis_matrix
1297
+
1298
+ INPUT:
1299
+
1300
+ - ``d`` -- integer dividing ``p*Nminus*Nplus``, where these
1301
+ quantities are associated to the BruhatTitsQuotient ``self._X``
1302
+
1303
+ OUTPUT:
1304
+
1305
+ The matrix of the Atkin-Lehner involution at ``d`` in the basis given by
1306
+ ``self.basis_matrix``.
1307
+
1308
+ EXAMPLES::
1309
+
1310
+ sage: X = BruhatTitsQuotient(5,13)
1311
+ sage: H = X.harmonic_cocycles(2,prec=5)
1312
+ sage: A = H.atkin_lehner_operator(5).matrix() # indirect doctest
1313
+ sage: A**2 == 1
1314
+ True
1315
+ """
1316
+ return self.__compute_operator_matrix(lambda f: self.__apply_atkin_lehner(d, f))
1317
+
1318
+ def _compute_hecke_matrix_prime(self, l):
1319
+ r"""
1320
+ When the underlying coefficient module is finite, this
1321
+ function computes the matrix of a (prime) Hecke operator in
1322
+ the basis provided by the function basis_matrix
1323
+
1324
+ INPUT:
1325
+
1326
+ - ``l`` -- prime integer
1327
+
1328
+ OUTPUT:
1329
+
1330
+ The matrix of `T_l` acting on the cocycles in the basis given by
1331
+ ``self.basis_matrix``.
1332
+
1333
+ EXAMPLES::
1334
+
1335
+ sage: X = BruhatTitsQuotient(3,11)
1336
+ sage: H = X.harmonic_cocycles(4,prec=60)
1337
+ sage: A = H.hecke_operator(7).matrix() # long time, indirect doctest
1338
+ sage: [o.rational_reconstruction() for o in A.charpoly().coefficients()] # long time
1339
+ [6496256, 1497856, -109040, -33600, -904, 32, 1]
1340
+ """
1341
+ return self.__compute_operator_matrix(lambda f: self.__apply_hecke_operator(l, f))
1342
+
1343
+ def __compute_operator_matrix(self, T):
1344
+ r"""
1345
+ Compute the matrix of the operator `T`.
1346
+
1347
+ Used primarily to compute matrices of Hecke operators
1348
+ in a streamlined way.
1349
+
1350
+ INPUT:
1351
+
1352
+ - ``T`` -- a linear function on the space of harmonic cocycles
1353
+
1354
+ OUTPUT: the matrix of ``T`` acting on the space of harmonic cocycles
1355
+
1356
+ EXAMPLES::
1357
+
1358
+ sage: X = BruhatTitsQuotient(3,17)
1359
+ sage: H = X.harmonic_cocycles(2,prec=10)
1360
+ sage: A = H.hecke_operator(11).matrix() # indirect doctest
1361
+ sage: [o.rational_reconstruction() for o in A.charpoly().coefficients()]
1362
+ [-12, -1, 4, 1]
1363
+ """
1364
+ R = self._R
1365
+ A = self.basis_matrix().transpose()
1366
+ basis = self.basis()
1367
+ B = zero_matrix(R, len(self._E) * (self._k - 1), self.dimension())
1368
+ for rr in range(len(basis)):
1369
+ g = T(basis[rr])
1370
+ B.set_block(0, rr, Matrix(R, len(self._E) * (self._k - 1), 1, [g._F[e].moment(ii) for e in range(len(self._E)) for ii in range(self._k - 1)]))
1371
+ try:
1372
+ res = (A.solve_right(B)).transpose()
1373
+ except ValueError:
1374
+ rest = (A.transpose() * A).solve_right(A.transpose() * B)
1375
+ err = A * rest - B
1376
+ if err != 0:
1377
+ try:
1378
+ if hasattr(err.parent().base_ring().an_element(),
1379
+ 'valuation'):
1380
+ minval = min([o.valuation() for o in err.list()
1381
+ if o != 0])
1382
+ else:
1383
+ minval = sum([RR(o.norm() ** 2) for o in err.list()])
1384
+ verbose('Error = %s' % minval)
1385
+ except AttributeError:
1386
+ verbose('Warning: something did not work in the computation')
1387
+ res = rest.transpose()
1388
+ res.set_immutable()
1389
+ return res
1390
+
1391
+ # class BruhatTitsHarmonicCocyclesSubmodule(BruhatTitsHarmonicCocycles,sage.modular.hecke.submodule.HeckeSubmodule):
1392
+ # r"""
1393
+ # Submodule of a space of BruhatTitsHarmonicCocycles.
1394
+ #
1395
+ # INPUT:
1396
+ #
1397
+ # - ``x`` -- integer (default: 1)
1398
+ #
1399
+ # - ``y`` -- integer (default: 2)
1400
+ #
1401
+ # EXAMPLES::
1402
+ #
1403
+ # sage: X = BruhatTitsQuotient(3,17)
1404
+ # sage: H = X.harmonic_cocycles(2,prec=10)
1405
+ # sage: N = H.free_module().span([H.an_element().element()])
1406
+ # sage: H1 = H.submodule(N) # indirect doctest
1407
+ # sage: H1
1408
+ # Subspace of Space of harmonic cocycles of weight 2 on Quotient of the Bruhat Tits tree of GL_2(QQ_3) with discriminant 17 and level 1 of dimension 1
1409
+ #
1410
+ # AUTHOR:
1411
+ #
1412
+ # - Marc Masdeu (2012-02-20)
1413
+ # """
1414
+ # def __init__(self, ambient_module, submodule, check):
1415
+ # """
1416
+ # Submodule of harmonic cocycles.
1417
+ #
1418
+ # INPUT:
1419
+ #
1420
+ # - ``ambient_module`` -- BruhatTitsHarmonicCocycles
1421
+ #
1422
+ # - ``submodule`` -- submodule of the ambient space
1423
+ #
1424
+ # - ``check`` -- boolean (default: ``False``); whether to check that the
1425
+ # submodule is Hecke equivariant
1426
+ #
1427
+ # EXAMPLES::
1428
+ #
1429
+ # sage: X = BruhatTitsQuotient(3,17)
1430
+ # sage: H = X.harmonic_cocycles(2,prec=10)
1431
+ # sage: N = H.free_module().span([H.an_element().element()])
1432
+ # sage: H1 = H.submodule(N)
1433
+ # sage: TestSuite(H1).run()
1434
+ # """
1435
+ # A = ambient_module
1436
+ # self.__rank = submodule.dimension()
1437
+ # basis_matrix = submodule.basis_matrix()*A.basis_matrix()
1438
+ # basis_matrix.set_immutable()
1439
+ # BruhatTitsHarmonicCocycles.__init__(self,A._X,A._k,A._prec,basis_matrix,A.base_ring())
1440
+ #
1441
+ # def rank(self):
1442
+ # r"""
1443
+ # Returns the rank (dimension) of the submodule.
1444
+ #
1445
+ # OUTPUT:
1446
+ #
1447
+ # Integer - The rank of ``self``.
1448
+ #
1449
+ # EXAMPLES::
1450
+ #
1451
+ # sage: X = BruhatTitsQuotient(3,17)
1452
+ # sage: H = X.harmonic_cocycles(2,prec=10)
1453
+ # sage: N = H.free_module().span([H.an_element().element()])
1454
+ # sage: H1 = H.submodule(basis = [H.an_element()])
1455
+ # sage: H1.rank()
1456
+ # 1
1457
+ # """
1458
+ # return self.__rank
1459
+ #
1460
+ # def _repr_(self):
1461
+ # r"""
1462
+ # Returns the representation of self as a string.
1463
+ #
1464
+ # OUTPUT:
1465
+ #
1466
+ # String representation of self.
1467
+ #
1468
+ # EXAMPLES::
1469
+ #
1470
+ # sage: X = BruhatTitsQuotient(3,17)
1471
+ # sage: H = X.harmonic_cocycles(2,prec=10)
1472
+ # sage: N = H.free_module().span([H.an_element().element()])
1473
+ # sage: H1=H.submodule(N)
1474
+ # sage: H1
1475
+ # Subspace of Space of harmonic cocycles of weight 2 on Quotient of the Bruhat Tits tree of GL_2(QQ_3) with discriminant 17 and level 1 of dimension 1
1476
+ # """
1477
+ # return "Subspace of %s of dimension %s"%(self.ambient(),self.dimension())
1478
+
1479
+
1480
+ class pAdicAutomorphicFormElement(ModuleElement):
1481
+ r"""
1482
+ Rudimentary implementation of a class for a `p`-adic
1483
+ automorphic form on a definite quaternion algebra over `\QQ`. These
1484
+ are required in order to compute moments of measures associated to
1485
+ harmonic cocycles on the Bruhat-Tits tree using the overconvergent modules
1486
+ of Darmon-Pollack and Matt Greenberg. See Greenberg's thesis [Gr2006]_ for
1487
+ more details.
1488
+
1489
+ INPUT:
1490
+
1491
+ - ``vec`` -- a preformatted list of data
1492
+
1493
+ EXAMPLES::
1494
+
1495
+ sage: X = BruhatTitsQuotient(17,3)
1496
+ sage: H = X.harmonic_cocycles(2,prec=10)
1497
+ sage: h = H.an_element()
1498
+ sage: HH = X.padic_automorphic_forms(2,10)
1499
+ sage: a = HH(h)
1500
+ sage: a
1501
+ p-adic automorphic form of cohomological weight 0
1502
+
1503
+ AUTHORS:
1504
+
1505
+ - Cameron Franc (2012-02-20)
1506
+ - Marc Masdeu
1507
+ """
1508
+ def __init__(self, parent, vec):
1509
+ """
1510
+ Create a pAdicAutomorphicFormElement.
1511
+
1512
+ EXAMPLES::
1513
+
1514
+ sage: X = BruhatTitsQuotient(17,3)
1515
+ sage: A = X.padic_automorphic_forms(2,prec=10)
1516
+ sage: TestSuite(A.an_element()).run()
1517
+ """
1518
+ self._num_generators = len(parent._list)
1519
+ self._cached_values = {}
1520
+ self._R = Qp(parent.prime(), prec=parent._prec)
1521
+ self._value = [parent._U(v) for v in vec]
1522
+ ModuleElement.__init__(self, parent)
1523
+
1524
+ def _add_(self, g):
1525
+ r"""
1526
+ This function adds two `p`-adic automorphic forms.
1527
+
1528
+ INPUT:
1529
+
1530
+ - ``g`` -- a `p`-adic automorphic form
1531
+
1532
+ OUTPUT: the result of adding ``g`` to ``self``
1533
+
1534
+ EXAMPLES::
1535
+
1536
+ sage: X = BruhatTitsQuotient(17,3)
1537
+ sage: A = X.padic_automorphic_forms(2,prec=10)
1538
+ sage: a = A.an_element()
1539
+ sage: b = a + a # indirect doctest
1540
+ """
1541
+ # Should ensure that self and g are of the same weight and on
1542
+ # the same curve
1543
+ vec = [self._value[e] + g._value[e]
1544
+ for e in range(self._num_generators)]
1545
+ return self.parent()(vec)
1546
+
1547
+ def _sub_(self, g):
1548
+ r"""
1549
+ This function subtracts a `p`-adic automorphic form from another.
1550
+
1551
+ INPUT:
1552
+
1553
+ - ``g`` -- a `p`-adic automorphic form
1554
+
1555
+ OUTPUT: the result of subtracting ``g`` from ``self``
1556
+
1557
+ EXAMPLES::
1558
+
1559
+ sage: X = BruhatTitsQuotient(17,3)
1560
+ sage: A = X.padic_automorphic_forms(2,prec=10)
1561
+ sage: a = A.an_element()
1562
+ sage: b = a - a # indirect doctest
1563
+ sage: b == 0
1564
+ True
1565
+ """
1566
+ # Should ensure that self and g are of the same weight and on
1567
+ # the same curve
1568
+ vec = [self._value[e] - g._value[e]
1569
+ for e in range(self._num_generators)]
1570
+ return self.parent()(vec)
1571
+
1572
+ def _richcmp_(self, other, op):
1573
+ r"""
1574
+ Test for equality of pAdicAutomorphicForm elements.
1575
+
1576
+ INPUT:
1577
+
1578
+ - ``other`` -- another `p`-automorphic form
1579
+
1580
+ EXAMPLES::
1581
+
1582
+ sage: X = BruhatTitsQuotient(5,23)
1583
+ sage: H = X.harmonic_cocycles(2,prec=10)
1584
+ sage: A = X.padic_automorphic_forms(2,prec=10)
1585
+ sage: v1 = A(H.basis()[0])
1586
+ sage: v2 = 3*v1
1587
+ sage: 2*v1 == v2-v1 # indirect doctest
1588
+ True
1589
+ """
1590
+ if op not in [op_EQ, op_NE]:
1591
+ return NotImplemented
1592
+
1593
+ b = all(self._value[e] == other._value[e]
1594
+ for e in range(self._num_generators))
1595
+ if op == op_EQ:
1596
+ return b
1597
+ return not b
1598
+
1599
+ def __bool__(self):
1600
+ """
1601
+ Tell whether the form is zero or not.
1602
+
1603
+ OUTPUT: boolean; whether ``self`` is zero
1604
+
1605
+ EXAMPLES::
1606
+
1607
+ sage: X = BruhatTitsQuotient(5,23)
1608
+ sage: H = X.harmonic_cocycles(4,prec = 20)
1609
+ sage: A = X.padic_automorphic_forms(4,prec = 20)
1610
+ sage: v1 = A(H.basis()[1])
1611
+ sage: bool(v1)
1612
+ True
1613
+ sage: v2 = v1-v1
1614
+ sage: bool(v2)
1615
+ False
1616
+ """
1617
+ return any(not o.is_zero() for o in self._value)
1618
+
1619
+ def __getitem__(self, e1):
1620
+ r"""
1621
+ Evaluate a `p`-adic automorphic form on a matrix in `GL_2(\QQ_p)`.
1622
+
1623
+ INPUT:
1624
+
1625
+ - ``e1`` -- a matrix in `GL_2(\QQ_p)`
1626
+
1627
+ OUTPUT: the value of ``self`` evaluated on ``e1``
1628
+
1629
+ EXAMPLES::
1630
+
1631
+ sage: X = BruhatTitsQuotient(17,3)
1632
+ sage: M = X.harmonic_cocycles(2,prec=5)
1633
+ sage: A = X.padic_automorphic_forms(2,prec=5)
1634
+ sage: a = A(M.gen(0))
1635
+ sage: a[Matrix(ZZ,2,2,[1,2,3,4])]
1636
+ 8 + 8*17 + 8*17^2 + 8*17^3 + 8*17^4 + O(17^5)
1637
+ """
1638
+ return self.evaluate(e1)
1639
+
1640
+ def evaluate(self, e1):
1641
+ r"""
1642
+ Evaluate a `p`-adic automorphic form on a matrix in `GL_2(\QQ_p)`.
1643
+
1644
+ INPUT:
1645
+
1646
+ - ``e1`` -- a matrix in `GL_2(\QQ_p)`
1647
+
1648
+ OUTPUT: the value of ``self`` evaluated on ``e1``
1649
+
1650
+ EXAMPLES::
1651
+
1652
+ sage: X = BruhatTitsQuotient(7,5)
1653
+ sage: M = X.harmonic_cocycles(2,prec=5)
1654
+ sage: A = X.padic_automorphic_forms(2,prec=5)
1655
+ sage: a = A(M.basis()[0])
1656
+ sage: a.evaluate(Matrix(ZZ,2,2,[1,2,3,1]))
1657
+ 4 + 6*7 + 6*7^2 + 6*7^3 + 6*7^4 + O(7^5)
1658
+ sage: a.evaluate(Matrix(ZZ,2,2,[17,0,0,1]))
1659
+ 1 + O(7^5)
1660
+ """
1661
+ X = self.parent()._source
1662
+ p = self.parent().prime()
1663
+ u = DoubleCosetReduction(X, e1)
1664
+ tmp = ((u.t(self.parent()._U.base_ring().precision_cap())) * p ** (u.power)).adjugate()
1665
+ S0 = self.parent()._Sigma0
1666
+ return S0(tmp, check=False) * self._value[u.label]
1667
+ # Warning! Should remove check=False...
1668
+
1669
+ def _lmul_(self, a):
1670
+ r"""
1671
+ Multiply the automorphic form by a scalar.
1672
+
1673
+ INPUT:
1674
+
1675
+ - ``a`` -- a scalar
1676
+
1677
+ EXAMPLES::
1678
+
1679
+ sage: X = BruhatTitsQuotient(17,3)
1680
+ sage: M = X.harmonic_cocycles(2,prec=5)
1681
+ sage: A = X.padic_automorphic_forms(2,prec=5)
1682
+ sage: a = A(M.basis()[0])
1683
+ sage: a.evaluate(Matrix(ZZ,2,2,[1,2,3,4]))
1684
+ 8 + 8*17 + 8*17^2 + 8*17^3 + 8*17^4 + O(17^5)
1685
+ sage: b = 2*a # indirect doctest
1686
+ sage: b.evaluate(Matrix(ZZ,2,2,[1,2,3,4]))
1687
+ 16 + 16*17 + 16*17^2 + 16*17^3 + 16*17^4 + O(17^5)
1688
+ """
1689
+ # Should ensure that 'a' is a scalar
1690
+ return self.parent()([a * self._value[e]
1691
+ for e in range(self._num_generators)])
1692
+
1693
+ def _repr_(self):
1694
+ r"""
1695
+ This returns the representation of ``self`` as a string.
1696
+
1697
+ If ``self`` corresponds to a modular form of weight `k`, then the
1698
+ cohomological weight is `k-2`.
1699
+
1700
+ EXAMPLES::
1701
+
1702
+ sage: X = BruhatTitsQuotient(17,3)
1703
+ sage: A = X.padic_automorphic_forms(2,prec=10)
1704
+ sage: a = A.an_element()
1705
+ sage: a # indirect doctest
1706
+ p-adic automorphic form of cohomological weight 0
1707
+ """
1708
+ return 'p-adic automorphic form of cohomological weight %s' % self.parent()._U.weight()
1709
+
1710
+ def valuation(self):
1711
+ r"""
1712
+ The valuation of ``self``, defined as the minimum of the
1713
+ valuations of the values that it takes on a set of edge
1714
+ representatives.
1715
+
1716
+ OUTPUT: integer
1717
+
1718
+ EXAMPLES::
1719
+
1720
+ sage: X = BruhatTitsQuotient(17,3)
1721
+ sage: M = X.harmonic_cocycles(2,prec=10)
1722
+ sage: A = X.padic_automorphic_forms(2,prec=10)
1723
+ sage: a = A(M.gen(0))
1724
+ sage: a.valuation()
1725
+ 0
1726
+ sage: (17*a).valuation()
1727
+ 1
1728
+ """
1729
+ return min(self._value[e].valuation()
1730
+ for e in range(self._num_generators))
1731
+
1732
+ def _improve(self, hc):
1733
+ r"""
1734
+ Repeatedly apply the `U_p` operator to a `p`-adic
1735
+ automorphic form. This is used to compute moments of a measure
1736
+ associated to a rigid modular form in the following way: lift
1737
+ a rigid modular form to an overconvergent `p`-adic
1738
+ automorphic form in any way, and then repeatedly apply `U_p`
1739
+ to project to the ordinary part. The resulting form encodes
1740
+ the moments of the measure of the original rigid modular form
1741
+ (assuming it is ordinary).
1742
+
1743
+ EXAMPLES::
1744
+
1745
+ sage: X = BruhatTitsQuotient(7,2)
1746
+ sage: H = X.harmonic_cocycles(2,prec = 10)
1747
+ sage: h = H.gen(0)
1748
+ sage: A = X.padic_automorphic_forms(2,prec = 10,overconvergent=True)
1749
+ sage: a = A.lift(h) # indirect doctest
1750
+
1751
+ REFERENCES:
1752
+
1753
+ For details see [Gr2006]_. Alternatively, one can look at
1754
+ [DP]_ for the analogous algorithm in the case of modular symbols.
1755
+
1756
+ AUTHORS:
1757
+
1758
+ - Cameron Franc (2012-02-20)
1759
+ - Marc Masdeu
1760
+ """
1761
+ MMM = self.parent()
1762
+ U = MMM._U
1763
+
1764
+ h1 = MMM([o.lift(M=MMM.precision_cap()) for o in self._value])
1765
+ h2 = MMM._apply_Up_operator(h1, True)
1766
+ verbose("Applied Up once")
1767
+ ii = 0
1768
+ current_val = 0
1769
+ init_val = self.valuation()
1770
+ old_val = init_val - 1
1771
+ while current_val > old_val:
1772
+ old_val = current_val
1773
+ ii += 1
1774
+ h1._value = [U(c) for c in h2._value]
1775
+ h2 = MMM._apply_Up_operator(h1, True)
1776
+ current_val = (h2 - h1).valuation() - init_val
1777
+ verbose('val = %s' % current_val)
1778
+ if current_val is Infinity:
1779
+ break
1780
+ verbose('Applied Up %s times' % (ii + 1))
1781
+ return h2
1782
+
1783
+ def integrate(self, f, center=1, level=0, method='moments'):
1784
+ r"""
1785
+ Calculate
1786
+
1787
+ .. MATH::
1788
+
1789
+ \int_{\mathbf{P}^1(\QQ_p)} f(x)d\mu(x)
1790
+
1791
+ were `\mu` is the measure associated to ``self``.
1792
+
1793
+ INPUT:
1794
+
1795
+ - ``f`` -- an analytic function
1796
+
1797
+ - ``center`` -- 2x2 matrix over `\QQ_p` (default: 1)
1798
+
1799
+ - ``level`` -- integer (default: 0)
1800
+
1801
+ - ``method`` -- string (default: ``'moments'``); which method of
1802
+ integration to use. Either ``'moments'`` or ``'riemann_sum'``.
1803
+
1804
+ EXAMPLES:
1805
+
1806
+ Integrating the Poisson kernel against a measure yields a
1807
+ value of the associated modular form. Such values can be
1808
+ computed efficiently using the overconvergent method, as long
1809
+ as one starts with an ordinary form::
1810
+
1811
+ sage: X = BruhatTitsQuotient(7,2)
1812
+ sage: X.genus()
1813
+ 1
1814
+
1815
+ Since the genus is 1, the space of weight 2 forms is 1
1816
+ dimensional. Hence any nonzero form will be a `U_7`
1817
+ eigenvector. By Jacquet-Langlands and Cerednik-Drinfeld, in
1818
+ this case the Hecke eigenvalues correspond to that of any
1819
+ nonzero form on `\Gamma_0(14)` of weight `2`. Such a form is
1820
+ ordinary at `7`, and so we can apply the overconvergent method
1821
+ directly to this form without `p`-stabilizing::
1822
+
1823
+ sage: H = X.harmonic_cocycles(2,prec = 5)
1824
+ sage: h = H.gen(0)
1825
+ sage: A = X.padic_automorphic_forms(2,prec = 5,overconvergent=True)
1826
+ sage: a = A.lift(h)
1827
+ sage: a._value[0].moment(2)
1828
+ 2 + 6*7 + 4*7^2 + 4*7^3 + 6*7^4 + O(7^5)
1829
+
1830
+ Now that we've lifted our harmonic cocycle to an
1831
+ overconvergent automorphic form we simply need to define the
1832
+ Teitelbaum-Poisson Kernel, and then integrate::
1833
+
1834
+ sage: Kp.<x> = Qq(49,prec = 5)
1835
+ sage: z = Kp['z'].gen()
1836
+ sage: f = 1/(z-x)
1837
+ sage: a.integrate(f)
1838
+ (5*x + 5) + (4*x + 4)*7 + (5*x + 5)*7^2 + (5*x + 6)*7^3 + O(7^5)
1839
+
1840
+ AUTHORS:
1841
+
1842
+ - Cameron Franc (2012-02-20)
1843
+ - Marc Masdeu (2012-02-20)
1844
+ """
1845
+ E = self.parent()._source._BT.get_balls(center, level)
1846
+ R1 = LaurentSeriesRing(f.base_ring(), 'r1', default_prec=self.parent()._U.base_ring().precision_cap() + 1)
1847
+ R2 = PolynomialRing(f.base_ring(), 'x')
1848
+ x = R2.gen()
1849
+ value = 0
1850
+ if method == 'riemann_sum':
1851
+ for e in E:
1852
+ exp = ((R1([e[1, 1], e[1, 0]])) ** (self.parent()._U.weight()) * e.determinant() ** (-(self.parent()._U.weight()) / 2)) * f(R1([e[0, 1], e[0, 0]]) / R1([e[1, 1], e[1, 0]]))
1853
+ new = eval_dist_at_powseries(self.evaluate(e), exp.truncate(self.parent()._U.weight() + 1))
1854
+ value += new
1855
+ elif method == 'moments':
1856
+ n = self.parent()._U.weight()
1857
+ for e in E:
1858
+ a, b, c, d = e.list()
1859
+ delta = e.determinant()
1860
+ verbose('%s' % (R2([e[0, 1], e[0, 0]])
1861
+ / R2([e[1, 1], e[1, 0]])))
1862
+ tmp = ((c * x + d) ** n * delta ** -ZZ(n // 2)) * f((a * x + b) / (c * x + d))
1863
+ exp = R1(tmp.numerator()) / R1(tmp.denominator())
1864
+ new = eval_dist_at_powseries(self.evaluate(e), exp)
1865
+
1866
+ value += new
1867
+ else:
1868
+ print('The available methods are either "moments" or "riemann_sum". The latter is only provided for consistency check, and should never be used.')
1869
+ return False
1870
+ return value
1871
+
1872
+ def modular_form(self, z=None, level=0, method='moments'):
1873
+ r"""
1874
+ Return the modular form corresponding to ``self``.
1875
+
1876
+ INPUT:
1877
+
1878
+ - ``z`` -- (default: ``None``) if specified, returns the value of
1879
+ the form at the point ``z`` in the `p`-adic upper half
1880
+ plane
1881
+
1882
+ - ``level`` -- integer (default: 0); if ``method`` is
1883
+ 'riemann_sum', will use a covering of `P^1(\QQ_p)` with
1884
+ balls of size `p^-\mbox{level}`
1885
+
1886
+ - ``method`` -- string (default: ``'moments'``); it must be
1887
+ either ``'moments'`` or ``'riemann_sum'``
1888
+
1889
+ OUTPUT:
1890
+
1891
+ A function from the `p`-adic upper half plane to `\CC_p`. If
1892
+ an argument ``z`` was passed, returns instead the value at
1893
+ that point.
1894
+
1895
+ EXAMPLES:
1896
+
1897
+ Integrating the Poisson kernel against a measure yields a
1898
+ value of the associated modular form. Such values can be
1899
+ computed efficiently using the overconvergent method, as long
1900
+ as one starts with an ordinary form::
1901
+
1902
+ sage: X = BruhatTitsQuotient(7, 2)
1903
+ sage: X.genus()
1904
+ 1
1905
+
1906
+ Since the genus is 1, the space of weight 2 forms is 1
1907
+ dimensional. Hence any nonzero form will be a `U_7`
1908
+ eigenvector. By Jacquet-Langlands and Cerednik-Drinfeld, in
1909
+ this case the Hecke eigenvalues correspond to that of any
1910
+ nonzero form on `\Gamma_0(14)` of weight `2`. Such a form is
1911
+ ordinary at `7`, and so we can apply the overconvergent method
1912
+ directly to this form without `p`-stabilizing::
1913
+
1914
+ sage: H = X.harmonic_cocycles(2,prec = 5)
1915
+ sage: A = X.padic_automorphic_forms(2,prec = 5,overconvergent=True)
1916
+ sage: f0 = A.lift(H.basis()[0])
1917
+
1918
+ Now that we've lifted our harmonic cocycle to an
1919
+ overconvergent automorphic form, we extract the associated
1920
+ modular form as a function and test the modular property::
1921
+
1922
+ sage: T.<x> = Qq(7^2,prec = 5)
1923
+ sage: f = f0.modular_form(method = 'moments')
1924
+ sage: a,b,c,d = X.embed_quaternion(X.get_units_of_order()[1]).change_ring(T.base_ring()).list()
1925
+ sage: ((c*x + d)^2*f(x)-f((a*x + b)/(c*x + d))).valuation()
1926
+ 5
1927
+ """
1928
+ return self.derivative(z, level, method, order=0)
1929
+
1930
+ def derivative(self, z=None, level=0, method='moments', order=1):
1931
+ r"""
1932
+ Return the derivative of the modular form corresponding to
1933
+ ``self``.
1934
+
1935
+ INPUT:
1936
+
1937
+ - ``z`` -- (default: ``None``) if specified, evaluates the derivative
1938
+ at the point ``z`` in the `p`-adic upper half plane
1939
+
1940
+ - ``level`` -- integer (default: 0); if ``method`` is
1941
+ 'riemann_sum', will use a covering of `P^1(\QQ_p)` with
1942
+ balls of size `p^-\mbox{level}`.
1943
+
1944
+ - ``method`` -- string (default: ``'moments'``); it must be
1945
+ either ``'moments'`` or ``'riemann_sum'``
1946
+
1947
+ - ``order`` -- integer (default: 1); the order of the
1948
+ derivative to be computed
1949
+
1950
+ OUTPUT:
1951
+
1952
+ A function from the `p`-adic upper half plane to `\CC_p`. If
1953
+ an argument ``z`` was passed, returns instead the value of
1954
+ the derivative at that point.
1955
+
1956
+ EXAMPLES:
1957
+
1958
+ Integrating the Poisson kernel against a measure yields a
1959
+ value of the associated modular form. Such values can be
1960
+ computed efficiently using the overconvergent method, as long
1961
+ as one starts with an ordinary form::
1962
+
1963
+ sage: X = BruhatTitsQuotient(7, 2)
1964
+ sage: X.genus()
1965
+ 1
1966
+
1967
+ Since the genus is 1, the space of weight 2 forms is 1
1968
+ dimensional. Hence any nonzero form will be a `U_7`
1969
+ eigenvector. By Jacquet-Langlands and Cerednik-Drinfeld, in
1970
+ this case the Hecke eigenvalues correspond to that of any
1971
+ nonzero form on `\Gamma_0(14)` of weight `2`. Such a form is
1972
+ ordinary at `7`, and so we can apply the overconvergent method
1973
+ directly to this form without `p`-stabilizing::
1974
+
1975
+ sage: H = X.harmonic_cocycles(2,prec=5)
1976
+ sage: h = H.gen(0)
1977
+ sage: A = X.padic_automorphic_forms(2,prec=5,overconvergent=True)
1978
+ sage: f0 = A.lift(h)
1979
+
1980
+ Now that we've lifted our harmonic cocycle to an
1981
+ overconvergent automorphic form, we extract the associated
1982
+ modular form as a function and test the modular property::
1983
+
1984
+ sage: T.<x> = Qq(49,prec=10)
1985
+ sage: f = f0.modular_form()
1986
+ sage: g = X.get_embedding_matrix()*X.get_units_of_order()[1]
1987
+ sage: a,b,c,d = g.change_ring(T).list()
1988
+ sage: (c*x +d)^2*f(x)-f((a*x + b)/(c*x + d))
1989
+ O(7^5)
1990
+
1991
+ We can also compute the Shimura-Maass derivative, which is a
1992
+ nearly rigid analytic modular forms of weight 4::
1993
+
1994
+ sage: f = f0.derivative()
1995
+ sage: (c*x + d)^4*f(x)-f((a*x + b)/(c*x + d))
1996
+ O(7^5)
1997
+ """
1998
+ def F(z, level=level, method=method):
1999
+ R = PolynomialRing(z.parent(), 'x,y').fraction_field()
2000
+ Rx = PolynomialRing(z.parent(), 'x1').fraction_field()
2001
+ x1 = Rx.gen()
2002
+ subst = R.hom([x1, z], codomain=Rx)
2003
+ x, y = R.gens()
2004
+ center = self.parent()._source._BT.find_containing_affinoid(z)
2005
+ zbar = z.trace() - z
2006
+ f = R(1) / (x - y)
2007
+ k = self.parent()._n + 2
2008
+ V = [f]
2009
+ for ii in range(order):
2010
+ V = [v.derivative(y) for v in V] + [k / (y - zbar) * v
2011
+ for v in V]
2012
+ k += 2
2013
+ return sum(self.integrate(subst(v), center, level, method)
2014
+ for v in V)
2015
+ if z is None:
2016
+ return F
2017
+
2018
+ return F(z, level, method)
2019
+
2020
+ # So far we cannot break it into two integrals because of the pole
2021
+ # at infinity.
2022
+ def coleman(self, t1, t2, E=None, method='moments', mult=False):
2023
+ r"""
2024
+ If ``self`` is a `p`-adic automorphic form that
2025
+ corresponds to a rigid modular form, then this computes the
2026
+ Coleman integral of this form between two points on the
2027
+ boundary `P^1(\QQ_p)` of the `p`-adic upper half plane.
2028
+
2029
+ INPUT:
2030
+
2031
+ - ``t1``, ``t2`` -- elements of `P^1(\QQ_p)` (the endpoints
2032
+ of integration)
2033
+
2034
+ - ``E`` -- (default: ``None``) if specified, will not compute the
2035
+ covering adapted to ``t1`` and ``t2`` and instead use the
2036
+ given one. In that case, ``E`` should be a list of matrices
2037
+ corresponding to edges describing the open balls to be
2038
+ considered.
2039
+
2040
+ - ``method`` -- string (default: ``'moments'``); tells which
2041
+ algorithm to use (alternative is ``'riemann_sum'``, which is
2042
+ unsuitable for computations requiring high precision)
2043
+
2044
+ - ``mult`` -- boolean (default: ``False``); whether to compute the
2045
+ multiplicative version
2046
+
2047
+ OUTPUT: the result of the Coleman integral
2048
+
2049
+ EXAMPLES::
2050
+
2051
+ sage: p = 7
2052
+ sage: lev = 2
2053
+ sage: prec = 10
2054
+ sage: X = BruhatTitsQuotient(p, lev)
2055
+ sage: k = 2
2056
+ sage: M = X.harmonic_cocycles(k, prec)
2057
+ sage: B = M.basis()
2058
+ sage: f = 3*B[0]
2059
+ sage: MM = X.padic_automorphic_forms(k, prec, overconvergent=True)
2060
+ sage: D = -11
2061
+ sage: X.is_admissible(D)
2062
+ True
2063
+ sage: K.<a> = QuadraticField(D)
2064
+ sage: Kp.<g> = Qq(p**2, prec)
2065
+ sage: P = Kp.gen()
2066
+ sage: Q = 2 + Kp.gen() + p*(Kp.gen()+1)
2067
+ sage: F = MM.lift(f) # long time
2068
+ sage: J0 = F.coleman(P, Q, mult=True) # long time
2069
+
2070
+ AUTHORS:
2071
+
2072
+ - Cameron Franc (2012-02-20)
2073
+ - Marc Masdeu (2012-02-20)
2074
+ """
2075
+ p = self.parent().prime()
2076
+ K = t1.parent()
2077
+ R = PolynomialRing(K, 'x')
2078
+ x = R.gen()
2079
+ R1 = LaurentSeriesRing(K, 'r1', default_prec=self.parent()._U.base_ring().precision_cap())
2080
+ if E is None:
2081
+ E = self.parent()._source._BT.find_covering(t1, t2)
2082
+ value = 0
2083
+ value_exp = K(1)
2084
+ if method == 'riemann_sum':
2085
+ for e in E:
2086
+ b = e[0, 1]
2087
+ d = e[1, 1]
2088
+ y = (b - d * t1) / (b - d * t2)
2089
+ poly = R1(y.log())
2090
+ c_e = self.evaluate(e)
2091
+ new = eval_dist_at_powseries(c_e, poly)
2092
+ value += new
2093
+ if mult:
2094
+ value_exp *= K.teichmuller(y) ** Integer(c_e.moment(0).rational_reconstruction())
2095
+
2096
+ elif method == 'moments':
2097
+ for e in E:
2098
+ f = (x - t1) / (x - t2)
2099
+ a, b, c, d = e.list()
2100
+ y0 = f(R1([b, a]) / R1([d, c])) # f( (ax+b)/(cx+d) )
2101
+ y0 = p ** (-y0(ZZ(0)).valuation()) * y0
2102
+ mu = K.teichmuller(y0(ZZ(0)))
2103
+ y = y0 / mu - 1
2104
+ poly = R1(0)
2105
+ ypow = y
2106
+ for jj in range(1, R1.default_prec() + 10):
2107
+ poly += (-1) ** (jj + 1) * ypow / jj
2108
+ ypow *= y
2109
+ c_e = self.evaluate(e)
2110
+ new = eval_dist_at_powseries(c_e, poly)
2111
+ if hasattr(new, 'degree'):
2112
+ assert 0
2113
+ value += new
2114
+ if mult:
2115
+ value_exp *= K.teichmuller((b - d * t1) / (b - d * t2)) ** Integer(c_e.moment(0).rational_reconstruction())
2116
+
2117
+ else:
2118
+ print('The available methods are either "moments" or "riemann_sum". The latter is only provided for consistency check, and should not be used in practice.')
2119
+ return False
2120
+ if mult:
2121
+ return K.teichmuller(value_exp) * value.exp()
2122
+ return value
2123
+
2124
+
2125
+ class pAdicAutomorphicForms(Module, UniqueRepresentation):
2126
+ Element = pAdicAutomorphicFormElement
2127
+
2128
+ @staticmethod
2129
+ def __classcall__(cls, domain, U, prec=None, t=None, R=None,
2130
+ overconvergent=False):
2131
+ r"""
2132
+ The module of (quaternionic) `p`-adic automorphic forms.
2133
+
2134
+ INPUT:
2135
+
2136
+ - ``domain`` -- a BruhatTitsQuotient
2137
+
2138
+ - ``U`` -- a distributions module or an integer. If ``U`` is a
2139
+ distributions module then this creates the relevant space of
2140
+ automorphic forms. If ``U`` is an integer then the coefficients
2141
+ are the (`U-2`)nd power of the symmetric representation of
2142
+ `GL_2(\QQ_p)`.
2143
+
2144
+ - ``prec`` -- a precision (default: ``None``); if not ``None`` should
2145
+ be a positive integer
2146
+
2147
+ - ``t`` -- (default: ``None``) the number of additional moments to
2148
+ store. If ``None``, determine it automatically from ``prec``, ``U``
2149
+ and the ``overconvergent`` flag.
2150
+
2151
+ - ``R`` -- (default: ``None``) if specified, coefficient field of the automorphic forms.
2152
+ If not specified it defaults to the base ring of the distributions ``U``, or to `Q_p`
2153
+ with the working precision ``prec``.
2154
+
2155
+ - ``overconvergent`` -- boolean (default: ``False``); if ``True``, will construct overconvergent
2156
+ `p`-adic automorphic forms. Otherwise it constructs the finite dimensional space of
2157
+ `p`-adic automorphic forms which is isomorphic to the space of harmonic cocycles.
2158
+
2159
+ EXAMPLES:
2160
+
2161
+ The space of weight 2 p-automorphic forms is isomorphic with
2162
+ the space of scalar valued invariant harmonic cocycles::
2163
+
2164
+ sage: X = BruhatTitsQuotient(11,5)
2165
+ sage: H0 = X.padic_automorphic_forms(2,10)
2166
+ sage: H1 = X.padic_automorphic_forms(2,prec = 10)
2167
+ sage: H0 == H1
2168
+ True
2169
+
2170
+ AUTHORS:
2171
+
2172
+ - Cameron Franc (2012-02-20)
2173
+ - Marc Masdeu (2012-02-20)
2174
+ """
2175
+ return super().__classcall__(cls, domain, U,
2176
+ prec, t, R,
2177
+ overconvergent)
2178
+
2179
+ def __init__(self, domain, U, prec=None, t=None, R=None,
2180
+ overconvergent=False):
2181
+ """
2182
+ Create a space of `p`-automorphic forms.
2183
+
2184
+ EXAMPLES::
2185
+
2186
+ sage: X = BruhatTitsQuotient(11,5)
2187
+ sage: H = X.harmonic_cocycles(2,prec=10)
2188
+ sage: A = X.padic_automorphic_forms(2,prec=10)
2189
+ sage: TestSuite(A).run()
2190
+ """
2191
+ if R is None:
2192
+ if not isinstance(U, Integer):
2193
+ self._R = U.base_ring()
2194
+ else:
2195
+ if prec is None:
2196
+ prec = 100
2197
+ self._R = Qp(domain._p, prec)
2198
+ else:
2199
+ self._R = R
2200
+ # U is a CoefficientModuleSpace
2201
+ if isinstance(U, Integer):
2202
+ if t is None:
2203
+ if overconvergent:
2204
+ t = prec - U + 1
2205
+ else:
2206
+ t = 0
2207
+ if overconvergent:
2208
+ self._U = OverconvergentDistributions(U - 2, base=self._R,
2209
+ prec_cap=U - 1 + t,
2210
+ act_on_left=True,
2211
+ adjuster=_btquot_adjuster(),
2212
+ dettwist=-ZZ((U - 2) // 2),
2213
+ act_padic=True)
2214
+ else:
2215
+ self._U = Symk(U - 2, base=self._R, act_on_left=True,
2216
+ adjuster=_btquot_adjuster(),
2217
+ dettwist=-ZZ((U - 2) // 2),
2218
+ act_padic=True)
2219
+ else:
2220
+ self._U = U
2221
+ self._source = domain
2222
+ self._list = self._source.get_list() # Contains also the opposite edges
2223
+ self._prec = self._R.precision_cap()
2224
+ self._n = self._U.weight()
2225
+ self._p = self._source._p
2226
+
2227
+ self._Sigma0 = self._U._act._Sigma0
2228
+
2229
+ Module.__init__(self, base=self._R)
2230
+ self._populate_coercion_lists_()
2231
+
2232
+ def prime(self):
2233
+ """
2234
+ Return the underlying prime.
2235
+
2236
+ OUTPUT: ``p`` -- prime integer
2237
+
2238
+ EXAMPLES::
2239
+
2240
+ sage: X = BruhatTitsQuotient(11,5)
2241
+ sage: H = X.harmonic_cocycles(2,prec = 10)
2242
+ sage: A = X.padic_automorphic_forms(2,prec = 10)
2243
+ sage: A.prime()
2244
+ 11
2245
+ """
2246
+ return self._p
2247
+
2248
+ def zero(self):
2249
+ r"""
2250
+ Return the zero element of ``self``.
2251
+
2252
+ EXAMPLES::
2253
+
2254
+ sage: X = BruhatTitsQuotient(5, 7)
2255
+ sage: H1 = X.padic_automorphic_forms( 2, prec=10)
2256
+ sage: H1.zero() == 0
2257
+ True
2258
+ """
2259
+ return self.element_class(self, [self._U(0) for o in self._list])
2260
+
2261
+ def __eq__(self, other):
2262
+ r"""
2263
+ Test whether two pAdicAutomorphicForm spaces are equal.
2264
+
2265
+ INPUT:
2266
+
2267
+ - ``other`` -- another space of `p`-automorphic forms
2268
+
2269
+ OUTPUT: boolean
2270
+
2271
+ EXAMPLES::
2272
+
2273
+ sage: X = BruhatTitsQuotient(5,7)
2274
+ sage: H1 = X.padic_automorphic_forms(2,prec = 10)
2275
+ sage: H2 = X.padic_automorphic_forms(2,prec = 10)
2276
+ sage: H1 == H2
2277
+ True
2278
+ """
2279
+ if not isinstance(other, pAdicAutomorphicForms):
2280
+ return False
2281
+
2282
+ return (self.base_ring() == other.base_ring() and
2283
+ self._source == other._source and
2284
+ self._U == other._U)
2285
+
2286
+ def __ne__(self, other):
2287
+ r"""
2288
+ Test whether two pAdicAutomorphicForm spaces are not equal.
2289
+
2290
+ INPUT:
2291
+
2292
+ - ``other`` -- another space of `p`-automorphic forms
2293
+
2294
+ OUTPUT: boolean
2295
+
2296
+ EXAMPLES::
2297
+
2298
+ sage: X = BruhatTitsQuotient(5,7)
2299
+ sage: H1 = X.padic_automorphic_forms(2,prec = 10)
2300
+ sage: H2 = X.padic_automorphic_forms(2,prec = 10)
2301
+ sage: H1 == H2
2302
+ True
2303
+ """
2304
+ return not self.__eq__(other)
2305
+
2306
+ def __hash__(self):
2307
+ """
2308
+ Return the hash of ``self``.
2309
+
2310
+ EXAMPLES::
2311
+
2312
+ sage: X = BruhatTitsQuotient(5,7)
2313
+ sage: H1 = X.padic_automorphic_forms(2,prec = 10)
2314
+ sage: H2 = X.padic_automorphic_forms(2,prec = 10)
2315
+ sage: hash(H1) == hash(H2)
2316
+ True
2317
+ """
2318
+ return hash((self.base_ring(), self._source, self._U))
2319
+
2320
+ def _repr_(self):
2321
+ r"""
2322
+ Return the representation of ``self`` as a string.
2323
+
2324
+ EXAMPLES::
2325
+
2326
+ sage: X = BruhatTitsQuotient(3,7)
2327
+ sage: A = X.padic_automorphic_forms(2,prec = 10)
2328
+ sage: A # indirect doctest
2329
+ Space of automorphic forms on Quotient of the Bruhat Tits tree of GL_2(QQ_3) with discriminant 7 and level 1 with values in Sym^0 Q_3^2
2330
+ """
2331
+ s = 'Space of automorphic forms on '
2332
+ s += str(self._source)
2333
+ s += ' with values in ' + str(self._U)
2334
+ return s
2335
+
2336
+ def _coerce_map_from_(self, S):
2337
+ r"""
2338
+ Can coerce from other BruhatTitsHarmonicCocycles or from pAdicAutomorphicForms.
2339
+
2340
+ INPUT:
2341
+
2342
+ - ``S`` -- a BruhatTitsHarmonicCocycle or pAdicAutomorphicForm
2343
+
2344
+ OUTPUT: boolean; ``True`` if and only if `S` is coercible into ``self``
2345
+
2346
+ EXAMPLES::
2347
+
2348
+ sage: X = BruhatTitsQuotient(3,7)
2349
+ sage: H = X.harmonic_cocycles(2,prec=10)
2350
+ sage: A = X.padic_automorphic_forms(2,prec=10)
2351
+ sage: A._coerce_map_from_(H)
2352
+ True
2353
+ """
2354
+ if isinstance(S, BruhatTitsHarmonicCocycles):
2355
+ if S.weight() - 2 != self._n:
2356
+ return False
2357
+ return S._X == self._source
2358
+ if isinstance(S, pAdicAutomorphicForms):
2359
+ if S._n != self._n:
2360
+ return False
2361
+ return S._source == self._source
2362
+ return False
2363
+
2364
+ def _element_constructor_(self, data):
2365
+ r"""
2366
+ Construct a `p`-automorphic form.
2367
+
2368
+ INPUT:
2369
+
2370
+ - ``data`` -- defining data. Can be either a harmonic cocycle, or a `p`-adic automorphic form,
2371
+ or a list of elements coercible into the module of coefficients of ``self``
2372
+
2373
+ OUTPUT: a `p`-adic automorphic form
2374
+
2375
+ EXAMPLES::
2376
+
2377
+ sage: X = BruhatTitsQuotient(13,5)
2378
+ sage: H = X.harmonic_cocycles(2,prec=10)
2379
+ sage: h = H.an_element() # indirect doctest
2380
+ sage: A = X.padic_automorphic_forms(2,prec=10)
2381
+ sage: A(h)
2382
+ p-adic automorphic form of cohomological weight 0
2383
+ """
2384
+ # Code how to coerce x into the space
2385
+ # Admissible values of x?
2386
+ if isinstance(data, list):
2387
+ return self.element_class(self, [self._U(o, normalize=False) for o in data])
2388
+
2389
+ if isinstance(data, pAdicAutomorphicFormElement):
2390
+ vals = [self._U(o, normalize=False) for o in data._value]
2391
+ return self.element_class(self, vals)
2392
+
2393
+ if isinstance(data, BruhatTitsHarmonicCocycleElement):
2394
+ E = self._list
2395
+ tmp = []
2396
+ F = []
2397
+ Uold = data.parent()._U
2398
+ for ii in range(len(data._F)):
2399
+ newtmp = data.parent()._Sigma0(E[ii].rep.inverse(), check=False) * Uold(data._F[ii],
2400
+ normalize=False)
2401
+ tmp.append(newtmp)
2402
+ F.append(newtmp)
2403
+ A = data.parent()._Sigma0(Matrix(QQ, 2, 2, [0, ~self.prime(), 1, 0]), check=False)
2404
+ F.extend(-(A * tmp[ii]) for ii in range(len(data._F)))
2405
+ vals = self._make_invariant([self._U(o, normalize=False) for o in F])
2406
+ return self.element_class(self, vals)
2407
+ if data == 0:
2408
+ return self.zero()
2409
+
2410
+ def _an_element_(self):
2411
+ r"""
2412
+ Return an element of the module.
2413
+
2414
+ OUTPUT: a harmonic cocycle
2415
+
2416
+ EXAMPLES::
2417
+
2418
+ sage: X = BruhatTitsQuotient(13,5)
2419
+ sage: A = X.padic_automorphic_forms(2,prec=10)
2420
+ sage: A.an_element() # indirect doctest
2421
+ p-adic automorphic form of cohomological weight 0
2422
+ """
2423
+ return self(0)
2424
+
2425
+ def precision_cap(self):
2426
+ """
2427
+ Return the precision of ``self``.
2428
+
2429
+ OUTPUT: integer
2430
+
2431
+ EXAMPLES::
2432
+
2433
+ sage: X = BruhatTitsQuotient(13,11)
2434
+ sage: A = X.padic_automorphic_forms(2,prec=10)
2435
+ sage: A.precision_cap()
2436
+ 10
2437
+ """
2438
+ return self._prec
2439
+
2440
+ def lift(self, f):
2441
+ r"""
2442
+ Lift the harmonic cocycle ``f`` to a p-automorphic form.
2443
+
2444
+ If one is using overconvergent coefficients, then this will
2445
+ compute all of the moments of the measure associated to ``f``.
2446
+
2447
+ INPUT:
2448
+
2449
+ - ``f`` -- a harmonic cocycle
2450
+
2451
+ OUTPUT: a `p`-adic automorphic form
2452
+
2453
+ EXAMPLES:
2454
+
2455
+ If one does not work with an overconvergent form then lift
2456
+ does nothing::
2457
+
2458
+ sage: X = BruhatTitsQuotient(13,5)
2459
+ sage: H = X.harmonic_cocycles(2,prec=10)
2460
+ sage: h = H.gen(0)
2461
+ sage: A = X.padic_automorphic_forms(2,prec=10)
2462
+ sage: A.lift(h) # long time
2463
+ p-adic automorphic form of cohomological weight 0
2464
+
2465
+ With overconvergent forms, the input is lifted naively and its
2466
+ moments are computed::
2467
+
2468
+ sage: X = BruhatTitsQuotient(13,11)
2469
+ sage: H = X.harmonic_cocycles(2,prec=5)
2470
+ sage: A2 = X.padic_automorphic_forms(2,prec=5,overconvergent=True)
2471
+ sage: a = H.gen(0)
2472
+ sage: A2.lift(a) # long time
2473
+ p-adic automorphic form of cohomological weight 0
2474
+ """
2475
+ return self(f)._improve(f)
2476
+
2477
+ def _make_invariant(self, F):
2478
+ r"""
2479
+ Naively lift a ``classical`` automorphic form to an
2480
+ overconvergent form.
2481
+
2482
+ INPUT:
2483
+
2484
+ - ``F`` -- a classical (nonoverconvergent) pAdicAutomorphicForm or
2485
+ BruhatTitsHarmonicCocycle
2486
+
2487
+ OUTPUT: an overconvergent pAdicAutomorphicForm
2488
+
2489
+ EXAMPLES::
2490
+
2491
+ sage: X = BruhatTitsQuotient(13,11)
2492
+ sage: H = X.harmonic_cocycles(2,prec = 5)
2493
+ sage: A = X.padic_automorphic_forms(2,prec = 5)
2494
+ sage: h = H.basis()[0]
2495
+ sage: A.lift(h) # indirect doctest, long time
2496
+ p-adic automorphic form of cohomological weight 0
2497
+ """
2498
+ S = self._source.get_stabilizers()
2499
+ M = [e.rep for e in self._list]
2500
+ newF = []
2501
+ for ii in range(len(S)):
2502
+ Si = S[ii]
2503
+ x = self._U(F[ii], normalize=False)
2504
+
2505
+ if any(v[2] for v in Si):
2506
+ newFi = self._U(0)
2507
+ s = QQ(0)
2508
+ m = M[ii]
2509
+ for v in Si:
2510
+ s += 1
2511
+ g = self._Sigma0(m.adjugate() * self._source.embed_quaternion(v[0], prec=self._prec).adjugate() * m,
2512
+ check=False)
2513
+ newFi += g * x
2514
+ newF.append((QQ(1) / s) * newFi)
2515
+ else:
2516
+ newF.append(self._U(x, normalize=False))
2517
+ return newF
2518
+
2519
+ def _apply_Up_operator(self, f, scale=False, original_moments=None):
2520
+ r"""
2521
+ Apply the Up operator to ``f``.
2522
+
2523
+ INPUT:
2524
+
2525
+ - ``f`` -- a `p`-adic automorphic form
2526
+ - ``scale`` -- boolean (default: ``True``); whether to scale by the appropriate power of `p`
2527
+ at each iteration
2528
+
2529
+ EXAMPLES::
2530
+
2531
+ sage: X = BruhatTitsQuotient(3,11)
2532
+ sage: M = X.harmonic_cocycles(4,10)
2533
+ sage: A = X.padic_automorphic_forms(4,10, overconvergent = True)
2534
+ sage: F = A.lift(M.basis()[0]); F # indirect doctest
2535
+ p-adic automorphic form of cohomological weight 2
2536
+ """
2537
+ HeckeData = self._source._get_Up_data()
2538
+ S0 = f._value[0].parent()._act._Sigma0
2539
+ prec_cap = self._U.base_ring().precision_cap()
2540
+
2541
+ if not scale:
2542
+ factor = self._p ** (self._U.weight() // 2)
2543
+ else:
2544
+ factor = 1
2545
+
2546
+ # Save original moments
2547
+ if original_moments is None:
2548
+ original_moments = [[fval._moments[ii] for ii in range(self._n + 1)]
2549
+ for fval in f._value]
2550
+
2551
+ Tf = []
2552
+ for jj in range(len(self._list)):
2553
+ tmp = self._U(0, normalize=False)
2554
+ for gg, edge_list in HeckeData:
2555
+ u = edge_list[jj]
2556
+ tprec = 2 * (prec_cap + u.power) + 1
2557
+ r = S0(self._p ** -u.power * (u.t(tprec) * gg).adjugate(),
2558
+ check=False)
2559
+ tmp += r * f._value[u.label]
2560
+ tmp *= factor
2561
+ for ii in range(self._n + 1):
2562
+ tmp._moments[ii] = original_moments[jj][ii]
2563
+ Tf.append(tmp)
2564
+ return self(Tf)