passagemath-flint 10.6.1rc10__cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.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 (360) hide show
  1. passagemath_flint-10.6.1rc10.dist-info/METADATA +122 -0
  2. passagemath_flint-10.6.1rc10.dist-info/RECORD +360 -0
  3. passagemath_flint-10.6.1rc10.dist-info/WHEEL +6 -0
  4. passagemath_flint-10.6.1rc10.dist-info/top_level.txt +2 -0
  5. passagemath_flint.libs/libflint-3701249d.so.21.0.0 +0 -0
  6. passagemath_flint.libs/libgf2x-fbd36f80.so.3.0.0 +0 -0
  7. passagemath_flint.libs/libgfortran-8a9a71bc.so.5.0.0 +0 -0
  8. passagemath_flint.libs/libgmp-93ebf16a.so.10.5.0 +0 -0
  9. passagemath_flint.libs/libgsl-e3525837.so.28.0.0 +0 -0
  10. passagemath_flint.libs/libmpfi-ad12a86d.so.0.0.0 +0 -0
  11. passagemath_flint.libs/libmpfr-e0f11cf3.so.6.2.1 +0 -0
  12. passagemath_flint.libs/libntl-1004113e.so.44.0.1 +0 -0
  13. passagemath_flint.libs/libopenblasp-r0-4c5b64b1.3.29.so +0 -0
  14. sage/all__sagemath_flint.py +29 -0
  15. sage/combinat/all__sagemath_flint.py +1 -0
  16. sage/combinat/posets/all__sagemath_flint.py +1 -0
  17. sage/combinat/posets/hasse_cython_flint.cpython-313-aarch64-linux-gnu.so +0 -0
  18. sage/combinat/posets/hasse_cython_flint.pyx +194 -0
  19. sage/data_structures/all__sagemath_flint.py +1 -0
  20. sage/data_structures/bounded_integer_sequences.cpython-313-aarch64-linux-gnu.so +0 -0
  21. sage/data_structures/bounded_integer_sequences.pxd +62 -0
  22. sage/data_structures/bounded_integer_sequences.pyx +1418 -0
  23. sage/graphs/all__sagemath_flint.py +1 -0
  24. sage/graphs/chrompoly.cpython-313-aarch64-linux-gnu.so +0 -0
  25. sage/graphs/chrompoly.pyx +555 -0
  26. sage/graphs/matchpoly.cpython-313-aarch64-linux-gnu.so +0 -0
  27. sage/graphs/matchpoly.pyx +412 -0
  28. sage/libs/all__sagemath_flint.py +17 -0
  29. sage/libs/arb/__init__.py +1 -0
  30. sage/libs/arb/acb.pxd +154 -0
  31. sage/libs/arb/acb_calc.pxd +9 -0
  32. sage/libs/arb/acb_elliptic.pxd +25 -0
  33. sage/libs/arb/acb_hypgeom.pxd +74 -0
  34. sage/libs/arb/acb_mat.pxd +62 -0
  35. sage/libs/arb/acb_modular.pxd +17 -0
  36. sage/libs/arb/acb_poly.pxd +216 -0
  37. sage/libs/arb/arb.pxd +240 -0
  38. sage/libs/arb/arb_fmpz_poly.pxd +21 -0
  39. sage/libs/arb/arb_hypgeom.pxd +83 -0
  40. sage/libs/arb/arb_wrap.h +34 -0
  41. sage/libs/arb/arf.pxd +131 -0
  42. sage/libs/arb/arith.cpython-313-aarch64-linux-gnu.so +0 -0
  43. sage/libs/arb/arith.pyx +87 -0
  44. sage/libs/arb/bernoulli.pxd +6 -0
  45. sage/libs/arb/mag.pxd +77 -0
  46. sage/libs/arb/types.pxd +37 -0
  47. sage/libs/flint/__init__.py +1 -0
  48. sage/libs/flint/acb.pxd +270 -0
  49. sage/libs/flint/acb_calc.pxd +22 -0
  50. sage/libs/flint/acb_dft.pxd +51 -0
  51. sage/libs/flint/acb_dirichlet.pxd +112 -0
  52. sage/libs/flint/acb_elliptic.pxd +42 -0
  53. sage/libs/flint/acb_hypgeom.pxd +169 -0
  54. sage/libs/flint/acb_macros.pxd +9 -0
  55. sage/libs/flint/acb_mat.pxd +136 -0
  56. sage/libs/flint/acb_mat_macros.pxd +10 -0
  57. sage/libs/flint/acb_modular.pxd +62 -0
  58. sage/libs/flint/acb_poly.pxd +251 -0
  59. sage/libs/flint/acb_poly_macros.pxd +8 -0
  60. sage/libs/flint/acb_theta.pxd +124 -0
  61. sage/libs/flint/acf.pxd +32 -0
  62. sage/libs/flint/aprcl.pxd +84 -0
  63. sage/libs/flint/arb.pxd +382 -0
  64. sage/libs/flint/arb_calc.pxd +31 -0
  65. sage/libs/flint/arb_fmpz_poly.pxd +34 -0
  66. sage/libs/flint/arb_fpwrap.pxd +215 -0
  67. sage/libs/flint/arb_hypgeom.pxd +147 -0
  68. sage/libs/flint/arb_macros.pxd +9 -0
  69. sage/libs/flint/arb_mat.pxd +140 -0
  70. sage/libs/flint/arb_mat_macros.pxd +10 -0
  71. sage/libs/flint/arb_poly.pxd +237 -0
  72. sage/libs/flint/arf.pxd +167 -0
  73. sage/libs/flint/arith.cpython-313-aarch64-linux-gnu.so +0 -0
  74. sage/libs/flint/arith.pxd +76 -0
  75. sage/libs/flint/arith.pyx +77 -0
  76. sage/libs/flint/arith_sage.cpython-313-aarch64-linux-gnu.so +0 -0
  77. sage/libs/flint/arith_sage.pyx +308 -0
  78. sage/libs/flint/bernoulli.pxd +28 -0
  79. sage/libs/flint/bool_mat.pxd +52 -0
  80. sage/libs/flint/ca.pxd +203 -0
  81. sage/libs/flint/ca_ext.pxd +34 -0
  82. sage/libs/flint/ca_field.pxd +32 -0
  83. sage/libs/flint/ca_mat.pxd +117 -0
  84. sage/libs/flint/ca_poly.pxd +104 -0
  85. sage/libs/flint/ca_vec.pxd +46 -0
  86. sage/libs/flint/calcium.pxd +27 -0
  87. sage/libs/flint/d_mat.pxd +39 -0
  88. sage/libs/flint/d_vec.pxd +32 -0
  89. sage/libs/flint/dirichlet.pxd +57 -0
  90. sage/libs/flint/dlog.pxd +53 -0
  91. sage/libs/flint/double_extras.pxd +24 -0
  92. sage/libs/flint/double_interval.pxd +36 -0
  93. sage/libs/flint/fexpr.pxd +104 -0
  94. sage/libs/flint/fexpr_builtin.pxd +20 -0
  95. sage/libs/flint/fft.pxd +66 -0
  96. sage/libs/flint/flint.pxd +36 -0
  97. sage/libs/flint/flint_ntl_wrap.h +35 -0
  98. sage/libs/flint/flint_sage.cpython-313-aarch64-linux-gnu.so +0 -0
  99. sage/libs/flint/flint_sage.pyx +163 -0
  100. sage/libs/flint/flint_wrap.h +190 -0
  101. sage/libs/flint/fmpq.pxd +137 -0
  102. sage/libs/flint/fmpq_mat.pxd +105 -0
  103. sage/libs/flint/fmpq_mat_macros.pxd +10 -0
  104. sage/libs/flint/fmpq_mpoly.pxd +165 -0
  105. sage/libs/flint/fmpq_mpoly_factor.pxd +30 -0
  106. sage/libs/flint/fmpq_poly.pxd +241 -0
  107. sage/libs/flint/fmpq_poly_macros.pxd +9 -0
  108. sage/libs/flint/fmpq_poly_sage.cpython-313-aarch64-linux-gnu.so +0 -0
  109. sage/libs/flint/fmpq_poly_sage.pxd +31 -0
  110. sage/libs/flint/fmpq_poly_sage.pyx +48 -0
  111. sage/libs/flint/fmpq_vec.pxd +27 -0
  112. sage/libs/flint/fmpz.pxd +256 -0
  113. sage/libs/flint/fmpz_extras.pxd +32 -0
  114. sage/libs/flint/fmpz_factor.pxd +42 -0
  115. sage/libs/flint/fmpz_factor_sage.cpython-313-aarch64-linux-gnu.so +0 -0
  116. sage/libs/flint/fmpz_factor_sage.pxd +4 -0
  117. sage/libs/flint/fmpz_factor_sage.pyx +29 -0
  118. sage/libs/flint/fmpz_lll.pxd +49 -0
  119. sage/libs/flint/fmpz_macros.pxd +8 -0
  120. sage/libs/flint/fmpz_mat.pxd +184 -0
  121. sage/libs/flint/fmpz_mat_macros.pxd +10 -0
  122. sage/libs/flint/fmpz_mod.pxd +46 -0
  123. sage/libs/flint/fmpz_mod_mat.pxd +71 -0
  124. sage/libs/flint/fmpz_mod_mpoly.pxd +161 -0
  125. sage/libs/flint/fmpz_mod_mpoly_factor.pxd +28 -0
  126. sage/libs/flint/fmpz_mod_poly.pxd +249 -0
  127. sage/libs/flint/fmpz_mod_poly_factor.pxd +46 -0
  128. sage/libs/flint/fmpz_mod_vec.pxd +27 -0
  129. sage/libs/flint/fmpz_mpoly.pxd +224 -0
  130. sage/libs/flint/fmpz_mpoly_factor.pxd +29 -0
  131. sage/libs/flint/fmpz_mpoly_q.pxd +57 -0
  132. sage/libs/flint/fmpz_poly.cpython-313-aarch64-linux-gnu.so +0 -0
  133. sage/libs/flint/fmpz_poly.pxd +407 -0
  134. sage/libs/flint/fmpz_poly.pyx +19 -0
  135. sage/libs/flint/fmpz_poly_factor.pxd +33 -0
  136. sage/libs/flint/fmpz_poly_macros.pxd +8 -0
  137. sage/libs/flint/fmpz_poly_mat.pxd +71 -0
  138. sage/libs/flint/fmpz_poly_q.pxd +55 -0
  139. sage/libs/flint/fmpz_poly_sage.cpython-313-aarch64-linux-gnu.so +0 -0
  140. sage/libs/flint/fmpz_poly_sage.pxd +20 -0
  141. sage/libs/flint/fmpz_poly_sage.pyx +500 -0
  142. sage/libs/flint/fmpz_vec.pxd +80 -0
  143. sage/libs/flint/fmpzi.pxd +52 -0
  144. sage/libs/flint/fq.pxd +97 -0
  145. sage/libs/flint/fq_default.pxd +84 -0
  146. sage/libs/flint/fq_default_mat.pxd +70 -0
  147. sage/libs/flint/fq_default_poly.pxd +97 -0
  148. sage/libs/flint/fq_default_poly_factor.pxd +39 -0
  149. sage/libs/flint/fq_embed.pxd +28 -0
  150. sage/libs/flint/fq_mat.pxd +83 -0
  151. sage/libs/flint/fq_nmod.pxd +95 -0
  152. sage/libs/flint/fq_nmod_embed.pxd +28 -0
  153. sage/libs/flint/fq_nmod_mat.pxd +83 -0
  154. sage/libs/flint/fq_nmod_mpoly.pxd +130 -0
  155. sage/libs/flint/fq_nmod_mpoly_factor.pxd +28 -0
  156. sage/libs/flint/fq_nmod_poly.pxd +202 -0
  157. sage/libs/flint/fq_nmod_poly_factor.pxd +47 -0
  158. sage/libs/flint/fq_nmod_vec.pxd +33 -0
  159. sage/libs/flint/fq_poly.pxd +204 -0
  160. sage/libs/flint/fq_poly_factor.pxd +47 -0
  161. sage/libs/flint/fq_vec.pxd +33 -0
  162. sage/libs/flint/fq_zech.pxd +99 -0
  163. sage/libs/flint/fq_zech_embed.pxd +28 -0
  164. sage/libs/flint/fq_zech_mat.pxd +78 -0
  165. sage/libs/flint/fq_zech_poly.pxd +198 -0
  166. sage/libs/flint/fq_zech_poly_factor.pxd +47 -0
  167. sage/libs/flint/fq_zech_vec.pxd +33 -0
  168. sage/libs/flint/gr.pxd +174 -0
  169. sage/libs/flint/gr_generic.pxd +215 -0
  170. sage/libs/flint/gr_mat.pxd +161 -0
  171. sage/libs/flint/gr_mpoly.pxd +68 -0
  172. sage/libs/flint/gr_poly.pxd +276 -0
  173. sage/libs/flint/gr_special.pxd +237 -0
  174. sage/libs/flint/gr_vec.pxd +120 -0
  175. sage/libs/flint/hypgeom.pxd +24 -0
  176. sage/libs/flint/long_extras.pxd +23 -0
  177. sage/libs/flint/mag.pxd +131 -0
  178. sage/libs/flint/mag_macros.pxd +8 -0
  179. sage/libs/flint/mpf_mat.pxd +36 -0
  180. sage/libs/flint/mpf_vec.pxd +34 -0
  181. sage/libs/flint/mpfr_mat.pxd +27 -0
  182. sage/libs/flint/mpfr_vec.pxd +25 -0
  183. sage/libs/flint/mpn_extras.pxd +41 -0
  184. sage/libs/flint/mpoly.pxd +72 -0
  185. sage/libs/flint/nf.pxd +19 -0
  186. sage/libs/flint/nf_elem.pxd +74 -0
  187. sage/libs/flint/nmod.pxd +35 -0
  188. sage/libs/flint/nmod_mat.pxd +104 -0
  189. sage/libs/flint/nmod_mpoly.pxd +144 -0
  190. sage/libs/flint/nmod_mpoly_factor.pxd +28 -0
  191. sage/libs/flint/nmod_poly.pxd +339 -0
  192. sage/libs/flint/nmod_poly_factor.pxd +44 -0
  193. sage/libs/flint/nmod_poly_linkage.pxi +710 -0
  194. sage/libs/flint/nmod_poly_mat.pxd +76 -0
  195. sage/libs/flint/nmod_vec.pxd +40 -0
  196. sage/libs/flint/ntl_interface.pxd +17 -0
  197. sage/libs/flint/padic.pxd +93 -0
  198. sage/libs/flint/padic_mat.pxd +64 -0
  199. sage/libs/flint/padic_poly.pxd +88 -0
  200. sage/libs/flint/partitions.pxd +23 -0
  201. sage/libs/flint/perm.pxd +26 -0
  202. sage/libs/flint/profiler.pxd +24 -0
  203. sage/libs/flint/qadic.pxd +77 -0
  204. sage/libs/flint/qfb.pxd +44 -0
  205. sage/libs/flint/qqbar.pxd +172 -0
  206. sage/libs/flint/qsieve.cpython-313-aarch64-linux-gnu.so +0 -0
  207. sage/libs/flint/qsieve.pxd +41 -0
  208. sage/libs/flint/qsieve.pyx +21 -0
  209. sage/libs/flint/qsieve_sage.cpython-313-aarch64-linux-gnu.so +0 -0
  210. sage/libs/flint/qsieve_sage.pyx +67 -0
  211. sage/libs/flint/thread_pool.pxd +25 -0
  212. sage/libs/flint/types.pxd +2076 -0
  213. sage/libs/flint/ulong_extras.cpython-313-aarch64-linux-gnu.so +0 -0
  214. sage/libs/flint/ulong_extras.pxd +141 -0
  215. sage/libs/flint/ulong_extras.pyx +21 -0
  216. sage/libs/flint/ulong_extras_sage.cpython-313-aarch64-linux-gnu.so +0 -0
  217. sage/libs/flint/ulong_extras_sage.pyx +21 -0
  218. sage/matrix/all__sagemath_flint.py +1 -0
  219. sage/matrix/change_ring.cpython-313-aarch64-linux-gnu.so +0 -0
  220. sage/matrix/change_ring.pyx +43 -0
  221. sage/matrix/matrix_complex_ball_dense.cpython-313-aarch64-linux-gnu.so +0 -0
  222. sage/matrix/matrix_complex_ball_dense.pxd +14 -0
  223. sage/matrix/matrix_complex_ball_dense.pyx +973 -0
  224. sage/matrix/matrix_cyclo_dense.cpython-313-aarch64-linux-gnu.so +0 -0
  225. sage/matrix/matrix_cyclo_dense.pxd +16 -0
  226. sage/matrix/matrix_cyclo_dense.pyx +1761 -0
  227. sage/matrix/matrix_integer_dense.cpython-313-aarch64-linux-gnu.so +0 -0
  228. sage/matrix/matrix_integer_dense.pxd +32 -0
  229. sage/matrix/matrix_integer_dense.pyx +5801 -0
  230. sage/matrix/matrix_integer_dense_hnf.py +1294 -0
  231. sage/matrix/matrix_integer_dense_saturation.py +346 -0
  232. sage/matrix/matrix_integer_sparse.cpython-313-aarch64-linux-gnu.so +0 -0
  233. sage/matrix/matrix_integer_sparse.pxd +9 -0
  234. sage/matrix/matrix_integer_sparse.pyx +1090 -0
  235. sage/matrix/matrix_rational_dense.cpython-313-aarch64-linux-gnu.so +0 -0
  236. sage/matrix/matrix_rational_dense.pxd +23 -0
  237. sage/matrix/matrix_rational_dense.pyx +2995 -0
  238. sage/matrix/matrix_rational_sparse.cpython-313-aarch64-linux-gnu.so +0 -0
  239. sage/matrix/matrix_rational_sparse.pxd +11 -0
  240. sage/matrix/matrix_rational_sparse.pyx +789 -0
  241. sage/matrix/misc_flint.cpython-313-aarch64-linux-gnu.so +0 -0
  242. sage/matrix/misc_flint.pyx +109 -0
  243. sage/modular/all__sagemath_flint.py +1 -0
  244. sage/modular/modform/all__sagemath_flint.py +1 -0
  245. sage/modular/modform/eis_series_cython.cpython-313-aarch64-linux-gnu.so +0 -0
  246. sage/modular/modform/eis_series_cython.pyx +226 -0
  247. sage/modular/modsym/all__sagemath_flint.py +1 -0
  248. sage/modular/modsym/apply.cpython-313-aarch64-linux-gnu.so +0 -0
  249. sage/modular/modsym/apply.pxd +6 -0
  250. sage/modular/modsym/apply.pyx +113 -0
  251. sage/modular/modsym/heilbronn.cpython-313-aarch64-linux-gnu.so +0 -0
  252. sage/modular/modsym/heilbronn.pyx +966 -0
  253. sage/modular/pollack_stevens/all__sagemath_flint.py +1 -0
  254. sage/modular/pollack_stevens/dist.cpython-313-aarch64-linux-gnu.so +0 -0
  255. sage/modular/pollack_stevens/dist.pxd +38 -0
  256. sage/modular/pollack_stevens/dist.pyx +1439 -0
  257. sage/quivers/algebra.py +691 -0
  258. sage/quivers/algebra_elements.cpython-313-aarch64-linux-gnu.so +0 -0
  259. sage/quivers/algebra_elements.pxd +97 -0
  260. sage/quivers/algebra_elements.pxi +1324 -0
  261. sage/quivers/algebra_elements.pyx +1424 -0
  262. sage/quivers/all.py +1 -0
  263. sage/quivers/ar_quiver.py +917 -0
  264. sage/quivers/homspace.py +640 -0
  265. sage/quivers/morphism.py +1282 -0
  266. sage/quivers/path_semigroup.py +1155 -0
  267. sage/quivers/paths.cpython-313-aarch64-linux-gnu.so +0 -0
  268. sage/quivers/paths.pxd +13 -0
  269. sage/quivers/paths.pyx +809 -0
  270. sage/quivers/representation.py +2975 -0
  271. sage/rings/all__sagemath_flint.py +37 -0
  272. sage/rings/cif.py +4 -0
  273. sage/rings/complex_arb.cpython-313-aarch64-linux-gnu.so +0 -0
  274. sage/rings/complex_arb.pxd +29 -0
  275. sage/rings/complex_arb.pyx +5176 -0
  276. sage/rings/complex_interval.cpython-313-aarch64-linux-gnu.so +0 -0
  277. sage/rings/complex_interval.pxd +30 -0
  278. sage/rings/complex_interval.pyx +2475 -0
  279. sage/rings/complex_interval_field.py +711 -0
  280. sage/rings/convert/all.py +1 -0
  281. sage/rings/convert/mpfi.cpython-313-aarch64-linux-gnu.so +0 -0
  282. sage/rings/convert/mpfi.pxd +6 -0
  283. sage/rings/convert/mpfi.pyx +576 -0
  284. sage/rings/factorint_flint.cpython-313-aarch64-linux-gnu.so +0 -0
  285. sage/rings/factorint_flint.pyx +99 -0
  286. sage/rings/fraction_field_FpT.cpython-313-aarch64-linux-gnu.so +0 -0
  287. sage/rings/fraction_field_FpT.pxd +28 -0
  288. sage/rings/fraction_field_FpT.pyx +2043 -0
  289. sage/rings/imaginary_unit.py +5 -0
  290. sage/rings/monomials.py +73 -0
  291. sage/rings/number_field/S_unit_solver.py +2870 -0
  292. sage/rings/number_field/all__sagemath_flint.py +7 -0
  293. sage/rings/number_field/bdd_height.py +664 -0
  294. sage/rings/number_field/class_group.py +762 -0
  295. sage/rings/number_field/galois_group.py +1307 -0
  296. sage/rings/number_field/homset.py +612 -0
  297. sage/rings/number_field/maps.py +687 -0
  298. sage/rings/number_field/morphism.py +272 -0
  299. sage/rings/number_field/number_field.py +12820 -0
  300. sage/rings/number_field/number_field_element.cpython-313-aarch64-linux-gnu.so +0 -0
  301. sage/rings/number_field/number_field_element.pxd +59 -0
  302. sage/rings/number_field/number_field_element.pyx +5735 -0
  303. sage/rings/number_field/number_field_element_quadratic.cpython-313-aarch64-linux-gnu.so +0 -0
  304. sage/rings/number_field/number_field_element_quadratic.pxd +34 -0
  305. sage/rings/number_field/number_field_element_quadratic.pyx +3185 -0
  306. sage/rings/number_field/number_field_ideal_rel.py +925 -0
  307. sage/rings/number_field/number_field_morphisms.cpython-313-aarch64-linux-gnu.so +0 -0
  308. sage/rings/number_field/number_field_morphisms.pyx +781 -0
  309. sage/rings/number_field/number_field_rel.py +2734 -0
  310. sage/rings/number_field/order.py +2981 -0
  311. sage/rings/number_field/order_ideal.py +804 -0
  312. sage/rings/number_field/selmer_group.py +715 -0
  313. sage/rings/number_field/small_primes_of_degree_one.py +242 -0
  314. sage/rings/number_field/splitting_field.py +606 -0
  315. sage/rings/number_field/structure.py +380 -0
  316. sage/rings/number_field/unit_group.py +721 -0
  317. sage/rings/padics/all__sagemath_flint.py +3 -0
  318. sage/rings/polynomial/all__sagemath_flint.py +1 -0
  319. sage/rings/polynomial/complex_roots.py +312 -0
  320. sage/rings/polynomial/evaluation_flint.cpython-313-aarch64-linux-gnu.so +0 -0
  321. sage/rings/polynomial/evaluation_flint.pxd +7 -0
  322. sage/rings/polynomial/evaluation_flint.pyx +68 -0
  323. sage/rings/polynomial/hilbert.cpython-313-aarch64-linux-gnu.so +0 -0
  324. sage/rings/polynomial/hilbert.pyx +602 -0
  325. sage/rings/polynomial/polynomial_complex_arb.cpython-313-aarch64-linux-gnu.so +0 -0
  326. sage/rings/polynomial/polynomial_complex_arb.pxd +7 -0
  327. sage/rings/polynomial/polynomial_complex_arb.pyx +963 -0
  328. sage/rings/polynomial/polynomial_integer_dense_flint.cpython-313-aarch64-linux-gnu.so +0 -0
  329. sage/rings/polynomial/polynomial_integer_dense_flint.pxd +13 -0
  330. sage/rings/polynomial/polynomial_integer_dense_flint.pyx +1881 -0
  331. sage/rings/polynomial/polynomial_number_field.cpython-313-aarch64-linux-gnu.so +0 -0
  332. sage/rings/polynomial/polynomial_number_field.pyx +345 -0
  333. sage/rings/polynomial/polynomial_rational_flint.cpython-313-aarch64-linux-gnu.so +0 -0
  334. sage/rings/polynomial/polynomial_rational_flint.pxd +20 -0
  335. sage/rings/polynomial/polynomial_rational_flint.pyx +2598 -0
  336. sage/rings/polynomial/polynomial_zmod_flint.cpython-313-aarch64-linux-gnu.so +0 -0
  337. sage/rings/polynomial/polynomial_zmod_flint.pxd +20 -0
  338. sage/rings/polynomial/polynomial_zmod_flint.pyx +1063 -0
  339. sage/rings/polynomial/real_roots.cpython-313-aarch64-linux-gnu.so +0 -0
  340. sage/rings/polynomial/real_roots.pxd +81 -0
  341. sage/rings/polynomial/real_roots.pyx +4704 -0
  342. sage/rings/polynomial/refine_root.cpython-313-aarch64-linux-gnu.so +0 -0
  343. sage/rings/polynomial/refine_root.pyx +142 -0
  344. sage/rings/polynomial/weil/all.py +4 -0
  345. sage/rings/polynomial/weil/power_sums.h +46 -0
  346. sage/rings/polynomial/weil/weil_polynomials.cpython-313-aarch64-linux-gnu.so +0 -0
  347. sage/rings/polynomial/weil/weil_polynomials.pyx +596 -0
  348. sage/rings/qqbar.py +9025 -0
  349. sage/rings/real_arb.cpython-313-aarch64-linux-gnu.so +0 -0
  350. sage/rings/real_arb.pxd +21 -0
  351. sage/rings/real_arb.pyx +4065 -0
  352. sage/rings/real_interval_absolute.cpython-313-aarch64-linux-gnu.so +0 -0
  353. sage/rings/real_interval_absolute.pyx +1073 -0
  354. sage/rings/real_mpfi.cpython-313-aarch64-linux-gnu.so +0 -0
  355. sage/rings/real_mpfi.pyx +5428 -0
  356. sage/schemes/all__sagemath_flint.py +1 -0
  357. sage/schemes/elliptic_curves/all__sagemath_flint.py +1 -0
  358. sage/schemes/elliptic_curves/descent_two_isogeny.cpython-313-aarch64-linux-gnu.so +0 -0
  359. sage/schemes/elliptic_curves/descent_two_isogeny.pyx +1387 -0
  360. sage/schemes/elliptic_curves/descent_two_isogeny_pari.pxd +5 -0
