passagemath-singular 10.6.31rc3__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-singular might be problematic. Click here for more details.
- PySingular.cpython-314-x86_64-linux-musl.so +0 -0
- passagemath_singular-10.6.31rc3.dist-info/METADATA +183 -0
- passagemath_singular-10.6.31rc3.dist-info/RECORD +493 -0
- passagemath_singular-10.6.31rc3.dist-info/WHEEL +5 -0
- passagemath_singular-10.6.31rc3.dist-info/top_level.txt +3 -0
- passagemath_singular.libs/libSingular-4-67059f19.4.1.so +0 -0
- passagemath_singular.libs/libcddgmp-30166d29.so.0.1.3 +0 -0
- passagemath_singular.libs/libfactory-4-9d37bcf4.4.1.so +0 -0
- passagemath_singular.libs/libflint-fd6f12fc.so.21.0.0 +0 -0
- passagemath_singular.libs/libgcc_s-0cd532bd.so.1 +0 -0
- passagemath_singular.libs/libgf2x-9e30c3e3.so.3.0.0 +0 -0
- passagemath_singular.libs/libgfortran-2c33b284.so.5.0.0 +0 -0
- passagemath_singular.libs/libgmp-0e7fc84e.so.10.5.0 +0 -0
- passagemath_singular.libs/libgsl-42cda06f.so.28.0.0 +0 -0
- passagemath_singular.libs/libmpfr-aaecbfc0.so.6.2.1 +0 -0
- passagemath_singular.libs/libncursesw-9c9e32c3.so.6.5 +0 -0
- passagemath_singular.libs/libntl-26885ca2.so.44.0.1 +0 -0
- passagemath_singular.libs/libomalloc-0-e9ff96db.9.6.so +0 -0
- passagemath_singular.libs/libopenblasp-r0-905cb27d.3.29.so +0 -0
- passagemath_singular.libs/libpolys-4-8bcf8e7d.4.1.so +0 -0
- passagemath_singular.libs/libquadmath-bb76a5fc.so.0.0.0 +0 -0
- passagemath_singular.libs/libreadline-06542304.so.8.2 +0 -0
- passagemath_singular.libs/libsingular_resources-4-73bf7623.4.1.so +0 -0
- passagemath_singular.libs/libstdc++-5d72f927.so.6.0.33 +0 -0
- sage/algebras/all__sagemath_singular.py +3 -0
- sage/algebras/fusion_rings/all.py +19 -0
- sage/algebras/fusion_rings/f_matrix.py +2448 -0
- sage/algebras/fusion_rings/fast_parallel_fmats_methods.cpython-314-x86_64-linux-musl.so +0 -0
- sage/algebras/fusion_rings/fast_parallel_fmats_methods.pxd +5 -0
- sage/algebras/fusion_rings/fast_parallel_fmats_methods.pyx +538 -0
- sage/algebras/fusion_rings/fast_parallel_fusion_ring_braid_repn.cpython-314-x86_64-linux-musl.so +0 -0
- sage/algebras/fusion_rings/fast_parallel_fusion_ring_braid_repn.pxd +3 -0
- sage/algebras/fusion_rings/fast_parallel_fusion_ring_braid_repn.pyx +331 -0
- sage/algebras/fusion_rings/fusion_double.py +899 -0
- sage/algebras/fusion_rings/fusion_ring.py +1580 -0
- sage/algebras/fusion_rings/poly_tup_engine.cpython-314-x86_64-linux-musl.so +0 -0
- sage/algebras/fusion_rings/poly_tup_engine.pxd +24 -0
- sage/algebras/fusion_rings/poly_tup_engine.pyx +579 -0
- sage/algebras/fusion_rings/shm_managers.cpython-314-x86_64-linux-musl.so +0 -0
- sage/algebras/fusion_rings/shm_managers.pxd +24 -0
- sage/algebras/fusion_rings/shm_managers.pyx +780 -0
- sage/algebras/letterplace/all.py +1 -0
- sage/algebras/letterplace/free_algebra_element_letterplace.cpython-314-x86_64-linux-musl.so +0 -0
- sage/algebras/letterplace/free_algebra_element_letterplace.pxd +18 -0
- sage/algebras/letterplace/free_algebra_element_letterplace.pyx +755 -0
- sage/algebras/letterplace/free_algebra_letterplace.cpython-314-x86_64-linux-musl.so +0 -0
- sage/algebras/letterplace/free_algebra_letterplace.pxd +35 -0
- sage/algebras/letterplace/free_algebra_letterplace.pyx +914 -0
- sage/algebras/letterplace/letterplace_ideal.cpython-314-x86_64-linux-musl.so +0 -0
- sage/algebras/letterplace/letterplace_ideal.pyx +408 -0
- sage/algebras/quatalg/all.py +2 -0
- sage/algebras/quatalg/quaternion_algebra.py +4778 -0
- sage/algebras/quatalg/quaternion_algebra_cython.cpython-314-x86_64-linux-musl.so +0 -0
- sage/algebras/quatalg/quaternion_algebra_cython.pyx +261 -0
- sage/algebras/quatalg/quaternion_algebra_element.cpython-314-x86_64-linux-musl.so +0 -0
- sage/algebras/quatalg/quaternion_algebra_element.pxd +29 -0
- sage/algebras/quatalg/quaternion_algebra_element.pyx +2176 -0
- sage/all__sagemath_singular.py +11 -0
- sage/ext_data/all__sagemath_singular.py +1 -0
- sage/ext_data/singular/function_field/core.lib +98 -0
- sage/interfaces/all__sagemath_singular.py +1 -0
- sage/interfaces/singular.py +2835 -0
- sage/libs/all__sagemath_singular.py +1 -0
- sage/libs/singular/__init__.py +1 -0
- sage/libs/singular/decl.pxd +1168 -0
- sage/libs/singular/function.cpython-314-x86_64-linux-musl.so +0 -0
- sage/libs/singular/function.pxd +87 -0
- sage/libs/singular/function.pyx +1901 -0
- sage/libs/singular/function_factory.py +61 -0
- sage/libs/singular/groebner_strategy.cpython-314-x86_64-linux-musl.so +0 -0
- sage/libs/singular/groebner_strategy.pxd +22 -0
- sage/libs/singular/groebner_strategy.pyx +582 -0
- sage/libs/singular/option.cpython-314-x86_64-linux-musl.so +0 -0
- sage/libs/singular/option.pyx +671 -0
- sage/libs/singular/polynomial.cpython-314-x86_64-linux-musl.so +0 -0
- sage/libs/singular/polynomial.pxd +39 -0
- sage/libs/singular/polynomial.pyx +661 -0
- sage/libs/singular/ring.cpython-314-x86_64-linux-musl.so +0 -0
- sage/libs/singular/ring.pxd +58 -0
- sage/libs/singular/ring.pyx +893 -0
- sage/libs/singular/singular.cpython-314-x86_64-linux-musl.so +0 -0
- sage/libs/singular/singular.pxd +72 -0
- sage/libs/singular/singular.pyx +1944 -0
- sage/libs/singular/standard_options.py +145 -0
- sage/matrix/all__sagemath_singular.py +1 -0
- sage/matrix/matrix_mpolynomial_dense.cpython-314-x86_64-linux-musl.so +0 -0
- sage/matrix/matrix_mpolynomial_dense.pxd +7 -0
- sage/matrix/matrix_mpolynomial_dense.pyx +615 -0
- sage/rings/all__sagemath_singular.py +1 -0
- sage/rings/function_field/all__sagemath_singular.py +1 -0
- sage/rings/function_field/derivations_polymod.py +911 -0
- sage/rings/function_field/element_polymod.cpython-314-x86_64-linux-musl.so +0 -0
- sage/rings/function_field/element_polymod.pyx +406 -0
- sage/rings/function_field/function_field_polymod.py +2611 -0
- sage/rings/function_field/ideal_polymod.py +1775 -0
- sage/rings/function_field/order_polymod.py +1475 -0
- sage/rings/function_field/place_polymod.py +681 -0
- sage/rings/polynomial/all__sagemath_singular.py +1 -0
- sage/rings/polynomial/multi_polynomial_ideal_libsingular.cpython-314-x86_64-linux-musl.so +0 -0
- sage/rings/polynomial/multi_polynomial_ideal_libsingular.pxd +5 -0
- sage/rings/polynomial/multi_polynomial_ideal_libsingular.pyx +339 -0
- sage/rings/polynomial/multi_polynomial_libsingular.cpython-314-x86_64-linux-musl.so +0 -0
- sage/rings/polynomial/multi_polynomial_libsingular.pxd +30 -0
- sage/rings/polynomial/multi_polynomial_libsingular.pyx +6277 -0
- sage/rings/polynomial/plural.cpython-314-x86_64-linux-musl.so +0 -0
- sage/rings/polynomial/plural.pxd +48 -0
- sage/rings/polynomial/plural.pyx +3171 -0
- sage/symbolic/all__sagemath_singular.py +1 -0
- sage/symbolic/comparison_impl.pxi +428 -0
- sage/symbolic/constants_c_impl.pxi +178 -0
- sage/symbolic/expression.cpython-314-x86_64-linux-musl.so +0 -0
- sage/symbolic/expression.pxd +7 -0
- sage/symbolic/expression.pyx +14200 -0
- sage/symbolic/getitem_impl.pxi +202 -0
- sage/symbolic/pynac.pxi +572 -0
- sage/symbolic/pynac_constant_impl.pxi +133 -0
- sage/symbolic/pynac_function_impl.pxi +206 -0
- sage/symbolic/pynac_impl.pxi +2576 -0
- sage/symbolic/pynac_wrap.h +124 -0
- sage/symbolic/series_impl.pxi +272 -0
- sage/symbolic/substitution_map_impl.pxi +94 -0
- sage_wheels/bin/ESingular +0 -0
- sage_wheels/bin/Singular +0 -0
- sage_wheels/bin/TSingular +0 -0
- sage_wheels/lib/singular/MOD/cohomo.la +41 -0
- sage_wheels/lib/singular/MOD/cohomo.so +0 -0
- sage_wheels/lib/singular/MOD/customstd.la +41 -0
- sage_wheels/lib/singular/MOD/customstd.so +0 -0
- sage_wheels/lib/singular/MOD/freealgebra.la +41 -0
- sage_wheels/lib/singular/MOD/freealgebra.so +0 -0
- sage_wheels/lib/singular/MOD/gfanlib.la +41 -0
- sage_wheels/lib/singular/MOD/gfanlib.so +0 -0
- sage_wheels/lib/singular/MOD/gitfan.la +41 -0
- sage_wheels/lib/singular/MOD/gitfan.so +0 -0
- sage_wheels/lib/singular/MOD/interval.la +41 -0
- sage_wheels/lib/singular/MOD/interval.so +0 -0
- sage_wheels/lib/singular/MOD/loctriv.la +41 -0
- sage_wheels/lib/singular/MOD/loctriv.so +0 -0
- sage_wheels/lib/singular/MOD/machinelearning.la +41 -0
- sage_wheels/lib/singular/MOD/machinelearning.so +0 -0
- sage_wheels/lib/singular/MOD/p_Procs_FieldGeneral.la +41 -0
- sage_wheels/lib/singular/MOD/p_Procs_FieldGeneral.so +0 -0
- sage_wheels/lib/singular/MOD/p_Procs_FieldIndep.la +41 -0
- sage_wheels/lib/singular/MOD/p_Procs_FieldIndep.so +0 -0
- sage_wheels/lib/singular/MOD/p_Procs_FieldQ.la +41 -0
- sage_wheels/lib/singular/MOD/p_Procs_FieldQ.so +0 -0
- sage_wheels/lib/singular/MOD/p_Procs_FieldZp.la +41 -0
- sage_wheels/lib/singular/MOD/p_Procs_FieldZp.so +0 -0
- sage_wheels/lib/singular/MOD/partialgb.la +41 -0
- sage_wheels/lib/singular/MOD/partialgb.so +0 -0
- sage_wheels/lib/singular/MOD/pyobject.la +41 -0
- sage_wheels/lib/singular/MOD/pyobject.so +0 -0
- sage_wheels/lib/singular/MOD/singmathic.la +41 -0
- sage_wheels/lib/singular/MOD/singmathic.so +0 -0
- sage_wheels/lib/singular/MOD/sispasm.la +41 -0
- sage_wheels/lib/singular/MOD/sispasm.so +0 -0
- sage_wheels/lib/singular/MOD/subsets.la +41 -0
- sage_wheels/lib/singular/MOD/subsets.so +0 -0
- sage_wheels/lib/singular/MOD/systhreads.la +41 -0
- sage_wheels/lib/singular/MOD/systhreads.so +0 -0
- sage_wheels/lib/singular/MOD/syzextra.la +41 -0
- sage_wheels/lib/singular/MOD/syzextra.so +0 -0
- sage_wheels/libexec/singular/MOD/change_cost +0 -0
- sage_wheels/libexec/singular/MOD/singularsurf +11 -0
- sage_wheels/libexec/singular/MOD/singularsurf_jupyter +9 -0
- sage_wheels/libexec/singular/MOD/singularsurf_win +10 -0
- sage_wheels/libexec/singular/MOD/solve_IP +0 -0
- sage_wheels/libexec/singular/MOD/surfex +16 -0
- sage_wheels/libexec/singular/MOD/toric_ideal +0 -0
- sage_wheels/share/factory/gftables/10201 +342 -0
- sage_wheels/share/factory/gftables/1024 +37 -0
- sage_wheels/share/factory/gftables/10609 +356 -0
- sage_wheels/share/factory/gftables/11449 +384 -0
- sage_wheels/share/factory/gftables/11881 +398 -0
- sage_wheels/share/factory/gftables/121 +6 -0
- sage_wheels/share/factory/gftables/12167 +408 -0
- sage_wheels/share/factory/gftables/125 +7 -0
- sage_wheels/share/factory/gftables/12769 +428 -0
- sage_wheels/share/factory/gftables/128 +7 -0
- sage_wheels/share/factory/gftables/1331 +47 -0
- sage_wheels/share/factory/gftables/1369 +48 -0
- sage_wheels/share/factory/gftables/14641 +490 -0
- sage_wheels/share/factory/gftables/15625 +523 -0
- sage_wheels/share/factory/gftables/16 +3 -0
- sage_wheels/share/factory/gftables/16129 +540 -0
- sage_wheels/share/factory/gftables/16384 +549 -0
- sage_wheels/share/factory/gftables/16807 +563 -0
- sage_wheels/share/factory/gftables/1681 +58 -0
- sage_wheels/share/factory/gftables/169 +8 -0
- sage_wheels/share/factory/gftables/17161 +574 -0
- sage_wheels/share/factory/gftables/1849 +64 -0
- sage_wheels/share/factory/gftables/18769 +628 -0
- sage_wheels/share/factory/gftables/19321 +646 -0
- sage_wheels/share/factory/gftables/19683 +659 -0
- sage_wheels/share/factory/gftables/2048 +71 -0
- sage_wheels/share/factory/gftables/2187 +75 -0
- sage_wheels/share/factory/gftables/2197 +76 -0
- sage_wheels/share/factory/gftables/2209 +76 -0
- sage_wheels/share/factory/gftables/22201 +742 -0
- sage_wheels/share/factory/gftables/22801 +762 -0
- sage_wheels/share/factory/gftables/2401 +82 -0
- sage_wheels/share/factory/gftables/243 +11 -0
- sage_wheels/share/factory/gftables/24389 +815 -0
- sage_wheels/share/factory/gftables/24649 +824 -0
- sage_wheels/share/factory/gftables/25 +3 -0
- sage_wheels/share/factory/gftables/256 +11 -0
- sage_wheels/share/factory/gftables/26569 +888 -0
- sage_wheels/share/factory/gftables/27 +3 -0
- sage_wheels/share/factory/gftables/27889 +932 -0
- sage_wheels/share/factory/gftables/2809 +96 -0
- sage_wheels/share/factory/gftables/28561 +954 -0
- sage_wheels/share/factory/gftables/289 +12 -0
- sage_wheels/share/factory/gftables/29791 +995 -0
- sage_wheels/share/factory/gftables/29929 +1000 -0
- sage_wheels/share/factory/gftables/3125 +107 -0
- sage_wheels/share/factory/gftables/32 +4 -0
- sage_wheels/share/factory/gftables/32041 +1070 -0
- sage_wheels/share/factory/gftables/32761 +1094 -0
- sage_wheels/share/factory/gftables/32768 +1095 -0
- sage_wheels/share/factory/gftables/343 +14 -0
- sage_wheels/share/factory/gftables/3481 +118 -0
- sage_wheels/share/factory/gftables/361 +14 -0
- sage_wheels/share/factory/gftables/36481 +1218 -0
- sage_wheels/share/factory/gftables/3721 +126 -0
- sage_wheels/share/factory/gftables/37249 +1244 -0
- sage_wheels/share/factory/gftables/38809 +1296 -0
- sage_wheels/share/factory/gftables/39601 +1322 -0
- sage_wheels/share/factory/gftables/4 +3 -0
- sage_wheels/share/factory/gftables/4096 +139 -0
- sage_wheels/share/factory/gftables/44521 +1486 -0
- sage_wheels/share/factory/gftables/4489 +152 -0
- sage_wheels/share/factory/gftables/49 +4 -0
- sage_wheels/share/factory/gftables/4913 +166 -0
- sage_wheels/share/factory/gftables/49729 +1660 -0
- sage_wheels/share/factory/gftables/5041 +170 -0
- sage_wheels/share/factory/gftables/50653 +1691 -0
- sage_wheels/share/factory/gftables/512 +20 -0
- sage_wheels/share/factory/gftables/51529 +1720 -0
- sage_wheels/share/factory/gftables/52441 +1750 -0
- sage_wheels/share/factory/gftables/529 +20 -0
- sage_wheels/share/factory/gftables/5329 +180 -0
- sage_wheels/share/factory/gftables/54289 +1812 -0
- sage_wheels/share/factory/gftables/57121 +1906 -0
- sage_wheels/share/factory/gftables/58081 +1938 -0
- sage_wheels/share/factory/gftables/59049 +1971 -0
- sage_wheels/share/factory/gftables/6241 +210 -0
- sage_wheels/share/factory/gftables/625 +23 -0
- sage_wheels/share/factory/gftables/63001 +2102 -0
- sage_wheels/share/factory/gftables/64 +5 -0
- sage_wheels/share/factory/gftables/6561 +221 -0
- sage_wheels/share/factory/gftables/6859 +231 -0
- sage_wheels/share/factory/gftables/6889 +232 -0
- sage_wheels/share/factory/gftables/729 +27 -0
- sage_wheels/share/factory/gftables/7921 +266 -0
- sage_wheels/share/factory/gftables/8 +3 -0
- sage_wheels/share/factory/gftables/81 +5 -0
- sage_wheels/share/factory/gftables/8192 +276 -0
- sage_wheels/share/factory/gftables/841 +30 -0
- sage_wheels/share/factory/gftables/9 +3 -0
- sage_wheels/share/factory/gftables/9409 +316 -0
- sage_wheels/share/factory/gftables/961 +34 -0
- sage_wheels/share/info/singular.info +191898 -0
- sage_wheels/share/singular/LIB/GND.lib +1359 -0
- sage_wheels/share/singular/LIB/JMBTest.lib +976 -0
- sage_wheels/share/singular/LIB/JMSConst.lib +1363 -0
- sage_wheels/share/singular/LIB/KVequiv.lib +699 -0
- sage_wheels/share/singular/LIB/SingularityDBM.lib +491 -0
- sage_wheels/share/singular/LIB/VecField.lib +1542 -0
- sage_wheels/share/singular/LIB/absfact.lib +959 -0
- sage_wheels/share/singular/LIB/ainvar.lib +730 -0
- sage_wheels/share/singular/LIB/aksaka.lib +419 -0
- sage_wheels/share/singular/LIB/alexpoly.lib +2542 -0
- sage_wheels/share/singular/LIB/algebra.lib +1193 -0
- sage_wheels/share/singular/LIB/all.lib +136 -0
- sage_wheels/share/singular/LIB/arcpoint.lib +514 -0
- sage_wheels/share/singular/LIB/arnold.lib +4553 -0
- sage_wheels/share/singular/LIB/arnoldclassify.lib +2058 -0
- sage_wheels/share/singular/LIB/arr.lib +3486 -0
- sage_wheels/share/singular/LIB/assprimeszerodim.lib +755 -0
- sage_wheels/share/singular/LIB/autgradalg.lib +3361 -0
- sage_wheels/share/singular/LIB/bfun.lib +1964 -0
- sage_wheels/share/singular/LIB/bimodules.lib +774 -0
- sage_wheels/share/singular/LIB/brillnoether.lib +226 -0
- sage_wheels/share/singular/LIB/brnoeth.lib +5017 -0
- sage_wheels/share/singular/LIB/central.lib +2169 -0
- sage_wheels/share/singular/LIB/chern.lib +4162 -0
- sage_wheels/share/singular/LIB/cimonom.lib +571 -0
- sage_wheels/share/singular/LIB/cisimplicial.lib +1835 -0
- sage_wheels/share/singular/LIB/classify.lib +3239 -0
- sage_wheels/share/singular/LIB/classify2.lib +1462 -0
- sage_wheels/share/singular/LIB/classifyMapGerms.lib +1515 -0
- sage_wheels/share/singular/LIB/classify_aeq.lib +3253 -0
- sage_wheels/share/singular/LIB/classifyceq.lib +2092 -0
- sage_wheels/share/singular/LIB/classifyci.lib +1133 -0
- sage_wheels/share/singular/LIB/combinat.lib +91 -0
- sage_wheels/share/singular/LIB/compregb.lib +276 -0
- sage_wheels/share/singular/LIB/control.lib +1636 -0
- sage_wheels/share/singular/LIB/crypto.lib +3795 -0
- sage_wheels/share/singular/LIB/curveInv.lib +667 -0
- sage_wheels/share/singular/LIB/curvepar.lib +1817 -0
- sage_wheels/share/singular/LIB/customstd.lib +100 -0
- sage_wheels/share/singular/LIB/deRham.lib +5979 -0
- sage_wheels/share/singular/LIB/decodegb.lib +2134 -0
- sage_wheels/share/singular/LIB/decomp.lib +1655 -0
- sage_wheels/share/singular/LIB/deflation.lib +872 -0
- sage_wheels/share/singular/LIB/deform.lib +925 -0
- sage_wheels/share/singular/LIB/difform.lib +3055 -0
- sage_wheels/share/singular/LIB/divisors.lib +750 -0
- sage_wheels/share/singular/LIB/dmod.lib +5817 -0
- sage_wheels/share/singular/LIB/dmodapp.lib +3269 -0
- sage_wheels/share/singular/LIB/dmodideal.lib +1211 -0
- sage_wheels/share/singular/LIB/dmodloc.lib +2645 -0
- sage_wheels/share/singular/LIB/dmodvar.lib +818 -0
- sage_wheels/share/singular/LIB/dummy.lib +17 -0
- sage_wheels/share/singular/LIB/elim.lib +1009 -0
- sage_wheels/share/singular/LIB/ellipticcovers.lib +548 -0
- sage_wheels/share/singular/LIB/enumpoints.lib +146 -0
- sage_wheels/share/singular/LIB/equising.lib +2127 -0
- sage_wheels/share/singular/LIB/ffmodstd.lib +2384 -0
- sage_wheels/share/singular/LIB/ffsolve.lib +1289 -0
- sage_wheels/share/singular/LIB/findifs.lib +778 -0
- sage_wheels/share/singular/LIB/finitediff.lib +1768 -0
- sage_wheels/share/singular/LIB/finvar.lib +7989 -0
- sage_wheels/share/singular/LIB/fpadim.lib +2429 -0
- sage_wheels/share/singular/LIB/fpalgebras.lib +1666 -0
- sage_wheels/share/singular/LIB/fpaprops.lib +1462 -0
- sage_wheels/share/singular/LIB/freegb.lib +3853 -0
- sage_wheels/share/singular/LIB/general.lib +1350 -0
- sage_wheels/share/singular/LIB/gfan.lib +1768 -0
- sage_wheels/share/singular/LIB/gitfan.lib +3130 -0
- sage_wheels/share/singular/LIB/gkdim.lib +99 -0
- sage_wheels/share/singular/LIB/gmspoly.lib +589 -0
- sage_wheels/share/singular/LIB/gmssing.lib +1739 -0
- sage_wheels/share/singular/LIB/goettsche.lib +909 -0
- sage_wheels/share/singular/LIB/graal.lib +1366 -0
- sage_wheels/share/singular/LIB/gradedModules.lib +2541 -0
- sage_wheels/share/singular/LIB/graphics.lib +360 -0
- sage_wheels/share/singular/LIB/grobcov.lib +7706 -0
- sage_wheels/share/singular/LIB/groups.lib +1123 -0
- sage_wheels/share/singular/LIB/grwalk.lib +507 -0
- sage_wheels/share/singular/LIB/hdepth.lib +194 -0
- sage_wheels/share/singular/LIB/help.cnf +57 -0
- sage_wheels/share/singular/LIB/hess.lib +1946 -0
- sage_wheels/share/singular/LIB/hnoether.lib +4292 -0
- sage_wheels/share/singular/LIB/hodge.lib +400 -0
- sage_wheels/share/singular/LIB/homolog.lib +1965 -0
- sage_wheels/share/singular/LIB/hyperel.lib +975 -0
- sage_wheels/share/singular/LIB/inout.lib +679 -0
- sage_wheels/share/singular/LIB/integralbasis.lib +6224 -0
- sage_wheels/share/singular/LIB/interval.lib +1418 -0
- sage_wheels/share/singular/LIB/intprog.lib +778 -0
- sage_wheels/share/singular/LIB/invar.lib +443 -0
- sage_wheels/share/singular/LIB/involut.lib +980 -0
- sage_wheels/share/singular/LIB/jacobson.lib +1215 -0
- sage_wheels/share/singular/LIB/kskernel.lib +534 -0
- sage_wheels/share/singular/LIB/latex.lib +3146 -0
- sage_wheels/share/singular/LIB/lejeune.lib +651 -0
- sage_wheels/share/singular/LIB/linalg.lib +2040 -0
- sage_wheels/share/singular/LIB/locnormal.lib +212 -0
- sage_wheels/share/singular/LIB/lrcalc.lib +526 -0
- sage_wheels/share/singular/LIB/makedbm.lib +294 -0
- sage_wheels/share/singular/LIB/mathml.lib +813 -0
- sage_wheels/share/singular/LIB/matrix.lib +1372 -0
- sage_wheels/share/singular/LIB/maxlike.lib +1132 -0
- sage_wheels/share/singular/LIB/methods.lib +212 -0
- sage_wheels/share/singular/LIB/moddiq.lib +322 -0
- sage_wheels/share/singular/LIB/modfinduni.lib +181 -0
- sage_wheels/share/singular/LIB/modnormal.lib +218 -0
- sage_wheels/share/singular/LIB/modprimdec.lib +1278 -0
- sage_wheels/share/singular/LIB/modquotient.lib +269 -0
- sage_wheels/share/singular/LIB/modstd.lib +1024 -0
- sage_wheels/share/singular/LIB/modular.lib +545 -0
- sage_wheels/share/singular/LIB/modules.lib +2561 -0
- sage_wheels/share/singular/LIB/modwalk.lib +609 -0
- sage_wheels/share/singular/LIB/mondromy.lib +1016 -0
- sage_wheels/share/singular/LIB/monomialideal.lib +3851 -0
- sage_wheels/share/singular/LIB/mprimdec.lib +2353 -0
- sage_wheels/share/singular/LIB/mregular.lib +1863 -0
- sage_wheels/share/singular/LIB/multigrading.lib +5629 -0
- sage_wheels/share/singular/LIB/ncHilb.lib +777 -0
- sage_wheels/share/singular/LIB/ncModslimgb.lib +791 -0
- sage_wheels/share/singular/LIB/ncalg.lib +16311 -0
- sage_wheels/share/singular/LIB/ncall.lib +31 -0
- sage_wheels/share/singular/LIB/ncdecomp.lib +468 -0
- sage_wheels/share/singular/LIB/ncfactor.lib +13371 -0
- sage_wheels/share/singular/LIB/ncfrac.lib +1023 -0
- sage_wheels/share/singular/LIB/nchilbert.lib +448 -0
- sage_wheels/share/singular/LIB/nchomolog.lib +759 -0
- sage_wheels/share/singular/LIB/ncloc.lib +361 -0
- sage_wheels/share/singular/LIB/ncpreim.lib +795 -0
- sage_wheels/share/singular/LIB/ncrat.lib +2849 -0
- sage_wheels/share/singular/LIB/nctools.lib +1887 -0
- sage_wheels/share/singular/LIB/nets.lib +1456 -0
- sage_wheels/share/singular/LIB/nfmodstd.lib +1000 -0
- sage_wheels/share/singular/LIB/nfmodsyz.lib +732 -0
- sage_wheels/share/singular/LIB/noether.lib +1106 -0
- sage_wheels/share/singular/LIB/normal.lib +8700 -0
- sage_wheels/share/singular/LIB/normaliz.lib +2226 -0
- sage_wheels/share/singular/LIB/ntsolve.lib +362 -0
- sage_wheels/share/singular/LIB/numerAlg.lib +560 -0
- sage_wheels/share/singular/LIB/numerDecom.lib +2261 -0
- sage_wheels/share/singular/LIB/olga.lib +1933 -0
- sage_wheels/share/singular/LIB/orbitparam.lib +351 -0
- sage_wheels/share/singular/LIB/parallel.lib +319 -0
- sage_wheels/share/singular/LIB/paraplanecurves.lib +3110 -0
- sage_wheels/share/singular/LIB/perron.lib +202 -0
- sage_wheels/share/singular/LIB/pfd.lib +2223 -0
- sage_wheels/share/singular/LIB/phindex.lib +642 -0
- sage_wheels/share/singular/LIB/pointid.lib +673 -0
- sage_wheels/share/singular/LIB/polybori.lib +1430 -0
- sage_wheels/share/singular/LIB/polyclass.lib +525 -0
- sage_wheels/share/singular/LIB/polylib.lib +1174 -0
- sage_wheels/share/singular/LIB/polymake.lib +1902 -0
- sage_wheels/share/singular/LIB/presolve.lib +1533 -0
- sage_wheels/share/singular/LIB/primdec.lib +9576 -0
- sage_wheels/share/singular/LIB/primdecint.lib +1782 -0
- sage_wheels/share/singular/LIB/primitiv.lib +401 -0
- sage_wheels/share/singular/LIB/puiseuxexpansions.lib +1631 -0
- sage_wheels/share/singular/LIB/purityfiltration.lib +960 -0
- sage_wheels/share/singular/LIB/qhmoduli.lib +1561 -0
- sage_wheels/share/singular/LIB/qmatrix.lib +293 -0
- sage_wheels/share/singular/LIB/random.lib +455 -0
- sage_wheels/share/singular/LIB/ratgb.lib +489 -0
- sage_wheels/share/singular/LIB/realclassify.lib +5759 -0
- sage_wheels/share/singular/LIB/realizationMatroids.lib +772 -0
- sage_wheels/share/singular/LIB/realrad.lib +1197 -0
- sage_wheels/share/singular/LIB/recover.lib +2628 -0
- sage_wheels/share/singular/LIB/redcgs.lib +3984 -0
- sage_wheels/share/singular/LIB/reesclos.lib +465 -0
- sage_wheels/share/singular/LIB/resbinomial.lib +2802 -0
- sage_wheels/share/singular/LIB/resgraph.lib +789 -0
- sage_wheels/share/singular/LIB/resjung.lib +820 -0
- sage_wheels/share/singular/LIB/resolve.lib +5110 -0
- sage_wheels/share/singular/LIB/resources.lib +170 -0
- sage_wheels/share/singular/LIB/reszeta.lib +5473 -0
- sage_wheels/share/singular/LIB/ring.lib +1328 -0
- sage_wheels/share/singular/LIB/ringgb.lib +343 -0
- sage_wheels/share/singular/LIB/rinvar.lib +1153 -0
- sage_wheels/share/singular/LIB/rootisolation.lib +1481 -0
- sage_wheels/share/singular/LIB/rootsmr.lib +709 -0
- sage_wheels/share/singular/LIB/rootsur.lib +886 -0
- sage_wheels/share/singular/LIB/rstandard.lib +607 -0
- sage_wheels/share/singular/LIB/rwalk.lib +336 -0
- sage_wheels/share/singular/LIB/sagbi.lib +1353 -0
- sage_wheels/share/singular/LIB/sagbiNormaliz.lib +1622 -0
- sage_wheels/share/singular/LIB/sagbiNormaliz0.lib +1498 -0
- sage_wheels/share/singular/LIB/sagbigrob.lib +449 -0
- sage_wheels/share/singular/LIB/schreyer.lib +321 -0
- sage_wheels/share/singular/LIB/schubert.lib +2551 -0
- sage_wheels/share/singular/LIB/sets.lib +524 -0
- sage_wheels/share/singular/LIB/sheafcoh.lib +1663 -0
- sage_wheels/share/singular/LIB/signcond.lib +437 -0
- sage_wheels/share/singular/LIB/sing.lib +1094 -0
- sage_wheels/share/singular/LIB/sing4ti2.lib +419 -0
- sage_wheels/share/singular/LIB/solve.lib +2243 -0
- sage_wheels/share/singular/LIB/spcurve.lib +1077 -0
- sage_wheels/share/singular/LIB/spectrum.lib +62 -0
- sage_wheels/share/singular/LIB/sresext.lib +757 -0
- sage_wheels/share/singular/LIB/ssi.lib +143 -0
- sage_wheels/share/singular/LIB/standard.lib +2769 -0
- sage_wheels/share/singular/LIB/stanleyreisner.lib +473 -0
- sage_wheels/share/singular/LIB/stdmodule.lib +547 -0
- sage_wheels/share/singular/LIB/stratify.lib +1070 -0
- sage_wheels/share/singular/LIB/surf.lib +506 -0
- sage_wheels/share/singular/LIB/surf_jupyter.lib +223 -0
- sage_wheels/share/singular/LIB/surfacesignature.lib +522 -0
- sage_wheels/share/singular/LIB/surfex.lib +1462 -0
- sage_wheels/share/singular/LIB/swalk.lib +877 -0
- sage_wheels/share/singular/LIB/symodstd.lib +1570 -0
- sage_wheels/share/singular/LIB/systhreads.lib +74 -0
- sage_wheels/share/singular/LIB/tasks.lib +1324 -0
- sage_wheels/share/singular/LIB/tateProdCplxNegGrad.lib +2412 -0
- sage_wheels/share/singular/LIB/teachstd.lib +858 -0
- sage_wheels/share/singular/LIB/template.lib +116 -0
- sage_wheels/share/singular/LIB/toric.lib +1119 -0
- sage_wheels/share/singular/LIB/transformation.lib +116 -0
- sage_wheels/share/singular/LIB/triang.lib +1197 -0
- sage_wheels/share/singular/LIB/tropical.lib +8741 -0
- sage_wheels/share/singular/LIB/tropicalEllipticCovers.lib +2922 -0
- sage_wheels/share/singular/LIB/tropicalNewton.lib +1128 -0
- sage_wheels/share/singular/LIB/tst.lib +1108 -0
- sage_wheels/share/singular/LIB/weierstr.lib +241 -0
- sage_wheels/share/singular/LIB/zeroset.lib +1478 -0
- sage_wheels/share/singular/emacs/.emacs-general +184 -0
- sage_wheels/share/singular/emacs/.emacs-singular +234 -0
- sage_wheels/share/singular/emacs/COPYING +44 -0
- sage_wheels/share/singular/emacs/cmd-cmpl.el +241 -0
- sage_wheels/share/singular/emacs/ex-cmpl.el +1681 -0
- sage_wheels/share/singular/emacs/hlp-cmpl.el +4318 -0
- sage_wheels/share/singular/emacs/lib-cmpl.el +179 -0
- sage_wheels/share/singular/emacs/singular.el +4273 -0
- sage_wheels/share/singular/emacs/singular.xpm +39 -0
- sage_wheels/share/singular/singular.idx +5002 -0
|
@@ -0,0 +1,755 @@
|
|
|
1
|
+
# sage_setup: distribution = sagemath-singular
|
|
2
|
+
"""
|
|
3
|
+
Weighted homogeneous elements of free algebras, in letterplace implementation
|
|
4
|
+
|
|
5
|
+
AUTHOR:
|
|
6
|
+
|
|
7
|
+
- Simon King (2011-03-23): Github issue :issue:`7797`
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
# ****************************************************************************
|
|
11
|
+
# Copyright (C) 2011 Simon King <simon.king@uni-jena.de>
|
|
12
|
+
#
|
|
13
|
+
# This program is free software: you can redistribute it and/or modify
|
|
14
|
+
# it under the terms of the GNU General Public License as published by
|
|
15
|
+
# the Free Software Foundation, either version 2 of the License, or
|
|
16
|
+
# (at your option) any later version.
|
|
17
|
+
# https://www.gnu.org/licenses/
|
|
18
|
+
# ****************************************************************************
|
|
19
|
+
|
|
20
|
+
from sage.groups.perm_gps.permgroup_named import CyclicPermutationGroup
|
|
21
|
+
from sage.libs.singular.function import lib
|
|
22
|
+
from sage.rings.polynomial.multi_polynomial_ideal import MPolynomialIdeal
|
|
23
|
+
from cpython.object cimport PyObject_RichCompare
|
|
24
|
+
|
|
25
|
+
# Define some singular functions
|
|
26
|
+
lib("freegb.lib")
|
|
27
|
+
|
|
28
|
+
#####################
|
|
29
|
+
# Free algebra elements
|
|
30
|
+
cdef class FreeAlgebraElement_letterplace(AlgebraElement):
|
|
31
|
+
"""
|
|
32
|
+
Weighted homogeneous elements of a free associative unital algebra
|
|
33
|
+
(letterplace implementation).
|
|
34
|
+
|
|
35
|
+
EXAMPLES::
|
|
36
|
+
|
|
37
|
+
sage: F.<x,y,z> = FreeAlgebra(QQ, implementation='letterplace')
|
|
38
|
+
sage: x+y
|
|
39
|
+
x + y
|
|
40
|
+
sage: x*y !=y*x
|
|
41
|
+
True
|
|
42
|
+
sage: I = F*[x*y+y*z,x^2+x*y-y*x-y^2]*F
|
|
43
|
+
sage: (y^3).reduce(I)
|
|
44
|
+
y*y*y
|
|
45
|
+
sage: (y^3).normal_form(I)
|
|
46
|
+
y*y*z - y*z*y + y*z*z
|
|
47
|
+
|
|
48
|
+
Here is an example with nontrivial degree weights::
|
|
49
|
+
|
|
50
|
+
sage: F.<x,y,z> = FreeAlgebra(QQ, implementation='letterplace', degrees=[2,1,3])
|
|
51
|
+
sage: I = F*[x*y-y*x, x^2+2*y*z, (x*y)^2-z^2]*F
|
|
52
|
+
sage: x.degree()
|
|
53
|
+
2
|
|
54
|
+
sage: y.degree()
|
|
55
|
+
1
|
|
56
|
+
sage: z.degree()
|
|
57
|
+
3
|
|
58
|
+
sage: (x*y)^3
|
|
59
|
+
x*y*x*y*x*y
|
|
60
|
+
sage: ((x*y)^3).normal_form(I)
|
|
61
|
+
z*z*y*x
|
|
62
|
+
sage: ((x*y)^3).degree()
|
|
63
|
+
9
|
|
64
|
+
"""
|
|
65
|
+
def __init__(self, A, x, check=True):
|
|
66
|
+
"""
|
|
67
|
+
INPUT:
|
|
68
|
+
|
|
69
|
+
- ``A`` - a free associative unital algebra in letterplace implementation
|
|
70
|
+
- ``x`` -- a homogeneous polynomial that can be coerced into the currently
|
|
71
|
+
used polynomial ring of `A`
|
|
72
|
+
- ``check`` -- boolean (default: ``True``); do not attempt the
|
|
73
|
+
above coercion (for internal use only)
|
|
74
|
+
|
|
75
|
+
TESTS::
|
|
76
|
+
|
|
77
|
+
sage: from sage.algebras.letterplace.free_algebra_element_letterplace import FreeAlgebraElement_letterplace
|
|
78
|
+
sage: F.<x,y,z> = FreeAlgebra(GF(3), implementation='letterplace')
|
|
79
|
+
sage: F.set_degbound(2)
|
|
80
|
+
sage: P = F.current_ring()
|
|
81
|
+
sage: F.set_degbound(4)
|
|
82
|
+
sage: P == F.current_ring()
|
|
83
|
+
False
|
|
84
|
+
sage: p = FreeAlgebraElement_letterplace(F,P.1*P.3+2*P.0*P.4); p
|
|
85
|
+
-x*y + y*x
|
|
86
|
+
sage: loads(dumps(p)) == p
|
|
87
|
+
True
|
|
88
|
+
"""
|
|
89
|
+
cdef FreeAlgebra_letterplace P = A
|
|
90
|
+
if check:
|
|
91
|
+
if not x.is_homogeneous():
|
|
92
|
+
raise ValueError("free algebras based on Letterplace can currently only work with weighted homogeneous elements")
|
|
93
|
+
P.set_degbound(x.degree())
|
|
94
|
+
x = P._current_ring(x)
|
|
95
|
+
AlgebraElement.__init__(self, P)
|
|
96
|
+
self._poly = x
|
|
97
|
+
|
|
98
|
+
def __reduce__(self):
|
|
99
|
+
"""
|
|
100
|
+
Pickling.
|
|
101
|
+
|
|
102
|
+
TESTS::
|
|
103
|
+
|
|
104
|
+
sage: F.<x,y,z> = FreeAlgebra(QQ, implementation='letterplace')
|
|
105
|
+
sage: loads(dumps(x*y*x)) == x*y*x # indirect doctest
|
|
106
|
+
True
|
|
107
|
+
"""
|
|
108
|
+
return self.__class__, (self._parent, self._poly)
|
|
109
|
+
|
|
110
|
+
def __copy__(self):
|
|
111
|
+
"""
|
|
112
|
+
TESTS::
|
|
113
|
+
|
|
114
|
+
sage: F.<x,y,z> = FreeAlgebra(QQ, implementation='letterplace')
|
|
115
|
+
sage: copy(x*y*z+z*y*x) == x*y*z+z*y*x # indirect doctest
|
|
116
|
+
True
|
|
117
|
+
"""
|
|
118
|
+
self._poly = (<FreeAlgebra_letterplace>self._parent)._current_ring(self._poly)
|
|
119
|
+
return self.__class__(self._parent, self._poly, check=False)
|
|
120
|
+
|
|
121
|
+
def __hash__(self):
|
|
122
|
+
"""
|
|
123
|
+
TESTS::
|
|
124
|
+
|
|
125
|
+
sage: F.<x,y,z> = FreeAlgebra(QQ, implementation='letterplace')
|
|
126
|
+
sage: set([x*y*z, z*y+x*z,x*y*z]) # indirect doctest
|
|
127
|
+
{x*z + z*y, x*y*z}
|
|
128
|
+
"""
|
|
129
|
+
return hash(self._poly)
|
|
130
|
+
|
|
131
|
+
def __iter__(self):
|
|
132
|
+
"""
|
|
133
|
+
Iterate over the pairs "tuple of exponents, coefficient".
|
|
134
|
+
|
|
135
|
+
EXAMPLES::
|
|
136
|
+
|
|
137
|
+
sage: F.<w,x,y,z> = FreeAlgebra(GF(3), implementation='letterplace')
|
|
138
|
+
sage: p = x*y-z^2
|
|
139
|
+
sage: sorted(p) # indirect doctest
|
|
140
|
+
[((0, 0, 0, 1, 0, 0, 0, 1), 2), ((0, 1, 0, 0, 0, 0, 1, 0), 1)]
|
|
141
|
+
"""
|
|
142
|
+
cdef dict d = self._poly.monomial_coefficients()
|
|
143
|
+
yield from d.items()
|
|
144
|
+
|
|
145
|
+
def _repr_(self):
|
|
146
|
+
"""
|
|
147
|
+
TESTS::
|
|
148
|
+
|
|
149
|
+
sage: K.<z> = GF(25)
|
|
150
|
+
sage: F.<a,b,c> = FreeAlgebra(K, implementation='letterplace')
|
|
151
|
+
sage: -(a+b*(z+1)-c)^2 # indirect doctest
|
|
152
|
+
-a*a + (4*z + 4)*a*b + a*c + (4*z + 4)*b*a + (2*z + 1)*b*b + (z + 1)*b*c + c*a + (z + 1)*c*b - c*c
|
|
153
|
+
|
|
154
|
+
It is possible to change the names temporarily::
|
|
155
|
+
|
|
156
|
+
sage: from sage.structure.parent_gens import localvars
|
|
157
|
+
sage: with localvars(F, ['w', 'x','y']):
|
|
158
|
+
....: print(a+b*(z+1)-c)
|
|
159
|
+
w + (z + 1)*x - y
|
|
160
|
+
sage: print(a+b*(z+1)-c)
|
|
161
|
+
a + (z + 1)*b - c
|
|
162
|
+
"""
|
|
163
|
+
cdef list L = []
|
|
164
|
+
cdef FreeAlgebra_letterplace P = self._parent
|
|
165
|
+
if P._base._repr_option('element_is_atomic'):
|
|
166
|
+
for E, c in zip(self._poly.exponents(), self._poly.coefficients()):
|
|
167
|
+
monstr = P.exponents_to_string(E)
|
|
168
|
+
if monstr:
|
|
169
|
+
if c == 1:
|
|
170
|
+
if L:
|
|
171
|
+
L.extend(['+', monstr])
|
|
172
|
+
else:
|
|
173
|
+
L.append(monstr)
|
|
174
|
+
elif c == -1:
|
|
175
|
+
if L:
|
|
176
|
+
L.extend(['-', monstr])
|
|
177
|
+
else:
|
|
178
|
+
L.append('-' + monstr)
|
|
179
|
+
else:
|
|
180
|
+
if L:
|
|
181
|
+
if c >= 0:
|
|
182
|
+
L.extend(['+', repr(c) + '*' + monstr])
|
|
183
|
+
else:
|
|
184
|
+
L.extend(['-', repr(-c) + '*' + monstr])
|
|
185
|
+
else:
|
|
186
|
+
L.append(repr(c) + '*' + monstr)
|
|
187
|
+
else:
|
|
188
|
+
if c >= 0:
|
|
189
|
+
if L:
|
|
190
|
+
L.extend(['+', repr(c)])
|
|
191
|
+
else:
|
|
192
|
+
L.append(repr(c))
|
|
193
|
+
else:
|
|
194
|
+
if L:
|
|
195
|
+
L.extend(['-', repr(-c)])
|
|
196
|
+
else:
|
|
197
|
+
L.append(repr(c))
|
|
198
|
+
else:
|
|
199
|
+
for E, c in zip(self._poly.exponents(), self._poly.coefficients()):
|
|
200
|
+
monstr = P.exponents_to_string(E)
|
|
201
|
+
if monstr:
|
|
202
|
+
if c == 1:
|
|
203
|
+
if L:
|
|
204
|
+
L.extend(['+', monstr])
|
|
205
|
+
else:
|
|
206
|
+
L.append(monstr)
|
|
207
|
+
elif c == -1:
|
|
208
|
+
if L:
|
|
209
|
+
L.extend(['-', monstr])
|
|
210
|
+
else:
|
|
211
|
+
L.append('-' + monstr)
|
|
212
|
+
else:
|
|
213
|
+
if L:
|
|
214
|
+
L.extend(['+', '(' + repr(c) + ')*' + monstr])
|
|
215
|
+
else:
|
|
216
|
+
L.append('(' + repr(c) + ')*' + monstr)
|
|
217
|
+
else:
|
|
218
|
+
if L:
|
|
219
|
+
L.extend(['+', repr(c)])
|
|
220
|
+
else:
|
|
221
|
+
L.append(repr(c))
|
|
222
|
+
if L:
|
|
223
|
+
return ' '.join(L)
|
|
224
|
+
return '0'
|
|
225
|
+
|
|
226
|
+
def _latex_(self):
|
|
227
|
+
r"""
|
|
228
|
+
TESTS::
|
|
229
|
+
|
|
230
|
+
sage: K.<z> = GF(25)
|
|
231
|
+
sage: F.<a,b,c> = FreeAlgebra(K, implementation='letterplace', degrees=[1,2,3])
|
|
232
|
+
sage: -(a*b*(z+1)-c)^2
|
|
233
|
+
(2*z + 1)*a*b*a*b + (z + 1)*a*b*c + (z + 1)*c*a*b - c*c
|
|
234
|
+
sage: latex(-(a*b*(z+1)-c)^2) # indirect doctest
|
|
235
|
+
\left(2 z + 1\right) a b a b + \left(z + 1\right) a b c + \left(z + 1\right) c a b - c c
|
|
236
|
+
"""
|
|
237
|
+
cdef list L = []
|
|
238
|
+
cdef FreeAlgebra_letterplace P = self._parent
|
|
239
|
+
from sage.misc.latex import latex
|
|
240
|
+
if P._base._repr_option('element_is_atomic'):
|
|
241
|
+
for E, c in zip(self._poly.exponents(), self._poly.coefficients()):
|
|
242
|
+
monstr = P.exponents_to_latex(E)
|
|
243
|
+
if monstr:
|
|
244
|
+
if c == 1:
|
|
245
|
+
if L:
|
|
246
|
+
L.extend(['+', monstr])
|
|
247
|
+
else:
|
|
248
|
+
L.append(monstr)
|
|
249
|
+
elif c == -1:
|
|
250
|
+
if L:
|
|
251
|
+
L.extend(['-', monstr])
|
|
252
|
+
else:
|
|
253
|
+
L.append('-' + monstr)
|
|
254
|
+
else:
|
|
255
|
+
if L:
|
|
256
|
+
if c >= 0:
|
|
257
|
+
L.extend(['+', repr(latex(c)) + ' ' + monstr])
|
|
258
|
+
else:
|
|
259
|
+
L.extend(['-', repr(latex(-c)) + ' ' + monstr])
|
|
260
|
+
else:
|
|
261
|
+
L.append(repr(latex(c)) + ' ' + monstr)
|
|
262
|
+
else:
|
|
263
|
+
if c >= 0:
|
|
264
|
+
if L:
|
|
265
|
+
L.extend(['+', repr(latex(c))])
|
|
266
|
+
else:
|
|
267
|
+
L.append(repr(latex(c)))
|
|
268
|
+
else:
|
|
269
|
+
if L:
|
|
270
|
+
L.extend(['-', repr(latex(-c))])
|
|
271
|
+
else:
|
|
272
|
+
L.append(repr(c))
|
|
273
|
+
else:
|
|
274
|
+
for E, c in zip(self._poly.exponents(), self._poly.coefficients()):
|
|
275
|
+
monstr = P.exponents_to_latex(E)
|
|
276
|
+
if monstr:
|
|
277
|
+
if c == 1:
|
|
278
|
+
if L:
|
|
279
|
+
L.extend(['+', monstr])
|
|
280
|
+
else:
|
|
281
|
+
L.append(monstr)
|
|
282
|
+
elif c == -1:
|
|
283
|
+
if L:
|
|
284
|
+
L.extend(['-', monstr])
|
|
285
|
+
else:
|
|
286
|
+
L.append('-' + monstr)
|
|
287
|
+
else:
|
|
288
|
+
if L:
|
|
289
|
+
L.extend(['+', '\\left(' + repr(latex(c)) + '\\right) ' + monstr])
|
|
290
|
+
else:
|
|
291
|
+
L.append('\\left(' + repr(latex(c)) + '\\right) ' + monstr)
|
|
292
|
+
else:
|
|
293
|
+
if L:
|
|
294
|
+
L.extend(['+', repr(latex(c))])
|
|
295
|
+
else:
|
|
296
|
+
L.append(repr(latex(c)))
|
|
297
|
+
if L:
|
|
298
|
+
return ' '.join(L)
|
|
299
|
+
return '0'
|
|
300
|
+
|
|
301
|
+
def degree(self):
|
|
302
|
+
"""
|
|
303
|
+
Return the degree of this element.
|
|
304
|
+
|
|
305
|
+
.. NOTE::
|
|
306
|
+
|
|
307
|
+
Generators may have a positive integral degree weight. All
|
|
308
|
+
elements must be weighted homogeneous.
|
|
309
|
+
|
|
310
|
+
EXAMPLES::
|
|
311
|
+
|
|
312
|
+
sage: F.<x,y,z> = FreeAlgebra(QQ, implementation='letterplace')
|
|
313
|
+
sage: ((x+y+z)^3).degree()
|
|
314
|
+
3
|
|
315
|
+
sage: F.<x,y,z> = FreeAlgebra(QQ, implementation='letterplace', degrees=[2,1,3])
|
|
316
|
+
sage: ((x*y+z)^3).degree()
|
|
317
|
+
9
|
|
318
|
+
"""
|
|
319
|
+
return self._poly.degree()
|
|
320
|
+
|
|
321
|
+
def letterplace_polynomial(self):
|
|
322
|
+
"""
|
|
323
|
+
Return the commutative polynomial that is used internally to represent this free algebra element.
|
|
324
|
+
|
|
325
|
+
EXAMPLES::
|
|
326
|
+
|
|
327
|
+
sage: F.<x,y,z> = FreeAlgebra(QQ, implementation='letterplace')
|
|
328
|
+
sage: ((x+y-z)^2).letterplace_polynomial()
|
|
329
|
+
x*x_1 + x*y_1 - x*z_1 + y*x_1 + y*y_1 - y*z_1 - z*x_1 - z*y_1 + z*z_1
|
|
330
|
+
|
|
331
|
+
If degree weights are used, the letterplace polynomial is
|
|
332
|
+
homogenized by slack variables::
|
|
333
|
+
|
|
334
|
+
sage: F.<x,y,z> = FreeAlgebra(QQ, implementation='letterplace', degrees=[2,1,3])
|
|
335
|
+
sage: ((x*y+z)^2).letterplace_polynomial()
|
|
336
|
+
x*x__1*y_2*x_3*x__4*y_5 + x*x__1*y_2*z_3*x__4*x__5 + z*x__1*x__2*x_3*x__4*y_5 + z*x__1*x__2*z_3*x__4*x__5
|
|
337
|
+
"""
|
|
338
|
+
return self._poly
|
|
339
|
+
|
|
340
|
+
def lm(self):
|
|
341
|
+
"""
|
|
342
|
+
The leading monomial of this free algebra element.
|
|
343
|
+
|
|
344
|
+
EXAMPLES::
|
|
345
|
+
|
|
346
|
+
sage: F.<x,y,z> = FreeAlgebra(QQ, implementation='letterplace')
|
|
347
|
+
sage: ((2*x+3*y-4*z)^2*(5*y+6*z)).lm()
|
|
348
|
+
x*x*y
|
|
349
|
+
sage: F.<x,y,z> = FreeAlgebra(QQ, implementation='letterplace', degrees=[2,1,3])
|
|
350
|
+
sage: ((2*x*y+z)^2).lm()
|
|
351
|
+
x*y*x*y
|
|
352
|
+
"""
|
|
353
|
+
return FreeAlgebraElement_letterplace(self._parent, self._poly.lm())
|
|
354
|
+
|
|
355
|
+
def lt(self):
|
|
356
|
+
"""
|
|
357
|
+
The leading term (monomial times coefficient) of this free algebra
|
|
358
|
+
element.
|
|
359
|
+
|
|
360
|
+
EXAMPLES::
|
|
361
|
+
|
|
362
|
+
sage: F.<x,y,z> = FreeAlgebra(QQ, implementation='letterplace')
|
|
363
|
+
sage: ((2*x+3*y-4*z)^2*(5*y+6*z)).lt()
|
|
364
|
+
20*x*x*y
|
|
365
|
+
sage: F.<x,y,z> = FreeAlgebra(QQ, implementation='letterplace', degrees=[2,1,3])
|
|
366
|
+
sage: ((2*x*y+z)^2).lt()
|
|
367
|
+
4*x*y*x*y
|
|
368
|
+
"""
|
|
369
|
+
return FreeAlgebraElement_letterplace(self._parent, self._poly.lt())
|
|
370
|
+
|
|
371
|
+
def lc(self):
|
|
372
|
+
"""
|
|
373
|
+
The leading coefficient of this free algebra element, as element
|
|
374
|
+
of the base ring.
|
|
375
|
+
|
|
376
|
+
EXAMPLES::
|
|
377
|
+
|
|
378
|
+
sage: F.<x,y,z> = FreeAlgebra(QQ, implementation='letterplace')
|
|
379
|
+
sage: ((2*x+3*y-4*z)^2*(5*y+6*z)).lc()
|
|
380
|
+
20
|
|
381
|
+
sage: ((2*x+3*y-4*z)^2*(5*y+6*z)).lc().parent() is F.base()
|
|
382
|
+
True
|
|
383
|
+
sage: F.<x,y,z> = FreeAlgebra(QQ, implementation='letterplace', degrees=[2,1,3])
|
|
384
|
+
sage: ((2*x*y+z)^2).lc()
|
|
385
|
+
4
|
|
386
|
+
"""
|
|
387
|
+
return self._poly.lc()
|
|
388
|
+
|
|
389
|
+
def __bool__(self):
|
|
390
|
+
"""
|
|
391
|
+
TESTS::
|
|
392
|
+
|
|
393
|
+
sage: F.<x,y,z> = FreeAlgebra(QQ, implementation='letterplace')
|
|
394
|
+
sage: bool(x) # indirect doctest
|
|
395
|
+
True
|
|
396
|
+
sage: bool(F.zero())
|
|
397
|
+
False
|
|
398
|
+
"""
|
|
399
|
+
return bool(self._poly)
|
|
400
|
+
|
|
401
|
+
def lm_divides(self, FreeAlgebraElement_letterplace p):
|
|
402
|
+
"""
|
|
403
|
+
Tell whether or not the leading monomial of ``self`` divides the
|
|
404
|
+
leading monomial of another element.
|
|
405
|
+
|
|
406
|
+
.. NOTE::
|
|
407
|
+
|
|
408
|
+
A free algebra element `p` divides another one `q` if there are
|
|
409
|
+
free algebra elements `s` and `t` such that `spt = q`.
|
|
410
|
+
|
|
411
|
+
EXAMPLES::
|
|
412
|
+
|
|
413
|
+
sage: F.<x,y,z> = FreeAlgebra(QQ, implementation='letterplace', degrees=[2,1,3])
|
|
414
|
+
sage: ((2*x*y+z)^2*z).lm()
|
|
415
|
+
x*y*x*y*z
|
|
416
|
+
sage: (y*x*y-y^4).lm()
|
|
417
|
+
y*x*y
|
|
418
|
+
sage: (y*x*y-y^4).lm_divides((2*x*y+z)^2*z)
|
|
419
|
+
True
|
|
420
|
+
"""
|
|
421
|
+
if self._parent is not p._parent:
|
|
422
|
+
raise TypeError("the two arguments must be elements in the same free algebra")
|
|
423
|
+
cdef FreeAlgebra_letterplace A = self._parent
|
|
424
|
+
P = A._current_ring
|
|
425
|
+
p_poly = p._poly = P(p._poly)
|
|
426
|
+
s_poly = self._poly = P(self._poly)
|
|
427
|
+
cdef int p_d = p_poly.degree()
|
|
428
|
+
cdef int s_d = s_poly.degree()
|
|
429
|
+
if s_d > p_d:
|
|
430
|
+
return False
|
|
431
|
+
cdef int i
|
|
432
|
+
if P.monomial_divides(s_poly, p_poly):
|
|
433
|
+
return True
|
|
434
|
+
realngens = A._commutative_ring.ngens()
|
|
435
|
+
CG = CyclicPermutationGroup(P.ngens())
|
|
436
|
+
for i in range(p_d - s_d):
|
|
437
|
+
s_poly = s_poly * CG[realngens]
|
|
438
|
+
if P.monomial_divides(s_poly, p_poly):
|
|
439
|
+
return True
|
|
440
|
+
return False
|
|
441
|
+
|
|
442
|
+
cpdef _richcmp_(self, other, int op):
|
|
443
|
+
"""
|
|
444
|
+
Implement comparisons, using the Cython richcmp convention.
|
|
445
|
+
|
|
446
|
+
TESTS::
|
|
447
|
+
|
|
448
|
+
sage: F.<x,y,z> = FreeAlgebra(QQ, implementation='letterplace')
|
|
449
|
+
sage: p = ((2*x+3*y-4*z)^2*(5*y+6*z))
|
|
450
|
+
sage: p - p.lt() < p # indirect doctest
|
|
451
|
+
True
|
|
452
|
+
"""
|
|
453
|
+
left = (<FreeAlgebraElement_letterplace>self)._poly
|
|
454
|
+
right = (<FreeAlgebraElement_letterplace>other)._poly
|
|
455
|
+
return PyObject_RichCompare(left, right, op)
|
|
456
|
+
|
|
457
|
+
################################
|
|
458
|
+
# Arithmetic
|
|
459
|
+
cpdef _neg_(self):
|
|
460
|
+
"""
|
|
461
|
+
TESTS::
|
|
462
|
+
|
|
463
|
+
sage: K.<z> = GF(25)
|
|
464
|
+
sage: F.<a,b,c> = FreeAlgebra(K, implementation='letterplace')
|
|
465
|
+
sage: -((z+2)*a^2*b+3*c^3) # indirect doctest
|
|
466
|
+
(4*z + 3)*a*a*b + (2)*c*c*c
|
|
467
|
+
sage: F.<x,y,z> = FreeAlgebra(QQ, implementation='letterplace')
|
|
468
|
+
sage: -(3*x*y+2*z^2)
|
|
469
|
+
-3*x*y - 2*z*z
|
|
470
|
+
"""
|
|
471
|
+
return FreeAlgebraElement_letterplace(self._parent, -self._poly,
|
|
472
|
+
check=False)
|
|
473
|
+
|
|
474
|
+
cpdef _add_(self, other):
|
|
475
|
+
"""
|
|
476
|
+
Addition, under the side condition that either one summand
|
|
477
|
+
is zero, or both summands have the same degree.
|
|
478
|
+
|
|
479
|
+
TESTS::
|
|
480
|
+
|
|
481
|
+
sage: F.<x,y,z> = FreeAlgebra(QQ, implementation='letterplace')
|
|
482
|
+
sage: x+y # indirect doctest
|
|
483
|
+
x + y
|
|
484
|
+
sage: x+1
|
|
485
|
+
Traceback (most recent call last):
|
|
486
|
+
...
|
|
487
|
+
ArithmeticError: can only add elements of the same weighted degree
|
|
488
|
+
sage: x+0
|
|
489
|
+
x
|
|
490
|
+
sage: 0+x
|
|
491
|
+
x
|
|
492
|
+
"""
|
|
493
|
+
if not other:
|
|
494
|
+
return self
|
|
495
|
+
if not self:
|
|
496
|
+
return other
|
|
497
|
+
cdef FreeAlgebraElement_letterplace right = other
|
|
498
|
+
if right._poly.degree() != self._poly.degree():
|
|
499
|
+
raise ArithmeticError("can only add elements of the same weighted degree")
|
|
500
|
+
# update the polynomials
|
|
501
|
+
cdef FreeAlgebra_letterplace A = self._parent
|
|
502
|
+
self._poly = A._current_ring(self._poly)
|
|
503
|
+
right._poly = A._current_ring(right._poly)
|
|
504
|
+
return FreeAlgebraElement_letterplace(self._parent,
|
|
505
|
+
self._poly + right._poly,
|
|
506
|
+
check=False)
|
|
507
|
+
|
|
508
|
+
cpdef _sub_(self, other):
|
|
509
|
+
"""
|
|
510
|
+
Difference, under the side condition that either one summand
|
|
511
|
+
is zero or both have the same weighted degree.
|
|
512
|
+
|
|
513
|
+
TESTS::
|
|
514
|
+
|
|
515
|
+
sage: F.<x,y,z> = FreeAlgebra(QQ, implementation='letterplace')
|
|
516
|
+
sage: x*y-y*x # indirect doctest
|
|
517
|
+
x*y - y*x
|
|
518
|
+
sage: x-1
|
|
519
|
+
Traceback (most recent call last):
|
|
520
|
+
...
|
|
521
|
+
ArithmeticError: can only subtract elements of the same degree
|
|
522
|
+
sage: x-0
|
|
523
|
+
x
|
|
524
|
+
sage: 0-x
|
|
525
|
+
-x
|
|
526
|
+
|
|
527
|
+
Here is an example with non-trivial degree weights::
|
|
528
|
+
|
|
529
|
+
sage: F.<x,y,z> = FreeAlgebra(QQ, implementation='letterplace', degrees=[2,1,3])
|
|
530
|
+
sage: x*y+z
|
|
531
|
+
x*y + z
|
|
532
|
+
"""
|
|
533
|
+
if not other:
|
|
534
|
+
return self
|
|
535
|
+
if not self:
|
|
536
|
+
return -other
|
|
537
|
+
cdef FreeAlgebraElement_letterplace right = other
|
|
538
|
+
if right._poly.degree() != self._poly.degree():
|
|
539
|
+
raise ArithmeticError("can only subtract elements of the same degree")
|
|
540
|
+
# update the polynomials
|
|
541
|
+
cdef FreeAlgebra_letterplace A = self._parent
|
|
542
|
+
self._poly = A._current_ring(self._poly)
|
|
543
|
+
right._poly = A._current_ring(right._poly)
|
|
544
|
+
return FreeAlgebraElement_letterplace(self._parent,
|
|
545
|
+
self._poly - right._poly,
|
|
546
|
+
check=False)
|
|
547
|
+
|
|
548
|
+
cpdef _lmul_(self, Element right):
|
|
549
|
+
"""
|
|
550
|
+
Multiplication from the right with an element of the base ring.
|
|
551
|
+
|
|
552
|
+
TESTS::
|
|
553
|
+
|
|
554
|
+
sage: K.<z> = GF(25)
|
|
555
|
+
sage: F.<a,b,c> = FreeAlgebra(K, implementation='letterplace')
|
|
556
|
+
sage: (a+b)*(z+1) # indirect doctest
|
|
557
|
+
(z + 1)*a + (z + 1)*b
|
|
558
|
+
"""
|
|
559
|
+
return FreeAlgebraElement_letterplace(self._parent,
|
|
560
|
+
self._poly._lmul_(right),
|
|
561
|
+
check=False)
|
|
562
|
+
|
|
563
|
+
cpdef _rmul_(self, Element left):
|
|
564
|
+
"""
|
|
565
|
+
Multiplication from the left with an element of the base ring.
|
|
566
|
+
|
|
567
|
+
TESTS::
|
|
568
|
+
|
|
569
|
+
sage: K.<z> = GF(25)
|
|
570
|
+
sage: F.<a,b,c> = FreeAlgebra(K, implementation='letterplace')
|
|
571
|
+
sage: (z+1)*(a+b) # indirect doctest
|
|
572
|
+
(z + 1)*a + (z + 1)*b
|
|
573
|
+
"""
|
|
574
|
+
return FreeAlgebraElement_letterplace(self._parent,
|
|
575
|
+
self._poly._rmul_(left),
|
|
576
|
+
check=False)
|
|
577
|
+
|
|
578
|
+
cpdef _mul_(self, other):
|
|
579
|
+
"""
|
|
580
|
+
Product of two free algebra elements in letterplace implementation.
|
|
581
|
+
|
|
582
|
+
TESTS::
|
|
583
|
+
|
|
584
|
+
sage: F.<x,y,z> = FreeAlgebra(QQ, implementation='letterplace', degrees=[2,1,3])
|
|
585
|
+
sage: (x*y+z)*z # indirect doctest
|
|
586
|
+
x*y*z + z*z
|
|
587
|
+
"""
|
|
588
|
+
cdef FreeAlgebraElement_letterplace left = self
|
|
589
|
+
cdef FreeAlgebraElement_letterplace right = other
|
|
590
|
+
cdef FreeAlgebra_letterplace A = left._parent
|
|
591
|
+
A.set_degbound(left._poly.degree() + right._poly.degree())
|
|
592
|
+
# we must put the polynomials into the same ring
|
|
593
|
+
left._poly = A._current_ring(left._poly)
|
|
594
|
+
right._poly = A._current_ring(right._poly)
|
|
595
|
+
realngens = A._commutative_ring.ngens()
|
|
596
|
+
CG = CyclicPermutationGroup(A._current_ring.ngens())
|
|
597
|
+
rshift = right._poly * CG[left._poly.degree() * realngens]
|
|
598
|
+
return FreeAlgebraElement_letterplace(A, left._poly * rshift,
|
|
599
|
+
check=False)
|
|
600
|
+
|
|
601
|
+
def __pow__(FreeAlgebraElement_letterplace self, int n, k):
|
|
602
|
+
"""
|
|
603
|
+
TESTS::
|
|
604
|
+
|
|
605
|
+
sage: K.<z> = GF(25)
|
|
606
|
+
sage: F.<a,b,c> = FreeAlgebra(K, implementation='letterplace')
|
|
607
|
+
sage: (a+z*b)^3 # indirect doctest
|
|
608
|
+
a*a*a + (z)*a*a*b + (z)*a*b*a + (z + 3)*a*b*b + (z)*b*a*a + (z + 3)*b*a*b + (z + 3)*b*b*a + (4*z + 3)*b*b*b
|
|
609
|
+
"""
|
|
610
|
+
cdef FreeAlgebra_letterplace A = self._parent
|
|
611
|
+
if n < 0:
|
|
612
|
+
raise ValueError("negative exponents are not allowed")
|
|
613
|
+
if n == 0:
|
|
614
|
+
return FreeAlgebraElement_letterplace(A, A._current_ring(1),
|
|
615
|
+
check=False)
|
|
616
|
+
if n == 1:
|
|
617
|
+
return self
|
|
618
|
+
A.set_degbound(self._poly.degree() * n)
|
|
619
|
+
cdef MPolynomial_libsingular p, q
|
|
620
|
+
self._poly = A._current_ring(self._poly)
|
|
621
|
+
cdef int d = self._poly.degree()
|
|
622
|
+
q = p = self._poly
|
|
623
|
+
realngens = A._commutative_ring.ngens()
|
|
624
|
+
cdef int i
|
|
625
|
+
CG = CyclicPermutationGroup(A._current_ring.ngens())
|
|
626
|
+
for i in range(1, n):
|
|
627
|
+
q = q * CG[d * realngens]
|
|
628
|
+
p *= q
|
|
629
|
+
return FreeAlgebraElement_letterplace(A, p, check=False)
|
|
630
|
+
|
|
631
|
+
# Groebner related stuff
|
|
632
|
+
def reduce(self, G):
|
|
633
|
+
"""
|
|
634
|
+
Reduce this element by a list of elements or by a
|
|
635
|
+
twosided weighted homogeneous ideal.
|
|
636
|
+
|
|
637
|
+
INPUT:
|
|
638
|
+
|
|
639
|
+
Either a list or tuple of weighted homogeneous elements of the
|
|
640
|
+
free algebra, or an ideal of the free algebra, or an ideal in
|
|
641
|
+
the commutative polynomial ring that is currently used to
|
|
642
|
+
implement the multiplication in the free algebra.
|
|
643
|
+
|
|
644
|
+
OUTPUT: the twosided reduction of this element by the argument
|
|
645
|
+
|
|
646
|
+
.. NOTE::
|
|
647
|
+
|
|
648
|
+
This may not be the normal form of this element, unless
|
|
649
|
+
the argument is a twosided Groebner basis up to the degree
|
|
650
|
+
of this element.
|
|
651
|
+
|
|
652
|
+
EXAMPLES::
|
|
653
|
+
|
|
654
|
+
sage: F.<x,y,z> = FreeAlgebra(QQ, implementation='letterplace')
|
|
655
|
+
sage: I = F*[x*y+y*z,x^2+x*y-y*x-y^2]*F
|
|
656
|
+
sage: p = y^2*z*y^2+y*z*y*z*y
|
|
657
|
+
|
|
658
|
+
We compute the letterplace version of the Groebner basis
|
|
659
|
+
of `I` with degree bound 4::
|
|
660
|
+
|
|
661
|
+
sage: G = F._reductor_(I.groebner_basis(4).gens(),4)
|
|
662
|
+
sage: G.ring() is F.current_ring()
|
|
663
|
+
True
|
|
664
|
+
|
|
665
|
+
Since the element `p` is of degree 5, it is no surprise
|
|
666
|
+
that its reductions with respect to the original generators
|
|
667
|
+
of `I` (of degree 2), or with respect to `G` (Groebner basis
|
|
668
|
+
with degree bound 4), or with respect to the Groebner basis
|
|
669
|
+
with degree bound 5 (which yields its normal form) are
|
|
670
|
+
pairwise different::
|
|
671
|
+
|
|
672
|
+
sage: p.reduce(I)
|
|
673
|
+
y*y*z*y*y + y*z*y*z*y
|
|
674
|
+
sage: p.reduce(G)
|
|
675
|
+
y*y*z*z*y + y*z*y*z*y - y*z*z*y*y + y*z*z*z*y
|
|
676
|
+
sage: p.normal_form(I)
|
|
677
|
+
y*y*z*z*z + y*z*y*z*z - y*z*z*y*z + y*z*z*z*z
|
|
678
|
+
sage: p.reduce(I) != p.reduce(G) != p.normal_form(I) != p.reduce(I)
|
|
679
|
+
True
|
|
680
|
+
"""
|
|
681
|
+
cdef FreeAlgebra_letterplace P = self._parent
|
|
682
|
+
if not isinstance(G, (list, tuple)):
|
|
683
|
+
if G == P:
|
|
684
|
+
return P.zero()
|
|
685
|
+
if not (isinstance(G, MPolynomialIdeal) and G.ring() == P._current_ring):
|
|
686
|
+
G = G.gens()
|
|
687
|
+
C = P.current_ring()
|
|
688
|
+
cdef int selfdeg = self._poly.degree()
|
|
689
|
+
if isinstance(G, MPolynomialIdeal):
|
|
690
|
+
gI = G
|
|
691
|
+
else:
|
|
692
|
+
gI = P._reductor_(G, selfdeg) # C.ideal(g,coerce=False)
|
|
693
|
+
from sage.libs.singular.option import LibSingularOptions
|
|
694
|
+
libsingular_options = LibSingularOptions()
|
|
695
|
+
bck = (libsingular_options['redTail'], libsingular_options['redSB'])
|
|
696
|
+
libsingular_options['redTail'] = True
|
|
697
|
+
libsingular_options['redSB'] = True
|
|
698
|
+
from sage.libs.singular.function import singular_function
|
|
699
|
+
poly_reduce = singular_function("NF")
|
|
700
|
+
poly = poly_reduce(C(self._poly), gI, ring=C,
|
|
701
|
+
attributes={gI: {"isSB": 1}})
|
|
702
|
+
libsingular_options['redTail'] = bck[0]
|
|
703
|
+
libsingular_options['redSB'] = bck[1]
|
|
704
|
+
return FreeAlgebraElement_letterplace(P, poly, check=False)
|
|
705
|
+
|
|
706
|
+
def normal_form(self, I):
|
|
707
|
+
"""
|
|
708
|
+
Return the normal form of this element with respect to
|
|
709
|
+
a twosided weighted homogeneous ideal.
|
|
710
|
+
|
|
711
|
+
INPUT:
|
|
712
|
+
|
|
713
|
+
- ``I`` -- a twosided homogeneous ideal of the parent `F` of
|
|
714
|
+
this element, `x`
|
|
715
|
+
|
|
716
|
+
OUTPUT: the normal form of `x` wrt. `I`
|
|
717
|
+
|
|
718
|
+
.. NOTE::
|
|
719
|
+
|
|
720
|
+
The normal form is computed by reduction with respect
|
|
721
|
+
to a Groebnerbasis of `I` with degree bound `deg(x)`.
|
|
722
|
+
|
|
723
|
+
EXAMPLES::
|
|
724
|
+
|
|
725
|
+
sage: F.<x,y,z> = FreeAlgebra(QQ, implementation='letterplace')
|
|
726
|
+
sage: I = F*[x*y+y*z,x^2+x*y-y*x-y^2]*F
|
|
727
|
+
sage: (x^5).normal_form(I)
|
|
728
|
+
-y*z*z*z*x - y*z*z*z*y - y*z*z*z*z
|
|
729
|
+
|
|
730
|
+
We verify two basic properties of normal forms: The
|
|
731
|
+
difference of an element and its normal form is contained
|
|
732
|
+
in the ideal, and if two elements of the free algebra
|
|
733
|
+
differ by an element of the ideal then they have the same
|
|
734
|
+
normal form::
|
|
735
|
+
|
|
736
|
+
sage: x^5 - (x^5).normal_form(I) in I
|
|
737
|
+
True
|
|
738
|
+
sage: (x^5+x*I.0*y*z-3*z^2*I.1*y).normal_form(I) == (x^5).normal_form(I)
|
|
739
|
+
True
|
|
740
|
+
|
|
741
|
+
Here is an example with non-trivial degree weights::
|
|
742
|
+
|
|
743
|
+
sage: F.<x,y,z> = FreeAlgebra(QQ, implementation='letterplace', degrees=[1,2,3])
|
|
744
|
+
sage: I = F*[x*y-y*x+z, y^2+2*x*z, (x*y)^2-z^2]*F
|
|
745
|
+
sage: ((x*y)^3).normal_form(I)
|
|
746
|
+
z*z*y*x - z*z*z
|
|
747
|
+
sage: (x*y)^3-((x*y)^3).normal_form(I) in I
|
|
748
|
+
True
|
|
749
|
+
sage: ((x*y)^3+2*z*I.0*z+y*I.1*z-x*I.2*y).normal_form(I) == ((x*y)^3).normal_form(I)
|
|
750
|
+
True
|
|
751
|
+
"""
|
|
752
|
+
if self._parent != I.ring():
|
|
753
|
+
raise ValueError("cannot compute normal form wrt an ideal that does not belong to %s" % self._parent)
|
|
754
|
+
sdeg = self._poly.degree()
|
|
755
|
+
return self.reduce(self._parent._reductor_(I.groebner_basis(degbound=sdeg).gens(), sdeg))
|