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,15 @@
|
|
|
1
|
+
# sage_setup: distribution = sagemath-pari
|
|
2
|
+
from sage.libs.gmp.types cimport mpz_t
|
|
3
|
+
from cypari2.gen cimport Gen as pari_gen
|
|
4
|
+
from sage.rings.padics.padic_capped_relative_element cimport CRElement
|
|
5
|
+
|
|
6
|
+
ctypedef mpz_t celement
|
|
7
|
+
include "CA_template_header.pxi"
|
|
8
|
+
|
|
9
|
+
cdef class pAdicCappedAbsoluteElement(CAElement):
|
|
10
|
+
cdef lift_c(self)
|
|
11
|
+
cdef pari_gen _to_gen(self)
|
|
12
|
+
|
|
13
|
+
from sage.rings.padics.pow_computer cimport PowComputer_base
|
|
14
|
+
cdef class PowComputer_(PowComputer_base):
|
|
15
|
+
pass
|
|
@@ -0,0 +1,520 @@
|
|
|
1
|
+
# sage_setup: distribution = sagemath-pari
|
|
2
|
+
# sage.doctest: needs sage.rings.padics
|
|
3
|
+
"""
|
|
4
|
+
`p`-adic Capped Absolute Elements
|
|
5
|
+
|
|
6
|
+
Elements of `p`-adic Rings with Absolute Precision Cap
|
|
7
|
+
|
|
8
|
+
AUTHORS:
|
|
9
|
+
|
|
10
|
+
- David Roe
|
|
11
|
+
- Genya Zaytman: documentation
|
|
12
|
+
- David Harvey: doctests
|
|
13
|
+
"""
|
|
14
|
+
# ****************************************************************************
|
|
15
|
+
# Copyright (C) 2007-2013 David Roe <roed.math@gmail.com>
|
|
16
|
+
# William Stein <wstein@gmail.com>
|
|
17
|
+
#
|
|
18
|
+
# Distributed under the terms of the GNU General Public License (GPL)
|
|
19
|
+
# as published by the Free Software Foundation; either version 2 of
|
|
20
|
+
# the License, or (at your option) any later version.
|
|
21
|
+
#
|
|
22
|
+
# https://www.gnu.org/licenses/
|
|
23
|
+
# ****************************************************************************
|
|
24
|
+
include "sage/libs/linkages/padics/mpz.pxi"
|
|
25
|
+
include "CA_template.pxi"
|
|
26
|
+
|
|
27
|
+
from sage.libs.pari.convert_gmp cimport new_gen_from_padic
|
|
28
|
+
from sage.rings.finite_rings.integer_mod import Mod
|
|
29
|
+
|
|
30
|
+
cdef extern from "transcendantal.c":
|
|
31
|
+
cdef void padiclog(mpz_t ans, const mpz_t a, unsigned long p, unsigned long prec, const mpz_t modulo)
|
|
32
|
+
cdef void padicexp(mpz_t ans, const mpz_t a, unsigned long p, unsigned long prec, const mpz_t modulo)
|
|
33
|
+
cdef void padicexp_Newton(mpz_t ans, const mpz_t a, unsigned long p, unsigned long prec, unsigned long precinit, const mpz_t modulo)
|
|
34
|
+
|
|
35
|
+
cdef class PowComputer_(PowComputer_base):
|
|
36
|
+
"""
|
|
37
|
+
A PowComputer for a capped-absolute `p`-adic ring.
|
|
38
|
+
"""
|
|
39
|
+
def __init__(self, Integer prime, long cache_limit, long prec_cap, long ram_prec_cap, bint in_field):
|
|
40
|
+
"""
|
|
41
|
+
Initialization.
|
|
42
|
+
|
|
43
|
+
EXAMPLES::
|
|
44
|
+
|
|
45
|
+
sage: R = ZpCA(5)
|
|
46
|
+
sage: type(R.prime_pow)
|
|
47
|
+
<class 'sage.rings.padics.padic_capped_absolute_element.PowComputer_'>
|
|
48
|
+
sage: R.prime_pow._prec_type
|
|
49
|
+
'capped-abs'
|
|
50
|
+
"""
|
|
51
|
+
self._prec_type = 'capped-abs'
|
|
52
|
+
PowComputer_base.__init__(self, prime, cache_limit, prec_cap, ram_prec_cap, in_field)
|
|
53
|
+
|
|
54
|
+
cdef class pAdicCappedAbsoluteElement(CAElement):
|
|
55
|
+
"""
|
|
56
|
+
Construct new element with given parent and value.
|
|
57
|
+
|
|
58
|
+
INPUT:
|
|
59
|
+
|
|
60
|
+
- ``x`` -- value to coerce into a capped absolute ring
|
|
61
|
+
|
|
62
|
+
- ``absprec`` -- maximum number of digits of absolute precision
|
|
63
|
+
|
|
64
|
+
- ``relprec`` -- maximum number of digits of relative precision
|
|
65
|
+
|
|
66
|
+
EXAMPLES::
|
|
67
|
+
|
|
68
|
+
sage: R = ZpCA(3, 5)
|
|
69
|
+
sage: R(2)
|
|
70
|
+
2 + O(3^5)
|
|
71
|
+
sage: R(2, absprec=2)
|
|
72
|
+
2 + O(3^2)
|
|
73
|
+
sage: R(3, relprec=2)
|
|
74
|
+
3 + O(3^3)
|
|
75
|
+
sage: R(Qp(3)(10))
|
|
76
|
+
1 + 3^2 + O(3^5)
|
|
77
|
+
sage: R(pari(6))
|
|
78
|
+
2*3 + O(3^5)
|
|
79
|
+
sage: R(pari(1/2))
|
|
80
|
+
2 + 3 + 3^2 + 3^3 + 3^4 + O(3^5)
|
|
81
|
+
sage: R(1/2)
|
|
82
|
+
2 + 3 + 3^2 + 3^3 + 3^4 + O(3^5)
|
|
83
|
+
sage: R(mod(-1, 3^7))
|
|
84
|
+
2 + 2*3 + 2*3^2 + 2*3^3 + 2*3^4 + O(3^5)
|
|
85
|
+
sage: R(mod(-1, 3^2))
|
|
86
|
+
2 + 2*3 + O(3^2)
|
|
87
|
+
sage: R(3 + O(3^2))
|
|
88
|
+
3 + O(3^2)
|
|
89
|
+
"""
|
|
90
|
+
def lift(self):
|
|
91
|
+
"""
|
|
92
|
+
EXAMPLES::
|
|
93
|
+
|
|
94
|
+
sage: R = ZpCA(3)
|
|
95
|
+
sage: R(10).lift()
|
|
96
|
+
10
|
|
97
|
+
sage: R(-1).lift()
|
|
98
|
+
3486784400
|
|
99
|
+
"""
|
|
100
|
+
return self.lift_c()
|
|
101
|
+
|
|
102
|
+
cdef lift_c(self):
|
|
103
|
+
"""
|
|
104
|
+
Implementation of lift.
|
|
105
|
+
|
|
106
|
+
TESTS::
|
|
107
|
+
|
|
108
|
+
sage: ZpCA(3,3)(1/4).lift() # indirect doctest
|
|
109
|
+
7
|
|
110
|
+
"""
|
|
111
|
+
cdef Integer ans = Integer.__new__(Integer)
|
|
112
|
+
mpz_set(ans.value, self.value)
|
|
113
|
+
return ans
|
|
114
|
+
|
|
115
|
+
def __pari__(self):
|
|
116
|
+
"""
|
|
117
|
+
Conversion to pari.
|
|
118
|
+
|
|
119
|
+
EXAMPLES::
|
|
120
|
+
|
|
121
|
+
sage: R = ZpCA(5)
|
|
122
|
+
sage: pari(R(1777)) # indirect doctest # needs sage.libs.pari
|
|
123
|
+
2 + 5^2 + 4*5^3 + 2*5^4 + O(5^20)
|
|
124
|
+
sage: pari(R(0,0)) # needs sage.libs.pari
|
|
125
|
+
O(5^0)
|
|
126
|
+
"""
|
|
127
|
+
return self._to_gen()
|
|
128
|
+
|
|
129
|
+
cdef pari_gen _to_gen(self):
|
|
130
|
+
"""
|
|
131
|
+
Convert this element to an equivalent pari element.
|
|
132
|
+
|
|
133
|
+
EXAMPLES::
|
|
134
|
+
|
|
135
|
+
sage: R = ZpCA(5, 10); a = R(17); pari(a) # indirect doctest
|
|
136
|
+
2 + 3*5 + O(5^10)
|
|
137
|
+
sage: pari(R(0,5)) # needs sage.libs.pari
|
|
138
|
+
O(5^5)
|
|
139
|
+
sage: pari(R(0,5)).debug() # needs sage.libs.pari
|
|
140
|
+
[&=...] PADIC(lg=5):... (precp=0,valp=5):... ... ... ...
|
|
141
|
+
p : [&=...] INT(lg=3):... (+,lgefint=3):... ...
|
|
142
|
+
p^l : [&=...] INT(lg=3):... (+,lgefint=3):... ...
|
|
143
|
+
I : gen_0
|
|
144
|
+
"""
|
|
145
|
+
cdef long val
|
|
146
|
+
# Let val be the valuation of self, holder (defined in the
|
|
147
|
+
# linkage file) be the unit part.
|
|
148
|
+
if mpz_sgn(self.value) == 0:
|
|
149
|
+
# Special case for zero: maximal valuation and 0 unit part
|
|
150
|
+
val = self.absprec
|
|
151
|
+
mpz_set_ui(holder.value, 0)
|
|
152
|
+
else:
|
|
153
|
+
val = mpz_remove(holder.value, self.value, self.prime_pow.prime.value)
|
|
154
|
+
return new_gen_from_padic(val, self.absprec - val,
|
|
155
|
+
self.prime_pow.prime.value,
|
|
156
|
+
self.prime_pow.pow_mpz_t_tmp(self.absprec - val),
|
|
157
|
+
holder.value)
|
|
158
|
+
|
|
159
|
+
def _integer_(self, Z=None):
|
|
160
|
+
r"""
|
|
161
|
+
Convert this element to an integer.
|
|
162
|
+
|
|
163
|
+
TESTS::
|
|
164
|
+
|
|
165
|
+
sage: R = ZpCA(5, prec = 4); a = R(642); a
|
|
166
|
+
2 + 3*5 + O(5^4)
|
|
167
|
+
sage: a._integer_()
|
|
168
|
+
17
|
|
169
|
+
"""
|
|
170
|
+
return self.lift_c()
|
|
171
|
+
|
|
172
|
+
def residue(self, absprec=1, field=None, check_prec=True):
|
|
173
|
+
r"""
|
|
174
|
+
Reduces ``self`` modulo `p^\mathrm{absprec}`.
|
|
175
|
+
|
|
176
|
+
INPUT:
|
|
177
|
+
|
|
178
|
+
- ``absprec`` -- nonnegative integer (default: 1)
|
|
179
|
+
|
|
180
|
+
- ``field`` -- boolean (default: ``None``); whether to return an
|
|
181
|
+
element of GF(p) or Zmod(p)
|
|
182
|
+
|
|
183
|
+
- ``check_prec`` -- boolean (default: ``True``); whether to raise an
|
|
184
|
+
error if this element has insufficient precision to determine the
|
|
185
|
+
reduction
|
|
186
|
+
|
|
187
|
+
OUTPUT:
|
|
188
|
+
|
|
189
|
+
This element reduced modulo `p^\mathrm{absprec}` as an element of
|
|
190
|
+
`\ZZ/p^\mathrm{absprec}\ZZ`
|
|
191
|
+
|
|
192
|
+
EXAMPLES::
|
|
193
|
+
|
|
194
|
+
sage: R = Zp(7,10,'capped-abs')
|
|
195
|
+
sage: a = R(8)
|
|
196
|
+
sage: a.residue(1)
|
|
197
|
+
1
|
|
198
|
+
|
|
199
|
+
This is different from applying ``% p^n`` which returns an element in
|
|
200
|
+
the same ring::
|
|
201
|
+
|
|
202
|
+
sage: b = a.residue(2); b
|
|
203
|
+
8
|
|
204
|
+
sage: b.parent()
|
|
205
|
+
Ring of integers modulo 49
|
|
206
|
+
sage: c = a % 7^2; c
|
|
207
|
+
1 + 7 + O(7^10)
|
|
208
|
+
sage: c.parent()
|
|
209
|
+
7-adic Ring with capped absolute precision 10
|
|
210
|
+
|
|
211
|
+
Note that reduction of ``c`` dropped to the precision of the unit part
|
|
212
|
+
of ``7^2``, see :meth:`_mod_`::
|
|
213
|
+
|
|
214
|
+
sage: R(7^2).unit_part()
|
|
215
|
+
1 + O(7^8)
|
|
216
|
+
|
|
217
|
+
TESTS::
|
|
218
|
+
|
|
219
|
+
sage: a.residue(0)
|
|
220
|
+
0
|
|
221
|
+
sage: a.residue(-1)
|
|
222
|
+
Traceback (most recent call last):
|
|
223
|
+
...
|
|
224
|
+
ValueError: cannot reduce modulo a negative power of p
|
|
225
|
+
sage: a.residue(11)
|
|
226
|
+
Traceback (most recent call last):
|
|
227
|
+
...
|
|
228
|
+
PrecisionError: not enough precision known in order to compute residue
|
|
229
|
+
sage: a.residue(5, check_prec=False)
|
|
230
|
+
8
|
|
231
|
+
|
|
232
|
+
sage: a.residue(field=True).parent()
|
|
233
|
+
Finite Field of size 7
|
|
234
|
+
|
|
235
|
+
.. SEEALSO::
|
|
236
|
+
|
|
237
|
+
:meth:`_mod_`
|
|
238
|
+
"""
|
|
239
|
+
if not isinstance(absprec, Integer):
|
|
240
|
+
absprec = Integer(absprec)
|
|
241
|
+
if check_prec and mpz_cmp_si((<Integer>absprec).value, self.absprec) > 0:
|
|
242
|
+
raise PrecisionError("not enough precision known in order to compute residue")
|
|
243
|
+
elif mpz_sgn((<Integer>absprec).value) < 0:
|
|
244
|
+
raise ValueError("cannot reduce modulo a negative power of p")
|
|
245
|
+
if field is None:
|
|
246
|
+
field = (absprec == 1)
|
|
247
|
+
elif field and absprec != 1:
|
|
248
|
+
raise ValueError("field keyword may only be set at precision 1")
|
|
249
|
+
cdef long aprec = mpz_get_ui((<Integer>absprec).value)
|
|
250
|
+
cdef Integer modulus = Integer.__new__(Integer)
|
|
251
|
+
mpz_set(modulus.value, self.prime_pow.pow_mpz_t_tmp(aprec))
|
|
252
|
+
cdef Integer selfvalue = Integer.__new__(Integer)
|
|
253
|
+
mpz_set(selfvalue.value, self.value)
|
|
254
|
+
if field:
|
|
255
|
+
from sage.rings.finite_rings.finite_field_constructor import GF
|
|
256
|
+
return GF(self.parent().prime())(selfvalue)
|
|
257
|
+
else:
|
|
258
|
+
return Mod(selfvalue, modulus)
|
|
259
|
+
|
|
260
|
+
def multiplicative_order(self):
|
|
261
|
+
r"""
|
|
262
|
+
Return the minimum possible multiplicative order of this element.
|
|
263
|
+
|
|
264
|
+
OUTPUT:
|
|
265
|
+
|
|
266
|
+
The multiplicative order of ``self``. This is the minimum multiplicative
|
|
267
|
+
order of all elements of `\ZZ_p` lifting ``self`` to infinite
|
|
268
|
+
precision.
|
|
269
|
+
|
|
270
|
+
EXAMPLES::
|
|
271
|
+
|
|
272
|
+
sage: R = ZpCA(7, 6)
|
|
273
|
+
sage: R(1/3)
|
|
274
|
+
5 + 4*7 + 4*7^2 + 4*7^3 + 4*7^4 + 4*7^5 + O(7^6)
|
|
275
|
+
sage: R(1/3).multiplicative_order()
|
|
276
|
+
+Infinity
|
|
277
|
+
sage: R(7).multiplicative_order()
|
|
278
|
+
+Infinity
|
|
279
|
+
sage: R(1).multiplicative_order()
|
|
280
|
+
1
|
|
281
|
+
sage: R(-1).multiplicative_order()
|
|
282
|
+
2
|
|
283
|
+
sage: R.teichmuller(3).multiplicative_order()
|
|
284
|
+
6
|
|
285
|
+
"""
|
|
286
|
+
cdef mpz_t ppow_minus_one
|
|
287
|
+
cdef Integer ans
|
|
288
|
+
if mpz_divisible_p(self.value, self.prime_pow.prime.value):
|
|
289
|
+
return infinity
|
|
290
|
+
if mpz_cmp_ui(self.value, 1) == 0:
|
|
291
|
+
ans = Integer.__new__(Integer)
|
|
292
|
+
mpz_set_ui(ans.value, 1)
|
|
293
|
+
return ans
|
|
294
|
+
mpz_init(ppow_minus_one)
|
|
295
|
+
mpz_sub_ui(ppow_minus_one, self.prime_pow.pow_mpz_t_tmp(self.absprec), 1)
|
|
296
|
+
if mpz_cmp(self.value, ppow_minus_one) == 0:
|
|
297
|
+
ans = Integer.__new__(Integer)
|
|
298
|
+
mpz_set_ui(ans.value, 2)
|
|
299
|
+
mpz_clear(ppow_minus_one)
|
|
300
|
+
return ans
|
|
301
|
+
# check if self is an approximation to a teichmuller lift:
|
|
302
|
+
mpz_powm(ppow_minus_one, self.value, self.prime_pow.prime.value, self.prime_pow.pow_mpz_t_tmp(self.absprec))
|
|
303
|
+
if mpz_cmp(ppow_minus_one, self.value) == 0:
|
|
304
|
+
mpz_clear(ppow_minus_one)
|
|
305
|
+
return self.residue(1).multiplicative_order()
|
|
306
|
+
else:
|
|
307
|
+
mpz_clear(ppow_minus_one)
|
|
308
|
+
return infinity
|
|
309
|
+
|
|
310
|
+
def _log_binary_splitting(self, aprec, mina=0):
|
|
311
|
+
r"""
|
|
312
|
+
Return ``\log(self)`` for ``self`` equal to 1 in the residue field.
|
|
313
|
+
|
|
314
|
+
This is a helper method for :meth:`log`.
|
|
315
|
+
It uses a fast binary splitting algorithm.
|
|
316
|
+
|
|
317
|
+
INPUT:
|
|
318
|
+
|
|
319
|
+
- ``aprec`` -- integer; the precision to which the result is
|
|
320
|
+
correct. ``aprec`` must not exceed the precision cap of the ring over
|
|
321
|
+
which this element is defined.
|
|
322
|
+
- ``mina`` -- integer (default: 0); the series will check `n` up to
|
|
323
|
+
this valuation (and beyond) to see if they can contribute to the
|
|
324
|
+
series
|
|
325
|
+
|
|
326
|
+
.. NOTE::
|
|
327
|
+
|
|
328
|
+
The function does not check that its argument ``self`` is
|
|
329
|
+
1 in the residue field. If this assumption is not fulfilled
|
|
330
|
+
the behaviour of the function is not specified.
|
|
331
|
+
|
|
332
|
+
ALGORITHM:
|
|
333
|
+
|
|
334
|
+
1. Raise `u` to the power `p^v` for a suitable `v` in order
|
|
335
|
+
to make it closer to 1. (`v` is chosen such that `p^v` is
|
|
336
|
+
close to the precision.)
|
|
337
|
+
|
|
338
|
+
2. Write
|
|
339
|
+
|
|
340
|
+
.. MATH::
|
|
341
|
+
|
|
342
|
+
u^{p-1} = \prod_{i=1}^\infty (1 - a_i p^{(v+1)*2^i})
|
|
343
|
+
|
|
344
|
+
with `0 \leq a_i < p^{(v+1)*2^i}` and compute
|
|
345
|
+
`\log(1 - a_i p^{(v+1)*2^i})` using the standard Taylor expansion
|
|
346
|
+
|
|
347
|
+
.. MATH::
|
|
348
|
+
|
|
349
|
+
\log(1 - x) = -x - 1/2 x^2 - 1/3 x^3 - 1/4 x^4 - 1/5 x^5 - \cdots
|
|
350
|
+
|
|
351
|
+
together with a binary splitting method.
|
|
352
|
+
|
|
353
|
+
3. Divide the result by `p^v`
|
|
354
|
+
|
|
355
|
+
The complexity of this algorithm is quasi-linear.
|
|
356
|
+
|
|
357
|
+
EXAMPLES::
|
|
358
|
+
|
|
359
|
+
sage: r = Qp(5,prec=4)(6)
|
|
360
|
+
sage: r._log_binary_splitting(2)
|
|
361
|
+
5 + O(5^2)
|
|
362
|
+
sage: r._log_binary_splitting(4)
|
|
363
|
+
5 + 2*5^2 + 4*5^3 + O(5^4)
|
|
364
|
+
sage: r._log_binary_splitting(100)
|
|
365
|
+
5 + 2*5^2 + 4*5^3 + O(5^4)
|
|
366
|
+
|
|
367
|
+
sage: r = Zp(5,prec=4,type='fixed-mod')(6)
|
|
368
|
+
sage: r._log_binary_splitting(5)
|
|
369
|
+
5 + 2*5^2 + 4*5^3
|
|
370
|
+
"""
|
|
371
|
+
cdef unsigned long p
|
|
372
|
+
cdef unsigned long prec = min(aprec, self.absprec)
|
|
373
|
+
cdef pAdicCappedAbsoluteElement ans, unit
|
|
374
|
+
|
|
375
|
+
if mpz_fits_slong_p(self.prime_pow.prime.value) == 0:
|
|
376
|
+
raise NotImplementedError("the prime %s does not fit in a long" % self.prime_pow.prime)
|
|
377
|
+
p = self.prime_pow.prime
|
|
378
|
+
|
|
379
|
+
ans = self._new_c()
|
|
380
|
+
ans.absprec = prec
|
|
381
|
+
unit = self.unit_part()
|
|
382
|
+
sig_on()
|
|
383
|
+
padiclog(ans.value, unit.value, p, prec, self.prime_pow.pow_mpz_t_tmp(prec))
|
|
384
|
+
sig_off()
|
|
385
|
+
|
|
386
|
+
return ans
|
|
387
|
+
|
|
388
|
+
def _exp_binary_splitting(self, aprec):
|
|
389
|
+
r"""
|
|
390
|
+
Compute the exponential power series of this element.
|
|
391
|
+
|
|
392
|
+
This is a helper method for :meth:`exp`.
|
|
393
|
+
|
|
394
|
+
INPUT:
|
|
395
|
+
|
|
396
|
+
- ``aprec`` -- integer; the precision to which to compute the
|
|
397
|
+
exponential
|
|
398
|
+
|
|
399
|
+
.. NOTE::
|
|
400
|
+
|
|
401
|
+
The function does not check that its argument ``self`` is
|
|
402
|
+
the disk of convergence of ``exp``. If this assumption is not
|
|
403
|
+
fulfilled the behaviour of the function is not specified.
|
|
404
|
+
|
|
405
|
+
ALGORITHM:
|
|
406
|
+
|
|
407
|
+
Write
|
|
408
|
+
|
|
409
|
+
.. MATH::
|
|
410
|
+
|
|
411
|
+
self = \sum_{i=1}^\infty a_i p^{2^i}
|
|
412
|
+
|
|
413
|
+
with `0 \leq a_i < p^{2^i}` and compute
|
|
414
|
+
`\exp(a_i p^{2^i})` using the standard Taylor expansion
|
|
415
|
+
|
|
416
|
+
.. MATH::
|
|
417
|
+
|
|
418
|
+
\exp(x) = 1 + x + x^2/2 + x^3/6 + x^4/24 + \cdots
|
|
419
|
+
|
|
420
|
+
together with a binary splitting method.
|
|
421
|
+
|
|
422
|
+
The binary complexity of this algorithm is quasi-linear.
|
|
423
|
+
|
|
424
|
+
EXAMPLES::
|
|
425
|
+
|
|
426
|
+
sage: R = Zp(7,5)
|
|
427
|
+
sage: x = R(7)
|
|
428
|
+
sage: x.exp(algorithm='binary_splitting') # indirect doctest
|
|
429
|
+
1 + 7 + 4*7^2 + 2*7^3 + O(7^5)
|
|
430
|
+
"""
|
|
431
|
+
cdef unsigned long p
|
|
432
|
+
cdef unsigned long prec = aprec
|
|
433
|
+
cdef pAdicCappedAbsoluteElement ans
|
|
434
|
+
|
|
435
|
+
if mpz_fits_slong_p(self.prime_pow.prime.value) == 0:
|
|
436
|
+
raise NotImplementedError("the prime %s does not fit in a long" % self.prime_pow.prime)
|
|
437
|
+
p = self.prime_pow.prime
|
|
438
|
+
|
|
439
|
+
ans = self._new_c()
|
|
440
|
+
ans.absprec = prec
|
|
441
|
+
sig_on()
|
|
442
|
+
padicexp(ans.value, self.value, p, prec, self.prime_pow.pow_mpz_t_tmp(prec))
|
|
443
|
+
sig_off()
|
|
444
|
+
|
|
445
|
+
return ans
|
|
446
|
+
|
|
447
|
+
def _exp_newton(self, aprec, log_algorithm=None):
|
|
448
|
+
r"""
|
|
449
|
+
Compute the exponential power series of this element.
|
|
450
|
+
|
|
451
|
+
This is a helper method for :meth:`exp`.
|
|
452
|
+
|
|
453
|
+
INPUT:
|
|
454
|
+
|
|
455
|
+
- ``aprec`` -- integer; the precision to which to compute the
|
|
456
|
+
exponential
|
|
457
|
+
|
|
458
|
+
- ``log_algorithm`` -- (default: ``None``) the algorithm used for
|
|
459
|
+
computing the logarithm. This attribute is passed to the log
|
|
460
|
+
method. See :meth:`log` for more details about the possible
|
|
461
|
+
algorithms.
|
|
462
|
+
|
|
463
|
+
.. NOTE::
|
|
464
|
+
|
|
465
|
+
The function does not check that its argument ``self`` is
|
|
466
|
+
the disk of convergence of ``exp``. If this assumption is not
|
|
467
|
+
fulfilled the behaviour of the function is not specified.
|
|
468
|
+
|
|
469
|
+
ALGORITHM:
|
|
470
|
+
|
|
471
|
+
Solve the equation `\log(x) = self` using the Newton scheme::
|
|
472
|
+
|
|
473
|
+
.. MATH::
|
|
474
|
+
|
|
475
|
+
x_{i+1} = x_i \cdot (1 + self - \log(x_i))
|
|
476
|
+
|
|
477
|
+
The binary complexity of this algorithm is roughly the same
|
|
478
|
+
than that of the computation of the logarithm.
|
|
479
|
+
|
|
480
|
+
EXAMPLES::
|
|
481
|
+
|
|
482
|
+
sage: # needs sage.libs.ntl
|
|
483
|
+
sage: R.<w> = Zq(7^2,5)
|
|
484
|
+
sage: x = R(7*w)
|
|
485
|
+
sage: x.exp(algorithm='newton') # indirect doctest
|
|
486
|
+
1 + w*7 + (4*w + 2)*7^2 + (w + 6)*7^3 + 5*7^4 + O(7^5)
|
|
487
|
+
"""
|
|
488
|
+
cdef unsigned long p
|
|
489
|
+
cdef unsigned long prec = aprec
|
|
490
|
+
cdef pAdicCappedAbsoluteElement ans
|
|
491
|
+
|
|
492
|
+
if mpz_fits_slong_p(self.prime_pow.prime.value) == 0:
|
|
493
|
+
raise NotImplementedError("the prime %s does not fit in a long" % self.prime_pow.prime)
|
|
494
|
+
p = self.prime_pow.prime
|
|
495
|
+
|
|
496
|
+
ans = self._new_c()
|
|
497
|
+
ans.absprec = prec
|
|
498
|
+
mpz_set_ui(ans.value, 1)
|
|
499
|
+
sig_on()
|
|
500
|
+
if p == 2:
|
|
501
|
+
padicexp_Newton(ans.value, self.value, p, prec, 2, self.prime_pow.pow_mpz_t_tmp(prec))
|
|
502
|
+
else:
|
|
503
|
+
padicexp_Newton(ans.value, self.value, p, prec, 1, self.prime_pow.pow_mpz_t_tmp(prec))
|
|
504
|
+
sig_off()
|
|
505
|
+
|
|
506
|
+
return ans
|
|
507
|
+
|
|
508
|
+
|
|
509
|
+
def make_pAdicCappedAbsoluteElement(parent, x, absprec):
|
|
510
|
+
"""
|
|
511
|
+
Unpickles a capped absolute element.
|
|
512
|
+
|
|
513
|
+
EXAMPLES::
|
|
514
|
+
|
|
515
|
+
sage: from sage.rings.padics.padic_capped_absolute_element import make_pAdicCappedAbsoluteElement
|
|
516
|
+
sage: R = ZpCA(5)
|
|
517
|
+
sage: a = make_pAdicCappedAbsoluteElement(R, 17*25, 5); a
|
|
518
|
+
2*5^2 + 3*5^3 + O(5^5)
|
|
519
|
+
"""
|
|
520
|
+
return unpickle_cae_v2(pAdicCappedAbsoluteElement, parent, x, absprec)
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# sage_setup: distribution = sagemath-pari
|
|
2
|
+
from sage.libs.gmp.types cimport mpz_t
|
|
3
|
+
from cypari2.gen cimport Gen as pari_gen
|
|
4
|
+
|
|
5
|
+
ctypedef mpz_t celement
|
|
6
|
+
include "CR_template_header.pxi"
|
|
7
|
+
|
|
8
|
+
cdef class pAdicCappedRelativeElement(CRElement):
|
|
9
|
+
cdef lift_c(self)
|
|
10
|
+
cdef pari_gen _to_gen(self)
|
|
11
|
+
|
|
12
|
+
from sage.rings.padics.pow_computer cimport PowComputer_base
|
|
13
|
+
cdef class PowComputer_(PowComputer_base):
|
|
14
|
+
pass
|