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,1372 @@
1
+ //////////////////////////////////////////////////////////////////////////////
2
+ version="version matrix.lib 4.3.2.3 Aug_2023 "; // $Id: 6c9bee0563f9eb9a7673b96bd1cad3c62f28ba29 $
3
+ category="Linear Algebra";
4
+ info="
5
+ LIBRARY: matrix.lib Elementary Matrix Operations
6
+
7
+ PROCEDURES:
8
+ compress(A); matrix, zero columns from A deleted
9
+ concat(A1,A2,..); matrix, concatenation of matrices A1,A2,...
10
+ diag(p,n); matrix, nxn diagonal matrix with entries poly p
11
+ dsum(A1,A2,..); matrix, direct sum of matrices A1,A2,...
12
+ flatten(A); ideal, generated by entries of matrix A
13
+ genericmat(n,m[,id]); generic nxm matrix [entries from id]
14
+ is_complex(c); 1 if list c is a complex, 0 if not
15
+ outer(A,B); matrix, outer product of matrices A and B
16
+ power(A,n); matrix/intmat, n-th power of matrix/intmat A
17
+ skewmat(n[,id]); generic skew-symmetric nxn matrix [entries from id]
18
+ submat(A,r,c); submatrix of A with rows/cols specified by intvec r/c
19
+ symmat(n[,id]); generic symmetric nxn matrix [entries from id]
20
+ unitmat(n); unit square matrix of size n
21
+ gauss_col(A); transform a matrix into col-reduced Gauss normal form
22
+ gauss_row(A); transform a matrix into row-reduced Gauss normal form
23
+ addcol(A,c1,p,c2); add p*(c1-th col) to c2-th column of matrix A, p poly
24
+ addrow(A,r1,p,r2); add p*(r1-th row) to r2-th row of matrix A, p poly
25
+ multcol(A,c,p); multiply c-th column of A with poly p
26
+ multrow(A,r,p); multiply r-th row of A with poly p
27
+ permcol(A,i,j); permute i-th and j-th columns
28
+ permrow(A,i,j); permute i-th and j-th rows
29
+ rowred(A[,any]); reduction of matrix A with elementary row-operations
30
+ colred(A[,any]); reduction of matrix A with elementary col-operations
31
+ linear_relations(E); find linear relations between homogeneous vectors
32
+ rm_unitrow(A); remove unit rows and associated columns of A
33
+ rm_unitcol(A); remove unit columns and associated rows of A
34
+ headStand(A); A[n-i+1,m-j+1]:=A[i,j]
35
+ symmetricBasis(n,k[,s]); basis of k-th symmetric power of n-dim v.space
36
+ exteriorBasis(n,k[,s]); basis of k-th exterior power of n-dim v.space
37
+ symmetricPower(A,k); k-th symmetric power of a module/matrix A
38
+ exteriorPower(A,k); k-th exterior power of a module/matrix A
39
+ (parameters in square brackets [] are optional)
40
+ ";
41
+
42
+ LIB "inout.lib";
43
+ LIB "ring.lib";
44
+ LIB "random.lib";
45
+ LIB "general.lib"; // for sort
46
+ LIB "nctools.lib"; // for superCommutative
47
+
48
+ ///////////////////////////////////////////////////////////////////////////////
49
+
50
+ proc compress (def A)
51
+ "USAGE: compress(A); A matrix/ideal/module/intmat/intvec
52
+ RETURN: same type, zero columns/generators from A deleted
53
+ (if A=intvec, zero elements are deleted)
54
+ EXAMPLE: example compress; shows an example
55
+ "
56
+ {
57
+ if( typeof(A)=="matrix" ) { return(matrix(simplify(A,2))); }
58
+ if( typeof(A)=="intmat" or typeof(A)=="intvec" )
59
+ {
60
+ ring r=0,x,lp;
61
+ if( typeof(A)=="intvec" ) { intmat C=transpose(A); kill A; intmat A=C; }
62
+ module m = matrix(A);
63
+ if ( size(m) == 0)
64
+ { intmat B; }
65
+ else
66
+ { intmat B[nrows(A)][size(m)]; }
67
+ int i,j;
68
+ for( i=1; i<=ncols(A); i++ )
69
+ {
70
+ if( m[i]!=[0] )
71
+ {
72
+ j++;
73
+ B[1..nrows(A),j]=A[1..nrows(A),i];
74
+ }
75
+ }
76
+ if( defined(C) ) { return(intvec(B)); }
77
+ return(B);
78
+ }
79
+ return(simplify(A,2));
80
+ }
81
+ example
82
+ { "EXAMPLE:"; echo = 2;
83
+ ring r=0,(x,y,z),ds;
84
+ matrix A[3][4]=1,0,3,0,x,0,z,0,x2,0,z2,0;
85
+ print(A);
86
+ print(compress(A));
87
+ module m=module(A); show(m);
88
+ show(compress(m));
89
+ intmat B[3][4]=1,0,3,0,4,0,5,0,6,0,7,0;
90
+ compress(B);
91
+ intvec C=0,0,1,2,0,3;
92
+ compress(C);
93
+ }
94
+ ///////////////////////////////////////////////////////////////////////////////
95
+ proc concat (list #)
96
+ "USAGE: concat(A1,A2,..); A1,A2,... matrices
97
+ RETURN: matrix, concatenation of A1,A2,.... Number of rows of result matrix
98
+ is max(nrows(A1),nrows(A2),...)
99
+ EXAMPLE: example concat; shows an example
100
+ "
101
+ {
102
+ int i;
103
+ for( i=size(#);i>0; i-- ) { #[i]=module(#[i]); }
104
+ module B=#[1..size(#)];
105
+ return(matrix(B));
106
+ }
107
+ example
108
+ { "EXAMPLE:"; echo = 2;
109
+ ring r=0,(x,y,z),ds;
110
+ matrix A[3][3]=1,2,3,x,y,z,x2,y2,z2;
111
+ matrix B[2][2]=1,0,2,0; matrix C[1][4]=4,5,x,y;
112
+ print(A);
113
+ print(B);
114
+ print(C);
115
+ print(concat(A,B,C));
116
+ }
117
+ ///////////////////////////////////////////////////////////////////////////////
118
+
119
+ proc diag (list #)
120
+ "USAGE: diag(p,n); p poly, n integer
121
+ diag(A); A matrix
122
+ RETURN: diag(p,n): diagonal matrix, p times unit matrix of size n.
123
+ @* diag(A) : n*m x n*m diagonal matrix with entries all the entries of
124
+ the nxm matrix A, taken from the 1st row, 2nd row etc of A
125
+ EXAMPLE: example diag; shows an example
126
+ "
127
+ {
128
+ if( size(#)==2 ) { return(matrix(#[1]*freemodule(#[2]))); }
129
+ if( size(#)==1 )
130
+ {
131
+ int i; ideal id=#[1];
132
+ int n=ncols(id); matrix A[n][n];
133
+ for( i=1; i<=n; i++ ) { A[i,i]=id[i]; }
134
+ }
135
+ return(A);
136
+ }
137
+ example
138
+ { "EXAMPLE:"; echo = 2;
139
+ ring r = 0,(x,y,z),ds;
140
+ print(diag(xy,4));
141
+ matrix A[3][2] = 1,2,3,4,5,6;
142
+ print(A);
143
+ print(diag(A));
144
+ }
145
+ ///////////////////////////////////////////////////////////////////////////////
146
+
147
+ proc dsum (list #)
148
+ "USAGE: dsum(A1,A2,..); A1,A2,... matrices
149
+ RETURN: matrix, direct sum of A1,A2,...
150
+ EXAMPLE: example dsum; shows an example
151
+ "
152
+ {
153
+ int i,N,a;
154
+ list L;
155
+ for( i=1; i<=size(#); i++ ) { N=N+nrows(#[i]); }
156
+ for( i=1; i<=size(#); i++ )
157
+ {
158
+ matrix B[N][ncols(#[i])];
159
+ B[a+1..a+nrows(#[i]),1..ncols(#[i])]=#[i];
160
+ a=a+nrows(#[i]);
161
+ L[i]=B; kill B;
162
+ }
163
+ return(concat(L));
164
+ }
165
+ example
166
+ { "EXAMPLE:"; echo = 2;
167
+ ring r = 0,(x,y,z),ds;
168
+ matrix A[3][3] = 1,2,3,4,5,6,7,8,9;
169
+ matrix B[2][2] = 1,x,y,z;
170
+ print(A);
171
+ print(B);
172
+ print(dsum(A,B));
173
+ }
174
+ ///////////////////////////////////////////////////////////////////////////////
175
+
176
+ proc flatten (def A)
177
+ "USAGE: flatten(A); A matrix/smatrix
178
+ RETURN: ideal, generated by all entries from A resp. all columns of A appended
179
+ EXAMPLE: example flatten; shows an example
180
+ "
181
+ {
182
+ if (typeof(A)=="smatrix") {return(system("flatten",A)); }
183
+ return(ideal(A));
184
+ }
185
+ example
186
+ { "EXAMPLE:"; echo = 2;
187
+ ring r = 0,(x,y,z),ds;
188
+ matrix A[2][3] = 1,2,x,y,z,7;
189
+ print(A);
190
+ flatten(A);
191
+ flatten(smatrix(A));
192
+ }
193
+ ///////////////////////////////////////////////////////////////////////////////
194
+
195
+ proc genericmat (int n,int m,list #)
196
+ "USAGE: genericmat(n,m[,id]); n,m=integers, id=ideal
197
+ RETURN: nxm matrix, with entries from id.
198
+ NOTE: if id has less than nxm elements, the matrix is filled with 0's,
199
+ (default: id=maxideal(1)).
200
+ genericmat(n,m); creates the generic nxm matrix
201
+ EXAMPLE: example genericmat; shows an example
202
+ "
203
+ {
204
+ if( size(#)==0 ) { ideal id=maxideal(1); }
205
+ if( size(#)==1 ) { ideal id=#[1]; }
206
+ if( size(#)>=2 ) { "// give 3 arguments, 3-rd argument must be an ideal"; }
207
+ matrix B[n][m]=id;
208
+ return(B);
209
+ }
210
+ example
211
+ { "EXAMPLE:"; echo = 2;
212
+ ring R = 0,x(1..16),lp;
213
+ print(genericmat(3,3)); // the generic 3x3 matrix
214
+ ring R1 = 0,(a,b,c,d),dp;
215
+ matrix A = genericmat(3,4,maxideal(1)^3);
216
+ print(A);
217
+ int n,m = 3,2;
218
+ ideal i = ideal(randommat(1,n*m,maxideal(1),9));
219
+ print(genericmat(n,m,i)); // matrix of generic linear forms
220
+ }
221
+ ///////////////////////////////////////////////////////////////////////////////
222
+
223
+ proc is_complex (list c)
224
+ "USAGE: is_complex(c); c = list of size-compatible modules or matrices
225
+ RETURN: 1 if c[i]*c[i+1]=0 for all i, 0 if not, hence checking whether the
226
+ list of matrices forms a complex.
227
+ NOTE: Ideals are treated internally as 1-line matrices.
228
+ If printlevel > 0, the position where c is not a complex is shown.
229
+ EXAMPLE: example is_complex; shows an example
230
+ "
231
+ {
232
+ int i;
233
+ module @test;
234
+ for( i=1; i<=size(c)-1; i++ )
235
+ {
236
+ c[i]=matrix(c[i]); c[i+1]=matrix(c[i+1]);
237
+ @test=c[i]*c[i+1];
238
+ if (size(@test)!=0)
239
+ {
240
+ dbprint(printlevel-voice+2,"// not a complex at position " +string(i));
241
+ return(0);
242
+ }
243
+ }
244
+ return(1);
245
+ }
246
+ example
247
+ { "EXAMPLE:"; echo = 2;
248
+ ring r = 32003,(x,y,z),ds;
249
+ ideal i = x4+y5+z6,xyz,yx2+xz2+zy7;
250
+ list L = nres(i,0);
251
+ is_complex(L);
252
+ L[4] = matrix(i);
253
+ is_complex(L);
254
+ }
255
+ ///////////////////////////////////////////////////////////////////////////////
256
+
257
+ proc outer (matrix A, matrix B)
258
+ "USAGE: outer(A,B); A,B matrices
259
+ RETURN: matrix, outer (tensor) product of A and B
260
+ EXAMPLE: example outer; shows an example
261
+ "
262
+ {
263
+ int i,j; list L;
264
+ int triv = nrows(B)*ncols(B);
265
+ if ((triv==0)||(nrows(A)==0))
266
+ {
267
+ matrix C[0][0];
268
+ return(C);
269
+ }
270
+ if( triv==1 )
271
+ {
272
+ return(B[1,1]*A);
273
+ }
274
+ else
275
+ {
276
+ int N = nrows(A)*nrows(B);
277
+ matrix C[N][ncols(B)];
278
+ for( i=ncols(A);i>0; i-- )
279
+ {
280
+ for( j=1; j<=nrows(A); j++ )
281
+ {
282
+ C[(j-1)*nrows(B)+1..j*nrows(B),1..ncols(B)]=A[j,i]*B;
283
+ }
284
+ L[i]=C;
285
+ }
286
+ return(concat(L));
287
+ }
288
+ }
289
+ example
290
+ { "EXAMPLE:"; echo = 2;
291
+ ring r=32003,(x,y,z),ds;
292
+ matrix A[3][3]=1,2,3,4,5,6,7,8,9;
293
+ matrix B[2][2]=x,y,0,z;
294
+ print(A);
295
+ print(B);
296
+ print(outer(A,B));
297
+ }
298
+ ///////////////////////////////////////////////////////////////////////////////
299
+
300
+ proc power (def A, int n)
301
+ "USAGE: power(A,n); A a square-matrix of type intmat or matrix, n=integer>=0
302
+ RETURN: intmat resp. matrix, the n-th power of A
303
+ NOTE: for A=intmat and big n the result may be wrong because of int overflow
304
+ EXAMPLE: example power; shows an example
305
+ "
306
+ {
307
+ //---------------------------- type checking ----------------------------------
308
+ if( typeof(A)!="matrix" and typeof(A)!="intmat" )
309
+ {
310
+ ERROR("no matrix or intmat!");
311
+ }
312
+ if( ncols(A) != nrows(A) )
313
+ {
314
+ ERROR("not a square matrix!");
315
+ }
316
+ //---------------------------- trivial cases ----------------------------------
317
+ int ii;
318
+ if( n <= 0 )
319
+ {
320
+ if( typeof(A)=="matrix" )
321
+ {
322
+ return (unitmat(nrows(A)));
323
+ }
324
+ if( typeof(A)=="intmat" )
325
+ {
326
+ intmat B[nrows(A)][nrows(A)];
327
+ for( ii=1; ii<=nrows(A); ii++ )
328
+ {
329
+ B[ii,ii] = 1;
330
+ }
331
+ return (B);
332
+ }
333
+ }
334
+ if( n == 1 ) { return (A); }
335
+ //---------------------------- sub procedure ----------------------------------
336
+ proc matpow (def A, int n)
337
+ {
338
+ def B = A*A;
339
+ int ii= 2;
340
+ int jj= 4;
341
+ while( jj <= n )
342
+ {
343
+ B=B*B;
344
+ ii=jj;
345
+ jj=2*jj;
346
+ }
347
+ return(B,n-ii);
348
+ }
349
+ //----------------------------- main program ----------------------------------
350
+ list L = matpow(A,n);
351
+ def B = L[1];
352
+ ii = L[2];
353
+ while( ii>=2 )
354
+ {
355
+ L = matpow(A,ii);
356
+ B = B*L[1];
357
+ ii= L[2];
358
+ }
359
+ if( ii == 0) { return(B); }
360
+ if( ii == 1) { return(A*B); }
361
+ }
362
+ example
363
+ { "EXAMPLE:"; echo = 2;
364
+ intmat A[3][3]=1,2,3,4,5,6,7,8,9;
365
+ print(power(A,3));"";
366
+ ring r=0,(x,y,z),dp;
367
+ matrix B[3][3]=0,x,y,z,0,0,y,z,0;
368
+ print(power(B,3));"";
369
+ }
370
+ ///////////////////////////////////////////////////////////////////////////////
371
+
372
+ proc skewmat (int n, list #)
373
+ "USAGE: skewmat(n[,id]); n integer, id ideal
374
+ RETURN: skew-symmetric nxn matrix, with entries from id
375
+ (default: id=maxideal(1))
376
+ skewmat(n); creates the generic skew-symmetric matrix
377
+ NOTE: if id has less than n*(n-1)/2 elements, the matrix is
378
+ filled with 0's,
379
+ EXAMPLE: example skewmat; shows an example
380
+ "
381
+ {
382
+ matrix B[n][n];
383
+ if( size(#)==0 ) { ideal id=maxideal(1); }
384
+ else { ideal id=#[1]; }
385
+ id = id,B[1..n,1..n];
386
+ int i,j;
387
+ for( i=0; i<=n-2; i++ )
388
+ {
389
+ B[i+1,i+2..n]=id[j+1..j+n-i-1];
390
+ j=j+n-i-1;
391
+ }
392
+ matrix A=transpose(B);
393
+ B=B-A;
394
+ return(B);
395
+ }
396
+ example
397
+ { "EXAMPLE:"; echo = 2;
398
+ ring R=0,x(1..5),lp;
399
+ print(skewmat(4)); // the generic skew-symmetric matrix
400
+ ring R1 = 0,(a,b,c),dp;
401
+ matrix A=skewmat(4,maxideal(1)^2);
402
+ print(A);
403
+ int n=3;
404
+ ideal i = ideal(randommat(1,n*(n-1) div 2,maxideal(1),9));
405
+ print(skewmat(n,i)); // skew matrix of generic linear forms
406
+ kill R1;
407
+ }
408
+ ///////////////////////////////////////////////////////////////////////////////
409
+
410
+ proc submat (matrix A, intvec r, intvec c)
411
+ "USAGE: submat(A,r,c); A=matrix, r,c=intvec
412
+ RETURN: matrix, submatrix of A with rows specified by intvec r
413
+ and columns specified by intvec c.
414
+ EXAMPLE: example submat; shows an example
415
+ "
416
+ {
417
+ matrix B[size(r)][size(c)]=A[r,c];
418
+ return(B);
419
+ }
420
+ example
421
+ { "EXAMPLE:"; echo = 2;
422
+ ring R=32003,(x,y,z),lp;
423
+ matrix A[4][4]=x,y,z,0,1,2,3,4,5,6,7,8,9,x2,y2,z2;
424
+ print(A);
425
+ intvec v=1,3,4;
426
+ matrix B=submat(A,v,1..3);
427
+ print(B);
428
+ }
429
+ ///////////////////////////////////////////////////////////////////////////////
430
+
431
+ proc symmat (int n, list #)
432
+ "USAGE: symmat(n[,id]); n integer, id ideal
433
+ RETURN: symmetric nxn matrix, with entries from id (default: id=maxideal(1))
434
+ NOTE: if id has less than n*(n+1)/2 elements, the matrix is filled with 0's,
435
+ symmat(n); creates the generic symmetric matrix
436
+ EXAMPLE: example symmat; shows an example
437
+ "
438
+ {
439
+ matrix B[n][n];
440
+ if( size(#)==0 ) { ideal id=maxideal(1); }
441
+ else { ideal id=#[1]; }
442
+ id = id,B[1..n,1..n];
443
+ int i,j;
444
+ for( i=0; i<=n-1; i++ )
445
+ {
446
+ B[i+1,i+1..n]=id[j+1..j+n-i];
447
+ j=j+n-i;
448
+ }
449
+ matrix A=transpose(B);
450
+ for( i=1; i<=n; i++ ) { A[i,i]=0; }
451
+ B=A+B;
452
+ return(B);
453
+ }
454
+ example
455
+ { "EXAMPLE:"; echo = 2;
456
+ ring R=0,x(1..10),lp;
457
+ print(symmat(4)); // the generic symmetric matrix
458
+ ring R1 = 0,(a,b,c),dp;
459
+ matrix A=symmat(4,maxideal(1)^3);
460
+ print(A);
461
+ int n=3;
462
+ ideal i = ideal(randommat(1,n*(n+1) div 2,maxideal(1),9));
463
+ print(symmat(n,i)); // symmetric matrix of generic linear forms
464
+ kill R1;
465
+ }
466
+ ///////////////////////////////////////////////////////////////////////////////
467
+
468
+ proc unitmat (int n)
469
+ "USAGE: unitmat(n); n integer >= 0
470
+ RETURN: nxn unit matrix
471
+ NOTE: needs a basering, diagonal entries are numbers (=1) in the basering
472
+ EXAMPLE: example unitmat; shows an example
473
+ "
474
+ {
475
+ return(matrix(freemodule(n)));
476
+ }
477
+ example
478
+ { "EXAMPLE:"; echo = 2;
479
+ ring r=32003,(x,y,z),lp;
480
+ print(xyz*unitmat(4));
481
+ print(unitmat(5));
482
+ }
483
+ ///////////////////////////////////////////////////////////////////////////////
484
+
485
+ proc gauss_col (matrix A, list #)
486
+ "USAGE: gauss_col(A[,e]); A a matrix, e any type
487
+ RETURN: - a matrix B, if called with one argument; B is the complete column-
488
+ reduced upper-triangular normal form of A if A is constant,
489
+ (resp. as far as this is possible if A is a polynomial matrix;
490
+ no division by polynomials).
491
+ @* - a list L of two matrices, if called with two arguments;
492
+ L satisfies L[1] = A * L[2] with L[1] the column-reduced form of A
493
+ and L[2] the transformation matrix.
494
+ NOTE: * The procedure just applies interred to A with ordering (C,dp).
495
+ The transformation matrix is obtained by applying 'lift'.
496
+ This should be faster than the procedure colred.
497
+ @* * It should only be used with exact coefficient field (there is no
498
+ pivoting and rounding error treatment).
499
+ @* * Parameters are allowed. Hence, if the entries of A are parameters,
500
+ B is the column-reduced form of A over the rational function field.
501
+ SEE ALSO: colred
502
+ EXAMPLE: example gauss_col; shows an example
503
+ "
504
+ {
505
+ def R=basering; int u;
506
+ int n = nrows(A);
507
+ int m = ncols(A);
508
+ module M = A;
509
+ intvec v = option(get);
510
+ //------------------------ change ordering if necessary ----------------------
511
+ if( ordstr(R) != ("C,dp("+string(nvars(R))+")") )
512
+ {
513
+ def @R=changeord(list(list("C",0:1),list("dp",1:nvars(R))),R);
514
+ setring @R; u=1;
515
+ matrix A = imap(R,A);
516
+ module M = A;
517
+ }
518
+ //------------------------------ start computation ---------------------------
519
+ option(redSB);
520
+ M = simplify(interred(M),1);
521
+ if(size(#) != 0)
522
+ {
523
+ module N = lift(A,M);
524
+ }
525
+ //--------------- reset ring and options and return --------------------------
526
+ if ( u==1 )
527
+ {
528
+ setring R;
529
+ M=imap(@R,M);
530
+ if (size(#) != 0)
531
+ {
532
+ module N = imap(@R,N);
533
+ }
534
+ kill @R;
535
+ }
536
+ option(set,v);
537
+ // M = sort(M,size(M)..1)[1];
538
+ A = matrix(M,n,m);
539
+ if (size(#) != 0)
540
+ {
541
+ list L= A,matrix(N,m,m);
542
+ return(L);
543
+ }
544
+ return(matrix(M,n,m));
545
+ }
546
+ example
547
+ { "EXAMPLE:"; echo = 2;
548
+ ring r=(0,a,b),(A,B,C),dp;
549
+ matrix m[8][6]=
550
+ 0, 2*C, 0, 0, 0, 0,
551
+ 0, -4*C,a*A, 0, 0, 0,
552
+ b*B, -A, 0, 0, 0, 0,
553
+ -A, B, 0, 0, 0, 0,
554
+ -4*C, 0, B, 2, 0, 0,
555
+ 2*A, B, 0, 0, 0, 0,
556
+ 0, 3*B, 0, 0, 2b, 0,
557
+ 0, AB, 0, 2*A,A, 2a;"";
558
+ list L=gauss_col(m,1);
559
+ print(L[1]);
560
+ print(L[2]);
561
+
562
+ ring S=0,x,(c,dp);
563
+ matrix A[5][4] =
564
+ 3, 1, 1, 1,
565
+ 13, 8, 6,-7,
566
+ 14,10, 6,-7,
567
+ 7, 4, 3,-3,
568
+ 2, 1, 0, 3;
569
+ print(gauss_col(A));
570
+ }
571
+ ///////////////////////////////////////////////////////////////////////////////
572
+
573
+ proc gauss_row (matrix A, list #)
574
+ "USAGE: gauss_row(A [,e]); A matrix, e any type
575
+ RETURN: - a matrix B, if called with one argument; B is the complete row-
576
+ reduced lower-triangular normal form of A if A is constant,
577
+ (resp. as far as this is possible if A is a polynomial matrix;
578
+ no division by polynomials).
579
+ @* - a list L of two matrices, if called with two arguments;
580
+ L satisfies transpose(L[2])*A=transpose(L[1])
581
+ with L[1] the row-reduced form of A
582
+ and L[2] the transformation matrix.
583
+ NOTE: * This procedure just applies gauss_col to the transposed matrix.
584
+ The transformation matrix is obtained by applying lift.
585
+ This should be faster than the procedure rowred.
586
+ @* * It should only be used with exact coefficient field (there is no
587
+ pivoting and rounding error treatment).
588
+ @* * Parameters are allowed. Hence, if the entries of A are parameters,
589
+ B is the row-reduced form of A over the rational function field.
590
+ SEE ALSO: rowred
591
+ EXAMPLE: example gauss_row; shows an example
592
+ "
593
+ {
594
+ if(size(#) > 0)
595
+ {
596
+ list L = gauss_col(transpose(A),1);
597
+ return(L);
598
+ }
599
+ A = gauss_col(transpose(A));
600
+ return(transpose(A));
601
+ }
602
+ example
603
+ { "EXAMPLE:"; echo = 2;
604
+ ring r=(0,a,b),(A,B,C),dp;
605
+ matrix m[6][8]=
606
+ 0, 0, b*B, -A,-4C,2A,0, 0,
607
+ 2C,-4C,-A,B, 0, B, 3B,AB,
608
+ 0,a*A, 0, 0, B, 0, 0, 0,
609
+ 0, 0, 0, 0, 2, 0, 0, 2A,
610
+ 0, 0, 0, 0, 0, 0, 2b, A,
611
+ 0, 0, 0, 0, 0, 0, 0, 2a;"";
612
+ print(gauss_row(m));"";
613
+ ring S=0,x,dp;
614
+ matrix A[4][5] = 3, 1,1,-1,2,
615
+ 13, 8,6,-7,1,
616
+ 14,10,6,-7,1,
617
+ 7, 4,3,-3,3;
618
+ list L=gauss_row(A,1);
619
+ print(L[1]);
620
+ print(L[2]);
621
+ }
622
+ ///////////////////////////////////////////////////////////////////////////////
623
+
624
+ proc addcol (matrix A, int c1, poly p, int c2)
625
+ "USAGE: addcol(A,c1,p,c2); A matrix, p poly, c1, c2 positive integers
626
+ RETURN: matrix, A being modified by adding p times column c1 to column c2
627
+ EXAMPLE: example addcol; shows an example
628
+ "
629
+ {
630
+ int k=nrows(A);
631
+ A[1..k,c2]=A[1..k,c2]+p*A[1..k,c1];
632
+ return(A);
633
+ }
634
+ example
635
+ { "EXAMPLE:"; echo = 2;
636
+ ring r=32003,(x,y,z),lp;
637
+ matrix A[3][3]=1,2,3,4,5,6,7,8,9;
638
+ print(A);
639
+ print(addcol(A,1,xy,2));
640
+ }
641
+ ///////////////////////////////////////////////////////////////////////////////
642
+
643
+ proc addrow (matrix A, int r1, poly p, int r2)
644
+ "USAGE: addrow(A,r1,p,r2); A matrix, p poly, r1, r2 positive integers
645
+ RETURN: matrix, A being modified by adding p times row r1 to row r2
646
+ EXAMPLE: example addrow; shows an example
647
+ "
648
+ {
649
+ int k=ncols(A);
650
+ A[r2,1..k]=A[r2,1..k]+p*A[r1,1..k];
651
+ return(A);
652
+ }
653
+ example
654
+ { "EXAMPLE:"; echo = 2;
655
+ ring r=32003,(x,y,z),lp;
656
+ matrix A[3][3]=1,2,3,4,5,6,7,8,9;
657
+ print(A);
658
+ print(addrow(A,1,xy,3));
659
+ }
660
+ ///////////////////////////////////////////////////////////////////////////////
661
+
662
+ proc multcol (matrix A, int c, poly p)
663
+ "USAGE: multcol(A,c,p); A matrix, p poly, c positive integer
664
+ RETURN: matrix, A being modified by multiplying column c by p
665
+ EXAMPLE: example multcol; shows an example
666
+ "
667
+ {
668
+ int k=nrows(A);
669
+ A[1..k,c]=p*A[1..k,c];
670
+ return(A);
671
+ }
672
+ example
673
+ { "EXAMPLE:"; echo = 2;
674
+ ring r=32003,(x,y,z),lp;
675
+ matrix A[3][3]=1,2,3,4,5,6,7,8,9;
676
+ print(A);
677
+ print(multcol(A,2,xy));
678
+ }
679
+ ///////////////////////////////////////////////////////////////////////////////
680
+
681
+ proc multrow (matrix A, int r, poly p)
682
+ "USAGE: multrow(A,r,p); A matrix, p poly, r positive integer
683
+ RETURN: matrix, A being modified by multiplying row r by p
684
+ EXAMPLE: example multrow; shows an example
685
+ "
686
+ {
687
+ int k=ncols(A);
688
+ A[r,1..k]=p*A[r,1..k];
689
+ return(A);
690
+ }
691
+ example
692
+ { "EXAMPLE:"; echo = 2;
693
+ ring r=32003,(x,y,z),lp;
694
+ matrix A[3][3]=1,2,3,4,5,6,7,8,9;
695
+ print(A);
696
+ print(multrow(A,2,xy));
697
+ }
698
+ ///////////////////////////////////////////////////////////////////////////////
699
+
700
+ proc permcol (matrix A, int c1, int c2)
701
+ "USAGE: permcol(A,c1,c2); A matrix, c1,c2 positive integers
702
+ RETURN: matrix, A being modified by permuting columns c1 and c2
703
+ EXAMPLE: example permcol; shows an example
704
+ "
705
+ {
706
+ matrix B=A;
707
+ int k=nrows(B);
708
+ B[1..k,c1]=A[1..k,c2];
709
+ B[1..k,c2]=A[1..k,c1];
710
+ return(B);
711
+ }
712
+ example
713
+ { "EXAMPLE:"; echo = 2;
714
+ ring r=32003,(x,y,z),lp;
715
+ matrix A[3][3]=1,x,3,4,y,6,7,z,9;
716
+ print(A);
717
+ print(permcol(A,2,3));
718
+ }
719
+ ///////////////////////////////////////////////////////////////////////////////
720
+
721
+ proc permrow (matrix A, int r1, int r2)
722
+ "USAGE: permrow(A,r1,r2); A matrix, r1,r2 positive integers
723
+ RETURN: matrix, A being modified by permuting rows r1 and r2
724
+ EXAMPLE: example permrow; shows an example
725
+ "
726
+ {
727
+ matrix B=A;
728
+ int k=ncols(B);
729
+ B[r1,1..k]=A[r2,1..k];
730
+ B[r2,1..k]=A[r1,1..k];
731
+ return(B);
732
+ }
733
+ example
734
+ { "EXAMPLE:"; echo = 2;
735
+ ring r=32003,(x,y,z),lp;
736
+ matrix A[3][3]=1,2,3,x,y,z,7,8,9;
737
+ print(A);
738
+ print(permrow(A,2,1));
739
+ }
740
+ ///////////////////////////////////////////////////////////////////////////////
741
+
742
+ proc rowred (matrix A,list #)
743
+ "USAGE: rowred(A[,e]); A matrix, e any type
744
+ RETURN: - a matrix B, being the row reduced form of A, if rowred is called
745
+ with one argument.
746
+ (as far as this is possible over the polynomial ring; no division
747
+ by polynomials)
748
+ @* - a list L of two matrices, such that L[1] = L[2] * A with L[1]
749
+ the row-reduced form of A and L[2] the transformation matrix
750
+ (if rowred is called with two arguments).
751
+ ASSUME: The entries of A are in the base field. It is not verified whether
752
+ this assumption holds.
753
+ NOTE: * This procedure is designed for teaching purposes mainly.
754
+ @* * The straight forward Gaussian algorithm is implemented in the
755
+ library (no standard basis computation).
756
+ The transformation matrix is obtained by concatenating a unit
757
+ matrix to A. proc gauss_row should be faster.
758
+ @* * It should only be used with exact coefficient field (there is no
759
+ pivoting) over the polynomial ring (ordering lp or dp).
760
+ @* * Parameters are allowed. Hence, if the entries of A are parameters
761
+ the computation takes place over the field of rational functions.
762
+ SEE ALSO: gauss_row
763
+ EXAMPLE: example rowred; shows an example
764
+ "
765
+ {
766
+ int m,n=nrows(A),ncols(A);
767
+ int i,j,k,l,rk;
768
+ poly p;
769
+ matrix d[m][n];
770
+ for (i=1;i<=m;i++)
771
+ { for (j=1;j<=n;j++)
772
+ { p = A[i,j];
773
+ if (ord(p)==0)
774
+ { if (deg(p)==0) { d[i,j]=p; }
775
+ }
776
+ }
777
+ }
778
+ matrix b = A;
779
+ if (size(#) != 0) { b = concat(b,unitmat(m)); }
780
+ for (l=1;l<=n;l=l+1)
781
+ {
782
+ k = findfirst(ideal(d[l]),rk+1);
783
+ if (k)
784
+ { rk = rk+1;
785
+ b = permrow(b,rk,k);
786
+ p = b[rk,l]; p = 1/p;
787
+ b = multrow(b,rk,p);
788
+ for (i=1;i<=m;i++)
789
+ {
790
+ if (rk-i) { b = addrow(b,rk,-b[i,l],i);}
791
+ }
792
+ d = 0;
793
+ for (i=rk+1;i<=m;i++)
794
+ { for (j=l+1;j<=n;j++)
795
+ { p = b[i,j];
796
+ if (ord(p)==0)
797
+ { if (deg(p)==0) { d[i,j]=p; }
798
+ }
799
+ }
800
+ }
801
+
802
+ }
803
+ }
804
+ d = submat(b,1..m,1..n);
805
+ if (size(#))
806
+ {
807
+ list L=d,submat(b,1..m,n+1..n+m);
808
+ return(L);
809
+ }
810
+ return(d);
811
+ }
812
+ example
813
+ { "EXAMPLE:"; echo = 2;
814
+ ring r=(0,a,b),(A,B,C),dp;
815
+ matrix m[6][8]=
816
+ 0, 0, b*B, -A,-4C,2A,0, 0,
817
+ 2C,-4C,-A,B, 0, B, 3B,AB,
818
+ 0,a*A, 0, 0, B, 0, 0, 0,
819
+ 0, 0, 0, 0, 2, 0, 0, 2A,
820
+ 0, 0, 0, 0, 0, 0, 2b, A,
821
+ 0, 0, 0, 0, 0, 0, 0, 2a;"";
822
+ print(rowred(m));"";
823
+ list L=rowred(m,1);
824
+ print(L[1]);
825
+ print(L[2]);
826
+ }
827
+ ///////////////////////////////////////////////////////////////////////////////
828
+
829
+ proc colred (matrix A,list #)
830
+ "USAGE: colred(A[,e]); A matrix, e any type
831
+ RETURN: - a matrix B, being the column reduced form of A, if colred is
832
+ called with one argument.
833
+ (as far as this is possible over the polynomial ring;
834
+ no division by polynomials)
835
+ @* - a list L of two matrices, such that L[1] = A * L[2] with L[1]
836
+ the column-reduced form of A and L[2] the transformation matrix
837
+ (if colred is called with two arguments).
838
+ ASSUME: The entries of A are in the base field. It is not verified whether
839
+ this assumption holds.
840
+ NOTE: * This procedure is designed for teaching purposes mainly.
841
+ @* * It applies rowred to the transposed matrix.
842
+ proc gauss_col should be faster.
843
+ @* * It should only be used with exact coefficient field (there is no
844
+ pivoting) over the polynomial ring (ordering lp or dp).
845
+ @* * Parameters are allowed. Hence, if the entries of A are parameters
846
+ the computation takes place over the field of rational functions.
847
+ SEE ALSO: gauss_col
848
+ EXAMPLE: example colred; shows an example
849
+ "
850
+ {
851
+ A = transpose(A);
852
+ if (size(#))
853
+ { list L = rowred(A,1); return(transpose(L[1]),transpose(L[2]));}
854
+ else
855
+ { return(transpose(rowred(A)));}
856
+ }
857
+ example
858
+ { "EXAMPLE:"; echo = 2;
859
+ ring r=(0,a,b),(A,B,C),dp;
860
+ matrix m[8][6]=
861
+ 0, 2*C, 0, 0, 0, 0,
862
+ 0, -4*C,a*A, 0, 0, 0,
863
+ b*B, -A, 0, 0, 0, 0,
864
+ -A, B, 0, 0, 0, 0,
865
+ -4*C, 0, B, 2, 0, 0,
866
+ 2*A, B, 0, 0, 0, 0,
867
+ 0, 3*B, 0, 0, 2b, 0,
868
+ 0, AB, 0, 2*A,A, 2a;"";
869
+ print(colred(m));"";
870
+ list L=colred(m,1);
871
+ print(L[1]);
872
+ print(L[2]);
873
+ }
874
+ //////////////////////////////////////////////////////////////////////////////
875
+
876
+ proc linear_relations(module M)
877
+ "USAGE: linear_relations(M);
878
+ M: a module
879
+ ASSUME: All non-zero entries of M are homogeneous polynomials of the same
880
+ positive degree. The base field must be an exact field (not real
881
+ or complex).
882
+ It is not checked whether these assumptions hold.
883
+ RETURN: a maximal module R such that M*R is formed by zero vectors.
884
+ EXAMPLE: example linear_relations; shows an example.
885
+ "
886
+ { int n = ncols(M);
887
+ def BaseR = basering;
888
+ def br = changeord(list(list("dp",1:nvars(basering))));
889
+ setring br;
890
+ module M = imap(BaseR,M);
891
+ ideal vars = maxideal(1);
892
+ ring tmpR = 0, ('y(1..n)), dp;
893
+ def newR = br + tmpR;
894
+ setring newR;
895
+ module M = imap(br,M);
896
+ ideal vars = imap(br,vars);
897
+ attrib(vars,"isSB",1);
898
+ for (int i = 1; i<=n; i++) {
899
+ M[i] = M[i] + 'y(i)*gen(1);
900
+ }
901
+ M = interred(M);
902
+ module redM = NF(M,vars);
903
+ module REL;
904
+ int sizeREL;
905
+ int j;
906
+ for (i=1; i<=n; i++) {
907
+ if (M[i][1]==redM[i][1]) { //-- relation found!
908
+ sizeREL++;
909
+ REL[sizeREL]=0;
910
+ for (j=1; j<=n; j++) {
911
+ REL[sizeREL] = REL[sizeREL] + (M[i][1]/'y(j))*gen(j);
912
+ }
913
+ }
914
+ }
915
+ setring BaseR;
916
+ return(minbase(imap(newR,REL)));
917
+ }
918
+ example
919
+ { "EXAMPLE:"; echo = 2;
920
+ ring r = (3,w), (a,b,c,d),dp;
921
+ minpoly = w2-w-1;
922
+ module M = [a2,b2],[wab,w2c2+2b2],[(w-2)*a2+wab,wb2+w2c2];
923
+ module REL = linear_relations(M);
924
+ pmat(REL);
925
+ pmat(matrix(M)*matrix(REL));
926
+ }
927
+
928
+ //////////////////////////////////////////////////////////////////////////////
929
+
930
+ static proc findfirst (ideal i,int t)
931
+ {
932
+ int n,k;
933
+ for (n=t;n<=ncols(i);n=n+1)
934
+ {
935
+ if (i[n]!=0) { k=n;break;}
936
+ }
937
+ return(k);
938
+ }
939
+ //////////////////////////////////////////////////////////////////////////////
940
+
941
+ proc rm_unitcol(matrix A)
942
+ "USAGE: rm_unitcol(A); A matrix (being row-reduced)
943
+ RETURN: matrix, obtained from A by deleting unit columns (having just one 1
944
+ and else 0 as entries) and associated rows
945
+ EXAMPLE: example rm_unitcol; shows an example
946
+ "
947
+ {
948
+ int l,j;
949
+ intvec v;
950
+ for (j=1;j<=ncols(A);j++)
951
+ {
952
+ if (gen(l+1)==module(A)[j]) {l=l+1;}
953
+ else { v=v,j;}
954
+ }
955
+ if (size(v)>1)
956
+ { v = v[2..size(v)];
957
+ return(submat(A,l+1..nrows(A),v));
958
+ }
959
+ else
960
+ { return(0);}
961
+ }
962
+ example
963
+ { "EXAMPLE:"; echo = 2;
964
+ ring r=0,(A,B,C),dp;
965
+ matrix m[6][8]=
966
+ 0, 0, A, 0, 1,0, 0,0,
967
+ 0, 0, -C2, 0, 0,0, 1,0,
968
+ 0, 0, 0,1/2B, 0,0, 0,1,
969
+ 0, 0, B, -A, 0,2A, 0,0,
970
+ 2C,-4C, -A, B, 0,B, 0,0,
971
+ 0, A, 0, 0, 0,0, 0,0;
972
+ print(rm_unitcol(m));
973
+ }
974
+ //////////////////////////////////////////////////////////////////////////////
975
+
976
+ proc rm_unitrow (matrix A)
977
+ "USAGE: rm_unitrow(A); A matrix (being col-reduced)
978
+ RETURN: matrix, obtained from A by deleting unit rows (having just one 1
979
+ and else 0 as entries) and associated columns
980
+ EXAMPLE: example rm_unitrow; shows an example
981
+ "
982
+ {
983
+ int l,j;
984
+ intvec v;
985
+ module M = transpose(A);
986
+ for (j=1; j <= nrows(A); j++)
987
+ {
988
+ if (gen(l+1) == M[j]) { l=l+1; }
989
+ else { v=v,j; }
990
+ }
991
+ if (size(v) > 1)
992
+ { v = v[2..size(v)];
993
+ return(submat(A,v,l+1..ncols(A)));
994
+ }
995
+ else
996
+ { return(0);}
997
+ }
998
+ example
999
+ { "EXAMPLE:"; echo = 2;
1000
+ ring r=0,(A,B,C),dp;
1001
+ matrix m[8][6]=
1002
+ 0,0, 0, 0, 2C, 0,
1003
+ 0,0, 0, 0, -4C,A,
1004
+ A,-C2,0, B, -A, 0,
1005
+ 0,0, 1/2B,-A,B, 0,
1006
+ 1,0, 0, 0, 0, 0,
1007
+ 0,0, 0, 2A,B, 0,
1008
+ 0,1, 0, 0, 0, 0,
1009
+ 0,0, 1, 0, 0, 0;
1010
+ print(rm_unitrow(m));
1011
+ }
1012
+ //////////////////////////////////////////////////////////////////////////////
1013
+ proc headStand(matrix M)
1014
+ "USAGE: headStand(M); M matrix
1015
+ RETURN: matrix B such that B[i][j]=M[n-i+1,m-j+1], n=nrows(M), m=ncols(M)
1016
+ EXAMPLE: example headStand; shows an example
1017
+ "
1018
+ {
1019
+ int i,j;
1020
+ int n=nrows(M);
1021
+ int m=ncols(M);
1022
+ matrix B[n][m];
1023
+ for(i=1;i<=n;i++)
1024
+ {
1025
+ for(j=1;j<=m;j++)
1026
+ {
1027
+ B[n-i+1,m-j+1]=M[i,j];
1028
+ }
1029
+ }
1030
+ return(B);
1031
+ }
1032
+ example
1033
+ { "EXAMPLE:"; echo = 2;
1034
+ ring r=0,(A,B,C),dp;
1035
+ matrix M[2][3]=
1036
+ 0,A, B,
1037
+ A2, B2, C;
1038
+ print(M);
1039
+ print(headStand(M));
1040
+ }
1041
+ //////////////////////////////////////////////////////////////////////////////
1042
+
1043
+ // Symmetric/Exterior powers thanks to Oleksandr Iena for his persistence ;-)
1044
+
1045
+ proc symmetricBasis(int n, int k, list #)
1046
+ "USAGE: symmetricBasis(n, k[,s]); n int, k int, s string
1047
+ RETURN: ring, poynomial ring containing the ideal \"symBasis\",
1048
+ being a basis of the k-th symmetric power of an n-dim vector space.
1049
+ NOTE: The output polynomial ring has characteristics 0 and n variables
1050
+ named \"S(i)\", where the base variable name S is either given by the
1051
+ optional string argument(which must not contain brackets) or equal to
1052
+ "e" by default.
1053
+ SEE ALSO: exteriorBasis
1054
+ KEYWORDS: symmetric basis
1055
+ EXAMPLE: example symmetricBasis; shows an example"
1056
+ {
1057
+ //------------------------ handle optional base variable name---------------
1058
+ string S = "e";
1059
+ if( size(#) > 0 )
1060
+ {
1061
+ if( typeof(#[1]) != "string" )
1062
+ {
1063
+ ERROR("Wrong optional argument: must be a string");
1064
+ }
1065
+ S = #[1];
1066
+ if( (find(S, "(") + find(S, ")")) > 0 )
1067
+ {
1068
+ ERROR("Wrong optional argument: must be a string without brackets");
1069
+ }
1070
+ }
1071
+
1072
+ //------------------------- create ring container for symmetric power basis-
1073
+ list l2;
1074
+ for (int ii = 1; ii <= n; ii++)
1075
+ {
1076
+ l2[ii] = S+"("+string(ii)+")";
1077
+ }
1078
+ ring @@@SYM_POWER_RING_NAME = create_ring(0, l2, "dp");
1079
+ //------------------------- choose symmetric basis -------------------------
1080
+ ideal symBasis = maxideal(k);
1081
+
1082
+ //------------------------- export and return -------------------------
1083
+ export symBasis;
1084
+ return(basering);
1085
+ }
1086
+ example
1087
+ { "EXAMPLE:"; echo = 2;
1088
+
1089
+ // basis of the 3-rd symmetricPower of a 4-dim vector space:
1090
+ def R = symmetricBasis(4, 3, "@e"); setring R;
1091
+ R; // container ring:
1092
+ symBasis; // symmetric basis:
1093
+ }
1094
+
1095
+ //////////////////////////////////////////////////////////////////////////////
1096
+
1097
+ proc exteriorBasis(int n, int k, list #)
1098
+ "USAGE: exteriorBasis(n, k[,s]); n int, k int, s string
1099
+ RETURN: qring, an exterior algebra containing the ideal \"extBasis\",
1100
+ being a basis of the k-th exterior power of an n-dim vector space.
1101
+ NOTE: The output polynomial ring has characteristics 0 and n variables
1102
+ named \"S(i)\", where the base variable name S is either given by the
1103
+ optional string argument(which must not contain brackets) or equal to
1104
+ "e" by default.
1105
+ SEE ALSO: symmetricBasis
1106
+ KEYWORDS: exterior basis
1107
+ EXAMPLE: example exteriorBasis; shows an example"
1108
+ {
1109
+ //------------------------ handle optional base variable name---------------
1110
+ string S = "e";
1111
+ if( size(#) > 0 )
1112
+ {
1113
+ if( typeof(#[1]) != "string" )
1114
+ {
1115
+ ERROR("Wrong optional argument: must be a string");
1116
+ }
1117
+ S = #[1];
1118
+ if( (find(S, "(") + find(S, ")")) > 0 )
1119
+ {
1120
+ ERROR("Wrong optional argument: must be a string without brackets");
1121
+ }
1122
+ }
1123
+
1124
+ //------------------------- create ring container for symmetric power basis-
1125
+ list l2;
1126
+ for (int ii = 1; ii <= n; ii++)
1127
+ {
1128
+ l2[ii] = S+"("+string(ii)+")";
1129
+ }
1130
+ ring @@@EXT_POWER_RING_NAME = create_ring(0, l2, "dp");
1131
+
1132
+ //------------------------- choose exterior basis -------------------------
1133
+ def T = superCommutative(); setring T;
1134
+ ideal extBasis = simplify( NF(maxideal(k), std(0)), 1 + 2 + 8 );
1135
+
1136
+ //------------------------- export and return -------------------------
1137
+ export extBasis;
1138
+ return(basering);
1139
+ }
1140
+ example
1141
+ { "EXAMPLE:"; echo = 2;
1142
+ // basis of the 3-rd symmetricPower of a 4-dim vector space:
1143
+ def r = exteriorBasis(4, 3, "@e"); setring r;
1144
+ r; // container ring:
1145
+ extBasis; // exterior basis:
1146
+ }
1147
+
1148
+ //////////////////////////////////////////////////////////////////////////////
1149
+
1150
+ static proc chooseSafeVarName(string prefix, string suffix)
1151
+ "USAGE: give appropreate prefix for variable names
1152
+ RETURN: safe variable name (repeated prefix + suffix)
1153
+ "
1154
+ {
1155
+ string V = varstr(basering);
1156
+ string S = suffix;
1157
+ while( find(V, S) > 0 )
1158
+ {
1159
+ S = prefix + S;
1160
+ }
1161
+ return(S);
1162
+ }
1163
+
1164
+ //////////////////////////////////////////////////////////////////////////////
1165
+
1166
+ static proc mapPower(int p, module A, int k, def Tn, def Tm)
1167
+ "USAGE: by both symmetric- and exterior-Power"
1168
+ NOTE: everything over the basering!
1169
+ module A (matrix of the map), int k (power)
1170
+ rings Tn is source- and Tm is image-ring with bases
1171
+ resp. Ink and Imk.
1172
+ M = max dim of Image, N - dim. of source
1173
+ SEE ALSO: symmetricPower, exteriorPower"
1174
+ {
1175
+ def save = basering;
1176
+
1177
+ int n = nvars(save);
1178
+ int M = nrows(A);
1179
+ int N = ncols(A);
1180
+
1181
+ int i, j;
1182
+
1183
+ //------------------------- compute matrix of single images ------------------
1184
+ def Rm = save + Tm; setring Rm;
1185
+ dbprint(p-2, "Temporary Working Ring", Rm);
1186
+
1187
+ module A = imap(save, A);
1188
+
1189
+ ideal B; poly t;
1190
+
1191
+ for( i = N; i > 0; i-- )
1192
+ {
1193
+ t = 0;
1194
+ for( j = M; j > 0; j-- )
1195
+ {
1196
+ t = t + A[i][j] * var(n + j);
1197
+ }
1198
+
1199
+ B[i] = t;
1200
+ }
1201
+
1202
+ dbprint(p-1, "Matrix of single images", B);
1203
+
1204
+ //------------------------- compute image ---------------------
1205
+ // apply S^k(A): Tn -> Rm to Source basis vectors Ink:
1206
+ map TMap = Tn, B;
1207
+
1208
+ ideal C = NF(TMap(Ink), std(0));
1209
+ dbprint(p-1, "Image Matrix: ", C);
1210
+
1211
+
1212
+ //------------------------- write it in Image basis ---------------------
1213
+ ideal Imk = imap(Tm, Imk);
1214
+
1215
+ module D; poly lm; vector tt;
1216
+
1217
+ for( i = ncols(C); i > 0; i-- )
1218
+ {
1219
+ t = C[i];
1220
+ tt = 0;
1221
+
1222
+ while( t != 0 )
1223
+ {
1224
+ lm = leadmonom(t);
1225
+ // lm;
1226
+ for( j = ncols(Imk); j > 0; j-- )
1227
+ {
1228
+ if( lm / Imk[j] != 0 )
1229
+ {
1230
+ tt = tt + (lead(t) / Imk[j]) * gen(j);
1231
+ break;
1232
+ }
1233
+ }
1234
+ t = t - lead(t);
1235
+ }
1236
+
1237
+ D[i] = tt;
1238
+ }
1239
+
1240
+ //------------------------- map it back and return ---------------------
1241
+ setring save;
1242
+ return( imap(Rm, D) );
1243
+ }
1244
+
1245
+
1246
+ //////////////////////////////////////////////////////////////////////////////
1247
+
1248
+ proc symmetricPower(module A, int k)
1249
+ "USAGE: symmetricPower(A, k); A module, k int
1250
+ RETURN: module: the k-th symmetric power of A
1251
+ NOTE: the chosen bases and most of intermediate data will be shown if
1252
+ printlevel is big enough
1253
+ SEE ALSO: exteriorPower
1254
+ KEYWORDS: symmetric power
1255
+ EXAMPLE: example symmetricPower; shows an example"
1256
+ {
1257
+ int p = printlevel - voice + 2;
1258
+
1259
+ def save = basering;
1260
+
1261
+ int M = nrows(A);
1262
+ int N = ncols(A);
1263
+
1264
+ string S = chooseSafeVarName("@", "@_e");
1265
+
1266
+ //------------------------- choose source basis -------------------------
1267
+ def Tn = symmetricBasis(N, k, S); setring Tn;
1268
+ ideal Ink = symBasis;
1269
+ export Ink;
1270
+ dbprint(p-3, "Temporary Source Ring", basering);
1271
+ dbprint(p, "S^k(Source Basis)", Ink);
1272
+
1273
+ //------------------------- choose image basis -------------------------
1274
+ def Tm = symmetricBasis(M, k, S); setring Tm;
1275
+ ideal Imk = symBasis;
1276
+ export Imk;
1277
+ dbprint(p-3, "Temporary Image Ring", basering);
1278
+ dbprint(p, "S^k(Image Basis)", Imk);
1279
+
1280
+ //------------------------- compute and return S^k(A) in chosen bases --
1281
+ setring save;
1282
+
1283
+ return(mapPower(p, A, k, Tn, Tm));
1284
+ }
1285
+ example
1286
+ { "EXAMPLE:"; echo = 2;
1287
+
1288
+ ring r = (0),(a, b, c, d), dp; r;
1289
+ module B = a*gen(1) + c* gen(2), b * gen(1) + d * gen(2); print(B);
1290
+
1291
+ // symmetric power over a commutative K-algebra:
1292
+ print(symmetricPower(B, 2));
1293
+ print(symmetricPower(B, 3));
1294
+
1295
+ // symmetric power over an exterior algebra:
1296
+ def g = superCommutative(); setring g; g;
1297
+
1298
+ module B = a*gen(1) + c* gen(2), b * gen(1) + d * gen(2); print(B);
1299
+
1300
+ print(symmetricPower(B, 2)); // much smaller!
1301
+ print(symmetricPower(B, 3)); // zero! (over an exterior algebra!)
1302
+
1303
+ }
1304
+
1305
+ //////////////////////////////////////////////////////////////////////////////
1306
+
1307
+ proc exteriorPower(module A, int k)
1308
+ "USAGE: exteriorPower(A, k); A module, k int
1309
+ RETURN: module: the k-th exterior power of A
1310
+ NOTE: the chosen bases and most of intermediate data will be shown if
1311
+ printlevel is big enough. Last rows will be invisible if zero.
1312
+ SEE ALSO: symmetricPower
1313
+ KEYWORDS: exterior power
1314
+ EXAMPLE: example exteriorPower; shows an example"
1315
+ {
1316
+ int p = printlevel - voice + 2;
1317
+ def save = basering;
1318
+
1319
+ int M = nrows(A);
1320
+ int N = ncols(A);
1321
+
1322
+ string S = chooseSafeVarName("@", "@_e");
1323
+
1324
+ //------------------------- choose source basis -------------------------
1325
+ def Tn = exteriorBasis(N, k, S); setring Tn;
1326
+ ideal Ink = extBasis;
1327
+ export Ink;
1328
+ dbprint(p-3, "Temporary Source Ring", basering);
1329
+ dbprint(p, "E^k(Source Basis)", Ink);
1330
+
1331
+ //------------------------- choose image basis -------------------------
1332
+ def Tm = exteriorBasis(M, k, S); setring Tm;
1333
+ ideal Imk = extBasis;
1334
+ export Imk;
1335
+ dbprint(p-3, "Temporary Image Ring", basering);
1336
+ dbprint(p, "E^k(Image Basis)", Imk);
1337
+
1338
+ //------------------------- compute and return E^k(A) in chosen bases --
1339
+ setring save;
1340
+ return(mapPower(p, A, k, Tn, Tm));
1341
+ }
1342
+ example
1343
+ { "EXAMPLE:"; echo = 2;
1344
+ ring r = (0),(a, b, c, d, e, f), dp;
1345
+ r; "base ring:";
1346
+
1347
+ module B = a*gen(1) + c*gen(2) + e*gen(3),
1348
+ b*gen(1) + d*gen(2) + f*gen(3),
1349
+ e*gen(1) + f*gen(3);
1350
+
1351
+ print(B);
1352
+ print(exteriorPower(B, 2));
1353
+ print(exteriorPower(B, 3));
1354
+
1355
+ def g = superCommutative(); setring g; g;
1356
+
1357
+ module A = a*gen(1), b * gen(1), c*gen(2), d * gen(2);
1358
+ print(A);
1359
+
1360
+ print(exteriorPower(A, 2));
1361
+
1362
+ module B = a*gen(1) + c*gen(2) + e*gen(3),
1363
+ b*gen(1) + d*gen(2) + f*gen(3),
1364
+ e*gen(1) + f*gen(3);
1365
+ print(B);
1366
+
1367
+ print(exteriorPower(B, 2));
1368
+ print(exteriorPower(B, 3));
1369
+
1370
+ }
1371
+
1372
+ //////////////////////////////////////////////////////////////////////////////