passagemath-pari 10.6.32__cp314-cp314-musllinux_1_2_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.

Potentially problematic release.


This version of passagemath-pari might be problematic. Click here for more details.

Files changed (331) hide show
  1. PARIKernel/__init__.py +2 -0
  2. PARIKernel/__main__.py +5 -0
  3. PARIKernel/io.cpython-314-x86_64-linux-musl.so +0 -0
  4. PARIKernel/io.pxd +7 -0
  5. PARIKernel/io.pyx +84 -0
  6. PARIKernel/kernel.cpython-314-x86_64-linux-musl.so +0 -0
  7. PARIKernel/kernel.pyx +260 -0
  8. PARIKernel/paridecl.pxd +95 -0
  9. PARIKernel/svg.cpython-314-x86_64-linux-musl.so +0 -0
  10. PARIKernel/svg.pyx +52 -0
  11. cypari2/__init__.py +8 -0
  12. cypari2/auto_paridecl.pxd +1070 -0
  13. cypari2/closure.cpython-314-x86_64-linux-musl.so +0 -0
  14. cypari2/closure.pxd +5 -0
  15. cypari2/closure.pyx +246 -0
  16. cypari2/convert.cpython-314-x86_64-linux-musl.so +0 -0
  17. cypari2/convert.pxd +80 -0
  18. cypari2/convert.pyx +613 -0
  19. cypari2/custom_block.cpython-314-x86_64-linux-musl.so +0 -0
  20. cypari2/custom_block.pyx +30 -0
  21. cypari2/cypari.h +13 -0
  22. cypari2/gen.cpython-314-x86_64-linux-musl.so +0 -0
  23. cypari2/gen.pxd +69 -0
  24. cypari2/gen.pyx +4819 -0
  25. cypari2/handle_error.cpython-314-x86_64-linux-musl.so +0 -0
  26. cypari2/handle_error.pxd +7 -0
  27. cypari2/handle_error.pyx +232 -0
  28. cypari2/pari_instance.cpython-314-x86_64-linux-musl.so +0 -0
  29. cypari2/pari_instance.pxd +27 -0
  30. cypari2/pari_instance.pyx +1438 -0
  31. cypari2/paridecl.pxd +5353 -0
  32. cypari2/paripriv.pxd +34 -0
  33. cypari2/pycore_long.h +98 -0
  34. cypari2/pycore_long.pxd +9 -0
  35. cypari2/stack.cpython-314-x86_64-linux-musl.so +0 -0
  36. cypari2/stack.pxd +27 -0
  37. cypari2/stack.pyx +278 -0
  38. cypari2/string_utils.cpython-314-x86_64-linux-musl.so +0 -0
  39. cypari2/string_utils.pxd +29 -0
  40. cypari2/string_utils.pyx +65 -0
  41. cypari2/types.pxd +147 -0
  42. passagemath_pari-10.6.32.data/data/etc/jupyter/nbconfig/notebook.d/gp-mode.json +5 -0
  43. passagemath_pari-10.6.32.data/data/share/jupyter/kernels/pari_jupyter/kernel.js +28 -0
  44. passagemath_pari-10.6.32.data/data/share/jupyter/kernels/pari_jupyter/kernel.json +6 -0
  45. passagemath_pari-10.6.32.data/data/share/jupyter/kernels/pari_jupyter/logo-64x64.png +0 -0
  46. passagemath_pari-10.6.32.data/data/share/jupyter/kernels/xeus-gp/kernel.json +13 -0
  47. passagemath_pari-10.6.32.data/data/share/jupyter/kernels/xeus-gp/logo-32x32.png +0 -0
  48. passagemath_pari-10.6.32.data/data/share/jupyter/kernels/xeus-gp/logo-64x64.png +0 -0
  49. passagemath_pari-10.6.32.data/data/share/jupyter/kernels/xeus-gp/logo-svg.svg +75 -0
  50. passagemath_pari-10.6.32.data/data/share/jupyter/nbextensions/gp-mode/gp.js +284 -0
  51. passagemath_pari-10.6.32.data/data/share/jupyter/nbextensions/gp-mode/main.js +15 -0
  52. passagemath_pari-10.6.32.dist-info/METADATA +209 -0
  53. passagemath_pari-10.6.32.dist-info/RECORD +331 -0
  54. passagemath_pari-10.6.32.dist-info/WHEEL +5 -0
  55. passagemath_pari-10.6.32.dist-info/top_level.txt +4 -0
  56. passagemath_pari.libs/libcrypto-f04afe95.so.3 +0 -0
  57. passagemath_pari.libs/libflint-fd6f12fc.so.21.0.0 +0 -0
  58. passagemath_pari.libs/libgcc_s-0cd532bd.so.1 +0 -0
  59. passagemath_pari.libs/libgf2x-9e30c3e3.so.3.0.0 +0 -0
  60. passagemath_pari.libs/libgfortran-2c33b284.so.5.0.0 +0 -0
  61. passagemath_pari.libs/libgivaro-9a94c711.so.9.2.1 +0 -0
  62. passagemath_pari.libs/libgmp-0e7fc84e.so.10.5.0 +0 -0
  63. passagemath_pari.libs/libgmpxx-9e08595c.so.4.7.0 +0 -0
  64. passagemath_pari.libs/libgsl-42cda06f.so.28.0.0 +0 -0
  65. passagemath_pari.libs/libmpfr-aaecbfc0.so.6.2.1 +0 -0
  66. passagemath_pari.libs/libncursesw-9c9e32c3.so.6.5 +0 -0
  67. passagemath_pari.libs/libntl-26885ca2.so.44.0.1 +0 -0
  68. passagemath_pari.libs/libopenblasp-r0-905cb27d.3.29.so +0 -0
  69. passagemath_pari.libs/libpari-gmp-tls-f31f908f.so.2.17.2 +0 -0
  70. passagemath_pari.libs/libquadmath-bb76a5fc.so.0.0.0 +0 -0
  71. passagemath_pari.libs/libreadline-06542304.so.8.2 +0 -0
  72. passagemath_pari.libs/libstdc++-5d72f927.so.6.0.33 +0 -0
  73. passagemath_pari.libs/libuuid-f3770415.so.1.3.0 +0 -0
  74. passagemath_pari.libs/libxeus-735780ff.so.13.1.0 +0 -0
  75. passagemath_pari.libs/libxeus-zmq-c68577b4.so.6.0.1 +0 -0
  76. passagemath_pari.libs/libzmq-1ba9a3da.so.5.2.5 +0 -0
  77. sage/all__sagemath_pari.py +26 -0
  78. sage/databases/all__sagemath_pari.py +7 -0
  79. sage/databases/conway.py +274 -0
  80. sage/ext/all__sagemath_pari.py +1 -0
  81. sage/ext/memory.cpython-314-x86_64-linux-musl.so +0 -0
  82. sage/ext/memory.pyx +98 -0
  83. sage/ext_data/pari/buzzard/DimensionSk.g +286 -0
  84. sage/ext_data/pari/buzzard/Tpprog.g +179 -0
  85. sage/ext_data/pari/buzzard/genusn.g +129 -0
  86. sage/ext_data/pari/dokchitser/computel.gp +740 -0
  87. sage/ext_data/pari/dokchitser/computel.gp.template +740 -0
  88. sage/ext_data/pari/dokchitser/ex-bsw +43 -0
  89. sage/ext_data/pari/dokchitser/ex-chgen +48 -0
  90. sage/ext_data/pari/dokchitser/ex-chqua +37 -0
  91. sage/ext_data/pari/dokchitser/ex-delta +35 -0
  92. sage/ext_data/pari/dokchitser/ex-eisen +30 -0
  93. sage/ext_data/pari/dokchitser/ex-gen2 +38 -0
  94. sage/ext_data/pari/dokchitser/ex-gen3 +49 -0
  95. sage/ext_data/pari/dokchitser/ex-gen4 +54 -0
  96. sage/ext_data/pari/dokchitser/ex-nf +48 -0
  97. sage/ext_data/pari/dokchitser/ex-shin +50 -0
  98. sage/ext_data/pari/dokchitser/ex-tau2 +30 -0
  99. sage/ext_data/pari/dokchitser/ex-zeta +27 -0
  100. sage/ext_data/pari/dokchitser/ex-zeta2 +47 -0
  101. sage/ext_data/pari/dokchitser/testall +13 -0
  102. sage/ext_data/pari/simon/ell.gp +2129 -0
  103. sage/ext_data/pari/simon/ellQ.gp +2151 -0
  104. sage/ext_data/pari/simon/ellcommon.gp +126 -0
  105. sage/ext_data/pari/simon/qfsolve.gp +722 -0
  106. sage/ext_data/pari/simon/resultant3.gp +306 -0
  107. sage/groups/all__sagemath_pari.py +3 -0
  108. sage/groups/pari_group.py +175 -0
  109. sage/interfaces/all__sagemath_pari.py +1 -0
  110. sage/interfaces/genus2reduction.py +464 -0
  111. sage/interfaces/gp.py +1114 -0
  112. sage/libs/all__sagemath_pari.py +2 -0
  113. sage/libs/linkages/__init__.py +1 -0
  114. sage/libs/linkages/padics/API.pxi +617 -0
  115. sage/libs/linkages/padics/Polynomial_ram.pxi +388 -0
  116. sage/libs/linkages/padics/Polynomial_shared.pxi +554 -0
  117. sage/libs/linkages/padics/__init__.py +1 -0
  118. sage/libs/linkages/padics/fmpz_poly_unram.pxi +869 -0
  119. sage/libs/linkages/padics/mpz.pxi +691 -0
  120. sage/libs/linkages/padics/relaxed/API.pxi +518 -0
  121. sage/libs/linkages/padics/relaxed/__init__.py +1 -0
  122. sage/libs/linkages/padics/relaxed/flint.pxi +543 -0
  123. sage/libs/linkages/padics/unram_shared.pxi +247 -0
  124. sage/libs/pari/__init__.py +210 -0
  125. sage/libs/pari/all.py +5 -0
  126. sage/libs/pari/convert_flint.cpython-314-x86_64-linux-musl.so +0 -0
  127. sage/libs/pari/convert_flint.pxd +14 -0
  128. sage/libs/pari/convert_flint.pyx +159 -0
  129. sage/libs/pari/convert_gmp.cpython-314-x86_64-linux-musl.so +0 -0
  130. sage/libs/pari/convert_gmp.pxd +14 -0
  131. sage/libs/pari/convert_gmp.pyx +210 -0
  132. sage/libs/pari/convert_sage.cpython-314-x86_64-linux-musl.so +0 -0
  133. sage/libs/pari/convert_sage.pxd +16 -0
  134. sage/libs/pari/convert_sage.pyx +588 -0
  135. sage/libs/pari/convert_sage_complex_double.cpython-314-x86_64-linux-musl.so +0 -0
  136. sage/libs/pari/convert_sage_complex_double.pxd +14 -0
  137. sage/libs/pari/convert_sage_complex_double.pyx +132 -0
  138. sage/libs/pari/convert_sage_matrix.cpython-314-x86_64-linux-musl.so +0 -0
  139. sage/libs/pari/convert_sage_matrix.pyx +106 -0
  140. sage/libs/pari/convert_sage_real_double.cpython-314-x86_64-linux-musl.so +0 -0
  141. sage/libs/pari/convert_sage_real_double.pxd +5 -0
  142. sage/libs/pari/convert_sage_real_double.pyx +14 -0
  143. sage/libs/pari/convert_sage_real_mpfr.cpython-314-x86_64-linux-musl.so +0 -0
  144. sage/libs/pari/convert_sage_real_mpfr.pxd +7 -0
  145. sage/libs/pari/convert_sage_real_mpfr.pyx +108 -0
  146. sage/libs/pari/misc.cpython-314-x86_64-linux-musl.so +0 -0
  147. sage/libs/pari/misc.pxd +4 -0
  148. sage/libs/pari/misc.pyx +26 -0
  149. sage/libs/pari/tests.py +1848 -0
  150. sage/matrix/all__sagemath_pari.py +1 -0
  151. sage/matrix/matrix_integer_pari.cpython-314-x86_64-linux-musl.so +0 -0
  152. sage/matrix/matrix_integer_pari.pyx +187 -0
  153. sage/matrix/matrix_rational_pari.cpython-314-x86_64-linux-musl.so +0 -0
  154. sage/matrix/matrix_rational_pari.pyx +160 -0
  155. sage/quadratic_forms/all__sagemath_pari.py +10 -0
  156. sage/quadratic_forms/genera/all.py +9 -0
  157. sage/quadratic_forms/genera/genus.py +3506 -0
  158. sage/quadratic_forms/genera/normal_form.py +1519 -0
  159. sage/quadratic_forms/genera/spinor_genus.py +243 -0
  160. sage/quadratic_forms/qfsolve.py +255 -0
  161. sage/quadratic_forms/quadratic_form__automorphisms.py +427 -0
  162. sage/quadratic_forms/quadratic_form__genus.py +141 -0
  163. sage/quadratic_forms/quadratic_form__local_density_interfaces.py +140 -0
  164. sage/quadratic_forms/quadratic_form__local_normal_form.py +421 -0
  165. sage/quadratic_forms/quadratic_form__local_representation_conditions.py +889 -0
  166. sage/quadratic_forms/quadratic_form__mass.py +69 -0
  167. sage/quadratic_forms/quadratic_form__mass__Conway_Sloane_masses.py +663 -0
  168. sage/quadratic_forms/quadratic_form__mass__Siegel_densities.py +373 -0
  169. sage/quadratic_forms/quadratic_form__siegel_product.py +198 -0
  170. sage/quadratic_forms/special_values.py +323 -0
  171. sage/rings/all__sagemath_pari.py +15 -0
  172. sage/rings/factorint_pari.cpython-314-x86_64-linux-musl.so +0 -0
  173. sage/rings/factorint_pari.pyx +80 -0
  174. sage/rings/finite_rings/all__sagemath_pari.py +1 -0
  175. sage/rings/finite_rings/element_givaro.cpython-314-x86_64-linux-musl.so +0 -0
  176. sage/rings/finite_rings/element_givaro.pxd +91 -0
  177. sage/rings/finite_rings/element_givaro.pyx +1769 -0
  178. sage/rings/finite_rings/element_ntl_gf2e.cpython-314-x86_64-linux-musl.so +0 -0
  179. sage/rings/finite_rings/element_ntl_gf2e.pxd +22 -0
  180. sage/rings/finite_rings/element_ntl_gf2e.pyx +1333 -0
  181. sage/rings/finite_rings/element_pari_ffelt.cpython-314-x86_64-linux-musl.so +0 -0
  182. sage/rings/finite_rings/element_pari_ffelt.pxd +13 -0
  183. sage/rings/finite_rings/element_pari_ffelt.pyx +1441 -0
  184. sage/rings/finite_rings/finite_field_givaro.py +612 -0
  185. sage/rings/finite_rings/finite_field_pari_ffelt.py +238 -0
  186. sage/rings/finite_rings/hom_finite_field_givaro.cpython-314-x86_64-linux-musl.so +0 -0
  187. sage/rings/finite_rings/hom_finite_field_givaro.pxd +28 -0
  188. sage/rings/finite_rings/hom_finite_field_givaro.pyx +280 -0
  189. sage/rings/finite_rings/residue_field_givaro.cpython-314-x86_64-linux-musl.so +0 -0
  190. sage/rings/finite_rings/residue_field_givaro.pyx +133 -0
  191. sage/rings/finite_rings/residue_field_pari_ffelt.cpython-314-x86_64-linux-musl.so +0 -0
  192. sage/rings/finite_rings/residue_field_pari_ffelt.pyx +128 -0
  193. sage/rings/function_field/all__sagemath_pari.py +1 -0
  194. sage/rings/function_field/valuation.py +1450 -0
  195. sage/rings/function_field/valuation_ring.py +212 -0
  196. sage/rings/number_field/all__sagemath_pari.py +14 -0
  197. sage/rings/number_field/totallyreal.cpython-314-x86_64-linux-musl.so +0 -0
  198. sage/rings/number_field/totallyreal.pyx +509 -0
  199. sage/rings/number_field/totallyreal_data.cpython-314-x86_64-linux-musl.so +0 -0
  200. sage/rings/number_field/totallyreal_data.pxd +26 -0
  201. sage/rings/number_field/totallyreal_data.pyx +928 -0
  202. sage/rings/number_field/totallyreal_phc.py +144 -0
  203. sage/rings/number_field/totallyreal_rel.py +1018 -0
  204. sage/rings/padics/CA_template.pxi +1847 -0
  205. sage/rings/padics/CA_template_header.pxi +50 -0
  206. sage/rings/padics/CR_template.pxi +2563 -0
  207. sage/rings/padics/CR_template_header.pxi +57 -0
  208. sage/rings/padics/FM_template.pxi +1575 -0
  209. sage/rings/padics/FM_template_header.pxi +50 -0
  210. sage/rings/padics/FP_template.pxi +2176 -0
  211. sage/rings/padics/FP_template_header.pxi +57 -0
  212. sage/rings/padics/all.py +3 -0
  213. sage/rings/padics/all__sagemath_pari.py +11 -0
  214. sage/rings/padics/common_conversion.cpython-314-x86_64-linux-musl.so +0 -0
  215. sage/rings/padics/common_conversion.pxd +15 -0
  216. sage/rings/padics/common_conversion.pyx +508 -0
  217. sage/rings/padics/eisenstein_extension_generic.py +232 -0
  218. sage/rings/padics/factory.py +3623 -0
  219. sage/rings/padics/generic_nodes.py +1615 -0
  220. sage/rings/padics/lattice_precision.py +2889 -0
  221. sage/rings/padics/morphism.cpython-314-x86_64-linux-musl.so +0 -0
  222. sage/rings/padics/morphism.pxd +11 -0
  223. sage/rings/padics/morphism.pyx +366 -0
  224. sage/rings/padics/padic_base_generic.py +467 -0
  225. sage/rings/padics/padic_base_leaves.py +1235 -0
  226. sage/rings/padics/padic_capped_absolute_element.cpython-314-x86_64-linux-musl.so +0 -0
  227. sage/rings/padics/padic_capped_absolute_element.pxd +15 -0
  228. sage/rings/padics/padic_capped_absolute_element.pyx +520 -0
  229. sage/rings/padics/padic_capped_relative_element.cpython-314-x86_64-linux-musl.so +0 -0
  230. sage/rings/padics/padic_capped_relative_element.pxd +14 -0
  231. sage/rings/padics/padic_capped_relative_element.pyx +614 -0
  232. sage/rings/padics/padic_extension_generic.py +990 -0
  233. sage/rings/padics/padic_extension_leaves.py +738 -0
  234. sage/rings/padics/padic_fixed_mod_element.cpython-314-x86_64-linux-musl.so +0 -0
  235. sage/rings/padics/padic_fixed_mod_element.pxd +15 -0
  236. sage/rings/padics/padic_fixed_mod_element.pyx +584 -0
  237. sage/rings/padics/padic_floating_point_element.cpython-314-x86_64-linux-musl.so +0 -0
  238. sage/rings/padics/padic_floating_point_element.pxd +14 -0
  239. sage/rings/padics/padic_floating_point_element.pyx +447 -0
  240. sage/rings/padics/padic_generic_element.cpython-314-x86_64-linux-musl.so +0 -0
  241. sage/rings/padics/padic_generic_element.pxd +48 -0
  242. sage/rings/padics/padic_generic_element.pyx +4642 -0
  243. sage/rings/padics/padic_lattice_element.py +1342 -0
  244. sage/rings/padics/padic_printing.cpython-314-x86_64-linux-musl.so +0 -0
  245. sage/rings/padics/padic_printing.pxd +38 -0
  246. sage/rings/padics/padic_printing.pyx +1505 -0
  247. sage/rings/padics/padic_relaxed_element.cpython-314-x86_64-linux-musl.so +0 -0
  248. sage/rings/padics/padic_relaxed_element.pxd +56 -0
  249. sage/rings/padics/padic_relaxed_element.pyx +18 -0
  250. sage/rings/padics/padic_relaxed_errors.cpython-314-x86_64-linux-musl.so +0 -0
  251. sage/rings/padics/padic_relaxed_errors.pxd +11 -0
  252. sage/rings/padics/padic_relaxed_errors.pyx +71 -0
  253. sage/rings/padics/padic_template_element.pxi +1212 -0
  254. sage/rings/padics/padic_template_element_header.pxi +50 -0
  255. sage/rings/padics/padic_valuation.py +1423 -0
  256. sage/rings/padics/pow_computer_flint.cpython-314-x86_64-linux-musl.so +0 -0
  257. sage/rings/padics/pow_computer_flint.pxd +38 -0
  258. sage/rings/padics/pow_computer_flint.pyx +641 -0
  259. sage/rings/padics/pow_computer_relative.cpython-314-x86_64-linux-musl.so +0 -0
  260. sage/rings/padics/pow_computer_relative.pxd +29 -0
  261. sage/rings/padics/pow_computer_relative.pyx +415 -0
  262. sage/rings/padics/qadic_flint_CA.cpython-314-x86_64-linux-musl.so +0 -0
  263. sage/rings/padics/qadic_flint_CA.pxd +21 -0
  264. sage/rings/padics/qadic_flint_CA.pyx +130 -0
  265. sage/rings/padics/qadic_flint_CR.cpython-314-x86_64-linux-musl.so +0 -0
  266. sage/rings/padics/qadic_flint_CR.pxd +13 -0
  267. sage/rings/padics/qadic_flint_CR.pyx +172 -0
  268. sage/rings/padics/qadic_flint_FM.cpython-314-x86_64-linux-musl.so +0 -0
  269. sage/rings/padics/qadic_flint_FM.pxd +14 -0
  270. sage/rings/padics/qadic_flint_FM.pyx +111 -0
  271. sage/rings/padics/qadic_flint_FP.cpython-314-x86_64-linux-musl.so +0 -0
  272. sage/rings/padics/qadic_flint_FP.pxd +12 -0
  273. sage/rings/padics/qadic_flint_FP.pyx +165 -0
  274. sage/rings/padics/relative_extension_leaves.py +429 -0
  275. sage/rings/padics/relative_ramified_CA.cpython-314-x86_64-linux-musl.so +0 -0
  276. sage/rings/padics/relative_ramified_CA.pxd +9 -0
  277. sage/rings/padics/relative_ramified_CA.pyx +33 -0
  278. sage/rings/padics/relative_ramified_CR.cpython-314-x86_64-linux-musl.so +0 -0
  279. sage/rings/padics/relative_ramified_CR.pxd +8 -0
  280. sage/rings/padics/relative_ramified_CR.pyx +33 -0
  281. sage/rings/padics/relative_ramified_FM.cpython-314-x86_64-linux-musl.so +0 -0
  282. sage/rings/padics/relative_ramified_FM.pxd +9 -0
  283. sage/rings/padics/relative_ramified_FM.pyx +33 -0
  284. sage/rings/padics/relative_ramified_FP.cpython-314-x86_64-linux-musl.so +0 -0
  285. sage/rings/padics/relative_ramified_FP.pxd +8 -0
  286. sage/rings/padics/relative_ramified_FP.pyx +33 -0
  287. sage/rings/padics/relaxed_template.pxi +4229 -0
  288. sage/rings/padics/relaxed_template_header.pxi +160 -0
  289. sage/rings/padics/tests.py +35 -0
  290. sage/rings/padics/tutorial.py +341 -0
  291. sage/rings/padics/unramified_extension_generic.py +335 -0
  292. sage/rings/padics/witt_vector.py +917 -0
  293. sage/rings/padics/witt_vector_ring.py +934 -0
  294. sage/rings/pari_ring.py +235 -0
  295. sage/rings/polynomial/all__sagemath_pari.py +1 -0
  296. sage/rings/polynomial/padics/all.py +1 -0
  297. sage/rings/polynomial/padics/polynomial_padic.py +360 -0
  298. sage/rings/polynomial/padics/polynomial_padic_capped_relative_dense.py +1324 -0
  299. sage/rings/polynomial/padics/polynomial_padic_flat.py +72 -0
  300. sage/rings/power_series_pari.cpython-314-x86_64-linux-musl.so +0 -0
  301. sage/rings/power_series_pari.pxd +6 -0
  302. sage/rings/power_series_pari.pyx +934 -0
  303. sage/rings/tate_algebra.py +1282 -0
  304. sage/rings/tate_algebra_element.cpython-314-x86_64-linux-musl.so +0 -0
  305. sage/rings/tate_algebra_element.pxd +49 -0
  306. sage/rings/tate_algebra_element.pyx +3464 -0
  307. sage/rings/tate_algebra_ideal.cpython-314-x86_64-linux-musl.so +0 -0
  308. sage/rings/tate_algebra_ideal.pxd +7 -0
  309. sage/rings/tate_algebra_ideal.pyx +1307 -0
  310. sage/rings/valuation/all.py +7 -0
  311. sage/rings/valuation/augmented_valuation.py +2118 -0
  312. sage/rings/valuation/developing_valuation.py +362 -0
  313. sage/rings/valuation/gauss_valuation.py +812 -0
  314. sage/rings/valuation/inductive_valuation.py +1686 -0
  315. sage/rings/valuation/limit_valuation.py +946 -0
  316. sage/rings/valuation/mapped_valuation.py +656 -0
  317. sage/rings/valuation/scaled_valuation.py +322 -0
  318. sage/rings/valuation/trivial_valuation.py +382 -0
  319. sage/rings/valuation/valuation.py +1119 -0
  320. sage/rings/valuation/valuation_space.py +1615 -0
  321. sage/rings/valuation/valuations_catalog.py +10 -0
  322. sage/rings/valuation/value_group.py +697 -0
  323. sage/schemes/all__sagemath_pari.py +1 -0
  324. sage/schemes/elliptic_curves/all__sagemath_pari.py +1 -0
  325. sage/schemes/elliptic_curves/descent_two_isogeny_pari.cpython-314-x86_64-linux-musl.so +0 -0
  326. sage/schemes/elliptic_curves/descent_two_isogeny_pari.pyx +46 -0
  327. sage_wheels/bin/gp +0 -0
  328. sage_wheels/bin/gp2c +0 -0
  329. sage_wheels/bin/gp2c-run +57 -0
  330. sage_wheels/bin/xeus-gp +0 -0
  331. sage_wheels/share/gp2c/func.dsc +18414 -0
