passagemath-schemes 10.6.47__cp312-cp312-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 (311) hide show
  1. passagemath_schemes/.dylibs/libflint.22.0.dylib +0 -0
  2. passagemath_schemes/.dylibs/libgmp.10.dylib +0 -0
  3. passagemath_schemes/.dylibs/libgmpxx.4.dylib +0 -0
  4. passagemath_schemes/.dylibs/libmpfr.6.dylib +0 -0
  5. passagemath_schemes/__init__.py +3 -0
  6. passagemath_schemes-10.6.47.dist-info/METADATA +204 -0
  7. passagemath_schemes-10.6.47.dist-info/METADATA.bak +205 -0
  8. passagemath_schemes-10.6.47.dist-info/RECORD +311 -0
  9. passagemath_schemes-10.6.47.dist-info/WHEEL +6 -0
  10. passagemath_schemes-10.6.47.dist-info/top_level.txt +3 -0
  11. sage/all__sagemath_schemes.py +23 -0
  12. sage/databases/all__sagemath_schemes.py +7 -0
  13. sage/databases/cremona.py +1723 -0
  14. sage/dynamics/all__sagemath_schemes.py +2 -0
  15. sage/dynamics/arithmetic_dynamics/affine_ds.py +1083 -0
  16. sage/dynamics/arithmetic_dynamics/all.py +14 -0
  17. sage/dynamics/arithmetic_dynamics/berkovich_ds.py +1101 -0
  18. sage/dynamics/arithmetic_dynamics/dynamical_semigroup.py +1543 -0
  19. sage/dynamics/arithmetic_dynamics/endPN_automorphism_group.py +2426 -0
  20. sage/dynamics/arithmetic_dynamics/endPN_minimal_model.py +1169 -0
  21. sage/dynamics/arithmetic_dynamics/generic_ds.py +663 -0
  22. sage/dynamics/arithmetic_dynamics/product_projective_ds.py +339 -0
  23. sage/dynamics/arithmetic_dynamics/projective_ds.py +9558 -0
  24. sage/dynamics/arithmetic_dynamics/projective_ds_helper.cpython-312-darwin.so +0 -0
  25. sage/dynamics/arithmetic_dynamics/projective_ds_helper.pyx +301 -0
  26. sage/dynamics/arithmetic_dynamics/wehlerK3.py +2576 -0
  27. sage/lfunctions/all.py +18 -0
  28. sage/lfunctions/dokchitser.py +745 -0
  29. sage/lfunctions/pari.py +818 -0
  30. sage/lfunctions/zero_sums.cpython-312-darwin.so +0 -0
  31. sage/lfunctions/zero_sums.pyx +1847 -0
  32. sage/modular/abvar/abvar.py +5135 -0
  33. sage/modular/abvar/abvar_ambient_jacobian.py +413 -0
  34. sage/modular/abvar/abvar_newform.py +244 -0
  35. sage/modular/abvar/all.py +8 -0
  36. sage/modular/abvar/constructor.py +186 -0
  37. sage/modular/abvar/cuspidal_subgroup.py +371 -0
  38. sage/modular/abvar/finite_subgroup.py +896 -0
  39. sage/modular/abvar/homology.py +720 -0
  40. sage/modular/abvar/homspace.py +998 -0
  41. sage/modular/abvar/lseries.py +415 -0
  42. sage/modular/abvar/morphism.py +935 -0
  43. sage/modular/abvar/torsion_point.py +274 -0
  44. sage/modular/abvar/torsion_subgroup.py +740 -0
  45. sage/modular/all.py +43 -0
  46. sage/modular/arithgroup/all.py +20 -0
  47. sage/modular/arithgroup/arithgroup_element.cpython-312-darwin.so +0 -0
  48. sage/modular/arithgroup/arithgroup_element.pyx +474 -0
  49. sage/modular/arithgroup/arithgroup_generic.py +1402 -0
  50. sage/modular/arithgroup/arithgroup_perm.py +2692 -0
  51. sage/modular/arithgroup/congroup.cpython-312-darwin.so +0 -0
  52. sage/modular/arithgroup/congroup.pyx +334 -0
  53. sage/modular/arithgroup/congroup_gamma.py +363 -0
  54. sage/modular/arithgroup/congroup_gamma0.py +692 -0
  55. sage/modular/arithgroup/congroup_gamma1.py +653 -0
  56. sage/modular/arithgroup/congroup_gammaH.py +1469 -0
  57. sage/modular/arithgroup/congroup_generic.py +628 -0
  58. sage/modular/arithgroup/congroup_sl2z.py +267 -0
  59. sage/modular/arithgroup/farey_symbol.cpython-312-darwin.so +0 -0
  60. sage/modular/arithgroup/farey_symbol.pyx +1066 -0
  61. sage/modular/arithgroup/tests.py +418 -0
  62. sage/modular/btquotients/all.py +4 -0
  63. sage/modular/btquotients/btquotient.py +3753 -0
  64. sage/modular/btquotients/pautomorphicform.py +2570 -0
  65. sage/modular/buzzard.py +100 -0
  66. sage/modular/congroup.py +29 -0
  67. sage/modular/congroup_element.py +13 -0
  68. sage/modular/cusps.py +1109 -0
  69. sage/modular/cusps_nf.py +1270 -0
  70. sage/modular/dims.py +569 -0
  71. sage/modular/dirichlet.py +3310 -0
  72. sage/modular/drinfeld_modform/all.py +2 -0
  73. sage/modular/drinfeld_modform/element.py +446 -0
  74. sage/modular/drinfeld_modform/ring.py +773 -0
  75. sage/modular/drinfeld_modform/tutorial.py +236 -0
  76. sage/modular/etaproducts.py +1065 -0
  77. sage/modular/hecke/algebra.py +746 -0
  78. sage/modular/hecke/all.py +20 -0
  79. sage/modular/hecke/ambient_module.py +1019 -0
  80. sage/modular/hecke/degenmap.py +119 -0
  81. sage/modular/hecke/element.py +325 -0
  82. sage/modular/hecke/hecke_operator.py +780 -0
  83. sage/modular/hecke/homspace.py +206 -0
  84. sage/modular/hecke/module.py +1767 -0
  85. sage/modular/hecke/morphism.py +174 -0
  86. sage/modular/hecke/submodule.py +989 -0
  87. sage/modular/hypergeometric_misc.cpython-312-darwin.so +0 -0
  88. sage/modular/hypergeometric_misc.pxd +4 -0
  89. sage/modular/hypergeometric_misc.pyx +166 -0
  90. sage/modular/hypergeometric_motive.py +2017 -0
  91. sage/modular/local_comp/all.py +2 -0
  92. sage/modular/local_comp/liftings.py +292 -0
  93. sage/modular/local_comp/local_comp.py +1071 -0
  94. sage/modular/local_comp/smoothchar.py +1825 -0
  95. sage/modular/local_comp/type_space.py +748 -0
  96. sage/modular/modform/all.py +30 -0
  97. sage/modular/modform/ambient.py +815 -0
  98. sage/modular/modform/ambient_R.py +177 -0
  99. sage/modular/modform/ambient_eps.py +306 -0
  100. sage/modular/modform/ambient_g0.py +124 -0
  101. sage/modular/modform/ambient_g1.py +204 -0
  102. sage/modular/modform/constructor.py +545 -0
  103. sage/modular/modform/cuspidal_submodule.py +708 -0
  104. sage/modular/modform/defaults.py +14 -0
  105. sage/modular/modform/eis_series.py +505 -0
  106. sage/modular/modform/eisenstein_submodule.py +663 -0
  107. sage/modular/modform/element.py +4131 -0
  108. sage/modular/modform/find_generators.py +59 -0
  109. sage/modular/modform/half_integral.py +154 -0
  110. sage/modular/modform/hecke_operator_on_qexp.py +247 -0
  111. sage/modular/modform/j_invariant.py +47 -0
  112. sage/modular/modform/l_series_gross_zagier.py +133 -0
  113. sage/modular/modform/l_series_gross_zagier_coeffs.cpython-312-darwin.so +0 -0
  114. sage/modular/modform/l_series_gross_zagier_coeffs.pyx +177 -0
  115. sage/modular/modform/notes.py +45 -0
  116. sage/modular/modform/numerical.py +514 -0
  117. sage/modular/modform/periods.py +14 -0
  118. sage/modular/modform/ring.py +1257 -0
  119. sage/modular/modform/space.py +1860 -0
  120. sage/modular/modform/submodule.py +118 -0
  121. sage/modular/modform/tests.py +64 -0
  122. sage/modular/modform/theta.py +110 -0
  123. sage/modular/modform/vm_basis.py +381 -0
  124. sage/modular/modform/weight1.py +220 -0
  125. sage/modular/modform_hecketriangle/abstract_ring.py +1932 -0
  126. sage/modular/modform_hecketriangle/abstract_space.py +2528 -0
  127. sage/modular/modform_hecketriangle/all.py +30 -0
  128. sage/modular/modform_hecketriangle/analytic_type.py +590 -0
  129. sage/modular/modform_hecketriangle/constructor.py +416 -0
  130. sage/modular/modform_hecketriangle/element.py +351 -0
  131. sage/modular/modform_hecketriangle/functors.py +752 -0
  132. sage/modular/modform_hecketriangle/graded_ring.py +541 -0
  133. sage/modular/modform_hecketriangle/graded_ring_element.py +2225 -0
  134. sage/modular/modform_hecketriangle/hecke_triangle_group_element.py +3352 -0
  135. sage/modular/modform_hecketriangle/hecke_triangle_groups.py +1432 -0
  136. sage/modular/modform_hecketriangle/readme.py +1214 -0
  137. sage/modular/modform_hecketriangle/series_constructor.py +580 -0
  138. sage/modular/modform_hecketriangle/space.py +1037 -0
  139. sage/modular/modform_hecketriangle/subspace.py +423 -0
  140. sage/modular/modsym/all.py +17 -0
  141. sage/modular/modsym/ambient.py +3846 -0
  142. sage/modular/modsym/boundary.py +1420 -0
  143. sage/modular/modsym/element.py +336 -0
  144. sage/modular/modsym/g1list.py +178 -0
  145. sage/modular/modsym/ghlist.py +182 -0
  146. sage/modular/modsym/hecke_operator.py +73 -0
  147. sage/modular/modsym/manin_symbol.cpython-312-darwin.so +0 -0
  148. sage/modular/modsym/manin_symbol.pxd +5 -0
  149. sage/modular/modsym/manin_symbol.pyx +497 -0
  150. sage/modular/modsym/manin_symbol_list.py +1295 -0
  151. sage/modular/modsym/modsym.py +400 -0
  152. sage/modular/modsym/modular_symbols.py +384 -0
  153. sage/modular/modsym/p1list_nf.py +1241 -0
  154. sage/modular/modsym/relation_matrix.py +591 -0
  155. sage/modular/modsym/relation_matrix_pyx.cpython-312-darwin.so +0 -0
  156. sage/modular/modsym/relation_matrix_pyx.pyx +108 -0
  157. sage/modular/modsym/space.py +2468 -0
  158. sage/modular/modsym/subspace.py +455 -0
  159. sage/modular/modsym/tests.py +375 -0
  160. sage/modular/multiple_zeta.py +2632 -0
  161. sage/modular/multiple_zeta_F_algebra.py +786 -0
  162. sage/modular/overconvergent/all.py +6 -0
  163. sage/modular/overconvergent/genus0.py +1878 -0
  164. sage/modular/overconvergent/hecke_series.py +1187 -0
  165. sage/modular/overconvergent/weightspace.py +778 -0
  166. sage/modular/pollack_stevens/all.py +4 -0
  167. sage/modular/pollack_stevens/distributions.py +874 -0
  168. sage/modular/pollack_stevens/fund_domain.py +1572 -0
  169. sage/modular/pollack_stevens/manin_map.py +859 -0
  170. sage/modular/pollack_stevens/modsym.py +1593 -0
  171. sage/modular/pollack_stevens/padic_lseries.py +417 -0
  172. sage/modular/pollack_stevens/sigma0.py +534 -0
  173. sage/modular/pollack_stevens/space.py +1076 -0
  174. sage/modular/quasimodform/all.py +3 -0
  175. sage/modular/quasimodform/element.py +845 -0
  176. sage/modular/quasimodform/ring.py +828 -0
  177. sage/modular/quatalg/all.py +3 -0
  178. sage/modular/quatalg/brandt.py +1642 -0
  179. sage/modular/ssmod/all.py +8 -0
  180. sage/modular/ssmod/ssmod.py +827 -0
  181. sage/rings/all__sagemath_schemes.py +1 -0
  182. sage/rings/polynomial/all__sagemath_schemes.py +1 -0
  183. sage/rings/polynomial/binary_form_reduce.py +585 -0
  184. sage/schemes/all.py +41 -0
  185. sage/schemes/berkovich/all.py +6 -0
  186. sage/schemes/berkovich/berkovich_cp_element.py +2582 -0
  187. sage/schemes/berkovich/berkovich_space.py +748 -0
  188. sage/schemes/curves/affine_curve.py +2928 -0
  189. sage/schemes/curves/all.py +33 -0
  190. sage/schemes/curves/closed_point.py +434 -0
  191. sage/schemes/curves/constructor.py +381 -0
  192. sage/schemes/curves/curve.py +542 -0
  193. sage/schemes/curves/plane_curve_arrangement.py +1283 -0
  194. sage/schemes/curves/point.py +463 -0
  195. sage/schemes/curves/projective_curve.py +3026 -0
  196. sage/schemes/curves/zariski_vankampen.py +1932 -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 +1036 -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 +1102 -0
  208. sage/schemes/elliptic_curves/constructor.py +1552 -0
  209. sage/schemes/elliptic_curves/ec_database.py +175 -0
  210. sage/schemes/elliptic_curves/ell_curve_isogeny.py +3972 -0
  211. sage/schemes/elliptic_curves/ell_egros.py +459 -0
  212. sage/schemes/elliptic_curves/ell_field.py +2836 -0
  213. sage/schemes/elliptic_curves/ell_finite_field.py +3359 -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 +4787 -0
  220. sage/schemes/elliptic_curves/ell_rational_field.py +7368 -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 +1669 -0
  227. sage/schemes/elliptic_curves/gp_simon.py +152 -0
  228. sage/schemes/elliptic_curves/heegner.py +7335 -0
  229. sage/schemes/elliptic_curves/height.py +2109 -0
  230. sage/schemes/elliptic_curves/hom.py +1406 -0
  231. sage/schemes/elliptic_curves/hom_composite.py +934 -0
  232. sage/schemes/elliptic_curves/hom_frobenius.py +522 -0
  233. sage/schemes/elliptic_curves/hom_scalar.py +531 -0
  234. sage/schemes/elliptic_curves/hom_sum.py +682 -0
  235. sage/schemes/elliptic_curves/hom_velusqrt.py +1290 -0
  236. sage/schemes/elliptic_curves/homset.py +271 -0
  237. sage/schemes/elliptic_curves/isogeny_class.py +1521 -0
  238. sage/schemes/elliptic_curves/isogeny_small_degree.py +2797 -0
  239. sage/schemes/elliptic_curves/jacobian.py +237 -0
  240. sage/schemes/elliptic_curves/kodaira_symbol.py +344 -0
  241. sage/schemes/elliptic_curves/kraus.py +1014 -0
  242. sage/schemes/elliptic_curves/lseries_ell.py +943 -0
  243. sage/schemes/elliptic_curves/mod5family.py +105 -0
  244. sage/schemes/elliptic_curves/mod_poly.py +197 -0
  245. sage/schemes/elliptic_curves/mod_sym_num.cpython-312-darwin.so +0 -0
  246. sage/schemes/elliptic_curves/mod_sym_num.pyx +3796 -0
  247. sage/schemes/elliptic_curves/modular_parametrization.py +305 -0
  248. sage/schemes/elliptic_curves/padic_lseries.py +1793 -0
  249. sage/schemes/elliptic_curves/padics.py +1816 -0
  250. sage/schemes/elliptic_curves/period_lattice.py +2234 -0
  251. sage/schemes/elliptic_curves/period_lattice_region.cpython-312-darwin.so +0 -0
  252. sage/schemes/elliptic_curves/period_lattice_region.pyx +722 -0
  253. sage/schemes/elliptic_curves/saturation.py +715 -0
  254. sage/schemes/elliptic_curves/sha_tate.py +1158 -0
  255. sage/schemes/elliptic_curves/weierstrass_morphism.py +1117 -0
  256. sage/schemes/elliptic_curves/weierstrass_transform.py +200 -0
  257. sage/schemes/hyperelliptic_curves/all.py +6 -0
  258. sage/schemes/hyperelliptic_curves/constructor.py +291 -0
  259. sage/schemes/hyperelliptic_curves/hyperelliptic_finite_field.py +1914 -0
  260. sage/schemes/hyperelliptic_curves/hyperelliptic_g2.py +192 -0
  261. sage/schemes/hyperelliptic_curves/hyperelliptic_generic.py +954 -0
  262. sage/schemes/hyperelliptic_curves/hyperelliptic_padic_field.py +1332 -0
  263. sage/schemes/hyperelliptic_curves/hyperelliptic_rational_field.py +84 -0
  264. sage/schemes/hyperelliptic_curves/invariants.py +410 -0
  265. sage/schemes/hyperelliptic_curves/jacobian_endomorphism_utils.py +315 -0
  266. sage/schemes/hyperelliptic_curves/jacobian_g2.py +32 -0
  267. sage/schemes/hyperelliptic_curves/jacobian_generic.py +419 -0
  268. sage/schemes/hyperelliptic_curves/jacobian_homset.py +186 -0
  269. sage/schemes/hyperelliptic_curves/jacobian_morphism.py +875 -0
  270. sage/schemes/hyperelliptic_curves/kummer_surface.py +99 -0
  271. sage/schemes/hyperelliptic_curves/mestre.py +302 -0
  272. sage/schemes/hyperelliptic_curves/monsky_washnitzer.py +3871 -0
  273. sage/schemes/jacobians/abstract_jacobian.py +277 -0
  274. sage/schemes/jacobians/all.py +2 -0
  275. sage/schemes/overview.py +161 -0
  276. sage/schemes/plane_conics/all.py +22 -0
  277. sage/schemes/plane_conics/con_field.py +1296 -0
  278. sage/schemes/plane_conics/con_finite_field.py +158 -0
  279. sage/schemes/plane_conics/con_number_field.py +456 -0
  280. sage/schemes/plane_conics/con_rational_field.py +406 -0
  281. sage/schemes/plane_conics/con_rational_function_field.py +580 -0
  282. sage/schemes/plane_conics/constructor.py +249 -0
  283. sage/schemes/plane_quartics/all.py +2 -0
  284. sage/schemes/plane_quartics/quartic_constructor.py +71 -0
  285. sage/schemes/plane_quartics/quartic_generic.py +73 -0
  286. sage/schemes/riemann_surfaces/all.py +1 -0
  287. sage/schemes/riemann_surfaces/riemann_surface.py +4117 -0
  288. sage_wheels/share/cremona/cremona_mini.db +0 -0
  289. sage_wheels/share/ellcurves/rank0 +30427 -0
  290. sage_wheels/share/ellcurves/rank1 +31871 -0
  291. sage_wheels/share/ellcurves/rank10 +6 -0
  292. sage_wheels/share/ellcurves/rank11 +6 -0
  293. sage_wheels/share/ellcurves/rank12 +1 -0
  294. sage_wheels/share/ellcurves/rank14 +1 -0
  295. sage_wheels/share/ellcurves/rank15 +1 -0
  296. sage_wheels/share/ellcurves/rank17 +1 -0
  297. sage_wheels/share/ellcurves/rank19 +1 -0
  298. sage_wheels/share/ellcurves/rank2 +2388 -0
  299. sage_wheels/share/ellcurves/rank20 +1 -0
  300. sage_wheels/share/ellcurves/rank21 +1 -0
  301. sage_wheels/share/ellcurves/rank22 +1 -0
  302. sage_wheels/share/ellcurves/rank23 +1 -0
  303. sage_wheels/share/ellcurves/rank24 +1 -0
  304. sage_wheels/share/ellcurves/rank28 +1 -0
  305. sage_wheels/share/ellcurves/rank3 +836 -0
  306. sage_wheels/share/ellcurves/rank4 +10 -0
  307. sage_wheels/share/ellcurves/rank5 +5 -0
  308. sage_wheels/share/ellcurves/rank6 +5 -0
  309. sage_wheels/share/ellcurves/rank7 +5 -0
  310. sage_wheels/share/ellcurves/rank8 +6 -0
  311. sage_wheels/share/ellcurves/rank9 +7 -0
