passagemath-flint 10.6.1rc10__cp312-cp312-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-312-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-312-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-312-aarch64-linux-gnu.so +0 -0
  25. sage/graphs/chrompoly.pyx +555 -0
  26. sage/graphs/matchpoly.cpython-312-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-312-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-312-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-312-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-312-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-312-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-312-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-312-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-312-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-312-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-312-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-312-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-312-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-312-aarch64-linux-gnu.so +0 -0
  220. sage/matrix/change_ring.pyx +43 -0
  221. sage/matrix/matrix_complex_ball_dense.cpython-312-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-312-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-312-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-312-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-312-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-312-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-312-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-312-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-312-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-312-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-312-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-312-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-312-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-312-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-312-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-312-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-312-aarch64-linux-gnu.so +0 -0
  285. sage/rings/factorint_flint.pyx +99 -0
  286. sage/rings/fraction_field_FpT.cpython-312-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-312-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-312-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-312-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-312-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-312-aarch64-linux-gnu.so +0 -0
  324. sage/rings/polynomial/hilbert.pyx +602 -0
  325. sage/rings/polynomial/polynomial_complex_arb.cpython-312-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-312-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-312-aarch64-linux-gnu.so +0 -0
  332. sage/rings/polynomial/polynomial_number_field.pyx +345 -0
  333. sage/rings/polynomial/polynomial_rational_flint.cpython-312-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-312-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-312-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-312-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-312-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-312-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-312-aarch64-linux-gnu.so +0 -0
  353. sage/rings/real_interval_absolute.pyx +1073 -0
  354. sage/rings/real_mpfi.cpython-312-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-312-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,596 @@