@@ -0,0 +1,38 @@
1
+ # sage_setup: distribution = sagemath-pari
2
+ from sage.libs.gmp.mpz cimport mpz_t
3
+ from sage.libs.flint.types cimport padic_ctx_t, fmpz_t, fmpz_poly_t
4
+ from sage.rings.padics.pow_computer cimport PowComputer_class
5
+
6
+ cdef class PowComputer_flint(PowComputer_class):
7
+ cdef padic_ctx_t ctx
8
+ cdef fmpz_t fprime
9
+ cdef fmpz_t half_prime
10
+ cdef fmpz_t _fpow_array
11
+ cdef fmpz_t _fpow_variable
12
+ cdef mpz_t top_power
13
+
14
+ cdef fmpz_t* pow_fmpz_t_tmp(self, unsigned long n) except NULL
15
+ cdef unsigned long capdiv(self, unsigned long n) noexcept
16
+
17
+ cdef fmpz_t tfmpz
18
+
19
+ cdef class PowComputer_flint_1step(PowComputer_flint):
20
+ cdef fmpz_t q
21
+ cdef fmpz_poly_t modulus
22
+ cdef fmpz_poly_t powhelper_oneunit
23
+ cdef fmpz_poly_t powhelper_teichdiff
24
+ cdef fmpz_poly_t* _moduli
25
+ cdef fmpz_poly_t* get_modulus(self, unsigned long n) noexcept
26
+ cdef fmpz_poly_t* get_modulus_capdiv(self, unsigned long n) noexcept
27
+ cdef _new_fmpz_poly(self, fmpz_poly_t value, var=*)
28
+
29
+ cdef class PowComputer_flint_unram(PowComputer_flint_1step):
30
+ # WARNING:
31
+ # These variables are modified by the linkage and must no be used anywhere else
32
+ # (other than in __(c)init__)
33
+ cdef fmpz_t fmpz_ccmp, fmpz_cval, fmpz_cinv, fmpz_cinv2, fmpz_cexp, fmpz_ctm, fmpz_cconv
34
+ cdef fmpz_poly_t poly_cconv, poly_ctm, poly_ccmp, poly_cinv, poly_cisunit, poly_cinv2, poly_flint_rep, poly_matmod, shift_rem, aliasing
35
+ cdef mpz_t mpz_cpow, mpz_ctm, mpz_cconv, mpz_matmod
36
+
37
+ cdef class PowComputer_flint_eis(PowComputer_flint_1step):
38
+ pass
@@ -0,0 +1,641 @@
1
+ # sage_setup: distribution = sagemath-pari
2
+ # distutils: extra_compile_args = -std=c++11
3
+ # distutils: libraries = gmp
4
+ # distutils: language = c++
5
+ # sage.doctest: needs sage.libs.flint
6
+ from cysignals.memory cimport sig_malloc, sig_free
7
+ from cysignals.signals cimport sig_on, sig_off
8
+
9
+ from sage.libs.gmp.mpz cimport mpz_init, mpz_clear, mpz_pow_ui
10
+ from sage.libs.flint.padic cimport *
11
+ from sage.libs.flint.fmpz_poly cimport *
12
+ from sage.libs.flint.nmod_vec cimport *
13
+ from sage.libs.flint.fmpz_vec cimport *
14
+ from sage.libs.flint.fmpz cimport fmpz_init, fmpz_one, fmpz_mul, fmpz_set, fmpz_get_mpz, fmpz_clear, fmpz_pow_ui, fmpz_set_mpz, fmpz_fdiv_q_2exp
15
+
16
+ from cpython.object cimport Py_EQ, Py_NE
17
+ from sage.structure.richcmp cimport richcmp_not_equal
18
+ from sage.rings.integer cimport Integer
19
+ from sage.rings.integer_ring import ZZ
20
+ from sage.rings.polynomial.polynomial_integer_dense_flint cimport Polynomial_integer_dense_flint
21
+
22
+
23
+ cdef class PowComputer_flint(PowComputer_class):
24
+ """
25
+ A PowComputer for use in `p`-adics implemented via FLINT.
26
+
27
+ For a description of inputs see :func:`PowComputer_flint_maker`.
28
+
29
+ EXAMPLES::
30
+
31
+ sage: from sage.rings.padics.pow_computer_flint import PowComputer_flint
32
+ sage: PowComputer_flint(5, 20, 20, 20, False)
33
+ FLINT PowComputer for 5
34
+ """
35
+ def __cinit__(self, Integer prime, long cache_limit, long prec_cap, long ram_prec_cap, bint in_field, poly=None, shift_seed=None):
36
+ """
37
+ Memory initialization.
38
+
39
+ TESTS::
40
+
41
+ sage: from sage.rings.padics.pow_computer_flint import PowComputer_flint
42
+ sage: type(PowComputer_flint(5, 20, 20, 20, False))
43
+ <class 'sage.rings.padics.pow_computer_flint.PowComputer_flint'>
44
+ """
45
+ # fmpz_init does not allocate memory
46
+ fmpz_init(self.fprime)
47
+ fmpz_init(self.half_prime)
48
+ fmpz_set_mpz(self.fprime, prime.value)
49
+ fmpz_init(self._fpow_variable)
50
+ fmpz_fdiv_q_2exp(self.half_prime, self.fprime, 1)
51
+ fmpz_init(self.tfmpz)
52
+
53
+ sig_on()
54
+ try:
55
+ mpz_init(self.top_power)
56
+ padic_ctx_init(self.ctx, self.fprime, 0, prec_cap, PADIC_SERIES)
57
+ finally:
58
+ sig_off()
59
+
60
+ self._allocated = 4
61
+
62
+ def __init__(self, Integer prime, long cache_limit, long prec_cap, long ram_prec_cap, bint in_field, poly=None, shift_seed=None):
63
+ """
64
+ Initialization.
65
+
66
+ TESTS::
67
+
68
+ sage: from sage.rings.padics.pow_computer_flint import PowComputer_flint_maker
69
+ sage: R.<x> = ZZ[]; f = x^3 - 8*x - 2
70
+ sage: A = PowComputer_flint_maker(5, 20, 20, 20, False, f, 'capped-rel') # indirect doctest
71
+ sage: TestSuite(A).run()
72
+ """
73
+ PowComputer_class.__init__(self, prime, cache_limit, prec_cap, ram_prec_cap, in_field, poly, shift_seed)
74
+
75
+ mpz_pow_ui(self.top_power, prime.value, prec_cap)
76
+
77
+ def __dealloc__(self):
78
+ """
79
+ Deallocation.
80
+
81
+ TESTS::
82
+
83
+ sage: from sage.rings.padics.pow_computer_flint import PowComputer_flint
84
+ sage: A = PowComputer_flint(5, 20, 20, 20, False)
85
+ sage: del A
86
+ """
87
+ if self._allocated >= 4:
88
+ fmpz_clear(self.fprime)
89
+ fmpz_clear(self.half_prime)
90
+ fmpz_clear(self._fpow_variable)
91
+ fmpz_clear(self.tfmpz)
92
+ mpz_clear(self.top_power)
93
+ padic_ctx_clear(self.ctx)
94
+
95
+ def __reduce__(self):
96
+ """
97
+ Pickling.
98
+
99
+ TESTS::
100
+
101
+ sage: from sage.rings.padics.pow_computer_flint import PowComputer_flint_maker
102
+ sage: R.<x> = ZZ[]; f = x^3 - 8*x - 2
103
+ sage: A = PowComputer_flint_maker(5, 20, 20, 20, False, f, 'capped-rel') # indirect doctest
104
+ sage: A._test_pickling() # indirect doctest
105
+ """
106
+ return PowComputer_flint_maker, (self.prime, self.cache_limit, self.prec_cap, self.ram_prec_cap, self.in_field, self.polynomial(), self._prec_type)
107
+
108
+ def _repr_(self):
109
+ """
110
+ String representation of this powcomputer.
111
+
112
+ EXAMPLES::
113
+
114
+ sage: from sage.rings.padics.pow_computer_flint import PowComputer_flint
115
+ sage: A = PowComputer_flint(5, 20, 20, 20, False); A
116
+ FLINT PowComputer for 5
117
+ """
118
+ return "FLINT PowComputer for %s" % self.prime
119
+
120
+ cdef fmpz_t* pow_fmpz_t_tmp(self, unsigned long n) except NULL:
121
+ """
122
+ Return a pointer to a FLINT ``fmpz_t`` holding `p^n`.
123
+
124
+ Analogous to
125
+ :meth:`sage.rings.padics.pow_computer.PowComputer_class.pow_mpz_t_tmp`
126
+ but with FLINT ``fmpz_t`` rather than GMP ``mpz_t``. The same
127
+ important warnings apply.
128
+ """
129
+ cdef padic_ctx_struct ctx = (<padic_ctx_struct*>self.ctx)[0]
130
+ if ctx.min <= n and n < ctx.max:
131
+ self._fpow_array[0] = (ctx.pow + (n - ctx.min))[0]
132
+ return &self._fpow_array
133
+ else:
134
+ fmpz_pow_ui(self._fpow_variable, self.fprime, n)
135
+ return &self._fpow_variable
136
+
137
+ cdef mpz_srcptr pow_mpz_t_tmp(self, long n) except NULL:
138
+ """
139
+ Return a pointer to an ``mpz_t`` holding `p^n`.
140
+
141
+ See
142
+ :meth:`sage.rings.padics.pow_computer.PowComputer_class.pow_mpz_t_tmp`
143
+ for important warnings.
144
+ """
145
+ fmpz_get_mpz(self.temp_m, self.pow_fmpz_t_tmp(n)[0])
146
+ return self.temp_m
147
+
148
+ cdef mpz_srcptr pow_mpz_t_top(self) noexcept:
149
+ """
150
+ Return a pointer to an ``mpz_t`` holding `p^N`, where `N` is
151
+ the precision cap.
152
+ """
153
+ return self.top_power
154
+
155
+ cdef unsigned long capdiv(self, unsigned long n) noexcept:
156
+ """
157
+ Return ceil(n / e).
158
+ """
159
+ if self.e == 1: return n
160
+ if n == 0: return 0
161
+ return (n-1) / self.e + 1
162
+
163
+ def polynomial(self, n=None, var='x'):
164
+ """
165
+ Return ``None``.
166
+
167
+ For consistency with subclasses.
168
+
169
+ EXAMPLES::
170
+
171
+ sage: from sage.rings.padics.pow_computer_flint import PowComputer_flint
172
+ sage: A = PowComputer_flint(5, 20, 20, 20, False, None)
173
+ sage: A.polynomial() is None
174
+ True
175
+ """
176
+ return None
177
+
178
+ cdef class PowComputer_flint_1step(PowComputer_flint):
179
+ """
180
+ A PowComputer for a `p`-adic extension defined by a single polynomial.
181
+
182
+ For a description of inputs see :func:`PowComputer_flint_maker`.
183
+
184
+ EXAMPLES::
185
+
186
+ sage: from sage.rings.padics.pow_computer_flint import PowComputer_flint_1step
187
+ sage: R.<x> = ZZ[]; f = x^3 - 8*x - 2
188
+ sage: A = PowComputer_flint_1step(5, 20, 20, 20, False, f); A
189
+ FLINT PowComputer for 5 with polynomial x^3 - 8*x - 2
190
+ """
191
+ def __cinit__(self, Integer prime, long cache_limit, long prec_cap, long ram_prec_cap, bint in_field, _poly):
192
+ """
193
+ Memory initialization.
194
+
195
+ TESTS::
196
+
197
+ sage: from sage.rings.padics.pow_computer_flint import PowComputer_flint_1step
198
+ sage: R.<x> = ZZ[]; f = x^3 - 8*x - 2
199
+ sage: A = PowComputer_flint_1step(5, 20, 20, 20, False, f)
200
+ sage: type(A)
201
+ <class 'sage.rings.padics.pow_computer_flint.PowComputer_flint_1step'>
202
+ """
203
+ cdef Polynomial_integer_dense_flint poly = _poly
204
+ cdef long length = fmpz_poly_length(poly._poly)
205
+
206
+ cdef Py_ssize_t i
207
+
208
+ # fmpz_init does not allocate memory
209
+ fmpz_init(self.q)
210
+
211
+ sig_on()
212
+ try:
213
+ self._moduli = <fmpz_poly_t*>sig_malloc(sizeof(fmpz_poly_t) * (cache_limit + 2))
214
+ if self._moduli == NULL:
215
+ raise MemoryError
216
+ try:
217
+ fmpz_poly_init2(self.modulus, length)
218
+ try:
219
+ fmpz_poly_init2(self.powhelper_oneunit, length)
220
+ try:
221
+ fmpz_poly_init2(self.powhelper_teichdiff, length)
222
+ try:
223
+ for i in range(1,cache_limit+2):
224
+ try:
225
+ fmpz_poly_init2(self._moduli[i], length)
226
+ except BaseException:
227
+ i-=1
228
+ while i:
229
+ fmpz_poly_clear(self._moduli[i])
230
+ i-=1
231
+ raise
232
+ except BaseException:
233
+ fmpz_poly_clear(self.powhelper_teichdiff)
234
+ raise
235
+ except BaseException:
236
+ fmpz_poly_clear(self.powhelper_oneunit)
237
+ raise
238
+ except BaseException:
239
+ fmpz_poly_clear(self.modulus)
240
+ raise
241
+ except BaseException:
242
+ sig_free(self._moduli)
243
+ raise
244
+ finally:
245
+ sig_off()
246
+
247
+ self._allocated = 8
248
+
249
+ def __init__(self, Integer prime, long cache_limit, long prec_cap, long ram_prec_cap, bint in_field, _poly, shift_seed=None):
250
+ """
251
+ Initialization.
252
+
253
+ TESTS::
254
+
255
+ sage: from sage.rings.padics.pow_computer_flint import PowComputer_flint_maker
256
+ sage: R.<x> = ZZ[]; f = x^3 - 8*x - 2
257
+ sage: A = PowComputer_flint_maker(5, 20, 20, 20, False, f, 'capped-rel')
258
+ sage: TestSuite(A).run()
259
+ """
260
+ PowComputer_flint.__init__(self, prime, cache_limit, prec_cap, ram_prec_cap, in_field, _poly, shift_seed)
261
+
262
+ cdef Polynomial_integer_dense_flint poly = _poly
263
+ cdef long length = fmpz_poly_length(poly._poly)
264
+ self.deg = length - 1
265
+
266
+ fmpz_poly_set(self.modulus, poly._poly)
267
+
268
+ cdef Py_ssize_t i
269
+ cdef fmpz* coeffs = self.modulus.coeffs
270
+ fmpz_one(self.tfmpz)
271
+ for i in range(1,cache_limit+1):
272
+ fmpz_mul(self.tfmpz, self.tfmpz, self.fprime)
273
+ _fmpz_vec_scalar_mod_fmpz((<fmpz_poly_struct*>self._moduli[i])[0].coeffs, coeffs, length, self.tfmpz)
274
+ _fmpz_poly_set_length(self._moduli[i], length)
275
+
276
+ _fmpz_poly_set_length(self._moduli[cache_limit+1], length)
277
+
278
+ def __dealloc__(self):
279
+ """
280
+ Deallocation.
281
+
282
+ TESTS::
283
+
284
+ sage: from sage.rings.padics.pow_computer_flint import PowComputer_flint_1step
285
+ sage: R.<x> = ZZ[]; f = x^3 - 8*x - 2
286
+ sage: A = PowComputer_flint_1step(5, 20, 20, 20, False, f)
287
+ sage: del A
288
+ """
289
+ cdef Py_ssize_t i
290
+
291
+ if self._allocated >= 8:
292
+ fmpz_clear(self.q)
293
+ fmpz_poly_clear(self.modulus)
294
+ fmpz_poly_clear(self.powhelper_oneunit)
295
+ fmpz_poly_clear(self.powhelper_teichdiff)
296
+ for i in range(1, self.cache_limit + 1):
297
+ fmpz_poly_clear(self._moduli[i])
298
+ sig_free(self._moduli)
299
+
300
+ def _repr_(self):
301
+ """
302
+ String representation of this powcomputer.
303
+
304
+ EXAMPLES::
305
+
306
+ sage: from sage.rings.padics.pow_computer_flint import PowComputer_flint_1step
307
+ sage: R.<x> = ZZ[]; f = x^3 - 8*x - 2
308
+ sage: A = PowComputer_flint_1step(5, 20, 20, 20, False, f); A
309
+ FLINT PowComputer for 5 with polynomial x^3 - 8*x - 2
310
+ """
311
+ return "FLINT PowComputer for %s with polynomial %s" % (self.prime, self.polynomial())
312
+
313
+ def __richcmp__(self, other, int op):
314
+ """
315
+ Comparison.
316
+
317
+ Lexicographic on class, prime, precision cap, cache_limit and polynomial.
318
+
319
+ EXAMPLES::
320
+
321
+ sage: from sage.rings.padics.pow_computer_flint import PowComputer_flint_1step
322
+ sage: R.<x> = ZZ[]; f = x^3 - 8*x - 2; g = x^3 - (8 + 5^22)*x - 2
323
+ sage: A = PowComputer_flint_1step(5, 20, 20, 20, False, f)
324
+ sage: B = PowComputer_flint_1step(5, 20, 20, 20, False, g)
325
+ sage: A == B
326
+ False
327
+ """
328
+ if not isinstance(other, PowComputer_flint_1step):
329
+ if op in [Py_EQ, Py_NE]:
330
+ return (op == Py_NE)
331
+ return NotImplemented
332
+
333
+ cdef PowComputer_flint_1step s = self
334
+ cdef PowComputer_flint_1step o = other
335
+
336
+ lx = s.prime
337
+ rx = o.prime
338
+ if lx != rx:
339
+ return richcmp_not_equal(lx, rx, op)
340
+
341
+ lx = s.prec_cap
342
+ rx = o.prec_cap
343
+ if lx != rx:
344
+ return richcmp_not_equal(lx, rx, op)
345
+
346
+ lx = s.cache_limit
347
+ rx = o.cache_limit
348
+ if lx != rx:
349
+ return richcmp_not_equal(lx, rx, op)
350
+
351
+ lx = s.in_field
352
+ rx = o.in_field
353
+ if lx != rx:
354
+ return richcmp_not_equal(lx, rx, op)
355
+
356
+ if fmpz_poly_equal(s.modulus, o.modulus):
357
+ return (op == Py_EQ)
358
+ if op != Py_NE:
359
+ return NotImplemented
360
+ return False
361
+
362
+ cdef fmpz_poly_t* get_modulus(self, unsigned long k) noexcept:
363
+ """
364
+ Return the defining polynomial reduced modulo `p^k`.
365
+
366
+ The same warnings apply as for
367
+ :meth:`sage.rings.padics.pow_computer.PowComputer_class.pow_mpz_t_tmp`.
368
+ """
369
+ cdef long c
370
+ if k <= self.cache_limit:
371
+ return &(self._moduli[k])
372
+ else:
373
+ c = self.cache_limit+1
374
+ _fmpz_vec_scalar_mod_fmpz((<fmpz_poly_struct*>self._moduli[c])[0].coeffs,
375
+ (<fmpz_poly_struct*>self.modulus)[0].coeffs,
376
+ self.deg + 1,
377
+ self.pow_fmpz_t_tmp(k)[0])
378
+ return &(self._moduli[c])
379
+
380
+ cdef fmpz_poly_t* get_modulus_capdiv(self, unsigned long k) noexcept:
381
+ """
382
+ Return the defining polynomial reduced modulo `p^a`, where
383
+ `a` is the ceiling of `k/e`.
384
+
385
+ The same warnings apply as for
386
+ :meth:`sage.rings.padics.pow_computer.PowComputer_class.pow_mpz_t_tmp`.
387
+ """
388
+ return self.get_modulus(self.capdiv(k))
389
+
390
+ def polynomial(self, _n=None, var='x'):
391
+ """
392
+ Return the polynomial attached to this ``PowComputer``, possibly
393
+ reduced modulo a power of `p`.
394
+
395
+ INPUT:
396
+
397
+ - ``_n`` -- (default: ``None``) an integer, the power of `p`
398
+ modulo which to reduce
399
+
400
+ - ``var`` -- (default: ``'x'``) the variable for the returned polynomial
401
+
402
+ .. NOTE::
403
+
404
+ From Cython you should use :meth:`get_modulus` instead for
405
+ speed.
406
+
407
+ EXAMPLES::
408
+
409
+ sage: from sage.rings.padics.pow_computer_flint import PowComputer_flint_1step
410
+ sage: R.<y> = ZZ[]; f = y^3 - 8*y - 2
411
+ sage: A = PowComputer_flint_1step(5, 20, 20, 20, False, f)
412
+ sage: A.polynomial()
413
+ x^3 - 8*x - 2
414
+ sage: A.polynomial(var='y')
415
+ y^3 - 8*y - 2
416
+ sage: A.polynomial(2)
417
+ x^3 + 17*x + 23
418
+ """
419
+ R = ZZ[var]
420
+ x = R.gen()
421
+ cdef Polynomial_integer_dense_flint ans = (<Polynomial_integer_dense_flint?>x)._new()
422
+ if _n is None:
423
+ fmpz_poly_set(ans._poly, self.modulus)
424
+ else:
425
+ fmpz_poly_set(ans._poly, self.get_modulus(_n)[0])
426
+ return ans
427
+
428
+ cdef _new_fmpz_poly(self, fmpz_poly_t value, var='x'):
429
+ """
430
+ Return a polynomial with the value stored in ``value`` and
431
+ variable name ``var``.
432
+ """
433
+ R = ZZ[var]
434
+ x = R.gen()
435
+ cdef Polynomial_integer_dense_flint ans = (<Polynomial_integer_dense_flint?>x)._new()
436
+ fmpz_poly_set(ans._poly, value)
437
+ return ans
438
+
439
+ cdef class PowComputer_flint_unram(PowComputer_flint_1step):
440
+ """
441
+ A PowComputer for a `p`-adic extension defined by an unramified polynomial.
442
+
443
+ For a description of inputs see :func:`PowComputer_flint_maker`.
444
+
445
+ EXAMPLES::
446
+
447
+ sage: from sage.rings.padics.pow_computer_flint import PowComputer_flint_unram
448
+ sage: R.<x> = ZZ[]; f = x^3 - 8*x - 2
449
+ sage: A = PowComputer_flint_unram(5, 20, 20, 20, False, f); A
450
+ FLINT PowComputer for 5 with polynomial x^3 - 8*x - 2
451
+ """
452
+ def __cinit__(self, Integer prime, long cache_limit, long prec_cap, long ram_prec_cap, bint in_field, _poly, shift_seed=None):
453
+ """
454
+ Memory initialization.
455
+
456
+ TESTS::
457
+
458
+ sage: from sage.rings.padics.pow_computer_flint import PowComputer_flint_unram
459
+ sage: R.<x> = ZZ[]; f = x^3 - 8*x - 2
460
+ sage: A = PowComputer_flint_unram(5, 20, 20, 20, False, f)
461
+ sage: type(A)
462
+ <class 'sage.rings.padics.pow_computer_flint.PowComputer_flint_unram'>
463
+ """
464
+ # fmpz_init does not allocate memory
465
+ fmpz_init(self.fmpz_ccmp)
466
+ fmpz_init(self.fmpz_cval)
467
+ fmpz_init(self.fmpz_cinv)
468
+ fmpz_init(self.fmpz_cinv2)
469
+ fmpz_init(self.fmpz_cexp)
470
+ fmpz_init(self.fmpz_ctm)
471
+ fmpz_init(self.fmpz_cconv)
472
+
473
+ # While the following allocations have the potential to leak
474
+ # small amounts of memory when interrupted or when one of the
475
+ # init methods raises a MemoryError, the only leak-free
476
+ # solution we could devise used 11-nested try blocks. We
477
+ # choose readable code in this case.
478
+ sig_on()
479
+ fmpz_poly_init(self.poly_cconv)
480
+ fmpz_poly_init(self.poly_ctm)
481
+ fmpz_poly_init(self.poly_ccmp)
482
+ fmpz_poly_init(self.poly_cinv)
483
+ fmpz_poly_init(self.poly_cisunit)
484
+ fmpz_poly_init(self.poly_cinv2)
485
+ fmpz_poly_init(self.poly_flint_rep)
486
+ fmpz_poly_init(self.poly_matmod)
487
+ fmpz_poly_init(self.shift_rem)
488
+ fmpz_poly_init(self.aliasing)
489
+ mpz_init(self.mpz_cpow)
490
+ mpz_init(self.mpz_ctm)
491
+ mpz_init(self.mpz_cconv)
492
+ mpz_init(self.mpz_matmod)
493
+ sig_off()
494
+
495
+ self._allocated = 16
496
+
497
+ def __dealloc__(self):
498
+ """
499
+ Deallocation.
500
+
501
+ TESTS::
502
+
503
+ sage: from sage.rings.padics.pow_computer_flint import PowComputer_flint_unram
504
+ sage: R.<x> = ZZ[]; f = x^3 - 8*x - 2
505
+ sage: A = PowComputer_flint_unram(5, 20, 20, 20, False, f)
506
+ sage: del A
507
+ """
508
+ if self._allocated >= 16:
509
+ fmpz_clear(self.fmpz_ccmp)
510
+ fmpz_clear(self.fmpz_cval)
511
+ fmpz_clear(self.fmpz_cinv)
512
+ fmpz_clear(self.fmpz_cinv2)
513
+ fmpz_clear(self.fmpz_cexp)
514
+ fmpz_clear(self.fmpz_ctm)
515
+ fmpz_clear(self.fmpz_cconv)
516
+ mpz_clear(self.mpz_cconv)
517
+ mpz_clear(self.mpz_ctm)
518
+ mpz_clear(self.mpz_cpow)
519
+ mpz_clear(self.mpz_matmod)
520
+ fmpz_poly_clear(self.poly_cconv)
521
+ fmpz_poly_clear(self.poly_ctm)
522
+ fmpz_poly_clear(self.poly_ccmp)
523
+ fmpz_poly_clear(self.poly_cinv)
524
+ fmpz_poly_clear(self.poly_cisunit)
525
+ fmpz_poly_clear(self.poly_cinv2)
526
+ fmpz_poly_clear(self.poly_flint_rep)
527
+ fmpz_poly_clear(self.poly_matmod)
528
+ fmpz_poly_clear(self.shift_rem)
529
+ fmpz_poly_clear(self.aliasing)
530
+
531
+ def __init__(self, Integer prime, long cache_limit, long prec_cap, long ram_prec_cap, bint in_field, poly=None):
532
+ """
533
+ Initialization.
534
+
535
+ TESTS::
536
+
537
+ sage: from sage.rings.padics.pow_computer_flint import PowComputer_flint_maker
538
+ sage: R.<x> = ZZ[]; f = x^3 - 8*x - 2
539
+ sage: A = PowComputer_flint_maker(5, 20, 20, 20, False, f, 'capped-rel')
540
+ sage: TestSuite(A).run()
541
+ """
542
+ PowComputer_flint_1step.__init__(self, prime, cache_limit, prec_cap, ram_prec_cap, in_field, poly)
543
+
544
+ self.e = 1
545
+ self.f = fmpz_poly_degree(self.modulus)
546
+ fmpz_pow_ui(self.q, self.fprime, self.f)
547
+
548
+ cdef class PowComputer_flint_eis(PowComputer_flint_1step):
549
+ """
550
+ A PowComputer for a `p`-adic extension defined by an Eisenstein polynomial.
551
+
552
+ For a description of inputs see :func:`PowComputer_flint_maker`.
553
+
554
+ EXAMPLES::
555
+
556
+ sage: from sage.rings.padics.pow_computer_flint import PowComputer_flint_eis
557
+ sage: R.<x> = ZZ[]; f = x^3 - 25*x + 5
558
+ sage: A = PowComputer_flint_eis(5, 20, 20, 60, False, f); A
559
+ FLINT PowComputer for 5 with polynomial x^3 - 25*x + 5
560
+ """
561
+ def __init__(self, Integer prime, long cache_limit, long prec_cap, long ram_prec_cap, bint in_field, poly=None):
562
+ """
563
+ Initialization.
564
+
565
+ TESTS::
566
+
567
+ sage: from sage.rings.padics.pow_computer_flint import PowComputer_flint_eis
568
+ sage: R.<x> = ZZ[]; f = x^3 - 25*x + 5
569
+ sage: A = PowComputer_flint_eis(5, 20, 20, 60, False, f)
570
+ sage: type(A)
571
+ <class 'sage.rings.padics.pow_computer_flint.PowComputer_flint_eis'>
572
+ """
573
+ PowComputer_flint_1step.__init__(self, prime, cache_limit, prec_cap, ram_prec_cap, in_field, poly)
574
+
575
+ self.e = fmpz_poly_degree(self.modulus)
576
+ self.f = 1
577
+ fmpz_set(self.q, self.fprime)
578
+
579
+
580
+ def PowComputer_flint_maker(prime, cache_limit, prec_cap, ram_prec_cap, in_field, poly, prec_type):
581
+ """
582
+ Return an appropriate FLINT PowComputer for the given input.
583
+
584
+ INPUT:
585
+
586
+ - ``prime`` -- an integral prime
587
+
588
+ - ``cache_limit`` -- nonnegative integer, controlling the
589
+ caching. Powers of ``prime``, reductions of ``poly`` modulo
590
+ different powers of ``prime`` and inverses of the leading
591
+ coefficient modulo different powers of ``prime`` are cached.
592
+ Additional data is cached for ramified extensions.
593
+
594
+ - ``prec_cap`` -- the power of `p` modulo which elements of
595
+ largest precision are defined
596
+
597
+ - ``ram_prec_cap`` -- approximately ``e*prec_cap``, where ``e`` is
598
+ the ramification degree of the extension. For a ramified
599
+ extension this is what Sage calls the precision cap of the ring.
600
+ In fact, it's possible to have rings with precision cap not a
601
+ multiple of `e`, in which case the actual relationship between
602
+ ``ram_prec_cap`` and ``prec_cap`` is that
603
+ ``prec_cap = ceil(n/e)``
604
+
605
+ - ``in_field`` -- (boolean) whether the associated ring is
606
+ actually a field
607
+
608
+ - ``poly`` -- the polynomial defining the extension
609
+
610
+ - ``prec_type`` -- one of ``'capped-rel'``, ``'capped-abs'`` or
611
+ ``'fixed-mod'``; the precision type of the ring
612
+
613
+ .. NOTE::
614
+
615
+ Because of the way templates work, this function imports the
616
+ class of its return value from the appropriate element files.
617
+ This means that the returned PowComputer will have the
618
+ appropriate compile-time-type for Cython.
619
+
620
+ EXAMPLES::
621
+
622
+ sage: from sage.rings.padics.pow_computer_flint import PowComputer_flint_maker
623
+ sage: R.<x> = ZZ[]
624
+ sage: A = PowComputer_flint_maker(3, 20, 20, 20, False, x^3 + 2*x + 1, 'capped-rel'); type(A)
625
+ <class 'sage.rings.padics.qadic_flint_CR.PowComputer_'>
626
+ sage: A = PowComputer_flint_maker(3, 20, 20, 20, False, x^3 + 2*x + 1, 'capped-abs'); type(A)
627
+ <class 'sage.rings.padics.qadic_flint_CA.PowComputer_'>
628
+ sage: A = PowComputer_flint_maker(3, 20, 20, 20, False, x^3 + 2*x + 1, 'fixed-mod'); type(A)
629
+ <class 'sage.rings.padics.qadic_flint_FM.PowComputer_'>
630
+ """
631
+ if prec_type == 'capped-rel':
632
+ from sage.rings.padics.qadic_flint_CR import PowComputer_
633
+ elif prec_type == 'capped-abs':
634
+ from sage.rings.padics.qadic_flint_CA import PowComputer_
635
+ elif prec_type == 'fixed-mod':
636
+ from sage.rings.padics.qadic_flint_FM import PowComputer_
637
+ elif prec_type == 'floating-point':
638
+ from sage.rings.padics.qadic_flint_FP import PowComputer_
639
+ else:
640
+ raise ValueError("unknown prec_type `%s`" % prec_type)
641
+ return PowComputer_(prime, cache_limit, prec_cap, ram_prec_cap, in_field, poly)