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.
- PARIKernel/__init__.py +2 -0
- PARIKernel/__main__.py +5 -0
- PARIKernel/io.cpython-314-x86_64-linux-musl.so +0 -0
- PARIKernel/io.pxd +7 -0
- PARIKernel/io.pyx +84 -0
- PARIKernel/kernel.cpython-314-x86_64-linux-musl.so +0 -0
- PARIKernel/kernel.pyx +260 -0
- PARIKernel/paridecl.pxd +95 -0
- PARIKernel/svg.cpython-314-x86_64-linux-musl.so +0 -0
- PARIKernel/svg.pyx +52 -0
- cypari2/__init__.py +8 -0
- cypari2/auto_paridecl.pxd +1070 -0
- cypari2/closure.cpython-314-x86_64-linux-musl.so +0 -0
- cypari2/closure.pxd +5 -0
- cypari2/closure.pyx +246 -0
- cypari2/convert.cpython-314-x86_64-linux-musl.so +0 -0
- cypari2/convert.pxd +80 -0
- cypari2/convert.pyx +613 -0
- cypari2/custom_block.cpython-314-x86_64-linux-musl.so +0 -0
- cypari2/custom_block.pyx +30 -0
- cypari2/cypari.h +13 -0
- cypari2/gen.cpython-314-x86_64-linux-musl.so +0 -0
- cypari2/gen.pxd +69 -0
- cypari2/gen.pyx +4819 -0
- cypari2/handle_error.cpython-314-x86_64-linux-musl.so +0 -0
- cypari2/handle_error.pxd +7 -0
- cypari2/handle_error.pyx +232 -0
- cypari2/pari_instance.cpython-314-x86_64-linux-musl.so +0 -0
- cypari2/pari_instance.pxd +27 -0
- cypari2/pari_instance.pyx +1438 -0
- cypari2/paridecl.pxd +5353 -0
- cypari2/paripriv.pxd +34 -0
- cypari2/pycore_long.h +98 -0
- cypari2/pycore_long.pxd +9 -0
- cypari2/stack.cpython-314-x86_64-linux-musl.so +0 -0
- cypari2/stack.pxd +27 -0
- cypari2/stack.pyx +278 -0
- cypari2/string_utils.cpython-314-x86_64-linux-musl.so +0 -0
- cypari2/string_utils.pxd +29 -0
- cypari2/string_utils.pyx +65 -0
- cypari2/types.pxd +147 -0
- passagemath_pari-10.6.32.data/data/etc/jupyter/nbconfig/notebook.d/gp-mode.json +5 -0
- passagemath_pari-10.6.32.data/data/share/jupyter/kernels/pari_jupyter/kernel.js +28 -0
- passagemath_pari-10.6.32.data/data/share/jupyter/kernels/pari_jupyter/kernel.json +6 -0
- passagemath_pari-10.6.32.data/data/share/jupyter/kernels/pari_jupyter/logo-64x64.png +0 -0
- passagemath_pari-10.6.32.data/data/share/jupyter/kernels/xeus-gp/kernel.json +13 -0
- passagemath_pari-10.6.32.data/data/share/jupyter/kernels/xeus-gp/logo-32x32.png +0 -0
- passagemath_pari-10.6.32.data/data/share/jupyter/kernels/xeus-gp/logo-64x64.png +0 -0
- passagemath_pari-10.6.32.data/data/share/jupyter/kernels/xeus-gp/logo-svg.svg +75 -0
- passagemath_pari-10.6.32.data/data/share/jupyter/nbextensions/gp-mode/gp.js +284 -0
- passagemath_pari-10.6.32.data/data/share/jupyter/nbextensions/gp-mode/main.js +15 -0
- passagemath_pari-10.6.32.dist-info/METADATA +209 -0
- passagemath_pari-10.6.32.dist-info/RECORD +331 -0
- passagemath_pari-10.6.32.dist-info/WHEEL +5 -0
- passagemath_pari-10.6.32.dist-info/top_level.txt +4 -0
- passagemath_pari.libs/libcrypto-f04afe95.so.3 +0 -0
- passagemath_pari.libs/libflint-fd6f12fc.so.21.0.0 +0 -0
- passagemath_pari.libs/libgcc_s-0cd532bd.so.1 +0 -0
- passagemath_pari.libs/libgf2x-9e30c3e3.so.3.0.0 +0 -0
- passagemath_pari.libs/libgfortran-2c33b284.so.5.0.0 +0 -0
- passagemath_pari.libs/libgivaro-9a94c711.so.9.2.1 +0 -0
- passagemath_pari.libs/libgmp-0e7fc84e.so.10.5.0 +0 -0
- passagemath_pari.libs/libgmpxx-9e08595c.so.4.7.0 +0 -0
- passagemath_pari.libs/libgsl-42cda06f.so.28.0.0 +0 -0
- passagemath_pari.libs/libmpfr-aaecbfc0.so.6.2.1 +0 -0
- passagemath_pari.libs/libncursesw-9c9e32c3.so.6.5 +0 -0
- passagemath_pari.libs/libntl-26885ca2.so.44.0.1 +0 -0
- passagemath_pari.libs/libopenblasp-r0-905cb27d.3.29.so +0 -0
- passagemath_pari.libs/libpari-gmp-tls-f31f908f.so.2.17.2 +0 -0
- passagemath_pari.libs/libquadmath-bb76a5fc.so.0.0.0 +0 -0
- passagemath_pari.libs/libreadline-06542304.so.8.2 +0 -0
- passagemath_pari.libs/libstdc++-5d72f927.so.6.0.33 +0 -0
- passagemath_pari.libs/libuuid-f3770415.so.1.3.0 +0 -0
- passagemath_pari.libs/libxeus-735780ff.so.13.1.0 +0 -0
- passagemath_pari.libs/libxeus-zmq-c68577b4.so.6.0.1 +0 -0
- passagemath_pari.libs/libzmq-1ba9a3da.so.5.2.5 +0 -0
- sage/all__sagemath_pari.py +26 -0
- sage/databases/all__sagemath_pari.py +7 -0
- sage/databases/conway.py +274 -0
- sage/ext/all__sagemath_pari.py +1 -0
- sage/ext/memory.cpython-314-x86_64-linux-musl.so +0 -0
- sage/ext/memory.pyx +98 -0
- sage/ext_data/pari/buzzard/DimensionSk.g +286 -0
- sage/ext_data/pari/buzzard/Tpprog.g +179 -0
- sage/ext_data/pari/buzzard/genusn.g +129 -0
- sage/ext_data/pari/dokchitser/computel.gp +740 -0
- sage/ext_data/pari/dokchitser/computel.gp.template +740 -0
- sage/ext_data/pari/dokchitser/ex-bsw +43 -0
- sage/ext_data/pari/dokchitser/ex-chgen +48 -0
- sage/ext_data/pari/dokchitser/ex-chqua +37 -0
- sage/ext_data/pari/dokchitser/ex-delta +35 -0
- sage/ext_data/pari/dokchitser/ex-eisen +30 -0
- sage/ext_data/pari/dokchitser/ex-gen2 +38 -0
- sage/ext_data/pari/dokchitser/ex-gen3 +49 -0
- sage/ext_data/pari/dokchitser/ex-gen4 +54 -0
- sage/ext_data/pari/dokchitser/ex-nf +48 -0
- sage/ext_data/pari/dokchitser/ex-shin +50 -0
- sage/ext_data/pari/dokchitser/ex-tau2 +30 -0
- sage/ext_data/pari/dokchitser/ex-zeta +27 -0
- sage/ext_data/pari/dokchitser/ex-zeta2 +47 -0
- sage/ext_data/pari/dokchitser/testall +13 -0
- sage/ext_data/pari/simon/ell.gp +2129 -0
- sage/ext_data/pari/simon/ellQ.gp +2151 -0
- sage/ext_data/pari/simon/ellcommon.gp +126 -0
- sage/ext_data/pari/simon/qfsolve.gp +722 -0
- sage/ext_data/pari/simon/resultant3.gp +306 -0
- sage/groups/all__sagemath_pari.py +3 -0
- sage/groups/pari_group.py +175 -0
- sage/interfaces/all__sagemath_pari.py +1 -0
- sage/interfaces/genus2reduction.py +464 -0
- sage/interfaces/gp.py +1114 -0
- sage/libs/all__sagemath_pari.py +2 -0
- sage/libs/linkages/__init__.py +1 -0
- sage/libs/linkages/padics/API.pxi +617 -0
- sage/libs/linkages/padics/Polynomial_ram.pxi +388 -0
- sage/libs/linkages/padics/Polynomial_shared.pxi +554 -0
- sage/libs/linkages/padics/__init__.py +1 -0
- sage/libs/linkages/padics/fmpz_poly_unram.pxi +869 -0
- sage/libs/linkages/padics/mpz.pxi +691 -0
- sage/libs/linkages/padics/relaxed/API.pxi +518 -0
- sage/libs/linkages/padics/relaxed/__init__.py +1 -0
- sage/libs/linkages/padics/relaxed/flint.pxi +543 -0
- sage/libs/linkages/padics/unram_shared.pxi +247 -0
- sage/libs/pari/__init__.py +210 -0
- sage/libs/pari/all.py +5 -0
- sage/libs/pari/convert_flint.cpython-314-x86_64-linux-musl.so +0 -0
- sage/libs/pari/convert_flint.pxd +14 -0
- sage/libs/pari/convert_flint.pyx +159 -0
- sage/libs/pari/convert_gmp.cpython-314-x86_64-linux-musl.so +0 -0
- sage/libs/pari/convert_gmp.pxd +14 -0
- sage/libs/pari/convert_gmp.pyx +210 -0
- sage/libs/pari/convert_sage.cpython-314-x86_64-linux-musl.so +0 -0
- sage/libs/pari/convert_sage.pxd +16 -0
- sage/libs/pari/convert_sage.pyx +588 -0
- sage/libs/pari/convert_sage_complex_double.cpython-314-x86_64-linux-musl.so +0 -0
- sage/libs/pari/convert_sage_complex_double.pxd +14 -0
- sage/libs/pari/convert_sage_complex_double.pyx +132 -0
- sage/libs/pari/convert_sage_matrix.cpython-314-x86_64-linux-musl.so +0 -0
- sage/libs/pari/convert_sage_matrix.pyx +106 -0
- sage/libs/pari/convert_sage_real_double.cpython-314-x86_64-linux-musl.so +0 -0
- sage/libs/pari/convert_sage_real_double.pxd +5 -0
- sage/libs/pari/convert_sage_real_double.pyx +14 -0
- sage/libs/pari/convert_sage_real_mpfr.cpython-314-x86_64-linux-musl.so +0 -0
- sage/libs/pari/convert_sage_real_mpfr.pxd +7 -0
- sage/libs/pari/convert_sage_real_mpfr.pyx +108 -0
- sage/libs/pari/misc.cpython-314-x86_64-linux-musl.so +0 -0
- sage/libs/pari/misc.pxd +4 -0
- sage/libs/pari/misc.pyx +26 -0
- sage/libs/pari/tests.py +1848 -0
- sage/matrix/all__sagemath_pari.py +1 -0
- sage/matrix/matrix_integer_pari.cpython-314-x86_64-linux-musl.so +0 -0
- sage/matrix/matrix_integer_pari.pyx +187 -0
- sage/matrix/matrix_rational_pari.cpython-314-x86_64-linux-musl.so +0 -0
- sage/matrix/matrix_rational_pari.pyx +160 -0
- sage/quadratic_forms/all__sagemath_pari.py +10 -0
- sage/quadratic_forms/genera/all.py +9 -0
- sage/quadratic_forms/genera/genus.py +3506 -0
- sage/quadratic_forms/genera/normal_form.py +1519 -0
- sage/quadratic_forms/genera/spinor_genus.py +243 -0
- sage/quadratic_forms/qfsolve.py +255 -0
- sage/quadratic_forms/quadratic_form__automorphisms.py +427 -0
- sage/quadratic_forms/quadratic_form__genus.py +141 -0
- sage/quadratic_forms/quadratic_form__local_density_interfaces.py +140 -0
- sage/quadratic_forms/quadratic_form__local_normal_form.py +421 -0
- sage/quadratic_forms/quadratic_form__local_representation_conditions.py +889 -0
- sage/quadratic_forms/quadratic_form__mass.py +69 -0
- sage/quadratic_forms/quadratic_form__mass__Conway_Sloane_masses.py +663 -0
- sage/quadratic_forms/quadratic_form__mass__Siegel_densities.py +373 -0
- sage/quadratic_forms/quadratic_form__siegel_product.py +198 -0
- sage/quadratic_forms/special_values.py +323 -0
- sage/rings/all__sagemath_pari.py +15 -0
- sage/rings/factorint_pari.cpython-314-x86_64-linux-musl.so +0 -0
- sage/rings/factorint_pari.pyx +80 -0
- sage/rings/finite_rings/all__sagemath_pari.py +1 -0
- sage/rings/finite_rings/element_givaro.cpython-314-x86_64-linux-musl.so +0 -0
- sage/rings/finite_rings/element_givaro.pxd +91 -0
- sage/rings/finite_rings/element_givaro.pyx +1769 -0
- sage/rings/finite_rings/element_ntl_gf2e.cpython-314-x86_64-linux-musl.so +0 -0
- sage/rings/finite_rings/element_ntl_gf2e.pxd +22 -0
- sage/rings/finite_rings/element_ntl_gf2e.pyx +1333 -0
- sage/rings/finite_rings/element_pari_ffelt.cpython-314-x86_64-linux-musl.so +0 -0
- sage/rings/finite_rings/element_pari_ffelt.pxd +13 -0
- sage/rings/finite_rings/element_pari_ffelt.pyx +1441 -0
- sage/rings/finite_rings/finite_field_givaro.py +612 -0
- sage/rings/finite_rings/finite_field_pari_ffelt.py +238 -0
- sage/rings/finite_rings/hom_finite_field_givaro.cpython-314-x86_64-linux-musl.so +0 -0
- sage/rings/finite_rings/hom_finite_field_givaro.pxd +28 -0
- sage/rings/finite_rings/hom_finite_field_givaro.pyx +280 -0
- sage/rings/finite_rings/residue_field_givaro.cpython-314-x86_64-linux-musl.so +0 -0
- sage/rings/finite_rings/residue_field_givaro.pyx +133 -0
- sage/rings/finite_rings/residue_field_pari_ffelt.cpython-314-x86_64-linux-musl.so +0 -0
- sage/rings/finite_rings/residue_field_pari_ffelt.pyx +128 -0
- sage/rings/function_field/all__sagemath_pari.py +1 -0
- sage/rings/function_field/valuation.py +1450 -0
- sage/rings/function_field/valuation_ring.py +212 -0
- sage/rings/number_field/all__sagemath_pari.py +14 -0
- sage/rings/number_field/totallyreal.cpython-314-x86_64-linux-musl.so +0 -0
- sage/rings/number_field/totallyreal.pyx +509 -0
- sage/rings/number_field/totallyreal_data.cpython-314-x86_64-linux-musl.so +0 -0
- sage/rings/number_field/totallyreal_data.pxd +26 -0
- sage/rings/number_field/totallyreal_data.pyx +928 -0
- sage/rings/number_field/totallyreal_phc.py +144 -0
- sage/rings/number_field/totallyreal_rel.py +1018 -0
- sage/rings/padics/CA_template.pxi +1847 -0
- sage/rings/padics/CA_template_header.pxi +50 -0
- sage/rings/padics/CR_template.pxi +2563 -0
- sage/rings/padics/CR_template_header.pxi +57 -0
- sage/rings/padics/FM_template.pxi +1575 -0
- sage/rings/padics/FM_template_header.pxi +50 -0
- sage/rings/padics/FP_template.pxi +2176 -0
- sage/rings/padics/FP_template_header.pxi +57 -0
- sage/rings/padics/all.py +3 -0
- sage/rings/padics/all__sagemath_pari.py +11 -0
- sage/rings/padics/common_conversion.cpython-314-x86_64-linux-musl.so +0 -0
- sage/rings/padics/common_conversion.pxd +15 -0
- sage/rings/padics/common_conversion.pyx +508 -0
- sage/rings/padics/eisenstein_extension_generic.py +232 -0
- sage/rings/padics/factory.py +3623 -0
- sage/rings/padics/generic_nodes.py +1615 -0
- sage/rings/padics/lattice_precision.py +2889 -0
- sage/rings/padics/morphism.cpython-314-x86_64-linux-musl.so +0 -0
- sage/rings/padics/morphism.pxd +11 -0
- sage/rings/padics/morphism.pyx +366 -0
- sage/rings/padics/padic_base_generic.py +467 -0
- sage/rings/padics/padic_base_leaves.py +1235 -0
- sage/rings/padics/padic_capped_absolute_element.cpython-314-x86_64-linux-musl.so +0 -0
- sage/rings/padics/padic_capped_absolute_element.pxd +15 -0
- sage/rings/padics/padic_capped_absolute_element.pyx +520 -0
- sage/rings/padics/padic_capped_relative_element.cpython-314-x86_64-linux-musl.so +0 -0
- sage/rings/padics/padic_capped_relative_element.pxd +14 -0
- sage/rings/padics/padic_capped_relative_element.pyx +614 -0
- sage/rings/padics/padic_extension_generic.py +990 -0
- sage/rings/padics/padic_extension_leaves.py +738 -0
- sage/rings/padics/padic_fixed_mod_element.cpython-314-x86_64-linux-musl.so +0 -0
- sage/rings/padics/padic_fixed_mod_element.pxd +15 -0
- sage/rings/padics/padic_fixed_mod_element.pyx +584 -0
- sage/rings/padics/padic_floating_point_element.cpython-314-x86_64-linux-musl.so +0 -0
- sage/rings/padics/padic_floating_point_element.pxd +14 -0
- sage/rings/padics/padic_floating_point_element.pyx +447 -0
- sage/rings/padics/padic_generic_element.cpython-314-x86_64-linux-musl.so +0 -0
- sage/rings/padics/padic_generic_element.pxd +48 -0
- sage/rings/padics/padic_generic_element.pyx +4642 -0
- sage/rings/padics/padic_lattice_element.py +1342 -0
- sage/rings/padics/padic_printing.cpython-314-x86_64-linux-musl.so +0 -0
- sage/rings/padics/padic_printing.pxd +38 -0
- sage/rings/padics/padic_printing.pyx +1505 -0
- sage/rings/padics/padic_relaxed_element.cpython-314-x86_64-linux-musl.so +0 -0
- sage/rings/padics/padic_relaxed_element.pxd +56 -0
- sage/rings/padics/padic_relaxed_element.pyx +18 -0
- sage/rings/padics/padic_relaxed_errors.cpython-314-x86_64-linux-musl.so +0 -0
- sage/rings/padics/padic_relaxed_errors.pxd +11 -0
- sage/rings/padics/padic_relaxed_errors.pyx +71 -0
- sage/rings/padics/padic_template_element.pxi +1212 -0
- sage/rings/padics/padic_template_element_header.pxi +50 -0
- sage/rings/padics/padic_valuation.py +1423 -0
- sage/rings/padics/pow_computer_flint.cpython-314-x86_64-linux-musl.so +0 -0
- sage/rings/padics/pow_computer_flint.pxd +38 -0
- sage/rings/padics/pow_computer_flint.pyx +641 -0
- sage/rings/padics/pow_computer_relative.cpython-314-x86_64-linux-musl.so +0 -0
- sage/rings/padics/pow_computer_relative.pxd +29 -0
- sage/rings/padics/pow_computer_relative.pyx +415 -0
- sage/rings/padics/qadic_flint_CA.cpython-314-x86_64-linux-musl.so +0 -0
- sage/rings/padics/qadic_flint_CA.pxd +21 -0
- sage/rings/padics/qadic_flint_CA.pyx +130 -0
- sage/rings/padics/qadic_flint_CR.cpython-314-x86_64-linux-musl.so +0 -0
- sage/rings/padics/qadic_flint_CR.pxd +13 -0
- sage/rings/padics/qadic_flint_CR.pyx +172 -0
- sage/rings/padics/qadic_flint_FM.cpython-314-x86_64-linux-musl.so +0 -0
- sage/rings/padics/qadic_flint_FM.pxd +14 -0
- sage/rings/padics/qadic_flint_FM.pyx +111 -0
- sage/rings/padics/qadic_flint_FP.cpython-314-x86_64-linux-musl.so +0 -0
- sage/rings/padics/qadic_flint_FP.pxd +12 -0
- sage/rings/padics/qadic_flint_FP.pyx +165 -0
- sage/rings/padics/relative_extension_leaves.py +429 -0
- sage/rings/padics/relative_ramified_CA.cpython-314-x86_64-linux-musl.so +0 -0
- sage/rings/padics/relative_ramified_CA.pxd +9 -0
- sage/rings/padics/relative_ramified_CA.pyx +33 -0
- sage/rings/padics/relative_ramified_CR.cpython-314-x86_64-linux-musl.so +0 -0
- sage/rings/padics/relative_ramified_CR.pxd +8 -0
- sage/rings/padics/relative_ramified_CR.pyx +33 -0
- sage/rings/padics/relative_ramified_FM.cpython-314-x86_64-linux-musl.so +0 -0
- sage/rings/padics/relative_ramified_FM.pxd +9 -0
- sage/rings/padics/relative_ramified_FM.pyx +33 -0
- sage/rings/padics/relative_ramified_FP.cpython-314-x86_64-linux-musl.so +0 -0
- sage/rings/padics/relative_ramified_FP.pxd +8 -0
- sage/rings/padics/relative_ramified_FP.pyx +33 -0
- sage/rings/padics/relaxed_template.pxi +4229 -0
- sage/rings/padics/relaxed_template_header.pxi +160 -0
- sage/rings/padics/tests.py +35 -0
- sage/rings/padics/tutorial.py +341 -0
- sage/rings/padics/unramified_extension_generic.py +335 -0
- sage/rings/padics/witt_vector.py +917 -0
- sage/rings/padics/witt_vector_ring.py +934 -0
- sage/rings/pari_ring.py +235 -0
- sage/rings/polynomial/all__sagemath_pari.py +1 -0
- sage/rings/polynomial/padics/all.py +1 -0
- sage/rings/polynomial/padics/polynomial_padic.py +360 -0
- sage/rings/polynomial/padics/polynomial_padic_capped_relative_dense.py +1324 -0
- sage/rings/polynomial/padics/polynomial_padic_flat.py +72 -0
- sage/rings/power_series_pari.cpython-314-x86_64-linux-musl.so +0 -0
- sage/rings/power_series_pari.pxd +6 -0
- sage/rings/power_series_pari.pyx +934 -0
- sage/rings/tate_algebra.py +1282 -0
- sage/rings/tate_algebra_element.cpython-314-x86_64-linux-musl.so +0 -0
- sage/rings/tate_algebra_element.pxd +49 -0
- sage/rings/tate_algebra_element.pyx +3464 -0
- sage/rings/tate_algebra_ideal.cpython-314-x86_64-linux-musl.so +0 -0
- sage/rings/tate_algebra_ideal.pxd +7 -0
- sage/rings/tate_algebra_ideal.pyx +1307 -0
- sage/rings/valuation/all.py +7 -0
- sage/rings/valuation/augmented_valuation.py +2118 -0
- sage/rings/valuation/developing_valuation.py +362 -0
- sage/rings/valuation/gauss_valuation.py +812 -0
- sage/rings/valuation/inductive_valuation.py +1686 -0
- sage/rings/valuation/limit_valuation.py +946 -0
- sage/rings/valuation/mapped_valuation.py +656 -0
- sage/rings/valuation/scaled_valuation.py +322 -0
- sage/rings/valuation/trivial_valuation.py +382 -0
- sage/rings/valuation/valuation.py +1119 -0
- sage/rings/valuation/valuation_space.py +1615 -0
- sage/rings/valuation/valuations_catalog.py +10 -0
- sage/rings/valuation/value_group.py +697 -0
- sage/schemes/all__sagemath_pari.py +1 -0
- sage/schemes/elliptic_curves/all__sagemath_pari.py +1 -0
- sage/schemes/elliptic_curves/descent_two_isogeny_pari.cpython-314-x86_64-linux-musl.so +0 -0
- sage/schemes/elliptic_curves/descent_two_isogeny_pari.pyx +46 -0
- sage_wheels/bin/gp +0 -0
- sage_wheels/bin/gp2c +0 -0
- sage_wheels/bin/gp2c-run +57 -0
- sage_wheels/bin/xeus-gp +0 -0
- sage_wheels/share/gp2c/func.dsc +18414 -0
|
@@ -0,0 +1,812 @@
|
|
|
1
|
+
# sage_setup: distribution = sagemath-pari
|
|
2
|
+
"""
|
|
3
|
+
Gauss valuations on polynomial rings
|
|
4
|
+
|
|
5
|
+
This file implements Gauss valuations for polynomial rings, i.e. discrete
|
|
6
|
+
valuations which assign to a polynomial the minimal valuation of its
|
|
7
|
+
coefficients.
|
|
8
|
+
|
|
9
|
+
AUTHORS:
|
|
10
|
+
|
|
11
|
+
- Julian Rüth (2013-04-15): initial version
|
|
12
|
+
|
|
13
|
+
EXAMPLES:
|
|
14
|
+
|
|
15
|
+
A Gauss valuation maps a polynomial to the minimal valuation of any of its
|
|
16
|
+
coefficients::
|
|
17
|
+
|
|
18
|
+
sage: R.<x> = QQ[]
|
|
19
|
+
sage: v0 = QQ.valuation(2)
|
|
20
|
+
sage: v = GaussValuation(R, v0); v
|
|
21
|
+
Gauss valuation induced by 2-adic valuation
|
|
22
|
+
sage: v(2*x + 2)
|
|
23
|
+
1
|
|
24
|
+
|
|
25
|
+
Gauss valuations can also be defined iteratively based on valuations over
|
|
26
|
+
polynomial rings::
|
|
27
|
+
|
|
28
|
+
sage: v = v.augmentation(x, 1/4); v
|
|
29
|
+
[ Gauss valuation induced by 2-adic valuation, v(x) = 1/4 ]
|
|
30
|
+
sage: v = v.augmentation(x^4+2*x^3+2*x^2+2*x+2, 4/3); v
|
|
31
|
+
[ Gauss valuation induced by 2-adic valuation, v(x) = 1/4, v(x^4 + 2*x^3 + 2*x^2 + 2*x + 2) = 4/3 ]
|
|
32
|
+
sage: S.<T> = R[]
|
|
33
|
+
sage: w = GaussValuation(S, v); w
|
|
34
|
+
Gauss valuation induced by [ Gauss valuation induced by 2-adic valuation, v(x) = 1/4, v(x^4 + 2*x^3 + 2*x^2 + 2*x + 2) = 4/3 ]
|
|
35
|
+
sage: w(2*T + 1)
|
|
36
|
+
0
|
|
37
|
+
"""
|
|
38
|
+
# ****************************************************************************
|
|
39
|
+
# Copyright (C) 2013-2017 Julian Rüth <julian.rueth@fsfe.org>
|
|
40
|
+
#
|
|
41
|
+
# Distributed under the terms of the GNU General Public License (GPL)
|
|
42
|
+
# as published by the Free Software Foundation; either version 2 of
|
|
43
|
+
# the License, or (at your option) any later version.
|
|
44
|
+
# https://www.gnu.org/licenses/
|
|
45
|
+
# ****************************************************************************
|
|
46
|
+
|
|
47
|
+
from .inductive_valuation import NonFinalInductiveValuation
|
|
48
|
+
|
|
49
|
+
from sage.misc.cachefunc import cached_method
|
|
50
|
+
from sage.structure.factory import UniqueFactory
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
class GaussValuationFactory(UniqueFactory):
|
|
54
|
+
r"""
|
|
55
|
+
Create a Gauss valuation on ``domain``.
|
|
56
|
+
|
|
57
|
+
INPUT:
|
|
58
|
+
|
|
59
|
+
- ``domain`` -- a univariate polynomial ring
|
|
60
|
+
|
|
61
|
+
- ``v`` -- a valuation on the base ring of ``domain``, the underlying
|
|
62
|
+
valuation on the constants of the polynomial ring (if unspecified take
|
|
63
|
+
the natural valuation on the valued ring ``domain``.)
|
|
64
|
+
|
|
65
|
+
EXAMPLES:
|
|
66
|
+
|
|
67
|
+
The Gauss valuation is the minimum of the valuation of the coefficients::
|
|
68
|
+
|
|
69
|
+
sage: v = QQ.valuation(2)
|
|
70
|
+
sage: R.<x> = QQ[]
|
|
71
|
+
sage: w = GaussValuation(R, v)
|
|
72
|
+
sage: w(2)
|
|
73
|
+
1
|
|
74
|
+
sage: w(x)
|
|
75
|
+
0
|
|
76
|
+
sage: w(x + 2)
|
|
77
|
+
0
|
|
78
|
+
"""
|
|
79
|
+
def create_key(self, domain, v=None):
|
|
80
|
+
r"""
|
|
81
|
+
Normalize and check the parameters to create a Gauss valuation.
|
|
82
|
+
|
|
83
|
+
TESTS::
|
|
84
|
+
|
|
85
|
+
sage: v = QQ.valuation(2)
|
|
86
|
+
sage: R.<x> = ZZ[]
|
|
87
|
+
sage: GaussValuation.create_key(R, v)
|
|
88
|
+
Traceback (most recent call last):
|
|
89
|
+
...
|
|
90
|
+
ValueError: the domain of v must be the base ring of domain but 2-adic valuation is not defined over Integer Ring but over Rational Field
|
|
91
|
+
"""
|
|
92
|
+
from sage.rings.polynomial.polynomial_ring import PolynomialRing_generic
|
|
93
|
+
if not isinstance(domain, PolynomialRing_generic):
|
|
94
|
+
raise TypeError("GaussValuations can only be created over polynomial rings but %r is not a polynomial ring" % (domain,))
|
|
95
|
+
if not domain.ngens() == 1:
|
|
96
|
+
raise NotImplementedError("domain must be univariate but %r is not univariate" % (domain,))
|
|
97
|
+
|
|
98
|
+
if v is None:
|
|
99
|
+
v = domain.base_ring().valuation()
|
|
100
|
+
|
|
101
|
+
if v.domain() is not domain.base_ring():
|
|
102
|
+
raise ValueError("the domain of v must be the base ring of domain but %r is not defined over %r but over %r" % (v, domain.base_ring(), v.domain()))
|
|
103
|
+
if not v.is_discrete_valuation():
|
|
104
|
+
raise ValueError("v must be a discrete valuation but %r is not" % (v,))
|
|
105
|
+
|
|
106
|
+
return (domain, v)
|
|
107
|
+
|
|
108
|
+
def create_object(self, version, key, **extra_args):
|
|
109
|
+
r"""
|
|
110
|
+
Create a Gauss valuation from normalized parameters.
|
|
111
|
+
|
|
112
|
+
TESTS::
|
|
113
|
+
|
|
114
|
+
sage: v = QQ.valuation(2)
|
|
115
|
+
sage: R.<x> = QQ[]
|
|
116
|
+
sage: GaussValuation.create_object(0, (R, v))
|
|
117
|
+
Gauss valuation induced by 2-adic valuation
|
|
118
|
+
"""
|
|
119
|
+
domain, v = key
|
|
120
|
+
from sage.rings.valuation.valuation_space import DiscretePseudoValuationSpace
|
|
121
|
+
parent = DiscretePseudoValuationSpace(domain)
|
|
122
|
+
return parent.__make_element_class__(GaussValuation_generic)(parent, v)
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
GaussValuation = GaussValuationFactory("sage.rings.valuation.gauss_valuation.GaussValuation")
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
class GaussValuation_generic(NonFinalInductiveValuation):
|
|
129
|
+
"""
|
|
130
|
+
A Gauss valuation on a polynomial ring ``domain``.
|
|
131
|
+
|
|
132
|
+
INPUT:
|
|
133
|
+
|
|
134
|
+
- ``domain`` -- a univariate polynomial ring over a valued ring `R`
|
|
135
|
+
|
|
136
|
+
- ``v`` -- a discrete valuation on `R`
|
|
137
|
+
|
|
138
|
+
EXAMPLES::
|
|
139
|
+
|
|
140
|
+
sage: R = Zp(3,5)
|
|
141
|
+
sage: S.<x> = R[] # needs sage.libs.ntl
|
|
142
|
+
sage: v0 = R.valuation()
|
|
143
|
+
sage: v = GaussValuation(S, v0); v # needs sage.libs.ntl
|
|
144
|
+
Gauss valuation induced by 3-adic valuation
|
|
145
|
+
|
|
146
|
+
sage: S.<x> = QQ[]
|
|
147
|
+
sage: v = GaussValuation(S, QQ.valuation(5)); v
|
|
148
|
+
Gauss valuation induced by 5-adic valuation
|
|
149
|
+
|
|
150
|
+
TESTS::
|
|
151
|
+
|
|
152
|
+
sage: TestSuite(v).run() # long time # needs sage.geometry.polyhedron
|
|
153
|
+
"""
|
|
154
|
+
def __init__(self, parent, v):
|
|
155
|
+
"""
|
|
156
|
+
TESTS::
|
|
157
|
+
|
|
158
|
+
sage: from sage.rings.valuation.gauss_valuation import GaussValuation_generic
|
|
159
|
+
sage: S.<x> = QQ[]
|
|
160
|
+
sage: v = GaussValuation(S, QQ.valuation(5))
|
|
161
|
+
sage: isinstance(v, GaussValuation_generic)
|
|
162
|
+
True
|
|
163
|
+
"""
|
|
164
|
+
NonFinalInductiveValuation.__init__(self, parent, parent.domain().gen())
|
|
165
|
+
|
|
166
|
+
self._base_valuation = v
|
|
167
|
+
|
|
168
|
+
def value_group(self):
|
|
169
|
+
"""
|
|
170
|
+
Return the value group of this valuation.
|
|
171
|
+
|
|
172
|
+
EXAMPLES::
|
|
173
|
+
|
|
174
|
+
sage: S.<x> = QQ[]
|
|
175
|
+
sage: v = GaussValuation(S, QQ.valuation(5))
|
|
176
|
+
sage: v.value_group()
|
|
177
|
+
Additive Abelian Group generated by 1
|
|
178
|
+
"""
|
|
179
|
+
return self._base_valuation.value_group()
|
|
180
|
+
|
|
181
|
+
def value_semigroup(self):
|
|
182
|
+
r"""
|
|
183
|
+
Return the value semigroup of this valuation.
|
|
184
|
+
|
|
185
|
+
EXAMPLES::
|
|
186
|
+
|
|
187
|
+
sage: S.<x> = QQ[]
|
|
188
|
+
sage: v = GaussValuation(S, QQ.valuation(5))
|
|
189
|
+
sage: v.value_semigroup()
|
|
190
|
+
Additive Abelian Semigroup generated by -1, 1
|
|
191
|
+
"""
|
|
192
|
+
return self._base_valuation.value_semigroup()
|
|
193
|
+
|
|
194
|
+
def _repr_(self):
|
|
195
|
+
"""
|
|
196
|
+
Return a printable representation of this valuation.
|
|
197
|
+
|
|
198
|
+
EXAMPLES::
|
|
199
|
+
|
|
200
|
+
sage: S.<x> = QQ[]
|
|
201
|
+
sage: v = GaussValuation(S, QQ.valuation(5))
|
|
202
|
+
sage: v # indirect doctest
|
|
203
|
+
Gauss valuation induced by 5-adic valuation
|
|
204
|
+
"""
|
|
205
|
+
return "Gauss valuation induced by %r" % self._base_valuation
|
|
206
|
+
|
|
207
|
+
@cached_method
|
|
208
|
+
def uniformizer(self):
|
|
209
|
+
"""
|
|
210
|
+
Return a uniformizer of this valuation, i.e., a uniformizer of the
|
|
211
|
+
valuation of the base ring.
|
|
212
|
+
|
|
213
|
+
EXAMPLES::
|
|
214
|
+
|
|
215
|
+
sage: S.<x> = QQ[]
|
|
216
|
+
sage: v = GaussValuation(S, QQ.valuation(5))
|
|
217
|
+
sage: v.uniformizer()
|
|
218
|
+
5
|
|
219
|
+
sage: v.uniformizer().parent() is S
|
|
220
|
+
True
|
|
221
|
+
"""
|
|
222
|
+
return self.domain()(self._base_valuation.uniformizer())
|
|
223
|
+
|
|
224
|
+
def valuations(self, f, coefficients=None, call_error=False):
|
|
225
|
+
r"""
|
|
226
|
+
Return the valuations of the `f_i\phi^i` in the expansion `f=\sum f_i\phi^i`.
|
|
227
|
+
|
|
228
|
+
INPUT:
|
|
229
|
+
|
|
230
|
+
- ``f`` -- a polynomial in the domain of this valuation
|
|
231
|
+
|
|
232
|
+
- ``coefficients`` -- the coefficients of ``f`` as produced by
|
|
233
|
+
:meth:`~sage.rings.valuation.developing_valuation.DevelopingValuation.coefficients` or ``None`` (default: ``None``); this can be
|
|
234
|
+
used to speed up the computation when the expansion of ``f`` is
|
|
235
|
+
already known from a previous computation.
|
|
236
|
+
|
|
237
|
+
- ``call_error`` -- whether or not to speed up the computation by
|
|
238
|
+
assuming that the result is only used to compute the valuation of
|
|
239
|
+
``f`` (default: ``False``)
|
|
240
|
+
|
|
241
|
+
OUTPUT: list, each entry a rational numbers or infinity, the valuations
|
|
242
|
+
of `f_0, f_1\phi, \dots`
|
|
243
|
+
|
|
244
|
+
EXAMPLES::
|
|
245
|
+
|
|
246
|
+
sage: R = ZZ
|
|
247
|
+
sage: S.<x> = R[]
|
|
248
|
+
sage: v = GaussValuation(S, R.valuation(2))
|
|
249
|
+
sage: f = x^2 + 2*x + 16
|
|
250
|
+
sage: list(v.valuations(f))
|
|
251
|
+
[4, 1, 0]
|
|
252
|
+
"""
|
|
253
|
+
f = self.domain().coerce(f)
|
|
254
|
+
|
|
255
|
+
if f.is_constant():
|
|
256
|
+
yield self._base_valuation(f[0])
|
|
257
|
+
return
|
|
258
|
+
|
|
259
|
+
from sage.rings.infinity import infinity
|
|
260
|
+
from sage.rings.rational_field import QQ
|
|
261
|
+
if f == self.domain().gen():
|
|
262
|
+
yield infinity
|
|
263
|
+
yield QQ(0)
|
|
264
|
+
return
|
|
265
|
+
|
|
266
|
+
if call_error:
|
|
267
|
+
lowest_valuation = infinity
|
|
268
|
+
for c in coefficients or f.coefficients(sparse=False):
|
|
269
|
+
if call_error:
|
|
270
|
+
if lowest_valuation is not infinity:
|
|
271
|
+
v = self._base_valuation.lower_bound(c)
|
|
272
|
+
if v is infinity or v >= lowest_valuation:
|
|
273
|
+
yield infinity
|
|
274
|
+
continue
|
|
275
|
+
ret = self._base_valuation(c)
|
|
276
|
+
if call_error:
|
|
277
|
+
if ret is not infinity and (lowest_valuation is infinity or ret < lowest_valuation):
|
|
278
|
+
lowest_valuation = ret
|
|
279
|
+
yield ret
|
|
280
|
+
|
|
281
|
+
@cached_method
|
|
282
|
+
def residue_ring(self):
|
|
283
|
+
"""
|
|
284
|
+
Return the residue ring of this valuation, i.e., the elements of
|
|
285
|
+
valuation zero module the elements of positive valuation.
|
|
286
|
+
|
|
287
|
+
EXAMPLES::
|
|
288
|
+
|
|
289
|
+
sage: S.<x> = Qp(2,5)[] # needs sage.libs.ntl
|
|
290
|
+
sage: v = GaussValuation(S) # needs sage.libs.ntl
|
|
291
|
+
sage: v.residue_ring() # needs sage.libs.ntl
|
|
292
|
+
Univariate Polynomial Ring in x over Finite Field of size 2 (using ...)
|
|
293
|
+
"""
|
|
294
|
+
return self.domain().change_ring(self._base_valuation.residue_ring())
|
|
295
|
+
|
|
296
|
+
def reduce(self, f, check=True, degree_bound=None, coefficients=None, valuations=None):
|
|
297
|
+
"""
|
|
298
|
+
Return the reduction of ``f`` modulo this valuation.
|
|
299
|
+
|
|
300
|
+
INPUT:
|
|
301
|
+
|
|
302
|
+
- ``f`` -- an integral element of the domain of this valuation
|
|
303
|
+
|
|
304
|
+
- ``check`` -- whether or not to check whether ``f`` has nonnegative
|
|
305
|
+
valuation (default: ``True``)
|
|
306
|
+
|
|
307
|
+
- ``degree_bound`` -- an a-priori known bound on the degree of the
|
|
308
|
+
result which can speed up the computation (default: not set)
|
|
309
|
+
|
|
310
|
+
- ``coefficients`` -- the coefficients of ``f`` as produced by
|
|
311
|
+
:meth:`~sage.rings.valuation.developing_valuation.DevelopingValuation.coefficients` or ``None`` (default: ``None``); ignored
|
|
312
|
+
|
|
313
|
+
- ``valuations`` -- the valuations of ``coefficients`` or ``None``
|
|
314
|
+
(default: ``None``); ignored
|
|
315
|
+
|
|
316
|
+
OUTPUT: a polynomial in the :meth:`residue_ring` of this valuation
|
|
317
|
+
|
|
318
|
+
EXAMPLES::
|
|
319
|
+
|
|
320
|
+
sage: # needs sage.libs.ntl
|
|
321
|
+
sage: S.<x> = Qp(2,5)[]
|
|
322
|
+
sage: v = GaussValuation(S)
|
|
323
|
+
sage: f = x^2 + 2*x + 16
|
|
324
|
+
sage: v.reduce(f)
|
|
325
|
+
x^2
|
|
326
|
+
sage: v.reduce(f).parent() is v.residue_ring()
|
|
327
|
+
True
|
|
328
|
+
|
|
329
|
+
The reduction is only defined for integral elements::
|
|
330
|
+
|
|
331
|
+
sage: f = x^2/2 # needs sage.libs.ntl
|
|
332
|
+
sage: v.reduce(f) # needs sage.libs.ntl
|
|
333
|
+
Traceback (most recent call last):
|
|
334
|
+
...
|
|
335
|
+
ValueError: reduction not defined for non-integral elements and (2^-1 + O(2^4))*x^2 is not integral over Gauss valuation induced by 2-adic valuation
|
|
336
|
+
|
|
337
|
+
.. SEEALSO::
|
|
338
|
+
|
|
339
|
+
:meth:`lift`
|
|
340
|
+
"""
|
|
341
|
+
f = self.domain().coerce(f)
|
|
342
|
+
|
|
343
|
+
if degree_bound is not None:
|
|
344
|
+
f = f.truncate(degree_bound + 1)
|
|
345
|
+
|
|
346
|
+
try:
|
|
347
|
+
return f.map_coefficients(self._base_valuation.reduce, self._base_valuation.residue_field())
|
|
348
|
+
except Exception:
|
|
349
|
+
if check and not all(v >= 0 for v in self.valuations(f)):
|
|
350
|
+
raise ValueError("reduction not defined for non-integral elements and %r is not integral over %r" % (f, self))
|
|
351
|
+
raise
|
|
352
|
+
|
|
353
|
+
def lift(self, F):
|
|
354
|
+
"""
|
|
355
|
+
Return a lift of ``F``.
|
|
356
|
+
|
|
357
|
+
INPUT:
|
|
358
|
+
|
|
359
|
+
- ``F`` -- a polynomial over the :meth:`residue_ring` of this valuation
|
|
360
|
+
|
|
361
|
+
OUTPUT:
|
|
362
|
+
|
|
363
|
+
a (possibly non-monic) polynomial in the domain of this valuation which
|
|
364
|
+
reduces to ``F``
|
|
365
|
+
|
|
366
|
+
EXAMPLES::
|
|
367
|
+
|
|
368
|
+
sage: # needs sage.libs.ntl
|
|
369
|
+
sage: S.<x> = Qp(3,5)[]
|
|
370
|
+
sage: v = GaussValuation(S)
|
|
371
|
+
sage: f = x^2 + 2*x + 16
|
|
372
|
+
sage: F = v.reduce(f); F
|
|
373
|
+
x^2 + 2*x + 1
|
|
374
|
+
sage: g = v.lift(F); g
|
|
375
|
+
(1 + O(3^5))*x^2 + (2 + O(3^5))*x + 1 + O(3^5)
|
|
376
|
+
sage: v.is_equivalent(f,g)
|
|
377
|
+
True
|
|
378
|
+
sage: g.parent() is v.domain()
|
|
379
|
+
True
|
|
380
|
+
|
|
381
|
+
.. SEEALSO::
|
|
382
|
+
|
|
383
|
+
:meth:`reduce`
|
|
384
|
+
"""
|
|
385
|
+
F = self.residue_ring().coerce(F)
|
|
386
|
+
return F.map_coefficients(self._base_valuation.lift,
|
|
387
|
+
self._base_valuation.domain())
|
|
388
|
+
|
|
389
|
+
def lift_to_key(self, F):
|
|
390
|
+
"""
|
|
391
|
+
Lift the irreducible polynomial ``F`` from the :meth:`residue_ring` to
|
|
392
|
+
a key polynomial over this valuation.
|
|
393
|
+
|
|
394
|
+
INPUT:
|
|
395
|
+
|
|
396
|
+
- ``F`` -- an irreducible non-constant monic polynomial in
|
|
397
|
+
:meth:`residue_ring` of this valuation
|
|
398
|
+
|
|
399
|
+
OUTPUT:
|
|
400
|
+
|
|
401
|
+
A polynomial `f` in the domain of this valuation which is a key
|
|
402
|
+
polynomial for this valuation and which, for a suitable equivalence
|
|
403
|
+
unit `R`, satisfies that the reduction of `Rf` is ``F``
|
|
404
|
+
|
|
405
|
+
EXAMPLES::
|
|
406
|
+
|
|
407
|
+
sage: R.<u> = QQ
|
|
408
|
+
sage: S.<x> = R[]
|
|
409
|
+
sage: v = GaussValuation(S, QQ.valuation(2))
|
|
410
|
+
sage: y = v.residue_ring().gen()
|
|
411
|
+
sage: f = v.lift_to_key(y^2 + y + 1); f
|
|
412
|
+
x^2 + x + 1
|
|
413
|
+
"""
|
|
414
|
+
F = self.residue_ring().coerce(F)
|
|
415
|
+
|
|
416
|
+
if F.is_constant():
|
|
417
|
+
raise ValueError("F must not be constant but %r is constant" % (F,))
|
|
418
|
+
if not F.is_monic():
|
|
419
|
+
raise ValueError("F must be monic but %r is not monic" % (F,))
|
|
420
|
+
if not F.is_irreducible():
|
|
421
|
+
raise ValueError("F must be irreducible but %r factors" % (F,))
|
|
422
|
+
|
|
423
|
+
return self.lift(F)
|
|
424
|
+
|
|
425
|
+
@cached_method
|
|
426
|
+
def equivalence_unit(self, s, reciprocal=False):
|
|
427
|
+
"""
|
|
428
|
+
Return an equivalence unit of valuation ``s``.
|
|
429
|
+
|
|
430
|
+
INPUT:
|
|
431
|
+
|
|
432
|
+
- ``s`` -- an element of the :meth:`value_group`
|
|
433
|
+
|
|
434
|
+
- ``reciprocal`` -- boolean (default: ``False``); whether or not to
|
|
435
|
+
return the equivalence unit as the :meth:`~sage.rings.valuation.inductive_valuation.InductiveValuation.equivalence_reciprocal` of
|
|
436
|
+
the equivalence unit of valuation ``-s``
|
|
437
|
+
|
|
438
|
+
EXAMPLES::
|
|
439
|
+
|
|
440
|
+
sage: # needs sage.libs.ntl
|
|
441
|
+
sage: S.<x> = Qp(3,5)[]
|
|
442
|
+
sage: v = GaussValuation(S)
|
|
443
|
+
sage: v.equivalence_unit(2)
|
|
444
|
+
3^2 + O(3^7)
|
|
445
|
+
sage: v.equivalence_unit(-2)
|
|
446
|
+
3^-2 + O(3^3)
|
|
447
|
+
"""
|
|
448
|
+
if reciprocal:
|
|
449
|
+
return self.equivalence_reciprocal(self.equivalence_unit(-s))
|
|
450
|
+
|
|
451
|
+
ret = self._base_valuation.element_with_valuation(s)
|
|
452
|
+
return self.domain()(ret)
|
|
453
|
+
|
|
454
|
+
def element_with_valuation(self, s):
|
|
455
|
+
r"""
|
|
456
|
+
Return a polynomial of minimal degree with valuation ``s``.
|
|
457
|
+
|
|
458
|
+
EXAMPLES::
|
|
459
|
+
|
|
460
|
+
sage: R.<x> = QQ[]
|
|
461
|
+
sage: v = GaussValuation(R, QQ.valuation(2))
|
|
462
|
+
sage: v.element_with_valuation(-2)
|
|
463
|
+
1/4
|
|
464
|
+
"""
|
|
465
|
+
return self.equivalence_unit(s)
|
|
466
|
+
|
|
467
|
+
def E(self):
|
|
468
|
+
"""
|
|
469
|
+
Return the ramification index of this valuation over its underlying
|
|
470
|
+
Gauss valuation, i.e., 1.
|
|
471
|
+
|
|
472
|
+
EXAMPLES::
|
|
473
|
+
|
|
474
|
+
sage: # needs sage.libs.ntl
|
|
475
|
+
sage: R.<u> = Qq(4,5)
|
|
476
|
+
sage: S.<x> = R[]
|
|
477
|
+
sage: v = GaussValuation(S)
|
|
478
|
+
sage: v.E()
|
|
479
|
+
1
|
|
480
|
+
"""
|
|
481
|
+
from sage.rings.integer_ring import ZZ
|
|
482
|
+
return ZZ.one()
|
|
483
|
+
|
|
484
|
+
def F(self):
|
|
485
|
+
"""
|
|
486
|
+
Return the degree of the residue field extension of this valuation
|
|
487
|
+
over the Gauss valuation, i.e., 1.
|
|
488
|
+
|
|
489
|
+
EXAMPLES::
|
|
490
|
+
|
|
491
|
+
sage: # needs sage.libs.ntl
|
|
492
|
+
sage: R.<u> = Qq(4,5)
|
|
493
|
+
sage: S.<x> = R[]
|
|
494
|
+
sage: v = GaussValuation(S)
|
|
495
|
+
sage: v.F()
|
|
496
|
+
1
|
|
497
|
+
"""
|
|
498
|
+
from sage.rings.integer_ring import ZZ
|
|
499
|
+
return ZZ.one()
|
|
500
|
+
|
|
501
|
+
def change_domain(self, ring):
|
|
502
|
+
r"""
|
|
503
|
+
Return this valuation as a valuation over ``ring``.
|
|
504
|
+
|
|
505
|
+
EXAMPLES::
|
|
506
|
+
|
|
507
|
+
sage: v = ZZ.valuation(2)
|
|
508
|
+
sage: R.<x> = ZZ[]
|
|
509
|
+
sage: w = GaussValuation(R, v)
|
|
510
|
+
sage: w.change_domain(QQ['x'])
|
|
511
|
+
Gauss valuation induced by 2-adic valuation
|
|
512
|
+
"""
|
|
513
|
+
from sage.rings.polynomial.polynomial_ring import PolynomialRing_generic
|
|
514
|
+
if isinstance(ring, PolynomialRing_generic) and ring.ngens() == 1:
|
|
515
|
+
base_valuation = self._base_valuation.change_domain(ring.base_ring())
|
|
516
|
+
return GaussValuation(self.domain().change_ring(ring.base_ring()), base_valuation)
|
|
517
|
+
return super().change_domain(ring)
|
|
518
|
+
|
|
519
|
+
def extensions(self, ring):
|
|
520
|
+
r"""
|
|
521
|
+
Return the extensions of this valuation to ``ring``.
|
|
522
|
+
|
|
523
|
+
EXAMPLES::
|
|
524
|
+
|
|
525
|
+
sage: v = ZZ.valuation(2)
|
|
526
|
+
sage: R.<x> = ZZ[]
|
|
527
|
+
sage: w = GaussValuation(R, v)
|
|
528
|
+
sage: w.extensions(GaussianIntegers()['x']) # needs sage.geometry.polyhedron sage.rings.number_field
|
|
529
|
+
[Gauss valuation induced by 2-adic valuation]
|
|
530
|
+
"""
|
|
531
|
+
from sage.rings.polynomial.polynomial_ring import PolynomialRing_generic
|
|
532
|
+
if isinstance(ring, PolynomialRing_generic) and ring.ngens() == 1:
|
|
533
|
+
if self.domain().is_subring(ring):
|
|
534
|
+
return [GaussValuation(ring, w) for w in self._base_valuation.extensions(ring.base_ring())]
|
|
535
|
+
return super().extensions(ring)
|
|
536
|
+
|
|
537
|
+
def restriction(self, ring):
|
|
538
|
+
r"""
|
|
539
|
+
Return the restriction of this valuation to ``ring``.
|
|
540
|
+
|
|
541
|
+
EXAMPLES::
|
|
542
|
+
|
|
543
|
+
sage: v = ZZ.valuation(2)
|
|
544
|
+
sage: R.<x> = ZZ[]
|
|
545
|
+
sage: w = GaussValuation(R, v)
|
|
546
|
+
sage: w.restriction(ZZ)
|
|
547
|
+
2-adic valuation
|
|
548
|
+
"""
|
|
549
|
+
if ring.is_subring(self.domain().base_ring()):
|
|
550
|
+
return self._base_valuation.restriction(ring)
|
|
551
|
+
from sage.rings.polynomial.polynomial_ring import PolynomialRing_generic
|
|
552
|
+
if isinstance(ring, PolynomialRing_generic) and ring.ngens() == 1:
|
|
553
|
+
if ring.base().is_subring(self.domain().base()):
|
|
554
|
+
return GaussValuation(ring, self._base_valuation.restriction(ring.base()))
|
|
555
|
+
return super().restriction(ring)
|
|
556
|
+
|
|
557
|
+
def is_gauss_valuation(self):
|
|
558
|
+
r"""
|
|
559
|
+
Return whether this valuation is a Gauss valuation.
|
|
560
|
+
|
|
561
|
+
EXAMPLES::
|
|
562
|
+
|
|
563
|
+
sage: # needs sage.libs.ntl
|
|
564
|
+
sage: R.<u> = Qq(4,5)
|
|
565
|
+
sage: S.<x> = R[]
|
|
566
|
+
sage: v = GaussValuation(S)
|
|
567
|
+
sage: v.is_gauss_valuation()
|
|
568
|
+
True
|
|
569
|
+
"""
|
|
570
|
+
return True
|
|
571
|
+
|
|
572
|
+
def augmentation_chain(self):
|
|
573
|
+
r"""
|
|
574
|
+
Return a list with the chain of augmentations down to the underlying
|
|
575
|
+
Gauss valuation.
|
|
576
|
+
|
|
577
|
+
EXAMPLES::
|
|
578
|
+
|
|
579
|
+
sage: # needs sage.libs.ntl
|
|
580
|
+
sage: R.<u> = Qq(4,5)
|
|
581
|
+
sage: S.<x> = R[]
|
|
582
|
+
sage: v = GaussValuation(S)
|
|
583
|
+
sage: v.augmentation_chain()
|
|
584
|
+
[Gauss valuation induced by 2-adic valuation]
|
|
585
|
+
"""
|
|
586
|
+
return [self]
|
|
587
|
+
|
|
588
|
+
def is_trivial(self):
|
|
589
|
+
r"""
|
|
590
|
+
Return whether this is a trivial valuation (sending everything but zero
|
|
591
|
+
to zero.)
|
|
592
|
+
|
|
593
|
+
EXAMPLES::
|
|
594
|
+
|
|
595
|
+
sage: R.<x> = QQ[]
|
|
596
|
+
sage: v = GaussValuation(R, valuations.TrivialValuation(QQ))
|
|
597
|
+
sage: v.is_trivial()
|
|
598
|
+
True
|
|
599
|
+
"""
|
|
600
|
+
return self._base_valuation.is_trivial()
|
|
601
|
+
|
|
602
|
+
def monic_integral_model(self, G):
|
|
603
|
+
r"""
|
|
604
|
+
Return a monic integral irreducible polynomial which defines the same
|
|
605
|
+
extension of the base ring of the domain as the irreducible polynomial
|
|
606
|
+
``G`` together with maps between the old and the new polynomial.
|
|
607
|
+
|
|
608
|
+
EXAMPLES::
|
|
609
|
+
|
|
610
|
+
sage: R.<x> = Qp(2, 5)[] # needs sage.libs.ntl
|
|
611
|
+
sage: v = GaussValuation(R) # needs sage.libs.ntl
|
|
612
|
+
sage: v.monic_integral_model(5*x^2 + 1/2*x + 1/4) # needs sage.libs.ntl
|
|
613
|
+
(Ring endomorphism of Univariate Polynomial Ring in x over 2-adic Field with capped relative precision 5
|
|
614
|
+
Defn: (1 + O(2^5))*x |--> (2^-1 + O(2^4))*x,
|
|
615
|
+
Ring endomorphism of Univariate Polynomial Ring in x over 2-adic Field with capped relative precision 5
|
|
616
|
+
Defn: (1 + O(2^5))*x |--> (2 + O(2^6))*x,
|
|
617
|
+
(1 + O(2^5))*x^2 + (1 + 2^2 + 2^3 + O(2^5))*x + 1 + 2^2 + 2^3 + O(2^5))
|
|
618
|
+
"""
|
|
619
|
+
if not G.is_monic():
|
|
620
|
+
# this might fail if the base ring is not a field
|
|
621
|
+
G = G / G.leading_coefficient()
|
|
622
|
+
|
|
623
|
+
x = G.parent().gen()
|
|
624
|
+
u = self._base_valuation.uniformizer()
|
|
625
|
+
|
|
626
|
+
factor = 1
|
|
627
|
+
substitution = x
|
|
628
|
+
H = G
|
|
629
|
+
while self(H) < 0:
|
|
630
|
+
# this might fail if the base ring is not a field
|
|
631
|
+
factor *= u
|
|
632
|
+
substitution = x / factor
|
|
633
|
+
H = G(substitution) * (factor ** G.degree())
|
|
634
|
+
|
|
635
|
+
assert H.is_monic()
|
|
636
|
+
return H.parent().hom(substitution, G.parent()), G.parent().hom(x / substitution[1], H.parent()), H
|
|
637
|
+
|
|
638
|
+
def _ge_(self, other):
|
|
639
|
+
r"""
|
|
640
|
+
Return whether this valuation is greater than or equal to ``other``
|
|
641
|
+
everywhere.
|
|
642
|
+
|
|
643
|
+
EXAMPLES::
|
|
644
|
+
|
|
645
|
+
sage: R.<x> = QQ[]
|
|
646
|
+
sage: v = GaussValuation(R, QQ.valuation(2))
|
|
647
|
+
sage: w = GaussValuation(R, QQ.valuation(3))
|
|
648
|
+
sage: v >= w
|
|
649
|
+
False
|
|
650
|
+
sage: w >= v
|
|
651
|
+
False
|
|
652
|
+
"""
|
|
653
|
+
if isinstance(other, GaussValuation_generic):
|
|
654
|
+
return self._base_valuation >= other._base_valuation
|
|
655
|
+
from .augmented_valuation import AugmentedValuation_base
|
|
656
|
+
if isinstance(other, AugmentedValuation_base):
|
|
657
|
+
return False
|
|
658
|
+
if other.is_trivial():
|
|
659
|
+
return other.is_discrete_valuation()
|
|
660
|
+
return super()._ge_(other)
|
|
661
|
+
|
|
662
|
+
def scale(self, scalar):
|
|
663
|
+
r"""
|
|
664
|
+
Return this valuation scaled by ``scalar``.
|
|
665
|
+
|
|
666
|
+
EXAMPLES::
|
|
667
|
+
|
|
668
|
+
sage: R.<x> = QQ[]
|
|
669
|
+
sage: v = GaussValuation(R, QQ.valuation(2))
|
|
670
|
+
sage: 3*v # indirect doctest
|
|
671
|
+
Gauss valuation induced by 3 * 2-adic valuation
|
|
672
|
+
"""
|
|
673
|
+
from sage.rings.rational_field import QQ
|
|
674
|
+
if scalar in QQ and scalar > 0 and scalar != 1:
|
|
675
|
+
return GaussValuation(self.domain(), self._base_valuation.scale(scalar))
|
|
676
|
+
return super().scale(scalar)
|
|
677
|
+
|
|
678
|
+
def _relative_size(self, f):
|
|
679
|
+
r"""
|
|
680
|
+
Return an estimate on the coefficient size of ``f``.
|
|
681
|
+
|
|
682
|
+
The number returned is an estimate on the factor between the number of
|
|
683
|
+
Bits used by ``f`` and the minimal number of bits used by an element
|
|
684
|
+
Congruent to ``f``.
|
|
685
|
+
|
|
686
|
+
This is used by :meth:`simplify` to decide whether simplification of
|
|
687
|
+
Coefficients is going to lead to a significant shrinking of the
|
|
688
|
+
Coefficients of ``f``.
|
|
689
|
+
|
|
690
|
+
EXAMPLES::
|
|
691
|
+
|
|
692
|
+
sage: R.<x> = QQ[]
|
|
693
|
+
sage: v = GaussValuation(R, QQ.valuation(2))
|
|
694
|
+
sage: v._relative_size(x + 1024)
|
|
695
|
+
6
|
|
696
|
+
|
|
697
|
+
For performance reasons, only the constant coefficient is considered.
|
|
698
|
+
(In common applications, the constant coefficient shows the most
|
|
699
|
+
critical coefficient growth)::
|
|
700
|
+
|
|
701
|
+
sage: v._relative_size(1024*x + 1)
|
|
702
|
+
1
|
|
703
|
+
"""
|
|
704
|
+
return self._base_valuation._relative_size(f[0])
|
|
705
|
+
|
|
706
|
+
def simplify(self, f, error=None, force=False, size_heuristic_bound=32, effective_degree=None, phiadic=True):
|
|
707
|
+
r"""
|
|
708
|
+
Return a simplified version of ``f``.
|
|
709
|
+
|
|
710
|
+
Produce an element which differs from ``f`` by an element of valuation
|
|
711
|
+
strictly greater than the valuation of ``f`` (or strictly greater than
|
|
712
|
+
``error`` if set.)
|
|
713
|
+
|
|
714
|
+
INPUT:
|
|
715
|
+
|
|
716
|
+
- ``f`` -- an element in the domain of this valuation
|
|
717
|
+
|
|
718
|
+
- ``error`` -- a rational, infinity, or ``None`` (default: ``None``),
|
|
719
|
+
the error allowed to introduce through the simplification
|
|
720
|
+
|
|
721
|
+
- ``force`` -- whether or not to simplify ``f`` even if there is
|
|
722
|
+
heuristically no change in the coefficient size of ``f`` expected
|
|
723
|
+
(default: ``False``)
|
|
724
|
+
|
|
725
|
+
- ``effective_degree`` -- when set, assume that coefficients beyond
|
|
726
|
+
``effective_degree`` can be safely dropped (default: ``None``)
|
|
727
|
+
|
|
728
|
+
- ``size_heuristic_bound`` -- when ``force`` is not set, the expected
|
|
729
|
+
factor by which the coefficients need to shrink to perform an actual
|
|
730
|
+
simplification (default: 32)
|
|
731
|
+
|
|
732
|
+
- ``phiadic`` -- whether to simplify in the `x`-adic expansion; the
|
|
733
|
+
parameter is ignored as no other simplification is implemented
|
|
734
|
+
|
|
735
|
+
EXAMPLES::
|
|
736
|
+
|
|
737
|
+
sage: # needs sage.libs.ntl
|
|
738
|
+
sage: R.<u> = Qq(4, 5)
|
|
739
|
+
sage: S.<x> = R[]
|
|
740
|
+
sage: v = GaussValuation(S)
|
|
741
|
+
sage: f = x^10/2 + 1
|
|
742
|
+
sage: v.simplify(f)
|
|
743
|
+
(2^-1 + O(2^4))*x^10 + 1 + O(2^5)
|
|
744
|
+
"""
|
|
745
|
+
f = self.domain().coerce(f)
|
|
746
|
+
|
|
747
|
+
if effective_degree is not None:
|
|
748
|
+
if effective_degree < f.degree():
|
|
749
|
+
f = f.truncate(effective_degree + 1)
|
|
750
|
+
|
|
751
|
+
if not force and self._relative_size(f) < size_heuristic_bound:
|
|
752
|
+
return f
|
|
753
|
+
|
|
754
|
+
if error is None:
|
|
755
|
+
# if the caller was sure that we should simplify, then we should try to do the best simplification possible
|
|
756
|
+
error = self(f) if force else self.uppper_bound(f)
|
|
757
|
+
|
|
758
|
+
return f.map_coefficients(lambda c: self._base_valuation.simplify(c, error=error, force=force))
|
|
759
|
+
|
|
760
|
+
def lower_bound(self, f):
|
|
761
|
+
r"""
|
|
762
|
+
Return a lower bound of this valuation at ``f``.
|
|
763
|
+
|
|
764
|
+
Use this method to get an approximation of the valuation of ``f``
|
|
765
|
+
when speed is more important than accuracy.
|
|
766
|
+
|
|
767
|
+
EXAMPLES::
|
|
768
|
+
|
|
769
|
+
sage: # needs sage.libs.ntl
|
|
770
|
+
sage: R.<u> = Qq(4, 5)
|
|
771
|
+
sage: S.<x> = R[]
|
|
772
|
+
sage: v = GaussValuation(S)
|
|
773
|
+
sage: v.lower_bound(1024*x + 2)
|
|
774
|
+
1
|
|
775
|
+
sage: v(1024*x + 2)
|
|
776
|
+
1
|
|
777
|
+
"""
|
|
778
|
+
from sage.rings.infinity import infinity
|
|
779
|
+
coefficients = f.coefficients(sparse=True)
|
|
780
|
+
coefficients.reverse()
|
|
781
|
+
ret = infinity
|
|
782
|
+
for c in coefficients:
|
|
783
|
+
v = self._base_valuation.lower_bound(c)
|
|
784
|
+
if c is not infinity and (ret is infinity or v < ret):
|
|
785
|
+
ret = v
|
|
786
|
+
return ret
|
|
787
|
+
|
|
788
|
+
def upper_bound(self, f):
|
|
789
|
+
r"""
|
|
790
|
+
Return an upper bound of this valuation at ``f``.
|
|
791
|
+
|
|
792
|
+
Use this method to get an approximation of the valuation of ``f``
|
|
793
|
+
when speed is more important than accuracy.
|
|
794
|
+
|
|
795
|
+
EXAMPLES::
|
|
796
|
+
|
|
797
|
+
sage: # needs sage.libs.ntl
|
|
798
|
+
sage: R.<u> = Qq(4, 5)
|
|
799
|
+
sage: S.<x> = R[]
|
|
800
|
+
sage: v = GaussValuation(S)
|
|
801
|
+
sage: v.upper_bound(1024*x + 1)
|
|
802
|
+
10
|
|
803
|
+
sage: v(1024*x + 1)
|
|
804
|
+
0
|
|
805
|
+
"""
|
|
806
|
+
f = self.domain().coerce(f)
|
|
807
|
+
coefficients = f.coefficients(sparse=True)
|
|
808
|
+
if not coefficients:
|
|
809
|
+
from sage.rings.infinity import infinity
|
|
810
|
+
return infinity
|
|
811
|
+
else:
|
|
812
|
+
return self._base_valuation.upper_bound(coefficients[-1])
|