@@ -0,0 +1,966 @@
1
+ # sage_setup: distribution = sagemath-flint
2
+ # distutils: extra_compile_args = -D_XPG6
3
+ # sage.doctest: needs sage.schemes
4
+ """
5
+ Heilbronn matrix computation
6
+ """
7
+ # ****************************************************************************
8
+ # Copyright (C) 2004 William Stein <wstein@gmail.com>
9
+ #
10
+ # Distributed under the terms of the GNU General Public License (GPL)
11
+ #
12
+ # This code is distributed in the hope that it will be useful,
13
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
+ # General Public License for more details.
16
+ #
17
+ # The full text of the GPL is available at:
18
+ #
19
+ # https://www.gnu.org/licenses/
20
+ # ****************************************************************************
21
+
22
+ from cysignals.memory cimport check_allocarray, sig_malloc, sig_free
23
+ from cysignals.signals cimport sig_on, sig_off, sig_check
24
+
25
+ from sage.misc.verbose import verbose
26
+ from sage.arith.misc import is_prime
27
+
28
+ from sage.libs.gmp.mpz cimport *
29
+ from sage.libs.gmp.mpq cimport *
30
+ from sage.libs.flint.fmpz cimport fmpz_add
31
+ from sage.libs.flint.fmpz_poly cimport *
32
+ from sage.libs.flint.fmpq_mat cimport fmpq_mat_entry_num
33
+
34
+ cdef extern from "<math.h>":
35
+ float roundf(float x)
36
+
37
+ cimport sage.modular.modsym.p1list as p1list
38
+ from sage.modular.modsym import p1list
39
+ cdef p1list.export export
40
+ export = p1list.export()
41
+
42
+ from sage.modular.modsym.apply cimport Apply
43
+ cdef Apply PolyApply= Apply()
44
+
45
+ from sage.matrix.matrix_rational_dense cimport Matrix_rational_dense
46
+ from sage.matrix.matrix_cyclo_dense cimport Matrix_cyclo_dense
47
+
48
+ ctypedef long long llong
49
+
50
+ cdef int llong_prod_mod(int a, int b, int N) noexcept:
51
+ cdef int c
52
+ c = <int> (((<llong> a) * (<llong> b)) % (<llong> N))
53
+ if c < 0:
54
+ c = c + N
55
+ return c
56
+
57
+ cdef struct list:
58
+ int *v
59
+ int i # how many positions of list are filled
60
+ int n # how much memory has been allocated
61
+
62
+ cdef int* expand(int *v, int n, int new_length) except NULL:
63
+ cdef int *w
64
+ cdef int i
65
+ w = <int*>check_allocarray(new_length, sizeof(int))
66
+ if v:
67
+ for i in range(n):
68
+ w[i] = v[i]
69
+ sig_free(v)
70
+ return w
71
+
72
+ cdef int list_append(list* L, int a) except -1:
73
+ cdef int j
74
+ if L.i >= L.n:
75
+ j = 10 + 2*L.n
76
+ L.v = expand(L.v, L.n, j)
77
+ L.n = j
78
+ L.v[L.i] = a
79
+ L.i = L.i + 1
80
+
81
+ cdef int list_append4(list* L, int a, int b, int c, int d) except -1:
82
+ list_append(L, a)
83
+ list_append(L, b)
84
+ list_append(L, c)
85
+ list_append(L, d)
86
+
87
+ cdef void list_clear(list L) noexcept:
88
+ sig_free(L.v)
89
+
90
+ cdef void list_init(list* L) noexcept:
91
+ L.n = 16
92
+ L.i = 0
93
+ L.v = expand(<int*>0, 0, L.n)
94
+
95
+
96
+ cdef class Heilbronn:
97
+ cdef int length
98
+ cdef list list
99
+
100
+ def __dealloc__(self):
101
+ list_clear(self.list)
102
+
103
+ def _initialize_list(self):
104
+ """
105
+ Initialize the list of matrices corresponding to ``self``.
106
+
107
+ (This function is automatically called during initialization.)
108
+
109
+ .. NOTE::
110
+
111
+ This function must be overridden by all derived classes!
112
+
113
+ EXAMPLES::
114
+
115
+ sage: from sage.modular.modsym.heilbronn import Heilbronn
116
+ sage: H = Heilbronn()
117
+ sage: H._initialize_list()
118
+ Traceback (most recent call last):
119
+ ...
120
+ NotImplementedError
121
+ """
122
+ raise NotImplementedError
123
+
124
+ def __getitem__(self, int n):
125
+ r"""
126
+ Return the `n`-th matrix in ``self``.
127
+
128
+ EXAMPLES::
129
+
130
+ sage: H = HeilbronnCremona(11)
131
+ sage: H[17]
132
+ [-1, 0, 1, -11]
133
+ sage: H[98234]
134
+ Traceback (most recent call last):
135
+ ...
136
+ IndexError
137
+ """
138
+ if n < 0 or n >= self.length:
139
+ raise IndexError
140
+ return [self.list.v[4*n], self.list.v[4*n+1],
141
+ self.list.v[4*n+2], self.list.v[4*n+3]]
142
+
143
+ def __len__(self):
144
+ """
145
+ Return the number of matrices in ``self``.
146
+
147
+ EXAMPLES::
148
+
149
+ sage: HeilbronnCremona(2).__len__()
150
+ 4
151
+ """
152
+ return self.length
153
+
154
+ def to_list(self):
155
+ """
156
+ Return the list of Heilbronn matrices corresponding to ``self``.
157
+
158
+ Each matrix is given as a list of four integers.
159
+
160
+ EXAMPLES::
161
+
162
+ sage: H = HeilbronnCremona(2); H
163
+ The Cremona-Heilbronn matrices of determinant 2
164
+ sage: H.to_list()
165
+ [[1, 0, 0, 2], [2, 0, 0, 1], [2, 1, 0, 1], [1, 0, 1, 2]]
166
+ """
167
+ cdef int i
168
+ L = []
169
+ for i in range(self.length):
170
+ L.append([self.list.v[4*i], self.list.v[4*i+1],
171
+ self.list.v[4*i+2], self.list.v[4*i+3]])
172
+ return L
173
+
174
+ cdef apply_only(self, int u, int v, int N, int* a, int* b):
175
+ r"""
176
+ INPUT:
177
+
178
+ - ``u``, ``v``, ``N`` -- integers
179
+
180
+ - ``a``, ``b`` -- preallocated integer arrays of the length of ``self``
181
+
182
+ OUTPUT: sets the entries of `a`, `b`
183
+
184
+ EXAMPLES::
185
+
186
+ sage: M = ModularSymbols(33,2,1) # indirect test
187
+ sage: a, b = sage.modular.modsym.heilbronn.hecke_images_gamma0_weight2(1,0,33,[2,3],M.manin_gens_to_basis())
188
+ sage: z = M((1,0))
189
+ sage: [M.T(n)(z).element() for n in [2,2]] == [a, a]
190
+ True
191
+ """
192
+ cdef Py_ssize_t i
193
+ sig_on()
194
+ if N == 1: # easy special case
195
+ for i in range(self.length):
196
+ a[i] = b[i] = 0
197
+ if N < 32768: # use ints with no reduction modulo N
198
+ for i in range(self.length):
199
+ a[i] = u * self.list.v[4*i] + v * self.list.v[4*i+2]
200
+ b[i] = u * self.list.v[4*i+1] + v * self.list.v[4*i+3]
201
+ elif N < 46340: # use ints but reduce mod N so can add two
202
+ for i in range(self.length):
203
+ a[i] = (u * self.list.v[4*i]) % N + (v * self.list.v[4*i+2]) % N
204
+ b[i] = (u * self.list.v[4*i+1]) % N + (v * self.list.v[4*i+3]) % N
205
+ else:
206
+ for i in range(self.length):
207
+ a[i] = llong_prod_mod(u, self.list.v[4*i], N) + llong_prod_mod(v, self.list.v[4*i+2], N)
208
+ b[i] = llong_prod_mod(u, self.list.v[4*i+1], N) + llong_prod_mod(v, self.list.v[4*i+3], N)
209
+ sig_off()
210
+
211
+ cdef apply_to_polypart(self, fmpz_poly_t* ans, int i, int k):
212
+ r"""
213
+ INPUT:
214
+
215
+ - ``ans`` -- ``fmpz_poly_t*``; pre-allocated an
216
+ initialized array of ``self.length`` ``fmpz_poly_t``s
217
+ - ``i`` -- integer
218
+ - ``k`` -- integer
219
+
220
+ OUTPUT: sets entries of ``ans``
221
+ """
222
+ cdef int j, m = k - 2
223
+ for j in range(self.length):
224
+ PolyApply.apply_to_monomial_flint(ans[j], i, m,
225
+ self.list.v[4 * j],
226
+ self.list.v[4 * j + 1],
227
+ self.list.v[4 * j + 2],
228
+ self.list.v[4 * j + 3])
229
+
230
+ def apply(self, int u, int v, int N):
231
+ r"""
232
+ Return a list of pairs `((c,d),m)`, which is obtained as follows:
233
+
234
+ 1) Compute the images `(a,b)` of the vector `(u,v) \pmod N` acted on by
235
+ each of the HeilbronnCremona matrices in ``self``.
236
+
237
+ 2) Reduce each `(a,b)` to canonical form `(c,d)` using ``p1normalize``.
238
+
239
+ 3) Sort.
240
+
241
+ 4) Create the list `((c,d),m)`, where `m` is the number of times
242
+ that `(c,d)` appears in the list created in steps 1-3
243
+ above. Note that the pairs `((c,d),m)` are sorted
244
+ lexicographically by `(c,d)`.
245
+
246
+ INPUT:
247
+
248
+ - ``u``, ``v``, ``N`` -- integers
249
+
250
+ OUTPUT: list
251
+
252
+ EXAMPLES::
253
+
254
+ sage: H = sage.modular.modsym.heilbronn.HeilbronnCremona(2); H
255
+ The Cremona-Heilbronn matrices of determinant 2
256
+ sage: H.apply(1,2,7)
257
+ [((1, 1), 1), ((1, 4), 1), ((1, 5), 1), ((1, 6), 1)]
258
+ """
259
+ cdef int i, a, b, c, d, s
260
+ cdef object X
261
+ cdef dict M = {}
262
+ t = verbose("start making list M.", level=5)
263
+ if N < 32768: # use ints with no reduction modulo N
264
+ for i in range(self.length):
265
+ sig_check()
266
+ a = u*self.list.v[4*i] + v*self.list.v[4*i+2]
267
+ b = u*self.list.v[4*i+1] + v*self.list.v[4*i+3]
268
+ export.c_p1_normalize_int(N, a, b, &c, &d, &s, 0)
269
+ X = (c, d)
270
+ if X in M:
271
+ M[X] += 1
272
+ else:
273
+ M[X] = 1
274
+ elif N < 46340: # use ints but reduce mod N so can add two
275
+ for i in range(self.length):
276
+ sig_check()
277
+ a = (u * self.list.v[4*i]) % N + (v * self.list.v[4*i+2]) % N
278
+ b = (u * self.list.v[4*i+1]) % N + (v * self.list.v[4*i+3]) % N
279
+ export.c_p1_normalize_int(N, a, b, &c, &d, &s, 0)
280
+ X = (c, d)
281
+ if X in M:
282
+ M[X] += 1
283
+ else:
284
+ M[X] = 1
285
+ else:
286
+ for i in range(self.length):
287
+ sig_check()
288
+ a = llong_prod_mod(u, self.list.v[4*i], N) + llong_prod_mod(v, self.list.v[4*i+2], N)
289
+ b = llong_prod_mod(u, self.list.v[4*i+1], N) + llong_prod_mod(v, self.list.v[4*i+3], N)
290
+ export.c_p1_normalize_llong(N, a, b, &c, &d, &s, 0)
291
+ X = (c, d)
292
+ if X in M:
293
+ M[X] += 1
294
+ else:
295
+ M[X] = 1
296
+ t = verbose("finished making list M.", t, level=5)
297
+ mul = sorted(M.items())
298
+ t = verbose("finished making mul list.", t, level=5)
299
+ return mul
300
+
301
+
302
+ cdef class HeilbronnCremona(Heilbronn):
303
+ cdef public int p
304
+
305
+ def __init__(self, int p):
306
+ r"""
307
+ Create the list of Heilbronn-Cremona matrices of determinant `p`.
308
+
309
+ EXAMPLES::
310
+
311
+ sage: H = HeilbronnCremona(3) ; H
312
+ The Cremona-Heilbronn matrices of determinant 3
313
+ sage: H.to_list()
314
+ [[1, 0, 0, 3],
315
+ [3, 1, 0, 1],
316
+ [1, 0, 1, 3],
317
+ [3, 0, 0, 1],
318
+ [3, -1, 0, 1],
319
+ [-1, 0, 1, -3]]
320
+ """
321
+ if p <= 1 or not is_prime(p):
322
+ raise ValueError("p must be >= 2 and prime")
323
+ self.p = p
324
+ self._initialize_list()
325
+
326
+ def __repr__(self):
327
+ """
328
+ Return the string representation of ``self``.
329
+
330
+ EXAMPLES::
331
+
332
+ sage: HeilbronnCremona(691).__repr__()
333
+ 'The Cremona-Heilbronn matrices of determinant 691'
334
+ """
335
+ return f"The Cremona-Heilbronn matrices of determinant {self.p}"
336
+
337
+ def _initialize_list(self):
338
+ """
339
+ Initialize the list of matrices corresponding to ``self``.
340
+
341
+ (This function is automatically called during initialization.)
342
+
343
+ EXAMPLES::
344
+
345
+ sage: from sage.modular.modsym.heilbronn import HeilbronnCremona
346
+ sage: H = HeilbronnCremona.__new__(HeilbronnCremona)
347
+ sage: H.p = 5
348
+ sage: H
349
+ The Cremona-Heilbronn matrices of determinant 5
350
+ sage: H.to_list()
351
+ []
352
+ sage: H._initialize_list()
353
+ sage: H.to_list()
354
+ [[1, 0, 0, 5],
355
+ [5, 2, 0, 1],
356
+ [2, 1, 1, 3],
357
+ [1, 0, 3, 5],
358
+ [5, 1, 0, 1],
359
+ [1, 0, 1, 5],
360
+ [5, 0, 0, 1],
361
+ [5, -1, 0, 1],
362
+ [-1, 0, 1, -5],
363
+ [5, -2, 0, 1],
364
+ [-2, 1, 1, -3],
365
+ [1, 0, -3, 5]]
366
+ """
367
+ cdef int r, x1, x2, y1, y2, a, b, c, x3, y3, q, p
368
+ cdef list *L
369
+ list_init(&self.list)
370
+ L = &self.list
371
+ p = self.p
372
+
373
+ list_append4(L, 1, 0, 0, p)
374
+
375
+ # When p==2, then Heilbronn matrices are
376
+ # [[1,0,0,2], [2,0,0,1], [2,1,0,1], [1,0,1,2]]
377
+ # which are not given by the algorithm below.
378
+ if p == 2:
379
+ list_append4(L, 2, 0, 0, 1)
380
+ list_append4(L, 2, 1, 0, 1)
381
+ list_append4(L, 1, 0, 1, 2)
382
+ self.length = 4
383
+ return
384
+
385
+ # NOTE: In C, -p/2 means "round toward 0", but in Python it
386
+ # means "round down."
387
+ sig_on()
388
+ for r in range(-p // 2, p // 2 + 1):
389
+ x1 = p
390
+ x2 = -r
391
+ y1 = 0
392
+ y2 = 1
393
+ a = -p
394
+ b = r
395
+ c = 0
396
+ x3 = 0
397
+ y3 = 0
398
+ q = 0
399
+ list_append4(L, x1, x2, y1, y2)
400
+ while b:
401
+ q = <int>roundf(<float>a / <float> b)
402
+ c = a - b*q
403
+ a = -b
404
+ b = c
405
+ x3 = q*x2 - x1
406
+ x1 = x2
407
+ x2 = x3
408
+ y3 = q*y2 - y1
409
+ y1 = y2
410
+ y2 = y3
411
+ list_append4(L, x1, x2, y1, y2)
412
+ self.length = L.i // 4
413
+ sig_off()
414
+
415
+
416
+ cdef class HeilbronnMerel(Heilbronn):
417
+ cdef public int n
418
+
419
+ def __init__(self, int n):
420
+ r"""
421
+ Initialize the list of Merel-Heilbronn matrices of determinant `n`.
422
+
423
+ EXAMPLES::
424
+
425
+ sage: H = HeilbronnMerel(3) ; H
426
+ The Merel-Heilbronn matrices of determinant 3
427
+ sage: H.to_list()
428
+ [[1, 0, 0, 3],
429
+ [1, 0, 1, 3],
430
+ [1, 0, 2, 3],
431
+ [2, 1, 1, 2],
432
+ [3, 0, 0, 1],
433
+ [3, 1, 0, 1],
434
+ [3, 2, 0, 1]]
435
+ """
436
+ if n <= 0:
437
+ raise ValueError("n (=%s) must be >= 1" % n)
438
+ self.n = n
439
+ self._initialize_list()
440
+
441
+ def __repr__(self):
442
+ """
443
+ Return the string representation of ``self``.
444
+
445
+ EXAMPLES::
446
+
447
+ sage: HeilbronnMerel(8).__repr__()
448
+ 'The Merel-Heilbronn matrices of determinant 8'
449
+ """
450
+ return "The Merel-Heilbronn matrices of determinant %s" % self.n
451
+
452
+ def _initialize_list(self):
453
+ """
454
+ Initialize the list of matrices corresponding to ``self``.
455
+
456
+ (This function is automatically called during initialization.)
457
+
458
+ EXAMPLES::
459
+
460
+ sage: from sage.modular.modsym.heilbronn import HeilbronnMerel
461
+ sage: H = HeilbronnMerel.__new__(HeilbronnMerel)
462
+ sage: H.n = 5
463
+ sage: H
464
+ The Merel-Heilbronn matrices of determinant 5
465
+ sage: H.to_list()
466
+ []
467
+ sage: H._initialize_list()
468
+ sage: H.to_list()
469
+ [[1, 0, 0, 5],
470
+ [1, 0, 1, 5],
471
+ [1, 0, 2, 5],
472
+ [1, 0, 3, 5],
473
+ [1, 0, 4, 5],
474
+ [2, 1, 1, 3],
475
+ [2, 1, 3, 4],
476
+ [3, 1, 1, 2],
477
+ [3, 2, 2, 3],
478
+ [4, 3, 1, 2],
479
+ [5, 0, 0, 1],
480
+ [5, 1, 0, 1],
481
+ [5, 2, 0, 1],
482
+ [5, 3, 0, 1],
483
+ [5, 4, 0, 1]]
484
+ """
485
+ cdef int a, q, d, b, c, n
486
+ cdef llong bc
487
+ cdef list *L
488
+ list_init(&self.list)
489
+ L = &self.list
490
+ n = self.n
491
+
492
+ sig_on()
493
+ for a in range(1, n+1):
494
+ # We have ad-bc=n so c=0 and ad=n, or b=(ad-n)/c
495
+ # Must have ad - n >= 0, so d must be >= Ceiling(n/a).
496
+ q = n // a
497
+ if q*a == n:
498
+ d = q
499
+ for b in range(a):
500
+ list_append4(L, a, b, 0, d)
501
+ for c in range(1, d):
502
+ list_append4(L, a, 0, c, d)
503
+ for d in range(q+1, n+1):
504
+ bc = (<llong>a) * (<llong>d) - (<llong>n)
505
+ # Divisor c of bc must satisfy Floor(bc/c) lt a and c lt d.
506
+ # c ge (bc div a + 1) <=> Floor(bc/c) lt a (for integers)
507
+ # c le d - 1 <=> c lt d
508
+ for c in range(bc // a + 1, d):
509
+ if bc % c == 0:
510
+ list_append4(L, a, bc // c, c, d)
511
+ self.length = L.i // 4
512
+ sig_off()
513
+
514
+
515
+ ############################################################################
516
+ # Fast application of Heilbronn operators to computation of
517
+ # systems of Hecke eigenvalues.
518
+ # GAMMA0 trivial character weight 2 case
519
+ ############################################################################
520
+
521
+
522
+ def hecke_images_gamma0_weight2(int u, int v, int N, indices, R):
523
+ r"""
524
+ INPUT:
525
+
526
+ - ``u``, ``v``, ``N`` -- integers so that `\gcd(u,v,N) = 1`
527
+ - ``indices`` -- list of positive integers
528
+ - ``R`` -- matrix over `\QQ` that writes each elements of
529
+ `\textnormal{P1} = \textnormal{P1List}(N)` in terms of a
530
+ subset of `\textnormal{P1}`
531
+
532
+ OUTPUT: a dense matrix whose columns are the images `T_n(x)`
533
+ for `n` in indices and `x` the Manin symbol `(u,v)`, expressed
534
+ in terms of the basis.
535
+
536
+ EXAMPLES::
537
+
538
+ sage: M = ModularSymbols(23,2,1)
539
+ sage: A = sage.modular.modsym.heilbronn.hecke_images_gamma0_weight2(1,0,23,[1..6],M.manin_gens_to_basis())
540
+ sage: rowsA = A.rows()
541
+ sage: z = M((1,0))
542
+ sage: all(M.T(n)(z).element() == rowsA[n-1] for n in [1..6])
543
+ True
544
+
545
+ TESTS::
546
+
547
+ sage: M = ModularSymbols(389,2,1,GF(7))
548
+ sage: C = M.cuspidal_subspace()
549
+ sage: N = C.new_subspace()
550
+ sage: D = N.decomposition()
551
+ sage: D[1].q_eigenform(10, 'a') # indirect doctest
552
+ q + 4*q^2 + 2*q^3 + 6*q^5 + q^6 + 5*q^7 + 6*q^8 + q^9 + O(q^10)
553
+ """
554
+ cdef p1list.P1List P1 = p1list.P1List(N)
555
+
556
+ # Create a zero dense matrix over `\QQ` with len(indices) rows
557
+ # and #P^1(N) columns.
558
+ cdef Matrix_rational_dense T
559
+ from sage.matrix.constructor import matrix
560
+ from sage.rings.rational_field import QQ
561
+ T = matrix(QQ, len(indices), len(P1), sparse=False)
562
+ original_base_ring = R.base_ring()
563
+ if original_base_ring != QQ:
564
+ R = R.change_ring(QQ)
565
+
566
+ cdef Py_ssize_t i, j
567
+ cdef int *a
568
+ cdef int *b
569
+ cdef int k
570
+
571
+ cdef Heilbronn H
572
+
573
+ t = verbose("computing non-reduced images of symbol under Hecke operators",
574
+ level=1, caller_name='hecke_images_gamma0_weight2')
575
+ for i, n in enumerate(indices):
576
+ # List the Heilbronn matrices of determinant n defined by Cremona or Merel
577
+ H = HeilbronnCremona(n) if is_prime(n) else HeilbronnMerel(n)
578
+
579
+ # Allocate memory to hold images of (u,v) under all Heilbronn matrices
580
+ a = <int*> sig_malloc(sizeof(int)*H.length)
581
+ if not a:
582
+ raise MemoryError
583
+ b = <int*> sig_malloc(sizeof(int)*H.length)
584
+ if not b:
585
+ raise MemoryError
586
+
587
+ # Compute images of (u,v) under all Heilbronn matrices
588
+ H.apply_only(u, v, N, a, b)
589
+
590
+ # Compute the indexes of these images.
591
+ # We just store them in the array a for simplicity.
592
+ for j in range(H.length):
593
+ # Compute index of the symbol a[j], b[j] in the standard list.
594
+ k = P1.index(a[j], b[j])
595
+
596
+ # Now fill in row i of the matrix T.
597
+ if k != -1:
598
+ # The following line is just a dangerous direct way to do: T[i,k] += 1
599
+ T._add_ui_unsafe_assuming_int(i, k, 1)
600
+
601
+ # Free a and b
602
+ sig_free(a)
603
+ sig_free(b)
604
+
605
+ t = verbose("finished computing non-reduced images",
606
+ t, level=1, caller_name='hecke_images_gamma0_weight2')
607
+
608
+ t = verbose("Now reducing images of symbol",
609
+ level=1, caller_name='hecke_images_gamma0_weight2')
610
+
611
+ # Return the product T * R, whose rows are the image of (u,v) under
612
+ # the Hecke operators T_n for n in indices.
613
+ if max(indices) <= 30: # In this case T tends to be very sparse
614
+ ans = T.sparse_matrix()._matrix_times_matrix_dense(R)
615
+ verbose("did reduction using sparse multiplication",
616
+ t, level=1, caller_name='hecke_images_gamma0_weight2')
617
+ elif R.is_sparse():
618
+ ans = T * R.dense_matrix()
619
+ verbose("did reduction using dense multiplication",
620
+ t, level=1, caller_name='hecke_images_gamma0_weight2')
621
+ else:
622
+ ans = T * R
623
+ verbose("did reduction using dense multiplication",
624
+ t, level=1, caller_name='hecke_images_gamma0_weight2')
625
+
626
+ if original_base_ring != QQ:
627
+ ans = ans.change_ring(original_base_ring)
628
+
629
+ return ans
630
+
631
+
632
+ ############################################################################
633
+ # Fast application of Heilbronn operators to computation of
634
+ # systems of Hecke eigenvalues.
635
+ # Nontrivial character but weight 2.
636
+ ############################################################################
637
+
638
+
639
+ def hecke_images_nonquad_character_weight2(int u, int v, int N, indices, chi, R):
640
+ r"""
641
+ Return images of the Hecke operators `T_n` for `n`
642
+ in the list indices, where `\chi` must be a quadratic Dirichlet
643
+ character with values in `\QQ`.
644
+
645
+ `R` is assumed to be the relation matrix of a weight modular symbols
646
+ space over `\QQ` with character `\chi`.
647
+
648
+ INPUT:
649
+
650
+ - ``u``, ``v``, ``N`` -- integers so that `\gcd(u,v,N) = 1`
651
+ - ``indices`` -- list of positive integers
652
+ - ``chi`` -- a Dirichlet character that takes values
653
+ in a nontrivial extension of `\QQ`
654
+ - ``R`` -- matrix over `\QQ` that writes each elements of
655
+ `\textnormal{P1} = \textnormal{P1List}(N)` in terms of a
656
+ subset of `\textnormal{P1}`
657
+
658
+ OUTPUT: a dense matrix with entries in the field `\QQ(\chi)` (the
659
+ values of `\chi`) whose columns are the images `T_n(x)` for `n` in
660
+ indices and `x` the Manin symbol `(u,v)`, expressed in terms of the
661
+ basis.
662
+
663
+ EXAMPLES::
664
+
665
+ sage: chi = DirichletGroup(13).0^2
666
+ sage: M = ModularSymbols(chi)
667
+ sage: eps = M.character()
668
+ sage: R = M.manin_gens_to_basis()
669
+ sage: sage.modular.modsym.heilbronn.hecke_images_nonquad_character_weight2(1,0,13,[1,2,6],eps,R)
670
+ [ 1 0 0 0]
671
+ [ zeta6 + 2 0 0 -1]
672
+ [ 7 -2*zeta6 + 1 -zeta6 - 1 -2*zeta6]
673
+ sage: x = M((1,0)); x.element()
674
+ (1, 0, 0, 0)
675
+ sage: M.T(2)(x).element()
676
+ (zeta6 + 2, 0, 0, -1)
677
+ sage: M.T(6)(x).element()
678
+ (7, -2*zeta6 + 1, -zeta6 - 1, -2*zeta6)
679
+ """
680
+ cdef p1list.P1List P1 = p1list.P1List(N)
681
+
682
+ from sage.rings.rational_field import QQ
683
+ K = chi.base_ring()
684
+
685
+ if K == QQ:
686
+ raise TypeError("character must not be trivial or quadratic")
687
+
688
+ if R.base_ring() != K:
689
+ R = R.change_ring(K)
690
+
691
+ # Create a zero dense matrix over K with len(indices) rows
692
+ # and #P^1(N) columns.
693
+ cdef Matrix_cyclo_dense T
694
+ from sage.matrix.constructor import matrix
695
+ T = matrix(K, len(indices), len(P1), sparse=False)
696
+
697
+ cdef Py_ssize_t i, j
698
+ cdef int *a
699
+ cdef int *b
700
+ cdef int k, scalar
701
+
702
+ cdef Heilbronn H
703
+
704
+ t = verbose("computing non-reduced images of symbol under Hecke operators",
705
+ level=1, caller_name='hecke_images_character_weight2')
706
+
707
+ # Make a matrix over the rational numbers each of whose columns
708
+ # are the values of the character chi.
709
+ cdef Matrix_rational_dense chi_vals
710
+ z = [t.list() for t in chi.values()]
711
+ chi_vals = matrix(QQ, z).transpose()
712
+
713
+ for i, n in enumerate(indices):
714
+ H = HeilbronnCremona(n) if is_prime(n) else HeilbronnMerel(n)
715
+
716
+ # Allocate memory to hold images of (u,v) under all Heilbronn matrices
717
+ a = <int*> sig_malloc(sizeof(int)*H.length)
718
+ if not a:
719
+ raise MemoryError
720
+ b = <int*> sig_malloc(sizeof(int)*H.length)
721
+ if not b:
722
+ raise MemoryError
723
+
724
+ # Compute images of (u,v) under all Heilbronn matrices
725
+ H.apply_only(u, v, N, a, b)
726
+
727
+ for j in range(H.length):
728
+ # Compute index of the symbol a[j], b[j] in the standard list.
729
+ P1.index_and_scalar(a[j], b[j], &k, &scalar)
730
+ # Now fill in row i of the matrix T.
731
+ if k != -1:
732
+ # The following line is just a dangerous direct way to do: T[i,k] += chi(scalar)
733
+ # T[i,k] += chi(scalar)
734
+ # This code makes assumptions about the internal structure
735
+ # of matrices over cyclotomic fields. It's nasty, but it
736
+ # is exactly what is needed to get a solid 100 or more
737
+ # times speedup.
738
+ scalar %= N
739
+ if scalar < 0:
740
+ scalar += N
741
+ # Note that the next line totally dominates the runtime of this whole function.
742
+ T._matrix._add_col_j_of_A_to_col_i_of_self(i * T._ncols + k, chi_vals, scalar)
743
+
744
+ # Free a and b
745
+ sig_free(a)
746
+ sig_free(b)
747
+
748
+ return T * R
749
+
750
+
751
+ def hecke_images_quad_character_weight2(int u, int v, int N, indices, chi, R):
752
+ r"""
753
+ INPUT:
754
+
755
+ - ``u``, ``v``, ``N`` -- integers so that `\gcd(u,v,N) = 1`
756
+ - ``indices`` -- list of positive integers
757
+ - ``chi`` -- a Dirichlet character that takes values in `\QQ`
758
+ - ``R`` -- matrix over `\QQ(\chi)` that writes each elements of
759
+ `\textnormal{P1} = \textnormal{P1List}(N)` in terms of a subset
760
+ of `\textnormal{P1}`
761
+
762
+ OUTPUT: a dense matrix with entries in the rational field `\QQ` (the
763
+ values of `\chi`) whose columns are the images `T_n(x)` for `n` in
764
+ indices and `x` the Manin symbol `(u,v)`, expressed in terms of the
765
+ basis.
766
+
767
+ EXAMPLES::
768
+
769
+ sage: chi = DirichletGroup(29,QQ).0
770
+ sage: M = ModularSymbols(chi)
771
+ sage: R = M.manin_gens_to_basis()
772
+ sage: sage.modular.modsym.heilbronn.hecke_images_quad_character_weight2(2,1,29,[1,3,4],chi,R)
773
+ [ 0 0 0 0 0 -1]
774
+ [ 0 1 0 1 1 1]
775
+ [ 0 -2 0 2 -2 -1]
776
+ sage: x = M((2,1)) ; x.element()
777
+ (0, 0, 0, 0, 0, -1)
778
+ sage: M.T(3)(x).element()
779
+ (0, 1, 0, 1, 1, 1)
780
+ sage: M.T(4)(x).element()
781
+ (0, -2, 0, 2, -2, -1)
782
+ """
783
+ cdef p1list.P1List P1 = p1list.P1List(N)
784
+ from sage.rings.rational_field import QQ
785
+ if chi.base_ring() != QQ:
786
+ raise TypeError("character must takes values in QQ")
787
+
788
+ # Create a zero dense matrix over `\QQ` with len(indices) rows
789
+ # and #P^1(N) columns.
790
+ cdef Matrix_rational_dense T
791
+ from sage.matrix.constructor import matrix
792
+ T = matrix(QQ, len(indices), len(P1), sparse=False)
793
+
794
+ if R.base_ring() != QQ:
795
+ R = R.change_ring(QQ)
796
+
797
+ cdef Py_ssize_t i, j
798
+ cdef int *a
799
+ cdef int *b
800
+ cdef int k, scalar
801
+ cdef Heilbronn H
802
+
803
+ _ = verbose("computing non-reduced images of symbol under Hecke operators",
804
+ level=1, caller_name='hecke_images_quad_character_weight2')
805
+
806
+ # Make a matrix over the rational numbers each of whose columns
807
+ # are the values of the character chi.
808
+ _chivals = chi.values()
809
+ cdef int *chi_vals = <int*>sig_malloc(sizeof(int)*len(_chivals))
810
+ if not chi_vals:
811
+ raise MemoryError
812
+ for i in range(len(_chivals)):
813
+ chi_vals[i] = _chivals[i]
814
+
815
+ for i, n in enumerate(indices):
816
+ H = HeilbronnCremona(n) if is_prime(n) else HeilbronnMerel(n)
817
+ a = <int*> sig_malloc(sizeof(int)*H.length)
818
+ if not a:
819
+ raise MemoryError
820
+ b = <int*> sig_malloc(sizeof(int)*H.length)
821
+ if not b:
822
+ raise MemoryError
823
+
824
+ H.apply_only(u, v, N, a, b)
825
+ for j in range(H.length):
826
+ P1.index_and_scalar(a[j], b[j], &k, &scalar)
827
+ if k != -1:
828
+ # This is just T[i,k] += chi(scalar)
829
+ scalar %= N
830
+ if scalar < 0:
831
+ scalar += N
832
+ if chi_vals[scalar] > 0:
833
+ T._add_ui_unsafe_assuming_int(i, k, 1)
834
+ elif chi_vals[scalar] < 0:
835
+ T._sub_ui_unsafe_assuming_int(i, k, 1)
836
+ sig_free(a)
837
+ sig_free(b)
838
+
839
+ sig_free(chi_vals)
840
+ return T * R
841
+
842
+
843
+ # ##########################################################################
844
+ # Fast application of Heilbronn operators to computation of
845
+ # systems of Hecke eigenvalues.
846
+ # Trivial character and weight > 2.
847
+ # ##########################################################################
848
+
849
+ def hecke_images_gamma0_weight_k(int u, int v, int i, int N, int k, indices, R):
850
+ r"""
851
+ INPUT:
852
+
853
+ - ``u``, ``v``, ``N`` -- integers so that `\gcd(u,v,N) = 1`
854
+ - ``i`` -- integer with `0 \le i \le k-2`
855
+ - ``k`` -- weight
856
+ - ``indices`` -- list of positive integers
857
+ - ``R`` -- matrix over `\QQ` that writes each elements of
858
+ `\textnormal{P1} = \textnormal{P1List}(N)` in terms of a
859
+ subset of `\textnormal{P1}`
860
+
861
+ OUTPUT: a dense matrix with rational entries whose columns are the
862
+ images `T_n(x)` for `n` in indices and `x` the Manin symbol
863
+ [`X^i*Y^{(k-2-i)}`, `(u,v)`], expressed in terms of the basis.
864
+
865
+ EXAMPLES::
866
+
867
+ sage: M = ModularSymbols(15,6,sign=-1)
868
+ sage: R = M.manin_gens_to_basis()
869
+ sage: a,b,c = sage.modular.modsym.heilbronn.hecke_images_gamma0_weight_k(4,1,3,15,6,[1,11,12], R)
870
+ sage: x = M((3,4,1)) ; x.element() == a
871
+ True
872
+ sage: M.T(11)(x).element() == b
873
+ True
874
+ sage: M.T(12)(x).element() == c
875
+ True
876
+ """
877
+ cdef p1list.P1List P1 = p1list.P1List(N)
878
+
879
+ # The Manin symbols are enumerated as
880
+ # all [0, (u,v)] for (u,v) in P^1(N) then
881
+ # all [1, (u,v)] for (u,v) in P^1(N) etc.
882
+ # So we create a zero dense matrix over `\QQ` with len(indices) rows
883
+ # and #P^1(N) * (k-1) columns.
884
+ cdef Matrix_rational_dense T
885
+ from sage.matrix.constructor import matrix
886
+ from sage.rings.rational_field import QQ
887
+ T = matrix(QQ, len(indices), len(P1)*(k-1), sparse=False)
888
+
889
+ if R.base_ring() != QQ:
890
+ R = R.change_ring(QQ)
891
+
892
+ cdef Py_ssize_t j, m, z, w, n, p
893
+ cdef int *a
894
+ cdef int *b
895
+
896
+ n = len(P1)
897
+
898
+ cdef Heilbronn H
899
+ cdef fmpz_poly_t* poly
900
+
901
+ for z, m in enumerate(indices):
902
+ H = HeilbronnCremona(m) if is_prime(m) else HeilbronnMerel(m)
903
+
904
+ # Allocate memory to hold images of (u,v) under all Heilbronn matrices
905
+ a = <int*> sig_malloc(sizeof(int)*H.length)
906
+ if not a:
907
+ raise MemoryError
908
+ b = <int*> sig_malloc(sizeof(int)*H.length)
909
+ if not b:
910
+ raise MemoryError
911
+
912
+ # Compute images of (u,v) under all Heilbronn matrices
913
+ H.apply_only(u, v, N, a, b)
914
+
915
+ # Compute images of X^i Y^(2-k-i) under each Heilbronn matrix
916
+ poly = <fmpz_poly_t*> sig_malloc(sizeof(fmpz_poly_t)*H.length)
917
+ for j in range(H.length):
918
+ fmpz_poly_init(poly[j])
919
+
920
+ # The following line dominates the runtime of this entire function:
921
+ H.apply_to_polypart(poly, i, k)
922
+
923
+ # Compute the indexes of these images.
924
+ # We just store them in the array a for simplicity.
925
+ for j in range(H.length):
926
+ # Compute index of the symbol a[j], b[j] in the standard list.
927
+ p = P1.index(a[j], b[j])
928
+ # Now fill in row z of the matrix T.
929
+ if p != -1:
930
+ for w in range(min(fmpz_poly_length(poly[j]), k-1)):
931
+ # The following two lines are just a vastly faster version of:
932
+ # T[z, n*w + p] += poly[j][w]
933
+ # They use that we know that T has only integer entries.
934
+ fmpz_add(fmpq_mat_entry_num(T._matrix, z, n*w+p),
935
+ fmpq_mat_entry_num(T._matrix, z, n*w+p),
936
+ fmpz_poly_get_coeff_ptr(poly[j], w))
937
+
938
+ # Free a and b
939
+ sig_free(a)
940
+ sig_free(b)
941
+
942
+ # Free poly part
943
+ for j in range(H.length):
944
+ fmpz_poly_clear(poly[j])
945
+ sig_free(poly)
946
+
947
+ # Return the product T * R, whose rows are the image of (u,v) under
948
+ # the Hecke operators T_n for n in indices.
949
+ return T * R.dense_matrix()
950
+
951
+
952
+ ############################################################################
953
+ # Fast application of Heilbronn operators to computation of
954
+ # systems of Hecke eigenvalues.
955
+ # Nontrivial character of order > 2 and weight > 2
956
+ ############################################################################
957
+
958
+ # TODO
959
+
960
+ ############################################################################
961
+ # Fast application of Heilbronn operators to computation of
962
+ # systems of Hecke eigenvalues.
963
+ # Nontrivial character of order = 2 and weight > 2
964
+ ############################################################################
965
+
966
+ # TODO