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,3130 @@
1
+ ////////////////////////////////////////////////////////////////////
2
+ version="version gitfan.lib 4.3.1.0 Sep_2022 ";
3
+ category="Algebraic Geometry";
4
+ info="
5
+ LIBRARY: gitfan.lib Compute GIT-fans.
6
+
7
+ AUTHORS: Janko Boehm, boehm at mathematik.uni-kl.de @*
8
+ Simon Keicher, keicher at mail.mathematik.uni-tuebingen.de @*
9
+ Yue Ren, ren at mathematik.uni-kl.de @*
10
+
11
+ OVERVIEW:
12
+ This library allows you to calculate GIT-fans, torus orbits and GKZ-fans.
13
+
14
+ In provides features to make use of symmetries of the torus action under consideration.
15
+
16
+ The main procedure is GITfan which can be directly applied to an ideal and a grading matrix
17
+ encoding the torus action, and returns a fan, the associated GIT-fan.
18
+ We also provide various procedures implementing substeps of the algorithm
19
+ to deal with large computations.
20
+
21
+ The library uses the package 'gfanlib' by Anders N. Jensen.
22
+
23
+ For notation, background, and algorithms see [BKR16].
24
+
25
+ Functions produce debug output if printlevel is positive.
26
+
27
+ Elements of the symmetric group Sn of type permutation can be created by
28
+ the function permutationFromIntvec.
29
+ The images of 1,...,n can be obtained by permutationToIntvec.
30
+ Composition of permutations can be done by the *-Operator,
31
+ also powers can be computed in the usual way.
32
+
33
+
34
+ REFERENCES:
35
+
36
+ [BKR16] J. Boehm, S. Keicher, Y. Ren: Computing GIT-Fans with Symmetry and the Mori Chamber Decomposition of M06bar, https://arxiv.org/abs/1603.09241
37
+
38
+ TYPES:
39
+ permutation; Permutation in map representation.
40
+
41
+ PROCEDURES:
42
+ isAface(ideal,intvec); Checks whether the given face is an a-face.
43
+ afaces(ideal); Returns a list of intvecs that correspond to the set of all a-faces, optionally for given list of simplex faces.
44
+ fullDimImages(list,intmat); Finds the afaces which have a full-dimensional projection.
45
+ minimalAfaces(list); compute the minimal a-faces among the a-faces with full dimensional projection.
46
+ orbitCones(list,intmat); Returns the list of all orbit cones.
47
+ GITcone(list,bigintmat); Returns the GIT-cone containing the given weight vector.
48
+ GITfan(ideal,intmat); Compute GIT-fan.
49
+ GITfanFromOrbitCones(list,intmat,cone); Compute GIT-fan from orbit cones.
50
+ GITfanParallel(list,intmat,cone); Compute GIT-fan in parallel from orbit cones.
51
+ GKZfan(intmat); Returns the GKZ-fan of the matrix Q.
52
+ movingCone(intmat); Compute the moving cone.
53
+ computeAfaceOrbits(list,list); Compute orbits of a-faces under a permutation group action.
54
+ minimalAfaceOrbits(list); Find the minimal a-face orbits.
55
+ orbitConeOrbits(list,intmat); Project the a-face orbits to orbit cone orbits.
56
+ minimalOrbitConeOrbits(list); Find the minimal orbit cone orbits.
57
+ intersectOrbitsWithMovingCone(list,cone); Intersect orbit cone orbits with moving cone.
58
+ groupActionOnQImage(list,intmat); Determine the induced group action in the target of the grading matrix.
59
+ groupActionOnHashes(list,list); Determine the induced group action on the set of orbit cones.
60
+ storeActionOnOrbitConeIndices(list, string); Write the group action on the set of orbit cones to a file.
61
+ permutationFromIntvec(intvec); Create a permutation from an intvec of images.
62
+ permutationToIntvec(permutation); Return the intvec of images.
63
+ evaluateProduct(list,list); Evaluate a list of products of group elements in terms of a given representation of the elements as permutations.
64
+ GITfanSymmetric(list,intmat,cone,list); Compute GIT-fan from orbit cones by determining a minimal representing set for the orbits of maximal dimensional GIT-cones.
65
+ GITfanParallelSymmetric(list, intmat, cone, list); Compute GIT-fan in parallel from orbit cones by determining a minimal representing set for the orbits of maximal dimensional GIT-cones.
66
+ bigintToBinary(bigint,int); Convert bigint into a sparse binary representation specifying the indices of the one-entries
67
+ binaryToBigint(intvec); Convert sparse binary representation specifying the indices of the one-entries to bigint
68
+ applyPermutationToIntvec(intvec,permutation); Apply permutation to a set of integers represented as an intvec
69
+ hashToCone(bigint,list); Convert a bigint hash to a GIT-cone
70
+ hashesToFan(list hashes,list OC)
71
+ gitCone(ideal,bigintmat,bigintmat); Returns the GIT-cone around the given weight vector w
72
+
73
+ KEYWORDS: library, gitfan, GIT, geometric invariant theory, quotients
74
+ ";
75
+
76
+
77
+ LIB "customstd.lib";
78
+ LIB "linalg.lib";
79
+ LIB "multigrading.lib";
80
+ LIB "parallel.lib";
81
+ LIB "gfan.lib";
82
+
83
+ static proc mod_init()
84
+ {
85
+ LIB "gfan.lib";
86
+ LIB "gitfan.so";
87
+ //LIB "subsets.so";
88
+ newstruct("permutation","intvec image");
89
+ system("install","permutation","*",composePermutations,2);
90
+ system("install","permutation","^",permutationPower,2);
91
+ system("install","permutation","print",printPermutation,1);
92
+ }
93
+
94
+ static proc emptyString(int n)
95
+ {
96
+ string st;
97
+ for (int i = 1; i<=n;i++){
98
+ st=st+" ";
99
+ }
100
+ return(st);}
101
+
102
+ proc printPermutation(permutation sigma)
103
+ {
104
+ intvec v = permutationToIntvec(sigma);
105
+ string vsrc,vimg;
106
+ for (int i = 1; i<=size(v);i++){
107
+ vsrc=vsrc+emptyString(1+size(string(size(v)))-size(string(i)))+string(i);
108
+ }
109
+ for (i = 1; i<=size(v);i++){
110
+ vimg=vimg+emptyString(1+size(string(size(v)))-size(string(v[i])))+string(v[i]);
111
+ }
112
+ print("|"+vsrc+"|");
113
+ print("|"+vimg+"|");
114
+ }
115
+
116
+
117
+ ////////////////////////////////////////////////////
118
+ // converts e.g. n=5 to its binary representation, i.e. 0,1,0,1
119
+ // if r = 3.
120
+ // and stores it in an intvec.
121
+ // r gives the bound for n <= 2^r:
122
+ static proc int2face(int n, int r)
123
+ {
124
+ int k = r-1;
125
+ intvec v;
126
+ int n0 = n;
127
+
128
+ while(n0 > 0){
129
+ while(2^k > n0){
130
+ k--;
131
+ //v[size(v)+1] = 0;
132
+ }
133
+
134
+ v = k+1,v;
135
+ n0 = n0 - 2^k;
136
+ k--;
137
+ }
138
+ v = v[1..size(v)-1];
139
+ return(v);
140
+ }
141
+ example
142
+ {
143
+ echo = 2;
144
+ int n = 5;
145
+ int r = 4;
146
+ int2face(n, r);
147
+
148
+ n = 1;
149
+ r = 1;
150
+ int2face(n,r);
151
+ }
152
+
153
+ ////////
154
+
155
+
156
+
157
+ ////////////////////////////////////////////////////
158
+
159
+ proc afaces(ideal a, list #)
160
+ "USAGE: afaces(a [,L]); a: ideal, L: list of intvecs
161
+ PURPOSE: Returns a list of all a-faces (considered as intvecs of 0 and 1, where the i-th entry is 1 if the cone has the i-th unit basis vector as a generator), if L is specified only the faces of the simplex listed in L are considered (e.g. representatives with respect to a group action).
162
+ RETURN: a list of intvecs
163
+ EXAMPLE: example afaces; shows an example
164
+ "
165
+ {
166
+ list AF;
167
+ if ((size(#)>0) and (typeof(#[1])=="intvec")){
168
+ list L = #;
169
+ for(int i = 1; i<=size(L); i++ ){
170
+ dbprint("representative "+string(i)+" of "+string(size(L)));
171
+ if (isAface(a,L[i])){
172
+ AF[size(AF) + 1] = L[i];
173
+ }
174
+ }
175
+ return(AF);
176
+ }
177
+
178
+ intvec gam0;
179
+ int r = nvars(basering);
180
+
181
+ // check if 0 is an a-face:
182
+ int bd;
183
+ if (size(#)>0){bd=#[1];}
184
+ gam0 = 0;
185
+ if (size(gam0)>=bd){
186
+ if (isAface(a,gam0)){
187
+ AF[size(AF) + 1] = gam0;
188
+ }
189
+ }
190
+ // check for other a-faces:
191
+ for(int i = 1; i < 2^r; i++ ){
192
+ gam0 = int2face(i,r);
193
+ if (size(gam0)>=bd){
194
+ if (isAface(a,gam0)){
195
+ AF[size(AF) + 1] = gam0;
196
+ }
197
+ }
198
+ }
199
+
200
+ //"done checking a-faces!";
201
+ return(AF);
202
+ }
203
+ example
204
+ {
205
+
206
+ echo = 2;
207
+ ring R = 0,T(1..3),dp;
208
+ ideal a = T(1)+T(2)+T(3);
209
+
210
+ list F = afaces(a);
211
+ print(F);
212
+ print(size(F));
213
+
214
+ // 2nd ex //
215
+ ring R2 = 0,T(1..3),dp;
216
+ ideal a2 = T(2)^2*T(3)^2+T(1)*T(3);
217
+
218
+ list F2 = afaces(a2);
219
+ print(F2);
220
+ print(size(F2));
221
+
222
+ // 3rd ex //
223
+ ring R3 = 0,T(1..3),dp;
224
+ ideal a3 = 0;
225
+
226
+ list F3 = afaces(a3);
227
+ print(F3);
228
+ print(size(F3));
229
+
230
+
231
+ // 4th ex //
232
+ ring R4 = 0,T(1..10),wp(1,1,1,1,1,1,1,1,1,1);
233
+ ideal J =
234
+ T(5)*T(10)-T(6)*T(9)+T(7)*T(8),
235
+ T(1)*T(9)-T(2)*T(7)+T(4)*T(5),
236
+ T(1)*T(8)-T(2)*T(6)+T(3)*T(5),
237
+ T(1)*T(10)-T(3)*T(7)+T(4)*T(6),
238
+ T(2)*T(10)-T(3)*T(9)+T(4)*T(8);
239
+ list F4 = afaces(J);
240
+ print(size(F4));
241
+ }
242
+
243
+
244
+
245
+ static proc saturateWithRespectToVariable(ideal I, int k)
246
+ {
247
+ // "saturating with respect to variable "+string(k);
248
+ ASSUME(1,k>=1);
249
+ ASSUME(1,k<=nvars(basering));
250
+
251
+ def origin = basering;
252
+ int n = nvars(basering);
253
+ intvec weightVector = ringlist(origin)[3][1][2];
254
+
255
+ string newVars;
256
+ intvec newWeightVector;
257
+ for (int i=1; i<k; i++)
258
+ {
259
+ newVars = newVars+string(var(i))+",";
260
+ newWeightVector[i]=weightVector[i];
261
+ }
262
+ for (i=k+1; i<=n; i++)
263
+ {
264
+ newVars = newVars+string(var(i))+",";
265
+ newWeightVector[i-1]=weightVector[i];
266
+ }
267
+ newVars = newVars+string(var(k));
268
+ newWeightVector[n]=weightVector[k];
269
+ ring ringForSaturation = create_ring(ring_list(origin)[1], "("+newVars+")",
270
+ list(list("wp", newWeightVector)),"no_minpoly");
271
+ ideal I = satstd(imap(origin,I));
272
+ I = simplify(I,2+4+32);
273
+
274
+ // "finished saturating with respect to variable "+string(k);
275
+ setring origin;
276
+ return (imap(ringForSaturation,I));
277
+ }
278
+
279
+ static proc stepwiseSaturation(ideal I)
280
+ {
281
+ if (I!=1)
282
+ {
283
+ list variablesToBeSaturated;
284
+ int l = nvars(basering);
285
+ for (int i=1; i<=l; i++)
286
+ { variablesToBeSaturated[i]=l-i+1; }
287
+
288
+ while (size(variablesToBeSaturated)>0)
289
+ {
290
+ I = saturateWithRespectToVariable(I,variablesToBeSaturated[1]);
291
+ variablesToBeSaturated = delete(variablesToBeSaturated,1);
292
+ if ((I==1) || (I==-1))
293
+ {
294
+ break;
295
+ }
296
+ }
297
+ }
298
+
299
+ return (I);
300
+ }
301
+
302
+
303
+
304
+
305
+
306
+
307
+ proc isAface(ideal a, intvec gam0)
308
+ "USAGE: isAface(a,gam0); a: ideal, gam0:intvec
309
+ PURPOSE: Checks whether gam0 is an a-face w.r.t. the ideal a.
310
+ RETURN: int
311
+ EXAMPLE: example isaface; shows an example
312
+ "
313
+ {
314
+ // special case: gam0 is the zero-cone:
315
+ if (size(gam0) == 1 and gam0[1] == 0){
316
+ poly pz;
317
+ ideal G;
318
+ int i;
319
+ for (int k = 1; k <= size(a); k++) {
320
+ pz = subst(a[k], var(1), 0);
321
+ for (i = 2; i <= nvars(basering); i++) {
322
+ pz = subst(pz, var(i), 0);
323
+ }
324
+ G = G, pz;
325
+ }
326
+ G = std(G);
327
+ // monomial inside?:
328
+ if(G == 1){
329
+ return(0);
330
+ }
331
+ return(1);
332
+ }
333
+
334
+ string initNewRing = "(";
335
+
336
+ intvec w = ringlist(basering)[3][1][2];
337
+ intvec w0;
338
+ for (int i=1; i<size(gam0); i++)
339
+ {
340
+ // take only entries i of w0 with i in gam0
341
+ initNewRing = initNewRing + string(var(gam0[i])) + ",";
342
+ w0[i] = w[gam0[i]];
343
+ }
344
+ w0[size(gam0)] = w[gam0[size(gam0)]];
345
+
346
+ initNewRing = initNewRing + string(var(gam0[size(gam0)])) + ")";
347
+ def R = basering;
348
+ // execute(initNewRing);
349
+ ring Rgam0 = create_ring(0, initNewRing, "wp("+string(w0)+")");
350
+
351
+ ideal agam0 = imap(R,a);
352
+
353
+ ideal G = stepwiseSaturation(agam0);
354
+
355
+ if(G == 1)
356
+ {
357
+ return(0); // true
358
+ }
359
+ return(1); // false
360
+ }
361
+ example
362
+ {
363
+ echo = 2;
364
+
365
+ ring R = 0,(T(1..4)),dp;
366
+ ideal I = T(1)*T(2)-T(4);
367
+
368
+ intvec w = 1,4;
369
+ intvec v = 1,2,4;
370
+
371
+ isAface(I,w); // should be 0
372
+ isAface(I,v); // should be 1
373
+ }
374
+
375
+
376
+ proc applyPermutationToIntvec(intvec v, permutation g)
377
+ "USAGE: applyPermutationToIntvec(v,g); v: intvec, g:permutation
378
+ PURPOSE: Apply g to the set of entries of v. The result is a sorted intvec. We assume that the entries of v are valid arguments of g. We do not require that the input is sorted.
379
+ RETURN: intvec.
380
+ EXAMPLE: example applyPermutationToIntvec; shows an example
381
+ "
382
+ {
383
+ intvec gv = composeIntvecs(permutationToIntvec(g),v);
384
+ //for (int i=1;i<=size(v);i++){
385
+ // gv[i]=g[v[i]];
386
+ //}
387
+ return(sort(gv)[1]);
388
+ }
389
+ example
390
+ {
391
+ permutation g = permutationFromIntvec(intvec(10, 9, 7, 4, 8, 6, 3, 5, 2, 1));
392
+ applyPermutationToIntvec(intvec(1, 3, 4, 6, 8),g);
393
+ }
394
+
395
+ static proc isContained(intvec v, list orbit){
396
+ for (int i=1;i<=size(orbit);i++){
397
+ if (v==orbit[i]){return(1);}
398
+ }
399
+ return(0);
400
+ }
401
+
402
+
403
+ static proc computeSimplexOrbit(intvec v, list G){
404
+ list orbit;
405
+ intvec gv;
406
+ for (int i=1;i<=size(G);i++){
407
+ gv=applyPermutationToIntvec(v,G[i]);
408
+ if (isContained(gv,orbit)==0){orbit[size(orbit)+1]=gv;}
409
+ }
410
+ return(orbit);
411
+ }
412
+
413
+
414
+ proc computeAfaceOrbits(list AF, list G)
415
+ "USAGE: computeAfaceOrbits(AF,G); AF list of intvecs, G: list of permutations
416
+ PURPOSE: Computes the orbits of the afaces in the list AF under the group action in G, where G is a list of permutations. We assume that the elements of G form a group and the first entry corresponds to the neutral element.
417
+ RETURN: a list of lists of intvecs
418
+ EXAMPLE: example computeAfaceOrbits; shows an example
419
+ "
420
+ {
421
+ list listorbits;
422
+ for (int i=1;i<=size(AF);i++){
423
+ dbprint(i);
424
+ listorbits[i]=computeSimplexOrbit(AF[i],G);
425
+ }
426
+ return(listorbits);}
427
+ example
428
+ {
429
+ echo = 2;
430
+ ring R = 0,T(1..10),wp(1,1,1,1,1,1,1,1,1,1);
431
+ ideal J =
432
+ T(5)*T(10)-T(6)*T(9)+T(7)*T(8),
433
+ T(1)*T(9)-T(2)*T(7)+T(4)*T(5),
434
+ T(1)*T(8)-T(2)*T(6)+T(3)*T(5),
435
+ T(1)*T(10)-T(3)*T(7)+T(4)*T(6),
436
+ T(2)*T(10)-T(3)*T(9)+T(4)*T(8);
437
+ intmat Q[5][10] =
438
+ 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,
439
+ 1, 0, 0, 0, 1, 1, 1, 0, 0, 0,
440
+ 0, 1, 1, 0, 0, 0, -1, 1, 0, 0,
441
+ 0, 1, 0, 1, 0, -1, 0, 0, 1, 0,
442
+ 0, 0, 1, 1, -1, 0, 0, 0, 0, 1;
443
+ list simplexSymmetryGroup = G25Action();
444
+ list simplexOrbitRepresentatives = intvec( 1, 2, 3, 4, 5 ),
445
+ intvec( 1, 2, 3, 5, 6 ),
446
+ intvec( 1, 2, 3, 5, 7 ),
447
+ intvec( 1, 2, 3, 5, 10 ),
448
+ intvec( 1, 2, 3, 7, 9 ),
449
+ intvec( 1, 2, 6, 9, 10 ),
450
+ intvec( 1, 2, 3, 4, 5, 6 ),
451
+ intvec( 1, 2, 3, 4, 5, 10 ),
452
+ intvec( 1, 2, 3, 5, 6, 8 ),
453
+ intvec( 1, 2, 3, 5, 6, 9 ),
454
+ intvec( 1, 2, 3, 5, 7, 10 ),
455
+ intvec( 1, 2, 3, 7, 9, 10 ),
456
+ intvec( 1, 2, 3, 4, 5, 6, 7 ),
457
+ intvec( 1, 2, 3, 4, 5, 6, 8 ),
458
+ intvec( 1, 2, 3, 4, 5, 6, 9 ),
459
+ intvec( 1, 2, 3, 5, 6, 9, 10 ),
460
+ intvec( 1, 2, 3, 4, 5, 6, 7, 8 ),
461
+ intvec( 1, 2, 3, 4, 5, 6, 9, 10 ),
462
+ intvec( 1, 2, 3, 4, 5, 6, 7, 8, 9 ),
463
+ intvec( 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 );
464
+ list afaceOrbitRepresentatives=afaces(J,simplexOrbitRepresentatives);
465
+ list fulldimAfaceOrbitRepresentatives=fullDimImages(afaceOrbitRepresentatives,Q);
466
+ list afaceOrbits=computeAfaceOrbits(fulldimAfaceOrbitRepresentatives,simplexSymmetryGroup);
467
+ apply(afaceOrbits,size);}
468
+
469
+
470
+
471
+
472
+ static proc isSubset(intvec v, intvec w)
473
+ {
474
+ int i,j;
475
+ int jStart=1;
476
+ for (i=1; i<=size(v); i++)
477
+ {
478
+ for (j=jStart; j<=size(w); j++)
479
+ {
480
+ if (v[i]==w[j])
481
+ {
482
+ break;
483
+ }
484
+ }
485
+ if (j<=size(w))
486
+ {
487
+ jStart = j+1;
488
+ }
489
+ else
490
+ {
491
+ return (0);
492
+ }
493
+ }
494
+ return (1);
495
+ }
496
+
497
+
498
+
499
+ static proc containsOrbitd(list A, list B)
500
+ {
501
+ intvec a = A[1];
502
+ for (int i=1; i<=size(B); i++)
503
+ {
504
+ if (isSubset(a,B[i]))
505
+ {
506
+ return (1);
507
+ }
508
+ }
509
+ return (0);
510
+ }
511
+
512
+
513
+ proc minimalAfaceOrbits(list listOfOrbits)
514
+ "USAGE: minimalAfaceOrbits(afaceOrbits); afaceOrbits: list
515
+ PURPOSE: Returns a list of all minimal a-face orbits.
516
+ RETURN: a list of intvecs
517
+ EXAMPLE: example minimalAfaceOrbits; shows an example
518
+ "
519
+ {
520
+ int i,j;
521
+ list L = listOfOrbits;
522
+ for (i=1; i<=size(L); i++)
523
+ {
524
+ dbprint(string(i)+" of "+string(size(L)));
525
+ for (j=1; j<=size(L); j++)
526
+ {
527
+ if (i!=j)
528
+ {
529
+ if (containsOrbitd(L[i],L[j]))
530
+ {
531
+ dbprint("werfe raus (Laenge): " + string(size(L[j])));
532
+ L = delete(L,j);
533
+ if (j<i)
534
+ {
535
+ i = i-1;
536
+ }
537
+ j = j-1;
538
+ }
539
+ }
540
+ }
541
+ }
542
+ return(L);
543
+ }
544
+ example
545
+ {
546
+ echo = 2;
547
+ ring R = 0,T(1..10),wp(1,1,1,1,1,1,1,1,1,1);
548
+ ideal J =
549
+ T(5)*T(10)-T(6)*T(9)+T(7)*T(8),
550
+ T(1)*T(9)-T(2)*T(7)+T(4)*T(5),
551
+ T(1)*T(8)-T(2)*T(6)+T(3)*T(5),
552
+ T(1)*T(10)-T(3)*T(7)+T(4)*T(6),
553
+ T(2)*T(10)-T(3)*T(9)+T(4)*T(8);
554
+ intmat Q[5][10] =
555
+ 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,
556
+ 1, 0, 0, 0, 1, 1, 1, 0, 0, 0,
557
+ 0, 1, 1, 0, 0, 0, -1, 1, 0, 0,
558
+ 0, 1, 0, 1, 0, -1, 0, 0, 1, 0,
559
+ 0, 0, 1, 1, -1, 0, 0, 0, 0, 1;
560
+ list simplexSymmetryGroup = G25Action();
561
+ list simplexOrbitRepresentatives = intvec( 1, 2, 3, 4, 5 ),
562
+ intvec( 1, 2, 3, 5, 6 ),
563
+ intvec( 1, 2, 3, 5, 7 ),
564
+ intvec( 1, 2, 3, 5, 10 ),
565
+ intvec( 1, 2, 3, 7, 9 ),
566
+ intvec( 1, 2, 6, 9, 10 ),
567
+ intvec( 1, 2, 3, 4, 5, 6 ),
568
+ intvec( 1, 2, 3, 4, 5, 10 ),
569
+ intvec( 1, 2, 3, 5, 6, 8 ),
570
+ intvec( 1, 2, 3, 5, 6, 9 ),
571
+ intvec( 1, 2, 3, 5, 7, 10 ),
572
+ intvec( 1, 2, 3, 7, 9, 10 ),
573
+ intvec( 1, 2, 3, 4, 5, 6, 7 ),
574
+ intvec( 1, 2, 3, 4, 5, 6, 8 ),
575
+ intvec( 1, 2, 3, 4, 5, 6, 9 ),
576
+ intvec( 1, 2, 3, 5, 6, 9, 10 ),
577
+ intvec( 1, 2, 3, 4, 5, 6, 7, 8 ),
578
+ intvec( 1, 2, 3, 4, 5, 6, 9, 10 ),
579
+ intvec( 1, 2, 3, 4, 5, 6, 7, 8, 9 ),
580
+ intvec( 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 );
581
+ list afaceOrbitRepresentatives=afaces(J,simplexOrbitRepresentatives);
582
+ list fulldimAfaceOrbitRepresentatives=fullDimImages(afaceOrbitRepresentatives,Q);
583
+ list afaceOrbits=computeAfaceOrbits(fulldimAfaceOrbitRepresentatives,simplexSymmetryGroup);
584
+ apply(afaceOrbits,size);
585
+ list minAfaceOrbits = minimalAfaceOrbits(afaceOrbits);
586
+ apply(minAfaceOrbits,size);
587
+ }
588
+
589
+
590
+ static proc list2string(list L){
591
+ string s = "";
592
+
593
+ for(int i = 1; i <=size(L); i++){
594
+ s = s + string(size(L[i])) + ", ";
595
+ }
596
+
597
+ return(s);
598
+ }
599
+
600
+
601
+
602
+ proc fullDimImages(list afaces,intmat Q)
603
+ "USAGE: fullDimImages(afaces, Q); afaces: list, Q: intmat
604
+ PURPOSE: Determines the a-faces (represented as intvecs) from the list afaces which have a full-dimensional projection with respect to Q.
605
+ RETURN: a list of intvecs
606
+ EXAMPLE: example fullDimImages; shows an example
607
+ "
608
+ {
609
+ list L;
610
+ for (int i=1; i<=size(afaces); i++)
611
+ {
612
+ intvec gam0 = afaces[i];
613
+ intmat Qgam0[nrows(Q)][size(gam0)] = Q[intvec(1..nrows(Q)),gam0];
614
+ //cone c = coneViaPoints(Qgam0);
615
+ if(rank(Qgam0) == nrows(Q)){
616
+ L[size(L)+1]=afaces[i];
617
+ }
618
+ kill gam0,Qgam0;
619
+ }
620
+ return(L);
621
+ }
622
+ example
623
+ {
624
+ echo=2;
625
+ ring R = 0,T(1..10),wp(1,1,1,1,1,1,1,1,1,1);
626
+ ideal J =
627
+ T(5)*T(10)-T(6)*T(9)+T(7)*T(8),
628
+ T(1)*T(9)-T(2)*T(7)+T(4)*T(5),
629
+ T(1)*T(8)-T(2)*T(6)+T(3)*T(5),
630
+ T(1)*T(10)-T(3)*T(7)+T(4)*T(6),
631
+ T(2)*T(10)-T(3)*T(9)+T(4)*T(8);
632
+ intmat Q[5][10] =
633
+ 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,
634
+ 1, 0, 0, 0, 1, 1, 1, 0, 0, 0,
635
+ 0, 1, 1, 0, 0, 0, -1, 1, 0, 0,
636
+ 0, 1, 0, 1, 0, -1, 0, 0, 1, 0,
637
+ 0, 0, 1, 1, -1, 0, 0, 0, 0, 1;
638
+
639
+ list AF= afaces(J,nrows(Q));
640
+ size(AF);
641
+ size(fullDimImages(AF,Q));
642
+ }
643
+
644
+
645
+
646
+
647
+ proc orbitConeOrbits(list F, intmat Q)
648
+ "USAGE: orbitConeOrbits(F, Q); F: list, Q: intmat
649
+ PURPOSE: Projects a list F of a-face orbits to the orbit cones with respect to Q. The function checks whether the projections are of full dimension and returns an error otherwise.
650
+ RETURN: a list of lists of cones
651
+ EXAMPLE: example orbitConeOrbits; shows an example
652
+ "
653
+ {
654
+ list OC;
655
+ int j;
656
+ intmat Qt = transpose(Q);
657
+ for(int i = 1; i <= size(F); i++){
658
+ list Orbit = F[i];
659
+ list U;
660
+ for(j = 1; j <= size(Orbit); j++){
661
+ intvec aface = Orbit[j];
662
+ intmat Qgam0[size(aface)][ncols(Qt)] = Qt[aface,intvec(1..ncols(Qt))];
663
+ cone c = coneViaPoints(Qgam0);
664
+ if (dimension(c)!=ncols(Qt)){ERROR("cone should have full dimension");}
665
+ // insert it even if it is already inside (mincones will take care of this)
666
+ U[size(U)+1] = c;
667
+ kill aface;
668
+ kill Qgam0;
669
+ kill c;
670
+ }
671
+ OC[size(OC)+1] = U;
672
+ dbprint("current size of OC:");
673
+ dbprint(size(OC));
674
+ kill U;
675
+ kill Orbit;
676
+ }
677
+ return(OC);
678
+ }
679
+ example
680
+ {
681
+ echo = 2;
682
+ // Note that simplexOrbitRepresentatives and simplexSymmetryGroup are subsets of the actual sets for G25. For the full example see the examples in the documentation
683
+ ring R = 0,T(1..10),wp(1,1,1,1,1,1,1,1,1,1);
684
+ ideal J =
685
+ T(5)*T(10)-T(6)*T(9)+T(7)*T(8),
686
+ T(1)*T(9)-T(2)*T(7)+T(4)*T(5),
687
+ T(1)*T(8)-T(2)*T(6)+T(3)*T(5),
688
+ T(1)*T(10)-T(3)*T(7)+T(4)*T(6),
689
+ T(2)*T(10)-T(3)*T(9)+T(4)*T(8);
690
+ intmat Q[5][10] =
691
+ 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,
692
+ 1, 0, 0, 0, 1, 1, 1, 0, 0, 0,
693
+ 0, 1, 1, 0, 0, 0, -1, 1, 0, 0,
694
+ 0, 1, 0, 1, 0, -1, 0, 0, 1, 0,
695
+ 0, 0, 1, 1, -1, 0, 0, 0, 0, 1;
696
+ list simplexOrbitRepresentatives = intvec( 1, 2, 3, 4, 5 ),
697
+ intvec( 1, 2, 3, 5, 6 ),
698
+ intvec( 1, 2, 3, 5, 7 ),
699
+ intvec( 1, 2, 3, 5, 10 ),
700
+ intvec( 1, 2, 3, 7, 9 ),
701
+ intvec( 1, 2, 3, 4, 5, 6, 9, 10 ),
702
+ intvec( 1, 2, 3, 4, 5, 6, 7, 8, 9 ),
703
+ intvec( 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 );
704
+ list afaceOrbitRepresentatives=afaces(J,simplexOrbitRepresentatives);
705
+ list simplexSymmetryGroup = permutationFromIntvec(intvec( 1 .. 10 )),
706
+ permutationFromIntvec(intvec( 1, 2, 4, 3, 5, 7, 6, 9, 8, 10 )),
707
+ permutationFromIntvec(intvec( 1, 3, 2, 4, 6, 5, 7, 8, 10, 9 )),
708
+ permutationFromIntvec(intvec( 1, 3, 4, 2, 6, 7, 5, 10, 8, 9 )),
709
+ permutationFromIntvec(intvec( 1, 4, 2, 3, 7, 5, 6, 9, 10, 8 )),
710
+ permutationFromIntvec(intvec( 1, 4, 3, 2, 7, 6, 5, 10, 9, 8 ));
711
+ list fulldimAfaceOrbitRepresentatives=fullDimImages(afaceOrbitRepresentatives,Q);
712
+ list afaceOrbits=computeAfaceOrbits(fulldimAfaceOrbitRepresentatives,simplexSymmetryGroup);
713
+ apply(afaceOrbits,size);
714
+ list minAfaceOrbits = minimalAfaceOrbits(afaceOrbits);
715
+ apply(minAfaceOrbits,size);
716
+ list listOfOrbitConeOrbits = orbitConeOrbits(minAfaceOrbits,Q);
717
+ }
718
+
719
+
720
+ proc minimalOrbitConeOrbits(list listOfOrbits)
721
+ "USAGE: minimalOrbitConeOrbits(listOfOrbits); listOfOrbits: list of lists of cones
722
+ PURPOSE: Minimizes a list of orbit cone orbits.
723
+ RETURN: a list of lists of cones
724
+ EXAMPLE: example minimalOrbitConeOrbits; shows an example
725
+ "
726
+ {
727
+ int i,j;
728
+ list L = listOfOrbits;
729
+
730
+
731
+ for (i=1; i<=size(L); i++)
732
+ {
733
+ dbprint("::::: " + string(i)+" of "+string(size(L)));
734
+
735
+ for (j=1; j<=size(L); j++)
736
+ {
737
+ dbprint("outer: "+string(i)+" inner: " + string(j));
738
+ if (i!=j)
739
+ {
740
+ if (containsOrbitdCone(L[i],L[j]))
741
+ {
742
+ dbprint("werfe raus, i="+string(i)+", j="+string(j)+" (Laenge): " + string(size(L[j])));
743
+ L = delete(L,j);
744
+ if (j<i)
745
+ {
746
+ i = i-1;
747
+ }
748
+ j = j-1;
749
+ }
750
+ }
751
+ }
752
+ }
753
+ return(L);
754
+ }
755
+ example
756
+ {
757
+ echo = 2;
758
+ ring R = 0,T(1..10),wp(1,1,1,1,1,1,1,1,1,1);
759
+ ideal J =
760
+ T(5)*T(10)-T(6)*T(9)+T(7)*T(8),
761
+ T(1)*T(9)-T(2)*T(7)+T(4)*T(5),
762
+ T(1)*T(8)-T(2)*T(6)+T(3)*T(5),
763
+ T(1)*T(10)-T(3)*T(7)+T(4)*T(6),
764
+ T(2)*T(10)-T(3)*T(9)+T(4)*T(8);
765
+ intmat Q[5][10] =
766
+ 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,
767
+ 1, 0, 0, 0, 1, 1, 1, 0, 0, 0,
768
+ 0, 1, 1, 0, 0, 0, -1, 1, 0, 0,
769
+ 0, 1, 0, 1, 0, -1, 0, 0, 1, 0,
770
+ 0, 0, 1, 1, -1, 0, 0, 0, 0, 1;
771
+ list simplexSymmetryGroup = G25Action();
772
+ list simplexOrbitRepresentatives = intvec( 1, 2, 3, 4, 5 ),
773
+ intvec( 1, 2, 3, 5, 6 ),
774
+ intvec( 1, 2, 3, 5, 7 ),
775
+ intvec( 1, 2, 3, 5, 10 ),
776
+ intvec( 1, 2, 3, 7, 9 ),
777
+ intvec( 1, 2, 6, 9, 10 ),
778
+ intvec( 1, 2, 3, 4, 5, 6 ),
779
+ intvec( 1, 2, 3, 4, 5, 10 ),
780
+ intvec( 1, 2, 3, 5, 6, 8 ),
781
+ intvec( 1, 2, 3, 5, 6, 9 ),
782
+ intvec( 1, 2, 3, 5, 7, 10 ),
783
+ intvec( 1, 2, 3, 7, 9, 10 ),
784
+ intvec( 1, 2, 3, 4, 5, 6, 7 ),
785
+ intvec( 1, 2, 3, 4, 5, 6, 8 ),
786
+ intvec( 1, 2, 3, 4, 5, 6, 9 ),
787
+ intvec( 1, 2, 3, 5, 6, 9, 10 ),
788
+ intvec( 1, 2, 3, 4, 5, 6, 7, 8 ),
789
+ intvec( 1, 2, 3, 4, 5, 6, 9, 10 ),
790
+ intvec( 1, 2, 3, 4, 5, 6, 7, 8, 9 ),
791
+ intvec( 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 );
792
+ list afaceOrbitRepresentatives=afaces(J,simplexOrbitRepresentatives);
793
+ list fulldimAfaceOrbitRepresentatives=fullDimImages(afaceOrbitRepresentatives,Q);
794
+ list afaceOrbits=computeAfaceOrbits(fulldimAfaceOrbitRepresentatives,simplexSymmetryGroup);
795
+ apply(afaceOrbits,size);
796
+ list minAfaceOrbits = minimalAfaceOrbits(afaceOrbits);
797
+ apply(minAfaceOrbits,size);
798
+ list listOfOrbitConeOrbits = orbitConeOrbits(minAfaceOrbits,Q);
799
+ apply(listOfOrbitConeOrbits,size);
800
+ list listOfMinimalOrbitConeOrbits = minimalOrbitConeOrbits(listOfOrbitConeOrbits);
801
+ size(listOfMinimalOrbitConeOrbits);
802
+ }
803
+
804
+
805
+ static proc containsOrbitdCone(list A, list B)
806
+ {
807
+ cone a = A[1];
808
+ for (int i=1; i<=size(B); i++)
809
+ {
810
+ if (isSubcone(a,B[i]))
811
+ {
812
+ dbprint("found subcone i="+string(i));
813
+ return (1);
814
+ }
815
+ }
816
+ return (0);
817
+ }
818
+
819
+ static proc isSubcone(cone c1, cone c2)
820
+ {
821
+ return(containsInSupport(c2, c1));
822
+ }
823
+
824
+
825
+
826
+
827
+
828
+
829
+ proc intersectOrbitsWithMovingCone(list OCmin,cone mov)
830
+ "USAGE: intersectOrbitsWithMovingCone(OCmin, mov); OCmin: list of lists of cones, mov: cone
831
+ PURPOSE: Intersects all cones in the orbits in OCmin with mov discarting all orbits of cones which are not of full dimension. The resulting orbits are duplicate free.
832
+ RETURN: a list of lists of cones
833
+ EXAMPLE: example intersectOrbitsWithMovingCone; shows an example
834
+ "
835
+ {
836
+ list OCmov;
837
+ cone ocmov;
838
+ int i,j;
839
+ int fulldim=dimension(mov);
840
+ for (i=1; i<=size(OCmin); i++)
841
+ {
842
+ dbprint("intersecting orbit "+string(i)+" with moving cone");
843
+ ocmov = convexIntersection(OCmin[i][1],mov);
844
+ if (dimension(ocmov)==fulldim)
845
+ {
846
+ list currentOrbit;
847
+ for (j=1; j<=size(OCmin[i]); j++)
848
+ {
849
+ dbprint("checking cone "+string(j)+" of "+string(size(OCmin[i])));
850
+ ocmov = convexIntersection(OCmin[i][j],mov);
851
+ ocmov = canonicalizeCone(ocmov);
852
+ if (!listContainsCone(currentOrbit,ocmov))
853
+ {
854
+ dbprint("inserting cone");
855
+ currentOrbit[size(currentOrbit)+1] = ocmov;
856
+ }
857
+ }
858
+ OCmov[size(OCmov)+1] = currentOrbit;
859
+ kill currentOrbit;
860
+ }
861
+ else
862
+ {
863
+ dbprint("intersection with moving cone lower-dimensional, abandoning orbit");
864
+ }
865
+ }
866
+ return(OCmov);
867
+ }
868
+ example {
869
+ echo=2;
870
+ ring R = 0,T(1..10),wp(1,1,1,1,1,1,1,1,1,1);
871
+ ideal J =
872
+ T(5)*T(10)-T(6)*T(9)+T(7)*T(8),
873
+ T(1)*T(9)-T(2)*T(7)+T(4)*T(5),
874
+ T(1)*T(8)-T(2)*T(6)+T(3)*T(5),
875
+ T(1)*T(10)-T(3)*T(7)+T(4)*T(6),
876
+ T(2)*T(10)-T(3)*T(9)+T(4)*T(8);
877
+ intmat Q[5][10] =
878
+ 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,
879
+ 1, 0, 0, 0, 1, 1, 1, 0, 0, 0,
880
+ 0, 1, 1, 0, 0, 0, -1, 1, 0, 0,
881
+ 0, 1, 0, 1, 0, -1, 0, 0, 1, 0,
882
+ 0, 0, 1, 1, -1, 0, 0, 0, 0, 1;
883
+ list simplexSymmetryGroup = G25Action();
884
+ list simplexOrbitRepresentatives = intvec( 1, 2, 3, 4, 5 ),
885
+ intvec( 1, 2, 3, 5, 6 ),
886
+ intvec( 1, 2, 3, 5, 7 ),
887
+ intvec( 1, 2, 3, 5, 10 ),
888
+ intvec( 1, 2, 3, 7, 9 ),
889
+ intvec( 1, 2, 6, 9, 10 ),
890
+ intvec( 1, 2, 3, 4, 5, 6 ),
891
+ intvec( 1, 2, 3, 4, 5, 10 ),
892
+ intvec( 1, 2, 3, 5, 6, 8 ),
893
+ intvec( 1, 2, 3, 5, 6, 9 ),
894
+ intvec( 1, 2, 3, 5, 7, 10 ),
895
+ intvec( 1, 2, 3, 7, 9, 10 ),
896
+ intvec( 1, 2, 3, 4, 5, 6, 7 ),
897
+ intvec( 1, 2, 3, 4, 5, 6, 8 ),
898
+ intvec( 1, 2, 3, 4, 5, 6, 9 ),
899
+ intvec( 1, 2, 3, 5, 6, 9, 10 ),
900
+ intvec( 1, 2, 3, 4, 5, 6, 7, 8 ),
901
+ intvec( 1, 2, 3, 4, 5, 6, 9, 10 ),
902
+ intvec( 1, 2, 3, 4, 5, 6, 7, 8, 9 ),
903
+ intvec( 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 );
904
+ list afaceOrbitRepresentatives=afaces(J,simplexOrbitRepresentatives);
905
+ list fulldimAfaceOrbitRepresentatives=fullDimImages(afaceOrbitRepresentatives,Q);
906
+ list afaceOrbits=computeAfaceOrbits(fulldimAfaceOrbitRepresentatives,simplexSymmetryGroup);
907
+ apply(afaceOrbits,size);
908
+ list minAfaceOrbits = minimalAfaceOrbits(afaceOrbits);
909
+ apply(minAfaceOrbits,size);
910
+ list listOfOrbitConeOrbits = orbitConeOrbits(minAfaceOrbits,Q);
911
+ cone mov = movingCone(Q);
912
+ intersectOrbitsWithMovingCone(listOfOrbitConeOrbits,mov);
913
+ }
914
+
915
+
916
+ static proc coneToString(cone C){
917
+ bigintmat F = facets(C);
918
+ ring R=0,(x),dp;
919
+ matrix FF[nrows(F)][ncols(F)];
920
+ int i,j;
921
+ for (i=1; i<=nrows(F);i++){
922
+ for (j=1; j<=ncols(F);j++){
923
+ FF[i,j]=number(F[i,j]);
924
+ }
925
+ }
926
+ return("bigintmat F["+string(nrows(F))+"]["+string(ncols(F))+"]="+string(FF)+";cone C=canonicalizeCone(coneViaInequalities(F));");
927
+ }
928
+
929
+ proc storeOrbitConeOrbits(list OC, string fn)
930
+ "USAGE: storeOrbitConeOrbits(OC, fn); OC: list of lists of cones, fn: string
931
+ PURPOSE: Writes OC to file fn in Singular readable format. Can be importet using <.
932
+ RETURN: nothing
933
+ "
934
+ {
935
+ int i,j;
936
+ write(":w "+fn,"list OC;");
937
+ for (i=1;i<=size(OC);i++){
938
+ write(":a "+fn,"list OCj;");
939
+ for (j=1;j<=size(OC[i]);j++){
940
+ write(":a "+fn,coneToString(OC[i][j]));
941
+ write(":a "+fn,"OCj[size(OCj)+1]=C;");
942
+ write(":a "+fn,"kill C;kill F;");
943
+ }
944
+ write(":a "+fn,"OC[size(OC)+1]=OCj;");
945
+ write(":a "+fn,"kill OCj;");
946
+ }
947
+ }
948
+
949
+ static proc storeCone(cone C,string fn){
950
+ intmat H = intmat(inequalities(C));
951
+ write(":w "+fn,"bigintmat H["+string(nrows(H))+"]["+string(ncols(H))+"] =");
952
+ write(":w "+fn,string(H)+";");
953
+ write(":a "+fn,"cone C= coneViaInequalities(H); kill H;");
954
+ }
955
+
956
+ static proc listToIntvec(list L){
957
+ intvec v;
958
+ for (int i = 1;i<=size(L);i++){
959
+ v[i]=L[i];}
960
+ return(v);
961
+ }
962
+
963
+ static proc intvecToList(intvec L){
964
+ list v;
965
+ for (int i = 1;i<=size(L);i++){
966
+ v[i]=L[i];}
967
+ return(v);
968
+ }
969
+
970
+ static proc stackMatrices(bigintmat M, bigintmat N){
971
+ if (ncols(M)!=ncols(N)){ERROR("matrices should have the same number of columns");}
972
+ bigintmat MN[nrows(M)+nrows(N)][ncols(N)];
973
+ MN[1..nrows(M),1..ncols(M)]=M[1..nrows(M),1..ncols(M)];
974
+ MN[(nrows(M)+1)..(nrows(M)+nrows(N)),1..ncols(M)]=N[1..nrows(N),1..ncols(N)];
975
+ return(MN);
976
+ }
977
+
978
+
979
+ proc movingCone(intmat Q)
980
+ "USAGE: movingCone(Q); Q: intmat
981
+ PURPOSE: Computes the moving cone from the grading matrix, with the degrees in the columns of Q.
982
+ RETURN: a cone
983
+ EXAMPLE: example movingCone; shows an example
984
+ "
985
+ {
986
+ // Check whether the cone generated by the columns of Q is pointed:
987
+ intmat Qt = transpose(Q);
988
+ cone CQ = coneViaPoints(Qt);
989
+ if (dimension(convexIntersection(CQ,negatedCone(CQ)))==0)
990
+ {
991
+ // The following old code assumes that
992
+ // the cone generated by the columns of Q is pointed:
993
+ cone Qgammadual = coneViaInequalities(Qt);
994
+ bigintmat R = facets(Qgammadual);
995
+ list idx1=intvecToList(intvec(1..nrows(R)));
996
+ intvec idx2=1..ncols(R);
997
+ intvec idx1iv;
998
+ bigintmat Ri[nrows(R)-1][ncols(R)];
999
+ list C;
1000
+ for (int i = 1; i<=nrows(R);i++){
1001
+ idx1iv = listToIntvec(delete(idx1,i));
1002
+ Ri=R[idx1iv,idx2];
1003
+ C[i]=coneViaPoints(Ri);
1004
+ dbprint(string(i)+" "+string(nrows(facets(C[i]))));
1005
+ }
1006
+ }
1007
+ else
1008
+ {
1009
+ // The following code works always but is generally slower:
1010
+ list C;
1011
+ int i,j;
1012
+ for (i=1; i<=nrows(Qt); i++)
1013
+ {
1014
+ intmat Qdash[nrows(Qt)-1][ncols(Qt)];
1015
+ for (j=1; j<i; j++)
1016
+ {
1017
+ Qdash[j,1..ncols(Qt)] = Qt[j,1..ncols(Qt)];
1018
+ }
1019
+ for (j=i+1; j<=nrows(Qt); j++)
1020
+ {
1021
+ Qdash[j-1,1..ncols(Qt)] = Qt[j,1..ncols(Qt)];
1022
+ }
1023
+ C[i] = coneViaPoints(Qdash);
1024
+ }
1025
+ }
1026
+ cone mov = convexIntersection(C);
1027
+ return(mov);
1028
+ }
1029
+ example
1030
+ {
1031
+ echo=2;
1032
+ intmat Q[5][10] =
1033
+ 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,
1034
+ 1, 0, 0, 0, 1, 1, 1, 0, 0, 0,
1035
+ 0, 1, 1, 0, 0, 0, -1, 1, 0, 0,
1036
+ 0, 1, 0, 1, 0, -1, 0, 0, 1, 0,
1037
+ 0, 0, 1, 1, -1, 0, 0, 0, 0, 1;
1038
+ cone mov = movingCone(Q);
1039
+ mov;
1040
+ rays(mov);
1041
+
1042
+ // moving cone where the image of the positive orthant
1043
+ // is the entire space
1044
+ // (from bug reported by Donton-Bury and Grab)
1045
+ intmat Q2[3][16] =
1046
+ 7, 7,7,7, 7,7,7, 7,7,7, 7,7,7, -7,0,0,
1047
+ 0, 0,2,1, 0,2,1, 3,2,1, 3,2,4, 0,-3,0,
1048
+ 0, 0,1,2, 0,1,2, 3,1,2, 3,4,2, 0,0,-3;
1049
+ cone mov2 = movingCone(Q2);
1050
+ mov2;
1051
+ rays(mov2);
1052
+ }
1053
+
1054
+
1055
+ static proc pivotIndices(matrix H)
1056
+ {
1057
+ intvec p;
1058
+ int pp;
1059
+ int i,j;
1060
+ int l=1;
1061
+ for (i=1; i<=ncols(H); i++)
1062
+ {
1063
+ for (j=nrows(H); j>=0; j--)
1064
+ {
1065
+ if (H[j,i]!=0)
1066
+ {
1067
+ if (j>pp)
1068
+ {
1069
+ p[l] = i;
1070
+ l++;
1071
+ pp = j;
1072
+ }
1073
+ break;
1074
+ }
1075
+ }
1076
+ }
1077
+ return (p);
1078
+ }
1079
+
1080
+
1081
+
1082
+ proc groupActionOnQImage(list G,intmat Q)
1083
+ "USAGE: groupActionOnQImage(G,Q); G: list of permutations, Q: intmat
1084
+ PURPOSE: Given the group G of permutations acting on the simplex on ncols(Q) objects, computes the corresponding group action on the image of Q. We assume that the basering has characteristic 0.
1085
+ RETURN: list of matrices
1086
+ EXAMPLE: example groupActionOnQImage; shows an example
1087
+ "
1088
+ {
1089
+ matrix Qmat = transpose(matrix(Q));
1090
+ matrix H = gauss_nf(Qmat);
1091
+ intvec indices = pivotIndices(H);
1092
+ intmat Qbasis[nrows(Q)][size(indices)]=Q[1..nrows(Q),indices];
1093
+ matrix QbasisInv = inverse(Qbasis);
1094
+ list L;
1095
+ intmat Qt = transpose(Q);
1096
+ for(int i = 1; i <= size(G); i++){
1097
+ intvec sig = permutationToIntvec(G[i]);
1098
+ intmat Bsig = perm2mat(sig, indices,Qt);
1099
+ matrix Asig = Bsig * QbasisInv;
1100
+ L[size(L)+1] = matrixToIntmat(Asig);
1101
+ kill sig;
1102
+ kill Bsig;
1103
+ kill Asig;
1104
+ }
1105
+ return(L);
1106
+ }
1107
+ example {
1108
+ echo=2;
1109
+ ring R = 0,(x),dp;
1110
+ intmat Q[5][10] =
1111
+ 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,
1112
+ 1, 0, 0, 0, 1, 1, 1, 0, 0, 0,
1113
+ 0, 1, 1, 0, 0, 0, -1, 1, 0, 0,
1114
+ 0, 1, 0, 1, 0, -1, 0, 0, 1, 0,
1115
+ 0, 0, 1, 1, -1, 0, 0, 0, 0, 1;
1116
+ list generatorsG = permutationFromIntvec(intvec( 1, 3, 2, 4, 6, 5, 7, 8, 10, 9 )),
1117
+ permutationFromIntvec(intvec( 5, 7, 1, 6, 9, 2, 8, 4, 10, 3 ));
1118
+ groupActionOnQImage(generatorsG,Q);
1119
+ }
1120
+
1121
+
1122
+
1123
+ static proc perm2mat(intvec sig, intvec indices, intmat Q){
1124
+ intvec sigind = 1:size(indices);
1125
+ for(int i = 1; i <= size(indices); i++){
1126
+ if(indices[i] > size(sig)){
1127
+ sigind[i] = indices[i];
1128
+ } else {
1129
+ sigind[i] = sig[indices[i]];
1130
+ }
1131
+ }
1132
+ intmat Asig[size(indices)][ncols(Q)];
1133
+ for(i = 1; i <= size(sigind); i++){
1134
+ Asig[i,1..ncols(Q)] = Q[sigind[i], 1..ncols(Q)];
1135
+ }
1136
+ // the new basis must be in the cols:
1137
+ return(transpose(Asig));
1138
+ }
1139
+
1140
+ ///////
1141
+
1142
+
1143
+
1144
+
1145
+ static proc imageCone(cone c, intmat A){
1146
+ bigintmat ineqs = inequalities(c);
1147
+ cone cc = coneViaInequalities (ineqs * A);
1148
+ return(cc);
1149
+ }
1150
+
1151
+
1152
+ static proc matrixToIntmat(matrix A){
1153
+ int i,j;
1154
+ intmat Aint[nrows(A)][ncols(A)];
1155
+ for(i = 1; i<=nrows(A); i++){
1156
+ for(j = 1; j<=ncols(A); j++){
1157
+ if (deg(A[i,j])>0){ERROR("entries should be constants");}
1158
+ if (denominator(number(A[i,j]))!=1){ERROR("entries should be integers");}
1159
+ Aint[i,j]=int(number(A[i,j]));
1160
+ }
1161
+ }
1162
+ return(Aint);
1163
+ }
1164
+
1165
+
1166
+ proc groupActionOnHashes(list Asigma, list OCmov)
1167
+ "USAGE: groupActionOnHashes(Asigma,OCmov); Asigma: list, OCmov: list of list of cones
1168
+ PURPOSE: From the list of orbits of orbitcones, and the symmetry group representation given by the matrices in Asigma, compute the corresponding permutation representation of the symmetry group on the orbit cones. The permutations are specified in a map representation of length the sum of the size of the orbits of OCmov.
1169
+ RETURN: list of permutations
1170
+ EXAMPLE: example groupActionOnHashes; shows an example
1171
+ "
1172
+ {
1173
+ // for each A in S6:
1174
+ // for each c in OC90:
1175
+ // store index of A*c
1176
+ // --> intvec v_A
1177
+ // store this in the list Ind
1178
+ list Ind;
1179
+ int i,j,b,k,sizepreviousorbits;
1180
+ list remaining;
1181
+ intmat A;
1182
+ cone c,Ac;
1183
+ for(i = 1; i<=size(Asigma); i++){
1184
+ intvec vA;
1185
+ A = intmat(Asigma[i]);
1186
+ dbprint("element "+string(i)+" of symmetry group");
1187
+ sizepreviousorbits=0;
1188
+ for(b = 1; b <= size(OCmov); b++){
1189
+ remaining = intvecToList(intvec(1..size(OCmov[b])));
1190
+ for(j = 1; j <= size(OCmov[b]); j++){
1191
+ Ac = imageCone(OCmov[b][j], A);
1192
+
1193
+ // find out index:
1194
+ for(k= 1; k <= size(remaining); k++){
1195
+ if(OCmov[b][remaining[k]] == Ac){
1196
+ vA[j+sizepreviousorbits] = remaining[k]+sizepreviousorbits;
1197
+ remaining = delete(remaining,k);
1198
+ break;
1199
+ }
1200
+ }
1201
+ }
1202
+
1203
+ sizepreviousorbits=size(vA);
1204
+ }
1205
+ Ind[size(Ind)+1] = permutationFromIntvec(vA);
1206
+ dbprint("vA: "+string(vA));
1207
+ kill vA;
1208
+ }
1209
+ return(Ind);
1210
+ }
1211
+ example
1212
+ {
1213
+ ring R = 0,T(1..10),wp(1,1,1,1,1,1,1,1,1,1);
1214
+ ideal J =
1215
+ T(5)*T(10)-T(6)*T(9)+T(7)*T(8),
1216
+ T(1)*T(9)-T(2)*T(7)+T(4)*T(5),
1217
+ T(1)*T(8)-T(2)*T(6)+T(3)*T(5),
1218
+ T(1)*T(10)-T(3)*T(7)+T(4)*T(6),
1219
+ T(2)*T(10)-T(3)*T(9)+T(4)*T(8);
1220
+ intmat Q[5][10] =
1221
+ 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,
1222
+ 1, 0, 0, 0, 1, 1, 1, 0, 0, 0,
1223
+ 0, 1, 1, 0, 0, 0, -1, 1, 0, 0,
1224
+ 0, 1, 0, 1, 0, -1, 0, 0, 1, 0,
1225
+ 0, 0, 1, 1, -1, 0, 0, 0, 0, 1;
1226
+ list AF= afaces(J);
1227
+ list OC = orbitCones(AF,Q);
1228
+ list generatorsG = permutationFromIntvec(intvec( 1, 3, 2, 4, 6, 5, 7, 8, 10, 9 )),
1229
+ permutationFromIntvec(intvec( 5, 7, 1, 6, 9, 2, 8, 4, 10, 3 ));
1230
+ list Asigmagens = groupActionOnQImage(generatorsG,Q);
1231
+ groupActionOnHashes(Asigmagens,list(OC));
1232
+
1233
+
1234
+ list simplexSymmetryGroup = G25Action();
1235
+ list orb = findOrbits(simplexSymmetryGroup,nrows(Q));
1236
+ list simplexOrbitRepresentatives;
1237
+ for (int i=1;i<=size(orb);i++){simplexOrbitRepresentatives[i]=orb[i][1];}
1238
+ list afaceOrbitRepresentatives=afaces(J,simplexOrbitRepresentatives);
1239
+ list fulldimAfaceOrbitRepresentatives=fullDimImages(afaceOrbitRepresentatives,Q);
1240
+ list afaceOrbits=computeAfaceOrbits(fulldimAfaceOrbitRepresentatives,simplexSymmetryGroup);
1241
+ list minAfaceOrbits = minimalAfaceOrbits(afaceOrbits);
1242
+ list listOfOrbitConeOrbits = orbitConeOrbits(minAfaceOrbits,Q);
1243
+ list listOfMinimalOrbitConeOrbits = minimalOrbitConeOrbits(listOfOrbitConeOrbits);
1244
+ list Asigma = groupActionOnQImage(simplexSymmetryGroup,Q);
1245
+ groupActionOnHashes(Asigma,listOfOrbitConeOrbits);
1246
+
1247
+ }
1248
+
1249
+
1250
+
1251
+
1252
+
1253
+
1254
+
1255
+
1256
+ static proc composePermutationsGAP(permutation sigma, permutation tau){
1257
+ intvec sigmaTauImage;
1258
+
1259
+ for (int i=1;i<=size(sigma.image);i++){
1260
+ sigmaTauImage[i]=tau.image[sigma.image[i]];
1261
+ }
1262
+
1263
+ permutation sigmaTau;
1264
+ sigmaTau.image = sigmaTauImage;
1265
+ return(sigmaTau);
1266
+ }
1267
+
1268
+ static proc composePermutations(permutation sigma, permutation tau){
1269
+ intvec sigmaTauImage;
1270
+
1271
+ for (int i=1;i<=size(sigma.image);i++){
1272
+ sigmaTauImage[i]=sigma.image[tau.image[i]];
1273
+ }
1274
+
1275
+ permutation sigmaTau;
1276
+ sigmaTau.image = sigmaTauImage;
1277
+ return(sigmaTau);
1278
+ }
1279
+
1280
+
1281
+ static proc permutationPower(permutation sigma, int k){
1282
+ int i;
1283
+ if (k==0)
1284
+ {
1285
+ permutation identity;
1286
+ identity.image = intvec(1..size(sigma.image));
1287
+ return (identity);
1288
+ }
1289
+ if (k<0)
1290
+ {
1291
+ // if k<0 invert sigma and replace k with -k
1292
+ intvec sigmaImage = sigma.image;
1293
+ for (i=1; i<=size(sigmaImage); i++)
1294
+ {
1295
+ sigma.image[sigmaImage[i]] = i;
1296
+ }
1297
+ k = -k;
1298
+ }
1299
+ permutation sigmaToPowerK = sigma;
1300
+ for (i=2; i<=k; i++)
1301
+ {
1302
+ sigmaToPowerK = composePermutations(sigmaToPowerK, sigma);
1303
+ }
1304
+ return (sigmaToPowerK);
1305
+ }
1306
+
1307
+ proc permutationFromIntvec(intvec sigmaImage)
1308
+ "USAGE: permutationFromIntvec(sigmaImage); sigmaImage: intvec
1309
+ PURPOSE: Create a permutation from an intvec of images.
1310
+ RETURN: permutation
1311
+ EXAMPLE: example permutationFromIntvec; shows an example
1312
+ "
1313
+ {
1314
+ permutation sigma;
1315
+ sigma.image = sigmaImage;
1316
+ return (sigma);
1317
+ }
1318
+
1319
+
1320
+ proc evaluateProduct(list generatorsGperm, string st)
1321
+ "USAGE: evaluateProduct(generatorsGperm,st); generatorsGperm: list, st: string
1322
+ PURPOSE: Evaluates a formal product of variables xi in st, where xi corresponds to the permutation generatorsGperm[i].
1323
+ RETURN: permutation
1324
+ EXAMPLE: example evaluateProduct; shows an example
1325
+ "
1326
+ {
1327
+ for (int i=1;i<=size(generatorsGperm);i++){
1328
+ execute("permutation x"+string(i)+"= generatorsGperm[i];");
1329
+ }
1330
+ if (st==""){
1331
+ st="x1^0";
1332
+ }
1333
+ execute("permutation sigma = "+st);
1334
+ return(sigma);}
1335
+ example
1336
+ {
1337
+ ring R = 0,T(1..10),wp(1,1,1,1,1,1,1,1,1,1);
1338
+ ideal J =
1339
+ T(5)*T(10)-T(6)*T(9)+T(7)*T(8),
1340
+ T(1)*T(9)-T(2)*T(7)+T(4)*T(5),
1341
+ T(1)*T(8)-T(2)*T(6)+T(3)*T(5),
1342
+ T(1)*T(10)-T(3)*T(7)+T(4)*T(6),
1343
+ T(2)*T(10)-T(3)*T(9)+T(4)*T(8);
1344
+ intmat Q[5][10] =
1345
+ 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,
1346
+ 1, 0, 0, 0, 1, 1, 1, 0, 0, 0,
1347
+ 0, 1, 1, 0, 0, 0, -1, 1, 0, 0,
1348
+ 0, 1, 0, 1, 0, -1, 0, 0, 1, 0,
1349
+ 0, 0, 1, 1, -1, 0, 0, 0, 0, 1;
1350
+ list AF= afaces(J);
1351
+ list OC = orbitCones(AF,Q);
1352
+ list generatorsG = permutationFromIntvec(intvec( 1, 3, 2, 4, 6, 5, 7, 8, 10, 9 )),
1353
+ permutationFromIntvec(intvec( 5, 7, 1, 6, 9, 2, 8, 4, 10, 3 ));
1354
+ list Asigmagens = groupActionOnQImage(generatorsG,Q);
1355
+ //list actionOnOrbitconeIndicesForGenerators = groupActionOnHashes(Asigmagens,OC);
1356
+ string elementInTermsOfGenerators =
1357
+ "(x2^-1*x1^-1)^3*x1^-1";
1358
+ //evaluateProduct(actionOnOrbitconeIndicesForGenerators, elementInTermsOfGenerators);
1359
+ }
1360
+
1361
+
1362
+ proc permutationToIntvec(permutation sigma)
1363
+ "USAGE: permutationToIntvec(sigma); sigma: permutation
1364
+ PURPOSE: Convert a permutation to an intvec of images.
1365
+ RETURN: intvec
1366
+ EXAMPLE: example permutationToIntvec; shows an example
1367
+ "
1368
+ {return(sigma.image);}
1369
+ example
1370
+ {
1371
+ permutation sigma = permutationFromIntvec(intvec( 1, 2, 4, 3, 5, 7, 6, 9, 8, 10 ));
1372
+ sigma;
1373
+ permutationToIntvec(sigma);
1374
+ }
1375
+
1376
+
1377
+
1378
+
1379
+
1380
+
1381
+
1382
+
1383
+
1384
+
1385
+
1386
+
1387
+ proc storeActionOnOrbitConeIndices(list Ind,string fn)
1388
+ "USAGE: storeActionOnOrbitConeIndices(generatorsGperm,st); generatorsGperm: list, fn: string
1389
+ PURPOSE: Write the action on the set of orbit cones to the file fn in Singular readable format.
1390
+ RETURN: nothing
1391
+ "
1392
+ {
1393
+ string s = "list actionOnOrbitconeIndices;";
1394
+ for(int i =1; i <= size(Ind); i++){
1395
+ s = s + "intvec v = " + string(Ind[i]) + ";" + newline;
1396
+ s = s + "actionOnOrbitconeIndices[size(actionOnOrbitconeIndices)+1] = permutationFromIntvec(v);" + newline + "kill v;" + newline;
1397
+ }
1398
+ write(":w "+fn, s);
1399
+ }
1400
+
1401
+
1402
+
1403
+
1404
+
1405
+ static proc getNeighborHash(list OC, bigintmat w, bigintmat v, int mu)
1406
+ {
1407
+ int success = 0;
1408
+ int zz;
1409
+ intvec Jtmp;
1410
+ bigintmat wtmp;
1411
+
1412
+ while(!success)
1413
+ {
1414
+ mu = mu*2;
1415
+ wtmp = mu*w - v;
1416
+ success = 1;
1417
+ for(zz = 1; zz <= size(OC); zz++)
1418
+ {
1419
+ if(containsInSupport(OC[zz], wtmp))
1420
+ {
1421
+ if(!containsInSupport(OC[zz], w))
1422
+ {
1423
+ success = 0;
1424
+ Jtmp = 0;
1425
+ break;
1426
+ }
1427
+ // insert index zz:
1428
+ if(size(Jtmp) ==1 && Jtmp[1] == 0)
1429
+ {
1430
+ Jtmp[1] = zz;
1431
+ }
1432
+ else
1433
+ {
1434
+ Jtmp[size(Jtmp)+1] = zz;
1435
+ }
1436
+ }
1437
+ }
1438
+ }
1439
+
1440
+ return(Jtmp);
1441
+ }
1442
+
1443
+
1444
+
1445
+
1446
+ ///////////////////////////////////////
1447
+
1448
+ proc GITfanSymmetric(list OC, bigintmat Q, cone Qgamma, list actiononorbitcones, list #)
1449
+ "USAGE: GITfanSymmetric(OC, Q, Qgamma, actiononorbitcones [, file1, file2]); OC:list, Q:bigintmat, Qgamma:cone, actiononorbitcones: list of intvec, file1:string, file2:string
1450
+ PURPOSE: Returns the common refinement of the cones given in
1451
+ the list OC which is supposed to contain the orbit cones intersected with Qgamma. The list actiononorbitcones is supposed to contain the symmetry group acting as permutations of on the list of orbit cones in OC. The optional argument can be used to specify one or two strings with file names, where the first file will contain the hashes of the GIT-cones and the second argument the actual cones in their H-representation.
1452
+ To obtain the whole GIT-fan Qgamma has to be take the cone generated by the columns of Q.
1453
+ RETURN: a list containing the bigint hashes of the GIT cones.
1454
+ EXAMPLE: example GITfanSymmetric; shows an example
1455
+ "
1456
+ {
1457
+ actiononorbitcones=apply(actiononorbitcones,permutationToIntvec);
1458
+ /**
1459
+ * stores the hashes of all maximal GIT cones computed
1460
+ */
1461
+ list hashesOfCones;
1462
+ /**
1463
+ * stores to the corresponding maximal GIT cone in hashesOfCones
1464
+ * - 0, if guaranteed that all adjacent GIT cones are known
1465
+ * or are to be computed in the next iteration (*)
1466
+ * - hash as intvec, otherwise
1467
+ */
1468
+ list workingList;
1469
+
1470
+
1471
+ /**
1472
+ * compute starting cone
1473
+ */
1474
+ bigintmat w,v;
1475
+ cone lambda;
1476
+ intvec lambdaHash;
1477
+ while(dimension(lambda) <> nrows(Q)){
1478
+ w = randConeEl(transpose(Q),100);
1479
+ dbprint("testing "+string(w));
1480
+ if (containsRelatively(Qgamma,w)) {
1481
+ lambda,lambdaHash = GITcone(OC,w);
1482
+ dbprint("computed cone of dimension "+string(dimension(lambda)));
1483
+ }
1484
+ }
1485
+ int nCones = 1; // essentially size(hashesOfCones)
1486
+ int nConesOpen = 1; // essentially size(workingList)+1, see (*) above
1487
+
1488
+
1489
+ /**
1490
+ * initialize lists
1491
+ */
1492
+ int posToInsert = 1;
1493
+ bigint hashToInsert = binaryToBigint(lambdaHash);
1494
+ intvec sigLambdaHash;
1495
+ for(int i = 2; i <= size(actiononorbitcones); i++){
1496
+ sigLambdaHash = composeIntvecs(actiononorbitcones[i],lambdaHash);
1497
+ hashToInsert = min(hashToInsert,binaryToBigint(sigLambdaHash));
1498
+ }
1499
+ hashesOfCones[1] = hashToInsert;
1500
+ workingList[1] = int(0);
1501
+ if (size(#)>0) {write(":w "+#[1],string(hashesOfCones[1]) + ",");}
1502
+ if (size(#)>1) {write(":w "+#[2],"");writeGitconeToFile(lambda,#[2]);}
1503
+
1504
+
1505
+ /**
1506
+ * traverse fan
1507
+ */
1508
+ int t,tt;
1509
+ list FL;
1510
+ intvec neighbourHash;
1511
+ int mu = 1024;
1512
+ while (lambdaHash>0)
1513
+ {
1514
+ tt=timer;
1515
+
1516
+ /**
1517
+ * compute all facets of lambda
1518
+ */
1519
+ t = timer;
1520
+ FL = listOfFacetsAndInteriorVectors(lambda, Qgamma);
1521
+ dbprint("time for facets: "+string(timer - t));
1522
+
1523
+ /**
1524
+ * compute all neighbours of lambda
1525
+ */
1526
+ for (i=size(FL[1]); i>0; i--)
1527
+ {
1528
+ v = FL[1][i][1]; // interior facet normal
1529
+ w = FL[1][i][2]; // interior facet point
1530
+ neighbourHash = getNeighborHash(OC,w,v,mu);
1531
+ posToInsert,hashToInsert = findPosToInsertSymmetric(hashesOfCones,neighbourHash,actiononorbitcones);
1532
+ if(posToInsert > 0)
1533
+ {
1534
+ if (size(#)>0){write(":a "+#[1],string(binaryToBigint(neighbourHash)) + ",");}
1535
+ hashesOfCones = insertToList(hashesOfCones,hashToInsert,posToInsert);
1536
+ workingList = insertToList(workingList,neighbourHash,posToInsert);
1537
+ nConesOpen++;
1538
+ nCones++;
1539
+ }
1540
+ }
1541
+
1542
+ /**
1543
+ * pick lambdaHash and lambda for next iteration,
1544
+ * set respective entry in workingList to 0
1545
+ */
1546
+ lambdaHash = 0;
1547
+ for (i=size(workingList); i>0; i--)
1548
+ {
1549
+ if (typeof(workingList[i])=="intvec")
1550
+ {
1551
+ lambdaHash = workingList[i];
1552
+ lambda = gitConeFromHash(OC,lambdaHash);
1553
+ if (size(#)>1) {writeGitconeToFile(lambda,#[2]);}
1554
+ workingList[i] = int(0);
1555
+ break;
1556
+ }
1557
+ }
1558
+ nConesOpen--;
1559
+
1560
+ dbprint("overall: "+string(nCones)+" open: "+string(nConesOpen)+" time for loop: "+string(timer-tt));
1561
+ }
1562
+ return(hashesOfCones);
1563
+ }
1564
+ example
1565
+ {
1566
+ ring R = 0,T(1..10),wp(1,1,1,1,1,1,1,1,1,1);
1567
+ ideal J =
1568
+ T(5)*T(10)-T(6)*T(9)+T(7)*T(8),
1569
+ T(1)*T(9)-T(2)*T(7)+T(4)*T(5),
1570
+ T(1)*T(8)-T(2)*T(6)+T(3)*T(5),
1571
+ T(1)*T(10)-T(3)*T(7)+T(4)*T(6),
1572
+ T(2)*T(10)-T(3)*T(9)+T(4)*T(8);
1573
+ intmat Q[5][10] =
1574
+ 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,
1575
+ 1, 0, 0, 0, 1, 1, 1, 0, 0, 0,
1576
+ 0, 1, 1, 0, 0, 0, -1, 1, 0, 0,
1577
+ 0, 1, 0, 1, 0, -1, 0, 0, 1, 0,
1578
+ 0, 0, 1, 1, -1, 0, 0, 0, 0, 1;
1579
+ list simplexSymmetryGroup = G25Action();
1580
+ list simplexOrbitRepresentatives = intvec( 1, 2, 3, 4, 5 ),
1581
+ intvec( 1, 2, 3, 5, 6 ),
1582
+ intvec( 1, 2, 3, 5, 7 ),
1583
+ intvec( 1, 2, 3, 5, 10 ),
1584
+ intvec( 1, 2, 3, 7, 9 ),
1585
+ intvec( 1, 2, 6, 9, 10 ),
1586
+ intvec( 1, 2, 3, 4, 5, 6 ),
1587
+ intvec( 1, 2, 3, 4, 5, 10 ),
1588
+ intvec( 1, 2, 3, 5, 6, 8 ),
1589
+ intvec( 1, 2, 3, 5, 6, 9 ),
1590
+ intvec( 1, 2, 3, 5, 7, 10 ),
1591
+ intvec( 1, 2, 3, 7, 9, 10 ),
1592
+ intvec( 1, 2, 3, 4, 5, 6, 7 ),
1593
+ intvec( 1, 2, 3, 4, 5, 6, 8 ),
1594
+ intvec( 1, 2, 3, 4, 5, 6, 9 ),
1595
+ intvec( 1, 2, 3, 5, 6, 9, 10 ),
1596
+ intvec( 1, 2, 3, 4, 5, 6, 7, 8 ),
1597
+ intvec( 1, 2, 3, 4, 5, 6, 9, 10 ),
1598
+ intvec( 1, 2, 3, 4, 5, 6, 7, 8, 9 ),
1599
+ intvec( 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 );
1600
+ list afaceOrbitRepresentatives=afaces(J,simplexOrbitRepresentatives);
1601
+ list fulldimAfaceOrbitRepresentatives=fullDimImages(afaceOrbitRepresentatives,Q);
1602
+ list afaceOrbits=computeAfaceOrbits(fulldimAfaceOrbitRepresentatives,simplexSymmetryGroup);
1603
+ apply(afaceOrbits,size);
1604
+ list minAfaceOrbits = minimalAfaceOrbits(afaceOrbits);
1605
+ apply(minAfaceOrbits,size);
1606
+ list listOfOrbitConeOrbits = orbitConeOrbits(minAfaceOrbits,Q);
1607
+ apply(listOfOrbitConeOrbits,size);
1608
+ list listOfMinimalOrbitConeOrbits = minimalOrbitConeOrbits(listOfOrbitConeOrbits);
1609
+ size(listOfMinimalOrbitConeOrbits);
1610
+ list Asigma = groupActionOnQImage(simplexSymmetryGroup,Q);
1611
+ list actionOnOrbitconeIndices = groupActionOnHashes(Asigma,listOfOrbitConeOrbits);
1612
+ list OClist = listOfOrbitConeOrbits[1];
1613
+ for (int i =2;i<=size(listOfOrbitConeOrbits);i++){
1614
+ OClist = OClist + listOfOrbitConeOrbits[i];
1615
+ }
1616
+ cone mov = coneViaPoints(transpose(Q));
1617
+ mov = canonicalizeCone(mov);
1618
+ printlevel = 3;
1619
+ list Sigma = GITfanSymmetric(OClist, Q, mov, actionOnOrbitconeIndices);
1620
+ Sigma;
1621
+ }
1622
+
1623
+
1624
+ proc GITfanParallelSymmetric(list OC, bigintmat Q, cone Qgamma, list actiononorbitcones, list #)
1625
+ "USAGE: GITfanParallelSymmetric(OC, Q, Qgamma, actiononorbitcones [, file1]); OC:list, Q:bigintmat, Qgamma:cone, actiononorbitcones: list of intvec, file1:string
1626
+ PURPOSE: Returns the common refinement of the cones given in
1627
+ the list OC which is supposed to contain the orbit cones intersected with Qgamma. The list actiononorbitcones is supposed to contain the symmetry group acting as permutations of on the list of orbit cones in OC. The optional argument can be used to specify a name for a file which will contain the hashes of the GIT-cones.
1628
+ To obtain the whole GIT-fan Qgamma has to be take the cone generated by the columns of Q.
1629
+ RETURN: a list containing the bigint hashes of the GIT cones.
1630
+ NOTE: The procedure uses parallel computation for the construction of the GIT-cones.
1631
+ EXAMPLE: example GITfanParallelSymmetric; shows an example
1632
+ "
1633
+ {
1634
+ actiononorbitcones=apply(actiononorbitcones,permutationToIntvec);
1635
+ /**
1636
+ * stores the hashes of all maximal GIT cones computed
1637
+ */
1638
+ list hashesOfCones;
1639
+ /**
1640
+ * stores to the corresponding maximal GIT cone in hashesOfCones
1641
+ * - 0, if guaranteed that all adjacent GIT cones are known
1642
+ * or are to be computed in the next iteration (*)
1643
+ * - hash as intvec, otherwise
1644
+ */
1645
+ list workingList;
1646
+
1647
+
1648
+ /**
1649
+ * compute starting cone
1650
+ */
1651
+ bigintmat w,v;
1652
+ cone lambda;
1653
+ intvec lambdaHash;
1654
+ while(dimension(lambda) <> nrows(Q)){
1655
+ w = randConeEl(transpose(Q),100);
1656
+ dbprint("testing "+string(w));
1657
+ if (containsRelatively(Qgamma,w)) {
1658
+ lambda,lambdaHash = GITcone(OC,w);
1659
+ dbprint("computed cone of dimension "+string(dimension(lambda)));
1660
+ }
1661
+ }
1662
+ int nCones = 1; // essentially size(hashesOfCones)
1663
+ int nConesOpen = 1; // essentially size(workingList)+1, see (*) above
1664
+
1665
+
1666
+ /**
1667
+ * initialize lists
1668
+ */
1669
+ bigint hashToInsert = binaryToBigint(lambdaHash);
1670
+ int posToInsert = 1;
1671
+ intvec sigLambdaHash;
1672
+ for(int i = 2; i <= size(actiononorbitcones); i++){
1673
+ sigLambdaHash = composeIntvecs(actiononorbitcones[i],lambdaHash);
1674
+ hashToInsert = min(hashToInsert,binaryToBigint(sigLambdaHash));
1675
+ }
1676
+ hashesOfCones[1] = hashToInsert;
1677
+ workingList[1] = int(0);
1678
+ if (size(#)>0) {write(":w "+#[1],string(binaryToBigint(lambdaHash)) + ",");}
1679
+ //if (size(#)>1) {write(":w "+#[2],"list listOfMaximalCones;");writeGitconeToFile(lambda,#[2]);}
1680
+
1681
+
1682
+ list iterationArgs = list(list(lambdaHash,OC,Qgamma,actiononorbitcones));
1683
+ list iterationRes;
1684
+
1685
+ /**
1686
+ * traverse fan
1687
+ */
1688
+ int j,t,tloop;
1689
+ list FL;
1690
+ list neighbourHashes;
1691
+ intvec neighbourHash;
1692
+ while (size(iterationArgs)>0)
1693
+ {
1694
+ tloop=rtimer;
1695
+
1696
+ /**
1697
+ * compute all neighbours of lambda
1698
+ */
1699
+ t = rtimer;
1700
+ iterationRes = parallelWaitAll("computeNeighbourMinimalHashes",iterationArgs);
1701
+ dbprint("time neighbours: "+string(rtimer - t));
1702
+
1703
+ /**
1704
+ * central book keeping
1705
+ */
1706
+ t = rtimer;
1707
+ for (i=1; i<=size(iterationRes); i++)
1708
+ {
1709
+ neighbourHashes = iterationRes[i];
1710
+ for (j=1; j<=size(neighbourHashes); j++)
1711
+ {
1712
+ neighbourHash = neighbourHashes[j];
1713
+ hashToInsert = binaryToBigint(neighbourHash);
1714
+ posToInsert = findPlaceToInsert(hashesOfCones,hashToInsert);
1715
+ if(posToInsert > 0)
1716
+ {
1717
+ if (size(#)>0){write(":a "+#[1],string(binaryToBigint(neighbourHash)) + ",");}
1718
+ hashesOfCones = insertToList(hashesOfCones,hashToInsert,posToInsert);
1719
+ workingList = insertToList(workingList,neighbourHash,posToInsert);
1720
+ nConesOpen++;
1721
+ nCones++;
1722
+ }
1723
+ }
1724
+ }
1725
+ nConesOpen = nConesOpen - size(iterationArgs);
1726
+ dbprint("time bookkeeping: "+string(rtimer - t));
1727
+
1728
+ /**
1729
+ * pick arguments for next iteration,
1730
+ * set respective entry in workingList to 0
1731
+ */
1732
+ t = rtimer;
1733
+ iterationArgs = list();
1734
+ for (i=size(workingList); i>0; i--)
1735
+ {
1736
+ if (typeof(workingList[i])=="intvec")
1737
+ {
1738
+ iterationArgs[size(iterationArgs)+1] = list(workingList[i],OC,Qgamma,actiononorbitcones);
1739
+ workingList[i] = int(0);
1740
+ if (size(iterationArgs) >= getcores())
1741
+ {
1742
+ break;
1743
+ }
1744
+ }
1745
+ }
1746
+ dbprint("time preparation: "+string(rtimer - t));
1747
+
1748
+ dbprint("overall: "+string(nCones)+" open: "+string(nConesOpen)+" time loop: "+string(rtimer-tloop));
1749
+ }
1750
+ return(hashesOfCones);
1751
+ }
1752
+ example
1753
+ {
1754
+ ring R = 0,T(1..10),wp(1,1,1,1,1,1,1,1,1,1);
1755
+ ideal J =
1756
+ T(5)*T(10)-T(6)*T(9)+T(7)*T(8),
1757
+ T(1)*T(9)-T(2)*T(7)+T(4)*T(5),
1758
+ T(1)*T(8)-T(2)*T(6)+T(3)*T(5),
1759
+ T(1)*T(10)-T(3)*T(7)+T(4)*T(6),
1760
+ T(2)*T(10)-T(3)*T(9)+T(4)*T(8);
1761
+ intmat Q[5][10] =
1762
+ 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,
1763
+ 1, 0, 0, 0, 1, 1, 1, 0, 0, 0,
1764
+ 0, 1, 1, 0, 0, 0, -1, 1, 0, 0,
1765
+ 0, 1, 0, 1, 0, -1, 0, 0, 1, 0,
1766
+ 0, 0, 1, 1, -1, 0, 0, 0, 0, 1;
1767
+ list simplexSymmetryGroup = G25Action();
1768
+ list simplexOrbitRepresentatives = intvec( 1, 2, 3, 4, 5 ),
1769
+ intvec( 1, 2, 3, 5, 6 ),
1770
+ intvec( 1, 2, 3, 5, 7 ),
1771
+ intvec( 1, 2, 3, 5, 10 ),
1772
+ intvec( 1, 2, 3, 7, 9 ),
1773
+ intvec( 1, 2, 6, 9, 10 ),
1774
+ intvec( 1, 2, 3, 4, 5, 6 ),
1775
+ intvec( 1, 2, 3, 4, 5, 10 ),
1776
+ intvec( 1, 2, 3, 5, 6, 8 ),
1777
+ intvec( 1, 2, 3, 5, 6, 9 ),
1778
+ intvec( 1, 2, 3, 5, 7, 10 ),
1779
+ intvec( 1, 2, 3, 7, 9, 10 ),
1780
+ intvec( 1, 2, 3, 4, 5, 6, 7 ),
1781
+ intvec( 1, 2, 3, 4, 5, 6, 8 ),
1782
+ intvec( 1, 2, 3, 4, 5, 6, 9 ),
1783
+ intvec( 1, 2, 3, 5, 6, 9, 10 ),
1784
+ intvec( 1, 2, 3, 4, 5, 6, 7, 8 ),
1785
+ intvec( 1, 2, 3, 4, 5, 6, 9, 10 ),
1786
+ intvec( 1, 2, 3, 4, 5, 6, 7, 8, 9 ),
1787
+ intvec( 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 );
1788
+ list afaceOrbitRepresentatives=afaces(J,simplexOrbitRepresentatives);
1789
+ list fulldimAfaceOrbitRepresentatives=fullDimImages(afaceOrbitRepresentatives,Q);
1790
+ list afaceOrbits=computeAfaceOrbits(fulldimAfaceOrbitRepresentatives,simplexSymmetryGroup);
1791
+ apply(afaceOrbits,size);
1792
+ list minAfaceOrbits = minimalAfaceOrbits(afaceOrbits);
1793
+ apply(minAfaceOrbits,size);
1794
+ list listOfOrbitConeOrbits = orbitConeOrbits(minAfaceOrbits,Q);
1795
+ apply(listOfOrbitConeOrbits,size);
1796
+ list listOfMinimalOrbitConeOrbits = minimalOrbitConeOrbits(listOfOrbitConeOrbits);
1797
+ size(listOfMinimalOrbitConeOrbits);
1798
+ list Asigma = groupActionOnQImage(simplexSymmetryGroup,Q);
1799
+ list actionOnOrbitconeIndices = groupActionOnHashes(Asigma,listOfOrbitConeOrbits);
1800
+ list OClist = listOfOrbitConeOrbits[1];
1801
+ for (int i =2;i<=size(listOfOrbitConeOrbits);i++){
1802
+ OClist = OClist + listOfOrbitConeOrbits[i];
1803
+ }
1804
+ cone mov = coneViaPoints(transpose(Q));
1805
+ mov = canonicalizeCone(mov);
1806
+ list Sigma = GITfanParallelSymmetric(OClist, Q, mov, actionOnOrbitconeIndices);
1807
+ Sigma;
1808
+ }
1809
+
1810
+
1811
+ // not static to be used in parallel.lib
1812
+ proc computeNeighbourMinimalHashes(intvec lambdaHash, list OC, cone Qgamma, list actiononorbitcones)
1813
+ {
1814
+ /**
1815
+ * compute all facets of lambda
1816
+ */
1817
+ cone lambda = gitConeFromHash(OC,lambdaHash);
1818
+ list FL = listOfFacetsAndInteriorVectors(lambda, Qgamma);
1819
+
1820
+ /**
1821
+ * compute all minimal hashes of neighbours of lambda
1822
+ */
1823
+ int i,j;
1824
+ bigintmat v,w;
1825
+ intvec neighbourHash;
1826
+ intvec neighbourHashPerm;
1827
+ bigint nPerm;
1828
+ intvec neighbourHashMin;
1829
+ bigint nMin;
1830
+ list neighbourHashes;
1831
+ for (i=size(FL[1]); i>0; i--)
1832
+ {
1833
+ v = FL[1][i][1]; // interior facet normal
1834
+ w = FL[1][i][2]; // interior facet point
1835
+ neighbourHash = getNeighborHash(OC,w,v,1024);
1836
+ neighbourHashMin = neighbourHash;
1837
+ nMin = binaryToBigint(neighbourHash);
1838
+ for (j=size(actiononorbitcones); j>1; j--)
1839
+ {
1840
+ neighbourHashPerm = composeIntvecs(actiononorbitcones[j],neighbourHash);
1841
+ nPerm = binaryToBigint(neighbourHashPerm);
1842
+ if (nPerm < nMin)
1843
+ {
1844
+ nMin = nPerm;
1845
+ neighbourHashMin = neighbourHashPerm;
1846
+ }
1847
+ }
1848
+ neighbourHashes[i] = neighbourHashMin;
1849
+ }
1850
+
1851
+ return (neighbourHashes);
1852
+ }
1853
+
1854
+
1855
+
1856
+ static proc writeGitconeToFile(cone lambda,string fn)
1857
+ {
1858
+ bigintmat H = facets(lambda);
1859
+
1860
+ int rows = nrows(H);
1861
+ int cols = ncols(H);
1862
+ string toBeWritten = "bigintmat H["+string(rows)+"]["+string(cols)+"]=";
1863
+ int i,j;
1864
+ for (i=1; i<=rows; i++)
1865
+ {
1866
+ for (j=1; j<=cols; j++)
1867
+ {
1868
+ toBeWritten = toBeWritten + string(H[i,j]) + ",";
1869
+ }
1870
+ }
1871
+ toBeWritten = toBeWritten[1..size(toBeWritten)-1];
1872
+ toBeWritten = toBeWritten + ";";
1873
+ write(":a "+fn,toBeWritten);
1874
+
1875
+ toBeWritten = "listOfMaximalCones[size(listOfMaximalCones)+1] = coneViaInequalities(V);";
1876
+ write(":a "+fn,toBeWritten);
1877
+
1878
+ toBeWritten = "kill V;";
1879
+ write(":a "+fn,toBeWritten);
1880
+
1881
+ toBeWritten = "";
1882
+ write(":a "+fn,toBeWritten);
1883
+ }
1884
+
1885
+
1886
+
1887
+ static proc listOfFacetsAndInteriorVectors(cone lambda, cone Qgamma, list #){
1888
+ list FL;
1889
+ int numboundary;
1890
+
1891
+ bigintmat FL0 = facets(lambda);
1892
+ bigintmat H[1][ncols(FL0)];
1893
+ bigintmat FL1[nrows(FL0)-1][ncols(FL0)]; // delete row of H from FL0
1894
+
1895
+ bigintmat w;
1896
+ cone facetCone;
1897
+ for(int i = 1; i <= nrows(FL0); i++){
1898
+ H = FL0[i,1..ncols(FL0)];
1899
+
1900
+ if(i > 1 and i < nrows(FL0)){
1901
+ FL1 = FL0[1..i-1, 1..ncols(FL0)], FL0[i+1..nrows(FL0), 1..ncols(FL0)];
1902
+ } else {
1903
+ if(i == nrows(FL0)){
1904
+ FL1 = FL0[1..i-1, 1..ncols(FL0)];
1905
+ } else { // i = 1:
1906
+ FL1 = FL0[2..nrows(FL0), 1..ncols(FL0)];
1907
+ }
1908
+ }
1909
+
1910
+ facetCone = coneViaInequalities(FL1, H);
1911
+
1912
+ if (size(#)>0)
1913
+ {
1914
+ if (containsInSupport(facetCone,#[1]))
1915
+ {
1916
+ i++;
1917
+ continue;
1918
+ }
1919
+ }
1920
+
1921
+ w = relativeInteriorPoint(facetCone);
1922
+
1923
+ if(containsRelatively(Qgamma,w)){
1924
+ FL[size(FL) + 1] = list(H,w);
1925
+ } else {
1926
+ numboundary=numboundary+1;
1927
+ }
1928
+ }
1929
+
1930
+ return(list(FL,numboundary));
1931
+ }
1932
+
1933
+
1934
+
1935
+
1936
+
1937
+ ////////////////////////////////
1938
+
1939
+ // CAREFUL: we assume that actiononorbitcones[1] = id.
1940
+ static proc findPosToInsertSymmetric(list hashesOfCones, intvec J, list actiononorbitcones){
1941
+
1942
+ // 1.: compute minimal hash sigJ
1943
+ bigint n = binaryToBigint(J);
1944
+ intvec sigJ;
1945
+ for(int i = 2; i <= size(actiononorbitcones); i++){
1946
+ sigJ = composeIntvecs(actiononorbitcones[i],J);
1947
+ n = min(n,binaryToBigint(sigJ));
1948
+ }
1949
+
1950
+ // 2.:check if minimal hash is already in list
1951
+ return(findPlaceToInsert(hashesOfCones,n),n);
1952
+ }
1953
+
1954
+ //////////////////////
1955
+
1956
+ // insert n at position pos and move bigger elements by one index
1957
+ proc insertToList(list L, def elementToInsert, int posToInsert){
1958
+ if(posToInsert == 1){
1959
+ return(list(elementToInsert)+L);
1960
+ }
1961
+ if(posToInsert == size(L)+1){
1962
+ return(L+list(elementToInsert));
1963
+ }
1964
+ return(list(L[1..(posToInsert-1)],elementToInsert,L[posToInsert..size(L)]));
1965
+ }
1966
+
1967
+ proc GITcone(list OCcones, bigintmat w)
1968
+ "USAGE: GITcone(OCcones, w); OCcones: list of orbit cones, w: bigintmat with one row
1969
+ PURPOSE: Returns the intersection of all orbit cones containing w.
1970
+ RETURN: cone,intvec with the GIT cone containing w, and the hash of this cone (the indices of the orbit cones contributing to the intersection)
1971
+ EXAMPLE: example GITcone; shows an example
1972
+ "
1973
+ {
1974
+ list OCrelcones;
1975
+ intvec Hash;
1976
+ for(int i = 1; i <= size(OCcones); i++){
1977
+ if(containsInSupport(OCcones[i], w)){
1978
+ OCrelcones[size(OCrelcones)+1]=OCcones[i];
1979
+ Hash[size(Hash)+1] = i;
1980
+ }
1981
+ }
1982
+ Hash = intvec(Hash[2..size(Hash)]);
1983
+ return(convexIntersection(OCrelcones),Hash);
1984
+ }
1985
+ example {
1986
+ echo=2;
1987
+ ring R = 0,T(1..10),wp(1,1,1,1,1,1,1,1,1,1);
1988
+ ideal J =
1989
+ T(5)*T(10)-T(6)*T(9)+T(7)*T(8),
1990
+ T(1)*T(9)-T(2)*T(7)+T(4)*T(5),
1991
+ T(1)*T(8)-T(2)*T(6)+T(3)*T(5),
1992
+ T(1)*T(10)-T(3)*T(7)+T(4)*T(6),
1993
+ T(2)*T(10)-T(3)*T(9)+T(4)*T(8);
1994
+ intmat Q[5][10] =
1995
+ 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,
1996
+ 1, 0, 0, 0, 1, 1, 1, 0, 0, 0,
1997
+ 0, 1, 1, 0, 0, 0, -1, 1, 0, 0,
1998
+ 0, 1, 0, 1, 0, -1, 0, 0, 1, 0,
1999
+ 0, 0, 1, 1, -1, 0, 0, 0, 0, 1;
2000
+
2001
+ list AF= afaces(J,nrows(Q));
2002
+ AF=fullDimImages(AF,Q);
2003
+ AF = minimalAfaces(AF);
2004
+ list OC = orbitCones(AF,Q);
2005
+ bigintmat w[1][nrows(Q)];
2006
+ int j;
2007
+ for(int i = 1; i <= nrows(Q); i++)
2008
+ {
2009
+ for(j=1;j<=nrows(Q);j++)
2010
+ {
2011
+ w[1,j]= w[1,j] + Q[1,i];
2012
+ }
2013
+ }
2014
+ GITcone(OC,w);
2015
+ }
2016
+
2017
+
2018
+ static proc gitConeFromHash(list OC, intvec Hash)
2019
+ {
2020
+ list OCtoIntersect = OC[Hash];
2021
+ return (convexIntersection(OCtoIntersect));
2022
+ }
2023
+
2024
+
2025
+
2026
+
2027
+
2028
+ static proc randConeEl(bigintmat Q, int bound){
2029
+ bigintmat w[1][ncols(Q)];
2030
+
2031
+ for(int i = 1; i <= nrows(Q); i++){
2032
+ bigintmat v[1][ncols(Q)] = Q[i,1..ncols(Q)];
2033
+
2034
+ w = w + random(1,bound) * v;
2035
+
2036
+ kill v;
2037
+ }
2038
+
2039
+ return(w);
2040
+ }
2041
+
2042
+
2043
+
2044
+ static proc subdividelist(list OC,int ncores){
2045
+ if (ncores>size(OC)){ncores=size(OC);}
2046
+ int percore = size(OC) div (ncores);
2047
+ int lastcore = size(OC) mod (ncores);
2048
+ list OCLL;
2049
+ int j=1;
2050
+ int starti=1;
2051
+ int endi;
2052
+ for (int i=1;i<=ncores;i++){
2053
+ endi = starti+percore-1;
2054
+ if (i<=lastcore) {endi=endi+1;}
2055
+ list OCLLi=OC[starti..endi];
2056
+ starti=endi+1;
2057
+ OCLL[i]=OCLLi;
2058
+ kill OCLLi;
2059
+ }
2060
+ return(OCLL);
2061
+ }
2062
+ //list OC = 1,2,3,4,5,6,7,8,9,10,11,12;
2063
+ //subdividelist(OC,4);
2064
+
2065
+
2066
+
2067
+
2068
+
2069
+
2070
+
2071
+
2072
+
2073
+
2074
+
2075
+
2076
+ proc orbitCones(list AF, intmat Q, list #)
2077
+ "USAGE: orbitCones(AF, Q[, d]); AF: list of intvecs, Q: intmat, d: int
2078
+ PURPOSE: Returns the list consisting of all cones Q(gam0) where gam0 in AF. If the optional argument d is given then the function returns only the orbit cones of dimension at least d
2079
+ RETURN: a list of cones
2080
+ EXAMPLE: example orbitCones; shows an example
2081
+ "
2082
+ {
2083
+ list OC;
2084
+ intvec gam0;
2085
+ int j;
2086
+ cone c;
2087
+ int d = 0;
2088
+ if (size(#)>0) {
2089
+ d = #[1];
2090
+ }
2091
+
2092
+ for(int i = 1; i <= size(AF); i++){
2093
+ gam0 = AF[i];
2094
+
2095
+ if(gam0 == 0){
2096
+ bigintmat M[1][nrows(Q)];
2097
+ } else {
2098
+ bigintmat M[size(gam0)][nrows(Q)];
2099
+
2100
+ for (j = 1; j <= size(gam0); j++){
2101
+ M[j,1..ncols(M)] = Q[1..nrows(Q),gam0[j]];
2102
+ }
2103
+ }
2104
+
2105
+ c = coneViaPoints(M);
2106
+
2107
+ if(listContainsCone(OC, c) == 0 && dimension(c)>=d){
2108
+ OC[size(OC)+1] = c;
2109
+ }
2110
+
2111
+ kill M;
2112
+ }
2113
+
2114
+ return(OC);
2115
+ }
2116
+ example
2117
+ {
2118
+ echo=2;
2119
+ ring R = 0,T(1..10),wp(1,1,1,1,1,1,1,1,1,1);
2120
+ ideal J =
2121
+ T(5)*T(10)-T(6)*T(9)+T(7)*T(8),
2122
+ T(1)*T(9)-T(2)*T(7)+T(4)*T(5),
2123
+ T(1)*T(8)-T(2)*T(6)+T(3)*T(5),
2124
+ T(1)*T(10)-T(3)*T(7)+T(4)*T(6),
2125
+ T(2)*T(10)-T(3)*T(9)+T(4)*T(8);
2126
+ intmat Q[5][10] =
2127
+ 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,
2128
+ 1, 0, 0, 0, 1, 1, 1, 0, 0, 0,
2129
+ 0, 1, 1, 0, 0, 0, -1, 1, 0, 0,
2130
+ 0, 1, 0, 1, 0, -1, 0, 0, 1, 0,
2131
+ 0, 0, 1, 1, -1, 0, 0, 0, 0, 1;
2132
+
2133
+ list AF= afaces(J);
2134
+ print(size(AF));
2135
+ list OC = orbitCones(AF,Q);
2136
+ size(OC);
2137
+ }
2138
+
2139
+
2140
+
2141
+ ///////////////////////////////////////
2142
+
2143
+ proc GITfanFromOrbitCones(list OC, bigintmat Q, cone Qgamma, list #)
2144
+ "USAGE: GITfanFromOrbitCones(OC, Q, Qgamma [, file1, file2]); OC:list, Q:bigintmat, Qgamma:cone, file1:string, file2:string
2145
+ PURPOSE: Returns the common refinement of the cones given in
2146
+ the list OC which is supposed to contain the orbit cones intersected with Qgamma. The optional argument can be used
2147
+ to specify one or two strings with file names, where the first file will contain the hashes of the
2148
+ GIT-cones and the second argument the actual cones in their H-representation.
2149
+ To obtain the whole GIT-fan Qgamma has to be take the cone generated by the columns of Q.
2150
+ RETURN: a list containing the bigint hashes of the GIT cones.
2151
+ EXAMPLE: example GITfanFromOrbitCones; shows an example
2152
+ "
2153
+ {
2154
+ /**
2155
+ * stores the hashes of all maximal GIT cones computed
2156
+ */
2157
+ list hashesOfCones;
2158
+ /**
2159
+ * stores to the corresponding maximal GIT cone in hashesOfCones
2160
+ * - 0, if guaranteed that all adjacent GIT cones are known
2161
+ * or are to be computed in the next iteration (*)
2162
+ * - hash as intvec, otherwise
2163
+ */
2164
+ list workingList;
2165
+
2166
+
2167
+ /**
2168
+ * compute starting cone
2169
+ */
2170
+ bigintmat w,v;
2171
+ cone lambda;
2172
+ intvec lambdaHash;
2173
+ while(dimension(lambda) <> nrows(Q)){
2174
+ w = randConeEl(transpose(Q),100);
2175
+ dbprint("testing "+string(w));
2176
+ if (containsRelatively(Qgamma,w)) {
2177
+ lambda,lambdaHash = GITcone(OC,w);
2178
+ dbprint("computed cone of dimension "+string(dimension(lambda)));
2179
+ }
2180
+ }
2181
+ int nCones = 1; // essentially size(hashesOfCones)
2182
+ int nConesOpen = 1; // essentially size(workingList)+1, see (*) above
2183
+
2184
+
2185
+ /**
2186
+ * initialize lists
2187
+ */
2188
+ int posToInsert = 1;
2189
+ bigint hashToInsert = binaryToBigint(lambdaHash);
2190
+ hashesOfCones[1] = hashToInsert;
2191
+ workingList[1] = int(0);
2192
+ if (size(#)>0) {write(":w "+#[1],string(hashesOfCones[1]) + ",");}
2193
+ if (size(#)>1) {write(":w "+#[2],"list listOfMaximalCones;");writeGitconeToFile(lambda,#[2]);}
2194
+
2195
+
2196
+ /**
2197
+ * traverse fan
2198
+ */
2199
+ int i,t,tt;
2200
+ list FL;
2201
+ intvec neighbourHash;
2202
+ int mu = 1024;
2203
+ while (lambdaHash>0)
2204
+ {
2205
+ tt=timer;
2206
+
2207
+ /**
2208
+ * compute all facets of lambda
2209
+ */
2210
+ t = timer;
2211
+ FL = listOfFacetsAndInteriorVectors(lambda, Qgamma);
2212
+ dbprint("time for facets: "+string(timer - t));
2213
+
2214
+ /**
2215
+ * compute all neighbours of lambda
2216
+ */
2217
+ for (i=size(FL[1]); i>0; i--)
2218
+ {
2219
+ v = FL[1][i][1]; // interior facet normal
2220
+ w = FL[1][i][2]; // interior facet point
2221
+ neighbourHash = getNeighborHash(OC,w,v,mu);
2222
+ hashToInsert = binaryToBigint(neighbourHash);
2223
+ posToInsert = findPlaceToInsert(hashesOfCones,hashToInsert);
2224
+
2225
+ if(posToInsert > 0)
2226
+ {
2227
+ if (size(#)>0){write(":a "+#[1],string(binaryToBigint(neighbourHash)) + ",");}
2228
+ hashesOfCones = insertToList(hashesOfCones,hashToInsert,posToInsert);
2229
+ workingList = insertToList(workingList,neighbourHash,posToInsert);
2230
+ nConesOpen++;
2231
+ nCones++;
2232
+ }
2233
+ }
2234
+
2235
+ /**
2236
+ * pick lambdaHash and lambda for next iteration,
2237
+ * set respective entry in workingList to 0
2238
+ */
2239
+ lambdaHash = 0;
2240
+ for (i=size(workingList); i>0; i--)
2241
+ {
2242
+ if (typeof(workingList[i])=="intvec")
2243
+ {
2244
+ lambdaHash = workingList[i];
2245
+ lambda = gitConeFromHash(OC,lambdaHash);
2246
+ if (size(#)>1) {writeGitconeToFile(lambda,#[2]);}
2247
+ workingList[i] = int(0);
2248
+ break;
2249
+ }
2250
+ }
2251
+ nConesOpen--;
2252
+
2253
+ dbprint("overall: "+string(nCones)+" open: "+string(nConesOpen)+" time for loop: "+string(timer-tt));
2254
+ }
2255
+ return(hashesOfCones);
2256
+ }
2257
+ example
2258
+ {
2259
+ echo=2;
2260
+ ring R = 0,T(1..10),wp(1,1,1,1,1,1,1,1,1,1);
2261
+ ideal J =
2262
+ T(5)*T(10)-T(6)*T(9)+T(7)*T(8),
2263
+ T(1)*T(9)-T(2)*T(7)+T(4)*T(5),
2264
+ T(1)*T(8)-T(2)*T(6)+T(3)*T(5),
2265
+ T(1)*T(10)-T(3)*T(7)+T(4)*T(6),
2266
+ T(2)*T(10)-T(3)*T(9)+T(4)*T(8);
2267
+ intmat Q[5][10] =
2268
+ 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,
2269
+ 1, 0, 0, 0, 1, 1, 1, 0, 0, 0,
2270
+ 0, 1, 1, 0, 0, 0, -1, 1, 0, 0,
2271
+ 0, 1, 0, 1, 0, -1, 0, 0, 1, 0,
2272
+ 0, 0, 1, 1, -1, 0, 0, 0, 0, 1;
2273
+
2274
+ list AF= afaces(J,nrows(Q));
2275
+ AF=fullDimImages(AF,Q);
2276
+ AF = minimalAfaces(AF);
2277
+ list OC = orbitCones(AF,Q);
2278
+ cone Qgamma = coneViaPoints(transpose(Q));
2279
+ list GIT = GITfanFromOrbitCones(OC,Q,Qgamma);
2280
+ size(GIT);
2281
+ }
2282
+
2283
+
2284
+
2285
+
2286
+
2287
+ proc GITfanParallel(list OC, intmat Q, cone Qgamma, list #)
2288
+ "USAGE: GITfanParallel(OC, Q, Qgamma [, file1]); OC:list, Q:intmat, Qgamma:cone, file1:string
2289
+ PURPOSE: Returns the common refinement of the cones given in
2290
+ the list OC which is supposed to contain the orbit cones intersected with Qgamma. The optional argument can be used to specify a name for a file which will contain the hashes of the GIT-cones.
2291
+ To obtain the whole GIT-fan Qgamma has to be take the cone generated by the columns of Q.
2292
+ RETURN: a list containing the bigint hashes of the GIT cones.
2293
+ NOTE: The procedure uses parallel computation for the construction of the GIT-cones.
2294
+ EXAMPLE: example GITfanParallel; shows an example
2295
+ "
2296
+ {
2297
+ /**
2298
+ * stores the hashes of all maximal GIT cones computed
2299
+ */
2300
+ list hashesOfCones;
2301
+ /**
2302
+ * stores to the corresponding maximal GIT cone in hashesOfCones
2303
+ * - 0, if guaranteed that all adjacent GIT cones are known
2304
+ * or are to be computed in the next iteration (*)
2305
+ * - hash as intvec, otherwise
2306
+ */
2307
+ list workingList;
2308
+
2309
+
2310
+ /**
2311
+ * compute starting cone
2312
+ */
2313
+ bigintmat w,v;
2314
+ cone lambda;
2315
+ intvec lambdaHash;
2316
+ while(dimension(lambda) <> nrows(Q)){
2317
+ w = randConeEl(transpose(Q),100);
2318
+ dbprint("testing "+string(w));
2319
+ if (containsRelatively(Qgamma,w)) {
2320
+ lambda,lambdaHash = GITcone(OC,w);
2321
+ dbprint("computed cone of dimension "+string(dimension(lambda)));
2322
+ }
2323
+ }
2324
+ int nCones = 1; // essentially size(hashesOfCones)
2325
+ int nConesOpen = 1; // essentially size(workingList)+1, see (*) above
2326
+
2327
+
2328
+ /**
2329
+ * initialize lists
2330
+ */
2331
+ bigint hashToInsert = binaryToBigint(lambdaHash);
2332
+ int posToInsert = 1;
2333
+ hashesOfCones[1] = hashToInsert;
2334
+ workingList[1] = int(0);
2335
+ if (size(#)>0) {write(":w "+#[1],string(binaryToBigint(lambdaHash)) + ",");}
2336
+ //if (size(#)>1) {write(":w "+#[2],"list listOfMaximalCones;");writeGitconeToFile(lambda,#[2]);}
2337
+
2338
+
2339
+ list iterationArgs = list(list(lambdaHash,OC,Qgamma));
2340
+ list iterationRes;
2341
+
2342
+ /**
2343
+ * traverse fan
2344
+ */
2345
+ int i,j,t,tloop;
2346
+ list FL;
2347
+ list neighbourHashes;
2348
+ intvec neighbourHash;
2349
+ while (size(iterationArgs)>0)
2350
+ {
2351
+ tloop=rtimer;
2352
+
2353
+ /**
2354
+ * compute all neighbours of lambda
2355
+ */
2356
+ t = rtimer;
2357
+ iterationRes = parallelWaitAll("computeNeighbourHashes",iterationArgs);
2358
+ dbprint("time neighbours: "+string(rtimer - t));
2359
+
2360
+ /**
2361
+ * central book keeping
2362
+ */
2363
+ t = rtimer;
2364
+ for (i=1; i<=size(iterationRes); i++)
2365
+ {
2366
+ neighbourHashes = iterationRes[i];
2367
+ for (j=1; j<=size(neighbourHashes); j++)
2368
+ {
2369
+ neighbourHash = neighbourHashes[j];
2370
+ hashToInsert = binaryToBigint(neighbourHash);
2371
+ posToInsert = findPlaceToInsert(hashesOfCones,hashToInsert);
2372
+ if(posToInsert > 0)
2373
+ {
2374
+ if (size(#)>0){write(":a "+#[1],string(binaryToBigint(neighbourHash)) + ",");}
2375
+ hashesOfCones = insertToList(hashesOfCones,hashToInsert,posToInsert);
2376
+ workingList = insertToList(workingList,neighbourHash,posToInsert);
2377
+ nConesOpen++;
2378
+ nCones++;
2379
+ }
2380
+ }
2381
+ }
2382
+ nConesOpen = nConesOpen - size(iterationArgs);
2383
+ dbprint("time bookkeeping: "+string(rtimer - t));
2384
+
2385
+ /**
2386
+ * pick arguments for next iteration,
2387
+ * set respective entry in workingList to 0
2388
+ */
2389
+ t = rtimer;
2390
+ iterationArgs = list();
2391
+ for (i=size(workingList); i>0; i--)
2392
+ {
2393
+ if (typeof(workingList[i])=="intvec")
2394
+ {
2395
+ iterationArgs[size(iterationArgs)+1] = list(workingList[i],OC,Qgamma);
2396
+ workingList[i] = int(0);
2397
+ if (size(iterationArgs) >= getcores())
2398
+ {
2399
+ break;
2400
+ }
2401
+ }
2402
+ }
2403
+ dbprint("time preparation: "+string(rtimer - t));
2404
+
2405
+ dbprint("overall: "+string(nCones)+" open: "+string(nConesOpen)+" time loop: "+string(rtimer-tloop));
2406
+ }
2407
+
2408
+ if (size(#)==0)
2409
+ {
2410
+ return(hashesOfCones);
2411
+ }
2412
+ }
2413
+ example
2414
+ {
2415
+ echo=2;
2416
+ setcores(4);
2417
+ ring R = 0,T(1..10),wp(1,1,1,1,1,1,1,1,1,1);
2418
+ ideal J =
2419
+ T(5)*T(10)-T(6)*T(9)+T(7)*T(8),
2420
+ T(1)*T(9)-T(2)*T(7)+T(4)*T(5),
2421
+ T(1)*T(8)-T(2)*T(6)+T(3)*T(5),
2422
+ T(1)*T(10)-T(3)*T(7)+T(4)*T(6),
2423
+ T(2)*T(10)-T(3)*T(9)+T(4)*T(8);
2424
+ intmat Q[5][10] =
2425
+ 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,
2426
+ 1, 0, 0, 0, 1, 1, 1, 0, 0, 0,
2427
+ 0, 1, 1, 0, 0, 0, -1, 1, 0, 0,
2428
+ 0, 1, 0, 1, 0, -1, 0, 0, 1, 0,
2429
+ 0, 0, 1, 1, -1, 0, 0, 0, 0, 1;
2430
+
2431
+ list AF= afaces(J);
2432
+ print(size(AF));
2433
+ list OC = orbitCones(AF,Q);
2434
+ cone Qgamma = coneViaPoints(transpose(Q));
2435
+ list GIT = GITfanParallel(OC,Q,Qgamma);
2436
+ size(GIT);
2437
+ }
2438
+
2439
+ // not static to be used in parallel.lib
2440
+ proc computeNeighbourHashes(intvec lambdaHash, list OC, cone Qgamma)
2441
+ {
2442
+ /**
2443
+ * compute all facets of lambda
2444
+ */
2445
+ cone lambda = gitConeFromHash(OC,lambdaHash);
2446
+ list FL = listOfFacetsAndInteriorVectors(lambda, Qgamma);
2447
+
2448
+ /**
2449
+ * compute all minimal hashes of neighbours of lambda
2450
+ */
2451
+ bigintmat v,w;
2452
+ intvec neighbourHash;
2453
+ list neighbourHashes;
2454
+ for (int i=size(FL[1]); i>0; i--)
2455
+ {
2456
+ v = FL[1][i][1]; // interior facet normal
2457
+ w = FL[1][i][2]; // interior facet point
2458
+ neighbourHash = getNeighborHash(OC,w,v,1024);
2459
+ neighbourHashes[i] = neighbourHash;
2460
+ }
2461
+
2462
+ return (neighbourHashes);
2463
+ }
2464
+
2465
+
2466
+
2467
+ proc minimalAfaces(list listOfAfaces)
2468
+ "USAGE: minimalAfaces(listOfAfaces); listOfAfaces: list
2469
+ PURPOSE: Returns a list of all minimal a-faces. Note that listOfAfaces must only contain
2470
+ afaces which project to full dimension.
2471
+ RETURN: a list of intvecs
2472
+ EXAMPLE: example minimalAfaces; shows an example
2473
+ "
2474
+ {
2475
+ int i,j;
2476
+ for (i=1; i<=size(listOfAfaces); i++)
2477
+ {
2478
+ for (j=1; j<=size(listOfAfaces); j++)
2479
+ {
2480
+ if (i!=j)
2481
+ {
2482
+ if (isSubset(listOfAfaces[i],listOfAfaces[j]))
2483
+ {
2484
+ listOfAfaces = delete(listOfAfaces,j);
2485
+ if (j<i)
2486
+ {
2487
+ i = i-1;
2488
+ }
2489
+ j = j-1;
2490
+ }
2491
+ }
2492
+ }
2493
+ }
2494
+ return(listOfAfaces);
2495
+ }
2496
+ example
2497
+ {
2498
+ echo=2;
2499
+ setcores(4);
2500
+ ring R = 0,T(1..10),wp(1,1,1,1,1,1,1,1,1,1);
2501
+ ideal J =
2502
+ T(5)*T(10)-T(6)*T(9)+T(7)*T(8),
2503
+ T(1)*T(9)-T(2)*T(7)+T(4)*T(5),
2504
+ T(1)*T(8)-T(2)*T(6)+T(3)*T(5),
2505
+ T(1)*T(10)-T(3)*T(7)+T(4)*T(6),
2506
+ T(2)*T(10)-T(3)*T(9)+T(4)*T(8);
2507
+ intmat Q[5][10] =
2508
+ 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,
2509
+ 1, 0, 0, 0, 1, 1, 1, 0, 0, 0,
2510
+ 0, 1, 1, 0, 0, 0, -1, 1, 0, 0,
2511
+ 0, 1, 0, 1, 0, -1, 0, 0, 1, 0,
2512
+ 0, 0, 1, 1, -1, 0, 0, 0, 0, 1;
2513
+ list AF= afaces(J,nrows(Q));
2514
+ size(AF);
2515
+ AF=fullDimImages(AF,Q);
2516
+ size(AF);
2517
+ AF=minimalAfaces(AF);
2518
+ size(AF);
2519
+ }
2520
+
2521
+
2522
+
2523
+ proc GITfan(ideal J, intmat Q, list #)
2524
+ "USAGE: GITfan(J,Q [, G]); J:ideal, Q:intmat, G:list
2525
+ PURPOSE: Computes the GIT fan associated to J and Q. Optionally a symmetry group action on the column space of Q can be specified.
2526
+ RETURN: a fan, the GIT fan.
2527
+ NOTE: The procedure uses parallel computation for the construction of the GIT-cones. The a-faces are not computed in parallel. This can be done by calling the aface procedure specifying a list of simplex faces. If used with the optional argument G, the orbit decomposition of the simplex of columns of Q is computed. Refer to the Singular documentation on how to do this more efficiently using GAP.
2528
+ EXAMPLE: example GITfan; shows an example
2529
+ "
2530
+ {
2531
+ list GIT;
2532
+ list OC;
2533
+ if (size(#)>0){
2534
+ (GIT,OC) = GITfanWrapperWithSymmetry(J,Q,#);
2535
+ } else {
2536
+ list AF= afaces(J,nrows(Q));
2537
+ AF=fullDimImages(AF,Q);
2538
+ AF = minimalAfaces(AF);
2539
+ OC = orbitCones(AF,Q);
2540
+ cone Qgamma = coneViaPoints(transpose(Q));
2541
+ GIT = GITfanParallel(OC,Q,Qgamma);
2542
+ }
2543
+ fan Sigma = hashesToFan(GIT,OC);
2544
+ return(Sigma);
2545
+ }
2546
+ example
2547
+ {
2548
+ echo=2;
2549
+ setcores(4);
2550
+ ring R = 0,T(1..10),wp(1,1,1,1,1,1,1,1,1,1);
2551
+ ideal J =
2552
+ T(5)*T(10)-T(6)*T(9)+T(7)*T(8),
2553
+ T(1)*T(9)-T(2)*T(7)+T(4)*T(5),
2554
+ T(1)*T(8)-T(2)*T(6)+T(3)*T(5),
2555
+ T(1)*T(10)-T(3)*T(7)+T(4)*T(6),
2556
+ T(2)*T(10)-T(3)*T(9)+T(4)*T(8);
2557
+ intmat Q[5][10] =
2558
+ 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,
2559
+ 1, 0, 0, 0, 1, 1, 1, 0, 0, 0,
2560
+ 0, 1, 1, 0, 0, 0, -1, 1, 0, 0,
2561
+ 0, 1, 0, 1, 0, -1, 0, 0, 1, 0,
2562
+ 0, 0, 1, 1, -1, 0, 0, 0, 0, 1;
2563
+ fan GIT = GITfan(J,Q);
2564
+
2565
+ intmat Q[5][10] =
2566
+ 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,
2567
+ 1, 0, 0, 0, 1, 1, 1, 0, 0, 0,
2568
+ 0, 1, 1, 0, 0, 0, -1, 1, 0, 0,
2569
+ 0, 1, 0, 1, 0, -1, 0, 0, 1, 0,
2570
+ 0, 0, 1, 1, -1, 0, 0, 0, 0, 1;
2571
+ list simplexSymmetryGroup = G25Action();
2572
+ fan GIT2 = GITfan(J,Q,simplexSymmetryGroup);
2573
+
2574
+ }
2575
+
2576
+
2577
+ proc hashToCone(bigint v, list OC)
2578
+ "USAGE: hashToCone(v, OC): v bigint, OC list of cones.
2579
+ ASSUME: the elements of OC are the orbit cones used in the hash representation of the GIT cones.
2580
+ RETURN: a cone, the intersection of the cones in OC according to the binary representation of the hash v.
2581
+ EXAMPLE: example hashToCone; shows an example
2582
+ "
2583
+ {
2584
+ intvec J = bigintToBinary(v, size(OC));
2585
+ return(convexIntersection(list(OC[J])));
2586
+ }
2587
+ example
2588
+ {
2589
+ echo = 2;
2590
+ setcores(4);
2591
+ ring R = 0,T(1..10),wp(1,1,1,1,1,1,1,1,1,1);
2592
+ ideal J =
2593
+ T(5)*T(10)-T(6)*T(9)+T(7)*T(8),
2594
+ T(1)*T(9)-T(2)*T(7)+T(4)*T(5),
2595
+ T(1)*T(8)-T(2)*T(6)+T(3)*T(5),
2596
+ T(1)*T(10)-T(3)*T(7)+T(4)*T(6),
2597
+ T(2)*T(10)-T(3)*T(9)+T(4)*T(8);
2598
+ intmat Q[5][10] =
2599
+ 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,
2600
+ 1, 0, 0, 0, 1, 1, 1, 0, 0, 0,
2601
+ 0, 1, 1, 0, 0, 0, -1, 1, 0, 0,
2602
+ 0, 1, 0, 1, 0, -1, 0, 0, 1, 0,
2603
+ 0, 0, 1, 1, -1, 0, 0, 0, 0, 1;
2604
+ list AF= afaces(J,nrows(Q));
2605
+ AF=fullDimImages(AF,Q);
2606
+ AF = minimalAfaces(AF);
2607
+ list OC = orbitCones(AF,Q);
2608
+ bigint v = 21300544;
2609
+ hashToCone(v, OC);
2610
+ }
2611
+
2612
+
2613
+ proc bigintToBinary(bigint n, int r)
2614
+ "
2615
+ USAGE: bigintToBinary(n, r): n bigint, r int.
2616
+ ASSUME: n is smaller then 2^r.
2617
+ RETURN: an intvec, with entries the positions of 1 in the binary representation of n with r bits.
2618
+ EXAMPLE: example bigintToBinary; shows an example
2619
+ "
2620
+ {
2621
+ int k = r-1;
2622
+
2623
+ intvec v;
2624
+ bigint n0 = n;
2625
+
2626
+ while(n0 > 0){
2627
+ bigint tmp = bigint(2)^k;
2628
+
2629
+ while(tmp > n0){
2630
+ k--;
2631
+ tmp = bigint(2)^k;
2632
+ }
2633
+
2634
+ v = k+1,v;
2635
+ n0 = n0 - tmp;
2636
+ k--;
2637
+
2638
+ kill tmp;
2639
+ }
2640
+
2641
+ v = v[1..size(v)-1];
2642
+ return(v);
2643
+ }
2644
+ example
2645
+ {
2646
+ echo = 2;
2647
+ bigintToBinary(bigint(2)^90-1, 90);
2648
+ }
2649
+
2650
+
2651
+
2652
+
2653
+ proc hashesToFan(list hashes, list OC)
2654
+ "USAGE: hashesToFan(hashes, OC): hashes list of bigint, OC list of cones.
2655
+ ASSUME: the elements of OC are the orbit cones used in the hash representation of the GIT cones.
2656
+ RETURN: a fan, with maximal cones the intersections of the cones in OC according to the binary representation of the hashes.
2657
+ EXAMPLE: example hashesToFan; shows an example
2658
+ "
2659
+ {
2660
+ fan Sigma = emptyFan(ambientDimension(OC[1]));
2661
+ for (int i=1;i<=size(hashes);i++){
2662
+ insertCone(Sigma,hashToCone(hashes[i],OC),0);
2663
+ }
2664
+ return(Sigma);
2665
+ }
2666
+ example
2667
+ {
2668
+ echo = 2;
2669
+ setcores(4);
2670
+ ring R = 0,T(1..10),wp(1,1,1,1,1,1,1,1,1,1);
2671
+ ideal J =
2672
+ T(5)*T(10)-T(6)*T(9)+T(7)*T(8),
2673
+ T(1)*T(9)-T(2)*T(7)+T(4)*T(5),
2674
+ T(1)*T(8)-T(2)*T(6)+T(3)*T(5),
2675
+ T(1)*T(10)-T(3)*T(7)+T(4)*T(6),
2676
+ T(2)*T(10)-T(3)*T(9)+T(4)*T(8);
2677
+ intmat Q[5][10] =
2678
+ 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,
2679
+ 1, 0, 0, 0, 1, 1, 1, 0, 0, 0,
2680
+ 0, 1, 1, 0, 0, 0, -1, 1, 0, 0,
2681
+ 0, 1, 0, 1, 0, -1, 0, 0, 1, 0,
2682
+ 0, 0, 1, 1, -1, 0, 0, 0, 0, 1;
2683
+ list AF= afaces(J,nrows(Q));
2684
+ AF=fullDimImages(AF,Q);
2685
+ AF = minimalAfaces(AF);
2686
+ list OC = orbitCones(AF,Q);
2687
+ cone Qgamma = coneViaPoints(transpose(Q));
2688
+ list GIT = GITfanParallel(OC,Q,Qgamma);
2689
+ fan Sigma = hashesToFan(GIT,OC);
2690
+ }
2691
+
2692
+
2693
+
2694
+
2695
+ /////////////////////////////////////
2696
+
2697
+ proc gkzFan(intmat Q)
2698
+ "USAGE: gkzFan(Q); a: ideal, Q:intmat
2699
+ PURPOSE: Returns the GKZ-fan of the matrix Q.
2700
+ RETURN: a fan.
2701
+ EXAMPLE: example gkzFan; shows an example
2702
+ "
2703
+ {
2704
+ // only difference to gitFan:
2705
+ // it suffices to consider all faces
2706
+ // that are simplicial:
2707
+ list OC = simplicialToricOrbitCones(Q);
2708
+ print(size(OC));
2709
+ cone Qgamma = coneViaPoints(transpose(Q));
2710
+ list GIT = GITfanParallel(OC,Q,Qgamma);
2711
+ fan Sigma = hashesToFan(GIT,OC);
2712
+ return(Sigma);
2713
+ }
2714
+ example
2715
+ {
2716
+ echo=2;
2717
+ intmat Q[3][4] =
2718
+ 1,0,1,0,
2719
+ 0,1,0,1,
2720
+ 0,0,1,1;
2721
+
2722
+ gkzFan(Q);
2723
+ }
2724
+
2725
+
2726
+
2727
+ /////////////////////////////////////
2728
+
2729
+ // Computes all simplicial orbit cones
2730
+ // w.r.t. the 0-ideal:
2731
+ static proc simplicialToricOrbitCones(bigintmat Q){
2732
+ intvec gam0;
2733
+ list OC;
2734
+ cone c;
2735
+ int r = ncols(Q);
2736
+ int j;
2737
+
2738
+ for(int i = 1; i < 2^r; i++ ){
2739
+ gam0 = int2face(i,r);
2740
+
2741
+ // each simplicial cone is generated by
2742
+ // exactly nrows(Q) many columns of Q:
2743
+ if(size(gam0) == nrows(Q)){
2744
+ bigintmat M[size(gam0)][nrows(Q)];
2745
+
2746
+ for(j = 1; j <= size(gam0); j++){
2747
+ M[j,1..ncols(M)] = Q[1..nrows(Q),gam0[j]];
2748
+ }
2749
+
2750
+ c = coneViaPoints(M);
2751
+
2752
+ if((dimension(c) == nrows(Q)) and (!(listContainsCone(OC, c)))){
2753
+ OC[size(OC)+1] = c;
2754
+ }
2755
+
2756
+ kill M;
2757
+ }
2758
+ }
2759
+
2760
+ return(OC);
2761
+ }
2762
+ example
2763
+ {
2764
+ echo = 2;
2765
+ bigintmat Q[3][4] =
2766
+ 1,0,1,0,
2767
+ 0,1,0,1,
2768
+ 0,0,1,1;
2769
+
2770
+ list OC = simplicialToricOrbitCones(Q);
2771
+ print(OC);
2772
+
2773
+ bigintmat Q[5][15] =
2774
+ 1,0,0,0,0,1,1,1,1,0,0,0,0,0,0,
2775
+ 0,1,0,0,0,1,0,0,0,1,1,1,0,0,0,
2776
+ 0,0,1,0,0,0,1,0,0,1,0,0,1,1,0,
2777
+ 0,0,0,1,0,0,0,1,0,0,1,0,1,0,1,
2778
+ 0,0,0,0,1,0,0,0,1,0,0,1,0,1,1;
2779
+
2780
+ list OC = simplicialToricOrbitCones(Q);
2781
+ print(size(OC));
2782
+ }
2783
+
2784
+
2785
+ proc G25Action()
2786
+ "USAGE: G25Action(Q);
2787
+ PURPOSE: Returns a representation of S5 as a subgroup of S10 with the action on the Grassmannian G25.
2788
+ RETURN: list of with elements of type permutation.
2789
+ EXAMPLE: example G25Action; shows an example
2790
+ "
2791
+ {
2792
+ list simplexSymmetryGroup = permutationFromIntvec(intvec( 1 .. 10 )),
2793
+ permutationFromIntvec(intvec( 1, 2, 4, 3, 5, 7, 6, 9, 8, 10 )),
2794
+ permutationFromIntvec(intvec( 1, 3, 2, 4, 6, 5, 7, 8, 10, 9 )),
2795
+ permutationFromIntvec(intvec( 1, 3, 4, 2, 6, 7, 5, 10, 8, 9 )),
2796
+ permutationFromIntvec(intvec( 1, 4, 2, 3, 7, 5, 6, 9, 10, 8 )),
2797
+ permutationFromIntvec(intvec( 1, 4, 3, 2, 7, 6, 5, 10, 9, 8 )),
2798
+ permutationFromIntvec(intvec( 1, 5, 6, 7, 2, 3, 4, 8, 9, 10 )),
2799
+ permutationFromIntvec(intvec( 1, 5, 7, 6, 2, 4, 3, 9, 8, 10 )),
2800
+ permutationFromIntvec(intvec( 1, 6, 5, 7, 3, 2, 4, 8, 10, 9 )),
2801
+ permutationFromIntvec(intvec( 1, 6, 7, 5, 3, 4, 2, 10, 8, 9 )),
2802
+ permutationFromIntvec(intvec( 1, 7, 5, 6, 4, 2, 3, 9, 10, 8 )),
2803
+ permutationFromIntvec(intvec( 1, 7, 6, 5, 4, 3, 2, 10, 9, 8 )),
2804
+ permutationFromIntvec(intvec( 2, 1, 3, 4, 5, 8, 9, 6, 7, 10 )),
2805
+ permutationFromIntvec(intvec( 2, 1, 4, 3, 5, 9, 8, 7, 6, 10 )),
2806
+ permutationFromIntvec(intvec( 2, 3, 1, 4, 8, 5, 9, 6, 10, 7 )),
2807
+ permutationFromIntvec(intvec( 2, 3, 4, 1, 8, 9, 5, 10, 6, 7 )),
2808
+ permutationFromIntvec(intvec( 2, 4, 1, 3, 9, 5, 8, 7, 10, 6 )),
2809
+ permutationFromIntvec(intvec( 2, 4, 3, 1, 9, 8, 5, 10, 7, 6 )),
2810
+ permutationFromIntvec(intvec( 2, 5, 8, 9, 1, 3, 4, 6, 7, 10 )),
2811
+ permutationFromIntvec(intvec( 2, 5, 9, 8, 1, 4, 3, 7, 6, 10 )),
2812
+ permutationFromIntvec(intvec( 2, 8, 5, 9, 3, 1, 4, 6, 10, 7 )),
2813
+ permutationFromIntvec(intvec( 2, 8, 9, 5, 3, 4, 1, 10, 6, 7 )),
2814
+ permutationFromIntvec(intvec( 2, 9, 5, 8, 4, 1, 3, 7, 10, 6 )),
2815
+ permutationFromIntvec(intvec( 2, 9, 8, 5, 4, 3, 1, 10, 7, 6 )),
2816
+ permutationFromIntvec(intvec( 3, 1, 2, 4, 6, 8, 10, 5, 7, 9 )),
2817
+ permutationFromIntvec(intvec( 3, 1, 4, 2, 6, 10, 8, 7, 5, 9 )),
2818
+ permutationFromIntvec(intvec( 3, 2, 1, 4, 8, 6, 10, 5, 9, 7 )),
2819
+ permutationFromIntvec(intvec( 3, 2, 4, 1, 8, 10, 6, 9, 5, 7 )),
2820
+ permutationFromIntvec(intvec( 3, 4, 1, 2, 10, 6, 8, 7, 9, 5 )),
2821
+ permutationFromIntvec(intvec( 3, 4, 2, 1, 10, 8, 6, 9, 7, 5 )),
2822
+ permutationFromIntvec(intvec( 3, 6, 8, 10, 1, 2, 4, 5, 7, 9 )),
2823
+ permutationFromIntvec(intvec( 3, 6, 10, 8, 1, 4, 2, 7, 5, 9 )),
2824
+ permutationFromIntvec(intvec( 3, 8, 6, 10, 2, 1, 4, 5, 9, 7 )),
2825
+ permutationFromIntvec(intvec( 3, 8, 10, 6, 2, 4, 1, 9, 5, 7 )),
2826
+ permutationFromIntvec(intvec( 3, 10, 6, 8, 4, 1, 2, 7, 9, 5 )),
2827
+ permutationFromIntvec(intvec( 3, 10, 8, 6, 4, 2, 1, 9, 7, 5 )),
2828
+ permutationFromIntvec(intvec( 4, 1, 2, 3, 7, 9, 10, 5, 6, 8 )),
2829
+ permutationFromIntvec(intvec( 4, 1, 3, 2, 7, 10, 9, 6, 5, 8 )),
2830
+ permutationFromIntvec(intvec( 4, 2, 1, 3, 9, 7, 10, 5, 8, 6 )),
2831
+ permutationFromIntvec(intvec( 4, 2, 3, 1, 9, 10, 7, 8, 5, 6 )),
2832
+ permutationFromIntvec(intvec( 4, 3, 1, 2, 10, 7, 9, 6, 8, 5 )),
2833
+ permutationFromIntvec(intvec( 4, 3, 2, 1, 10, 9, 7, 8, 6, 5 )),
2834
+ permutationFromIntvec(intvec( 4, 7, 9, 10, 1, 2, 3, 5, 6, 8 )),
2835
+ permutationFromIntvec(intvec( 4, 7, 10, 9, 1, 3, 2, 6, 5, 8 )),
2836
+ permutationFromIntvec(intvec( 4, 9, 7, 10, 2, 1, 3, 5, 8, 6 )),
2837
+ permutationFromIntvec(intvec( 4, 9, 10, 7, 2, 3, 1, 8, 5, 6 )),
2838
+ permutationFromIntvec(intvec( 4, 10, 7, 9, 3, 1, 2, 6, 8, 5 )),
2839
+ permutationFromIntvec(intvec( 4, 10, 9, 7, 3, 2, 1, 8, 6, 5 )),
2840
+ permutationFromIntvec(intvec( 5, 1, 6, 7, 2, 8, 9, 3, 4, 10 )),
2841
+ permutationFromIntvec(intvec( 5, 1, 7, 6, 2, 9, 8, 4, 3, 10 )),
2842
+ permutationFromIntvec(intvec( 5, 2, 8, 9, 1, 6, 7, 3, 4, 10 )),
2843
+ permutationFromIntvec(intvec( 5, 2, 9, 8, 1, 7, 6, 4, 3, 10 )),
2844
+ permutationFromIntvec(intvec( 5, 6, 1, 7, 8, 2, 9, 3, 10, 4 )),
2845
+ permutationFromIntvec(intvec( 5, 6, 7, 1, 8, 9, 2, 10, 3, 4 )),
2846
+ permutationFromIntvec(intvec( 5, 7, 1, 6, 9, 2, 8, 4, 10, 3 )),
2847
+ permutationFromIntvec(intvec( 5, 7, 6, 1, 9, 8, 2, 10, 4, 3 )),
2848
+ permutationFromIntvec(intvec( 5, 8, 2, 9, 6, 1, 7, 3, 10, 4 )),
2849
+ permutationFromIntvec(intvec( 5, 8, 9, 2, 6, 7, 1, 10, 3, 4 )),
2850
+ permutationFromIntvec(intvec( 5, 9, 2, 8, 7, 1, 6, 4, 10, 3 )),
2851
+ permutationFromIntvec(intvec( 5, 9, 8, 2, 7, 6, 1, 10, 4, 3 )),
2852
+ permutationFromIntvec(intvec( 6, 1, 5, 7, 3, 8, 10, 2, 4, 9 )),
2853
+ permutationFromIntvec(intvec( 6, 1, 7, 5, 3, 10, 8, 4, 2, 9 )),
2854
+ permutationFromIntvec(intvec( 6, 3, 8, 10, 1, 5, 7, 2, 4, 9 )),
2855
+ permutationFromIntvec(intvec( 6, 3, 10, 8, 1, 7, 5, 4, 2, 9 )),
2856
+ permutationFromIntvec(intvec( 6, 5, 1, 7, 8, 3, 10, 2, 9, 4 )),
2857
+ permutationFromIntvec(intvec( 6, 5, 7, 1, 8, 10, 3, 9, 2, 4 )),
2858
+ permutationFromIntvec(intvec( 6, 7, 1, 5, 10, 3, 8, 4, 9, 2 )),
2859
+ permutationFromIntvec(intvec( 6, 7, 5, 1, 10, 8, 3, 9, 4, 2 )),
2860
+ permutationFromIntvec(intvec( 6, 8, 3, 10, 5, 1, 7, 2, 9, 4 )),
2861
+ permutationFromIntvec(intvec( 6, 8, 10, 3, 5, 7, 1, 9, 2, 4 )),
2862
+ permutationFromIntvec(intvec( 6, 10, 3, 8, 7, 1, 5, 4, 9, 2 )),
2863
+ permutationFromIntvec(intvec( 6, 10, 8, 3, 7, 5, 1, 9, 4, 2 )),
2864
+ permutationFromIntvec(intvec( 7, 1, 5, 6, 4, 9, 10, 2, 3, 8 )),
2865
+ permutationFromIntvec(intvec( 7, 1, 6, 5, 4, 10, 9, 3, 2, 8 )),
2866
+ permutationFromIntvec(intvec( 7, 4, 9, 10, 1, 5, 6, 2, 3, 8 )),
2867
+ permutationFromIntvec(intvec( 7, 4, 10, 9, 1, 6, 5, 3, 2, 8 )),
2868
+ permutationFromIntvec(intvec( 7, 5, 1, 6, 9, 4, 10, 2, 8, 3 )),
2869
+ permutationFromIntvec(intvec( 7, 5, 6, 1, 9, 10, 4, 8, 2, 3 )),
2870
+ permutationFromIntvec(intvec( 7, 6, 1, 5, 10, 4, 9, 3, 8, 2 )),
2871
+ permutationFromIntvec(intvec( 7, 6, 5, 1, 10, 9, 4, 8, 3, 2 )),
2872
+ permutationFromIntvec(intvec( 7, 9, 4, 10, 5, 1, 6, 2, 8, 3 )),
2873
+ permutationFromIntvec(intvec( 7, 9, 10, 4, 5, 6, 1, 8, 2, 3 )),
2874
+ permutationFromIntvec(intvec( 7, 10, 4, 9, 6, 1, 5, 3, 8, 2 )),
2875
+ permutationFromIntvec(intvec( 7, 10, 9, 4, 6, 5, 1, 8, 3, 2 )),
2876
+ permutationFromIntvec(intvec( 8, 2, 5, 9, 3, 6, 10, 1, 4, 7 )),
2877
+ permutationFromIntvec(intvec( 8, 2, 9, 5, 3, 10, 6, 4, 1, 7 )),
2878
+ permutationFromIntvec(intvec( 8, 3, 6, 10, 2, 5, 9, 1, 4, 7 )),
2879
+ permutationFromIntvec(intvec( 8, 3, 10, 6, 2, 9, 5, 4, 1, 7 )),
2880
+ permutationFromIntvec(intvec( 8, 5, 2, 9, 6, 3, 10, 1, 7, 4 )),
2881
+ permutationFromIntvec(intvec( 8, 5, 9, 2, 6, 10, 3, 7, 1, 4 )),
2882
+ permutationFromIntvec(intvec( 8, 6, 3, 10, 5, 2, 9, 1, 7, 4 )),
2883
+ permutationFromIntvec(intvec( 8, 6, 10, 3, 5, 9, 2, 7, 1, 4 )),
2884
+ permutationFromIntvec(intvec( 8, 9, 2, 5, 10, 3, 6, 4, 7, 1 )),
2885
+ permutationFromIntvec(intvec( 8, 9, 5, 2, 10, 6, 3, 7, 4, 1 )),
2886
+ permutationFromIntvec(intvec( 8, 10, 3, 6, 9, 2, 5, 4, 7, 1 )),
2887
+ permutationFromIntvec(intvec( 8, 10, 6, 3, 9, 5, 2, 7, 4, 1 )),
2888
+ permutationFromIntvec(intvec( 9, 2, 5, 8, 4, 7, 10, 1, 3, 6 )),
2889
+ permutationFromIntvec(intvec( 9, 2, 8, 5, 4, 10, 7, 3, 1, 6 )),
2890
+ permutationFromIntvec(intvec( 9, 4, 7, 10, 2, 5, 8, 1, 3, 6 )),
2891
+ permutationFromIntvec(intvec( 9, 4, 10, 7, 2, 8, 5, 3, 1, 6 )),
2892
+ permutationFromIntvec(intvec( 9, 5, 2, 8, 7, 4, 10, 1, 6, 3 )),
2893
+ permutationFromIntvec(intvec( 9, 5, 8, 2, 7, 10, 4, 6, 1, 3 )),
2894
+ permutationFromIntvec(intvec( 9, 7, 4, 10, 5, 2, 8, 1, 6, 3 )),
2895
+ permutationFromIntvec(intvec( 9, 7, 10, 4, 5, 8, 2, 6, 1, 3 )),
2896
+ permutationFromIntvec(intvec( 9, 8, 2, 5, 10, 4, 7, 3, 6, 1 )),
2897
+ permutationFromIntvec(intvec( 9, 8, 5, 2, 10, 7, 4, 6, 3, 1 )),
2898
+ permutationFromIntvec(intvec( 9, 10, 4, 7, 8, 2, 5, 3, 6, 1 )),
2899
+ permutationFromIntvec(intvec( 9, 10, 7, 4, 8, 5, 2, 6, 3, 1 )),
2900
+ permutationFromIntvec(intvec( 10, 3, 6, 8, 4, 7, 9, 1, 2, 5 )),
2901
+ permutationFromIntvec(intvec( 10, 3, 8, 6, 4, 9, 7, 2, 1, 5 )),
2902
+ permutationFromIntvec(intvec( 10, 4, 7, 9, 3, 6, 8, 1, 2, 5 )),
2903
+ permutationFromIntvec(intvec( 10, 4, 9, 7, 3, 8, 6, 2, 1, 5 )),
2904
+ permutationFromIntvec(intvec( 10, 6, 3, 8, 7, 4, 9, 1, 5, 2 )),
2905
+ permutationFromIntvec(intvec( 10, 6, 8, 3, 7, 9, 4, 5, 1, 2 )),
2906
+ permutationFromIntvec(intvec( 10, 7, 4, 9, 6, 3, 8, 1, 5, 2 )),
2907
+ permutationFromIntvec(intvec( 10, 7, 9, 4, 6, 8, 3, 5, 1, 2 )),
2908
+ permutationFromIntvec(intvec( 10, 8, 3, 6, 9, 4, 7, 2, 5, 1 )),
2909
+ permutationFromIntvec(intvec( 10, 8, 6, 3, 9, 7, 4, 5, 2, 1 )),
2910
+ permutationFromIntvec(intvec( 10, 9, 4, 7, 8, 3, 6, 2, 5, 1 )),
2911
+ permutationFromIntvec(intvec( 10, 9, 7, 4, 8, 6, 3, 5, 2, 1 ));
2912
+ return(simplexSymmetryGroup);
2913
+ }
2914
+ example
2915
+ {
2916
+ echo = 2;
2917
+ G25Action();
2918
+ }
2919
+
2920
+
2921
+ proc findOrbits(list G, int #)
2922
+ "USAGE: findOrbits(G [,d]); G list of permutations in a subgroup of the symmetric group; d int minimum cardinality of simplices to be considered; if d is not specified all orbits are computed.
2923
+ PURPOSE: Computes the orbit decomposition of the action of G.
2924
+ RETURN: list of intvec.
2925
+ EXAMPLE: example findOrbits; shows an example
2926
+ "
2927
+ {
2928
+ int d;
2929
+ if (size(#)>0){d=#;}
2930
+ int n = size(permutationToIntvec(G[1]));
2931
+ list listOrbits;
2932
+ list finished;
2933
+ int tst;
2934
+ bigint startel;
2935
+ intvec startelbin;
2936
+ list neworbit,neworbitint;
2937
+ int i,posToInsert;
2938
+ bigint nn;
2939
+ while (size(finished)<2^n){
2940
+ startel=0;
2941
+ if (size(finished)>0){
2942
+ tst=0;
2943
+ while ((tst==0) and (startel+1<=size(finished))){
2944
+ if (finished[int(startel+1)]<>startel){
2945
+ tst=1;
2946
+ } else {
2947
+ startel=startel+1;
2948
+ }
2949
+ }
2950
+ }
2951
+ if (startel==0){
2952
+ neworbit[1]= list();
2953
+ neworbitint[1]=0;
2954
+ } else {
2955
+ startelbin=bigintToBinary(startel,n);
2956
+ neworbitint=list(startel);
2957
+ for (i=2;i<=size(G);i++){
2958
+ nn=binaryToBigint(applyPermutationToIntvec(startelbin,G[i]));
2959
+ //nn;neworbitint;
2960
+ //"place to insert";
2961
+ posToInsert = findPlaceToInsert(neworbitint,nn);
2962
+ //"pos";posToInsert;
2963
+ if(posToInsert > 0)
2964
+ {
2965
+ //"vorher";neworbitint;
2966
+ neworbitint = insertToList(neworbitint,nn,posToInsert);
2967
+ //"nachher";neworbitint;
2968
+ }
2969
+ }
2970
+ for (i=1;i<=size(neworbitint);i++){
2971
+ neworbit[i]=bigintToBinary(neworbitint[i],n);
2972
+ }
2973
+ }
2974
+ if (size(neworbit[1])>=d){
2975
+ listOrbits[size(listOrbits)+1]=neworbit;
2976
+ }
2977
+ finished=sort(finished+neworbitint)[1];
2978
+ }
2979
+ return(listOrbits);}
2980
+ example
2981
+ {
2982
+ list G = G25Action();
2983
+ list orb = findOrbits(G);
2984
+ for (int i=1;i<=size(orb);i++){orb[i][1];}
2985
+ }
2986
+
2987
+
2988
+
2989
+ static proc GITfanWrapperWithSymmetry(ideal J, intmat Q, list simplexSymmetryGroup){
2990
+ list orb = findOrbits(simplexSymmetryGroup,nrows(Q));
2991
+ list simplexOrbitRepresentatives;
2992
+ for (int i=1;i<=size(orb);i++){simplexOrbitRepresentatives[i]=orb[i][1];}
2993
+ list afaceOrbitRepresentatives=afaces(J,simplexOrbitRepresentatives);
2994
+ list fulldimAfaceOrbitRepresentatives=fullDimImages(afaceOrbitRepresentatives,Q);
2995
+ list afaceOrbits=computeAfaceOrbits(fulldimAfaceOrbitRepresentatives,simplexSymmetryGroup);
2996
+ list minAfaceOrbits = minimalAfaceOrbits(afaceOrbits);
2997
+ list listOfOrbitConeOrbits = orbitConeOrbits(minAfaceOrbits,Q);
2998
+ list listOfMinimalOrbitConeOrbits = minimalOrbitConeOrbits(listOfOrbitConeOrbits);
2999
+ list Asigma = groupActionOnQImage(simplexSymmetryGroup,Q);
3000
+ list actionOnOrbitconeIndices = groupActionOnHashes(Asigma,listOfOrbitConeOrbits);
3001
+ list OClist = listOfOrbitConeOrbits[1];
3002
+ for (i =2;i<=size(listOfOrbitConeOrbits);i++){
3003
+ OClist = OClist + listOfOrbitConeOrbits[i];
3004
+ }
3005
+ cone mov = coneViaPoints(transpose(Q));
3006
+ mov = canonicalizeCone(mov);
3007
+ list Sigma = GITfanParallelSymmetric(OClist, Q, mov, actionOnOrbitconeIndices);
3008
+ return(Sigma, OClist);
3009
+ }
3010
+ ///////////////////////////////////////
3011
+
3012
+ proc gitCone(ideal a, bigintmat Q, bigintmat w)
3013
+ "USAGE: gitCone(a, Q, w); a: ideal, Q:bigintmat, w:bigintmat
3014
+ PURPOSE: Returns the GIT-cone lambda(w), i.e. the intersection of all
3015
+ orbit cones containing the vector w.
3016
+ NOTE: call this only if you are interested in a single GIT-cone.
3017
+ RETURN: a cone.
3018
+ EXAMPLE: example gitCone; shows an example
3019
+ "
3020
+ {
3021
+ list OC = orbitConesOld(a, intmat(Q));
3022
+ cone lambda = nrows(Q);
3023
+
3024
+ for(int i = 1; i <= size(OC); i++)
3025
+ {
3026
+ cone c = OC[i];
3027
+
3028
+ if(containsInSupport(c, w))
3029
+ {
3030
+ lambda = convexIntersectionOld(lambda, c);
3031
+ }
3032
+
3033
+ kill c;
3034
+ }
3035
+
3036
+ return(lambda);
3037
+ }
3038
+ example
3039
+ {
3040
+ echo=2;
3041
+ intmat Q[3][4] =
3042
+ 1,0,1,0,
3043
+ 0,1,0,1,
3044
+ 0,0,1,1;
3045
+
3046
+ ring R = 0,T(1..4),dp;
3047
+ ideal a = 0;
3048
+
3049
+ bigintmat w[1][3] = 3,3,1;
3050
+ cone lambda = gitCone(a, Q, w);
3051
+ rays(lambda);
3052
+
3053
+ bigintmat w2[1][3] = 1,1,1;
3054
+ cone lambda2 = gitCone(a, Q, w2);
3055
+ rays(lambda2);
3056
+ }
3057
+
3058
+ proc orbitConesOld(ideal a, bigintmat Q, list #)
3059
+ "USAGE: orbitConesOld(a, Q, b, c); a: ideal, Q: bigintmat, b: int, c: int
3060
+ PURPOSE: Returns a list consisting of all cones Q(gam0) where gam0 is an a-face.
3061
+ Moreover, it is possible to specify a dimensional bound b,
3062
+ upon which only cones of that dimension and above are returned.
3063
+ Lastly, as the computation is parallizable, one can specify c,
3064
+ the number of cores to be used by the computation.
3065
+ RETURN: a list of cones
3066
+ EXAMPLE: example orbitConesOld; shows an example
3067
+ "
3068
+ {
3069
+ list AF;
3070
+
3071
+ if((size(#) > 1) and (typeof(#[2]) == "int"))
3072
+ {
3073
+ AF = afaces(a, nrows(Q), #[2]);
3074
+ }
3075
+ else
3076
+ {
3077
+ AF = afaces(a, nrows(Q));
3078
+ }
3079
+
3080
+ int dimensionBound = 0;
3081
+ if((size(#) > 0) and (typeof(#[1]) == "int"))
3082
+ {
3083
+ dimensionBound = #[1];
3084
+ }
3085
+
3086
+ list OC;
3087
+ intvec gam0;
3088
+ int j;
3089
+
3090
+ for(int i = 1; i <= size(AF); i++)
3091
+ {
3092
+ gam0 = AF[i];
3093
+
3094
+ if(gam0 == 0)
3095
+ {
3096
+ bigintmat M[1][nrows(Q)];
3097
+ }
3098
+ else
3099
+ {
3100
+ bigintmat M[size(gam0)][nrows(Q)];
3101
+ for (j = 1; j <= size(gam0); j++)
3102
+ {
3103
+ M[j,1..ncols(M)] = Q[1..nrows(Q),gam0[j]];
3104
+ }
3105
+ }
3106
+ cone c = coneViaPoints(M);
3107
+
3108
+ if((dimension(c) >= dimensionBound) and (!(listContainsCone(OC, c))))
3109
+ {
3110
+ OC[size(OC)+1] = c;
3111
+ }
3112
+
3113
+ kill M, c;
3114
+ }
3115
+
3116
+ return(OC);
3117
+ }
3118
+ example
3119
+ {
3120
+ echo=2;
3121
+ intmat Q[3][4] =
3122
+ 1,0,1,0,
3123
+ 0,1,0,1,
3124
+ 0,0,1,1;
3125
+
3126
+ ring R = 0,T(1..4),dp;
3127
+ ideal a = 0;
3128
+
3129
+ orbitConesOld(a, Q);
3130
+ }