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,946 @@
1
+ # sage_setup: distribution = sagemath-pari
2
+ r"""
3
+ Valuations which are defined as limits of valuations.
4
+
5
+ The discrete valuation of a complete field extends uniquely to a finite field
6
+ extension. This is not the case anymore for fields which are not complete with
7
+ respect to their discrete valuation. In this case, the extensions essentially
8
+ correspond to the factors of the defining polynomial of the extension over the
9
+ completion. However, these factors only exist over the completion and this
10
+ makes it difficult to write down such valuations with a representation of
11
+ finite length.
12
+
13
+ More specifically, let `v` be a discrete valuation on `K` and let `L=K[x]/(G)`
14
+ a finite extension thereof. An extension of `v` to `L` can be represented as a
15
+ discrete pseudo-valuation `w'` on `K[x]` which sends `G` to infinity.
16
+ However, such `w'` might not be described by an :mod:`augmented valuation <sage.rings.valuation.augmented_valuation>`
17
+ over a :mod:`Gauss valuation <sage.rings.valuation.gauss_valuation>` anymore. Instead, we may need to write is as a
18
+ limit of augmented valuations.
19
+
20
+ The classes in this module provide the means of writing down such limits and
21
+ resulting valuations on quotients.
22
+
23
+ AUTHORS:
24
+
25
+ - Julian Rüth (2016-10-19): initial version
26
+
27
+ EXAMPLES:
28
+
29
+ In this function field, the unique place of ``K`` which corresponds to the zero
30
+ point has two extensions to ``L``. The valuations corresponding to these
31
+ extensions can only be approximated::
32
+
33
+ sage: # needs sage.rings.function_field
34
+ sage: K.<x> = FunctionField(QQ)
35
+ sage: R.<y> = K[]
36
+ sage: L.<y> = K.extension(y^2 - x)
37
+ sage: v = K.valuation(1)
38
+ sage: w = v.extensions(L); w # needs sage.geometry.polyhedron
39
+ [[ (x - 1)-adic valuation, v(y + 1) = 1 ]-adic valuation,
40
+ [ (x - 1)-adic valuation, v(y - 1) = 1 ]-adic valuation]
41
+
42
+ The same phenomenon can be observed for valuations on number fields::
43
+
44
+ sage: # needs sage.rings.number_field
45
+ sage: K = QQ
46
+ sage: R.<t> = K[]
47
+ sage: L.<t> = K.extension(t^2 + 1)
48
+ sage: v = QQ.valuation(5)
49
+ sage: w = v.extensions(L); w # needs sage.geometry.polyhedron
50
+ [[ 5-adic valuation, v(t + 2) = 1 ]-adic valuation,
51
+ [ 5-adic valuation, v(t + 3) = 1 ]-adic valuation]
52
+
53
+ .. NOTE::
54
+
55
+ We often rely on approximations of valuations even if we could represent the
56
+ valuation without using a limit. This is done to improve performance as many
57
+ computations already can be done correctly with an approximation::
58
+
59
+ sage: # needs sage.geometry.polyhedron sage.rings.function_field
60
+ sage: K.<x> = FunctionField(QQ)
61
+ sage: R.<y> = K[]
62
+ sage: L.<y> = K.extension(y^2 - x)
63
+ sage: v = K.valuation(1/x)
64
+ sage: w = v.extension(L); w
65
+ Valuation at the infinite place
66
+ sage: w._base_valuation._base_valuation._improve_approximation()
67
+ sage: w._base_valuation._base_valuation._approximation
68
+ [ Gauss valuation induced by Valuation at the infinite place,
69
+ v(y) = 1/2, v(y^2 - 1/x) = +Infinity ]
70
+
71
+ REFERENCES:
72
+
73
+ Limits of inductive valuations are discussed in [Mac1936I]_ and [Mac1936II]_. An
74
+ overview can also be found in Section 4.6 of [Rüt2014]_.
75
+ """
76
+ # ****************************************************************************
77
+ # Copyright (C) 2016-2017 Julian Rüth <julian.rueth@fsfe.org>
78
+ #
79
+ # Distributed under the terms of the GNU General Public License (GPL)
80
+ # as published by the Free Software Foundation; either version 2 of
81
+ # the License, or (at your option) any later version.
82
+ # https://www.gnu.org/licenses/
83
+ # ****************************************************************************
84
+ from sage.misc.abstract_method import abstract_method
85
+ from .valuation import DiscretePseudoValuation, InfiniteDiscretePseudoValuation
86
+ from sage.structure.factory import UniqueFactory
87
+
88
+
89
+ class LimitValuationFactory(UniqueFactory):
90
+ r"""
91
+ Return a limit valuation which sends the polynomial ``G`` to infinity and
92
+ is greater than or equal than ``base_valuation``.
93
+
94
+ INPUT:
95
+
96
+ - ``base_valuation`` -- a discrete (pseudo-)valuation on a polynomial ring
97
+ which is a discrete valuation on the coefficient ring which can be
98
+ uniquely augmented (possibly only in the limit) to a pseudo-valuation
99
+ that sends ``G`` to infinity.
100
+
101
+ - ``G`` -- a squarefree polynomial in the domain of ``base_valuation``
102
+
103
+ EXAMPLES::
104
+
105
+ sage: R.<x> = QQ[]
106
+ sage: v = GaussValuation(R, QQ.valuation(2))
107
+ sage: w = valuations.LimitValuation(v, x)
108
+ sage: w(x)
109
+ +Infinity
110
+ """
111
+ def create_key(self, base_valuation, G):
112
+ r"""
113
+ Create a key from the parameters of this valuation.
114
+
115
+ EXAMPLES:
116
+
117
+ Note that this does not normalize ``base_valuation`` in any way. It is
118
+ easily possible to create the same limit in two different ways::
119
+
120
+ sage: R.<x> = QQ[]
121
+ sage: v = GaussValuation(R, QQ.valuation(2))
122
+ sage: w = valuations.LimitValuation(v, x) # indirect doctest
123
+ sage: v = v.augmentation(x, infinity)
124
+ sage: u = valuations.LimitValuation(v, x)
125
+ sage: u == w
126
+ False
127
+
128
+ The point here is that this is not meant to be invoked from user code.
129
+ But mostly from other factories which have made sure that the
130
+ parameters are normalized already.
131
+ """
132
+ if not base_valuation.restriction(G.parent().base_ring()).is_discrete_valuation():
133
+ raise ValueError("base_valuation must be discrete on the coefficient ring.")
134
+ return base_valuation, G
135
+
136
+ def create_object(self, version, key):
137
+ r"""
138
+ Create an object from ``key``.
139
+
140
+ EXAMPLES::
141
+
142
+ sage: R.<x> = QQ[]
143
+ sage: v = GaussValuation(R, QQ.valuation(2))
144
+ sage: w = valuations.LimitValuation(v, x^2 + 1) # indirect doctest
145
+ """
146
+ base_valuation, G = key
147
+ from .valuation_space import DiscretePseudoValuationSpace
148
+ parent = DiscretePseudoValuationSpace(base_valuation.domain())
149
+ return parent.__make_element_class__(MacLaneLimitValuation)(parent, base_valuation, G)
150
+
151
+
152
+ LimitValuation = LimitValuationFactory("sage.rings.valuation.limit_valuation.LimitValuation")
153
+
154
+
155
+ class LimitValuation_generic(DiscretePseudoValuation):
156
+ r"""
157
+ Base class for limit valuations.
158
+
159
+ A limit valuation is realized as an approximation of a valuation and means
160
+ to improve that approximation when necessary.
161
+
162
+ EXAMPLES::
163
+
164
+ sage: # needs sage.rings.function_field
165
+ sage: K.<x> = FunctionField(QQ)
166
+ sage: R.<y> = K[]
167
+ sage: L.<y> = K.extension(y^2 - x)
168
+ sage: v = K.valuation(0)
169
+ sage: w = v.extension(L) # needs sage.geometry.polyhedron
170
+ sage: w._base_valuation # needs sage.geometry.polyhedron sage.rings.function_field
171
+ [ Gauss valuation induced by (x)-adic valuation, v(y) = 1/2 , … ]
172
+
173
+ The currently used approximation can be found in the ``_approximation``
174
+ field::
175
+
176
+ sage: w._base_valuation._approximation # needs sage.geometry.polyhedron sage.rings.function_field
177
+ [ Gauss valuation induced by (x)-adic valuation, v(y) = 1/2 ]
178
+
179
+ TESTS::
180
+
181
+ sage: from sage.rings.valuation.limit_valuation import LimitValuation_generic
182
+ sage: isinstance(w._base_valuation, LimitValuation_generic) # needs sage.geometry.polyhedron sage.rings.function_field
183
+ True
184
+ sage: TestSuite(w._base_valuation).run() # long time # needs sage.geometry.polyhedron sage.rings.function_field
185
+ """
186
+ def __init__(self, parent, approximation):
187
+ r"""
188
+ TESTS::
189
+
190
+ sage: # needs sage.geometry.polyhedron sage.rings.number_field
191
+ sage: R.<x> = QQ[]
192
+ sage: K.<i> = QQ.extension(x^2 + 1)
193
+ sage: v = K.valuation(2)
194
+ sage: from sage.rings.valuation.limit_valuation import LimitValuation_generic
195
+ sage: isinstance(v._base_valuation, LimitValuation_generic)
196
+ True
197
+ """
198
+ DiscretePseudoValuation.__init__(self, parent)
199
+
200
+ self._initial_approximation = approximation
201
+ self._approximation = approximation
202
+
203
+ def reduce(self, f, check=True):
204
+ r"""
205
+ Return the reduction of ``f`` as an element of the :meth:`~sage.rings.valuation.valuation_space.DiscretePseudoValuationSpace.ElementMethods.residue_ring`.
206
+
207
+ INPUT:
208
+
209
+ - ``f`` -- an element in the domain of this valuation of nonnegative
210
+ valuation
211
+
212
+ - ``check`` -- whether or not to check that ``f`` has nonnegative
213
+ valuation (default: ``True``)
214
+
215
+ EXAMPLES::
216
+
217
+ sage: # needs sage.rings.function_field
218
+ sage: K.<x> = FunctionField(QQ)
219
+ sage: R.<y> = K[]
220
+ sage: L.<y> = K.extension(y^2 - (x - 1))
221
+ sage: v = K.valuation(0)
222
+ sage: w = v.extension(L)
223
+ sage: w.reduce(y) # indirect doctest
224
+ u1
225
+ """
226
+ f = self.domain().coerce(f)
227
+ self._improve_approximation_for_reduce(f)
228
+ F = self._approximation.reduce(f, check=check)
229
+ return self.residue_ring()(F)
230
+
231
+ def _call_(self, f):
232
+ r"""
233
+ Return the valuation of ``f``.
234
+
235
+ EXAMPLES::
236
+
237
+ sage: # needs sage.geometry.polyhedron sage.rings.function_field
238
+ sage: K.<x> = FunctionField(QQ)
239
+ sage: R.<y> = K[]
240
+ sage: L.<y> = K.extension(y^2 - x)
241
+ sage: v = K.valuation(0)
242
+ sage: w = v.extension(L)
243
+ sage: w(y) # indirect doctest
244
+ 1/2
245
+ """
246
+ self._improve_approximation_for_call(f)
247
+ return self._approximation(f)
248
+
249
+ @abstract_method
250
+ def _improve_approximation_for_reduce(self, f):
251
+ r"""
252
+ Replace our approximation with a sufficiently precise approximation to
253
+ correctly compute the reduction of ``f``.
254
+
255
+ EXAMPLES::
256
+
257
+ sage: # needs sage.rings.function_field
258
+ sage: K.<x> = FunctionField(QQ)
259
+ sage: R.<y> = K[]
260
+ sage: L.<y> = K.extension(y^2 - (x - 1337))
261
+
262
+ For the unique extension over the place at 1337, the initial
263
+ approximation is sufficient to compute the reduction of ``y``::
264
+
265
+ sage: # needs sage.geometry.polyhedron sage.rings.function_field
266
+ sage: v = K.valuation(1337)
267
+ sage: w = v.extension(L)
268
+ sage: u = w._base_valuation
269
+ sage: u._approximation
270
+ [ Gauss valuation induced by (x - 1337)-adic valuation, v(y) = 1/2 ]
271
+ sage: w.reduce(y)
272
+ 0
273
+ sage: u._approximation
274
+ [ Gauss valuation induced by (x - 1337)-adic valuation, v(y) = 1/2 ]
275
+
276
+ However, at a place over 1341, the initial approximation is not sufficient
277
+ for some values (note that 1341-1337 is a square)::
278
+
279
+ sage: # needs sage.geometry.polyhedron sage.rings.function_field
280
+ sage: v = K.valuation(1341)
281
+ sage: w = v.extensions(L)[1]
282
+ sage: u = w._base_valuation
283
+ sage: u._approximation
284
+ [ Gauss valuation induced by (x - 1341)-adic valuation, v(y - 2) = 1 ]
285
+ sage: w.reduce((y - 2) / (x - 1341)) # indirect doctest
286
+ 1/4
287
+ sage: u._approximation
288
+ [ Gauss valuation induced by (x - 1341)-adic valuation, v(y - 1/4*x + 1333/4) = 2 ]
289
+ sage: w.reduce((y - 1/4*x + 1333/4) / (x - 1341)^2) # indirect doctest
290
+ -1/64
291
+ sage: u._approximation
292
+ [ Gauss valuation induced by (x - 1341)-adic valuation,
293
+ v(y + 1/64*x^2 - 1349/32*x + 1819609/64) = 3 ]
294
+ """
295
+
296
+ @abstract_method
297
+ def _improve_approximation_for_call(self, f):
298
+ r"""
299
+ Replace our approximation with a sufficiently precise approximation to
300
+ correctly compute the valuation of ``f``.
301
+
302
+ EXAMPLES::
303
+
304
+ sage: # needs sage.rings.function_field
305
+ sage: K.<x> = FunctionField(QQ)
306
+ sage: R.<y> = K[]
307
+ sage: L.<y> = K.extension(y^2 - (x - 23))
308
+
309
+ For the unique extension over the place at 23, the initial
310
+ approximation is sufficient to compute all valuations::
311
+
312
+ sage: # needs sage.geometry.polyhedron sage.rings.function_field
313
+ sage: v = K.valuation(23)
314
+ sage: w = v.extension(L)
315
+ sage: u = w._base_valuation
316
+ sage: u._approximation
317
+ [ Gauss valuation induced by (x - 23)-adic valuation, v(y) = 1/2 ]
318
+ sage: w(x - 23)
319
+ 1
320
+ sage: u._approximation
321
+ [ Gauss valuation induced by (x - 23)-adic valuation, v(y) = 1/2 ]
322
+
323
+ However, due to performance reasons, sometimes we improve the
324
+ approximation though it would not have been necessary (performing the
325
+ improvement step is faster in this case than checking whether the
326
+ approximation is sufficient)::
327
+
328
+ sage: # needs sage.geometry.polyhedron sage.rings.function_field
329
+ sage: w(y) # indirect doctest
330
+ 1/2
331
+ sage: u._approximation
332
+ [ Gauss valuation induced by (x - 23)-adic valuation, v(y) = 1/2, v(y^2 - x + 23) = +Infinity ]
333
+ """
334
+
335
+ def _repr_(self):
336
+ r"""
337
+ Return a printable representation of this valuation.
338
+
339
+ EXAMPLES::
340
+
341
+ sage: # needs sage.geometry.polyhedron sage.rings.number_field
342
+ sage: K = QQ
343
+ sage: R.<t> = K[]
344
+ sage: L.<t> = K.extension(t^2 + 1)
345
+ sage: v = QQ.valuation(2)
346
+ sage: w = v.extension(L)
347
+ sage: w._base_valuation # indirect doctest
348
+ [ Gauss valuation induced by 2-adic valuation, v(t + 1) = 1/2 , … ]
349
+ """
350
+ from sage.rings.infinity import infinity
351
+ from .augmented_valuation import AugmentedValuation_base
352
+ if self._initial_approximation(self._G) is not infinity:
353
+ if isinstance(self._initial_approximation, AugmentedValuation_base):
354
+ return repr(self._initial_approximation)[:-1] + ", … ]"
355
+ return repr(self._initial_approximation)
356
+
357
+
358
+ class MacLaneLimitValuation(LimitValuation_generic, InfiniteDiscretePseudoValuation):
359
+ r"""
360
+ A limit valuation that is a pseudo-valuation on polynomial ring `K[x]`
361
+ which sends a square-free polynomial `G` to infinity.
362
+
363
+ This uses the MacLane algorithm to compute the next element in the limit.
364
+
365
+ It starts from a first valuation ``approximation`` which has a unique
366
+ augmentation that sends `G` to infinity and whose uniformizer must be a
367
+ uniformizer of the limit and whose residue field must contain the residue
368
+ field of the limit.
369
+
370
+ EXAMPLES::
371
+
372
+ sage: # needs sage.geometry.polyhedron sage.rings.number_field
373
+ sage: R.<x> = QQ[]
374
+ sage: K.<i> = QQ.extension(x^2 + 1)
375
+ sage: v = K.valuation(2)
376
+ sage: u = v._base_valuation; u
377
+ [ Gauss valuation induced by 2-adic valuation, v(x + 1) = 1/2 , … ]
378
+ """
379
+ def __init__(self, parent, approximation, G):
380
+ r"""
381
+ TESTS::
382
+
383
+ sage: # needs sage.geometry.polyhedron sage.rings.number_field
384
+ sage: R.<x> = QQ[]
385
+ sage: K.<i> = QQ.extension(x^2 + 1)
386
+ sage: v = K.valuation(2)
387
+ sage: u = v._base_valuation
388
+ sage: from sage.rings.valuation.limit_valuation import MacLaneLimitValuation
389
+ sage: isinstance(u, MacLaneLimitValuation)
390
+ True
391
+ """
392
+ LimitValuation_generic.__init__(self, parent, approximation)
393
+ InfiniteDiscretePseudoValuation.__init__(self, parent)
394
+
395
+ self._G = G
396
+ self._next_coefficients = None
397
+ self._next_valuations = None
398
+
399
+ def extensions(self, ring):
400
+ r"""
401
+ Return the extensions of this valuation to ``ring``.
402
+
403
+ EXAMPLES::
404
+
405
+ sage: # needs sage.geometry.polyhedron sage.rings.number_field
406
+ sage: v = GaussianIntegers().valuation(2)
407
+ sage: u = v._base_valuation
408
+ sage: u.extensions(QQ['x'])
409
+ [[ Gauss valuation induced by 2-adic valuation, v(x + 1) = 1/2 , … ]]
410
+ """
411
+ if self.domain() is ring:
412
+ return [self]
413
+ from sage.rings.polynomial.polynomial_ring import PolynomialRing_generic
414
+ if isinstance(ring, PolynomialRing_generic) and self.domain().base_ring().is_subring(ring.base_ring()):
415
+ if self.domain().base_ring().fraction_field() is ring.base_ring():
416
+ return [LimitValuation(self._initial_approximation.change_domain(ring),
417
+ self._G.change_ring(ring.base_ring()))]
418
+ else:
419
+ # we need to recompute the mac lane approximants over this base
420
+ # ring because it could split differently
421
+ pass
422
+ return super().extensions(ring)
423
+
424
+ def lift(self, F):
425
+ r"""
426
+ Return a lift of ``F`` from the :meth:`~sage.rings.valuation.valuation_space.DiscretePseudoValuationSpace.ElementMethods.residue_ring` to the domain of
427
+ this valuation.
428
+
429
+ EXAMPLES::
430
+
431
+ sage: # needs sage.geometry.polyhedron sage.rings.function_field
432
+ sage: K.<x> = FunctionField(QQ)
433
+ sage: R.<y> = K[]
434
+ sage: L.<y> = K.extension(y^4 - x^2 - 2*x - 1)
435
+ sage: v = K.valuation(1)
436
+ sage: w = v.extensions(L)[1]; w
437
+ [ (x - 1)-adic valuation, v(y^2 - 2) = 1 ]-adic valuation
438
+ sage: s = w.reduce(y); s
439
+ u1
440
+ sage: w.lift(s) # indirect doctest
441
+ y
442
+ """
443
+ F = self.residue_ring().coerce(F)
444
+ return self._initial_approximation.lift(F)
445
+
446
+ def uniformizer(self):
447
+ r"""
448
+ Return a uniformizing element for this valuation.
449
+
450
+ EXAMPLES::
451
+
452
+ sage: # needs sage.geometry.polyhedron sage.rings.function_field
453
+ sage: K.<x> = FunctionField(QQ)
454
+ sage: R.<y> = K[]
455
+ sage: L.<y> = K.extension(y^2 - x)
456
+ sage: v = K.valuation(0)
457
+ sage: w = v.extension(L)
458
+ sage: w.uniformizer() # indirect doctest
459
+ y
460
+ """
461
+ return self._initial_approximation.uniformizer()
462
+
463
+ def _call_(self, f):
464
+ r"""
465
+ Return the valuation of ``f``.
466
+
467
+ EXAMPLES::
468
+
469
+ sage: # needs sage.geometry.polyhedron
470
+ sage: K = QQ
471
+ sage: R.<x> = K[]
472
+ sage: vK = K.valuation(2)
473
+ sage: f = (x^2 + 7) * (x^2 + 9)
474
+ sage: V = vK.mac_lane_approximants(f, require_incomparability=True)
475
+ sage: w = valuations.LimitValuation(V[0], f)
476
+ sage: w((x^2 + 7) * (x + 3))
477
+ 3/2
478
+ sage: w = valuations.LimitValuation(V[1], f)
479
+ sage: w((x^2 + 7) * (x + 3))
480
+ +Infinity
481
+ sage: w = valuations.LimitValuation(V[2], f)
482
+ sage: w((x^2 + 7) * (x + 3))
483
+ +Infinity
484
+ """
485
+ self._improve_approximation_for_call(f)
486
+ if self._G.divides(f):
487
+ from sage.rings.infinity import infinity
488
+ return infinity
489
+ return self._approximation(f)
490
+
491
+ def _improve_approximation(self):
492
+ r"""
493
+ Perform one step of the Mac Lane algorithm to improve our approximation.
494
+
495
+ EXAMPLES::
496
+
497
+ sage: # needs sage.geometry.polyhedron sage.rings.number_field
498
+ sage: K = QQ
499
+ sage: R.<t> = K[]
500
+ sage: L.<t> = K.extension(t^2 + 1)
501
+ sage: v = QQ.valuation(2)
502
+ sage: w = v.extension(L)
503
+ sage: u = w._base_valuation
504
+ sage: u._approximation
505
+ [ Gauss valuation induced by 2-adic valuation, v(t + 1) = 1/2 ]
506
+ sage: u._improve_approximation()
507
+ sage: u._approximation
508
+ [ Gauss valuation induced by 2-adic valuation, v(t + 1) = 1/2, v(t^2 + 1) = +Infinity ]
509
+
510
+ This method has no effect, if the approximation is already an infinite
511
+ valuation::
512
+
513
+ sage: u._improve_approximation() # needs sage.geometry.polyhedron sage.rings.number_field
514
+ sage: u._approximation # needs sage.geometry.polyhedron sage.rings.number_field
515
+ [ Gauss valuation induced by 2-adic valuation, v(t + 1) = 1/2, v(t^2 + 1) = +Infinity ]
516
+ """
517
+ from sage.rings.infinity import infinity
518
+ if self._approximation(self._G) is infinity:
519
+ # an infinite valuation can not be improved further
520
+ return
521
+
522
+ approximations = self._approximation.mac_lane_step(self._G,
523
+ assume_squarefree=True,
524
+ assume_equivalence_irreducible=True,
525
+ check=False,
526
+ principal_part_bound=1 if self._approximation.E() * self._approximation.F() == self._approximation.phi().degree() else None,
527
+ report_degree_bounds_and_caches=True)
528
+ assert (len(approximations) == 1)
529
+ self._approximation, _, _, self._next_coefficients, self._next_valuations = approximations[0]
530
+
531
+ def _improve_approximation_for_call(self, f):
532
+ r"""
533
+ Replace our approximation with a sufficiently precise approximation to
534
+ correctly compute the valuation of ``f``.
535
+
536
+ EXAMPLES:
537
+
538
+ In this examples, the approximation is increased unnecessarily. The
539
+ first approximation would have been precise enough to compute the
540
+ valuation of ``t + 2``. However, it is faster to improve the
541
+ approximation (perform one step of the Mac Lane algorithm) than to
542
+ check for this::
543
+
544
+ sage: # needs sage.geometry.polyhedron sage.rings.number_field
545
+ sage: K = QQ
546
+ sage: R.<t> = K[]
547
+ sage: L.<t> = K.extension(t^2 + 1)
548
+ sage: v = QQ.valuation(5)
549
+ sage: w = v.extensions(L)[0]
550
+ sage: u = w._base_valuation
551
+ sage: u._approximation
552
+ [ Gauss valuation induced by 5-adic valuation, v(t + 2) = 1 ]
553
+ sage: w(t + 2) # indirect doctest
554
+ 1
555
+ sage: u._approximation
556
+ [ Gauss valuation induced by 5-adic valuation, v(t + 7) = 2 ]
557
+
558
+ ALGORITHM:
559
+
560
+ Write `L=K[x]/(G)` and consider `g` a representative of the class
561
+ of ``f`` in `K[x]` (of minimal degree.) Write `v` for
562
+ ``self._approximation`` and `\phi` for the last key polynomial of
563
+ `v`. With repeated quotient and remainder `g` has a unique
564
+ expansion as `g=\sum a_i\phi^i`. Suppose that `g` is an
565
+ equivalence-unit with respect to ``self._approximation``, i.e.,
566
+ `v(a_0) < v(a_i\phi^i)` for all `i\ne 0`. If we denote the limit
567
+ valuation as `w`, then `v(a_i\phi^i)=w(a_i\phi^i)` since the
568
+ valuation of key polynomials does not change during augmentations
569
+ (Theorem 6.4 in [Mac1936II]_.) By the strict triangle inequality,
570
+ `w(g)=v(g)`.
571
+ Note that any `g` which is coprime to `G` is an equivalence-unit
572
+ after finitely many steps of the Mac Lane algorithm. Indeed,
573
+ otherwise the valuation of `g` would be infinite (follows from
574
+ Theorem 5.1 in [Mac1936II]_) since the valuation of the key
575
+ polynomials increases.
576
+ When `f` is not coprime to `G`, consider `s=gcd(f,G)` and write
577
+ `G=st`. Since `G` is squarefree, either `s` or `t` have finite
578
+ valuation. With the above algorithm, this can be decided in
579
+ finitely many steps. From this we can deduce the valuation of `s`
580
+ (and in fact replace `G` with the factor with infinite valuation
581
+ for all future computations.)
582
+ """
583
+ from sage.rings.infinity import infinity
584
+ if self._approximation(self._approximation.phi()) is infinity:
585
+ # an infinite valuation can not be improved further
586
+ return
587
+
588
+ if f == 0:
589
+ # zero always has infinite valuation (actually, this might
590
+ # not be desirable for inexact zero elements with leading
591
+ # zero coefficients.)
592
+ return
593
+
594
+ while not self._approximation.is_equivalence_unit(f):
595
+ # TODO: I doubt that this really works over inexact fields
596
+ s = self._G.gcd(f)
597
+ if s.is_constant():
598
+ self._improve_approximation()
599
+ else:
600
+ t = self._G // s
601
+
602
+ while True:
603
+ if self._approximation.is_equivalence_unit(s):
604
+ # t has infinite valuation
605
+ self._G = t
606
+ return self._improve_approximation_for_call(f // s)
607
+ if self._approximation.is_equivalence_unit(t):
608
+ # s has infinite valuation
609
+ self._G = s
610
+ return
611
+
612
+ self._improve_approximation()
613
+
614
+ def _improve_approximation_for_reduce(self, f):
615
+ r"""
616
+ Replace our approximation with a sufficiently precise approximation to
617
+ correctly compute the reduction of ``f``.
618
+
619
+ EXAMPLES::
620
+
621
+ sage: # needs sage.geometry.polyhedron sage.rings.number_field
622
+ sage: K = QQ
623
+ sage: R.<t> = K[]
624
+ sage: L.<t> = K.extension(t^2 + 1)
625
+ sage: v = QQ.valuation(13)
626
+ sage: w = v.extensions(L)[0]
627
+ sage: u = w._base_valuation
628
+ sage: u._approximation
629
+ [ Gauss valuation induced by 13-adic valuation, v(t + 5) = 1 ]
630
+ sage: w.reduce((t + 5) / 13) # indirect doctest
631
+ 8
632
+ sage: u._approximation
633
+ [ Gauss valuation induced by 13-adic valuation, v(t - 29/2) = 2 ]
634
+
635
+ ALGORITHM:
636
+
637
+ The reduction produced by the approximation is correct for an
638
+ equivalence-unit, see :meth:`_improve_approximation_for_call`.
639
+ """
640
+ if self._approximation(f) > 0:
641
+ return
642
+ self._improve_approximation_for_call(f)
643
+
644
+ def residue_ring(self):
645
+ r"""
646
+ Return the residue ring of this valuation, which is always a field.
647
+
648
+ EXAMPLES::
649
+
650
+ sage: # needs sage.geometry.polyhedron sage.rings.number_field
651
+ sage: K = QQ
652
+ sage: R.<t> = K[]
653
+ sage: L.<t> = K.extension(t^2 + 1)
654
+ sage: v = QQ.valuation(2)
655
+ sage: w = v.extension(L)
656
+ sage: w.residue_ring()
657
+ Finite Field of size 2
658
+ """
659
+ R = self._initial_approximation.residue_ring()
660
+ from sage.categories.fields import Fields
661
+ if R in Fields():
662
+ # the approximation ends in v(phi)=infty
663
+ return R
664
+ else:
665
+ from sage.rings.polynomial.polynomial_ring import PolynomialRing_generic
666
+ assert (isinstance(R, PolynomialRing_generic))
667
+ return R.base_ring()
668
+
669
+ def _ge_(self, other):
670
+ r"""
671
+ Return whether this valuation is greater or equal than ``other``
672
+ everywhere.
673
+
674
+ EXAMPLES::
675
+
676
+ sage: # needs sage.geometry.polyhedron
677
+ sage: R.<x> = QQ[]
678
+ sage: F = (x^2 + 7) * (x^2 + 9)
679
+ sage: G = (x^2 + 7)
680
+ sage: V = QQ.valuation(2).mac_lane_approximants(F, require_incomparability=True)
681
+ sage: valuations.LimitValuation(V[0], F) >= valuations.LimitValuation(V[1], F)
682
+ False
683
+ sage: valuations.LimitValuation(V[1], F) >= valuations.LimitValuation(V[1], G)
684
+ True
685
+ sage: valuations.LimitValuation(V[2], F) >= valuations.LimitValuation(V[2], G)
686
+ True
687
+ """
688
+ if other.is_trivial():
689
+ return other.is_discrete_valuation()
690
+ if isinstance(other, MacLaneLimitValuation):
691
+ if self._approximation.restriction(self._approximation.domain().base_ring()) == other._approximation.restriction(other._approximation.domain().base_ring()):
692
+ # Two MacLane limit valuations v,w over the same constant
693
+ # valuation are either equal or incomparable; neither v>w nor
694
+ # v<w can hold everywhere.
695
+ # They are equal iff they approximate the same factor of their
696
+ # defining G. Note that they can be equal even if the defining
697
+ # G is different, so we need to make sure that this can not be
698
+ # the case.
699
+ self._improve_approximation_for_call(other._G)
700
+ other._improve_approximation_for_call(self._G)
701
+ if self._G != other._G:
702
+ assert self._G.gcd(other._G).is_one()
703
+ return False
704
+
705
+ # If the valuations are comparable, they must approximate the
706
+ # same factor of G (see the documentation of LimitValuation:
707
+ # the approximation must *uniquely* single out a valuation.)
708
+ return (self._initial_approximation >= other._initial_approximation
709
+ or self._initial_approximation <= other._initial_approximation)
710
+
711
+ return super()._ge_(other)
712
+
713
+ def restriction(self, ring):
714
+ r"""
715
+ Return the restriction of this valuation to ``ring``.
716
+
717
+ EXAMPLES::
718
+
719
+ sage: # needs sage.geometry.polyhedron sage.rings.number_field
720
+ sage: K = QQ
721
+ sage: R.<t> = K[]
722
+ sage: L.<t> = K.extension(t^2 + 1)
723
+ sage: v = QQ.valuation(2)
724
+ sage: w = v.extension(L)
725
+ sage: w._base_valuation.restriction(K)
726
+ 2-adic valuation
727
+ """
728
+ if ring.is_subring(self.domain().base()):
729
+ return self._initial_approximation.restriction(ring)
730
+ return super().restriction(ring)
731
+
732
+ def _weakly_separating_element(self, other):
733
+ r"""
734
+ Return an element in the domain of this valuation which has
735
+ positive valuation with respect to this valuation and higher
736
+ valuation with respect to this valuation than with respect to
737
+ ``other``.
738
+
739
+ EXAMPLES::
740
+
741
+ sage: # needs sage.geometry.polyhedron sage.rings.number_field
742
+ sage: K = QQ
743
+ sage: R.<t> = K[]
744
+ sage: L.<t> = K.extension(t^2 + 1)
745
+ sage: v = QQ.valuation(2)
746
+ sage: w = v.extension(L)
747
+ sage: v = QQ.valuation(5)
748
+ sage: u,uu = v.extensions(L)
749
+ sage: w._base_valuation._weakly_separating_element(u._base_valuation) # long time
750
+ 2
751
+ sage: u._base_valuation._weakly_separating_element(uu._base_valuation) # long time
752
+ t + 2
753
+
754
+ sage: # needs sage.geometry.polyhedron sage.rings.function_field
755
+ sage: K.<x> = FunctionField(QQ)
756
+ sage: v = K.valuation(1/x)
757
+ sage: R.<y> = K[]
758
+ sage: L.<y> = K.extension(y^2 - 1/(x^2 + 1))
759
+ sage: u,uu = v.extensions(L)
760
+ sage: v = K.valuation(x)
761
+ sage: w,ww = v.extensions(L)
762
+ sage: v = K.valuation(1)
763
+ sage: v = v.extension(L)
764
+ sage: u.separating_element([uu,ww,w,v]) # random output # long time
765
+ ((8*x^4 + 12*x^2 + 4)/(x^2 - x))*y + (8*x^4 + 8*x^2 + 1)/(x^3 - x^2)
766
+
767
+ The underlying algorithm is quite naive and might not terminate in
768
+ reasonable time. In particular, the order of the arguments sometimes
769
+ has a huge impact on the runtime::
770
+
771
+ sage: u.separating_element([ww,w,v,uu]) # not tested, takes forever
772
+ """
773
+ from .scaled_valuation import ScaledValuation_generic
774
+ v = self.restriction(self.domain().base())
775
+ if isinstance(v, ScaledValuation_generic):
776
+ v = v._base_valuation
777
+ u = other.restriction(self.domain().base())
778
+ if isinstance(u, ScaledValuation_generic):
779
+ u = u._base_valuation
780
+
781
+ if u == v:
782
+ # phi of the initial approximant must be good enough to separate it
783
+ # from any other approximant of an extension
784
+ ret = self._initial_approximation.phi()
785
+ assert (self(ret) > other(ret)) # I could not come up with an example where this fails
786
+ return ret
787
+ else:
788
+ # if the valuations are sane, it should be possible to separate
789
+ # them with constants
790
+ return self.domain()(v._weakly_separating_element(u))
791
+
792
+ def value_semigroup(self):
793
+ r"""
794
+ Return the value semigroup of this valuation.
795
+
796
+ TESTS::
797
+
798
+ sage: # needs sage.geometry.polyhedron sage.rings.number_field
799
+ sage: K = QQ
800
+ sage: R.<t> = K[]
801
+ sage: L.<t> = K.extension(t^2 + 1)
802
+ sage: v = QQ.valuation(5)
803
+ sage: u,uu = v.extensions(L)
804
+ sage: u.value_semigroup()
805
+ Additive Abelian Semigroup generated by -1, 1
806
+ """
807
+ return self._initial_approximation.value_semigroup()
808
+
809
+ def element_with_valuation(self, s):
810
+ r"""
811
+ Return an element with valuation ``s``.
812
+
813
+ TESTS::
814
+
815
+ sage: # needs sage.geometry.polyhedron sage.rings.number_field
816
+ sage: K = QQ
817
+ sage: R.<t> = K[]
818
+ sage: L.<t> = K.extension(t^2 + 1)
819
+ sage: v = QQ.valuation(2)
820
+ sage: u = v.extension(L)
821
+ sage: u.element_with_valuation(1/2)
822
+ t + 1
823
+ """
824
+ return self._initial_approximation.element_with_valuation(s)
825
+
826
+ def _relative_size(self, f):
827
+ r"""
828
+ Return an estimate on the coefficient size of ``f``.
829
+
830
+ The number returned is an estimate on the factor between the number of
831
+ bits used by ``f`` and the minimal number of bits used by an element
832
+ congruent to ``f``.
833
+
834
+ This is used by :meth:`simplify` to decide whether simplification of
835
+ coefficients is going to lead to a significant shrinking of the
836
+ coefficients of ``f``.
837
+
838
+ EXAMPLES::
839
+
840
+ sage: # needs sage.geometry.polyhedron sage.rings.number_field
841
+ sage: K = QQ
842
+ sage: R.<t> = K[]
843
+ sage: L.<t> = K.extension(t^2 + 1)
844
+ sage: v = QQ.valuation(2)
845
+ sage: u = v.extension(L)
846
+ sage: u._relative_size(1024*t + 1024)
847
+ 6
848
+ """
849
+ return self._initial_approximation._relative_size(f)
850
+
851
+ def simplify(self, f, error=None, force=False):
852
+ r"""
853
+ Return a simplified version of ``f``.
854
+
855
+ Produce an element which differs from ``f`` by an element of valuation
856
+ strictly greater than the valuation of ``f`` (or strictly greater than
857
+ ``error`` if set.)
858
+
859
+ EXAMPLES::
860
+
861
+ sage: # needs sage.geometry.polyhedron sage.rings.number_field
862
+ sage: K = QQ
863
+ sage: R.<t> = K[]
864
+ sage: L.<t> = K.extension(t^2 + 1)
865
+ sage: v = QQ.valuation(2)
866
+ sage: u = v.extension(L)
867
+ sage: u.simplify(t + 1024, force=True)
868
+ t
869
+ """
870
+ f = self.domain().coerce(f)
871
+
872
+ self._improve_approximation_for_call(f)
873
+ # now _approximation is sufficiently precise to compute a valid
874
+ # simplification of f
875
+
876
+ if error is None:
877
+ error = self(f) if force else self.upper_bound(f)
878
+
879
+ return self._approximation.simplify(f, error=error, force=force)
880
+
881
+ def lower_bound(self, f):
882
+ r"""
883
+ Return a lower bound of this valuation at ``x``.
884
+
885
+ Use this method to get an approximation of the valuation of ``x``
886
+ when speed is more important than accuracy.
887
+
888
+ EXAMPLES::
889
+
890
+ sage: # needs sage.geometry.polyhedron sage.rings.number_field
891
+ sage: K = QQ
892
+ sage: R.<t> = K[]
893
+ sage: L.<t> = K.extension(t^2 + 1)
894
+ sage: v = QQ.valuation(2)
895
+ sage: u = v.extension(L)
896
+ sage: u.lower_bound(1024*t + 1024)
897
+ 10
898
+ sage: u(1024*t + 1024)
899
+ 21/2
900
+ """
901
+ f = self.domain().coerce(f)
902
+ return self._approximation.lower_bound(f)
903
+
904
+ def upper_bound(self, f):
905
+ r"""
906
+ Return an upper bound of this valuation at ``x``.
907
+
908
+ Use this method to get an approximation of the valuation of ``x``
909
+ when speed is more important than accuracy.
910
+
911
+ EXAMPLES::
912
+
913
+ sage: # needs sage.geometry.polyhedron sage.rings.number_field
914
+ sage: K = QQ
915
+ sage: R.<t> = K[]
916
+ sage: L.<t> = K.extension(t^2 + 1)
917
+ sage: v = QQ.valuation(2)
918
+ sage: u = v.extension(L)
919
+ sage: u.upper_bound(1024*t + 1024)
920
+ 21/2
921
+ sage: u(1024*t + 1024)
922
+ 21/2
923
+ """
924
+ f = self.domain().coerce(f)
925
+ self._improve_approximation_for_call(f)
926
+ return self._approximation.upper_bound(f)
927
+
928
+ def is_negative_pseudo_valuation(self):
929
+ r"""
930
+ Return whether this valuation attains `-\infty`.
931
+
932
+ EXAMPLES:
933
+
934
+ For a Mac Lane limit valuation, this is never the case, so this
935
+ method always returns ``False``::
936
+
937
+ sage: # needs sage.geometry.polyhedron sage.rings.number_field
938
+ sage: K = QQ
939
+ sage: R.<t> = K[]
940
+ sage: L.<t> = K.extension(t^2 + 1)
941
+ sage: v = QQ.valuation(2)
942
+ sage: u = v.extension(L)
943
+ sage: u.is_negative_pseudo_valuation()
944
+ False
945
+ """
946
+ return False