passagemath-singular 10.6.31rc3__cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_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-gnu.so +0 -0
- passagemath_singular-10.6.31rc3.dist-info/METADATA +183 -0
- passagemath_singular-10.6.31rc3.dist-info/RECORD +491 -0
- passagemath_singular-10.6.31rc3.dist-info/WHEEL +6 -0
- passagemath_singular-10.6.31rc3.dist-info/top_level.txt +3 -0
- passagemath_singular.libs/libSingular-4-20aec911.4.1.so +0 -0
- passagemath_singular.libs/libcddgmp-21acf0c6.so.0.1.3 +0 -0
- passagemath_singular.libs/libfactory-4-fcee31da.4.1.so +0 -0
- passagemath_singular.libs/libflint-66e12231.so.21.0.0 +0 -0
- passagemath_singular.libs/libgf2x-a4cdec90.so.3.0.0 +0 -0
- passagemath_singular.libs/libgfortran-83c28eba.so.5.0.0 +0 -0
- passagemath_singular.libs/libgmp-6e109695.so.10.5.0 +0 -0
- passagemath_singular.libs/libgsl-cda90e79.so.28.0.0 +0 -0
- passagemath_singular.libs/libmpfr-82690d50.so.6.2.1 +0 -0
- passagemath_singular.libs/libntl-e6f0d543.so.44.0.1 +0 -0
- passagemath_singular.libs/libomalloc-0-5c9e866e.9.6.so +0 -0
- passagemath_singular.libs/libopenblasp-r0-6dcb67f9.3.29.so +0 -0
- passagemath_singular.libs/libpolys-4-5c0a87e0.4.1.so +0 -0
- passagemath_singular.libs/libquadmath-2284e583.so.0.0.0 +0 -0
- passagemath_singular.libs/libreadline-ea270e21.so.8.2 +0 -0
- passagemath_singular.libs/libsingular_resources-4-a1aafc6d.4.1.so +0 -0
- passagemath_singular.libs/libtinfo-ceb117d9.so.6.3 +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-gnu.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-gnu.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-gnu.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-gnu.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-gnu.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-gnu.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-gnu.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-gnu.so +0 -0
- sage/algebras/quatalg/quaternion_algebra_cython.pyx +261 -0
- sage/algebras/quatalg/quaternion_algebra_element.cpython-314-x86_64-linux-gnu.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-gnu.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-gnu.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-gnu.so +0 -0
- sage/libs/singular/option.pyx +671 -0
- sage/libs/singular/polynomial.cpython-314-x86_64-linux-gnu.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-gnu.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-gnu.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-gnu.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-gnu.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-gnu.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-gnu.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-gnu.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-gnu.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,914 @@
|
|
|
1
|
+
# sage_setup: distribution = sagemath-singular
|
|
2
|
+
# sage.doctest: needs sage.combinat
|
|
3
|
+
###############################################################################
|
|
4
|
+
#
|
|
5
|
+
# Copyright (C) 2011 Simon King <simon.king@uni-jena.de>
|
|
6
|
+
# Distributed under the terms of the GNU General Public License (GPL),
|
|
7
|
+
# version 2 or any later version. The full text of the GPL is available at:
|
|
8
|
+
# https://www.gnu.org/licenses/
|
|
9
|
+
#
|
|
10
|
+
###############################################################################
|
|
11
|
+
|
|
12
|
+
"""
|
|
13
|
+
Free associative unital algebras, implemented via Singular's letterplace rings
|
|
14
|
+
|
|
15
|
+
AUTHOR:
|
|
16
|
+
|
|
17
|
+
- Simon King (2011-03-21): :issue:`7797`
|
|
18
|
+
|
|
19
|
+
With this implementation, Groebner bases out to a degree bound and
|
|
20
|
+
normal forms can be computed for twosided weighted homogeneous ideals
|
|
21
|
+
of free algebras. For now, all computations are restricted to weighted
|
|
22
|
+
homogeneous elements, i.e., other elements cannot be created by
|
|
23
|
+
arithmetic operations.
|
|
24
|
+
|
|
25
|
+
EXAMPLES::
|
|
26
|
+
|
|
27
|
+
sage: F.<x,y,z> = FreeAlgebra(QQ, implementation='letterplace')
|
|
28
|
+
sage: F
|
|
29
|
+
Free Associative Unital Algebra on 3 generators (x, y, z) over Rational Field
|
|
30
|
+
sage: I = F*[x*y+y*z,x^2+x*y-y*x-y^2]*F
|
|
31
|
+
sage: I
|
|
32
|
+
Twosided Ideal (x*y + y*z, x*x + x*y - y*x - y*y) of Free Associative Unital Algebra on 3 generators (x, y, z) over Rational Field
|
|
33
|
+
sage: x*(x*I.0-I.1*y+I.0*y)-I.1*y*z
|
|
34
|
+
x*y*x*y + x*y*y*y - x*y*y*z + x*y*z*y + y*x*y*z + y*y*y*z
|
|
35
|
+
sage: x^2*I.0-x*I.1*y+x*I.0*y-I.1*y*z in I
|
|
36
|
+
True
|
|
37
|
+
|
|
38
|
+
The preceding containment test is based on the computation of Groebner
|
|
39
|
+
bases with degree bound::
|
|
40
|
+
|
|
41
|
+
sage: I.groebner_basis(degbound=4)
|
|
42
|
+
Twosided Ideal (x*y + y*z,
|
|
43
|
+
x*x - y*x - y*y - y*z,
|
|
44
|
+
y*y*y - y*y*z + y*z*y - y*z*z,
|
|
45
|
+
y*y*x + y*y*z + y*z*x + y*z*z,
|
|
46
|
+
y*y*z*y - y*y*z*z + y*z*z*y - y*z*z*z,
|
|
47
|
+
y*z*y*y - y*z*y*z + y*z*z*y - y*z*z*z,
|
|
48
|
+
y*y*z*x + y*y*z*z + y*z*z*x + y*z*z*z,
|
|
49
|
+
y*z*y*x + y*z*y*z + y*z*z*x + y*z*z*z) of Free Associative Unital
|
|
50
|
+
Algebra on 3 generators (x, y, z) over Rational Field
|
|
51
|
+
|
|
52
|
+
When reducing an element by `I`, the original generators are chosen::
|
|
53
|
+
|
|
54
|
+
sage: (y*z*y*y).reduce(I)
|
|
55
|
+
y*z*y*y
|
|
56
|
+
|
|
57
|
+
However, there is a method for computing the normal form of an
|
|
58
|
+
element, which is the same as reduction by the Groebner basis out to
|
|
59
|
+
the degree of that element::
|
|
60
|
+
|
|
61
|
+
sage: (y*z*y*y).normal_form(I)
|
|
62
|
+
y*z*y*z - y*z*z*y + y*z*z*z
|
|
63
|
+
sage: (y*z*y*y).reduce(I.groebner_basis(4))
|
|
64
|
+
y*z*y*z - y*z*z*y + y*z*z*z
|
|
65
|
+
|
|
66
|
+
The default term order derives from the degree reverse lexicographic
|
|
67
|
+
order on the commutative version of the free algebra::
|
|
68
|
+
|
|
69
|
+
sage: F.commutative_ring().term_order()
|
|
70
|
+
Degree reverse lexicographic term order
|
|
71
|
+
|
|
72
|
+
A different term order can be chosen, and of course may yield a
|
|
73
|
+
different normal form::
|
|
74
|
+
|
|
75
|
+
sage: L.<a,b,c> = FreeAlgebra(QQ, implementation='letterplace', order='lex')
|
|
76
|
+
sage: L.commutative_ring().term_order()
|
|
77
|
+
Lexicographic term order
|
|
78
|
+
sage: J = L*[a*b+b*c,a^2+a*b-b*c-c^2]*L
|
|
79
|
+
sage: J.groebner_basis(4)
|
|
80
|
+
Twosided Ideal (2*b*c*b - b*c*c + c*c*b,
|
|
81
|
+
a*b + b*c,
|
|
82
|
+
-a*c*c + 2*b*c*a + 2*b*c*c + c*c*a,
|
|
83
|
+
a*c*c*b - 2*b*c*c*b + b*c*c*c,
|
|
84
|
+
a*a - 2*b*c - c*c,
|
|
85
|
+
a*c*c*a - 2*b*c*c*a - 4*b*c*c*c - c*c*c*c) of Free Associative Unital
|
|
86
|
+
Algebra on 3 generators (a, b, c) over Rational Field
|
|
87
|
+
sage: (b*c*b*b).normal_form(J)
|
|
88
|
+
1/2*b*c*c*b - 1/2*c*c*b*b
|
|
89
|
+
|
|
90
|
+
Here is an example with degree weights::
|
|
91
|
+
|
|
92
|
+
sage: F.<x,y,z> = FreeAlgebra(QQ, implementation='letterplace', degrees=[1,2,3])
|
|
93
|
+
sage: (x*y+z).degree()
|
|
94
|
+
3
|
|
95
|
+
|
|
96
|
+
TESTS::
|
|
97
|
+
|
|
98
|
+
sage: TestSuite(F).run()
|
|
99
|
+
sage: TestSuite(L).run()
|
|
100
|
+
sage: loads(dumps(F)) is F
|
|
101
|
+
True
|
|
102
|
+
|
|
103
|
+
sage: F.<x,y,z> = FreeAlgebra(QQ, implementation='letterplace')
|
|
104
|
+
sage: F.is_commutative()
|
|
105
|
+
False
|
|
106
|
+
sage: FreeAlgebra(QQ, implementation='letterplace', names=['x']).is_commutative()
|
|
107
|
+
True
|
|
108
|
+
|
|
109
|
+
.. TODO::
|
|
110
|
+
|
|
111
|
+
The computation of Groebner bases only works for global term
|
|
112
|
+
orderings, and all elements must be weighted homogeneous with respect
|
|
113
|
+
to positive integral degree weights. It is ongoing work in Singular to
|
|
114
|
+
lift these restrictions.
|
|
115
|
+
|
|
116
|
+
We support coercion from the letterplace wrapper to the corresponding
|
|
117
|
+
generic implementation of a free algebra
|
|
118
|
+
(:class:`~sage.algebras.free_algebra.FreeAlgebra_generic`), but there
|
|
119
|
+
is no coercion in the opposite direction, since the generic
|
|
120
|
+
implementation also comprises non-homogeneous elements.
|
|
121
|
+
|
|
122
|
+
We also do not support coercion from a subalgebra, or between free
|
|
123
|
+
algebras with different term orderings, yet.
|
|
124
|
+
"""
|
|
125
|
+
from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing
|
|
126
|
+
from sage.libs.singular.function import lib
|
|
127
|
+
from sage.libs.singular.function cimport RingWrap
|
|
128
|
+
from sage.libs.singular.ring cimport singular_ring_delete, singular_ring_reference
|
|
129
|
+
from sage.categories.algebras import Algebras
|
|
130
|
+
from sage.rings.noncommutative_ideals import IdealMonoid_nc
|
|
131
|
+
from sage.rings.polynomial.plural cimport new_CRing
|
|
132
|
+
from sage.misc.cachefunc import cached_method
|
|
133
|
+
|
|
134
|
+
#####################
|
|
135
|
+
# Define some singular functions
|
|
136
|
+
lib("freegb.lib")
|
|
137
|
+
|
|
138
|
+
# unfortunately we cannot set Singular attributes for MPolynomialRing_libsingular
|
|
139
|
+
# Hence, we must constantly work around Letterplace's sanity checks,
|
|
140
|
+
# and cannot use the following library functions:
|
|
141
|
+
# set_letterplace_attributes = singular_function("setLetterplaceAttributes")
|
|
142
|
+
# lpMult = singular_function("lpMult")
|
|
143
|
+
|
|
144
|
+
#####################
|
|
145
|
+
# Auxiliary functions
|
|
146
|
+
|
|
147
|
+
cdef MPolynomialRing_libsingular make_letterplace_ring(base_ring, blocks):
|
|
148
|
+
"""
|
|
149
|
+
Create a polynomial ring in block order.
|
|
150
|
+
|
|
151
|
+
INPUT:
|
|
152
|
+
|
|
153
|
+
- ``base_ring`` -- a multivariate polynomial ring
|
|
154
|
+
- ``blocks`` -- the number of blocks to be formed
|
|
155
|
+
|
|
156
|
+
OUTPUT:
|
|
157
|
+
|
|
158
|
+
A multivariate polynomial ring in block order, all blocks
|
|
159
|
+
isomorphic (as ordered rings) with the given ring, and the
|
|
160
|
+
variable names of the `n`-th block (`n>0`) ending with
|
|
161
|
+
``"_%d"%n``.
|
|
162
|
+
|
|
163
|
+
TESTS:
|
|
164
|
+
|
|
165
|
+
Note that, since the algebras are cached, we need to choose
|
|
166
|
+
a different base ring, since other doctests could have a
|
|
167
|
+
side effect on the attained degree bound::
|
|
168
|
+
|
|
169
|
+
sage: F.<x,y,z> = FreeAlgebra(GF(17), implementation='letterplace')
|
|
170
|
+
sage: L.<a,b,c> = FreeAlgebra(GF(17), implementation='letterplace', order='lex')
|
|
171
|
+
sage: F.set_degbound(4)
|
|
172
|
+
sage: F.current_ring() # indirect doctest
|
|
173
|
+
Multivariate Polynomial Ring in x, y, z, x_1, y_1, z_1, x_2, y_2, z_2, x_3, y_3, z_3 over Finite Field of size 17
|
|
174
|
+
sage: F.current_ring().term_order()
|
|
175
|
+
Block term order with blocks:
|
|
176
|
+
(Degree reverse lexicographic term order of length 3,
|
|
177
|
+
Degree reverse lexicographic term order of length 3,
|
|
178
|
+
Degree reverse lexicographic term order of length 3,
|
|
179
|
+
Degree reverse lexicographic term order of length 3)
|
|
180
|
+
sage: L.set_degbound(2)
|
|
181
|
+
sage: L.current_ring().term_order()
|
|
182
|
+
Block term order with blocks:
|
|
183
|
+
(Lexicographic term order of length 3,
|
|
184
|
+
Lexicographic term order of length 3)
|
|
185
|
+
"""
|
|
186
|
+
T0 = base_ring.term_order()
|
|
187
|
+
T = T0
|
|
188
|
+
cdef i
|
|
189
|
+
cdef tuple names0 = base_ring.variable_names()
|
|
190
|
+
cdef list names = list(names0)
|
|
191
|
+
for i in range(1, blocks):
|
|
192
|
+
T += T0
|
|
193
|
+
names.extend([x + '_' + str(i) for x in names0])
|
|
194
|
+
return PolynomialRing(base_ring.base_ring(), names, order=T,
|
|
195
|
+
implementation='singular')
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
#####################
|
|
199
|
+
# The free algebra
|
|
200
|
+
|
|
201
|
+
cdef class FreeAlgebra_letterplace(Parent):
|
|
202
|
+
"""
|
|
203
|
+
Finitely generated free algebra, with arithmetic restricted to weighted homogeneous elements.
|
|
204
|
+
|
|
205
|
+
.. NOTE::
|
|
206
|
+
|
|
207
|
+
The restriction to weighted homogeneous elements should be lifted
|
|
208
|
+
as soon as the restriction to homogeneous elements is lifted in
|
|
209
|
+
Singular's "Letterplace algebras".
|
|
210
|
+
|
|
211
|
+
EXAMPLES::
|
|
212
|
+
|
|
213
|
+
sage: K.<z> = GF(25)
|
|
214
|
+
sage: F.<a,b,c> = FreeAlgebra(K, implementation='letterplace')
|
|
215
|
+
sage: F
|
|
216
|
+
Free Associative Unital Algebra on 3 generators (a, b, c) over Finite Field in z of size 5^2
|
|
217
|
+
sage: P = F.commutative_ring()
|
|
218
|
+
sage: P
|
|
219
|
+
Multivariate Polynomial Ring in a, b, c over Finite Field in z of size 5^2
|
|
220
|
+
|
|
221
|
+
We can do arithmetic as usual, as long as we stay (weighted) homogeneous::
|
|
222
|
+
|
|
223
|
+
sage: (z*a+(z+1)*b+2*c)^2
|
|
224
|
+
(z + 3)*a*a + (2*z + 3)*a*b + (2*z)*a*c + (2*z + 3)*b*a + (3*z + 4)*b*b + (2*z + 2)*b*c + (2*z)*c*a + (2*z + 2)*c*b - c*c
|
|
225
|
+
sage: a+1
|
|
226
|
+
Traceback (most recent call last):
|
|
227
|
+
...
|
|
228
|
+
ArithmeticError: can only add elements of the same weighted degree
|
|
229
|
+
"""
|
|
230
|
+
# It is not really a free algebra over the given generators. Rather,
|
|
231
|
+
# it is a free algebra over the commutative monoid generated by the given generators.
|
|
232
|
+
def __init__(self, R, degrees=None):
|
|
233
|
+
"""
|
|
234
|
+
INPUT:
|
|
235
|
+
|
|
236
|
+
A multivariate polynomial ring of type :class:`~sage.rings.polynomial.multipolynomial_libsingular.MPolynomialRing_libsingular`.
|
|
237
|
+
|
|
238
|
+
OUTPUT: the free associative version of the given commutative ring
|
|
239
|
+
|
|
240
|
+
.. NOTE::
|
|
241
|
+
|
|
242
|
+
One is supposed to use the :class:`FreeAlgebra` constructor,
|
|
243
|
+
in order to use the cache.
|
|
244
|
+
|
|
245
|
+
TESTS::
|
|
246
|
+
|
|
247
|
+
sage: from sage.algebras.letterplace.free_algebra_letterplace import FreeAlgebra_letterplace
|
|
248
|
+
sage: FreeAlgebra_letterplace(QQ['x','y'])
|
|
249
|
+
Free Associative Unital Algebra on 2 generators (x, y) over Rational Field
|
|
250
|
+
sage: FreeAlgebra_letterplace(QQ['x'])
|
|
251
|
+
Traceback (most recent call last):
|
|
252
|
+
...
|
|
253
|
+
TypeError: a letterplace algebra must be provided by a polynomial ring of type <... 'sage.rings.polynomial.multi_polynomial_libsingular.MPolynomialRing_libsingular'>
|
|
254
|
+
|
|
255
|
+
::
|
|
256
|
+
|
|
257
|
+
sage: K.<z> = GF(25)
|
|
258
|
+
sage: F.<a,b,c> = FreeAlgebra(K, implementation='letterplace')
|
|
259
|
+
sage: TestSuite(F).run()
|
|
260
|
+
"""
|
|
261
|
+
if not isinstance(R, MPolynomialRing_libsingular):
|
|
262
|
+
raise TypeError("a letterplace algebra must be provided by a polynomial ring of type %s" % MPolynomialRing_libsingular)
|
|
263
|
+
|
|
264
|
+
self._ngens = R.ngens()
|
|
265
|
+
if degrees is None:
|
|
266
|
+
varnames = R.variable_names()
|
|
267
|
+
self._nb_slackvars = 0
|
|
268
|
+
else:
|
|
269
|
+
varnames = R.variable_names()[:-1]
|
|
270
|
+
self._nb_slackvars = 1
|
|
271
|
+
number_of_vars = self._ngens - self._nb_slackvars
|
|
272
|
+
|
|
273
|
+
base_ring = R.base_ring()
|
|
274
|
+
if number_of_vars <= 1:
|
|
275
|
+
cat = Algebras(base_ring).Commutative()
|
|
276
|
+
else:
|
|
277
|
+
cat = Algebras(base_ring)
|
|
278
|
+
Parent.__init__(self, base=base_ring, names=varnames,
|
|
279
|
+
normalize=False, category=cat)
|
|
280
|
+
|
|
281
|
+
self._commutative_ring = R
|
|
282
|
+
self._current_ring = make_letterplace_ring(R, 1)
|
|
283
|
+
self._degbound = 1
|
|
284
|
+
if degrees is None:
|
|
285
|
+
self._degrees = tuple([int(1)] * self._ngens)
|
|
286
|
+
else:
|
|
287
|
+
if (not isinstance(degrees, (tuple, list))) \
|
|
288
|
+
or len(degrees) != number_of_vars \
|
|
289
|
+
or any(i <= 0 for i in degrees):
|
|
290
|
+
raise TypeError("the generator degrees must be given by a list or tuple of %d positive integers" % (self._ngens - 1))
|
|
291
|
+
self._degrees = tuple([int(i) for i in degrees])
|
|
292
|
+
self.set_degbound(max(self._degrees))
|
|
293
|
+
self._populate_coercion_lists_(coerce_list=[base_ring])
|
|
294
|
+
|
|
295
|
+
def __reduce__(self):
|
|
296
|
+
"""
|
|
297
|
+
TESTS::
|
|
298
|
+
|
|
299
|
+
sage: K.<z> = GF(25)
|
|
300
|
+
sage: F.<a,b,c> = FreeAlgebra(K, implementation='letterplace')
|
|
301
|
+
sage: loads(dumps(F)) is F # indirect doctest
|
|
302
|
+
True
|
|
303
|
+
"""
|
|
304
|
+
from sage.algebras.free_algebra import FreeAlgebra
|
|
305
|
+
if self._nb_slackvars == 0:
|
|
306
|
+
return FreeAlgebra, (self._commutative_ring,)
|
|
307
|
+
return FreeAlgebra, (self._commutative_ring, None, None, None,
|
|
308
|
+
None, None, None, None, self._degrees)
|
|
309
|
+
|
|
310
|
+
# Small methods
|
|
311
|
+
def ngens(self):
|
|
312
|
+
"""
|
|
313
|
+
Return the number of generators.
|
|
314
|
+
|
|
315
|
+
EXAMPLES::
|
|
316
|
+
|
|
317
|
+
sage: F.<a,b,c> = FreeAlgebra(QQ, implementation='letterplace')
|
|
318
|
+
sage: F.ngens()
|
|
319
|
+
3
|
|
320
|
+
"""
|
|
321
|
+
return self._ngens - self._nb_slackvars
|
|
322
|
+
|
|
323
|
+
@cached_method
|
|
324
|
+
def gen(self, i):
|
|
325
|
+
"""
|
|
326
|
+
Return the `i`-th generator.
|
|
327
|
+
|
|
328
|
+
INPUT:
|
|
329
|
+
|
|
330
|
+
- ``i`` -- integer
|
|
331
|
+
|
|
332
|
+
OUTPUT: the generator with index `i`
|
|
333
|
+
|
|
334
|
+
EXAMPLES::
|
|
335
|
+
|
|
336
|
+
sage: F.<a,b,c> = FreeAlgebra(QQ, implementation='letterplace')
|
|
337
|
+
sage: F.1 is F.1 # indirect doctest
|
|
338
|
+
True
|
|
339
|
+
sage: F.gen(2)
|
|
340
|
+
c
|
|
341
|
+
"""
|
|
342
|
+
if i >= self._ngens - self._nb_slackvars:
|
|
343
|
+
raise ValueError("this free algebra only has %d generators" % (self._ngens - self._nb_slackvars))
|
|
344
|
+
deg = self._degrees[i]
|
|
345
|
+
p = self._current_ring.gen(i)
|
|
346
|
+
cdef int n
|
|
347
|
+
cdef int j = self._ngens - 1
|
|
348
|
+
for n in range(1, deg):
|
|
349
|
+
j += self._ngens
|
|
350
|
+
p *= self._current_ring.gen(j)
|
|
351
|
+
return FreeAlgebraElement_letterplace(self, p)
|
|
352
|
+
|
|
353
|
+
def gens(self) -> tuple:
|
|
354
|
+
"""
|
|
355
|
+
Return the tuple of generators.
|
|
356
|
+
|
|
357
|
+
EXAMPLES::
|
|
358
|
+
|
|
359
|
+
sage: F.<a,b,c> = FreeAlgebra(QQ, implementation='letterplace')
|
|
360
|
+
sage: F.gens()
|
|
361
|
+
(a, b, c)
|
|
362
|
+
"""
|
|
363
|
+
return tuple(self.gen(i) for i in range(self.ngens()))
|
|
364
|
+
|
|
365
|
+
def current_ring(self):
|
|
366
|
+
"""
|
|
367
|
+
Return the commutative ring that is used to emulate
|
|
368
|
+
the non-commutative multiplication out to the current degree.
|
|
369
|
+
|
|
370
|
+
EXAMPLES::
|
|
371
|
+
|
|
372
|
+
sage: F.<a,b,c> = FreeAlgebra(QQ, implementation='letterplace')
|
|
373
|
+
sage: F.current_ring()
|
|
374
|
+
Multivariate Polynomial Ring in a, b, c over Rational Field
|
|
375
|
+
sage: a*b
|
|
376
|
+
a*b
|
|
377
|
+
sage: F.current_ring()
|
|
378
|
+
Multivariate Polynomial Ring in a, b, c, a_1, b_1, c_1 over Rational Field
|
|
379
|
+
sage: F.set_degbound(3)
|
|
380
|
+
sage: F.current_ring()
|
|
381
|
+
Multivariate Polynomial Ring in a, b, c, a_1, b_1, c_1, a_2, b_2, c_2 over Rational Field
|
|
382
|
+
"""
|
|
383
|
+
return self._current_ring
|
|
384
|
+
|
|
385
|
+
def commutative_ring(self):
|
|
386
|
+
"""
|
|
387
|
+
Return the commutative version of this free algebra.
|
|
388
|
+
|
|
389
|
+
.. NOTE::
|
|
390
|
+
|
|
391
|
+
This commutative ring is used as a unique key of the free algebra.
|
|
392
|
+
|
|
393
|
+
EXAMPLES::
|
|
394
|
+
|
|
395
|
+
sage: K.<z> = GF(25)
|
|
396
|
+
sage: F.<a,b,c> = FreeAlgebra(K, implementation='letterplace')
|
|
397
|
+
sage: F
|
|
398
|
+
Free Associative Unital Algebra on 3 generators (a, b, c) over Finite Field in z of size 5^2
|
|
399
|
+
sage: F.commutative_ring()
|
|
400
|
+
Multivariate Polynomial Ring in a, b, c over Finite Field in z of size 5^2
|
|
401
|
+
sage: FreeAlgebra(F.commutative_ring()) is F
|
|
402
|
+
True
|
|
403
|
+
"""
|
|
404
|
+
return self._commutative_ring
|
|
405
|
+
|
|
406
|
+
def term_order_of_block(self):
|
|
407
|
+
"""
|
|
408
|
+
Return the term order that is used for the commutative version of this free algebra.
|
|
409
|
+
|
|
410
|
+
EXAMPLES::
|
|
411
|
+
|
|
412
|
+
sage: F.<x,y,z> = FreeAlgebra(QQ, implementation='letterplace')
|
|
413
|
+
sage: F.term_order_of_block()
|
|
414
|
+
Degree reverse lexicographic term order
|
|
415
|
+
sage: L.<a,b,c> = FreeAlgebra(QQ, implementation='letterplace',order='lex')
|
|
416
|
+
sage: L.term_order_of_block()
|
|
417
|
+
Lexicographic term order
|
|
418
|
+
"""
|
|
419
|
+
return self._commutative_ring.term_order()
|
|
420
|
+
|
|
421
|
+
def generator_degrees(self):
|
|
422
|
+
return self._degrees
|
|
423
|
+
|
|
424
|
+
# Some basic properties of this ring
|
|
425
|
+
def is_field(self, proof=True):
|
|
426
|
+
"""
|
|
427
|
+
Tell whether this free algebra is a field.
|
|
428
|
+
|
|
429
|
+
.. NOTE::
|
|
430
|
+
|
|
431
|
+
This would only be the case in the degenerate case of no generators.
|
|
432
|
+
But such an example cannot be constructed in this implementation.
|
|
433
|
+
|
|
434
|
+
TESTS::
|
|
435
|
+
|
|
436
|
+
sage: F.<x,y,z> = FreeAlgebra(QQ, implementation='letterplace')
|
|
437
|
+
sage: F.is_field()
|
|
438
|
+
False
|
|
439
|
+
"""
|
|
440
|
+
return (not (self._ngens - self._nb_slackvars)) and self._base.is_field(proof=proof)
|
|
441
|
+
|
|
442
|
+
def _repr_(self):
|
|
443
|
+
"""
|
|
444
|
+
EXAMPLES::
|
|
445
|
+
|
|
446
|
+
sage: F.<x,y,z> = FreeAlgebra(QQ, implementation='letterplace')
|
|
447
|
+
sage: F # indirect doctest
|
|
448
|
+
Free Associative Unital Algebra on 3 generators (x, y, z) over Rational Field
|
|
449
|
+
|
|
450
|
+
The degree weights are not part of the string representation::
|
|
451
|
+
|
|
452
|
+
sage: F.<x,y,z> = FreeAlgebra(QQ, implementation='letterplace', degrees=[2,1,3])
|
|
453
|
+
sage: F
|
|
454
|
+
Free Associative Unital Algebra on 3 generators (x, y, z) over Rational Field
|
|
455
|
+
"""
|
|
456
|
+
return "Free Associative Unital Algebra on %d generators %s over %s" % (self._ngens - self._nb_slackvars, self.gens(), self._base)
|
|
457
|
+
|
|
458
|
+
def _latex_(self):
|
|
459
|
+
r"""
|
|
460
|
+
Representation of this free algebra in LaTeX.
|
|
461
|
+
|
|
462
|
+
EXAMPLES::
|
|
463
|
+
|
|
464
|
+
sage: F.<bla,alpha,z> = FreeAlgebra(QQ, implementation='letterplace', degrees=[1,2,3])
|
|
465
|
+
sage: latex(F)
|
|
466
|
+
\Bold{Q}\langle \mathit{bla}, \alpha, z\rangle
|
|
467
|
+
"""
|
|
468
|
+
from sage.misc.latex import latex
|
|
469
|
+
return "%s\\langle %s\\rangle" % (latex(self.base_ring()), ', '.join(self.latex_variable_names()))
|
|
470
|
+
|
|
471
|
+
def degbound(self):
|
|
472
|
+
"""
|
|
473
|
+
Return the degree bound that is currently used.
|
|
474
|
+
|
|
475
|
+
.. NOTE::
|
|
476
|
+
|
|
477
|
+
When multiplying two elements of this free algebra, the degree
|
|
478
|
+
bound will be dynamically adapted. It can also be set by
|
|
479
|
+
:meth:`set_degbound`.
|
|
480
|
+
|
|
481
|
+
EXAMPLES:
|
|
482
|
+
|
|
483
|
+
In order to avoid we get a free algebras from the cache that
|
|
484
|
+
was created in another doctest and has a different degree
|
|
485
|
+
bound, we choose a base ring that does not appear in other tests::
|
|
486
|
+
|
|
487
|
+
sage: F.<x,y,z> = FreeAlgebra(ZZ, implementation='letterplace')
|
|
488
|
+
sage: F.degbound()
|
|
489
|
+
1
|
|
490
|
+
sage: x*y
|
|
491
|
+
x*y
|
|
492
|
+
sage: F.degbound()
|
|
493
|
+
2
|
|
494
|
+
sage: F.set_degbound(4)
|
|
495
|
+
sage: F.degbound()
|
|
496
|
+
4
|
|
497
|
+
"""
|
|
498
|
+
return self._degbound
|
|
499
|
+
|
|
500
|
+
def set_degbound(self, d):
|
|
501
|
+
"""
|
|
502
|
+
Increase the degree bound that is currently in place.
|
|
503
|
+
|
|
504
|
+
.. NOTE::
|
|
505
|
+
|
|
506
|
+
The degree bound cannot be decreased.
|
|
507
|
+
|
|
508
|
+
EXAMPLES:
|
|
509
|
+
|
|
510
|
+
In order to avoid we get a free algebras from the cache that
|
|
511
|
+
was created in another doctest and has a different degree
|
|
512
|
+
bound, we choose a base ring that does not appear in other tests::
|
|
513
|
+
|
|
514
|
+
sage: F.<x,y,z> = FreeAlgebra(GF(251), implementation='letterplace')
|
|
515
|
+
sage: F.degbound()
|
|
516
|
+
1
|
|
517
|
+
sage: x*y
|
|
518
|
+
x*y
|
|
519
|
+
sage: F.degbound()
|
|
520
|
+
2
|
|
521
|
+
sage: F.set_degbound(4)
|
|
522
|
+
sage: F.degbound()
|
|
523
|
+
4
|
|
524
|
+
sage: F.set_degbound(2)
|
|
525
|
+
sage: F.degbound()
|
|
526
|
+
4
|
|
527
|
+
"""
|
|
528
|
+
if d <= self._degbound:
|
|
529
|
+
return
|
|
530
|
+
self._degbound = d
|
|
531
|
+
self._current_ring = make_letterplace_ring(self._commutative_ring, d)
|
|
532
|
+
|
|
533
|
+
# def base_extend(self, R):
|
|
534
|
+
# if self._base.has_coerce_map_from(R):
|
|
535
|
+
# return self
|
|
536
|
+
|
|
537
|
+
################################################
|
|
538
|
+
# Ideals
|
|
539
|
+
|
|
540
|
+
def _ideal_class_(self, n=0):
|
|
541
|
+
"""
|
|
542
|
+
Return the class :class:`~sage.algebras.letterplace.letterplace_ideal.LetterplaceIdeal`.
|
|
543
|
+
|
|
544
|
+
EXAMPLES::
|
|
545
|
+
|
|
546
|
+
sage: F.<x,y,z> = FreeAlgebra(QQ, implementation='letterplace')
|
|
547
|
+
sage: I = [x*y+y*z,x^2+x*y-y*x-y^2]*F
|
|
548
|
+
sage: I
|
|
549
|
+
Right Ideal (x*y + y*z, x*x + x*y - y*x - y*y) of Free Associative Unital Algebra on 3 generators (x, y, z) over Rational Field
|
|
550
|
+
sage: type(I) is F._ideal_class_()
|
|
551
|
+
True
|
|
552
|
+
"""
|
|
553
|
+
from sage.algebras.letterplace.letterplace_ideal import LetterplaceIdeal
|
|
554
|
+
return LetterplaceIdeal
|
|
555
|
+
|
|
556
|
+
def ideal_monoid(self):
|
|
557
|
+
"""
|
|
558
|
+
Return the monoid of ideals of this free algebra.
|
|
559
|
+
|
|
560
|
+
EXAMPLES::
|
|
561
|
+
|
|
562
|
+
sage: F.<x,y> = FreeAlgebra(GF(2), implementation='letterplace')
|
|
563
|
+
sage: F.ideal_monoid()
|
|
564
|
+
Monoid of ideals of Free Associative Unital Algebra on 2 generators (x, y) over Finite Field of size 2
|
|
565
|
+
sage: F.ideal_monoid() is F.ideal_monoid()
|
|
566
|
+
True
|
|
567
|
+
"""
|
|
568
|
+
if self.__monoid is None:
|
|
569
|
+
self.__monoid = IdealMonoid_nc(self)
|
|
570
|
+
return self.__monoid
|
|
571
|
+
|
|
572
|
+
# Auxiliary methods
|
|
573
|
+
cdef str exponents_to_string(self, E):
|
|
574
|
+
"""
|
|
575
|
+
This auxiliary method is used for the string representation of elements of this free algebra.
|
|
576
|
+
|
|
577
|
+
EXAMPLES::
|
|
578
|
+
|
|
579
|
+
sage: F.<x,y,z> = FreeAlgebra(GF(2), implementation='letterplace')
|
|
580
|
+
sage: x*y*x*z # indirect doctest
|
|
581
|
+
x*y*x*z
|
|
582
|
+
|
|
583
|
+
It should be possible to use the letterplace algebra to implement the
|
|
584
|
+
free algebra generated by the elements of a finitely generated free abelian
|
|
585
|
+
monoid. However, we cannot use it, yet. So, for now, we raise an error::
|
|
586
|
+
|
|
587
|
+
sage: from sage.algebras.letterplace.free_algebra_element_letterplace import FreeAlgebraElement_letterplace
|
|
588
|
+
sage: P = F.commutative_ring()
|
|
589
|
+
sage: FreeAlgebraElement_letterplace(F, P.0*P.1^2+P.1^3) # indirect doctest
|
|
590
|
+
<repr(<sage.algebras.letterplace.free_algebra_element_letterplace.FreeAlgebraElement_letterplace at 0x...>) failed: NotImplementedError:
|
|
591
|
+
Apparently you tried to view the letterplace algebra with
|
|
592
|
+
shift-multiplication as the free algebra over a finitely
|
|
593
|
+
generated free abelian monoid.
|
|
594
|
+
In principle, this is correct, but it is not implemented, yet.>
|
|
595
|
+
"""
|
|
596
|
+
cdef int ngens = self._ngens
|
|
597
|
+
cdef int nblocks = len(E) // ngens
|
|
598
|
+
cdef int i, j, base, exp, var_ind
|
|
599
|
+
cdef list out = []
|
|
600
|
+
cdef list tmp
|
|
601
|
+
for i from 0<=i<nblocks:
|
|
602
|
+
# warning : the loop index is changed during the loop
|
|
603
|
+
base = i*ngens
|
|
604
|
+
tmp = [(j, E[base + j]) for j in range(ngens) if E[base + j]]
|
|
605
|
+
if not tmp:
|
|
606
|
+
continue
|
|
607
|
+
var_ind, exp = tmp[0]
|
|
608
|
+
if len(tmp) > 1 or exp > 1:
|
|
609
|
+
raise NotImplementedError("\n Apparently you tried to view the letterplace algebra with\n shift-multiplication as the free algebra over a finitely\n generated free abelian monoid.\n In principle, this is correct, but it is not implemented, yet.")
|
|
610
|
+
out.append(self._names[var_ind])
|
|
611
|
+
i += self._degrees[var_ind] - 1
|
|
612
|
+
return '*'.join(out)
|
|
613
|
+
|
|
614
|
+
# Auxiliary methods
|
|
615
|
+
cdef str exponents_to_latex(self, E):
|
|
616
|
+
r"""
|
|
617
|
+
This auxiliary method is used for the representation of elements of this free algebra as a latex string.
|
|
618
|
+
|
|
619
|
+
EXAMPLES::
|
|
620
|
+
|
|
621
|
+
sage: K.<z> = GF(25)
|
|
622
|
+
sage: F.<a,b,c> = FreeAlgebra(K, implementation='letterplace', degrees=[1,2,3])
|
|
623
|
+
sage: -(a*b*(z+1)-c)^2
|
|
624
|
+
(2*z + 1)*a*b*a*b + (z + 1)*a*b*c + (z + 1)*c*a*b - c*c
|
|
625
|
+
sage: latex(-(a*b*(z+1)-c)^2) # indirect doctest
|
|
626
|
+
\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
|
|
627
|
+
"""
|
|
628
|
+
cdef int ngens = self._ngens
|
|
629
|
+
cdef int nblocks = len(E) // ngens
|
|
630
|
+
cdef int i, j, base, exp, var_ind
|
|
631
|
+
cdef list out = []
|
|
632
|
+
cdef list tmp
|
|
633
|
+
cdef list names = self.latex_variable_names()
|
|
634
|
+
for i from 0<=i<nblocks:
|
|
635
|
+
# warning : the loop index is changed during the loop
|
|
636
|
+
base = i*ngens
|
|
637
|
+
tmp = [(j, E[base+j]) for j in range(ngens) if E[base+j]]
|
|
638
|
+
if not tmp:
|
|
639
|
+
continue
|
|
640
|
+
var_ind, exp = tmp[0]
|
|
641
|
+
if len(tmp) > 1 or exp > 1:
|
|
642
|
+
raise NotImplementedError("\n Apparently you tried to view the letterplace algebra with\n shift-multiplication as the free algebra over a finitely\n generated free abelian monoid.\n In principle, this is correct, but it is not implemented, yet.")
|
|
643
|
+
out.append(names[var_ind])
|
|
644
|
+
i += (self._degrees[var_ind] - 1)
|
|
645
|
+
return ' '.join(out)
|
|
646
|
+
|
|
647
|
+
def _reductor_(self, g, d):
|
|
648
|
+
"""
|
|
649
|
+
Return a commutative ideal that can be used to compute the normal
|
|
650
|
+
form of a free algebra element of a given degree.
|
|
651
|
+
|
|
652
|
+
INPUT:
|
|
653
|
+
|
|
654
|
+
- ``g`` -- list of elements of this free algebra
|
|
655
|
+
- ``d`` -- integer
|
|
656
|
+
|
|
657
|
+
OUTPUT:
|
|
658
|
+
|
|
659
|
+
An ideal such that reduction of a letterplace polynomial by that ideal corresponds
|
|
660
|
+
to reduction of an element of degree at most ``d`` by ``g``.
|
|
661
|
+
|
|
662
|
+
EXAMPLES::
|
|
663
|
+
|
|
664
|
+
sage: F.<x,y,z> = FreeAlgebra(QQ, implementation='letterplace')
|
|
665
|
+
sage: I = F*[x*y+y*z,x^2+x*y-y*x-y^2]*F
|
|
666
|
+
sage: p = y*x*y + y*y*y + y*z*y - y*z*z
|
|
667
|
+
sage: p.reduce(I)
|
|
668
|
+
y*y*y - y*y*z + y*z*y - y*z*z
|
|
669
|
+
sage: G = F._reductor_(I.gens(),3); G
|
|
670
|
+
Ideal (x*y_1 + y*z_1, x_1*y_2 + y_1*z_2, x*x_1 + x*y_1 - y*x_1 - y*y_1, x_1*x_2 + x_1*y_2 - y_1*x_2 - y_1*y_2) of Multivariate Polynomial Ring in x, y, z, x_1, y_1, z_1, x_2, y_2, z_2... over Rational Field
|
|
671
|
+
|
|
672
|
+
We do not use the usual reduction method for polynomials in
|
|
673
|
+
Sage, since it does the reductions in a different order
|
|
674
|
+
compared to Singular. Therefore, we call the original Singular
|
|
675
|
+
reduction method, and prevent a warning message by asserting
|
|
676
|
+
that `G` is a Groebner basis. ::
|
|
677
|
+
|
|
678
|
+
sage: from sage.libs.singular.function import singular_function
|
|
679
|
+
sage: poly_reduce = singular_function("NF")
|
|
680
|
+
sage: q = poly_reduce(p.letterplace_polynomial(), G, ring=F.current_ring(), attributes={G:{"isSB":1}}); q
|
|
681
|
+
y*y_1*y_2 - y*y_1*z_2 + y*z_1*y_2 - y*z_1*z_2
|
|
682
|
+
sage: p.reduce(I).letterplace_polynomial() == q
|
|
683
|
+
True
|
|
684
|
+
"""
|
|
685
|
+
cdef list out = []
|
|
686
|
+
C = self.current_ring()
|
|
687
|
+
cdef FreeAlgebraElement_letterplace x
|
|
688
|
+
ngens = self._ngens
|
|
689
|
+
cdef list G = [C(x._poly) for x in g]
|
|
690
|
+
from sage.groups.perm_gps.permgroup_named import CyclicPermutationGroup
|
|
691
|
+
CG = CyclicPermutationGroup(C.ngens())
|
|
692
|
+
for y in G:
|
|
693
|
+
out.extend([y] + [y * CG[ngens * (n + 1)]
|
|
694
|
+
for n in range(d - y.degree())])
|
|
695
|
+
return C.ideal(out)
|
|
696
|
+
|
|
697
|
+
###########################
|
|
698
|
+
# Coercion
|
|
699
|
+
cpdef _coerce_map_from_(self, S):
|
|
700
|
+
"""
|
|
701
|
+
A ring ``R`` coerces into ``self``, if:
|
|
702
|
+
|
|
703
|
+
- it coerces into the current polynomial ring, or
|
|
704
|
+
- it is a free graded algebra in letterplace implementation,
|
|
705
|
+
the generator names of ``R`` are a proper subset of the
|
|
706
|
+
generator names of ``self``, the degrees of equally named
|
|
707
|
+
generators are equal, and the base ring of ``R`` coerces
|
|
708
|
+
into the base ring of ``self``.
|
|
709
|
+
|
|
710
|
+
TESTS:
|
|
711
|
+
|
|
712
|
+
Coercion from the base ring::
|
|
713
|
+
|
|
714
|
+
sage: F.<x,y,z> = FreeAlgebra(GF(5), implementation='letterplace')
|
|
715
|
+
sage: 5 == F.zero() # indirect doctest
|
|
716
|
+
True
|
|
717
|
+
|
|
718
|
+
Coercion from another free graded algebra::
|
|
719
|
+
|
|
720
|
+
sage: F.<t,y,z> = FreeAlgebra(ZZ, implementation='letterplace', degrees=[4,2,3])
|
|
721
|
+
sage: G = FreeAlgebra(GF(5), implementation='letterplace', names=['x','y','z','t'], degrees=[1,2,3,4])
|
|
722
|
+
sage: t*G.0 # indirect doctest
|
|
723
|
+
t*x
|
|
724
|
+
"""
|
|
725
|
+
if self == S or self._current_ring.has_coerce_map_from(S):
|
|
726
|
+
return True
|
|
727
|
+
cdef int i
|
|
728
|
+
# Do we have another letterplace algebra?
|
|
729
|
+
if not isinstance(S, FreeAlgebra_letterplace):
|
|
730
|
+
return False
|
|
731
|
+
# Do the base rings coerce?
|
|
732
|
+
if not self.base_ring().has_coerce_map_from(S.base_ring()):
|
|
733
|
+
return False
|
|
734
|
+
# Do the names match?
|
|
735
|
+
cdef tuple degs, Sdegs, names, Snames
|
|
736
|
+
names = self.variable_names()
|
|
737
|
+
Snames = S.variable_names()
|
|
738
|
+
if not set(names).issuperset(Snames):
|
|
739
|
+
return False
|
|
740
|
+
# Do the degrees match
|
|
741
|
+
degs = self._degrees
|
|
742
|
+
Sdegs = (<FreeAlgebra_letterplace>S)._degrees
|
|
743
|
+
for i in range(S.ngens()):
|
|
744
|
+
if degs[names.index(Snames[i])] != Sdegs[i]:
|
|
745
|
+
return False
|
|
746
|
+
return True
|
|
747
|
+
|
|
748
|
+
def _an_element_(self):
|
|
749
|
+
"""
|
|
750
|
+
Return an element.
|
|
751
|
+
|
|
752
|
+
EXAMPLES::
|
|
753
|
+
|
|
754
|
+
sage: F.<x,y,z> = FreeAlgebra(QQ, implementation='letterplace')
|
|
755
|
+
sage: F.an_element() # indirect doctest
|
|
756
|
+
x
|
|
757
|
+
"""
|
|
758
|
+
return FreeAlgebraElement_letterplace(self, self._current_ring.an_element(), check=False)
|
|
759
|
+
|
|
760
|
+
# def random_element(self, degree=2, terms=5):
|
|
761
|
+
# """
|
|
762
|
+
# Return a random element of a given degree and with a given number of terms.
|
|
763
|
+
#
|
|
764
|
+
# INPUT:
|
|
765
|
+
#
|
|
766
|
+
# - ``degree`` -- the maximal degree of the output (default: 2)
|
|
767
|
+
# - ``terms`` -- the maximal number of terms of the output (default: 5)
|
|
768
|
+
#
|
|
769
|
+
# NOTE:
|
|
770
|
+
#
|
|
771
|
+
# This method is currently not useful at all.
|
|
772
|
+
#
|
|
773
|
+
# Not tested.
|
|
774
|
+
# """
|
|
775
|
+
# self.set_degbound(degree)
|
|
776
|
+
# while(1):
|
|
777
|
+
# p = self._current_ring.random_element(degree=degree,terms=terms)
|
|
778
|
+
# if p.is_homogeneous():
|
|
779
|
+
# break
|
|
780
|
+
# return FreeAlgebraElement_letterplace(self, p, check=False)
|
|
781
|
+
|
|
782
|
+
def _from_dict_(self, dict D, check=True):
|
|
783
|
+
"""
|
|
784
|
+
Create an element from a dictionary.
|
|
785
|
+
|
|
786
|
+
INPUT:
|
|
787
|
+
|
|
788
|
+
- ``D`` -- dictionary; keys: tuples of exponents, values:
|
|
789
|
+
the coefficients of the corresponding monomial
|
|
790
|
+
in the to-be-created element
|
|
791
|
+
- ``check`` -- boolean (default: ``True``);
|
|
792
|
+
this is forwarded to the initialisation of
|
|
793
|
+
:class:`~sage.algebras.letterplace.free_algebra_element_letterplace.FreeAlgebraElement_letterplace`
|
|
794
|
+
|
|
795
|
+
TESTS:
|
|
796
|
+
|
|
797
|
+
This method applied to the dictionary of any element must
|
|
798
|
+
return the same element. This must hold true even if the
|
|
799
|
+
underlying letterplace ring has been extended in the meantime.
|
|
800
|
+
::
|
|
801
|
+
|
|
802
|
+
sage: F.<x,y,z> = FreeAlgebra(QQ, implementation='letterplace')
|
|
803
|
+
sage: p = 3*x*y+2*z^2
|
|
804
|
+
sage: F.set_degbound(10)
|
|
805
|
+
sage: p == F._from_dict_(dict(p))
|
|
806
|
+
True
|
|
807
|
+
|
|
808
|
+
For the empty dictionary, zero is returned::
|
|
809
|
+
|
|
810
|
+
sage: F._from_dict_({})
|
|
811
|
+
0
|
|
812
|
+
"""
|
|
813
|
+
if not D:
|
|
814
|
+
return self.zero()
|
|
815
|
+
cdef Py_ssize_t l
|
|
816
|
+
for e in D:
|
|
817
|
+
l = len(e)
|
|
818
|
+
break
|
|
819
|
+
cdef dict out = {}
|
|
820
|
+
self.set_degbound(l // self._ngens)
|
|
821
|
+
cdef Py_ssize_t n = self._current_ring.ngens()
|
|
822
|
+
for e, c in D.iteritems():
|
|
823
|
+
out[tuple(e) + (0,) * (n - l)] = c
|
|
824
|
+
return FreeAlgebraElement_letterplace(self, self._current_ring(out),
|
|
825
|
+
check=check)
|
|
826
|
+
|
|
827
|
+
def _element_constructor_(self, x):
|
|
828
|
+
"""
|
|
829
|
+
Return an element of this free algebra.
|
|
830
|
+
|
|
831
|
+
INPUT:
|
|
832
|
+
|
|
833
|
+
An element of a free algebra with a proper subset of generator
|
|
834
|
+
names, or anything that can be interpreted in the polynomial
|
|
835
|
+
ring that is used to implement the letterplace algebra out to
|
|
836
|
+
the current degree bound, or a string that can be interpreted
|
|
837
|
+
as an expression in the algebra (provided that the
|
|
838
|
+
coefficients are numerical).
|
|
839
|
+
|
|
840
|
+
EXAMPLES::
|
|
841
|
+
|
|
842
|
+
sage: F.<t,y,z> = FreeAlgebra(ZZ, implementation='letterplace', degrees=[4,2,3])
|
|
843
|
+
|
|
844
|
+
Conversion of a number::
|
|
845
|
+
|
|
846
|
+
sage: F(3)
|
|
847
|
+
3
|
|
848
|
+
|
|
849
|
+
Interpretation of a string as an algebra element::
|
|
850
|
+
|
|
851
|
+
sage: F('t*y+3*z^2')
|
|
852
|
+
t*y + 3*z*z
|
|
853
|
+
|
|
854
|
+
Conversion from the currently underlying polynomial ring::
|
|
855
|
+
|
|
856
|
+
sage: F.set_degbound(3)
|
|
857
|
+
sage: P = F.current_ring()
|
|
858
|
+
sage: F(P.0*P.7*P.11*P.15*P.17*P.23 - 2*P.2*P.7*P.11*P.14*P.19*P.23)
|
|
859
|
+
t*y - 2*z*z
|
|
860
|
+
|
|
861
|
+
Conversion from a graded sub-algebra::
|
|
862
|
+
|
|
863
|
+
sage: G = FreeAlgebra(GF(5), implementation='letterplace', names=['x','y','z','t'], degrees=[1,2,3,4])
|
|
864
|
+
sage: G(t*y + 2*y^3 - 4*z^2) # indirect doctest
|
|
865
|
+
(2)*y*y*y + z*z + t*y
|
|
866
|
+
"""
|
|
867
|
+
if isinstance(x, str):
|
|
868
|
+
from sage.misc.sage_eval import sage_eval
|
|
869
|
+
return sage_eval(x, locals=self.gens_dict())
|
|
870
|
+
try:
|
|
871
|
+
P = x.parent()
|
|
872
|
+
except AttributeError:
|
|
873
|
+
P = None
|
|
874
|
+
if P is self:
|
|
875
|
+
(<FreeAlgebraElement_letterplace>x)._poly = self._current_ring((<FreeAlgebraElement_letterplace>x)._poly)
|
|
876
|
+
return x
|
|
877
|
+
if isinstance(P, FreeAlgebra_letterplace):
|
|
878
|
+
self.set_degbound(P.degbound())
|
|
879
|
+
Ppoly = (<FreeAlgebra_letterplace>P)._current_ring
|
|
880
|
+
Gens = self._current_ring.gens()
|
|
881
|
+
Names = self._current_ring.variable_names()
|
|
882
|
+
PNames = list(Ppoly.variable_names())
|
|
883
|
+
# translate the slack variables
|
|
884
|
+
PNames[P.ngens(): len(PNames): P.ngens() + 1] = list(Names[self.ngens(): len(Names): self.ngens() + 1])[:P.degbound()]
|
|
885
|
+
x = Ppoly.hom([Gens[Names.index(asdf)] for asdf in PNames])(x.letterplace_polynomial())
|
|
886
|
+
return FreeAlgebraElement_letterplace(self, self._current_ring(x))
|
|
887
|
+
|
|
888
|
+
|
|
889
|
+
cdef class FreeAlgebra_letterplace_libsingular():
|
|
890
|
+
"""
|
|
891
|
+
Internally used wrapper around a Singular Letterplace polynomial ring.
|
|
892
|
+
"""
|
|
893
|
+
|
|
894
|
+
def __cinit__(self, MPolynomialRing_libsingular commutative_ring,
|
|
895
|
+
int degbound):
|
|
896
|
+
from sage.libs.singular.function import singular_function
|
|
897
|
+
freeAlgebra = singular_function("freeAlgebra")
|
|
898
|
+
cdef RingWrap rw = freeAlgebra(commutative_ring, degbound)
|
|
899
|
+
self._lp_ring = singular_ring_reference(rw._ring)
|
|
900
|
+
# `_lp_ring` viewed as `MPolynomialRing_libsingular` with additional
|
|
901
|
+
# letterplace attributes set (for internal use only)
|
|
902
|
+
self._lp_ring_internal = new_CRing(rw, commutative_ring.base_ring())
|
|
903
|
+
self._commutative_ring = commutative_ring
|
|
904
|
+
|
|
905
|
+
def __init__(self, commutative_ring, degbound):
|
|
906
|
+
self._ngens = commutative_ring.ngens() * degbound
|
|
907
|
+
|
|
908
|
+
def __dealloc__(self):
|
|
909
|
+
r"""
|
|
910
|
+
Carefully deallocate the ring, without changing ``currRing``
|
|
911
|
+
(since this method can be at unpredictable times due to garbage
|
|
912
|
+
collection).
|
|
913
|
+
"""
|
|
914
|
+
singular_ring_delete(self._lp_ring)
|