@@ -0,0 +1,2570 @@
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
+ if S._X != self._X:
954
+ return False
955
+ return True
956
+ return False
957
+
958
+ def __eq__(self, other):
959
+ r"""
960
+ Test whether two BruhatTitsHarmonicCocycle spaces are equal.
961
+
962
+ INPUT:
963
+
964
+ - ``other`` -- a BruhatTitsHarmonicCocycles class
965
+
966
+ OUTPUT: boolean
967
+
968
+ EXAMPLES::
969
+
970
+ sage: X = BruhatTitsQuotient(5,7)
971
+ sage: H1 = X.harmonic_cocycles(2,prec=10)
972
+ sage: H2 = X.harmonic_cocycles(2,prec=10)
973
+ sage: H1 == H2
974
+ True
975
+ """
976
+ if not isinstance(other, BruhatTitsHarmonicCocycles):
977
+ return False
978
+
979
+ return (self.base_ring() == other.base_ring() and
980
+ self._X == other._X and
981
+ self._k == other._k)
982
+
983
+ def __ne__(self, other):
984
+ r"""
985
+ Test whether two BruhatTitsHarmonicCocycle spaces are not equal.
986
+
987
+ INPUT:
988
+
989
+ - ``other`` -- a BruhatTitsHarmonicCocycles class
990
+
991
+ OUTPUT: boolean
992
+
993
+ EXAMPLES::
994
+
995
+ sage: X = BruhatTitsQuotient(5,7)
996
+ sage: H1 = X.harmonic_cocycles(2,prec=10)
997
+ sage: H2 = X.harmonic_cocycles(2,prec=10)
998
+ sage: H1 != H2
999
+ False
1000
+ """
1001
+ return not self.__eq__(other)
1002
+
1003
+ def __hash__(self):
1004
+ """
1005
+ Return the hash of ``self``.
1006
+
1007
+ EXAMPLES::
1008
+
1009
+ sage: X = BruhatTitsQuotient(5,7)
1010
+ sage: H1 = X.harmonic_cocycles(2,prec=10)
1011
+ sage: H2 = X.harmonic_cocycles(2,prec=10)
1012
+ sage: hash(H1) == hash(H2)
1013
+ True
1014
+ """
1015
+ return hash((self.base_ring(), self._X, self._k))
1016
+
1017
+ def _element_constructor_(self, x):
1018
+ r"""
1019
+ Constructor for harmonic cocycles.
1020
+
1021
+ INPUT:
1022
+
1023
+ - ``x`` -- an object coercible into a harmonic cocycle
1024
+
1025
+ OUTPUT: a harmonic cocycle
1026
+
1027
+ EXAMPLES::
1028
+
1029
+ sage: X = BruhatTitsQuotient(3,17)
1030
+ sage: H = X.harmonic_cocycles(2,prec=10)
1031
+ sage: H(H.an_element()) # indirect doctest
1032
+ Harmonic cocycle with values in Sym^0 Q_3^2
1033
+ sage: H(0)
1034
+ Harmonic cocycle with values in Sym^0 Q_3^2
1035
+ """
1036
+ if type(x) is sage.modules.free_module_element.FreeModuleElement_generic_dense:
1037
+ vmat = MatrixSpace(self._R, 1, self.dimension())(x)
1038
+ tmp = (vmat * self.ambient_module().basis_matrix()).row(0)
1039
+ vec = [self._U(tmp[e * (self._k - 1):(e + 1) * (self._k - 1)])
1040
+ for e in range(len(self._E))]
1041
+ return self.element_class(self, vec)
1042
+
1043
+ if type(x) is list:
1044
+ return self.element_class(self, [self._U(o) for o in x])
1045
+
1046
+ if hasattr(x, 'parent'):
1047
+ parent = x.parent()
1048
+ if isinstance(parent, BruhatTitsHarmonicCocycles):
1049
+ return self.element_class(self, [self._U(o) for o in x._F])
1050
+ elif isinstance(parent, pAdicAutomorphicForms):
1051
+ tmp = [self._E[ii].rep * self._U(x._F[ii]) for ii in range(self._nE)]
1052
+ return self.element_class(self, tmp)
1053
+ if x == 0:
1054
+ tmp = [self._U([0] * (self.weight() - 1))] * self._X._num_edges
1055
+ return self.element_class(self, tmp)
1056
+ else:
1057
+ raise TypeError
1058
+
1059
+ def free_module(self):
1060
+ r"""
1061
+ Return the underlying free module.
1062
+
1063
+ OUTPUT: a free module
1064
+
1065
+ EXAMPLES::
1066
+
1067
+ sage: X = BruhatTitsQuotient(3,7)
1068
+ sage: H = X.harmonic_cocycles(2,prec=10)
1069
+ sage: H.free_module()
1070
+ Vector space of dimension 1 over 3-adic Field with
1071
+ capped relative precision 10
1072
+ """
1073
+ try:
1074
+ return self.__free_module
1075
+ except AttributeError:
1076
+ pass
1077
+ V = self.base_ring() ** self.dimension()
1078
+ self.__free_module = V
1079
+ return V
1080
+
1081
+ def character(self):
1082
+ r"""
1083
+ The trivial character.
1084
+
1085
+ OUTPUT: the identity map
1086
+
1087
+ EXAMPLES::
1088
+
1089
+ sage: X = BruhatTitsQuotient(3,7)
1090
+ sage: H = X.harmonic_cocycles(2,prec = 10)
1091
+ sage: f = H.character()
1092
+ sage: f(1)
1093
+ 1
1094
+ sage: f(2)
1095
+ 2
1096
+ """
1097
+ return lambda x: x
1098
+
1099
+ def embed_quaternion(self, g, scale=1, exact=None):
1100
+ r"""
1101
+ Embed the quaternion element ``g`` into the matrix algebra.
1102
+
1103
+ INPUT:
1104
+
1105
+ - ``g`` -- a quaternion, expressed as a 4x1 matrix
1106
+
1107
+ OUTPUT: a 2x2 matrix with `p`-adic entries
1108
+
1109
+ EXAMPLES::
1110
+
1111
+ sage: X = BruhatTitsQuotient(7,2)
1112
+ sage: q = X.get_stabilizers()[0][1][0]
1113
+ sage: H = X.harmonic_cocycles(2,prec = 5)
1114
+ sage: Hmat = H.embed_quaternion(q)
1115
+ sage: Hmat.matrix().trace() == X._conv(q).reduced_trace() and Hmat.matrix().determinant() == 1
1116
+ True
1117
+ """
1118
+ if exact is None:
1119
+ exact = self._R.is_exact()
1120
+ return self._Sigma0(scale * self._X.embed_quaternion(g, exact=exact,
1121
+ prec=self._prec),
1122
+ check=False)
1123
+
1124
+ def basis_matrix(self):
1125
+ r"""
1126
+ Return a basis of ``self`` in matrix form.
1127
+
1128
+ If the coefficient module `M` is of finite rank then the space
1129
+ of Gamma invariant `M` valued harmonic cocycles can be
1130
+ represented as a subspace of the finite rank space of all
1131
+ functions from the finitely many edges in the corresponding
1132
+ BruhatTitsQuotient into `M`. This function computes this
1133
+ representation of the space of cocycles.
1134
+
1135
+ OUTPUT:
1136
+
1137
+ - A basis matrix describing the cocycles in the spaced of all
1138
+ `M` valued Gamma invariant functions on the tree.
1139
+
1140
+ EXAMPLES::
1141
+
1142
+ sage: X = BruhatTitsQuotient(5,3)
1143
+ sage: M = X.harmonic_cocycles(4,prec = 20)
1144
+ sage: B = M.basis() # indirect doctest
1145
+ sage: len(B) == X.dimension_harmonic_cocycles(4)
1146
+ True
1147
+
1148
+ AUTHORS:
1149
+
1150
+ - Cameron Franc (2012-02-20)
1151
+ - Marc Masdeu (2012-02-20)
1152
+ """
1153
+ try:
1154
+ return self.__matrix
1155
+ except AttributeError:
1156
+ pass
1157
+ nV = len(self._V)
1158
+ nE = len(self._E)
1159
+ stab_conds = []
1160
+ S = self._X.get_edge_stabilizers()
1161
+ p = self._X._p
1162
+ d = self._k - 1
1163
+ for e in self._E:
1164
+ try:
1165
+ g = next(g for g in S[e.label] if g[2])
1166
+ C = self._U.acting_matrix(self._Sigma0(self.embed_quaternion(g[0])), d).transpose() # Warning - Need to allow the check = True
1167
+ C -= self._U.acting_matrix(self._Sigma0(Matrix(QQ, 2, 2, p ** g[1])), d).transpose() # Warning - Need to allow the check = True
1168
+ stab_conds.append([e.label, C])
1169
+ except StopIteration:
1170
+ pass
1171
+
1172
+ n_stab_conds = len(stab_conds)
1173
+ self._M = Matrix(self._R, (nV + n_stab_conds) * d, nE * d, 0,
1174
+ sparse=True)
1175
+ for v in self._V:
1176
+ for e in v.leaving_edges:
1177
+ if e.parity:
1178
+ continue
1179
+ C = sum([self._U.acting_matrix(self.embed_quaternion(x[0]), d)
1180
+ for x in e.links],
1181
+ Matrix(self._R, d, d, 0)).transpose()
1182
+ self._M.set_block(v.label * d, e.label * d, C)
1183
+ for e in v.entering_edges:
1184
+ if e.parity:
1185
+ continue
1186
+ C = sum([self._U.acting_matrix(self.embed_quaternion(x[0]), d)
1187
+ for x in e.opposite.links],
1188
+ Matrix(self._R, d, d, 0)).transpose()
1189
+ self._M.set_block(v.label * d, e.opposite.label * d, C)
1190
+
1191
+ for kk in range(n_stab_conds):
1192
+ v = stab_conds[kk]
1193
+ self._M.set_block((nV + kk) * d, v[0] * d, v[1])
1194
+
1195
+ x1 = self._M.right_kernel().matrix()
1196
+
1197
+ if x1.nrows() != self.rank():
1198
+ raise RuntimeError('The computed dimension does not agree with '
1199
+ 'the expectation. Consider increasing '
1200
+ 'precision!')
1201
+
1202
+ K = [c.list() for c in x1.rows()]
1203
+
1204
+ if not self._R.is_exact():
1205
+ for ii in range(len(K)):
1206
+ s = min([t.valuation() for t in K[ii]])
1207
+ for jj in range(len(K[ii])):
1208
+ K[ii][jj] = (p ** (-s)) * K[ii][jj]
1209
+
1210
+ self.__matrix = Matrix(self._R, len(K), nE * d, K)
1211
+ self.__matrix.set_immutable()
1212
+ return self.__matrix
1213
+
1214
+ def __apply_atkin_lehner(self, q, f):
1215
+ r"""
1216
+ Apply an Atkin-Lehner involution to a harmonic cocycle.
1217
+
1218
+ INPUT:
1219
+
1220
+ - ``q`` -- integer dividing the full level ``p*Nminus*Nplus``
1221
+
1222
+ - ``f`` -- a harmonic cocycle
1223
+
1224
+ OUTPUT:
1225
+
1226
+ The harmonic cocycle obtained by hitting ``f`` with the
1227
+ Atkin-Lehner at ``q``.
1228
+
1229
+ EXAMPLES::
1230
+
1231
+ sage: X = BruhatTitsQuotient(5,17)
1232
+ sage: H = X.harmonic_cocycles(2,prec = 10)
1233
+ sage: A = H.atkin_lehner_operator(5).matrix() # indirect doctest
1234
+ sage: A**2 == 1
1235
+ True
1236
+ """
1237
+ Data = self._X._get_atkin_lehner_data(q)
1238
+ p = self._X._p
1239
+ tmp = [self._U(0) for jj in range(len(self._E))]
1240
+ d1 = Data[1]
1241
+ mga = self.embed_quaternion(Data[0])
1242
+ nE = len(self._E)
1243
+ for jj in range(nE):
1244
+ t = d1[jj]
1245
+ if t.label < nE:
1246
+ tmp[jj] += mga * t.igamma(self.embed_quaternion, scale=p ** -t.power) * f._F[t.label]
1247
+ else:
1248
+ tmp[jj] += mga * t.igamma(self.embed_quaternion, scale=p ** -t.power) * (-f._F[t.label - nE])
1249
+
1250
+ return self(tmp)
1251
+
1252
+ def __apply_hecke_operator(self, l, f):
1253
+ r"""
1254
+ This function applies a Hecke operator to a harmonic cocycle.
1255
+
1256
+ INPUT:
1257
+
1258
+ - ``l`` -- integer
1259
+
1260
+ - ``f`` -- a harmonic cocycle
1261
+
1262
+ OUTPUT:
1263
+
1264
+ A harmonic cocycle which is the result of applying the `l`-th
1265
+ Hecke operator to ``f``.
1266
+
1267
+ EXAMPLES::
1268
+
1269
+ sage: X = BruhatTitsQuotient(5,17)
1270
+ sage: H = X.harmonic_cocycles(2,prec=50)
1271
+ sage: A = H.hecke_operator(7).matrix() # indirect doctest
1272
+ sage: [o.rational_reconstruction() for o in A.charpoly().coefficients()]
1273
+ [-8, -12, 12, 20, 8, 1]
1274
+ """
1275
+ HeckeData, alpha = self._X._get_hecke_data(l)
1276
+ if self.level() % l == 0:
1277
+ factor = QQ(l ** (Integer((self._k - 2) // 2)) / (l + 1))
1278
+ else:
1279
+ factor = QQ(l ** (Integer((self._k - 2) // 2)))
1280
+ p = self._X._p
1281
+ alphamat = self.embed_quaternion(alpha)
1282
+ tmp = [self._U(0) for jj in range(len(self._E))]
1283
+ for d0, d1 in HeckeData:
1284
+ mga = self.embed_quaternion(d0) * alphamat
1285
+ nE = len(self._E)
1286
+ for jj in range(nE):
1287
+ t = d1[jj]
1288
+ if t.label < nE:
1289
+ tmp[jj] += mga * t.igamma(self.embed_quaternion, scale=p ** -t.power) * f._F[t.label]
1290
+ else:
1291
+ tmp[jj] += mga * t.igamma(self.embed_quaternion, scale=p ** -t.power) * (-f._F[t.label - nE])
1292
+ return self([factor * x for x in tmp])
1293
+
1294
+ def _compute_atkin_lehner_matrix(self, d):
1295
+ r"""
1296
+ When the underlying coefficient module is finite, this
1297
+ function computes the matrix of an Atkin-Lehner involution in
1298
+ the basis provided by the function basis_matrix
1299
+
1300
+ INPUT:
1301
+
1302
+ - ``d`` -- integer dividing ``p*Nminus*Nplus``, where these
1303
+ quantities are associated to the BruhatTitsQuotient ``self._X``
1304
+
1305
+ OUTPUT:
1306
+
1307
+ The matrix of the Atkin-Lehner involution at ``d`` in the basis given by
1308
+ ``self.basis_matrix``.
1309
+
1310
+ EXAMPLES::
1311
+
1312
+ sage: X = BruhatTitsQuotient(5,13)
1313
+ sage: H = X.harmonic_cocycles(2,prec=5)
1314
+ sage: A = H.atkin_lehner_operator(5).matrix() # indirect doctest
1315
+ sage: A**2 == 1
1316
+ True
1317
+ """
1318
+ return self.__compute_operator_matrix(lambda f: self.__apply_atkin_lehner(d, f))
1319
+
1320
+ def _compute_hecke_matrix_prime(self, l):
1321
+ r"""
1322
+ When the underlying coefficient module is finite, this
1323
+ function computes the matrix of a (prime) Hecke operator in
1324
+ the basis provided by the function basis_matrix
1325
+
1326
+ INPUT:
1327
+
1328
+ - ``l`` -- prime integer
1329
+
1330
+ OUTPUT:
1331
+
1332
+ The matrix of `T_l` acting on the cocycles in the basis given by
1333
+ ``self.basis_matrix``.
1334
+
1335
+ EXAMPLES::
1336
+
1337
+ sage: X = BruhatTitsQuotient(3,11)
1338
+ sage: H = X.harmonic_cocycles(4,prec=60)
1339
+ sage: A = H.hecke_operator(7).matrix() # long time, indirect doctest
1340
+ sage: [o.rational_reconstruction() for o in A.charpoly().coefficients()] # long time
1341
+ [6496256, 1497856, -109040, -33600, -904, 32, 1]
1342
+ """
1343
+ return self.__compute_operator_matrix(lambda f: self.__apply_hecke_operator(l, f))
1344
+
1345
+ def __compute_operator_matrix(self, T):
1346
+ r"""
1347
+ Compute the matrix of the operator `T`.
1348
+
1349
+ Used primarily to compute matrices of Hecke operators
1350
+ in a streamlined way.
1351
+
1352
+ INPUT:
1353
+
1354
+ - ``T`` -- a linear function on the space of harmonic cocycles
1355
+
1356
+ OUTPUT: the matrix of ``T`` acting on the space of harmonic cocycles
1357
+
1358
+ EXAMPLES::
1359
+
1360
+ sage: X = BruhatTitsQuotient(3,17)
1361
+ sage: H = X.harmonic_cocycles(2,prec=10)
1362
+ sage: A = H.hecke_operator(11).matrix() # indirect doctest
1363
+ sage: [o.rational_reconstruction() for o in A.charpoly().coefficients()]
1364
+ [-12, -1, 4, 1]
1365
+ """
1366
+ R = self._R
1367
+ A = self.basis_matrix().transpose()
1368
+ basis = self.basis()
1369
+ B = zero_matrix(R, len(self._E) * (self._k - 1), self.dimension())
1370
+ for rr in range(len(basis)):
1371
+ g = T(basis[rr])
1372
+ 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)]))
1373
+ try:
1374
+ res = (A.solve_right(B)).transpose()
1375
+ except ValueError:
1376
+ rest = (A.transpose() * A).solve_right(A.transpose() * B)
1377
+ err = A * rest - B
1378
+ if err != 0:
1379
+ try:
1380
+ if hasattr(err.parent().base_ring().an_element(),
1381
+ 'valuation'):
1382
+ minval = min([o.valuation() for o in err.list()
1383
+ if o != 0])
1384
+ else:
1385
+ minval = sum([RR(o.norm() ** 2) for o in err.list()])
1386
+ verbose('Error = %s' % minval)
1387
+ except AttributeError:
1388
+ verbose('Warning: something did not work in the computation')
1389
+ res = rest.transpose()
1390
+ res.set_immutable()
1391
+ return res
1392
+
1393
+ # class BruhatTitsHarmonicCocyclesSubmodule(BruhatTitsHarmonicCocycles,sage.modular.hecke.submodule.HeckeSubmodule):
1394
+ # r"""
1395
+ # Submodule of a space of BruhatTitsHarmonicCocycles.
1396
+ #
1397
+ # INPUT:
1398
+ #
1399
+ # - ``x`` -- integer (default: 1)
1400
+ #
1401
+ # - ``y`` -- integer (default: 2)
1402
+ #
1403
+ # EXAMPLES::
1404
+ #
1405
+ # sage: X = BruhatTitsQuotient(3,17)
1406
+ # sage: H = X.harmonic_cocycles(2,prec=10)
1407
+ # sage: N = H.free_module().span([H.an_element().element()])
1408
+ # sage: H1 = H.submodule(N) # indirect doctest
1409
+ # sage: H1
1410
+ # 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
1411
+ #
1412
+ # AUTHOR:
1413
+ #
1414
+ # - Marc Masdeu (2012-02-20)
1415
+ # """
1416
+ # def __init__(self, ambient_module, submodule, check):
1417
+ # """
1418
+ # Submodule of harmonic cocycles.
1419
+ #
1420
+ # INPUT:
1421
+ #
1422
+ # - ``ambient_module`` -- BruhatTitsHarmonicCocycles
1423
+ #
1424
+ # - ``submodule`` -- submodule of the ambient space
1425
+ #
1426
+ # - ``check`` -- boolean (default: ``False``); whether to check that the
1427
+ # submodule is Hecke equivariant
1428
+ #
1429
+ # EXAMPLES::
1430
+ #
1431
+ # sage: X = BruhatTitsQuotient(3,17)
1432
+ # sage: H = X.harmonic_cocycles(2,prec=10)
1433
+ # sage: N = H.free_module().span([H.an_element().element()])
1434
+ # sage: H1 = H.submodule(N)
1435
+ # sage: TestSuite(H1).run()
1436
+ # """
1437
+ # A = ambient_module
1438
+ # self.__rank = submodule.dimension()
1439
+ # basis_matrix = submodule.basis_matrix()*A.basis_matrix()
1440
+ # basis_matrix.set_immutable()
1441
+ # BruhatTitsHarmonicCocycles.__init__(self,A._X,A._k,A._prec,basis_matrix,A.base_ring())
1442
+ #
1443
+ # def rank(self):
1444
+ # r"""
1445
+ # Returns the rank (dimension) of the submodule.
1446
+ #
1447
+ # OUTPUT:
1448
+ #
1449
+ # Integer - The rank of ``self``.
1450
+ #
1451
+ # EXAMPLES::
1452
+ #
1453
+ # sage: X = BruhatTitsQuotient(3,17)
1454
+ # sage: H = X.harmonic_cocycles(2,prec=10)
1455
+ # sage: N = H.free_module().span([H.an_element().element()])
1456
+ # sage: H1 = H.submodule(basis = [H.an_element()])
1457
+ # sage: H1.rank()
1458
+ # 1
1459
+ # """
1460
+ # return self.__rank
1461
+ #
1462
+ # def _repr_(self):
1463
+ # r"""
1464
+ # Returns the representation of self as a string.
1465
+ #
1466
+ # OUTPUT:
1467
+ #
1468
+ # String representation of self.
1469
+ #
1470
+ # EXAMPLES::
1471
+ #
1472
+ # sage: X = BruhatTitsQuotient(3,17)
1473
+ # sage: H = X.harmonic_cocycles(2,prec=10)
1474
+ # sage: N = H.free_module().span([H.an_element().element()])
1475
+ # sage: H1=H.submodule(N)
1476
+ # sage: H1
1477
+ # 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
1478
+ # """
1479
+ # return "Subspace of %s of dimension %s"%(self.ambient(),self.dimension())
1480
+
1481
+
1482
+ class pAdicAutomorphicFormElement(ModuleElement):
1483
+ r"""
1484
+ Rudimentary implementation of a class for a `p`-adic
1485
+ automorphic form on a definite quaternion algebra over `\QQ`. These
1486
+ are required in order to compute moments of measures associated to
1487
+ harmonic cocycles on the Bruhat-Tits tree using the overconvergent modules
1488
+ of Darmon-Pollack and Matt Greenberg. See Greenberg's thesis [Gr2006]_ for
1489
+ more details.
1490
+
1491
+ INPUT:
1492
+
1493
+ - ``vec`` -- a preformatted list of data
1494
+
1495
+ EXAMPLES::
1496
+
1497
+ sage: X = BruhatTitsQuotient(17,3)
1498
+ sage: H = X.harmonic_cocycles(2,prec=10)
1499
+ sage: h = H.an_element()
1500
+ sage: HH = X.padic_automorphic_forms(2,10)
1501
+ sage: a = HH(h)
1502
+ sage: a
1503
+ p-adic automorphic form of cohomological weight 0
1504
+
1505
+ AUTHORS:
1506
+
1507
+ - Cameron Franc (2012-02-20)
1508
+ - Marc Masdeu
1509
+ """
1510
+ def __init__(self, parent, vec):
1511
+ """
1512
+ Create a pAdicAutomorphicFormElement.
1513
+
1514
+ EXAMPLES::
1515
+
1516
+ sage: X = BruhatTitsQuotient(17,3)
1517
+ sage: A = X.padic_automorphic_forms(2,prec=10)
1518
+ sage: TestSuite(A.an_element()).run()
1519
+ """
1520
+ self._num_generators = len(parent._list)
1521
+ self._cached_values = {}
1522
+ self._R = Qp(parent.prime(), prec=parent._prec)
1523
+ self._value = [parent._U(v) for v in vec]
1524
+ ModuleElement.__init__(self, parent)
1525
+
1526
+ def _add_(self, g):
1527
+ r"""
1528
+ This function adds two `p`-adic automorphic forms.
1529
+
1530
+ INPUT:
1531
+
1532
+ - ``g`` -- a `p`-adic automorphic form
1533
+
1534
+ OUTPUT: the result of adding ``g`` to ``self``
1535
+
1536
+ EXAMPLES::
1537
+
1538
+ sage: X = BruhatTitsQuotient(17,3)
1539
+ sage: A = X.padic_automorphic_forms(2,prec=10)
1540
+ sage: a = A.an_element()
1541
+ sage: b = a + a # indirect doctest
1542
+ """
1543
+ # Should ensure that self and g are of the same weight and on
1544
+ # the same curve
1545
+ vec = [self._value[e] + g._value[e]
1546
+ for e in range(self._num_generators)]
1547
+ return self.parent()(vec)
1548
+
1549
+ def _sub_(self, g):
1550
+ r"""
1551
+ This function subtracts a `p`-adic automorphic form from another.
1552
+
1553
+ INPUT:
1554
+
1555
+ - ``g`` -- a `p`-adic automorphic form
1556
+
1557
+ OUTPUT: the result of subtracting ``g`` from ``self``
1558
+
1559
+ EXAMPLES::
1560
+
1561
+ sage: X = BruhatTitsQuotient(17,3)
1562
+ sage: A = X.padic_automorphic_forms(2,prec=10)
1563
+ sage: a = A.an_element()
1564
+ sage: b = a - a # indirect doctest
1565
+ sage: b == 0
1566
+ True
1567
+ """
1568
+ # Should ensure that self and g are of the same weight and on
1569
+ # the same curve
1570
+ vec = [self._value[e] - g._value[e]
1571
+ for e in range(self._num_generators)]
1572
+ return self.parent()(vec)
1573
+
1574
+ def _richcmp_(self, other, op):
1575
+ r"""
1576
+ Test for equality of pAdicAutomorphicForm elements.
1577
+
1578
+ INPUT:
1579
+
1580
+ - ``other`` -- another `p`-automorphic form
1581
+
1582
+ EXAMPLES::
1583
+
1584
+ sage: X = BruhatTitsQuotient(5,23)
1585
+ sage: H = X.harmonic_cocycles(2,prec=10)
1586
+ sage: A = X.padic_automorphic_forms(2,prec=10)
1587
+ sage: v1 = A(H.basis()[0])
1588
+ sage: v2 = 3*v1
1589
+ sage: 2*v1 == v2-v1 # indirect doctest
1590
+ True
1591
+ """
1592
+ if op not in [op_EQ, op_NE]:
1593
+ return NotImplemented
1594
+
1595
+ b = all(self._value[e] == other._value[e]
1596
+ for e in range(self._num_generators))
1597
+ if op == op_EQ:
1598
+ return b
1599
+ return not b
1600
+
1601
+ def __bool__(self):
1602
+ """
1603
+ Tell whether the form is zero or not.
1604
+
1605
+ OUTPUT: boolean; whether ``self`` is zero
1606
+
1607
+ EXAMPLES::
1608
+
1609
+ sage: X = BruhatTitsQuotient(5,23)
1610
+ sage: H = X.harmonic_cocycles(4,prec = 20)
1611
+ sage: A = X.padic_automorphic_forms(4,prec = 20)
1612
+ sage: v1 = A(H.basis()[1])
1613
+ sage: bool(v1)
1614
+ True
1615
+ sage: v2 = v1-v1
1616
+ sage: bool(v2)
1617
+ False
1618
+ """
1619
+ return any(not o.is_zero() for o in self._value)
1620
+
1621
+ def __getitem__(self, e1):
1622
+ r"""
1623
+ Evaluate a `p`-adic automorphic form on a matrix in `GL_2(\QQ_p)`.
1624
+
1625
+ INPUT:
1626
+
1627
+ - ``e1`` -- a matrix in `GL_2(\QQ_p)`
1628
+
1629
+ OUTPUT: the value of ``self`` evaluated on ``e1``
1630
+
1631
+ EXAMPLES::
1632
+
1633
+ sage: X = BruhatTitsQuotient(17,3)
1634
+ sage: M = X.harmonic_cocycles(2,prec=5)
1635
+ sage: A = X.padic_automorphic_forms(2,prec=5)
1636
+ sage: a = A(M.gen(0))
1637
+ sage: a[Matrix(ZZ,2,2,[1,2,3,4])]
1638
+ 8 + 8*17 + 8*17^2 + 8*17^3 + 8*17^4 + O(17^5)
1639
+ """
1640
+ return self.evaluate(e1)
1641
+
1642
+ def evaluate(self, e1):
1643
+ r"""
1644
+ Evaluate a `p`-adic automorphic form on a matrix in `GL_2(\QQ_p)`.
1645
+
1646
+ INPUT:
1647
+
1648
+ - ``e1`` -- a matrix in `GL_2(\QQ_p)`
1649
+
1650
+ OUTPUT: the value of ``self`` evaluated on ``e1``
1651
+
1652
+ EXAMPLES::
1653
+
1654
+ sage: X = BruhatTitsQuotient(7,5)
1655
+ sage: M = X.harmonic_cocycles(2,prec=5)
1656
+ sage: A = X.padic_automorphic_forms(2,prec=5)
1657
+ sage: a = A(M.basis()[0])
1658
+ sage: a.evaluate(Matrix(ZZ,2,2,[1,2,3,1]))
1659
+ 4 + 6*7 + 6*7^2 + 6*7^3 + 6*7^4 + O(7^5)
1660
+ sage: a.evaluate(Matrix(ZZ,2,2,[17,0,0,1]))
1661
+ 1 + O(7^5)
1662
+ """
1663
+ X = self.parent()._source
1664
+ p = self.parent().prime()
1665
+ u = DoubleCosetReduction(X, e1)
1666
+ tmp = ((u.t(self.parent()._U.base_ring().precision_cap())) * p ** (u.power)).adjugate()
1667
+ S0 = self.parent()._Sigma0
1668
+ return S0(tmp, check=False) * self._value[u.label]
1669
+ # Warning! Should remove check=False...
1670
+
1671
+ def _lmul_(self, a):
1672
+ r"""
1673
+ Multiply the automorphic form by a scalar.
1674
+
1675
+ INPUT:
1676
+
1677
+ - ``a`` -- a scalar
1678
+
1679
+ EXAMPLES::
1680
+
1681
+ sage: X = BruhatTitsQuotient(17,3)
1682
+ sage: M = X.harmonic_cocycles(2,prec=5)
1683
+ sage: A = X.padic_automorphic_forms(2,prec=5)
1684
+ sage: a = A(M.basis()[0])
1685
+ sage: a.evaluate(Matrix(ZZ,2,2,[1,2,3,4]))
1686
+ 8 + 8*17 + 8*17^2 + 8*17^3 + 8*17^4 + O(17^5)
1687
+ sage: b = 2*a # indirect doctest
1688
+ sage: b.evaluate(Matrix(ZZ,2,2,[1,2,3,4]))
1689
+ 16 + 16*17 + 16*17^2 + 16*17^3 + 16*17^4 + O(17^5)
1690
+ """
1691
+ # Should ensure that 'a' is a scalar
1692
+ return self.parent()([a * self._value[e]
1693
+ for e in range(self._num_generators)])
1694
+
1695
+ def _repr_(self):
1696
+ r"""
1697
+ This returns the representation of ``self`` as a string.
1698
+
1699
+ If ``self`` corresponds to a modular form of weight `k`, then the
1700
+ cohomological weight is `k-2`.
1701
+
1702
+ EXAMPLES::
1703
+
1704
+ sage: X = BruhatTitsQuotient(17,3)
1705
+ sage: A = X.padic_automorphic_forms(2,prec=10)
1706
+ sage: a = A.an_element()
1707
+ sage: a # indirect doctest
1708
+ p-adic automorphic form of cohomological weight 0
1709
+ """
1710
+ return 'p-adic automorphic form of cohomological weight %s' % self.parent()._U.weight()
1711
+
1712
+ def valuation(self):
1713
+ r"""
1714
+ The valuation of ``self``, defined as the minimum of the
1715
+ valuations of the values that it takes on a set of edge
1716
+ representatives.
1717
+
1718
+ OUTPUT: integer
1719
+
1720
+ EXAMPLES::
1721
+
1722
+ sage: X = BruhatTitsQuotient(17,3)
1723
+ sage: M = X.harmonic_cocycles(2,prec=10)
1724
+ sage: A = X.padic_automorphic_forms(2,prec=10)
1725
+ sage: a = A(M.gen(0))
1726
+ sage: a.valuation()
1727
+ 0
1728
+ sage: (17*a).valuation()
1729
+ 1
1730
+ """
1731
+ return min(self._value[e].valuation()
1732
+ for e in range(self._num_generators))
1733
+
1734
+ def _improve(self, hc):
1735
+ r"""
1736
+ Repeatedly apply the `U_p` operator to a `p`-adic
1737
+ automorphic form. This is used to compute moments of a measure
1738
+ associated to a rigid modular form in the following way: lift
1739
+ a rigid modular form to an overconvergent `p`-adic
1740
+ automorphic form in any way, and then repeatedly apply `U_p`
1741
+ to project to the ordinary part. The resulting form encodes
1742
+ the moments of the measure of the original rigid modular form
1743
+ (assuming it is ordinary).
1744
+
1745
+ EXAMPLES::
1746
+
1747
+ sage: X = BruhatTitsQuotient(7,2)
1748
+ sage: H = X.harmonic_cocycles(2,prec = 10)
1749
+ sage: h = H.gen(0)
1750
+ sage: A = X.padic_automorphic_forms(2,prec = 10,overconvergent=True)
1751
+ sage: a = A.lift(h) # indirect doctest
1752
+
1753
+ REFERENCES:
1754
+
1755
+ For details see [Gr2006]_. Alternatively, one can look at
1756
+ [DP]_ for the analogous algorithm in the case of modular symbols.
1757
+
1758
+ AUTHORS:
1759
+
1760
+ - Cameron Franc (2012-02-20)
1761
+ - Marc Masdeu
1762
+ """
1763
+ MMM = self.parent()
1764
+ U = MMM._U
1765
+
1766
+ h1 = MMM([o.lift(M=MMM.precision_cap()) for o in self._value])
1767
+ h2 = MMM._apply_Up_operator(h1, True)
1768
+ verbose("Applied Up once")
1769
+ ii = 0
1770
+ current_val = 0
1771
+ init_val = self.valuation()
1772
+ old_val = init_val - 1
1773
+ while current_val > old_val:
1774
+ old_val = current_val
1775
+ ii += 1
1776
+ h1._value = [U(c) for c in h2._value]
1777
+ h2 = MMM._apply_Up_operator(h1, True)
1778
+ current_val = (h2 - h1).valuation() - init_val
1779
+ verbose('val = %s' % current_val)
1780
+ if current_val is Infinity:
1781
+ break
1782
+ verbose('Applied Up %s times' % (ii + 1))
1783
+ return h2
1784
+
1785
+ def integrate(self, f, center=1, level=0, method='moments'):
1786
+ r"""
1787
+ Calculate
1788
+
1789
+ .. MATH::
1790
+
1791
+ \int_{\mathbf{P}^1(\QQ_p)} f(x)d\mu(x)
1792
+
1793
+ were `\mu` is the measure associated to ``self``.
1794
+
1795
+ INPUT:
1796
+
1797
+ - ``f`` -- an analytic function
1798
+
1799
+ - ``center`` -- 2x2 matrix over `\QQ_p` (default: 1)
1800
+
1801
+ - ``level`` -- integer (default: 0)
1802
+
1803
+ - ``method`` -- string (default: ``'moments'``); which method of
1804
+ integration to use. Either ``'moments'`` or ``'riemann_sum'``.
1805
+
1806
+ EXAMPLES:
1807
+
1808
+ Integrating the Poisson kernel against a measure yields a
1809
+ value of the associated modular form. Such values can be
1810
+ computed efficiently using the overconvergent method, as long
1811
+ as one starts with an ordinary form::
1812
+
1813
+ sage: X = BruhatTitsQuotient(7,2)
1814
+ sage: X.genus()
1815
+ 1
1816
+
1817
+ Since the genus is 1, the space of weight 2 forms is 1
1818
+ dimensional. Hence any nonzero form will be a `U_7`
1819
+ eigenvector. By Jacquet-Langlands and Cerednik-Drinfeld, in
1820
+ this case the Hecke eigenvalues correspond to that of any
1821
+ nonzero form on `\Gamma_0(14)` of weight `2`. Such a form is
1822
+ ordinary at `7`, and so we can apply the overconvergent method
1823
+ directly to this form without `p`-stabilizing::
1824
+
1825
+ sage: H = X.harmonic_cocycles(2,prec = 5)
1826
+ sage: h = H.gen(0)
1827
+ sage: A = X.padic_automorphic_forms(2,prec = 5,overconvergent=True)
1828
+ sage: a = A.lift(h)
1829
+ sage: a._value[0].moment(2)
1830
+ 2 + 6*7 + 4*7^2 + 4*7^3 + 6*7^4 + O(7^5)
1831
+
1832
+ Now that we've lifted our harmonic cocycle to an
1833
+ overconvergent automorphic form we simply need to define the
1834
+ Teitelbaum-Poisson Kernel, and then integrate::
1835
+
1836
+ sage: Kp.<x> = Qq(49,prec = 5)
1837
+ sage: z = Kp['z'].gen()
1838
+ sage: f = 1/(z-x)
1839
+ sage: a.integrate(f)
1840
+ (5*x + 5) + (4*x + 4)*7 + (5*x + 5)*7^2 + (5*x + 6)*7^3 + O(7^5)
1841
+
1842
+ AUTHORS:
1843
+
1844
+ - Cameron Franc (2012-02-20)
1845
+ - Marc Masdeu (2012-02-20)
1846
+ """
1847
+ E = self.parent()._source._BT.get_balls(center, level)
1848
+ R1 = LaurentSeriesRing(f.base_ring(), 'r1', default_prec=self.parent()._U.base_ring().precision_cap() + 1)
1849
+ R2 = PolynomialRing(f.base_ring(), 'x')
1850
+ x = R2.gen()
1851
+ value = 0
1852
+ if method == 'riemann_sum':
1853
+ for e in E:
1854
+ 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]]))
1855
+ new = eval_dist_at_powseries(self.evaluate(e), exp.truncate(self.parent()._U.weight() + 1))
1856
+ value += new
1857
+ elif method == 'moments':
1858
+ n = self.parent()._U.weight()
1859
+ for e in E:
1860
+ a, b, c, d = e.list()
1861
+ delta = e.determinant()
1862
+ verbose('%s' % (R2([e[0, 1], e[0, 0]])
1863
+ / R2([e[1, 1], e[1, 0]])))
1864
+ tmp = ((c * x + d) ** n * delta ** -ZZ(n // 2)) * f((a * x + b) / (c * x + d))
1865
+ exp = R1(tmp.numerator()) / R1(tmp.denominator())
1866
+ new = eval_dist_at_powseries(self.evaluate(e), exp)
1867
+
1868
+ value += new
1869
+ else:
1870
+ print('The available methods are either "moments" or "riemann_sum". The latter is only provided for consistency check, and should never be used.')
1871
+ return False
1872
+ return value
1873
+
1874
+ def modular_form(self, z=None, level=0, method='moments'):
1875
+ r"""
1876
+ Return the modular form corresponding to ``self``.
1877
+
1878
+ INPUT:
1879
+
1880
+ - ``z`` -- (default: ``None``) if specified, returns the value of
1881
+ the form at the point ``z`` in the `p`-adic upper half
1882
+ plane
1883
+
1884
+ - ``level`` -- integer (default: 0); if ``method`` is
1885
+ 'riemann_sum', will use a covering of `P^1(\QQ_p)` with
1886
+ balls of size `p^-\mbox{level}`
1887
+
1888
+ - ``method`` -- string (default: ``'moments'``); it must be
1889
+ either ``'moments'`` or ``'riemann_sum'``
1890
+
1891
+ OUTPUT:
1892
+
1893
+ A function from the `p`-adic upper half plane to `\CC_p`. If
1894
+ an argument ``z`` was passed, returns instead the value at
1895
+ that point.
1896
+
1897
+ EXAMPLES:
1898
+
1899
+ Integrating the Poisson kernel against a measure yields a
1900
+ value of the associated modular form. Such values can be
1901
+ computed efficiently using the overconvergent method, as long
1902
+ as one starts with an ordinary form::
1903
+
1904
+ sage: X = BruhatTitsQuotient(7, 2)
1905
+ sage: X.genus()
1906
+ 1
1907
+
1908
+ Since the genus is 1, the space of weight 2 forms is 1
1909
+ dimensional. Hence any nonzero form will be a `U_7`
1910
+ eigenvector. By Jacquet-Langlands and Cerednik-Drinfeld, in
1911
+ this case the Hecke eigenvalues correspond to that of any
1912
+ nonzero form on `\Gamma_0(14)` of weight `2`. Such a form is
1913
+ ordinary at `7`, and so we can apply the overconvergent method
1914
+ directly to this form without `p`-stabilizing::
1915
+
1916
+ sage: H = X.harmonic_cocycles(2,prec = 5)
1917
+ sage: A = X.padic_automorphic_forms(2,prec = 5,overconvergent=True)
1918
+ sage: f0 = A.lift(H.basis()[0])
1919
+
1920
+ Now that we've lifted our harmonic cocycle to an
1921
+ overconvergent automorphic form, we extract the associated
1922
+ modular form as a function and test the modular property::
1923
+
1924
+ sage: T.<x> = Qq(7^2,prec = 5)
1925
+ sage: f = f0.modular_form(method = 'moments')
1926
+ sage: a,b,c,d = X.embed_quaternion(X.get_units_of_order()[1]).change_ring(T.base_ring()).list()
1927
+ sage: ((c*x + d)^2*f(x)-f((a*x + b)/(c*x + d))).valuation()
1928
+ 5
1929
+ """
1930
+ return self.derivative(z, level, method, order=0)
1931
+
1932
+ def derivative(self, z=None, level=0, method='moments', order=1):
1933
+ r"""
1934
+ Return the derivative of the modular form corresponding to
1935
+ ``self``.
1936
+
1937
+ INPUT:
1938
+
1939
+ - ``z`` -- (default: ``None``) if specified, evaluates the derivative
1940
+ at the point ``z`` in the `p`-adic upper half plane
1941
+
1942
+ - ``level`` -- integer (default: 0); if ``method`` is
1943
+ 'riemann_sum', will use a covering of `P^1(\QQ_p)` with
1944
+ balls of size `p^-\mbox{level}`.
1945
+
1946
+ - ``method`` -- string (default: ``'moments'``); it must be
1947
+ either ``'moments'`` or ``'riemann_sum'``
1948
+
1949
+ - ``order`` -- integer (default: 1); the order of the
1950
+ derivative to be computed
1951
+
1952
+ OUTPUT:
1953
+
1954
+ A function from the `p`-adic upper half plane to `\CC_p`. If
1955
+ an argument ``z`` was passed, returns instead the value of
1956
+ the derivative at that point.
1957
+
1958
+ EXAMPLES:
1959
+
1960
+ Integrating the Poisson kernel against a measure yields a
1961
+ value of the associated modular form. Such values can be
1962
+ computed efficiently using the overconvergent method, as long
1963
+ as one starts with an ordinary form::
1964
+
1965
+ sage: X = BruhatTitsQuotient(7, 2)
1966
+ sage: X.genus()
1967
+ 1
1968
+
1969
+ Since the genus is 1, the space of weight 2 forms is 1
1970
+ dimensional. Hence any nonzero form will be a `U_7`
1971
+ eigenvector. By Jacquet-Langlands and Cerednik-Drinfeld, in
1972
+ this case the Hecke eigenvalues correspond to that of any
1973
+ nonzero form on `\Gamma_0(14)` of weight `2`. Such a form is
1974
+ ordinary at `7`, and so we can apply the overconvergent method
1975
+ directly to this form without `p`-stabilizing::
1976
+
1977
+ sage: H = X.harmonic_cocycles(2,prec=5)
1978
+ sage: h = H.gen(0)
1979
+ sage: A = X.padic_automorphic_forms(2,prec=5,overconvergent=True)
1980
+ sage: f0 = A.lift(h)
1981
+
1982
+ Now that we've lifted our harmonic cocycle to an
1983
+ overconvergent automorphic form, we extract the associated
1984
+ modular form as a function and test the modular property::
1985
+
1986
+ sage: T.<x> = Qq(49,prec=10)
1987
+ sage: f = f0.modular_form()
1988
+ sage: g = X.get_embedding_matrix()*X.get_units_of_order()[1]
1989
+ sage: a,b,c,d = g.change_ring(T).list()
1990
+ sage: (c*x +d)^2*f(x)-f((a*x + b)/(c*x + d))
1991
+ O(7^5)
1992
+
1993
+ We can also compute the Shimura-Maass derivative, which is a
1994
+ nearly rigid analytic modular forms of weight 4::
1995
+
1996
+ sage: f = f0.derivative()
1997
+ sage: (c*x + d)^4*f(x)-f((a*x + b)/(c*x + d))
1998
+ O(7^5)
1999
+ """
2000
+ def F(z, level=level, method=method):
2001
+ R = PolynomialRing(z.parent(), 'x,y').fraction_field()
2002
+ Rx = PolynomialRing(z.parent(), 'x1').fraction_field()
2003
+ x1 = Rx.gen()
2004
+ subst = R.hom([x1, z], codomain=Rx)
2005
+ x, y = R.gens()
2006
+ center = self.parent()._source._BT.find_containing_affinoid(z)
2007
+ zbar = z.trace() - z
2008
+ f = R(1) / (x - y)
2009
+ k = self.parent()._n + 2
2010
+ V = [f]
2011
+ for ii in range(order):
2012
+ V = [v.derivative(y) for v in V] + [k / (y - zbar) * v
2013
+ for v in V]
2014
+ k += 2
2015
+ return sum(self.integrate(subst(v), center, level, method)
2016
+ for v in V)
2017
+ if z is None:
2018
+ return F
2019
+
2020
+ return F(z, level, method)
2021
+
2022
+ # So far we cannot break it into two integrals because of the pole
2023
+ # at infinity.
2024
+ def coleman(self, t1, t2, E=None, method='moments', mult=False):
2025
+ r"""
2026
+ If ``self`` is a `p`-adic automorphic form that
2027
+ corresponds to a rigid modular form, then this computes the
2028
+ Coleman integral of this form between two points on the
2029
+ boundary `P^1(\QQ_p)` of the `p`-adic upper half plane.
2030
+
2031
+ INPUT:
2032
+
2033
+ - ``t1``, ``t2`` -- elements of `P^1(\QQ_p)` (the endpoints
2034
+ of integration)
2035
+
2036
+ - ``E`` -- (default: ``None``) if specified, will not compute the
2037
+ covering adapted to ``t1`` and ``t2`` and instead use the
2038
+ given one. In that case, ``E`` should be a list of matrices
2039
+ corresponding to edges describing the open balls to be
2040
+ considered.
2041
+
2042
+ - ``method`` -- string (default: ``'moments'``); tells which
2043
+ algorithm to use (alternative is ``'riemann_sum'``, which is
2044
+ unsuitable for computations requiring high precision)
2045
+
2046
+ - ``mult`` -- boolean (default: ``False``); whether to compute the
2047
+ multiplicative version
2048
+
2049
+ OUTPUT: the result of the Coleman integral
2050
+
2051
+ EXAMPLES::
2052
+
2053
+ sage: p = 7
2054
+ sage: lev = 2
2055
+ sage: prec = 10
2056
+ sage: X = BruhatTitsQuotient(p, lev)
2057
+ sage: k = 2
2058
+ sage: M = X.harmonic_cocycles(k, prec)
2059
+ sage: B = M.basis()
2060
+ sage: f = 3*B[0]
2061
+ sage: MM = X.padic_automorphic_forms(k, prec, overconvergent=True)
2062
+ sage: D = -11
2063
+ sage: X.is_admissible(D)
2064
+ True
2065
+ sage: K.<a> = QuadraticField(D)
2066
+ sage: Kp.<g> = Qq(p**2, prec)
2067
+ sage: P = Kp.gen()
2068
+ sage: Q = 2 + Kp.gen() + p*(Kp.gen()+1)
2069
+ sage: F = MM.lift(f) # long time
2070
+ sage: J0 = F.coleman(P, Q, mult=True) # long time
2071
+
2072
+ AUTHORS:
2073
+
2074
+ - Cameron Franc (2012-02-20)
2075
+ - Marc Masdeu (2012-02-20)
2076
+ """
2077
+ p = self.parent().prime()
2078
+ K = t1.parent()
2079
+ R = PolynomialRing(K, 'x')
2080
+ x = R.gen()
2081
+ R1 = LaurentSeriesRing(K, 'r1', default_prec=self.parent()._U.base_ring().precision_cap())
2082
+ if E is None:
2083
+ E = self.parent()._source._BT.find_covering(t1, t2)
2084
+ value = 0
2085
+ value_exp = K(1)
2086
+ if method == 'riemann_sum':
2087
+ for e in E:
2088
+ b = e[0, 1]
2089
+ d = e[1, 1]
2090
+ y = (b - d * t1) / (b - d * t2)
2091
+ poly = R1(y.log())
2092
+ c_e = self.evaluate(e)
2093
+ new = eval_dist_at_powseries(c_e, poly)
2094
+ value += new
2095
+ if mult:
2096
+ value_exp *= K.teichmuller(y) ** Integer(c_e.moment(0).rational_reconstruction())
2097
+
2098
+ elif method == 'moments':
2099
+ for e in E:
2100
+ f = (x - t1) / (x - t2)
2101
+ a, b, c, d = e.list()
2102
+ y0 = f(R1([b, a]) / R1([d, c])) # f( (ax+b)/(cx+d) )
2103
+ y0 = p ** (-y0(ZZ(0)).valuation()) * y0
2104
+ mu = K.teichmuller(y0(ZZ(0)))
2105
+ y = y0 / mu - 1
2106
+ poly = R1(0)
2107
+ ypow = y
2108
+ for jj in range(1, R1.default_prec() + 10):
2109
+ poly += (-1) ** (jj + 1) * ypow / jj
2110
+ ypow *= y
2111
+ c_e = self.evaluate(e)
2112
+ new = eval_dist_at_powseries(c_e, poly)
2113
+ if hasattr(new, 'degree'):
2114
+ assert 0
2115
+ value += new
2116
+ if mult:
2117
+ value_exp *= K.teichmuller((b - d * t1) / (b - d * t2)) ** Integer(c_e.moment(0).rational_reconstruction())
2118
+
2119
+ else:
2120
+ 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.')
2121
+ return False
2122
+ if mult:
2123
+ return K.teichmuller(value_exp) * value.exp()
2124
+ return value
2125
+
2126
+
2127
+ class pAdicAutomorphicForms(Module, UniqueRepresentation):
2128
+ Element = pAdicAutomorphicFormElement
2129
+
2130
+ @staticmethod
2131
+ def __classcall__(cls, domain, U, prec=None, t=None, R=None,
2132
+ overconvergent=False):
2133
+ r"""
2134
+ The module of (quaternionic) `p`-adic automorphic forms.
2135
+
2136
+ INPUT:
2137
+
2138
+ - ``domain`` -- a BruhatTitsQuotient
2139
+
2140
+ - ``U`` -- a distributions module or an integer. If ``U`` is a
2141
+ distributions module then this creates the relevant space of
2142
+ automorphic forms. If ``U`` is an integer then the coefficients
2143
+ are the (`U-2`)nd power of the symmetric representation of
2144
+ `GL_2(\QQ_p)`.
2145
+
2146
+ - ``prec`` -- a precision (default: ``None``); if not ``None`` should
2147
+ be a positive integer
2148
+
2149
+ - ``t`` -- (default: ``None``) the number of additional moments to
2150
+ store. If ``None``, determine it automatically from ``prec``, ``U``
2151
+ and the ``overconvergent`` flag.
2152
+
2153
+ - ``R`` -- (default: ``None``) if specified, coefficient field of the automorphic forms.
2154
+ If not specified it defaults to the base ring of the distributions ``U``, or to `Q_p`
2155
+ with the working precision ``prec``.
2156
+
2157
+ - ``overconvergent`` -- boolean (default: ``False``); if ``True``, will construct overconvergent
2158
+ `p`-adic automorphic forms. Otherwise it constructs the finite dimensional space of
2159
+ `p`-adic automorphic forms which is isomorphic to the space of harmonic cocycles.
2160
+
2161
+ EXAMPLES:
2162
+
2163
+ The space of weight 2 p-automorphic forms is isomorphic with
2164
+ the space of scalar valued invariant harmonic cocycles::
2165
+
2166
+ sage: X = BruhatTitsQuotient(11,5)
2167
+ sage: H0 = X.padic_automorphic_forms(2,10)
2168
+ sage: H1 = X.padic_automorphic_forms(2,prec = 10)
2169
+ sage: H0 == H1
2170
+ True
2171
+
2172
+ AUTHORS:
2173
+
2174
+ - Cameron Franc (2012-02-20)
2175
+ - Marc Masdeu (2012-02-20)
2176
+ """
2177
+ return super().__classcall__(cls, domain, U,
2178
+ prec, t, R,
2179
+ overconvergent)
2180
+
2181
+ def __init__(self, domain, U, prec=None, t=None, R=None,
2182
+ overconvergent=False):
2183
+ """
2184
+ Create a space of `p`-automorphic forms.
2185
+
2186
+ EXAMPLES::
2187
+
2188
+ sage: X = BruhatTitsQuotient(11,5)
2189
+ sage: H = X.harmonic_cocycles(2,prec=10)
2190
+ sage: A = X.padic_automorphic_forms(2,prec=10)
2191
+ sage: TestSuite(A).run()
2192
+ """
2193
+ if R is None:
2194
+ if not isinstance(U, Integer):
2195
+ self._R = U.base_ring()
2196
+ else:
2197
+ if prec is None:
2198
+ prec = 100
2199
+ self._R = Qp(domain._p, prec)
2200
+ else:
2201
+ self._R = R
2202
+ # U is a CoefficientModuleSpace
2203
+ if isinstance(U, Integer):
2204
+ if t is None:
2205
+ if overconvergent:
2206
+ t = prec - U + 1
2207
+ else:
2208
+ t = 0
2209
+ if overconvergent:
2210
+ self._U = OverconvergentDistributions(U - 2, base=self._R,
2211
+ prec_cap=U - 1 + t,
2212
+ act_on_left=True,
2213
+ adjuster=_btquot_adjuster(),
2214
+ dettwist=-ZZ((U - 2) // 2),
2215
+ act_padic=True)
2216
+ else:
2217
+ self._U = Symk(U - 2, base=self._R, act_on_left=True,
2218
+ adjuster=_btquot_adjuster(),
2219
+ dettwist=-ZZ((U - 2) // 2),
2220
+ act_padic=True)
2221
+ else:
2222
+ self._U = U
2223
+ self._source = domain
2224
+ self._list = self._source.get_list() # Contains also the opposite edges
2225
+ self._prec = self._R.precision_cap()
2226
+ self._n = self._U.weight()
2227
+ self._p = self._source._p
2228
+
2229
+ self._Sigma0 = self._U._act._Sigma0
2230
+
2231
+ Module.__init__(self, base=self._R)
2232
+ self._populate_coercion_lists_()
2233
+
2234
+ def prime(self):
2235
+ """
2236
+ Return the underlying prime.
2237
+
2238
+ OUTPUT: ``p`` -- prime integer
2239
+
2240
+ EXAMPLES::
2241
+
2242
+ sage: X = BruhatTitsQuotient(11,5)
2243
+ sage: H = X.harmonic_cocycles(2,prec = 10)
2244
+ sage: A = X.padic_automorphic_forms(2,prec = 10)
2245
+ sage: A.prime()
2246
+ 11
2247
+ """
2248
+ return self._p
2249
+
2250
+ def zero(self):
2251
+ r"""
2252
+ Return the zero element of ``self``.
2253
+
2254
+ EXAMPLES::
2255
+
2256
+ sage: X = BruhatTitsQuotient(5, 7)
2257
+ sage: H1 = X.padic_automorphic_forms( 2, prec=10)
2258
+ sage: H1.zero() == 0
2259
+ True
2260
+ """
2261
+ return self.element_class(self, [self._U(0) for o in self._list])
2262
+
2263
+ def __eq__(self, other):
2264
+ r"""
2265
+ Test whether two pAdicAutomorphicForm spaces are equal.
2266
+
2267
+ INPUT:
2268
+
2269
+ - ``other`` -- another space of `p`-automorphic forms
2270
+
2271
+ OUTPUT: boolean
2272
+
2273
+ EXAMPLES::
2274
+
2275
+ sage: X = BruhatTitsQuotient(5,7)
2276
+ sage: H1 = X.padic_automorphic_forms(2,prec = 10)
2277
+ sage: H2 = X.padic_automorphic_forms(2,prec = 10)
2278
+ sage: H1 == H2
2279
+ True
2280
+ """
2281
+ if not isinstance(other, pAdicAutomorphicForms):
2282
+ return False
2283
+
2284
+ return (self.base_ring() == other.base_ring() and
2285
+ self._source == other._source and
2286
+ self._U == other._U)
2287
+
2288
+ def __ne__(self, other):
2289
+ r"""
2290
+ Test whether two pAdicAutomorphicForm spaces are not equal.
2291
+
2292
+ INPUT:
2293
+
2294
+ - ``other`` -- another space of `p`-automorphic forms
2295
+
2296
+ OUTPUT: boolean
2297
+
2298
+ EXAMPLES::
2299
+
2300
+ sage: X = BruhatTitsQuotient(5,7)
2301
+ sage: H1 = X.padic_automorphic_forms(2,prec = 10)
2302
+ sage: H2 = X.padic_automorphic_forms(2,prec = 10)
2303
+ sage: H1 == H2
2304
+ True
2305
+ """
2306
+ return not self.__eq__(other)
2307
+
2308
+ def __hash__(self):
2309
+ """
2310
+ Return the hash of ``self``.
2311
+
2312
+ EXAMPLES::
2313
+
2314
+ sage: X = BruhatTitsQuotient(5,7)
2315
+ sage: H1 = X.padic_automorphic_forms(2,prec = 10)
2316
+ sage: H2 = X.padic_automorphic_forms(2,prec = 10)
2317
+ sage: hash(H1) == hash(H2)
2318
+ True
2319
+ """
2320
+ return hash((self.base_ring(), self._source, self._U))
2321
+
2322
+ def _repr_(self):
2323
+ r"""
2324
+ Return the representation of ``self`` as a string.
2325
+
2326
+ EXAMPLES::
2327
+
2328
+ sage: X = BruhatTitsQuotient(3,7)
2329
+ sage: A = X.padic_automorphic_forms(2,prec = 10)
2330
+ sage: A # indirect doctest
2331
+ 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
2332
+ """
2333
+ s = 'Space of automorphic forms on '
2334
+ s += str(self._source)
2335
+ s += ' with values in ' + str(self._U)
2336
+ return s
2337
+
2338
+ def _coerce_map_from_(self, S):
2339
+ r"""
2340
+ Can coerce from other BruhatTitsHarmonicCocycles or from pAdicAutomorphicForms.
2341
+
2342
+ INPUT:
2343
+
2344
+ - ``S`` -- a BruhatTitsHarmonicCocycle or pAdicAutomorphicForm
2345
+
2346
+ OUTPUT: boolean; ``True`` if and only if `S` is coercible into ``self``
2347
+
2348
+ EXAMPLES::
2349
+
2350
+ sage: X = BruhatTitsQuotient(3,7)
2351
+ sage: H = X.harmonic_cocycles(2,prec=10)
2352
+ sage: A = X.padic_automorphic_forms(2,prec=10)
2353
+ sage: A._coerce_map_from_(H)
2354
+ True
2355
+ """
2356
+ if isinstance(S, BruhatTitsHarmonicCocycles):
2357
+ if S.weight() - 2 != self._n:
2358
+ return False
2359
+ if S._X != self._source:
2360
+ return False
2361
+ return True
2362
+ if isinstance(S, pAdicAutomorphicForms):
2363
+ if S._n != self._n:
2364
+ return False
2365
+ if S._source != self._source:
2366
+ return False
2367
+ return True
2368
+ return False
2369
+
2370
+ def _element_constructor_(self, data):
2371
+ r"""
2372
+ Construct a `p`-automorphic form.
2373
+
2374
+ INPUT:
2375
+
2376
+ - ``data`` -- defining data. Can be either a harmonic cocycle, or a `p`-adic automorphic form,
2377
+ or a list of elements coercible into the module of coefficients of ``self``
2378
+
2379
+ OUTPUT: a `p`-adic automorphic form
2380
+
2381
+ EXAMPLES::
2382
+
2383
+ sage: X = BruhatTitsQuotient(13,5)
2384
+ sage: H = X.harmonic_cocycles(2,prec=10)
2385
+ sage: h = H.an_element() # indirect doctest
2386
+ sage: A = X.padic_automorphic_forms(2,prec=10)
2387
+ sage: A(h)
2388
+ p-adic automorphic form of cohomological weight 0
2389
+ """
2390
+ # Code how to coerce x into the space
2391
+ # Admissible values of x?
2392
+ if isinstance(data, list):
2393
+ return self.element_class(self, [self._U(o, normalize=False) for o in data])
2394
+
2395
+ if isinstance(data, pAdicAutomorphicFormElement):
2396
+ vals = [self._U(o, normalize=False) for o in data._value]
2397
+ return self.element_class(self, vals)
2398
+
2399
+ if isinstance(data, BruhatTitsHarmonicCocycleElement):
2400
+ E = self._list
2401
+ tmp = []
2402
+ F = []
2403
+ Uold = data.parent()._U
2404
+ for ii in range(len(data._F)):
2405
+ newtmp = data.parent()._Sigma0(E[ii].rep.inverse(), check=False) * Uold(data._F[ii],
2406
+ normalize=False)
2407
+ tmp.append(newtmp)
2408
+ F.append(newtmp)
2409
+ A = data.parent()._Sigma0(Matrix(QQ, 2, 2, [0, ~self.prime(), 1, 0]), check=False)
2410
+ F.extend(-(A * tmp[ii]) for ii in range(len(data._F)))
2411
+ vals = self._make_invariant([self._U(o, normalize=False) for o in F])
2412
+ return self.element_class(self, vals)
2413
+ if data == 0:
2414
+ return self.zero()
2415
+
2416
+ def _an_element_(self):
2417
+ r"""
2418
+ Return an element of the module.
2419
+
2420
+ OUTPUT: a harmonic cocycle
2421
+
2422
+ EXAMPLES::
2423
+
2424
+ sage: X = BruhatTitsQuotient(13,5)
2425
+ sage: A = X.padic_automorphic_forms(2,prec=10)
2426
+ sage: A.an_element() # indirect doctest
2427
+ p-adic automorphic form of cohomological weight 0
2428
+ """
2429
+ return self(0)
2430
+
2431
+ def precision_cap(self):
2432
+ """
2433
+ Return the precision of ``self``.
2434
+
2435
+ OUTPUT: integer
2436
+
2437
+ EXAMPLES::
2438
+
2439
+ sage: X = BruhatTitsQuotient(13,11)
2440
+ sage: A = X.padic_automorphic_forms(2,prec=10)
2441
+ sage: A.precision_cap()
2442
+ 10
2443
+ """
2444
+ return self._prec
2445
+
2446
+ def lift(self, f):
2447
+ r"""
2448
+ Lift the harmonic cocycle ``f`` to a p-automorphic form.
2449
+
2450
+ If one is using overconvergent coefficients, then this will
2451
+ compute all of the moments of the measure associated to ``f``.
2452
+
2453
+ INPUT:
2454
+
2455
+ - ``f`` -- a harmonic cocycle
2456
+
2457
+ OUTPUT: a `p`-adic automorphic form
2458
+
2459
+ EXAMPLES:
2460
+
2461
+ If one does not work with an overconvergent form then lift
2462
+ does nothing::
2463
+
2464
+ sage: X = BruhatTitsQuotient(13,5)
2465
+ sage: H = X.harmonic_cocycles(2,prec=10)
2466
+ sage: h = H.gen(0)
2467
+ sage: A = X.padic_automorphic_forms(2,prec=10)
2468
+ sage: A.lift(h) # long time
2469
+ p-adic automorphic form of cohomological weight 0
2470
+
2471
+ With overconvergent forms, the input is lifted naively and its
2472
+ moments are computed::
2473
+
2474
+ sage: X = BruhatTitsQuotient(13,11)
2475
+ sage: H = X.harmonic_cocycles(2,prec=5)
2476
+ sage: A2 = X.padic_automorphic_forms(2,prec=5,overconvergent=True)
2477
+ sage: a = H.gen(0)
2478
+ sage: A2.lift(a) # long time
2479
+ p-adic automorphic form of cohomological weight 0
2480
+ """
2481
+ return self(f)._improve(f)
2482
+
2483
+ def _make_invariant(self, F):
2484
+ r"""
2485
+ Naively lift a ``classical`` automorphic form to an
2486
+ overconvergent form.
2487
+
2488
+ INPUT:
2489
+
2490
+ - ``F`` -- a classical (nonoverconvergent) pAdicAutomorphicForm or
2491
+ BruhatTitsHarmonicCocycle
2492
+
2493
+ OUTPUT: an overconvergent pAdicAutomorphicForm
2494
+
2495
+ EXAMPLES::
2496
+
2497
+ sage: X = BruhatTitsQuotient(13,11)
2498
+ sage: H = X.harmonic_cocycles(2,prec = 5)
2499
+ sage: A = X.padic_automorphic_forms(2,prec = 5)
2500
+ sage: h = H.basis()[0]
2501
+ sage: A.lift(h) # indirect doctest, long time
2502
+ p-adic automorphic form of cohomological weight 0
2503
+ """
2504
+ S = self._source.get_stabilizers()
2505
+ M = [e.rep for e in self._list]
2506
+ newF = []
2507
+ for ii in range(len(S)):
2508
+ Si = S[ii]
2509
+ x = self._U(F[ii], normalize=False)
2510
+
2511
+ if any(v[2] for v in Si):
2512
+ newFi = self._U(0)
2513
+ s = QQ(0)
2514
+ m = M[ii]
2515
+ for v in Si:
2516
+ s += 1
2517
+ g = self._Sigma0(m.adjugate() * self._source.embed_quaternion(v[0], prec=self._prec).adjugate() * m,
2518
+ check=False)
2519
+ newFi += g * x
2520
+ newF.append((QQ(1) / s) * newFi)
2521
+ else:
2522
+ newF.append(self._U(x, normalize=False))
2523
+ return newF
2524
+
2525
+ def _apply_Up_operator(self, f, scale=False, original_moments=None):
2526
+ r"""
2527
+ Apply the Up operator to ``f``.
2528
+
2529
+ INPUT:
2530
+
2531
+ - ``f`` -- a `p`-adic automorphic form
2532
+ - ``scale`` -- boolean (default: ``True``); whether to scale by the appropriate power of `p`
2533
+ at each iteration
2534
+
2535
+ EXAMPLES::
2536
+
2537
+ sage: X = BruhatTitsQuotient(3,11)
2538
+ sage: M = X.harmonic_cocycles(4,10)
2539
+ sage: A = X.padic_automorphic_forms(4,10, overconvergent = True)
2540
+ sage: F = A.lift(M.basis()[0]); F # indirect doctest
2541
+ p-adic automorphic form of cohomological weight 2
2542
+ """
2543
+ HeckeData = self._source._get_Up_data()
2544
+ S0 = f._value[0].parent()._act._Sigma0
2545
+ prec_cap = self._U.base_ring().precision_cap()
2546
+
2547
+ if not scale:
2548
+ factor = self._p ** (self._U.weight() // 2)
2549
+ else:
2550
+ factor = 1
2551
+
2552
+ # Save original moments
2553
+ if original_moments is None:
2554
+ original_moments = [[fval._moments[ii] for ii in range(self._n + 1)]
2555
+ for fval in f._value]
2556
+
2557
+ Tf = []
2558
+ for jj in range(len(self._list)):
2559
+ tmp = self._U(0, normalize=False)
2560
+ for gg, edge_list in HeckeData:
2561
+ u = edge_list[jj]
2562
+ tprec = 2 * (prec_cap + u.power) + 1
2563
+ r = S0(self._p ** -u.power * (u.t(tprec) * gg).adjugate(),
2564
+ check=False)
2565
+ tmp += r * f._value[u.label]
2566
+ tmp *= factor
2567
+ for ii in range(self._n + 1):
2568
+ tmp._moments[ii] = original_moments[jj][ii]
2569
+ Tf.append(tmp)
2570
+ return self(Tf)