1
+ # sage_setup: distribution = sagemath-flint
2
+ r"""
3
+ Iterator for Weil polynomials.
4
+
5
+ For `q` a prime power, a `q`-Weil polynomial is a monic polynomial with integer
6
+ coefficients whose complex roots all have absolute value `sqrt(q)`. The class
7
+ WeilPolynomials provides an iterable over a space of polynomials of this type;
8
+ it is possible to relax the monic condition by specifying one (or more) leading
9
+ coefficients. One may also impose certain congruence conditions; this can be
10
+ used to limit the Newton polygons of the resulting polynomials, or to lift
11
+ a polynomial specified by a congruence to a Weil polynomial.
12
+
13
+ For large jobs, one can set parallel=True to use OpenMP (if support was
14
+ enabled at compile time). Due to increased overhead, this is not recommended
15
+ for smaller problem sizes. To enable support, ensure that your compiler supports
16
+ OpenMP and remove the appropriate # characters in the distutils commands below.
17
+ (You may also need to move those lines to the start of the file.)
18
+
19
+ AUTHOR:
20
+ -- Kiran S. Kedlaya (2007-05-28): initial version
21
+ -- (2015-08-29): switch from NTL to FLINT
22
+ -- (2017-10-03): consolidate Sage layer into .pyx file
23
+ define WeilPolynomials iterator
24
+ reverse convention for polynomials
25
+ pass multiprecision integers to/from C
26
+ -- (2019-02-02): update for Python3
27
+ improve parallel mode
28
+ -- (2019-12-19): final packaging for Sage (with help from David Roe)
29
+
30
+ A standalone version of this code can be found at
31
+ https://github.com/kedlaya/root-unitary
32
+ """
33
+ ## Remove second # from the next two lines to enable OpenMP support.
34
+ ##distutils: libraries = gomp
35
+ ##distutils: extra_compile_args = -fopenmp
36
+
37
+ #*****************************************************************************
38
+ # Copyright (C) 2019 Kiran S. Kedlaya <kskedl@gmail.com>
39
+ #
40
+ # This program is free software: you can redistribute it and/or modify
41
+ # it under the terms of the GNU General Public License as published by
42
+ # the Free Software Foundation, either version 2 of the License, or
43
+ # (at your option) any later version.
44
+ # http://www.gnu.org/licenses/
45
+ #*****************************************************************************
46
+
47
+ cimport cython
48
+ from cython.parallel import prange
49
+ from libc.stdlib cimport malloc, free
50
+ from cysignals.signals cimport sig_on, sig_off
51
+
52
+ from sage.rings.rational_field import QQ
53
+ from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing
54
+ from sage.functions.generalized import sgn
55
+
56
+ from sage.rings.integer cimport Integer
57
+ from sage.libs.gmp.types cimport mpz_t
58
+ from sage.libs.gmp.mpz cimport mpz_set
59
+ from sage.libs.flint.fmpz cimport *
60
+ from sage.libs.flint.fmpz_vec cimport *
61
+
62
+ cdef extern from "sage/rings/polynomial/weil/power_sums.c":
63
+ ctypedef struct ps_static_data_t:
64
+ pass
65
+
66
+ ctypedef struct ps_dynamic_data_t:
67
+ int flag # State of the iterator (0 = inactive, 1 = running,
68
+ # 2 = found a solution,
69
+ # -1 = too many nodes)
70
+ long node_count # Number of terminal nodes encountered
71
+ fmpz *sympol # Return value (a polynomial)
72
+
73
+ int has_openmp()
74
+ ps_static_data_t *ps_static_init(int d, fmpz_t q, int coeffsign, fmpz_t lead,
75
+ int cofactor, fmpz *modlist, long node_limit,
76
+ int force_squarefree)
77
+ ps_dynamic_data_t *ps_dynamic_init(int d, fmpz_t q, fmpz *coefflist)
78
+ void ps_dynamic_split(ps_dynamic_data_t *dy_data, ps_dynamic_data_t *dy_data2) nogil
79
+ void ps_static_clear(ps_static_data_t *st_data)
80
+ void ps_dynamic_clear(ps_dynamic_data_t *dy_data)
81
+ void next_pol(ps_static_data_t *st_data, ps_dynamic_data_t *dy_data, int max_steps) nogil
82
+
83
+ cdef class dfs_manager:
84
+ """
85
+ Data structure to manage depth-first search.
86
+
87
+ Such a structure is created and managed by an instance of ``WeilPolynomials_iter``.
88
+ There is generally no need for a user to manipulate it directly.
89
+ """
90
+ cdef int d
91
+ cdef int num_processes
92
+ cdef long node_limit
93
+ cdef ps_static_data_t *ps_st_data
94
+ cdef ps_dynamic_data_t **dy_data_buf
95
+
96
+ def __cinit__(self, int d, q, coefflist, modlist, int sign, int cofactor,
97
+ long node_limit, int parallel, int force_squarefree):
98
+ """
99
+ Perform required C-level initialization (e.g., memory allocation).
100
+
101
+ This is called automatically at object creation. It should never be called directly.
102
+
103
+ TESTS:
104
+
105
+ For some reason, Sage requires a dummy doctest to meet coverage requirements::
106
+
107
+ sage: from sage.rings.polynomial.weil.weil_polynomials import WeilPolynomials
108
+ sage: w = WeilPolynomials(10,1,sign=1,lead=[3,1,1])
109
+ sage: it = iter(w)
110
+ sage: it.process is not None # Verify object creation
111
+ True
112
+ """
113
+ cdef fmpz_t temp_lead
114
+ cdef fmpz_t temp_q
115
+ cdef fmpz *temp_array
116
+ cdef int i = 101 if parallel else 1
117
+
118
+ self.d = d
119
+ self.num_processes = i
120
+ self.dy_data_buf = <ps_dynamic_data_t **>malloc(i*cython.sizeof(cython.pointer(ps_dynamic_data_t)))
121
+ self.node_limit = node_limit
122
+ fmpz_init(temp_lead)
123
+ fmpz_set_mpz(temp_lead, Integer(coefflist[-1]).value)
124
+ fmpz_init(temp_q)
125
+ fmpz_set_mpz(temp_q, Integer(q).value)
126
+ temp_array = _fmpz_vec_init(d + 1)
127
+ for i in range(d + 1):
128
+ fmpz_set_mpz(temp_array + i, Integer(modlist[i]).value)
129
+ self.ps_st_data = ps_static_init(d, temp_q, sign, temp_lead, cofactor,
130
+ temp_array, node_limit, force_squarefree)
131
+
132
+ # Initialize processes, but assign work to only one process.
133
+ # In parallel mode, other processes will get initialized later via work-stealing.
134
+ for i in range(d+1):
135
+ fmpz_set_mpz(temp_array+i, Integer(coefflist[i]).value)
136
+ self.dy_data_buf[0] = ps_dynamic_init(d, temp_q, temp_array)
137
+ for i in range(1, self.num_processes):
138
+ self.dy_data_buf[i] = ps_dynamic_init(d, temp_q, NULL)
139
+
140
+ fmpz_clear(temp_lead)
141
+ fmpz_clear(temp_q)
142
+ _fmpz_vec_clear(temp_array, d + 1)
143
+
144
+ def __dealloc__(self):
145
+ """
146
+ Deallocate memory.
147
+ """
148
+ ps_static_clear(self.ps_st_data)
149
+ self.ps_st_data = NULL
150
+ if self.dy_data_buf != NULL:
151
+ for i in range(self.num_processes):
152
+ ps_dynamic_clear(self.dy_data_buf[i])
153
+ free(self.dy_data_buf)
154
+ self.dy_data_buf = NULL
155
+
156
+ cpdef long node_count(self) noexcept:
157
+ """
158
+ Count nodes.
159
+
160
+ This method should not be called directly. Instead, use the ``node_count`` method
161
+ of an instance of ``WeilPolynomials`` or ``WeilPolynomials_iter``.
162
+
163
+ TESTS::
164
+
165
+ sage: from sage.rings.polynomial.weil.weil_polynomials import WeilPolynomials
166
+ sage: w = WeilPolynomials(10,1,sign=1,lead=[3,1,1])
167
+ sage: it = iter(w)
168
+ sage: _ = next(it)
169
+ sage: it.process.node_count()
170
+ 158
171
+ """
172
+ cdef long count = 0
173
+ cdef int i
174
+ for i in range(self.num_processes):
175
+ count += self.dy_data_buf[i].node_count
176
+ return count
177
+
178
+ cpdef object advance_exhaust(self):
179
+ """
180
+ Advance the tree exhaustion.
181
+
182
+ This method should not be called directly. Instead, use the iterator
183
+ ``WeilPolynomials_iter`` or the iterable ``WeilPolynomials``.
184
+
185
+ TESTS::
186
+
187
+ sage: from sage.rings.polynomial.weil.weil_polynomials import WeilPolynomials
188
+ sage: w = WeilPolynomials(10,1,sign=1,lead=[3,1,1])
189
+ sage: it = iter(w)
190
+ sage: it.process.advance_exhaust()[0]
191
+ [3, 1, 1, -5, 1, -2, 1, -5, 1, 1, 3, 0, 0]
192
+ """
193
+ cdef int i, j, k, d = self.d, t = 1, u = 0, np = self.num_processes, max_steps = 1000
194
+ cdef long ans_count = 0, ans_max = 10000
195
+ cdef mpz_t z
196
+ cdef Integer temp
197
+ ans = []
198
+
199
+ k=1
200
+ while (t and not u and ans_count < ans_max):
201
+ if np == 1: # Serial mode
202
+ next_pol(self.ps_st_data, self.dy_data_buf[0], max_steps)
203
+ t = self.dy_data_buf[0].flag
204
+ else: # Parallel mode
205
+ t = 0
206
+ k = (k<<1) % np # Note that 2 is a primitive root mod np.
207
+ with nogil:
208
+ sig_on()
209
+ for i in prange(np, schedule='dynamic'): # Step each process forward
210
+ next_pol(self.ps_st_data, self.dy_data_buf[i], max_steps)
211
+ if self.dy_data_buf[i].flag: t += 1
212
+ if self.dy_data_buf[i].flag == -1: u += 1
213
+ for i in prange(np, schedule='dynamic'): # Redistribute work to idle processes
214
+ j = (i-k) % np
215
+ ps_dynamic_split(self.dy_data_buf[j], self.dy_data_buf[i])
216
+ sig_off()
217
+ for i in range(np):
218
+ if self.dy_data_buf[i].flag == 2: # Extract a solution
219
+ l = []
220
+ # Convert a vector of fmpz's into mpz's, then Integers.
221
+ for j in range(2 * d + 3):
222
+ flint_mpz_init_set_readonly(z, &self.dy_data_buf[i].sympol[j])
223
+ temp = Integer()
224
+ mpz_set(temp.value, z)
225
+ l.append(temp)
226
+ flint_mpz_clear_readonly(z)
227
+ ans.append(l)
228
+ ans_count += 1
229
+ if u:
230
+ print(u)
231
+ raise RuntimeError("Node limit ({0:%d}) exceeded".format(self.node_limit))
232
+ return ans
233
+
234
+
235
+ class WeilPolynomials_iter():
236
+ r"""
237
+ Iterator created by WeilPolynomials.
238
+
239
+ EXAMPLES::
240
+
241
+ sage: from sage.rings.polynomial.weil.weil_polynomials import WeilPolynomials
242
+ sage: w = WeilPolynomials(10,1,sign=1,lead=[3,1,1])
243
+ sage: it = iter(w)
244
+ sage: next(it)
245
+ 3*x^10 + x^9 + x^8 + 7*x^7 + 5*x^6 + 2*x^5 + 5*x^4 + 7*x^3 + x^2 + x + 3
246
+ sage: w = WeilPolynomials(10,1,sign=-1,lead=[3,1,1])
247
+ sage: it = iter(w)
248
+ sage: next(it)
249
+ 3*x^10 + x^9 + x^8 + 6*x^7 - 2*x^6 + 2*x^4 - 6*x^3 - x^2 - x - 3
250
+ """
251
+ def __init__(self, d, q, sign, lead, node_limit, parallel, squarefree, polring=None):
252
+ r"""
253
+ Create an iterator for Weil polynomials.
254
+
255
+ EXAMPLES::
256
+
257
+ sage: from sage.rings.polynomial.weil.weil_polynomials import WeilPolynomials
258
+ sage: w = WeilPolynomials(10,1,sign=1,lead=[3,1,1])
259
+ sage: it = iter(w)
260
+ sage: next(it)
261
+ 3*x^10 + x^9 + x^8 + 7*x^7 + 5*x^6 + 2*x^5 + 5*x^4 + 7*x^3 + x^2 + x + 3
262
+ """
263
+ if polring is None:
264
+ polring = PolynomialRing(QQ, name='x')
265
+ self.pol = polring
266
+ x = self.pol.gen()
267
+ d = Integer(d)
268
+ if sign != 1 and sign != -1:
269
+ raise ValueError("Invalid sign")
270
+ if not q.is_integer() or q <= 0:
271
+ raise ValueError("q must be a positive integer")
272
+ if d % 2 == 0:
273
+ if sign == 1:
274
+ d2 = d//2
275
+ num_cofactor = 0
276
+ else:
277
+ d2 = d//2 - 1
278
+ num_cofactor = 3
279
+ else:
280
+ if not q.is_square():
281
+ raise ValueError("Degree must be even if q is not a square")
282
+ d2 = d//2
283
+ if sign == 1:
284
+ num_cofactor = 1
285
+ else:
286
+ num_cofactor = 2
287
+ try:
288
+ leadlist = list(lead)
289
+ except TypeError:
290
+ leadlist = [(lead, 0)]
291
+ coefflist = []
292
+ modlist = []
293
+ for i in leadlist:
294
+ try:
295
+ (j, k) = i
296
+ except TypeError:
297
+ (j, k) = (i, 0)
298
+ j = Integer(j)
299
+ k = Integer(k)
300
+ if len(modlist) == 0 and k != 0:
301
+ raise ValueError("Leading coefficient must be specified exactly")
302
+ if modlist and ((k != 0 and modlist[-1] % k != 0) or (k == 0 and modlist[-1] != 0)):
303
+ raise ValueError("Invalid moduli")
304
+ coefflist.append(j)
305
+ modlist.append(k)
306
+ # Remove cofactor from initial coefficients
307
+ if num_cofactor == 1: # cofactor x + sqrt(q)
308
+ for i in range(1, len(coefflist)):
309
+ coefflist[i] -= coefflist[i-1]*q.sqrt()
310
+ elif num_cofactor == 2: # cofactor x + sqrt(q)
311
+ for i in range(1, len(coefflist)):
312
+ coefflist[i] += coefflist[i-1]*q.sqrt()
313
+ elif num_cofactor == 3: # cofactor x^2 - q
314
+ for i in range(2, len(coefflist)):
315
+ coefflist[i] += coefflist[i-2]*q
316
+ # Asymmetrize initial coefficients
317
+ for i in range(len(coefflist)):
318
+ for j in range(1, (len(coefflist)-i+1)//2):
319
+ coefflist[i+2*j] -= (d2-i).binomial(j)*(q**j)*coefflist[i]
320
+ for _ in range(d2+1-len(coefflist)):
321
+ coefflist.append(0)
322
+ modlist.append(1)
323
+ coeffsign = sgn(coefflist[0])
324
+ coefflist = [x*coeffsign for x in reversed(coefflist)]
325
+ if node_limit is None:
326
+ node_limit = -1
327
+ force_squarefree = Integer(squarefree)
328
+ self.process = None if d2<0 else dfs_manager(d2, q, coefflist, modlist, coeffsign,
329
+ num_cofactor, node_limit, parallel,
330
+ force_squarefree)
331
+ self.q = q
332
+ self.squarefree = squarefree
333
+ self.ans = []
334
+
335
+ def __iter__(self):
336
+ r"""
337
+ Return the iterator (i.e. ``self``).
338
+
339
+ EXAMPLES::
340
+
341
+ sage: from sage.rings.polynomial.weil.weil_polynomials import WeilPolynomials
342
+ sage: w = WeilPolynomials(10,1,sign=1,lead=[3,1,1])
343
+ sage: it = iter(w)
344
+ sage: it.__iter__() is it
345
+ True
346
+ """
347
+ return self
348
+
349
+ def __next__(self):
350
+ r"""
351
+ Step the iterator forward.
352
+
353
+ EXAMPLES::
354
+
355
+ sage: from sage.rings.polynomial.weil.weil_polynomials import WeilPolynomials
356
+ sage: w = WeilPolynomials(10,1,sign=1,lead=[3,1,1])
357
+ sage: it = iter(w)
358
+ sage: next(it)
359
+ 3*x^10 + x^9 + x^8 + 7*x^7 + 5*x^6 + 2*x^5 + 5*x^4 + 7*x^3 + x^2 + x + 3
360
+ """
361
+ if self.process is None:
362
+ raise StopIteration
363
+ if len(self.ans) == 0:
364
+ self.ans = self.process.advance_exhaust()
365
+ if len(self.ans) == 0:
366
+ self.count = self.process.node_count()
367
+ self.process = None
368
+ raise StopIteration
369
+ return self.pol(self.ans.pop())
370
+
371
+ def node_count(self):
372
+ r"""
373
+ Return the number of terminal nodes found in the tree, excluding
374
+ actual solutions.
375
+
376
+ EXAMPLES::
377
+
378
+ sage: from sage.rings.polynomial.weil.weil_polynomials import WeilPolynomials
379
+ sage: w = WeilPolynomials(10,1,sign=1,lead=[3,1,1])
380
+ sage: it = iter(w)
381
+ sage: l = list(it)
382
+ sage: it.node_count()
383
+ 158
384
+ """
385
+ if self.process is None:
386
+ return self.count
387
+ return self.process.node_count()
388
+
389
+
390
+ class WeilPolynomials():
391
+ r"""
392
+ Iterable for Weil polynomials, i.e., integer polynomials with all complex
393
+ roots having a particular absolute value.
394
+
395
+ Such polynomials `f` satisfy a functional equation
396
+
397
+ .. MATH::
398
+
399
+ T^d f(q/T) = s q^{d/2} f(T)
400
+
401
+ where `d` is the degree of `f`, `s` is a sign and `q^{1/2}` is the absolute value
402
+ of the roots of `f`.
403
+
404
+ If parallel is False, then the order of values is descending lexicographical
405
+ (i.e., polynomials with the largest coefficients of largest degrees sort first).
406
+
407
+ If parallel is True, then the order of values is not specified. (Beware that
408
+ due to increased overhead, parallel execution may not yield a significant
409
+ speedup for small problem sizes.)
410
+
411
+ INPUT:
412
+
413
+ - ``d`` -- integer; the degree of the polynomials
414
+
415
+ - ``q`` -- integer; the square of the complex absolute value of the roots
416
+
417
+ - ``sign`` -- integer (default: `1`); the sign `s` of the functional equation
418
+
419
+ - ``lead`` -- integer (default: `1`); list of integers or pairs of integers
420
+
421
+ These are constraints on the leading coefficients of the generated polynomials.
422
+ If pairs `(a, b)` of integers are given, they are treated as a constraint
423
+ of the form `\equiv a \pmod{b}`; the moduli must be in decreasing order by
424
+ divisibility, and the modulus of the leading coefficient must be 0.
425
+
426
+ - ``node_limit`` -- integer (default: ``None``)
427
+
428
+ If set, imposes an upper bound on the number of terminal nodes during the search
429
+ (will raise a :exc:`RuntimeError` if exceeded).
430
+
431
+ - ``parallel`` -- boolean (default: ``False``); whether to use multiple processes
432
+
433
+ If set, will raise an error unless this file was compiled with OpenMP support
434
+ (see instructions at the top of :mod:`sage.rings.polynomial.weil.weil_polynomials`).
435
+
436
+ - ``squarefree`` -- boolean (default: ``False``)
437
+
438
+ If set, only squarefree polynomials will be returned.
439
+
440
+ - ``polring`` -- (optional) a polynomial ring in which to construct the results
441
+
442
+ EXAMPLES:
443
+
444
+ Some simple cases::
445
+
446
+ sage: from sage.rings.polynomial.weil.weil_polynomials import WeilPolynomials
447
+ sage: list(WeilPolynomials(2,2))
448
+ [x^2 + 2*x + 2, x^2 + x + 2, x^2 + 2, x^2 - x + 2, x^2 - 2*x + 2]
449
+ sage: l = list(WeilPolynomials(4,2))
450
+ sage: l[0], l[-1]
451
+ (x^4 + 4*x^3 + 8*x^2 + 8*x + 4, x^4 - 4*x^3 + 8*x^2 - 8*x + 4)
452
+ sage: l = list(WeilPolynomials(3, 1, sign=-1))
453
+ sage: l[0], l[-1]
454
+ (x^3 + x^2 - x - 1, x^3 - 3*x^2 + 3*x - 1)
455
+
456
+ By Kronecker's theorem, a monic integer polynomial has all roots of absolute
457
+ value 1 if and only if it is a product of cyclotomic polynomials. For such a
458
+ product to have positive sign of the functional equation, the factors `x-1`
459
+ and `x+1` must each occur with even multiplicity. This code confirms
460
+ Kronecker's theorem for polynomials of degree 6::
461
+
462
+ sage: P.<x> = PolynomialRing(ZZ)
463
+ sage: d = 6
464
+ sage: ans1 = list(WeilPolynomials(d, 1, 1))
465
+ sage: ans1.sort()
466
+ sage: l = [(x-1)^2, (x+1)^2] + [cyclotomic_polynomial(n,x) # needs sage.libs.pari
467
+ ....: for n in range(3, 2*d*d) if euler_phi(n) <= d]
468
+
469
+ sage: # needs sage.combinat sage.libs.pari
470
+ sage: w = WeightedIntegerVectors(d, [i.degree() for i in l])
471
+ sage: ans2 = [prod(l[i]^v[i] for i in range(len(l))) for v in w]
472
+ sage: ans2.sort()
473
+ sage: print(ans1 == ans2)
474
+ True
475
+
476
+ Generating Weil polynomials with prescribed initial coefficients::
477
+
478
+ sage: w = WeilPolynomials(10,1,sign=1,lead=[3,1,1])
479
+ sage: it = iter(w)
480
+ sage: next(it)
481
+ 3*x^10 + x^9 + x^8 + 7*x^7 + 5*x^6 + 2*x^5 + 5*x^4 + 7*x^3 + x^2 + x + 3
482
+ sage: w = WeilPolynomials(10,1,sign=-1,lead=[3,1,1])
483
+ sage: it = iter(w)
484
+ sage: next(it)
485
+ 3*x^10 + x^9 + x^8 + 6*x^7 - 2*x^6 + 2*x^4 - 6*x^3 - x^2 - x - 3
486
+
487
+ TESTS:
488
+
489
+ Test restriction of initial coefficients::
490
+
491
+ sage: w1 = WeilPolynomials(10,1,sign=1,lead=3)
492
+ sage: l1 = list(w1)
493
+ sage: w2 = WeilPolynomials(10,1,sign=1,lead=[3,1,1])
494
+ sage: l2 = list(w2)
495
+ sage: l3 = [i for i in l1 if i[1] == 1 and i[2] == 1]
496
+ sage: l2 == l3
497
+ True
498
+
499
+ sage: w = WeilPolynomials(4,2,lead=[(1,0),(0,2)])
500
+ sage: l = list(w)
501
+ sage: l[0], l[-1]
502
+ (x^4 + 4*x^3 + 8*x^2 + 8*x + 4, x^4 - 4*x^3 + 8*x^2 - 8*x + 4)
503
+ sage: sorted(list(set(i[3] for i in l)))
504
+ [-4, -2, 0, 2, 4]
505
+
506
+ Test restriction to squarefree polynomials::
507
+
508
+ sage: for (d,q,sign) in ((6,2,1),(6,4,-1),(5,4,-1)):
509
+ ....: w1 = WeilPolynomials(d,q,sign=sign)
510
+ ....: l1 = list(w1)
511
+ ....: w2 = WeilPolynomials(d,q,sign=sign,squarefree=True)
512
+ ....: l2 = list(w2)
513
+ ....: l3 = [i for i in l1 if i.is_squarefree()]
514
+ ....: print(l2 == l3)
515
+ True
516
+ True
517
+ True
518
+
519
+ Test that :issue:`29475` is resolved::
520
+
521
+ sage: # needs sage.libs.pari
522
+ sage: P.<x> = QQ[]
523
+ sage: u = x^6 + x^5 + 6*x^4 - 2*x^3 + 66*x^2 + 121*x + 1331
524
+ sage: u.is_weil_polynomial()
525
+ True
526
+ sage: u in WeilPolynomials(6, 11, 1, [1,1,6])
527
+ True
528
+ sage: u in WeilPolynomials(6, 11, 1, [(1,0),(1,11),(6,11)])
529
+ True
530
+
531
+ Test that :issue:`31809` is resolved::
532
+
533
+ sage: from sage.rings.polynomial.weil.weil_polynomials import WeilPolynomials
534
+ sage: foo = list(WeilPolynomials(12, 3, lead=(1,0,9,2,46), squarefree=False))
535
+ sage: bar = list(WeilPolynomials(12, 3, lead=(1,0,9,2,46), squarefree=True))
536
+ sage: bar == [f for f in foo if f.is_squarefree()]
537
+ True
538
+
539
+ Test that :issue:`32348` is resolved::
540
+
541
+ sage: list(WeilPolynomials(10, 2, lead=(1,-3,5,-5,5,-5)))
542
+ [x^10 - 3*x^9 + 5*x^8 - 5*x^7 + 5*x^6 - 5*x^5 + 10*x^4 - 20*x^3 + 40*x^2 - 48*x + 32]
543
+
544
+ Test that :issue:`37860` is resolved::
545
+
546
+ sage: list(WeilPolynomials(-1, 1))
547
+ []
548
+ sage: list(WeilPolynomials(0, 1, sign=-1))
549
+ []
550
+ """
551
+ def __init__(self, d, q, sign=1, lead=1, node_limit=None, parallel=False, squarefree=False, polring=None):
552
+ r"""
553
+ Initialize this iterable.
554
+
555
+ EXAMPLES::
556
+
557
+ sage: from sage.rings.polynomial.weil.weil_polynomials import WeilPolynomials
558
+ sage: w = WeilPolynomials(10,1,sign=1,lead=[3,1,1])
559
+ sage: w.__init__(10,1,sign=1,lead=[3,1,-1]) # Change parameters before iterating
560
+ sage: it = iter(w)
561
+ sage: next(it) # Results reflect the changed parameters
562
+ 3*x^10 + x^9 - x^8 + 7*x^7 + 5*x^6 - 2*x^5 + 5*x^4 + 7*x^3 - x^2 + x + 3
563
+ """
564
+ if parallel and not has_openmp():
565
+ raise RuntimeError("Parallel execution not supported")
566
+ self.data = (d, q, sign, lead, node_limit, parallel, squarefree, polring)
567
+
568
+ def __iter__(self):
569
+ r"""
570
+ Construct the associated iterator.
571
+
572
+ EXAMPLES::
573
+
574
+ sage: from sage.rings.polynomial.weil.weil_polynomials import WeilPolynomials
575
+ sage: w = WeilPolynomials(10,1,sign=1,lead=[3,1,1])
576
+ sage: it = w.__iter__()
577
+ sage: next(it)
578
+ 3*x^10 + x^9 + x^8 + 7*x^7 + 5*x^6 + 2*x^5 + 5*x^4 + 7*x^3 + x^2 + x + 3
579
+ """
580
+ w = WeilPolynomials_iter(*self.data)
581
+ self.w = w
582
+ return w
583
+
584
+ def node_count(self):
585
+ r"""
586
+ Return the number of terminal nodes found in the tree, excluding actual solutions.
587
+
588
+ EXAMPLES::
589
+
590
+ sage: from sage.rings.polynomial.weil.weil_polynomials import WeilPolynomials
591
+ sage: w = WeilPolynomials(10,1,sign=1,lead=[3,1,1])
592
+ sage: l = list(w)
593
+ sage: w.node_count()
594
+ 158
595
+ """
596
+ return self.w.node_count()