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.

Files changed (493) hide show
  1. PySingular.cpython-314-x86_64-linux-musl.so +0 -0
  2. passagemath_singular-10.6.31rc3.dist-info/METADATA +183 -0
  3. passagemath_singular-10.6.31rc3.dist-info/RECORD +493 -0
  4. passagemath_singular-10.6.31rc3.dist-info/WHEEL +5 -0
  5. passagemath_singular-10.6.31rc3.dist-info/top_level.txt +3 -0
  6. passagemath_singular.libs/libSingular-4-67059f19.4.1.so +0 -0
  7. passagemath_singular.libs/libcddgmp-30166d29.so.0.1.3 +0 -0
  8. passagemath_singular.libs/libfactory-4-9d37bcf4.4.1.so +0 -0
  9. passagemath_singular.libs/libflint-fd6f12fc.so.21.0.0 +0 -0
  10. passagemath_singular.libs/libgcc_s-0cd532bd.so.1 +0 -0
  11. passagemath_singular.libs/libgf2x-9e30c3e3.so.3.0.0 +0 -0
  12. passagemath_singular.libs/libgfortran-2c33b284.so.5.0.0 +0 -0
  13. passagemath_singular.libs/libgmp-0e7fc84e.so.10.5.0 +0 -0
  14. passagemath_singular.libs/libgsl-42cda06f.so.28.0.0 +0 -0
  15. passagemath_singular.libs/libmpfr-aaecbfc0.so.6.2.1 +0 -0
  16. passagemath_singular.libs/libncursesw-9c9e32c3.so.6.5 +0 -0
  17. passagemath_singular.libs/libntl-26885ca2.so.44.0.1 +0 -0
  18. passagemath_singular.libs/libomalloc-0-e9ff96db.9.6.so +0 -0
  19. passagemath_singular.libs/libopenblasp-r0-905cb27d.3.29.so +0 -0
  20. passagemath_singular.libs/libpolys-4-8bcf8e7d.4.1.so +0 -0
  21. passagemath_singular.libs/libquadmath-bb76a5fc.so.0.0.0 +0 -0
  22. passagemath_singular.libs/libreadline-06542304.so.8.2 +0 -0
  23. passagemath_singular.libs/libsingular_resources-4-73bf7623.4.1.so +0 -0
  24. passagemath_singular.libs/libstdc++-5d72f927.so.6.0.33 +0 -0
  25. sage/algebras/all__sagemath_singular.py +3 -0
  26. sage/algebras/fusion_rings/all.py +19 -0
  27. sage/algebras/fusion_rings/f_matrix.py +2448 -0
  28. sage/algebras/fusion_rings/fast_parallel_fmats_methods.cpython-314-x86_64-linux-musl.so +0 -0
  29. sage/algebras/fusion_rings/fast_parallel_fmats_methods.pxd +5 -0
  30. sage/algebras/fusion_rings/fast_parallel_fmats_methods.pyx +538 -0
  31. sage/algebras/fusion_rings/fast_parallel_fusion_ring_braid_repn.cpython-314-x86_64-linux-musl.so +0 -0
  32. sage/algebras/fusion_rings/fast_parallel_fusion_ring_braid_repn.pxd +3 -0
  33. sage/algebras/fusion_rings/fast_parallel_fusion_ring_braid_repn.pyx +331 -0
  34. sage/algebras/fusion_rings/fusion_double.py +899 -0
  35. sage/algebras/fusion_rings/fusion_ring.py +1580 -0
  36. sage/algebras/fusion_rings/poly_tup_engine.cpython-314-x86_64-linux-musl.so +0 -0
  37. sage/algebras/fusion_rings/poly_tup_engine.pxd +24 -0
  38. sage/algebras/fusion_rings/poly_tup_engine.pyx +579 -0
  39. sage/algebras/fusion_rings/shm_managers.cpython-314-x86_64-linux-musl.so +0 -0
  40. sage/algebras/fusion_rings/shm_managers.pxd +24 -0
  41. sage/algebras/fusion_rings/shm_managers.pyx +780 -0
  42. sage/algebras/letterplace/all.py +1 -0
  43. sage/algebras/letterplace/free_algebra_element_letterplace.cpython-314-x86_64-linux-musl.so +0 -0
  44. sage/algebras/letterplace/free_algebra_element_letterplace.pxd +18 -0
  45. sage/algebras/letterplace/free_algebra_element_letterplace.pyx +755 -0
  46. sage/algebras/letterplace/free_algebra_letterplace.cpython-314-x86_64-linux-musl.so +0 -0
  47. sage/algebras/letterplace/free_algebra_letterplace.pxd +35 -0
  48. sage/algebras/letterplace/free_algebra_letterplace.pyx +914 -0
  49. sage/algebras/letterplace/letterplace_ideal.cpython-314-x86_64-linux-musl.so +0 -0
  50. sage/algebras/letterplace/letterplace_ideal.pyx +408 -0
  51. sage/algebras/quatalg/all.py +2 -0
  52. sage/algebras/quatalg/quaternion_algebra.py +4778 -0
  53. sage/algebras/quatalg/quaternion_algebra_cython.cpython-314-x86_64-linux-musl.so +0 -0
  54. sage/algebras/quatalg/quaternion_algebra_cython.pyx +261 -0
  55. sage/algebras/quatalg/quaternion_algebra_element.cpython-314-x86_64-linux-musl.so +0 -0
  56. sage/algebras/quatalg/quaternion_algebra_element.pxd +29 -0
  57. sage/algebras/quatalg/quaternion_algebra_element.pyx +2176 -0
  58. sage/all__sagemath_singular.py +11 -0
  59. sage/ext_data/all__sagemath_singular.py +1 -0
  60. sage/ext_data/singular/function_field/core.lib +98 -0
  61. sage/interfaces/all__sagemath_singular.py +1 -0
  62. sage/interfaces/singular.py +2835 -0
  63. sage/libs/all__sagemath_singular.py +1 -0
  64. sage/libs/singular/__init__.py +1 -0
  65. sage/libs/singular/decl.pxd +1168 -0
  66. sage/libs/singular/function.cpython-314-x86_64-linux-musl.so +0 -0
  67. sage/libs/singular/function.pxd +87 -0
  68. sage/libs/singular/function.pyx +1901 -0
  69. sage/libs/singular/function_factory.py +61 -0
  70. sage/libs/singular/groebner_strategy.cpython-314-x86_64-linux-musl.so +0 -0
  71. sage/libs/singular/groebner_strategy.pxd +22 -0
  72. sage/libs/singular/groebner_strategy.pyx +582 -0
  73. sage/libs/singular/option.cpython-314-x86_64-linux-musl.so +0 -0
  74. sage/libs/singular/option.pyx +671 -0
  75. sage/libs/singular/polynomial.cpython-314-x86_64-linux-musl.so +0 -0
  76. sage/libs/singular/polynomial.pxd +39 -0
  77. sage/libs/singular/polynomial.pyx +661 -0
  78. sage/libs/singular/ring.cpython-314-x86_64-linux-musl.so +0 -0
  79. sage/libs/singular/ring.pxd +58 -0
  80. sage/libs/singular/ring.pyx +893 -0
  81. sage/libs/singular/singular.cpython-314-x86_64-linux-musl.so +0 -0
  82. sage/libs/singular/singular.pxd +72 -0
  83. sage/libs/singular/singular.pyx +1944 -0
  84. sage/libs/singular/standard_options.py +145 -0
  85. sage/matrix/all__sagemath_singular.py +1 -0
  86. sage/matrix/matrix_mpolynomial_dense.cpython-314-x86_64-linux-musl.so +0 -0
  87. sage/matrix/matrix_mpolynomial_dense.pxd +7 -0
  88. sage/matrix/matrix_mpolynomial_dense.pyx +615 -0
  89. sage/rings/all__sagemath_singular.py +1 -0
  90. sage/rings/function_field/all__sagemath_singular.py +1 -0
  91. sage/rings/function_field/derivations_polymod.py +911 -0
  92. sage/rings/function_field/element_polymod.cpython-314-x86_64-linux-musl.so +0 -0
  93. sage/rings/function_field/element_polymod.pyx +406 -0
  94. sage/rings/function_field/function_field_polymod.py +2611 -0
  95. sage/rings/function_field/ideal_polymod.py +1775 -0
  96. sage/rings/function_field/order_polymod.py +1475 -0
  97. sage/rings/function_field/place_polymod.py +681 -0
  98. sage/rings/polynomial/all__sagemath_singular.py +1 -0
  99. sage/rings/polynomial/multi_polynomial_ideal_libsingular.cpython-314-x86_64-linux-musl.so +0 -0
  100. sage/rings/polynomial/multi_polynomial_ideal_libsingular.pxd +5 -0
  101. sage/rings/polynomial/multi_polynomial_ideal_libsingular.pyx +339 -0
  102. sage/rings/polynomial/multi_polynomial_libsingular.cpython-314-x86_64-linux-musl.so +0 -0
  103. sage/rings/polynomial/multi_polynomial_libsingular.pxd +30 -0
  104. sage/rings/polynomial/multi_polynomial_libsingular.pyx +6277 -0
  105. sage/rings/polynomial/plural.cpython-314-x86_64-linux-musl.so +0 -0
  106. sage/rings/polynomial/plural.pxd +48 -0
  107. sage/rings/polynomial/plural.pyx +3171 -0
  108. sage/symbolic/all__sagemath_singular.py +1 -0
  109. sage/symbolic/comparison_impl.pxi +428 -0
  110. sage/symbolic/constants_c_impl.pxi +178 -0
  111. sage/symbolic/expression.cpython-314-x86_64-linux-musl.so +0 -0
  112. sage/symbolic/expression.pxd +7 -0
  113. sage/symbolic/expression.pyx +14200 -0
  114. sage/symbolic/getitem_impl.pxi +202 -0
  115. sage/symbolic/pynac.pxi +572 -0
  116. sage/symbolic/pynac_constant_impl.pxi +133 -0
  117. sage/symbolic/pynac_function_impl.pxi +206 -0
  118. sage/symbolic/pynac_impl.pxi +2576 -0
  119. sage/symbolic/pynac_wrap.h +124 -0
  120. sage/symbolic/series_impl.pxi +272 -0
  121. sage/symbolic/substitution_map_impl.pxi +94 -0
  122. sage_wheels/bin/ESingular +0 -0
  123. sage_wheels/bin/Singular +0 -0
  124. sage_wheels/bin/TSingular +0 -0
  125. sage_wheels/lib/singular/MOD/cohomo.la +41 -0
  126. sage_wheels/lib/singular/MOD/cohomo.so +0 -0
  127. sage_wheels/lib/singular/MOD/customstd.la +41 -0
  128. sage_wheels/lib/singular/MOD/customstd.so +0 -0
  129. sage_wheels/lib/singular/MOD/freealgebra.la +41 -0
  130. sage_wheels/lib/singular/MOD/freealgebra.so +0 -0
  131. sage_wheels/lib/singular/MOD/gfanlib.la +41 -0
  132. sage_wheels/lib/singular/MOD/gfanlib.so +0 -0
  133. sage_wheels/lib/singular/MOD/gitfan.la +41 -0
  134. sage_wheels/lib/singular/MOD/gitfan.so +0 -0
  135. sage_wheels/lib/singular/MOD/interval.la +41 -0
  136. sage_wheels/lib/singular/MOD/interval.so +0 -0
  137. sage_wheels/lib/singular/MOD/loctriv.la +41 -0
  138. sage_wheels/lib/singular/MOD/loctriv.so +0 -0
  139. sage_wheels/lib/singular/MOD/machinelearning.la +41 -0
  140. sage_wheels/lib/singular/MOD/machinelearning.so +0 -0
  141. sage_wheels/lib/singular/MOD/p_Procs_FieldGeneral.la +41 -0
  142. sage_wheels/lib/singular/MOD/p_Procs_FieldGeneral.so +0 -0
  143. sage_wheels/lib/singular/MOD/p_Procs_FieldIndep.la +41 -0
  144. sage_wheels/lib/singular/MOD/p_Procs_FieldIndep.so +0 -0
  145. sage_wheels/lib/singular/MOD/p_Procs_FieldQ.la +41 -0
  146. sage_wheels/lib/singular/MOD/p_Procs_FieldQ.so +0 -0
  147. sage_wheels/lib/singular/MOD/p_Procs_FieldZp.la +41 -0
  148. sage_wheels/lib/singular/MOD/p_Procs_FieldZp.so +0 -0
  149. sage_wheels/lib/singular/MOD/partialgb.la +41 -0
  150. sage_wheels/lib/singular/MOD/partialgb.so +0 -0
  151. sage_wheels/lib/singular/MOD/pyobject.la +41 -0
  152. sage_wheels/lib/singular/MOD/pyobject.so +0 -0
  153. sage_wheels/lib/singular/MOD/singmathic.la +41 -0
  154. sage_wheels/lib/singular/MOD/singmathic.so +0 -0
  155. sage_wheels/lib/singular/MOD/sispasm.la +41 -0
  156. sage_wheels/lib/singular/MOD/sispasm.so +0 -0
  157. sage_wheels/lib/singular/MOD/subsets.la +41 -0
  158. sage_wheels/lib/singular/MOD/subsets.so +0 -0
  159. sage_wheels/lib/singular/MOD/systhreads.la +41 -0
  160. sage_wheels/lib/singular/MOD/systhreads.so +0 -0
  161. sage_wheels/lib/singular/MOD/syzextra.la +41 -0
  162. sage_wheels/lib/singular/MOD/syzextra.so +0 -0
  163. sage_wheels/libexec/singular/MOD/change_cost +0 -0
  164. sage_wheels/libexec/singular/MOD/singularsurf +11 -0
  165. sage_wheels/libexec/singular/MOD/singularsurf_jupyter +9 -0
  166. sage_wheels/libexec/singular/MOD/singularsurf_win +10 -0
  167. sage_wheels/libexec/singular/MOD/solve_IP +0 -0
  168. sage_wheels/libexec/singular/MOD/surfex +16 -0
  169. sage_wheels/libexec/singular/MOD/toric_ideal +0 -0
  170. sage_wheels/share/factory/gftables/10201 +342 -0
  171. sage_wheels/share/factory/gftables/1024 +37 -0
  172. sage_wheels/share/factory/gftables/10609 +356 -0
  173. sage_wheels/share/factory/gftables/11449 +384 -0
  174. sage_wheels/share/factory/gftables/11881 +398 -0
  175. sage_wheels/share/factory/gftables/121 +6 -0
  176. sage_wheels/share/factory/gftables/12167 +408 -0
  177. sage_wheels/share/factory/gftables/125 +7 -0
  178. sage_wheels/share/factory/gftables/12769 +428 -0
  179. sage_wheels/share/factory/gftables/128 +7 -0
  180. sage_wheels/share/factory/gftables/1331 +47 -0
  181. sage_wheels/share/factory/gftables/1369 +48 -0
  182. sage_wheels/share/factory/gftables/14641 +490 -0
  183. sage_wheels/share/factory/gftables/15625 +523 -0
  184. sage_wheels/share/factory/gftables/16 +3 -0
  185. sage_wheels/share/factory/gftables/16129 +540 -0
  186. sage_wheels/share/factory/gftables/16384 +549 -0
  187. sage_wheels/share/factory/gftables/16807 +563 -0
  188. sage_wheels/share/factory/gftables/1681 +58 -0
  189. sage_wheels/share/factory/gftables/169 +8 -0
  190. sage_wheels/share/factory/gftables/17161 +574 -0
  191. sage_wheels/share/factory/gftables/1849 +64 -0
  192. sage_wheels/share/factory/gftables/18769 +628 -0
  193. sage_wheels/share/factory/gftables/19321 +646 -0
  194. sage_wheels/share/factory/gftables/19683 +659 -0
  195. sage_wheels/share/factory/gftables/2048 +71 -0
  196. sage_wheels/share/factory/gftables/2187 +75 -0
  197. sage_wheels/share/factory/gftables/2197 +76 -0
  198. sage_wheels/share/factory/gftables/2209 +76 -0
  199. sage_wheels/share/factory/gftables/22201 +742 -0
  200. sage_wheels/share/factory/gftables/22801 +762 -0
  201. sage_wheels/share/factory/gftables/2401 +82 -0
  202. sage_wheels/share/factory/gftables/243 +11 -0
  203. sage_wheels/share/factory/gftables/24389 +815 -0
  204. sage_wheels/share/factory/gftables/24649 +824 -0
  205. sage_wheels/share/factory/gftables/25 +3 -0
  206. sage_wheels/share/factory/gftables/256 +11 -0
  207. sage_wheels/share/factory/gftables/26569 +888 -0
  208. sage_wheels/share/factory/gftables/27 +3 -0
  209. sage_wheels/share/factory/gftables/27889 +932 -0
  210. sage_wheels/share/factory/gftables/2809 +96 -0
  211. sage_wheels/share/factory/gftables/28561 +954 -0
  212. sage_wheels/share/factory/gftables/289 +12 -0
  213. sage_wheels/share/factory/gftables/29791 +995 -0
  214. sage_wheels/share/factory/gftables/29929 +1000 -0
  215. sage_wheels/share/factory/gftables/3125 +107 -0
  216. sage_wheels/share/factory/gftables/32 +4 -0
  217. sage_wheels/share/factory/gftables/32041 +1070 -0
  218. sage_wheels/share/factory/gftables/32761 +1094 -0
  219. sage_wheels/share/factory/gftables/32768 +1095 -0
  220. sage_wheels/share/factory/gftables/343 +14 -0
  221. sage_wheels/share/factory/gftables/3481 +118 -0
  222. sage_wheels/share/factory/gftables/361 +14 -0
  223. sage_wheels/share/factory/gftables/36481 +1218 -0
  224. sage_wheels/share/factory/gftables/3721 +126 -0
  225. sage_wheels/share/factory/gftables/37249 +1244 -0
  226. sage_wheels/share/factory/gftables/38809 +1296 -0
  227. sage_wheels/share/factory/gftables/39601 +1322 -0
  228. sage_wheels/share/factory/gftables/4 +3 -0
  229. sage_wheels/share/factory/gftables/4096 +139 -0
  230. sage_wheels/share/factory/gftables/44521 +1486 -0
  231. sage_wheels/share/factory/gftables/4489 +152 -0
  232. sage_wheels/share/factory/gftables/49 +4 -0
  233. sage_wheels/share/factory/gftables/4913 +166 -0
  234. sage_wheels/share/factory/gftables/49729 +1660 -0
  235. sage_wheels/share/factory/gftables/5041 +170 -0
  236. sage_wheels/share/factory/gftables/50653 +1691 -0
  237. sage_wheels/share/factory/gftables/512 +20 -0
  238. sage_wheels/share/factory/gftables/51529 +1720 -0
  239. sage_wheels/share/factory/gftables/52441 +1750 -0
  240. sage_wheels/share/factory/gftables/529 +20 -0
  241. sage_wheels/share/factory/gftables/5329 +180 -0
  242. sage_wheels/share/factory/gftables/54289 +1812 -0
  243. sage_wheels/share/factory/gftables/57121 +1906 -0
  244. sage_wheels/share/factory/gftables/58081 +1938 -0
  245. sage_wheels/share/factory/gftables/59049 +1971 -0
  246. sage_wheels/share/factory/gftables/6241 +210 -0
  247. sage_wheels/share/factory/gftables/625 +23 -0
  248. sage_wheels/share/factory/gftables/63001 +2102 -0
  249. sage_wheels/share/factory/gftables/64 +5 -0
  250. sage_wheels/share/factory/gftables/6561 +221 -0
  251. sage_wheels/share/factory/gftables/6859 +231 -0
  252. sage_wheels/share/factory/gftables/6889 +232 -0
  253. sage_wheels/share/factory/gftables/729 +27 -0
  254. sage_wheels/share/factory/gftables/7921 +266 -0
  255. sage_wheels/share/factory/gftables/8 +3 -0
  256. sage_wheels/share/factory/gftables/81 +5 -0
  257. sage_wheels/share/factory/gftables/8192 +276 -0
  258. sage_wheels/share/factory/gftables/841 +30 -0
  259. sage_wheels/share/factory/gftables/9 +3 -0
  260. sage_wheels/share/factory/gftables/9409 +316 -0
  261. sage_wheels/share/factory/gftables/961 +34 -0
  262. sage_wheels/share/info/singular.info +191898 -0
  263. sage_wheels/share/singular/LIB/GND.lib +1359 -0
  264. sage_wheels/share/singular/LIB/JMBTest.lib +976 -0
  265. sage_wheels/share/singular/LIB/JMSConst.lib +1363 -0
  266. sage_wheels/share/singular/LIB/KVequiv.lib +699 -0
  267. sage_wheels/share/singular/LIB/SingularityDBM.lib +491 -0
  268. sage_wheels/share/singular/LIB/VecField.lib +1542 -0
  269. sage_wheels/share/singular/LIB/absfact.lib +959 -0
  270. sage_wheels/share/singular/LIB/ainvar.lib +730 -0
  271. sage_wheels/share/singular/LIB/aksaka.lib +419 -0
  272. sage_wheels/share/singular/LIB/alexpoly.lib +2542 -0
  273. sage_wheels/share/singular/LIB/algebra.lib +1193 -0
  274. sage_wheels/share/singular/LIB/all.lib +136 -0
  275. sage_wheels/share/singular/LIB/arcpoint.lib +514 -0
  276. sage_wheels/share/singular/LIB/arnold.lib +4553 -0
  277. sage_wheels/share/singular/LIB/arnoldclassify.lib +2058 -0
  278. sage_wheels/share/singular/LIB/arr.lib +3486 -0
  279. sage_wheels/share/singular/LIB/assprimeszerodim.lib +755 -0
  280. sage_wheels/share/singular/LIB/autgradalg.lib +3361 -0
  281. sage_wheels/share/singular/LIB/bfun.lib +1964 -0
  282. sage_wheels/share/singular/LIB/bimodules.lib +774 -0
  283. sage_wheels/share/singular/LIB/brillnoether.lib +226 -0
  284. sage_wheels/share/singular/LIB/brnoeth.lib +5017 -0
  285. sage_wheels/share/singular/LIB/central.lib +2169 -0
  286. sage_wheels/share/singular/LIB/chern.lib +4162 -0
  287. sage_wheels/share/singular/LIB/cimonom.lib +571 -0
  288. sage_wheels/share/singular/LIB/cisimplicial.lib +1835 -0
  289. sage_wheels/share/singular/LIB/classify.lib +3239 -0
  290. sage_wheels/share/singular/LIB/classify2.lib +1462 -0
  291. sage_wheels/share/singular/LIB/classifyMapGerms.lib +1515 -0
  292. sage_wheels/share/singular/LIB/classify_aeq.lib +3253 -0
  293. sage_wheels/share/singular/LIB/classifyceq.lib +2092 -0
  294. sage_wheels/share/singular/LIB/classifyci.lib +1133 -0
  295. sage_wheels/share/singular/LIB/combinat.lib +91 -0
  296. sage_wheels/share/singular/LIB/compregb.lib +276 -0
  297. sage_wheels/share/singular/LIB/control.lib +1636 -0
  298. sage_wheels/share/singular/LIB/crypto.lib +3795 -0
  299. sage_wheels/share/singular/LIB/curveInv.lib +667 -0
  300. sage_wheels/share/singular/LIB/curvepar.lib +1817 -0
  301. sage_wheels/share/singular/LIB/customstd.lib +100 -0
  302. sage_wheels/share/singular/LIB/deRham.lib +5979 -0
  303. sage_wheels/share/singular/LIB/decodegb.lib +2134 -0
  304. sage_wheels/share/singular/LIB/decomp.lib +1655 -0
  305. sage_wheels/share/singular/LIB/deflation.lib +872 -0
  306. sage_wheels/share/singular/LIB/deform.lib +925 -0
  307. sage_wheels/share/singular/LIB/difform.lib +3055 -0
  308. sage_wheels/share/singular/LIB/divisors.lib +750 -0
  309. sage_wheels/share/singular/LIB/dmod.lib +5817 -0
  310. sage_wheels/share/singular/LIB/dmodapp.lib +3269 -0
  311. sage_wheels/share/singular/LIB/dmodideal.lib +1211 -0
  312. sage_wheels/share/singular/LIB/dmodloc.lib +2645 -0
  313. sage_wheels/share/singular/LIB/dmodvar.lib +818 -0
  314. sage_wheels/share/singular/LIB/dummy.lib +17 -0
  315. sage_wheels/share/singular/LIB/elim.lib +1009 -0
  316. sage_wheels/share/singular/LIB/ellipticcovers.lib +548 -0
  317. sage_wheels/share/singular/LIB/enumpoints.lib +146 -0
  318. sage_wheels/share/singular/LIB/equising.lib +2127 -0
  319. sage_wheels/share/singular/LIB/ffmodstd.lib +2384 -0
  320. sage_wheels/share/singular/LIB/ffsolve.lib +1289 -0
  321. sage_wheels/share/singular/LIB/findifs.lib +778 -0
  322. sage_wheels/share/singular/LIB/finitediff.lib +1768 -0
  323. sage_wheels/share/singular/LIB/finvar.lib +7989 -0
  324. sage_wheels/share/singular/LIB/fpadim.lib +2429 -0
  325. sage_wheels/share/singular/LIB/fpalgebras.lib +1666 -0
  326. sage_wheels/share/singular/LIB/fpaprops.lib +1462 -0
  327. sage_wheels/share/singular/LIB/freegb.lib +3853 -0
  328. sage_wheels/share/singular/LIB/general.lib +1350 -0
  329. sage_wheels/share/singular/LIB/gfan.lib +1768 -0
  330. sage_wheels/share/singular/LIB/gitfan.lib +3130 -0
  331. sage_wheels/share/singular/LIB/gkdim.lib +99 -0
  332. sage_wheels/share/singular/LIB/gmspoly.lib +589 -0
  333. sage_wheels/share/singular/LIB/gmssing.lib +1739 -0
  334. sage_wheels/share/singular/LIB/goettsche.lib +909 -0
  335. sage_wheels/share/singular/LIB/graal.lib +1366 -0
  336. sage_wheels/share/singular/LIB/gradedModules.lib +2541 -0
  337. sage_wheels/share/singular/LIB/graphics.lib +360 -0
  338. sage_wheels/share/singular/LIB/grobcov.lib +7706 -0
  339. sage_wheels/share/singular/LIB/groups.lib +1123 -0
  340. sage_wheels/share/singular/LIB/grwalk.lib +507 -0
  341. sage_wheels/share/singular/LIB/hdepth.lib +194 -0
  342. sage_wheels/share/singular/LIB/help.cnf +57 -0
  343. sage_wheels/share/singular/LIB/hess.lib +1946 -0
  344. sage_wheels/share/singular/LIB/hnoether.lib +4292 -0
  345. sage_wheels/share/singular/LIB/hodge.lib +400 -0
  346. sage_wheels/share/singular/LIB/homolog.lib +1965 -0
  347. sage_wheels/share/singular/LIB/hyperel.lib +975 -0
  348. sage_wheels/share/singular/LIB/inout.lib +679 -0
  349. sage_wheels/share/singular/LIB/integralbasis.lib +6224 -0
  350. sage_wheels/share/singular/LIB/interval.lib +1418 -0
  351. sage_wheels/share/singular/LIB/intprog.lib +778 -0
  352. sage_wheels/share/singular/LIB/invar.lib +443 -0
  353. sage_wheels/share/singular/LIB/involut.lib +980 -0
  354. sage_wheels/share/singular/LIB/jacobson.lib +1215 -0
  355. sage_wheels/share/singular/LIB/kskernel.lib +534 -0
  356. sage_wheels/share/singular/LIB/latex.lib +3146 -0
  357. sage_wheels/share/singular/LIB/lejeune.lib +651 -0
  358. sage_wheels/share/singular/LIB/linalg.lib +2040 -0
  359. sage_wheels/share/singular/LIB/locnormal.lib +212 -0
  360. sage_wheels/share/singular/LIB/lrcalc.lib +526 -0
  361. sage_wheels/share/singular/LIB/makedbm.lib +294 -0
  362. sage_wheels/share/singular/LIB/mathml.lib +813 -0
  363. sage_wheels/share/singular/LIB/matrix.lib +1372 -0
  364. sage_wheels/share/singular/LIB/maxlike.lib +1132 -0
  365. sage_wheels/share/singular/LIB/methods.lib +212 -0
  366. sage_wheels/share/singular/LIB/moddiq.lib +322 -0
  367. sage_wheels/share/singular/LIB/modfinduni.lib +181 -0
  368. sage_wheels/share/singular/LIB/modnormal.lib +218 -0
  369. sage_wheels/share/singular/LIB/modprimdec.lib +1278 -0
  370. sage_wheels/share/singular/LIB/modquotient.lib +269 -0
  371. sage_wheels/share/singular/LIB/modstd.lib +1024 -0
  372. sage_wheels/share/singular/LIB/modular.lib +545 -0
  373. sage_wheels/share/singular/LIB/modules.lib +2561 -0
  374. sage_wheels/share/singular/LIB/modwalk.lib +609 -0
  375. sage_wheels/share/singular/LIB/mondromy.lib +1016 -0
  376. sage_wheels/share/singular/LIB/monomialideal.lib +3851 -0
  377. sage_wheels/share/singular/LIB/mprimdec.lib +2353 -0
  378. sage_wheels/share/singular/LIB/mregular.lib +1863 -0
  379. sage_wheels/share/singular/LIB/multigrading.lib +5629 -0
  380. sage_wheels/share/singular/LIB/ncHilb.lib +777 -0
  381. sage_wheels/share/singular/LIB/ncModslimgb.lib +791 -0
  382. sage_wheels/share/singular/LIB/ncalg.lib +16311 -0
  383. sage_wheels/share/singular/LIB/ncall.lib +31 -0
  384. sage_wheels/share/singular/LIB/ncdecomp.lib +468 -0
  385. sage_wheels/share/singular/LIB/ncfactor.lib +13371 -0
  386. sage_wheels/share/singular/LIB/ncfrac.lib +1023 -0
  387. sage_wheels/share/singular/LIB/nchilbert.lib +448 -0
  388. sage_wheels/share/singular/LIB/nchomolog.lib +759 -0
  389. sage_wheels/share/singular/LIB/ncloc.lib +361 -0
  390. sage_wheels/share/singular/LIB/ncpreim.lib +795 -0
  391. sage_wheels/share/singular/LIB/ncrat.lib +2849 -0
  392. sage_wheels/share/singular/LIB/nctools.lib +1887 -0
  393. sage_wheels/share/singular/LIB/nets.lib +1456 -0
  394. sage_wheels/share/singular/LIB/nfmodstd.lib +1000 -0
  395. sage_wheels/share/singular/LIB/nfmodsyz.lib +732 -0
  396. sage_wheels/share/singular/LIB/noether.lib +1106 -0
  397. sage_wheels/share/singular/LIB/normal.lib +8700 -0
  398. sage_wheels/share/singular/LIB/normaliz.lib +2226 -0
  399. sage_wheels/share/singular/LIB/ntsolve.lib +362 -0
  400. sage_wheels/share/singular/LIB/numerAlg.lib +560 -0
  401. sage_wheels/share/singular/LIB/numerDecom.lib +2261 -0
  402. sage_wheels/share/singular/LIB/olga.lib +1933 -0
  403. sage_wheels/share/singular/LIB/orbitparam.lib +351 -0
  404. sage_wheels/share/singular/LIB/parallel.lib +319 -0
  405. sage_wheels/share/singular/LIB/paraplanecurves.lib +3110 -0
  406. sage_wheels/share/singular/LIB/perron.lib +202 -0
  407. sage_wheels/share/singular/LIB/pfd.lib +2223 -0
  408. sage_wheels/share/singular/LIB/phindex.lib +642 -0
  409. sage_wheels/share/singular/LIB/pointid.lib +673 -0
  410. sage_wheels/share/singular/LIB/polybori.lib +1430 -0
  411. sage_wheels/share/singular/LIB/polyclass.lib +525 -0
  412. sage_wheels/share/singular/LIB/polylib.lib +1174 -0
  413. sage_wheels/share/singular/LIB/polymake.lib +1902 -0
  414. sage_wheels/share/singular/LIB/presolve.lib +1533 -0
  415. sage_wheels/share/singular/LIB/primdec.lib +9576 -0
  416. sage_wheels/share/singular/LIB/primdecint.lib +1782 -0
  417. sage_wheels/share/singular/LIB/primitiv.lib +401 -0
  418. sage_wheels/share/singular/LIB/puiseuxexpansions.lib +1631 -0
  419. sage_wheels/share/singular/LIB/purityfiltration.lib +960 -0
  420. sage_wheels/share/singular/LIB/qhmoduli.lib +1561 -0
  421. sage_wheels/share/singular/LIB/qmatrix.lib +293 -0
  422. sage_wheels/share/singular/LIB/random.lib +455 -0
  423. sage_wheels/share/singular/LIB/ratgb.lib +489 -0
  424. sage_wheels/share/singular/LIB/realclassify.lib +5759 -0
  425. sage_wheels/share/singular/LIB/realizationMatroids.lib +772 -0
  426. sage_wheels/share/singular/LIB/realrad.lib +1197 -0
  427. sage_wheels/share/singular/LIB/recover.lib +2628 -0
  428. sage_wheels/share/singular/LIB/redcgs.lib +3984 -0
  429. sage_wheels/share/singular/LIB/reesclos.lib +465 -0
  430. sage_wheels/share/singular/LIB/resbinomial.lib +2802 -0
  431. sage_wheels/share/singular/LIB/resgraph.lib +789 -0
  432. sage_wheels/share/singular/LIB/resjung.lib +820 -0
  433. sage_wheels/share/singular/LIB/resolve.lib +5110 -0
  434. sage_wheels/share/singular/LIB/resources.lib +170 -0
  435. sage_wheels/share/singular/LIB/reszeta.lib +5473 -0
  436. sage_wheels/share/singular/LIB/ring.lib +1328 -0
  437. sage_wheels/share/singular/LIB/ringgb.lib +343 -0
  438. sage_wheels/share/singular/LIB/rinvar.lib +1153 -0
  439. sage_wheels/share/singular/LIB/rootisolation.lib +1481 -0
  440. sage_wheels/share/singular/LIB/rootsmr.lib +709 -0
  441. sage_wheels/share/singular/LIB/rootsur.lib +886 -0
  442. sage_wheels/share/singular/LIB/rstandard.lib +607 -0
  443. sage_wheels/share/singular/LIB/rwalk.lib +336 -0
  444. sage_wheels/share/singular/LIB/sagbi.lib +1353 -0
  445. sage_wheels/share/singular/LIB/sagbiNormaliz.lib +1622 -0
  446. sage_wheels/share/singular/LIB/sagbiNormaliz0.lib +1498 -0
  447. sage_wheels/share/singular/LIB/sagbigrob.lib +449 -0
  448. sage_wheels/share/singular/LIB/schreyer.lib +321 -0
  449. sage_wheels/share/singular/LIB/schubert.lib +2551 -0
  450. sage_wheels/share/singular/LIB/sets.lib +524 -0
  451. sage_wheels/share/singular/LIB/sheafcoh.lib +1663 -0
  452. sage_wheels/share/singular/LIB/signcond.lib +437 -0
  453. sage_wheels/share/singular/LIB/sing.lib +1094 -0
  454. sage_wheels/share/singular/LIB/sing4ti2.lib +419 -0
  455. sage_wheels/share/singular/LIB/solve.lib +2243 -0
  456. sage_wheels/share/singular/LIB/spcurve.lib +1077 -0
  457. sage_wheels/share/singular/LIB/spectrum.lib +62 -0
  458. sage_wheels/share/singular/LIB/sresext.lib +757 -0
  459. sage_wheels/share/singular/LIB/ssi.lib +143 -0
  460. sage_wheels/share/singular/LIB/standard.lib +2769 -0
  461. sage_wheels/share/singular/LIB/stanleyreisner.lib +473 -0
  462. sage_wheels/share/singular/LIB/stdmodule.lib +547 -0
  463. sage_wheels/share/singular/LIB/stratify.lib +1070 -0
  464. sage_wheels/share/singular/LIB/surf.lib +506 -0
  465. sage_wheels/share/singular/LIB/surf_jupyter.lib +223 -0
  466. sage_wheels/share/singular/LIB/surfacesignature.lib +522 -0
  467. sage_wheels/share/singular/LIB/surfex.lib +1462 -0
  468. sage_wheels/share/singular/LIB/swalk.lib +877 -0
  469. sage_wheels/share/singular/LIB/symodstd.lib +1570 -0
  470. sage_wheels/share/singular/LIB/systhreads.lib +74 -0
  471. sage_wheels/share/singular/LIB/tasks.lib +1324 -0
  472. sage_wheels/share/singular/LIB/tateProdCplxNegGrad.lib +2412 -0
  473. sage_wheels/share/singular/LIB/teachstd.lib +858 -0
  474. sage_wheels/share/singular/LIB/template.lib +116 -0
  475. sage_wheels/share/singular/LIB/toric.lib +1119 -0
  476. sage_wheels/share/singular/LIB/transformation.lib +116 -0
  477. sage_wheels/share/singular/LIB/triang.lib +1197 -0
  478. sage_wheels/share/singular/LIB/tropical.lib +8741 -0
  479. sage_wheels/share/singular/LIB/tropicalEllipticCovers.lib +2922 -0
  480. sage_wheels/share/singular/LIB/tropicalNewton.lib +1128 -0
  481. sage_wheels/share/singular/LIB/tst.lib +1108 -0
  482. sage_wheels/share/singular/LIB/weierstr.lib +241 -0
  483. sage_wheels/share/singular/LIB/zeroset.lib +1478 -0
  484. sage_wheels/share/singular/emacs/.emacs-general +184 -0
  485. sage_wheels/share/singular/emacs/.emacs-singular +234 -0
  486. sage_wheels/share/singular/emacs/COPYING +44 -0
  487. sage_wheels/share/singular/emacs/cmd-cmpl.el +241 -0
  488. sage_wheels/share/singular/emacs/ex-cmpl.el +1681 -0
  489. sage_wheels/share/singular/emacs/hlp-cmpl.el +4318 -0
  490. sage_wheels/share/singular/emacs/lib-cmpl.el +179 -0
  491. sage_wheels/share/singular/emacs/singular.el +4273 -0
  492. sage_wheels/share/singular/emacs/singular.xpm +39 -0
  493. sage_wheels/share/singular/singular.idx +5002 -0
