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