@@ -0,0 +1,1353 @@
1
+ ///////////////////////////////////////////////////////////////////////////
2
+ version="version sagbi.lib 4.3.1.2 Nov_2022 "; // $Id: 58e64469768d63bfceef18cf9096487a5a741370 $
3
+ category="Commutative Algebra";
4
+ info="
5
+ LIBRARY: sagbi.lib Compute SAGBI basis (subalgebra bases analogous to Groebner bases for ideals) of a subalgebra
6
+ AUTHORS: Jan Hackfeld, Jan.Hackfeld@rwth-aachen.de
7
+ Gerhard Pfister, pfister@mathematik.uni-kl.de
8
+ Viktor Levandovskyy, levandov@math.rwth-aachen.de
9
+
10
+ OVERVIEW:
11
+ SAGBI stands for 'subalgebra bases analogous to Groebner bases for ideals'.
12
+ SAGBI bases provide important tools for working with finitely presented
13
+ subalgebras of a polynomial ring. Note, that in contrast to Groebner
14
+ bases, SAGBI bases may be infinite.
15
+
16
+ REFERENCES:
17
+ Ana Bravo: Some Facts About Canonical Subalgebra Bases,
18
+ MSRI Publications 51, p. 247-254
19
+
20
+ PROCEDURES:
21
+ sagbiSPoly(A [,r,m]); computes SAGBI S-polynomials of A
22
+ sagbiReduce(I,A [,t,mt]); performs subalgebra reduction of I by A
23
+ sagbi(A [,m,t]); computes SAGBI basis for A
24
+ sagbiPart(A,k[,m]); computes partial SAGBI basis for A
25
+ algebraicDependence(I,it); performs iterations of SAGBI for algebraic dependencies of I
26
+
27
+ SEE ALSO: algebra_lib
28
+ ";
29
+
30
+ LIB "elim.lib";
31
+ LIB "toric.lib";
32
+ LIB "algebra.lib";
33
+ LIB "ring.lib";
34
+ //////////////////////////////////////////////////////////////////////////////
35
+
36
+ static proc assumeQring()
37
+ {
38
+ if (ideal(basering) != 0)
39
+ {
40
+ ERROR("This function has not yet been implemented over qrings.");
41
+ }
42
+ if(!hasGlobalOrdering(basering))
43
+ {
44
+ ERROR("global ordering required");
45
+ }
46
+ }
47
+
48
+
49
+ static proc uniqueVariableName (string variableName)
50
+ {
51
+ //Adds character "@" at the beginning of variableName until this name ist unique
52
+ //(not contained in the names of the ring variables or description of the coefficient field)
53
+ string ringVars = charstr(basering) + "," + varstr(basering);
54
+ while (find(ringVars,variableName) <> 0)
55
+ {
56
+ variableName="@"+variableName;
57
+ }
58
+ return(variableName);
59
+ }
60
+
61
+ static proc extendRing(def r, ideal leadTermsAlgebra, int method) {
62
+ /* Extends ring r with additional variables. If k=ncols(leadTermsAlgebra) and
63
+ * r contains already m additional variables @y, the procedure adds k-m variables
64
+ * @y(m+1)...@y(k) to the ring.
65
+ * The monomial ordering of the extended ring depends on method.
66
+ * Important: When calling this function, the basering (where algebra is defined) has to be active
67
+ */
68
+ def br=basering;
69
+ int i;
70
+ ideal varsBasering=maxideal(1);
71
+ int numTotalAdditionalVars=ncols(leadTermsAlgebra);
72
+ string variableName=uniqueVariableName("@y");
73
+ //get a variable name different from existing variables
74
+
75
+ //-------- extend current baserring r with new variables @y,
76
+ // one for each new element in ideal algebra -------------
77
+ setring r;
78
+ list l = ring_list(r);
79
+ for (i=nvars(r)-nvars(br)+1; i<=numTotalAdditionalVars;i++)
80
+ {
81
+ l[2][i+nvars(br)]=string(variableName,"(",i,")");
82
+ }
83
+ if (method>=0 && method<=1)
84
+ {
85
+ if (nvars(r)==nvars(br))
86
+ { //first run of spolynomialGB in sagbi construction algorithms
87
+ l[3][size(l[3])+1]=l[3][size(l[3])]; //save module ordering
88
+ l[3][size(l[3])-1]=list("dp",intvec(1:numTotalAdditionalVars));
89
+ }
90
+ else
91
+ { //overwrite existing order for @y(i) to only get one block for the @y
92
+ l[3][size(l[3])-1]=list("dp",intvec(1:numTotalAdditionalVars));
93
+ }
94
+ }
95
+ // VL : todo noncomm case: correctly use l[5] and l[6]
96
+ // that is update matrices
97
+ // at the moment this is troublesome, so use nc_algebra call
98
+ // see how it done in algebraicDependence proc // VL
99
+ def rNew=ring(l);
100
+ setring br;
101
+ return(rNew);
102
+ }
103
+
104
+
105
+ static proc stdKernPhi(ideal kernNew, ideal kernOld, ideal leadTermsAlgebra,int method)
106
+ {
107
+ /* Computes Groebner basis of kernNew+kernOld, where kernOld already is a GB
108
+ * and kernNew contains elements of the form @y(i)-leadTermsAlgebra[i] added to it.
109
+ * The techniques chosen is specified by the integer method
110
+ */
111
+ ideal kern;
112
+ attrib(kernOld,"isSB",1);
113
+ if (method==0)
114
+ {
115
+ kernNew=reduce(kernNew,kernOld);
116
+ kern=kernOld+kernNew;
117
+ kern=std(kern);
118
+ //kern=std(kernOld,kernNew); //Found bug using this method.
119
+ // TODO Change if bug is removed
120
+ //this call of std return Groebner Basis of ideal kernNew+kernOld
121
+ // given that kernOld is a Groebner basis
122
+ }
123
+ if (method==1)
124
+ {
125
+ kernNew=reduce(kernNew,kernOld);
126
+ kern=slimgb(kernNew+kernOld);
127
+ }
128
+ return(kern);
129
+ }
130
+
131
+
132
+ static proc spolynomialsGB(ideal algebra,def r,int method)
133
+ {
134
+ /* This procedure does the actual S-polynomial calculation using Groebner basis methods and is
135
+ * called by the procedures sagbiSPoly,sagbi and sagbiPart. As this procedure is called
136
+ * at each step of the SAGBI construction algorithm, we can reuse the information already calculated
137
+ * which is contained in the ring r. This is done in the following order
138
+ * 1. If r already contain m additional variables and m'=number of elements in algebra, extend r with variables @y(m+1),...,@y(m')
139
+ * 2. Transfer all objects to this ring, kernOld=kern is the Groebnerbasis already computed
140
+ * 3. Define ideal kernNew containing elements of the form leadTermsAlgebra(m+1)-@y(m+1),...,leadTermsAlgebra(m')-@y(m')
141
+ * 4. Compute Groebnerbasis of kernOld+kernNew
142
+ * 5. Compute the new algebraic relations
143
+ */
144
+ int ppl = printlevel-voice+3; //variable for additional printlevel-dependend information
145
+ dbprint(ppl,"//Spoly-1- initialisation and precomputation");
146
+ def br=basering;
147
+ ideal varsBasering=maxideal(1);
148
+ ideal leadTermsAlgebra=lead(algebra);
149
+ //save leading terms as ordering in ring extension
150
+ //may not be compatible with ordering in basering
151
+ int numGenerators=ncols(algebra);
152
+
153
+ def rNew=extendRing(r,leadTermsAlgebra,method);
154
+ // important: br has to be active here
155
+ setring r;
156
+ if (!defined(kern))
157
+ //only true for first run of spolynomialGB in sagbi construction algorithms
158
+ {
159
+ ideal kern=0;
160
+ ideal algebraicRelations=0;
161
+ }
162
+ setring rNew;
163
+ //-------------------------- transfer object to new ring rNew ----------------------
164
+ ideal varsBasering=fetch(br,varsBasering);
165
+ ideal kernOld,algebraicRelationsOld;
166
+ kernOld=fetch(r,kern); //kern is Groebner basis of the kernel of the map Phi:r->K[x_1,...,x_n], x(i)->x(i), @y(i)->leadTermsAlgebra(i)
167
+ algebraicRelationsOld=fetch(r,algebraicRelations);
168
+ ideal leadTermsAlgebra=fetch(br,leadTermsAlgebra);
169
+ ideal listOfVariables=maxideal(1);
170
+ //---------define kernNew containing elements to be added to the ideal kern --------
171
+ ideal kernNew;
172
+ for (int i=nvars(r)-nvars(br)+1; i<=numGenerators; i++)
173
+ {
174
+ kernNew[i-nvars(r)+nvars(br)]=leadTermsAlgebra[i]-listOfVariables[i+nvars(br)];
175
+ }
176
+ //--------------- calculate kernel of Phi depending on method chosen ---------------
177
+ dbprint(ppl,"//Spoly-2- Groebner basis computation");
178
+ attrib(kernOld,"isSB",1);
179
+ ideal kern=stdKernPhi(kernNew,kernOld,leadTermsAlgebra,method);
180
+ dbprint(ppl-2,"//Spoly-2-1- ideal kern",kern);
181
+ //-------------------------- calculate algebraic relations -----------------------
182
+ dbprint(ppl,"//Spoly-3- computing new algebraic relations");
183
+ ideal algebraicRelations=nselect(kern,1..nvars(br));
184
+ attrib(algebraicRelationsOld,"isSB",1);
185
+ ideal algebraicRelationsNew=reduce(algebraicRelations,algebraicRelationsOld);
186
+ /* canonicalizing: */
187
+ algebraicRelationsNew=canonicalform(algebraicRelationsNew);
188
+ dbprint(ppl-2,"//Spoly-3-1- ideal of new algebraic relations",algebraicRelationsNew);
189
+ /* algebraicRelationsOld is a groebner basis by construction (as variable
190
+ * ordering is
191
+ * block ordering we have an elimination ordering for the varsBasering)
192
+ * Therefore, to only get the new algebraic relations, calculate
193
+ * <algebraicRelations>\<algebraicRelationsOld> using groebner reduction
194
+ */
195
+ kill kernOld,kernNew,algebraicRelationsOld,listOfVariables;
196
+ export algebraicRelationsNew,algebraicRelations,kern;
197
+ setring br;
198
+ return(rNew);
199
+ }
200
+
201
+ static proc spolynomialsToric(ideal algebra) {
202
+ /* This procedure does the actual S-polynomial calculation using toric.lib for
203
+ * computation of a Groebner basis for the toric ideal kern(phi), where
204
+ * phi:K[y_1,...,y_m]->K[x_1,...,x_n], y_i->leadmonom(algebra[i])
205
+ * By suitable substitutions we obtain the kernel of the map
206
+ * K[y_1,...,y_m]->K[x_1,...,x_n], x(i)->x(i), @y(i)->leadterm(algebra[i])
207
+ */
208
+ int ppl = printlevel-voice+3; //variable for additional printlevel-dependend information
209
+ dbprint(ppl,"//Spoly-1- initialisation and precomputation");
210
+ def br=basering;
211
+ int m=ncols(algebra);
212
+ int n=nvars(basering);
213
+ intvec tempVec;
214
+ int i,j;
215
+ ideal leadCoefficients;
216
+ for (i=1;i<=m; i++)
217
+ {
218
+ leadCoefficients[i]=leadcoef(algebra[i]);
219
+ }
220
+ dbprint(ppl-2,"//Spoly-1-1- Vector of leading coefficients",leadCoefficients);
221
+ int k=1;
222
+ for (i=1;i<=n;i++)
223
+ {
224
+ for (j=1; j<=m; j++)
225
+ {
226
+ tempVec[k]=leadexp(algebra[j])[i];
227
+ k++;
228
+ }
229
+ }
230
+ //The columns of the matrix A are now the exponent vectors
231
+ //of the leadings monomials in algebra.
232
+ intmat A[n][m]=intmat(tempVec,n,m);
233
+ dbprint(ppl-2,"//Spoly-1-2- Matrix A",A);
234
+ //Create the preimage ring K[@y(1),...,@y(m)], where m=ncols(algebra).
235
+ string variableName=uniqueVariableName("@y");
236
+ list l = ring_list(basering);
237
+ for (i=1; i<=m;i++)
238
+ {
239
+ l[2][i]=string(variableName,"(",i,")");
240
+ }
241
+ l[3][2]=l[3][size(l[3])];
242
+ l[3][1]=list("dp",intvec(1:m));
243
+ def rNew=ring(l);
244
+ setring rNew;
245
+ //Use toric_ideal to compute the kernel
246
+ dbprint(ppl,"//Spoly-2- call of toric_ideal");
247
+ ideal algebraicRelations=toric_ideal(A,"ect");
248
+ //Suitable substitution
249
+ dbprint(ppl,"//Spoly-3- substitutions");
250
+ ideal leadCoefficients=fetch(br,leadCoefficients);
251
+ for (i=1; i<=m; i++)
252
+ {
253
+ if (leadCoefficients[i]!=0)
254
+ {
255
+ algebraicRelations=subst(algebraicRelations,var(i),1/leadCoefficients[i]*var(i));
256
+ }
257
+ }
258
+ dbprint(ppl-2,"//Spoly-3-1- algebraic relations",algebraicRelations);
259
+ export algebraicRelations;
260
+ return(rNew);
261
+ }
262
+
263
+
264
+ static proc reductionGB(ideal F, ideal algebra,def r, int tailreduction,int method,int parRed)
265
+ {
266
+ /* This procedure does the actual SAGBI/subalgebra reduction using GB methods and is
267
+ * called by the procedures sagbiReduce,sagbi and sagbiPart
268
+ * If r already is an extension of the basering
269
+ * and contains the ideal kern needed for the subalgebra reduction,
270
+ * the reduction can be started directly, at each reduction step using the fact that
271
+ * p=reduce(leadF,kern) in K[@y(1),...,@y(m)] <=> leadF in K[lead(algebra)]
272
+ * Otherwise some precomputation has to be done, outlined below.
273
+ * When using sagbiReduce,sagbi and sagbiPart the integer parRed will always be zero. Only the procedure
274
+ * algebraicDependence causes this procedure to be called with parRed<>0. The only difference when parRed<>0
275
+ * is that the reduction algorithms returns the non-zero constants it attains (instead of just returning zero as the
276
+ * correct remainder), as they will be expressions in parameters for an algebraic dependence.
277
+ */
278
+ int ppl = printlevel-voice+3; //variable for additional printlevel-dependend information
279
+ dbprint(ppl,"//Red-1- initialisation and precomputation");
280
+ def br=basering;
281
+ int numVarsBasering=nvars(br);
282
+ ideal varsBasering=maxideal(1);
283
+ int i;
284
+
285
+ if (numVarsBasering==nvars(r))
286
+ {
287
+ dbprint(ppl-1,"//Red-1-1- Groebner basis computation");
288
+ /* Case that ring r is the same ring as the basering. Using proc extendRing,
289
+ * stdKernPhi
290
+ * one construct the extension of the current baserring with new variables @y, one for each element
291
+ * in ideal algebra and calculates the kernel of Phi, where
292
+ * Phi: r---->br, x_i-->x_i, y_i-->f_i,
293
+ * algebra={f_1,...f_m}, br=K[x1,...,x_n] und r=K[x1,...x_n,@y1,...@y_m]
294
+ * This is similarly dones
295
+ * (however step by step for each run of the SAGBI construction algorithm)
296
+ * in the procedure spolynomialsGB
297
+ */
298
+ ideal leadTermsAlgebra=lead(algebra);
299
+ kill r;
300
+ def r=extendRing(br,leadTermsAlgebra,method);
301
+ setring r;
302
+ ideal listOfVariables=maxideal(1);
303
+ ideal leadTermsAlgebra=fetch(br,leadTermsAlgebra);
304
+ ideal kern;
305
+ for (i=1; i<=ncols(leadTermsAlgebra); i++)
306
+ {
307
+ kern[i]=leadTermsAlgebra[i]-listOfVariables[numVarsBasering+i];
308
+ }
309
+ kern=stdKernPhi(kern,0,leadTermsAlgebra,method);
310
+ dbprint(ppl-2,"//Red-1-1-1- Ideal kern",kern);
311
+ }
312
+ setring r;
313
+ poly p,leadF;
314
+ ideal varsBasering=fetch(br,varsBasering);
315
+ setring br;
316
+ map phi=r,varsBasering,algebra;
317
+ poly p,normalform,leadF;
318
+ intvec tempExp;
319
+ //-------------algebraic reduction for each polynomial F[i] ------------------------
320
+ dbprint(ppl,"//Red-2- reduction, polynomial by polynomial");
321
+ for (i=1; i<=ncols(F);i++)
322
+ {
323
+ dbprint(ppl-1,"//Red-2-"+string(i)+"- starting with new polynomial");
324
+ dbprint(ppl-2,"//Red-2-"+string(i)+"-1- Polynomial before reduction",F[i]);
325
+ normalform=0;
326
+ while (F[i]!=0)
327
+ {
328
+ leadF=lead(F[i]);
329
+ if(leadmonom(leadF)==1)
330
+ {
331
+ //K is always contained in the subalgebra,
332
+ //thus the remainder is zero in this case
333
+ if (parRed)
334
+ {
335
+ //If parRed<>0 save non-zero constants the reduction algorithms attains.
336
+ break;
337
+ }
338
+ else
339
+ {
340
+ F[i]=0;
341
+ break;
342
+ }
343
+ }
344
+ //note: as the ordering in br and r might not be compatible
345
+ //it can be that lead(F[i]) in r is
346
+ //different from lead(F[i]) in br.
347
+ //To take the "correct" leading term therefore take lead(F[i])
348
+ //in br and transfer it to the extension r
349
+ setring r;
350
+ leadF=fetch(br,leadF);
351
+ p=reduce(leadF,kern);
352
+ if (leadmonom(p)<varsBasering[numVarsBasering])
353
+ {
354
+ //as chosen ordering is a block ordering,
355
+ //lm(p) in K[y_1...y_m] is equivalent to lm(p)<x_n
356
+ //Needs to be changed, if no block ordering is used!
357
+ setring br;
358
+ F[i]=F[i]-phi(p);
359
+ }
360
+ else
361
+ {
362
+ if (tailreduction)
363
+ {
364
+ setring br;
365
+ normalform=normalform+lead(F[i]);
366
+ F[i]=F[i]-lead(F[i]);
367
+ }
368
+ else
369
+ {
370
+ setring br;
371
+ break;
372
+ }
373
+ }
374
+ }
375
+ if (tailreduction)
376
+ {
377
+ F[i] = normalform;
378
+ }
379
+ dbprint(ppl-2,"//Red-2-"+string(i)+"-2- Polynomial after reduction",F[i]);
380
+ }
381
+ return(F);
382
+ }
383
+
384
+ static proc reduceByMonomials(ideal algebra)
385
+ /*This procedures uses the sagbiReduce procedure to reduce all polynomials in algebra,
386
+ * which are not monomials, by the subset of all monomials.
387
+ */
388
+ {
389
+ ideal monomials;
390
+ int i;
391
+ for (i=1; i<=ncols(algebra);i++)
392
+ {
393
+ if(size(algebra[i])==1)
394
+ {
395
+ monomials[i]=algebra[i];
396
+ algebra[i]=0;
397
+ }
398
+ else
399
+ {
400
+ monomials[i]=0;
401
+ }
402
+ }
403
+ //Monomials now contains the subset of all monomials in algebra,
404
+ //algebra contains the non-monomials.
405
+ if(size(monomials)>0)
406
+ {
407
+ algebra=sagbiReduce(algebra,monomials,1);
408
+ for (i=1; i<=ncols(algebra);i++)
409
+ {
410
+ if(size(monomials[i])==1)
411
+ {
412
+ //Put back monomials into algebra.
413
+ algebra[i]=monomials[i];
414
+ }
415
+ }
416
+ }
417
+ return(algebra);
418
+ }
419
+
420
+
421
+ static proc sagbiConstruction(ideal algebra, int iterations, int tailreduction, int method,int parRed)
422
+ /* This procedure is the SAGBI construction algorithm and does the actual computation
423
+ * both for the procedure sagbi and sagbiPart.
424
+ * - If the sagbi procedure calls this procedure, iterations==-1
425
+ * and this procedure only stops
426
+ * if all S-Polynomials reduce to zero
427
+ * (criterion for termination of SAGBI construction algorithm).
428
+ * - If the sagbiPart procedure calls this procedure, iterations>=0
429
+ * and iterations specifies the
430
+ * number of iterations. A degree boundary is not used here.
431
+ * When this method is called via the procedures sagbi and sagbiPart the integer parRed
432
+ * will always be zero. Only the procedure algebraicDependence calls this procedure with
433
+ * parRed<>0. The only difference when parRed<>0 is that the reduction algorithms returns
434
+ * the non-zero constants it attains (instead of just returning zero as the correct
435
+ * remainder), as they will be expressions in parameters for an algebraic dependence.
436
+ * These constants are saved in the ideal reducedParameters.
437
+ */
438
+ {
439
+ int ppl = printlevel-voice+3; //variable for additional printlevel-dependend information
440
+ dbprint(ppl,"// -0- initialisation and precomputation");
441
+ def br=basering;
442
+ int i=1;
443
+
444
+ ideal reducedParameters;
445
+ int numReducedParameters=1; //number of elements plus one in reducedParameters
446
+ int j;
447
+ if (parRed==0) //if parRed<>0 the algebra does not contain monomials and normalisation should be avoided
448
+ {
449
+ algebra=reduceByMonomials(algebra);
450
+ algebra=simplify(simplify(algebra,3),4);
451
+ }
452
+ // canonicalizing the gen's:
453
+ algebra = canonicalform(algebra);
454
+ ideal P=1;
455
+ //note: P is initialized this way, so that the while loop is entered.
456
+ //P gets overridden there, anyhow.
457
+ ideal varsBasering=maxideal(1);
458
+ map phi;
459
+ ideal spolynomialsNew;
460
+ def r=br;
461
+ while (size(P)>0)
462
+ {
463
+ dbprint(ppl,"// -"+string(i)+"- interaction of SAGBI construction algorithm");
464
+ dbprint(ppl-1,"// -"+string(i)+"-1- Computing algebraic relations");
465
+ def rNew=spolynomialsGB(algebra,r,method); /* canonicalizing inside! */
466
+ kill r;
467
+ def r=rNew;
468
+ kill rNew;
469
+ phi=r,varsBasering,algebra;
470
+ dbprint(ppl-1,"// -"+string(i)+"-2- Substituting into algebraic relations");
471
+ spolynomialsNew=simplify(phi(algebraicRelationsNew),6);
472
+ //By construction spolynomialsNew only contains the spolynomials,
473
+ //that have not already
474
+ //been calculated in the steps before.
475
+ dbprint(ppl-1,"// -"+string(i)+"-3- SAGBI reduction");
476
+ dbprint(ppl-2,"// -"+string(i)+"-3-1- new S-polynomials before reduction",spolynomialsNew);
477
+ P=reductionGB(spolynomialsNew,algebra,r,tailreduction,method,parRed);
478
+ if (parRed)
479
+ {
480
+ for(j=1; j<=ncols(P); j++)
481
+ {
482
+ if (leadmonom(P[j])==1)
483
+ {
484
+ reducedParameters[numReducedParameters]=P[j];
485
+ P[j]=0;
486
+ numReducedParameters++;
487
+ }
488
+ }
489
+ }
490
+ if (parRed==0)
491
+ {
492
+ P=reduceByMonomials(P);
493
+ //Reducing with monomials is cheap and can only result in less terms
494
+ P=simplify(simplify(P,3),4);
495
+ //Avoid that zeros are added to the bases or one element in P more than once
496
+ }
497
+ else
498
+ {
499
+ P=simplify(P,6);
500
+ }
501
+ /* canonicalize ! */
502
+ P = canonicalform(P);
503
+ dbprint(ppl-2,"// -"+string(i)+"-3-1- new S-polynomials after reduction",P);
504
+ algebra=algebra,P;
505
+ //Note that elements and order of elements must in algebra must not be changed,
506
+ //otherwise the already calculated
507
+ //ideal in r will give wrong results. Thus it is important to use a komma here.
508
+ i=i+1;
509
+ if (iterations!=-1 && i>iterations) //When iterations==-1 the number of iterations is unlimited
510
+ {
511
+ break;
512
+ }
513
+ }
514
+ if (iterations!=-1)
515
+ { //case that sagbiPart called this procedure
516
+ if (size(P)==0)
517
+ {
518
+ dbprint(4-voice,
519
+ "//SAGBI construction algorithm terminated after "+string(i-1)
520
+ +" iterations, as all SAGBI S-polynomials reduced to 0.
521
+ //Returned generators therefore are a SAGBI basis.");
522
+ }
523
+ else
524
+ {
525
+ dbprint(4-voice,
526
+ "//SAGBI construction algorithm stopped as it reached the limit of "
527
+ +string(iterations)+" iterations.
528
+ //In general the returned generators are no SAGBI basis for the given algebra.");
529
+ }
530
+ }
531
+ kill r;
532
+ if (parRed)
533
+ {
534
+ algebra=algebra,reducedParameters;
535
+ }
536
+ algebra = simplify(algebra,6);
537
+ algebra = canonicalform(algebra);
538
+ return(algebra);
539
+ }
540
+
541
+
542
+ proc sagbiSPoly(ideal algebra,list #)
543
+ "USAGE: sagbiSPoly(A[, returnRing, meth]); A is an ideal, returnRing and meth are integers.
544
+ RETURN: ideal or ring
545
+ ASSUME: basering is not a qring
546
+ PURPOSE: Returns SAGBI S-polynomials of the leading terms of a given ideal A if returnRing=0.
547
+ @* Otherwise returns a new ring containing the ideals algebraicRelations
548
+ @* and spolynomials, where these objects are explained by their name.
549
+ @* See the example on how to access these objects.
550
+ @* The other optional argument meth determines which method is
551
+ @* used for computing the algebraic relations.
552
+ @* - If meth=0 (default), the procedure std is used.
553
+ @* - If meth=1, the procedure slimgb is used.
554
+ @* - If meth=2, the procedure uses toric_ideal.
555
+ EXAMPLE: example sagbiSPoly; shows an example"
556
+ {
557
+ assumeQring();
558
+ int returnRing;
559
+ int method=0;
560
+ def br=basering;
561
+ ideal spolynomials;
562
+ if (size(#)>=1)
563
+ {
564
+ if (typeof(#[1])=="int")
565
+ {
566
+ returnRing=#[1];
567
+ }
568
+ else
569
+ {
570
+ ERROR("Type of first optional argument needs to be int.");
571
+ }
572
+ }
573
+ if (size(#)==2)
574
+ {
575
+ if (typeof(#[2])=="int")
576
+ {
577
+ if (#[2]<0 || #[2]>2)
578
+ {
579
+ ERROR("Type of second optional argument needs to be 0,1 or 2.");
580
+ }
581
+ else
582
+ {
583
+ method=#[2];
584
+ }
585
+ }
586
+ else
587
+ {
588
+ ERROR("Type of second optional argument needs to be int.");
589
+ }
590
+ }
591
+ if (method>=0 and method<=1)
592
+ {
593
+ ideal varsBasering=maxideal(1);
594
+ def rNew=spolynomialsGB(algebra,br,method);
595
+ map phi=rNew,varsBasering,algebra;
596
+ spolynomials=simplify(phi(algebraicRelationsNew),7);
597
+ }
598
+ if(method==2)
599
+ {
600
+ def r2=spolynomialsToric(algebra);
601
+ map phi=r2,algebra;
602
+ spolynomials=simplify(phi(algebraicRelations),7);
603
+ def rNew=extendRing(br,lead(algebra),0);
604
+ setring rNew;
605
+ ideal algebraicRelations=imap(r2,algebraicRelations);
606
+ export algebraicRelations;
607
+ setring br;
608
+ }
609
+
610
+ if (returnRing==0)
611
+ {
612
+ return(spolynomials);
613
+ }
614
+ else
615
+ {
616
+ setring rNew;
617
+ ideal spolynomials=fetch(br,spolynomials);
618
+ export spolynomials;
619
+ setring br;
620
+ return(rNew);
621
+ }
622
+ }
623
+ example
624
+ { "EXAMPLE:"; echo = 2;
625
+ ring r= 0,(x,y),dp;
626
+ ideal A=x*y+x,x*y^2,y^2+y,x^2+x;
627
+ //------------------ Compute the SAGBI S-polynomials only
628
+ sagbiSPoly(A);
629
+ //------------------ Extended ring is to be returned, which contains
630
+ // the ideal of algebraic relations and the ideal of the S-polynomials
631
+ def rNew=sagbiSPoly(A,1); setring rNew;
632
+ spolynomials;
633
+ algebraicRelations;
634
+ //----------------- Now we verify that the substitution of A[i] into @y(i)
635
+ // results in the spolynomials listed above
636
+ ideal A=fetch(r,A);
637
+ map phi=rNew,x,y,A;
638
+ ideal spolynomials2=simplify(phi(algebraicRelations),1);
639
+ spolynomials2;
640
+ }
641
+
642
+
643
+ proc sagbiReduce(def idealORpoly, ideal algebra, list #)
644
+ "USAGE: sagbiReduce(I, A[, tr, mt]); I, A ideals, tr, mt optional integers
645
+ RETURN: ideal of remainders of I after SAGBI reduction by A
646
+ ASSUME: basering is not a qring
647
+ PURPOSE:
648
+ @format
649
+ The optional argument tr=tailred determines whether tail reduction will be performed.
650
+ - If (tailred=0), no tail reduction is done.
651
+ - If (tailred<>0), tail reduction is done.
652
+ The other optional argument meth determines which method is
653
+ used for Groebner basis computations.
654
+ - If mt=0 (default), the procedure std is used.
655
+ - If mt=1, the procedure slimgb is used.
656
+ @end format
657
+ EXAMPLE: example sagbiReduce; shows an example"
658
+ {
659
+ assumeQring();
660
+ int tailreduction=0; //Default
661
+ int method=0; //Default
662
+ ideal I;
663
+ if(typeof(idealORpoly)=="ideal")
664
+ {
665
+ I=idealORpoly;
666
+ }
667
+ else
668
+ {
669
+ if(typeof(idealORpoly)=="poly")
670
+ {
671
+ I[1]=idealORpoly;
672
+ }
673
+ else
674
+ {
675
+ ERROR("Type of first argument needs to be an ideal or polynomial.");
676
+ }
677
+ }
678
+ if (size(#)>=1)
679
+ {
680
+ if (typeof(#[1])=="int")
681
+ {
682
+ tailreduction=#[1];
683
+ }
684
+ else
685
+ {
686
+ ERROR("Type of optional argument needs to be int.");
687
+ }
688
+ }
689
+ if (size(#)>=2 )
690
+ {
691
+ if (typeof(#[2])=="int")
692
+ {
693
+ if (#[2]<0 || #[2]>1)
694
+ {
695
+ ERROR("Type of second optional argument needs to be 0 or 1.");
696
+ }
697
+ else
698
+ {
699
+ method=#[2];
700
+ }
701
+ }
702
+ else
703
+ {
704
+ ERROR("Type of optional arguments needs to be int.");
705
+ }
706
+ }
707
+
708
+ def r=basering;
709
+ I=simplify(reductionGB(I,algebra,r,tailreduction,method,0),1);
710
+
711
+ if(typeof(idealORpoly)=="ideal")
712
+ {
713
+ return(I);
714
+ }
715
+ else
716
+ {
717
+ if(typeof(idealORpoly)=="poly")
718
+ {
719
+ return(I[1]);
720
+ }
721
+ }
722
+ }
723
+ example
724
+ { "EXAMPLE:"; echo = 2;
725
+ ring r=0,(x,y,z),dp;
726
+ ideal A=x2,2*x2y+y,x3y2;
727
+ poly p1=x^5+x2y+y;
728
+ poly p2=x^16+x^12*y^5+6*x^8*y^4+x^6+y^4+3;
729
+ ideal P=p1,p2;
730
+ //---------------------------------------------
731
+ //SAGBI reduction of polynomial p1 by algebra A.
732
+ //Default call, that is, no tail-reduction is done.
733
+ sagbiReduce(p1,A);
734
+ //---------------------------------------------
735
+ //SAGBI reduction of set of polynomials P by algebra A,
736
+ //now tail-reduction is done.
737
+ sagbiReduce(P,A,1);
738
+ }
739
+
740
+ proc sagbi(ideal algebra, list #)
741
+ "USAGE: sagbi(A[, tr, mt]); A ideal, tr, mt optional integers
742
+ RETURN: ideal, a SAGBI basis for A
743
+ ASSUME: basering is not a qring
744
+ PURPOSE: Computes a SAGBI basis for the subalgebra given by the generators in A.
745
+ @format
746
+ The optional argument tr=tailred determines whether tail reduction will be performed.
747
+ - If (tailred=0), no tail reduction is performed,
748
+ - If (tailred<>0), tail reduction is performed.
749
+ The other optional argument meth determines which method is
750
+ used for Groebner basis computations.
751
+ - If mt=0 (default), the procedure std is used.
752
+ - If mt=1, the procedure slimgb is used.
753
+ @end format
754
+ EXAMPLE: example sagbi; shows an example"
755
+ {
756
+ assumeQring();
757
+ int tailreduction=0; //default value
758
+ int method=0; //default value
759
+ if (size(#)>=1)
760
+ {
761
+ if (typeof(#[1])=="int")
762
+ {
763
+ tailreduction=#[1];
764
+ }
765
+ else
766
+ {
767
+ ERROR("Type of optional argument needs to be int.");
768
+ }
769
+ }
770
+ if (size(#)>=2 )
771
+ {
772
+ if (typeof(#[2])=="int")
773
+ {
774
+ if (#[2]<0 || #[2]>1)
775
+ {
776
+ ERROR("Type of second optional argument needs to be 0 or 1.");
777
+ }
778
+ else
779
+ {
780
+ method=#[2];
781
+ }
782
+ }
783
+ else
784
+ {
785
+ ERROR("Type of optional arguments needs to be int.");
786
+ }
787
+ }
788
+ ideal a;
789
+ a=sagbiConstruction(algebra,-1,tailreduction,method,0);
790
+ a=simplify(a,7);
791
+ // a=interreduced(a);
792
+ return(a);
793
+ }
794
+ example
795
+ { "EXAMPLE:"; echo = 2;
796
+ ring r= 0,(x,y,z),dp;
797
+ ideal A=x2,y2,xy+y;
798
+ //Default call, no tail-reduction is done.
799
+ sagbi(A);
800
+ //---------------------------------------------
801
+ //Call with tail-reduction and method specified.
802
+ sagbi(A,1,0);
803
+ }
804
+
805
+ proc sagbiPart(ideal algebra, int iterations, list #)
806
+ "USAGE: sagbiPart(A, k,[tr, mt]); A is an ideal, k, tr and mt are integers
807
+ RETURN: ideal
808
+ ASSUME: basering is not a qring
809
+ PURPOSE: Performs k iterations of the SAGBI construction algorithm for the subalgebra given by the generators given by A.
810
+ @format
811
+ The optional argument tr=tailred determines if tail reduction will be performed.
812
+ - If (tailred=0), no tail reduction is performed,
813
+ - If (tailred<>0), tail reduction is performed.
814
+ The other optional argument meth determines which method is
815
+ used for Groebner basis computations.
816
+ - If mt=0 (default), the procedure std is used.
817
+ - If mt=1, the procedure slimgb is used.
818
+ @end format
819
+ EXAMPLE: example sagbiPart; shows an example"
820
+ {
821
+ assumeQring();
822
+ int tailreduction=0; //default value
823
+ int method=0; //default value
824
+ if (size(#)>=1)
825
+ {
826
+ if (typeof(#[1])=="int")
827
+ {
828
+ tailreduction=#[1];
829
+ }
830
+ else
831
+ {
832
+ ERROR("Type of optional argument needs to be int.");
833
+ }
834
+ }
835
+ if (size(#)>=2 )
836
+ {
837
+ if (typeof(#[2])=="int")
838
+ {
839
+ if (#[2]<0 || #[2]>3)
840
+ {
841
+ ERROR("Type of second optional argument needs to be 0 or 1.");
842
+ }
843
+ else
844
+ {
845
+ method=#[2];
846
+ }
847
+ }
848
+ else
849
+ {
850
+ ERROR("Type of optional arguments needs to be int.");
851
+ }
852
+ }
853
+ if (iterations<0)
854
+ {
855
+ ERROR("Number of iterations needs to be non-negative.");
856
+ }
857
+ ideal a;
858
+ a=sagbiConstruction(algebra,iterations,tailreduction,method,0);
859
+ a=simplify(a,6);
860
+ // a=interreduced(a);
861
+ return(a);
862
+ }
863
+ example
864
+ { "EXAMPLE:"; echo = 2;
865
+ ring r= 0,(x,y,z),dp;
866
+ //The following algebra does not have a finite SAGBI basis.
867
+ ideal A=x,xy-y2,xy2;
868
+ //---------------------------------------------------
869
+ //Call with two iterations, no tail-reduction is done.
870
+ sagbiPart(A,2);
871
+ //---------------------------------------------------
872
+ //Call with three iterations, tail-reduction and method 0.
873
+ sagbiPart(A,3,1,0);
874
+ }
875
+
876
+
877
+ proc algebraicDependence(ideal I,int iterations)
878
+ "USAGE: algebraicDependence(I,it); I an an ideal, it is an integer
879
+ RETURN: ring
880
+ ASSUME: basering is not a qring
881
+ PURPOSE: Returns a ring containing the ideal @code{algDep}, which contains possibly
882
+ @* some algebraic dependencies of the elements of I obtained through @code{it}
883
+ @* iterations of the SAGBI construction algorithms. See the example on how
884
+ @* to access these objects.
885
+ EXAMPLE: example algebraicDependence; shows an example"
886
+ {
887
+ assumeQring();
888
+ int ppl = printlevel-voice+3; //variable for additional printlevel-dependend information
889
+ dbprint(ppl,"//AlgDep-1- initialisation and precomputation");
890
+ def br=basering;
891
+ int i;
892
+ I=simplify(I,2); //avoid that I contains zeros
893
+
894
+ //Create two polynomial rings, which both are extensions of the current basering.
895
+ //The first ring will contain the additional parameters @c(1),...,@c(m), the second one
896
+ //will contain the additional variables @c(1),...,@c(m), where m=ncols(I).
897
+ string parameterName=uniqueVariableName("@c");
898
+ list l = ringlist(basering);
899
+ list parList;
900
+ for (i=1; i<=ncols(I);i++)
901
+ {
902
+ parList[i]=string(parameterName,"(",i,")");
903
+ }
904
+ l[1]=list(l[1],parList,list(list("dp",1:ncols(I)))); //add @c(i) to the ring as parameters
905
+ ideal temp=0;
906
+ l[1][4]=temp;
907
+ // addition VL: noncomm case
908
+ int isNCcase = 0; // default for comm
909
+ // if (size(l)>4)
910
+ // {
911
+ // // that is we're in the noncomm algebra
912
+ // isNCcase = 1; // noncomm
913
+ // matrix @C@ = l[5];
914
+ // matrix @D@ = l[6];
915
+ // l = l[1],l[2],l[3],l[4];
916
+ // }
917
+ def parameterRing=ring(l);
918
+
919
+ string extendVarName=uniqueVariableName("@c");
920
+ list l2 = ring_list(basering);
921
+ for (i=1; i<=ncols(I);i++)
922
+ {
923
+ l2[2][i+nvars(br)]=string(extendVarName,"(",i,")"); //add @c(i) to the rings as variables
924
+ }
925
+ l2[3][size(l2[3])+1]=l2[3][size(l2[3])];
926
+ l2[3][size(l2[3])-1]=list("dp",intvec(1:ncols(I)));
927
+ // if (isNCcase)
928
+ // {
929
+ // // that is we're in the noncomm algebra
930
+ // matrix @C@2 = l2[5];
931
+ // matrix @D@2 = l2[6];
932
+ // l2 = l2[1],l2[2],l2[3],l2[4];
933
+ // }
934
+
935
+ def extendVarRing=ring(l2);
936
+ setring extendVarRing;
937
+ // VL : this requires extended matrices
938
+ // let's forget it for the moment
939
+ // since this holds only for showing the answer
940
+ // if (isNCcase)
941
+ // {
942
+ // matrix C2=imap(br,@C@2);
943
+ // matrix D2=imap(br,@D@2);
944
+ // def er2 = nc_algebra(C2,D2);
945
+ // setring er2;
946
+ // def extendVarRing=er2;
947
+ // }
948
+
949
+ setring parameterRing;
950
+
951
+ // if (isNCcase)
952
+ // {
953
+ // matrix C=imap(br,@C@);
954
+ // matrix D=imap(br,@D@);
955
+ // def pr = nc_algebra(C,D);
956
+ // setring pr;
957
+ // def parameterRing=pr;
958
+ // }
959
+
960
+ //Compute a partial SAGBI basis of the algebra generated by I[1]-@c(1),...,I[m]-@c(m),
961
+ //where the @c(n) are parameters
962
+ ideal I=fetch(br,I);
963
+ ideal algebra;
964
+ for (i=1; i<=ncols(I);i++)
965
+ {
966
+ algebra[i]=I[i]-par(i);
967
+ }
968
+ dbprint(ppl,"//AlgDep-2- call of SAGBI construction algorithm");
969
+ algebra=sagbiConstruction(algebra, iterations,0,0,1);
970
+ dbprint(ppl,"//AlgDep-3- postprocessing of results");
971
+ int j=1;
972
+ //If K[x_1,...,x_n] was the basering, then algebra is in K(@c(1),...,@c(m))[x_1,...x_n]. We intersect
973
+ //elements in algebra with K(@c(1),..,@c(n)) to get algDep. Note that @c(i) can only appear in the numerator,
974
+ //as the SAGBI construction algorithms just multiplies and subtracts polynomials. So actually we have
975
+ //algDep=algebra intersect K[@c(1),...,@c(m)]
976
+ ideal algDep;
977
+ for (i=1; i<= ncols(algebra); i++)
978
+ {
979
+ if (leadmonom(algebra[i])==1) //leadmonom(algebra[i])==1 iff algebra[i] in K[@c(1),...,@c(m)]
980
+ {
981
+ algDep[j]=algebra[i];
982
+ j++;
983
+ }
984
+ }
985
+ //Transfer algebraic dependencies to ring where @c(i) are not parameters, but now variables.
986
+ setring extendVarRing;
987
+ ideal algDep=imap(parameterRing,algDep);
988
+ ideal algebra=imap(parameterRing,algebra);
989
+ //Now get rid of constants in K that may have been added to algDep.
990
+ for (i=1; i<=ncols(algDep); i++)
991
+ {
992
+ if(leadmonom(algDep[i])==1)
993
+ {
994
+ algDep[i]=0;
995
+ }
996
+ }
997
+ algDep=simplify(algDep,2);
998
+ export algDep,algebra;
999
+ setring br;
1000
+ return(extendVarRing);
1001
+ }
1002
+ example
1003
+ { "EXAMPLE:"; echo = 2;
1004
+ ring r= 0,(x,y),dp;
1005
+ //The following algebra does not have a finite SAGBI basis.
1006
+ ideal I=x^2, xy-y2, xy2;
1007
+ //---------------------------------------------------
1008
+ //Call with two iterations
1009
+ def DI = algebraicDependence(I,2);
1010
+ setring DI; algDep;
1011
+ // we see that no dependency has been seen so far
1012
+ //---------------------------------------------------
1013
+ //Call with two iterations
1014
+ setring r; kill DI;
1015
+ def DI = algebraicDependence(I,3);
1016
+ setring DI; algDep;
1017
+ map F = DI,x,y,x^2, xy-y2, xy2;
1018
+ F(algDep); // we see that it is a dependence indeed
1019
+ }
1020
+
1021
+ static proc interreduced(ideal I)
1022
+ {
1023
+ /* performs subalgebra interreduction of a set of subalgebra generators */
1024
+ int ppl = printlevel-voice+3; //variable for additional printlevel-dependend information
1025
+ dbprint(ppl,"//Interred-1- starting interreduction");
1026
+ ideal J,B;
1027
+ int i,j,k;
1028
+ poly f;
1029
+ for(k=1;k<=ncols(I);k++)
1030
+ {
1031
+ dbprint(ppl-1,"//Interred-1-"+string(k)+"- reducing next poly");
1032
+ f=I[k];
1033
+ I[k]=0;
1034
+ f=sagbiReduce(f,I,1);
1035
+ I[k]=f;
1036
+ }
1037
+ I=simplify(I,2);
1038
+ dbprint(ppl,"//Interred-2- interreduction completed");
1039
+ return(I);
1040
+ }
1041
+ ///////////////////////////////////////////////////////////////////////////////
1042
+
1043
+ proc sagbiReduction(poly p,ideal dom,list #)
1044
+ "USAGE: sagbiReduction(p,dom[,n]); p poly , dom ideal
1045
+ RETURN: polynomial, after one step of subalgebra reduction
1046
+ PURPOSE:
1047
+ @format
1048
+ Three algorithm variants are used to perform subalgebra reduction.
1049
+ The positive integer n determines which variant should be used.
1050
+ n may take the values 0 (default), 1 or 2.
1051
+ @end format
1052
+ NOTE: works over both polynomial rings and their quotients
1053
+ EXAMPLE: example sagbiReduction; shows an example"
1054
+ {
1055
+ def bsr=basering;
1056
+ ideal B=ideal(bsr);//When the basering is quotient ring this type casting
1057
+ // gives the quotient ideal.
1058
+ int b=size(B);
1059
+ int n=nvars(bsr);
1060
+
1061
+ //In quotient rings, SINGULAR, usually does not reduce polynomials w.r.t the
1062
+ //quotient ideal,therefore we should first reduce,
1063
+ //when it is necessary for computations,
1064
+ // to have a uniquely determined representant for each equivalent
1065
+ //class,which is the case of this algorithm.
1066
+
1067
+ if(b !=0) //means that the basering is a quotient ring
1068
+ {
1069
+ p=reduce(p,std(0));
1070
+ dom=reduce(dom,std(0));
1071
+ }
1072
+
1073
+ int i,choose;
1074
+ int z=ncols(dom);
1075
+
1076
+ if((size(#)>0) && (typeof(#[1])=="int"))
1077
+ {
1078
+ choose = #[1];
1079
+ }
1080
+ if (size(#)>1)
1081
+ {
1082
+ choose =#[2];
1083
+ }
1084
+
1085
+ //=======================first algorithm(default)=========================
1086
+ if ( choose == 0 )
1087
+ {
1088
+ list L = algebra_containment(lead(p),lead(dom),1);
1089
+ if( L[1]==1 )
1090
+ {
1091
+ // the ring L[2] = char(bsr),(x(1..nvars(bsr)),y(1..z)),(dp(n),dp(m)),
1092
+ // contains poly check s.t. LT(p) is of the form check(LT(f1),...,LT(fr))
1093
+ def s1 = L[2];
1094
+ map psi = s1,maxideal(1),dom;
1095
+ poly re = p - psi(check);
1096
+ // divide by the maximal power of #[1]
1097
+ if ( (size(#)>0) && (typeof(#[1])=="poly") )
1098
+ {
1099
+ while ((re!=0) && (re!=#[1]) &&(subst(re,#[1],0)==0))
1100
+ {
1101
+ re=re/#[1];
1102
+ }
1103
+ }
1104
+ return(re);
1105
+ }
1106
+ return(p);
1107
+ }
1108
+ //======================2end variant of algorithm=========================
1109
+ //It uses two different commands for elimaination.
1110
+ //if(choose==1):"elimainate"command.
1111
+ //if (choose==2):"nselect" command.
1112
+ else
1113
+ {
1114
+ poly v=product(maxideal(1));
1115
+
1116
+ //------------- change the basering bsr to bsr[@(0),...,@(z)] ----------
1117
+ def s=addNvarsTo(basering,z+1,,"@",0); setring s;
1118
+
1119
+ //constructs the leading ideal of dom=(p-@(0),dom[1]-@(1),...,dom[z]-@(z))
1120
+ ideal dom=imap(bsr,dom);
1121
+ for (i=1;i<=z;i++)
1122
+ {
1123
+ dom[i]=lead(dom[i])-var(nvars(bsr)+i+1);
1124
+ }
1125
+ dom=lead(imap(bsr,p))-@(0),dom;
1126
+
1127
+ //---------- eliminate the variables of the basering bsr --------------
1128
+ //i.e. computes dom intersected with K[@(0),...,@(z)].
1129
+
1130
+ if(choose==1)
1131
+ {
1132
+ ideal kern=eliminate(dom,imap(bsr,v));//eliminate does not need a
1133
+ //standard basis as input.
1134
+ }
1135
+ if(choose==2)
1136
+ {
1137
+ ideal kern= nselect(groebner(dom),1..n);//"nselect" is combinatorial command
1138
+ //which uses the internal command
1139
+ // "simplify"
1140
+ }
1141
+
1142
+ //--------- test whether @(0)-h(@(1),...,@(z)) is in ker ---------------
1143
+ // for some poly h and divide by maximal power of q=#[1]
1144
+ poly h;
1145
+ z=size(kern);
1146
+ for (i=1;i<=z;i++)
1147
+ {
1148
+ h=kern[i]/@(0);
1149
+ if (deg(h)==0)
1150
+ {
1151
+ h=(1/h)*kern[i];
1152
+ // define the map psi : s ---> bsr defined by @(i) ---> p,dom[i]
1153
+ setring bsr;
1154
+ map psi=s,maxideal(1),p,dom;
1155
+ poly re=psi(h);
1156
+ // divide by the maximal power of #[1]
1157
+ if ((size(#)>0) && (typeof(#[1])== "poly") )
1158
+ {
1159
+ while ((re!=0) && (re!=#[1]) &&(subst(re,#[1],0)==0))
1160
+ {
1161
+ re=re/#[1];
1162
+ }
1163
+ }
1164
+ return(re);
1165
+ }
1166
+ }
1167
+ setring bsr;
1168
+ return(p);
1169
+ }
1170
+ }
1171
+ example
1172
+ {"EXAMPLE:"; echo = 2;
1173
+ ring r= 0,(x,y),dp;
1174
+ ideal dom =x2,y2,xy-y;
1175
+ poly p=x4+x3y+xy2-y2;
1176
+ sagbiReduction(p,dom);
1177
+ sagbiReduction(p,dom,2);
1178
+ // now let us see the action over quotient ring
1179
+ ideal I = xy;
1180
+ qring Q = std(I);
1181
+ ideal dom = imap(r,dom); poly p = imap(r,p);
1182
+ sagbiReduction(p,dom,1);
1183
+ }
1184
+
1185
+ proc sagbiNF(id,ideal dom,int k,list#)
1186
+ "USAGE: sagbiNF(id,dom,k[,n]); id either poly or ideal,dom ideal, k and n positive integers.
1187
+ RETURN: same as type of id; ideal or polynomial.
1188
+ PURPOSE:
1189
+ @format
1190
+ The integer k determines what kind of s-reduction is performed:
1191
+ - if (k=0) no tail s-reduction is performed.
1192
+ - if (k=1) tail s-reduction is performed.
1193
+ Three Algorithm variants are used to perform subalgebra reduction.
1194
+ The positive integer n determines which variant should be used.
1195
+ n may take the values (0 or default),1 or 2.
1196
+ @end format
1197
+ NOTE: sagbiNF works over both rings and quotient rings
1198
+ EXAMPLE: example sagbiNF; show example "
1199
+ {
1200
+ ideal rs;
1201
+ if (ideal(basering) == 0)
1202
+ {
1203
+ rs = sagbiReduce(id,dom,k) ;
1204
+ }
1205
+ else
1206
+ {
1207
+ rs = sagbiReduction(id,dom,k) ;
1208
+ }
1209
+ if (typeof(id)=="poly") { return (rs[1]); }
1210
+ return(rs);
1211
+ }
1212
+ example
1213
+ {"EXAMPLE:"; echo = 2;
1214
+ ring r=0,(x,y),dp;
1215
+ poly p=x4+x2y+y;
1216
+ ideal dom =x2,x2y+y,x3y2;
1217
+ sagbiNF(p,dom,1);
1218
+ ideal I= x2-xy;
1219
+ qring Q=std(I); // we go to the quotient ring
1220
+ poly p=imap(r,p);
1221
+ NF(p,std(0)); // the representative of p has changed
1222
+ ideal dom = imap(r,dom);
1223
+ print(matrix(NF(dom,std(0)))); // dom has changed as well
1224
+ sagbiNF(p,dom,0); // no tail reduction
1225
+ sagbiNF(p,dom,1);// tail subalgebra reduction is performed
1226
+ }
1227
+
1228
+ static proc canonicalform(ideal I)
1229
+ {
1230
+ /* placeholder for the canonical form of a set of gen's */
1231
+ /* for the time being we agree on content(p)=1; that is coeffs with no fractions */
1232
+ int i; ideal J=I;
1233
+ for(i=ncols(I); i>=1; i--)
1234
+ {
1235
+ J[i] = canonicalform_poly(I[i]);
1236
+ }
1237
+ return(J);
1238
+ }
1239
+
1240
+ static proc canonicalform_poly(poly p)
1241
+ {
1242
+ /* placeholder for the canonical form of a poly */
1243
+ /* for the time being we agree on content(p)=1; that is coeffs with no fractions */
1244
+ number n = content(p);
1245
+ return( p/content(p) );
1246
+ }
1247
+
1248
+ /*
1249
+ ring r= 0,(x,y),dp;
1250
+ //The following algebra does not have a finite SAGBI basis.
1251
+ ideal J=x^2, xy-y2, xy2, x^2*(x*y-y^2)^2 - (x*y^2)^2*x^4 + 11;
1252
+ //---------------------------------------------------
1253
+ //Call with two iterations
1254
+ def DI = algebraicDependence(J,2);
1255
+ setring DI; algDep;
1256
+ */
1257
+
1258
+ proc minimalGenerators(ideal a, list #)
1259
+ "USAGE: minimalGenerators(id[,w]); id ideal, w: weight vector.
1260
+ RETURN: ideal (list of minimal generators of the subalgebra a)
1261
+ EXAMPLE: example minimalGenerators; shows an example"
1262
+ {
1263
+ if(!homog(a))
1264
+ {
1265
+ ERROR("generators must be homogeneous");
1266
+ }
1267
+ ring br=basering;
1268
+ intvec w;
1269
+ if (size(#)==0) { w=1:nvars(basering); }
1270
+ else { w=#[1]; }
1271
+ int elems=size(a);
1272
+ int j; ideal ad; poly p; ideal sb; ideal mingen; ideal h;
1273
+ for (int d=0;elems>0;d++)
1274
+ {
1275
+ ad=jet(jet(a,d,w),-d,-w); // degree d part of a
1276
+ if (size(ad)>0)
1277
+ {
1278
+ "sagbi for deg ",d-1;sb;
1279
+ "testing deg ",d;
1280
+ "ad=",ad;
1281
+ for(j=1;j<=ncols(ad);j++) // 2.1
1282
+ {
1283
+ if (ad[j]!=0)
1284
+ {
1285
+ p=sagbiReduce(ad[j],sb);
1286
+ "reduced:",p;
1287
+ if(p==0) { a[j]=0; "a[",j,"] not needed"; }
1288
+ else
1289
+ {"min gen",j," = ",p;
1290
+ sb=sb,p;
1291
+ mingen=mingen,p;
1292
+ }
1293
+ elems--;
1294
+ }
1295
+ }
1296
+ }
1297
+ h=relations_apply(sb,a); // 2.3
1298
+ h=jet(jet(h,d+1,w),-d-1,w); // deg d+1 part
1299
+ "rel. in deg ",d+1," =",h;
1300
+ for(j=1;j<=ncols(h);j++) // 2.4
1301
+ {
1302
+ h[j]=sagbiReduce(h[j],sb);
1303
+ }
1304
+ sb=sb,h; // 2.5
1305
+ sb=simplify(sb,2); // 2.6
1306
+ }
1307
+ "sb=",sb;
1308
+ return(simplify(a,2));
1309
+ }
1310
+ example
1311
+ {
1312
+ "EXAMPLE:";echo=2;
1313
+ ring r= 0,(a0,a1,a2),dp;
1314
+ ideal A=a0,a1*a2-a0*a1+a0*a2,a1^2-a2^2+a0*a1,a1^3-a0*a2^2;
1315
+ A=A,A[1]*A[4]+A[2]*A[3];
1316
+ minimalGenerators(A);
1317
+ }
1318
+
1319
+ proc relations_apply(ideal s, ideal a)
1320
+ {
1321
+ ideal ls=lead(s);
1322
+ // new vars, #=ncols(s)
1323
+ ring savering=basering;
1324
+ ring d1=0,(y(1..ncols(a))),dp;
1325
+ def e1=d1+savering;
1326
+ setring e1;
1327
+ ideal ls=imap(savering,ls);
1328
+ poly m=1;
1329
+ for(int i=1;i<=nvars(savering);i++)
1330
+ { m=m*var(i+nvars(d1)); }
1331
+ for(i=1;i<=ncols(ls);i++)
1332
+ {
1333
+ if (ls[i]!=0)
1334
+ {
1335
+ ls[i]=ls[i]-y(i);
1336
+ }
1337
+ }
1338
+ ls=eliminate(ls,m); // eliminate original vars from ls
1339
+ "orig rel:",ls;
1340
+ // apply the relations
1341
+ setring savering;
1342
+ // image of map;
1343
+ ideal im;
1344
+ im[nvars(savering)]=0;
1345
+ im=im,a;
1346
+ // map:
1347
+ map f=e1,im;
1348
+ // apply relations
1349
+ ideal rel=f(ls);
1350
+ "Relations:",rel;
1351
+ return(rel);
1352
+ }
1353
+