passagemath-singular 10.6.31rc3__cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of passagemath-singular might be problematic. Click here for more details.

Files changed (491) hide show
  1. PySingular.cpython-314-x86_64-linux-gnu.so +0 -0
  2. passagemath_singular-10.6.31rc3.dist-info/METADATA +183 -0
  3. passagemath_singular-10.6.31rc3.dist-info/RECORD +491 -0
  4. passagemath_singular-10.6.31rc3.dist-info/WHEEL +6 -0
  5. passagemath_singular-10.6.31rc3.dist-info/top_level.txt +3 -0
  6. passagemath_singular.libs/libSingular-4-20aec911.4.1.so +0 -0
  7. passagemath_singular.libs/libcddgmp-21acf0c6.so.0.1.3 +0 -0
  8. passagemath_singular.libs/libfactory-4-fcee31da.4.1.so +0 -0
  9. passagemath_singular.libs/libflint-66e12231.so.21.0.0 +0 -0
  10. passagemath_singular.libs/libgf2x-a4cdec90.so.3.0.0 +0 -0
  11. passagemath_singular.libs/libgfortran-83c28eba.so.5.0.0 +0 -0
  12. passagemath_singular.libs/libgmp-6e109695.so.10.5.0 +0 -0
  13. passagemath_singular.libs/libgsl-cda90e79.so.28.0.0 +0 -0
  14. passagemath_singular.libs/libmpfr-82690d50.so.6.2.1 +0 -0
  15. passagemath_singular.libs/libntl-e6f0d543.so.44.0.1 +0 -0
  16. passagemath_singular.libs/libomalloc-0-5c9e866e.9.6.so +0 -0
  17. passagemath_singular.libs/libopenblasp-r0-6dcb67f9.3.29.so +0 -0
  18. passagemath_singular.libs/libpolys-4-5c0a87e0.4.1.so +0 -0
  19. passagemath_singular.libs/libquadmath-2284e583.so.0.0.0 +0 -0
  20. passagemath_singular.libs/libreadline-ea270e21.so.8.2 +0 -0
  21. passagemath_singular.libs/libsingular_resources-4-a1aafc6d.4.1.so +0 -0
  22. passagemath_singular.libs/libtinfo-ceb117d9.so.6.3 +0 -0
  23. sage/algebras/all__sagemath_singular.py +3 -0
  24. sage/algebras/fusion_rings/all.py +19 -0
  25. sage/algebras/fusion_rings/f_matrix.py +2448 -0
  26. sage/algebras/fusion_rings/fast_parallel_fmats_methods.cpython-314-x86_64-linux-gnu.so +0 -0
  27. sage/algebras/fusion_rings/fast_parallel_fmats_methods.pxd +5 -0
  28. sage/algebras/fusion_rings/fast_parallel_fmats_methods.pyx +538 -0
  29. sage/algebras/fusion_rings/fast_parallel_fusion_ring_braid_repn.cpython-314-x86_64-linux-gnu.so +0 -0
  30. sage/algebras/fusion_rings/fast_parallel_fusion_ring_braid_repn.pxd +3 -0
  31. sage/algebras/fusion_rings/fast_parallel_fusion_ring_braid_repn.pyx +331 -0
  32. sage/algebras/fusion_rings/fusion_double.py +899 -0
  33. sage/algebras/fusion_rings/fusion_ring.py +1580 -0
  34. sage/algebras/fusion_rings/poly_tup_engine.cpython-314-x86_64-linux-gnu.so +0 -0
  35. sage/algebras/fusion_rings/poly_tup_engine.pxd +24 -0
  36. sage/algebras/fusion_rings/poly_tup_engine.pyx +579 -0
  37. sage/algebras/fusion_rings/shm_managers.cpython-314-x86_64-linux-gnu.so +0 -0
  38. sage/algebras/fusion_rings/shm_managers.pxd +24 -0
  39. sage/algebras/fusion_rings/shm_managers.pyx +780 -0
  40. sage/algebras/letterplace/all.py +1 -0
  41. sage/algebras/letterplace/free_algebra_element_letterplace.cpython-314-x86_64-linux-gnu.so +0 -0
  42. sage/algebras/letterplace/free_algebra_element_letterplace.pxd +18 -0
  43. sage/algebras/letterplace/free_algebra_element_letterplace.pyx +755 -0
  44. sage/algebras/letterplace/free_algebra_letterplace.cpython-314-x86_64-linux-gnu.so +0 -0
  45. sage/algebras/letterplace/free_algebra_letterplace.pxd +35 -0
  46. sage/algebras/letterplace/free_algebra_letterplace.pyx +914 -0
  47. sage/algebras/letterplace/letterplace_ideal.cpython-314-x86_64-linux-gnu.so +0 -0
  48. sage/algebras/letterplace/letterplace_ideal.pyx +408 -0
  49. sage/algebras/quatalg/all.py +2 -0
  50. sage/algebras/quatalg/quaternion_algebra.py +4778 -0
  51. sage/algebras/quatalg/quaternion_algebra_cython.cpython-314-x86_64-linux-gnu.so +0 -0
  52. sage/algebras/quatalg/quaternion_algebra_cython.pyx +261 -0
  53. sage/algebras/quatalg/quaternion_algebra_element.cpython-314-x86_64-linux-gnu.so +0 -0
  54. sage/algebras/quatalg/quaternion_algebra_element.pxd +29 -0
  55. sage/algebras/quatalg/quaternion_algebra_element.pyx +2176 -0
  56. sage/all__sagemath_singular.py +11 -0
  57. sage/ext_data/all__sagemath_singular.py +1 -0
  58. sage/ext_data/singular/function_field/core.lib +98 -0
  59. sage/interfaces/all__sagemath_singular.py +1 -0
  60. sage/interfaces/singular.py +2835 -0
  61. sage/libs/all__sagemath_singular.py +1 -0
  62. sage/libs/singular/__init__.py +1 -0
  63. sage/libs/singular/decl.pxd +1168 -0
  64. sage/libs/singular/function.cpython-314-x86_64-linux-gnu.so +0 -0
  65. sage/libs/singular/function.pxd +87 -0
  66. sage/libs/singular/function.pyx +1901 -0
  67. sage/libs/singular/function_factory.py +61 -0
  68. sage/libs/singular/groebner_strategy.cpython-314-x86_64-linux-gnu.so +0 -0
  69. sage/libs/singular/groebner_strategy.pxd +22 -0
  70. sage/libs/singular/groebner_strategy.pyx +582 -0
  71. sage/libs/singular/option.cpython-314-x86_64-linux-gnu.so +0 -0
  72. sage/libs/singular/option.pyx +671 -0
  73. sage/libs/singular/polynomial.cpython-314-x86_64-linux-gnu.so +0 -0
  74. sage/libs/singular/polynomial.pxd +39 -0
  75. sage/libs/singular/polynomial.pyx +661 -0
  76. sage/libs/singular/ring.cpython-314-x86_64-linux-gnu.so +0 -0
  77. sage/libs/singular/ring.pxd +58 -0
  78. sage/libs/singular/ring.pyx +893 -0
  79. sage/libs/singular/singular.cpython-314-x86_64-linux-gnu.so +0 -0
  80. sage/libs/singular/singular.pxd +72 -0
  81. sage/libs/singular/singular.pyx +1944 -0
  82. sage/libs/singular/standard_options.py +145 -0
  83. sage/matrix/all__sagemath_singular.py +1 -0
  84. sage/matrix/matrix_mpolynomial_dense.cpython-314-x86_64-linux-gnu.so +0 -0
  85. sage/matrix/matrix_mpolynomial_dense.pxd +7 -0
  86. sage/matrix/matrix_mpolynomial_dense.pyx +615 -0
  87. sage/rings/all__sagemath_singular.py +1 -0
  88. sage/rings/function_field/all__sagemath_singular.py +1 -0
  89. sage/rings/function_field/derivations_polymod.py +911 -0
  90. sage/rings/function_field/element_polymod.cpython-314-x86_64-linux-gnu.so +0 -0
  91. sage/rings/function_field/element_polymod.pyx +406 -0
  92. sage/rings/function_field/function_field_polymod.py +2611 -0
  93. sage/rings/function_field/ideal_polymod.py +1775 -0
  94. sage/rings/function_field/order_polymod.py +1475 -0
  95. sage/rings/function_field/place_polymod.py +681 -0
  96. sage/rings/polynomial/all__sagemath_singular.py +1 -0
  97. sage/rings/polynomial/multi_polynomial_ideal_libsingular.cpython-314-x86_64-linux-gnu.so +0 -0
  98. sage/rings/polynomial/multi_polynomial_ideal_libsingular.pxd +5 -0
  99. sage/rings/polynomial/multi_polynomial_ideal_libsingular.pyx +339 -0
  100. sage/rings/polynomial/multi_polynomial_libsingular.cpython-314-x86_64-linux-gnu.so +0 -0
  101. sage/rings/polynomial/multi_polynomial_libsingular.pxd +30 -0
  102. sage/rings/polynomial/multi_polynomial_libsingular.pyx +6277 -0
  103. sage/rings/polynomial/plural.cpython-314-x86_64-linux-gnu.so +0 -0
  104. sage/rings/polynomial/plural.pxd +48 -0
  105. sage/rings/polynomial/plural.pyx +3171 -0
  106. sage/symbolic/all__sagemath_singular.py +1 -0
  107. sage/symbolic/comparison_impl.pxi +428 -0
  108. sage/symbolic/constants_c_impl.pxi +178 -0
  109. sage/symbolic/expression.cpython-314-x86_64-linux-gnu.so +0 -0
  110. sage/symbolic/expression.pxd +7 -0
  111. sage/symbolic/expression.pyx +14200 -0
  112. sage/symbolic/getitem_impl.pxi +202 -0
  113. sage/symbolic/pynac.pxi +572 -0
  114. sage/symbolic/pynac_constant_impl.pxi +133 -0
  115. sage/symbolic/pynac_function_impl.pxi +206 -0
  116. sage/symbolic/pynac_impl.pxi +2576 -0
  117. sage/symbolic/pynac_wrap.h +124 -0
  118. sage/symbolic/series_impl.pxi +272 -0
  119. sage/symbolic/substitution_map_impl.pxi +94 -0
  120. sage_wheels/bin/ESingular +0 -0
  121. sage_wheels/bin/Singular +0 -0
  122. sage_wheels/bin/TSingular +0 -0
  123. sage_wheels/lib/singular/MOD/cohomo.la +41 -0
  124. sage_wheels/lib/singular/MOD/cohomo.so +0 -0
  125. sage_wheels/lib/singular/MOD/customstd.la +41 -0
  126. sage_wheels/lib/singular/MOD/customstd.so +0 -0
  127. sage_wheels/lib/singular/MOD/freealgebra.la +41 -0
  128. sage_wheels/lib/singular/MOD/freealgebra.so +0 -0
  129. sage_wheels/lib/singular/MOD/gfanlib.la +41 -0
  130. sage_wheels/lib/singular/MOD/gfanlib.so +0 -0
  131. sage_wheels/lib/singular/MOD/gitfan.la +41 -0
  132. sage_wheels/lib/singular/MOD/gitfan.so +0 -0
  133. sage_wheels/lib/singular/MOD/interval.la +41 -0
  134. sage_wheels/lib/singular/MOD/interval.so +0 -0
  135. sage_wheels/lib/singular/MOD/loctriv.la +41 -0
  136. sage_wheels/lib/singular/MOD/loctriv.so +0 -0
  137. sage_wheels/lib/singular/MOD/machinelearning.la +41 -0
  138. sage_wheels/lib/singular/MOD/machinelearning.so +0 -0
  139. sage_wheels/lib/singular/MOD/p_Procs_FieldGeneral.la +41 -0
  140. sage_wheels/lib/singular/MOD/p_Procs_FieldGeneral.so +0 -0
  141. sage_wheels/lib/singular/MOD/p_Procs_FieldIndep.la +41 -0
  142. sage_wheels/lib/singular/MOD/p_Procs_FieldIndep.so +0 -0
  143. sage_wheels/lib/singular/MOD/p_Procs_FieldQ.la +41 -0
  144. sage_wheels/lib/singular/MOD/p_Procs_FieldQ.so +0 -0
  145. sage_wheels/lib/singular/MOD/p_Procs_FieldZp.la +41 -0
  146. sage_wheels/lib/singular/MOD/p_Procs_FieldZp.so +0 -0
  147. sage_wheels/lib/singular/MOD/partialgb.la +41 -0
  148. sage_wheels/lib/singular/MOD/partialgb.so +0 -0
  149. sage_wheels/lib/singular/MOD/pyobject.la +41 -0
  150. sage_wheels/lib/singular/MOD/pyobject.so +0 -0
  151. sage_wheels/lib/singular/MOD/singmathic.la +41 -0
  152. sage_wheels/lib/singular/MOD/singmathic.so +0 -0
  153. sage_wheels/lib/singular/MOD/sispasm.la +41 -0
  154. sage_wheels/lib/singular/MOD/sispasm.so +0 -0
  155. sage_wheels/lib/singular/MOD/subsets.la +41 -0
  156. sage_wheels/lib/singular/MOD/subsets.so +0 -0
  157. sage_wheels/lib/singular/MOD/systhreads.la +41 -0
  158. sage_wheels/lib/singular/MOD/systhreads.so +0 -0
  159. sage_wheels/lib/singular/MOD/syzextra.la +41 -0
  160. sage_wheels/lib/singular/MOD/syzextra.so +0 -0
  161. sage_wheels/libexec/singular/MOD/change_cost +0 -0
  162. sage_wheels/libexec/singular/MOD/singularsurf +11 -0
  163. sage_wheels/libexec/singular/MOD/singularsurf_jupyter +9 -0
  164. sage_wheels/libexec/singular/MOD/singularsurf_win +10 -0
  165. sage_wheels/libexec/singular/MOD/solve_IP +0 -0
  166. sage_wheels/libexec/singular/MOD/surfex +16 -0
  167. sage_wheels/libexec/singular/MOD/toric_ideal +0 -0
  168. sage_wheels/share/factory/gftables/10201 +342 -0
  169. sage_wheels/share/factory/gftables/1024 +37 -0
  170. sage_wheels/share/factory/gftables/10609 +356 -0
  171. sage_wheels/share/factory/gftables/11449 +384 -0
  172. sage_wheels/share/factory/gftables/11881 +398 -0
  173. sage_wheels/share/factory/gftables/121 +6 -0
  174. sage_wheels/share/factory/gftables/12167 +408 -0
  175. sage_wheels/share/factory/gftables/125 +7 -0
  176. sage_wheels/share/factory/gftables/12769 +428 -0
  177. sage_wheels/share/factory/gftables/128 +7 -0
  178. sage_wheels/share/factory/gftables/1331 +47 -0
  179. sage_wheels/share/factory/gftables/1369 +48 -0
  180. sage_wheels/share/factory/gftables/14641 +490 -0
  181. sage_wheels/share/factory/gftables/15625 +523 -0
  182. sage_wheels/share/factory/gftables/16 +3 -0
  183. sage_wheels/share/factory/gftables/16129 +540 -0
  184. sage_wheels/share/factory/gftables/16384 +549 -0
  185. sage_wheels/share/factory/gftables/16807 +563 -0
  186. sage_wheels/share/factory/gftables/1681 +58 -0
  187. sage_wheels/share/factory/gftables/169 +8 -0
  188. sage_wheels/share/factory/gftables/17161 +574 -0
  189. sage_wheels/share/factory/gftables/1849 +64 -0
  190. sage_wheels/share/factory/gftables/18769 +628 -0
  191. sage_wheels/share/factory/gftables/19321 +646 -0
  192. sage_wheels/share/factory/gftables/19683 +659 -0
  193. sage_wheels/share/factory/gftables/2048 +71 -0
  194. sage_wheels/share/factory/gftables/2187 +75 -0
  195. sage_wheels/share/factory/gftables/2197 +76 -0
  196. sage_wheels/share/factory/gftables/2209 +76 -0
  197. sage_wheels/share/factory/gftables/22201 +742 -0
  198. sage_wheels/share/factory/gftables/22801 +762 -0
  199. sage_wheels/share/factory/gftables/2401 +82 -0
  200. sage_wheels/share/factory/gftables/243 +11 -0
  201. sage_wheels/share/factory/gftables/24389 +815 -0
  202. sage_wheels/share/factory/gftables/24649 +824 -0
  203. sage_wheels/share/factory/gftables/25 +3 -0
  204. sage_wheels/share/factory/gftables/256 +11 -0
  205. sage_wheels/share/factory/gftables/26569 +888 -0
  206. sage_wheels/share/factory/gftables/27 +3 -0
  207. sage_wheels/share/factory/gftables/27889 +932 -0
  208. sage_wheels/share/factory/gftables/2809 +96 -0
  209. sage_wheels/share/factory/gftables/28561 +954 -0
  210. sage_wheels/share/factory/gftables/289 +12 -0
  211. sage_wheels/share/factory/gftables/29791 +995 -0
  212. sage_wheels/share/factory/gftables/29929 +1000 -0
  213. sage_wheels/share/factory/gftables/3125 +107 -0
  214. sage_wheels/share/factory/gftables/32 +4 -0
  215. sage_wheels/share/factory/gftables/32041 +1070 -0
  216. sage_wheels/share/factory/gftables/32761 +1094 -0
  217. sage_wheels/share/factory/gftables/32768 +1095 -0
  218. sage_wheels/share/factory/gftables/343 +14 -0
  219. sage_wheels/share/factory/gftables/3481 +118 -0
  220. sage_wheels/share/factory/gftables/361 +14 -0
  221. sage_wheels/share/factory/gftables/36481 +1218 -0
  222. sage_wheels/share/factory/gftables/3721 +126 -0
  223. sage_wheels/share/factory/gftables/37249 +1244 -0
  224. sage_wheels/share/factory/gftables/38809 +1296 -0
  225. sage_wheels/share/factory/gftables/39601 +1322 -0
  226. sage_wheels/share/factory/gftables/4 +3 -0
  227. sage_wheels/share/factory/gftables/4096 +139 -0
  228. sage_wheels/share/factory/gftables/44521 +1486 -0
  229. sage_wheels/share/factory/gftables/4489 +152 -0
  230. sage_wheels/share/factory/gftables/49 +4 -0
  231. sage_wheels/share/factory/gftables/4913 +166 -0
  232. sage_wheels/share/factory/gftables/49729 +1660 -0
  233. sage_wheels/share/factory/gftables/5041 +170 -0
  234. sage_wheels/share/factory/gftables/50653 +1691 -0
  235. sage_wheels/share/factory/gftables/512 +20 -0
  236. sage_wheels/share/factory/gftables/51529 +1720 -0
  237. sage_wheels/share/factory/gftables/52441 +1750 -0
  238. sage_wheels/share/factory/gftables/529 +20 -0
  239. sage_wheels/share/factory/gftables/5329 +180 -0
  240. sage_wheels/share/factory/gftables/54289 +1812 -0
  241. sage_wheels/share/factory/gftables/57121 +1906 -0
  242. sage_wheels/share/factory/gftables/58081 +1938 -0
  243. sage_wheels/share/factory/gftables/59049 +1971 -0
  244. sage_wheels/share/factory/gftables/6241 +210 -0
  245. sage_wheels/share/factory/gftables/625 +23 -0
  246. sage_wheels/share/factory/gftables/63001 +2102 -0
  247. sage_wheels/share/factory/gftables/64 +5 -0
  248. sage_wheels/share/factory/gftables/6561 +221 -0
  249. sage_wheels/share/factory/gftables/6859 +231 -0
  250. sage_wheels/share/factory/gftables/6889 +232 -0
  251. sage_wheels/share/factory/gftables/729 +27 -0
  252. sage_wheels/share/factory/gftables/7921 +266 -0
  253. sage_wheels/share/factory/gftables/8 +3 -0
  254. sage_wheels/share/factory/gftables/81 +5 -0
  255. sage_wheels/share/factory/gftables/8192 +276 -0
  256. sage_wheels/share/factory/gftables/841 +30 -0
  257. sage_wheels/share/factory/gftables/9 +3 -0
  258. sage_wheels/share/factory/gftables/9409 +316 -0
  259. sage_wheels/share/factory/gftables/961 +34 -0
  260. sage_wheels/share/info/singular.info +191898 -0
  261. sage_wheels/share/singular/LIB/GND.lib +1359 -0
  262. sage_wheels/share/singular/LIB/JMBTest.lib +976 -0
  263. sage_wheels/share/singular/LIB/JMSConst.lib +1363 -0
  264. sage_wheels/share/singular/LIB/KVequiv.lib +699 -0
  265. sage_wheels/share/singular/LIB/SingularityDBM.lib +491 -0
  266. sage_wheels/share/singular/LIB/VecField.lib +1542 -0
  267. sage_wheels/share/singular/LIB/absfact.lib +959 -0
  268. sage_wheels/share/singular/LIB/ainvar.lib +730 -0
  269. sage_wheels/share/singular/LIB/aksaka.lib +419 -0
  270. sage_wheels/share/singular/LIB/alexpoly.lib +2542 -0
  271. sage_wheels/share/singular/LIB/algebra.lib +1193 -0
  272. sage_wheels/share/singular/LIB/all.lib +136 -0
  273. sage_wheels/share/singular/LIB/arcpoint.lib +514 -0
  274. sage_wheels/share/singular/LIB/arnold.lib +4553 -0
  275. sage_wheels/share/singular/LIB/arnoldclassify.lib +2058 -0
  276. sage_wheels/share/singular/LIB/arr.lib +3486 -0
  277. sage_wheels/share/singular/LIB/assprimeszerodim.lib +755 -0
  278. sage_wheels/share/singular/LIB/autgradalg.lib +3361 -0
  279. sage_wheels/share/singular/LIB/bfun.lib +1964 -0
  280. sage_wheels/share/singular/LIB/bimodules.lib +774 -0
  281. sage_wheels/share/singular/LIB/brillnoether.lib +226 -0
  282. sage_wheels/share/singular/LIB/brnoeth.lib +5017 -0
  283. sage_wheels/share/singular/LIB/central.lib +2169 -0
  284. sage_wheels/share/singular/LIB/chern.lib +4162 -0
  285. sage_wheels/share/singular/LIB/cimonom.lib +571 -0
  286. sage_wheels/share/singular/LIB/cisimplicial.lib +1835 -0
  287. sage_wheels/share/singular/LIB/classify.lib +3239 -0
  288. sage_wheels/share/singular/LIB/classify2.lib +1462 -0
  289. sage_wheels/share/singular/LIB/classifyMapGerms.lib +1515 -0
  290. sage_wheels/share/singular/LIB/classify_aeq.lib +3253 -0
  291. sage_wheels/share/singular/LIB/classifyceq.lib +2092 -0
  292. sage_wheels/share/singular/LIB/classifyci.lib +1133 -0
  293. sage_wheels/share/singular/LIB/combinat.lib +91 -0
  294. sage_wheels/share/singular/LIB/compregb.lib +276 -0
  295. sage_wheels/share/singular/LIB/control.lib +1636 -0
  296. sage_wheels/share/singular/LIB/crypto.lib +3795 -0
  297. sage_wheels/share/singular/LIB/curveInv.lib +667 -0
  298. sage_wheels/share/singular/LIB/curvepar.lib +1817 -0
  299. sage_wheels/share/singular/LIB/customstd.lib +100 -0
  300. sage_wheels/share/singular/LIB/deRham.lib +5979 -0
  301. sage_wheels/share/singular/LIB/decodegb.lib +2134 -0
  302. sage_wheels/share/singular/LIB/decomp.lib +1655 -0
  303. sage_wheels/share/singular/LIB/deflation.lib +872 -0
  304. sage_wheels/share/singular/LIB/deform.lib +925 -0
  305. sage_wheels/share/singular/LIB/difform.lib +3055 -0
  306. sage_wheels/share/singular/LIB/divisors.lib +750 -0
  307. sage_wheels/share/singular/LIB/dmod.lib +5817 -0
  308. sage_wheels/share/singular/LIB/dmodapp.lib +3269 -0
  309. sage_wheels/share/singular/LIB/dmodideal.lib +1211 -0
  310. sage_wheels/share/singular/LIB/dmodloc.lib +2645 -0
  311. sage_wheels/share/singular/LIB/dmodvar.lib +818 -0
  312. sage_wheels/share/singular/LIB/dummy.lib +17 -0
  313. sage_wheels/share/singular/LIB/elim.lib +1009 -0
  314. sage_wheels/share/singular/LIB/ellipticcovers.lib +548 -0
  315. sage_wheels/share/singular/LIB/enumpoints.lib +146 -0
  316. sage_wheels/share/singular/LIB/equising.lib +2127 -0
  317. sage_wheels/share/singular/LIB/ffmodstd.lib +2384 -0
  318. sage_wheels/share/singular/LIB/ffsolve.lib +1289 -0
  319. sage_wheels/share/singular/LIB/findifs.lib +778 -0
  320. sage_wheels/share/singular/LIB/finitediff.lib +1768 -0
  321. sage_wheels/share/singular/LIB/finvar.lib +7989 -0
  322. sage_wheels/share/singular/LIB/fpadim.lib +2429 -0
  323. sage_wheels/share/singular/LIB/fpalgebras.lib +1666 -0
  324. sage_wheels/share/singular/LIB/fpaprops.lib +1462 -0
  325. sage_wheels/share/singular/LIB/freegb.lib +3853 -0
  326. sage_wheels/share/singular/LIB/general.lib +1350 -0
  327. sage_wheels/share/singular/LIB/gfan.lib +1768 -0
  328. sage_wheels/share/singular/LIB/gitfan.lib +3130 -0
  329. sage_wheels/share/singular/LIB/gkdim.lib +99 -0
  330. sage_wheels/share/singular/LIB/gmspoly.lib +589 -0
  331. sage_wheels/share/singular/LIB/gmssing.lib +1739 -0
  332. sage_wheels/share/singular/LIB/goettsche.lib +909 -0
  333. sage_wheels/share/singular/LIB/graal.lib +1366 -0
  334. sage_wheels/share/singular/LIB/gradedModules.lib +2541 -0
  335. sage_wheels/share/singular/LIB/graphics.lib +360 -0
  336. sage_wheels/share/singular/LIB/grobcov.lib +7706 -0
  337. sage_wheels/share/singular/LIB/groups.lib +1123 -0
  338. sage_wheels/share/singular/LIB/grwalk.lib +507 -0
  339. sage_wheels/share/singular/LIB/hdepth.lib +194 -0
  340. sage_wheels/share/singular/LIB/help.cnf +57 -0
  341. sage_wheels/share/singular/LIB/hess.lib +1946 -0
  342. sage_wheels/share/singular/LIB/hnoether.lib +4292 -0
  343. sage_wheels/share/singular/LIB/hodge.lib +400 -0
  344. sage_wheels/share/singular/LIB/homolog.lib +1965 -0
  345. sage_wheels/share/singular/LIB/hyperel.lib +975 -0
  346. sage_wheels/share/singular/LIB/inout.lib +679 -0
  347. sage_wheels/share/singular/LIB/integralbasis.lib +6224 -0
  348. sage_wheels/share/singular/LIB/interval.lib +1418 -0
  349. sage_wheels/share/singular/LIB/intprog.lib +778 -0
  350. sage_wheels/share/singular/LIB/invar.lib +443 -0
  351. sage_wheels/share/singular/LIB/involut.lib +980 -0
  352. sage_wheels/share/singular/LIB/jacobson.lib +1215 -0
  353. sage_wheels/share/singular/LIB/kskernel.lib +534 -0
  354. sage_wheels/share/singular/LIB/latex.lib +3146 -0
  355. sage_wheels/share/singular/LIB/lejeune.lib +651 -0
  356. sage_wheels/share/singular/LIB/linalg.lib +2040 -0
  357. sage_wheels/share/singular/LIB/locnormal.lib +212 -0
  358. sage_wheels/share/singular/LIB/lrcalc.lib +526 -0
  359. sage_wheels/share/singular/LIB/makedbm.lib +294 -0
  360. sage_wheels/share/singular/LIB/mathml.lib +813 -0
  361. sage_wheels/share/singular/LIB/matrix.lib +1372 -0
  362. sage_wheels/share/singular/LIB/maxlike.lib +1132 -0
  363. sage_wheels/share/singular/LIB/methods.lib +212 -0
  364. sage_wheels/share/singular/LIB/moddiq.lib +322 -0
  365. sage_wheels/share/singular/LIB/modfinduni.lib +181 -0
  366. sage_wheels/share/singular/LIB/modnormal.lib +218 -0
  367. sage_wheels/share/singular/LIB/modprimdec.lib +1278 -0
  368. sage_wheels/share/singular/LIB/modquotient.lib +269 -0
  369. sage_wheels/share/singular/LIB/modstd.lib +1024 -0
  370. sage_wheels/share/singular/LIB/modular.lib +545 -0
  371. sage_wheels/share/singular/LIB/modules.lib +2561 -0
  372. sage_wheels/share/singular/LIB/modwalk.lib +609 -0
  373. sage_wheels/share/singular/LIB/mondromy.lib +1016 -0
  374. sage_wheels/share/singular/LIB/monomialideal.lib +3851 -0
  375. sage_wheels/share/singular/LIB/mprimdec.lib +2353 -0
  376. sage_wheels/share/singular/LIB/mregular.lib +1863 -0
  377. sage_wheels/share/singular/LIB/multigrading.lib +5629 -0
  378. sage_wheels/share/singular/LIB/ncHilb.lib +777 -0
  379. sage_wheels/share/singular/LIB/ncModslimgb.lib +791 -0
  380. sage_wheels/share/singular/LIB/ncalg.lib +16311 -0
  381. sage_wheels/share/singular/LIB/ncall.lib +31 -0
  382. sage_wheels/share/singular/LIB/ncdecomp.lib +468 -0
  383. sage_wheels/share/singular/LIB/ncfactor.lib +13371 -0
  384. sage_wheels/share/singular/LIB/ncfrac.lib +1023 -0
  385. sage_wheels/share/singular/LIB/nchilbert.lib +448 -0
  386. sage_wheels/share/singular/LIB/nchomolog.lib +759 -0
  387. sage_wheels/share/singular/LIB/ncloc.lib +361 -0
  388. sage_wheels/share/singular/LIB/ncpreim.lib +795 -0
  389. sage_wheels/share/singular/LIB/ncrat.lib +2849 -0
  390. sage_wheels/share/singular/LIB/nctools.lib +1887 -0
  391. sage_wheels/share/singular/LIB/nets.lib +1456 -0
  392. sage_wheels/share/singular/LIB/nfmodstd.lib +1000 -0
  393. sage_wheels/share/singular/LIB/nfmodsyz.lib +732 -0
  394. sage_wheels/share/singular/LIB/noether.lib +1106 -0
  395. sage_wheels/share/singular/LIB/normal.lib +8700 -0
  396. sage_wheels/share/singular/LIB/normaliz.lib +2226 -0
  397. sage_wheels/share/singular/LIB/ntsolve.lib +362 -0
  398. sage_wheels/share/singular/LIB/numerAlg.lib +560 -0
  399. sage_wheels/share/singular/LIB/numerDecom.lib +2261 -0
  400. sage_wheels/share/singular/LIB/olga.lib +1933 -0
  401. sage_wheels/share/singular/LIB/orbitparam.lib +351 -0
  402. sage_wheels/share/singular/LIB/parallel.lib +319 -0
  403. sage_wheels/share/singular/LIB/paraplanecurves.lib +3110 -0
  404. sage_wheels/share/singular/LIB/perron.lib +202 -0
  405. sage_wheels/share/singular/LIB/pfd.lib +2223 -0
  406. sage_wheels/share/singular/LIB/phindex.lib +642 -0
  407. sage_wheels/share/singular/LIB/pointid.lib +673 -0
  408. sage_wheels/share/singular/LIB/polybori.lib +1430 -0
  409. sage_wheels/share/singular/LIB/polyclass.lib +525 -0
  410. sage_wheels/share/singular/LIB/polylib.lib +1174 -0
  411. sage_wheels/share/singular/LIB/polymake.lib +1902 -0
  412. sage_wheels/share/singular/LIB/presolve.lib +1533 -0
  413. sage_wheels/share/singular/LIB/primdec.lib +9576 -0
  414. sage_wheels/share/singular/LIB/primdecint.lib +1782 -0
  415. sage_wheels/share/singular/LIB/primitiv.lib +401 -0
  416. sage_wheels/share/singular/LIB/puiseuxexpansions.lib +1631 -0
  417. sage_wheels/share/singular/LIB/purityfiltration.lib +960 -0
  418. sage_wheels/share/singular/LIB/qhmoduli.lib +1561 -0
  419. sage_wheels/share/singular/LIB/qmatrix.lib +293 -0
  420. sage_wheels/share/singular/LIB/random.lib +455 -0
  421. sage_wheels/share/singular/LIB/ratgb.lib +489 -0
  422. sage_wheels/share/singular/LIB/realclassify.lib +5759 -0
  423. sage_wheels/share/singular/LIB/realizationMatroids.lib +772 -0
  424. sage_wheels/share/singular/LIB/realrad.lib +1197 -0
  425. sage_wheels/share/singular/LIB/recover.lib +2628 -0
  426. sage_wheels/share/singular/LIB/redcgs.lib +3984 -0
  427. sage_wheels/share/singular/LIB/reesclos.lib +465 -0
  428. sage_wheels/share/singular/LIB/resbinomial.lib +2802 -0
  429. sage_wheels/share/singular/LIB/resgraph.lib +789 -0
  430. sage_wheels/share/singular/LIB/resjung.lib +820 -0
  431. sage_wheels/share/singular/LIB/resolve.lib +5110 -0
  432. sage_wheels/share/singular/LIB/resources.lib +170 -0
  433. sage_wheels/share/singular/LIB/reszeta.lib +5473 -0
  434. sage_wheels/share/singular/LIB/ring.lib +1328 -0
  435. sage_wheels/share/singular/LIB/ringgb.lib +343 -0
  436. sage_wheels/share/singular/LIB/rinvar.lib +1153 -0
  437. sage_wheels/share/singular/LIB/rootisolation.lib +1481 -0
  438. sage_wheels/share/singular/LIB/rootsmr.lib +709 -0
  439. sage_wheels/share/singular/LIB/rootsur.lib +886 -0
  440. sage_wheels/share/singular/LIB/rstandard.lib +607 -0
  441. sage_wheels/share/singular/LIB/rwalk.lib +336 -0
  442. sage_wheels/share/singular/LIB/sagbi.lib +1353 -0
  443. sage_wheels/share/singular/LIB/sagbiNormaliz.lib +1622 -0
  444. sage_wheels/share/singular/LIB/sagbiNormaliz0.lib +1498 -0
  445. sage_wheels/share/singular/LIB/sagbigrob.lib +449 -0
  446. sage_wheels/share/singular/LIB/schreyer.lib +321 -0
  447. sage_wheels/share/singular/LIB/schubert.lib +2551 -0
  448. sage_wheels/share/singular/LIB/sets.lib +524 -0
  449. sage_wheels/share/singular/LIB/sheafcoh.lib +1663 -0
  450. sage_wheels/share/singular/LIB/signcond.lib +437 -0
  451. sage_wheels/share/singular/LIB/sing.lib +1094 -0
  452. sage_wheels/share/singular/LIB/sing4ti2.lib +419 -0
  453. sage_wheels/share/singular/LIB/solve.lib +2243 -0
  454. sage_wheels/share/singular/LIB/spcurve.lib +1077 -0
  455. sage_wheels/share/singular/LIB/spectrum.lib +62 -0
  456. sage_wheels/share/singular/LIB/sresext.lib +757 -0
  457. sage_wheels/share/singular/LIB/ssi.lib +143 -0
  458. sage_wheels/share/singular/LIB/standard.lib +2769 -0
  459. sage_wheels/share/singular/LIB/stanleyreisner.lib +473 -0
  460. sage_wheels/share/singular/LIB/stdmodule.lib +547 -0
  461. sage_wheels/share/singular/LIB/stratify.lib +1070 -0
  462. sage_wheels/share/singular/LIB/surf.lib +506 -0
  463. sage_wheels/share/singular/LIB/surf_jupyter.lib +223 -0
  464. sage_wheels/share/singular/LIB/surfacesignature.lib +522 -0
  465. sage_wheels/share/singular/LIB/surfex.lib +1462 -0
  466. sage_wheels/share/singular/LIB/swalk.lib +877 -0
  467. sage_wheels/share/singular/LIB/symodstd.lib +1570 -0
  468. sage_wheels/share/singular/LIB/systhreads.lib +74 -0
  469. sage_wheels/share/singular/LIB/tasks.lib +1324 -0
  470. sage_wheels/share/singular/LIB/tateProdCplxNegGrad.lib +2412 -0
  471. sage_wheels/share/singular/LIB/teachstd.lib +858 -0
  472. sage_wheels/share/singular/LIB/template.lib +116 -0
  473. sage_wheels/share/singular/LIB/toric.lib +1119 -0
  474. sage_wheels/share/singular/LIB/transformation.lib +116 -0
  475. sage_wheels/share/singular/LIB/triang.lib +1197 -0
  476. sage_wheels/share/singular/LIB/tropical.lib +8741 -0
  477. sage_wheels/share/singular/LIB/tropicalEllipticCovers.lib +2922 -0
  478. sage_wheels/share/singular/LIB/tropicalNewton.lib +1128 -0
  479. sage_wheels/share/singular/LIB/tst.lib +1108 -0
  480. sage_wheels/share/singular/LIB/weierstr.lib +241 -0
  481. sage_wheels/share/singular/LIB/zeroset.lib +1478 -0
  482. sage_wheels/share/singular/emacs/.emacs-general +184 -0
  483. sage_wheels/share/singular/emacs/.emacs-singular +234 -0
  484. sage_wheels/share/singular/emacs/COPYING +44 -0
  485. sage_wheels/share/singular/emacs/cmd-cmpl.el +241 -0
  486. sage_wheels/share/singular/emacs/ex-cmpl.el +1681 -0
  487. sage_wheels/share/singular/emacs/hlp-cmpl.el +4318 -0
  488. sage_wheels/share/singular/emacs/lib-cmpl.el +179 -0
  489. sage_wheels/share/singular/emacs/singular.el +4273 -0
  490. sage_wheels/share/singular/emacs/singular.xpm +39 -0
  491. sage_wheels/share/singular/singular.idx +5002 -0
@@ -0,0 +1,1475 @@
1
+ # sage_setup: distribution = sagemath-singular
2
+ # sage.doctest: needs sage.rings.function_field
3
+ r"""
4
+ Orders of function fields: extension
5
+ """
6
+
7
+ # ****************************************************************************
8
+ # Copyright (C) 2010 William Stein <wstein@gmail.com>
9
+ # 2011 Maarten Derickx <m.derickx.student@gmail.com>
10
+ # 2011 Julian Rueth <julian.rueth@gmail.com>
11
+ # 2017-2020 Kwankyu Lee
12
+ # 2019 Brent Baccala
13
+ #
14
+ # Distributed under the terms of the GNU General Public License (GPL)
15
+ # as published by the Free Software Foundation; either version 2 of
16
+ # the License, or (at your option) any later version.
17
+ # http://www.gnu.org/licenses/
18
+ # ****************************************************************************
19
+
20
+ from sage.arith.functions import lcm
21
+ from sage.categories.commutative_algebras import CommutativeAlgebras
22
+ from sage.misc.cachefunc import cached_method
23
+ from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing
24
+
25
+ from .ideal import FunctionFieldIdeal
26
+ from .ideal_polymod import (
27
+ FunctionFieldIdeal_polymod,
28
+ FunctionFieldIdeal_global,
29
+ FunctionFieldIdealInfinite_polymod
30
+ )
31
+ from .order import FunctionFieldMaximalOrder, FunctionFieldMaximalOrderInfinite
32
+
33
+
34
+ class FunctionFieldMaximalOrder_polymod(FunctionFieldMaximalOrder):
35
+ """
36
+ Maximal orders of extensions of function fields.
37
+ """
38
+
39
+ def __init__(self, field, ideal_class=FunctionFieldIdeal_polymod):
40
+ """
41
+ Initialize.
42
+
43
+ TESTS::
44
+
45
+ sage: # needs sage.rings.finite_rings
46
+ sage: K.<x> = FunctionField(GF(7)); R.<y> = K[]
47
+ sage: L.<y> = K.extension(y^4 + x*y + 4*x + 1)
48
+ sage: O = L.maximal_order()
49
+ sage: TestSuite(O).run()
50
+ """
51
+ FunctionFieldMaximalOrder.__init__(self, field, ideal_class)
52
+
53
+ from sage.modules.free_module_element import vector
54
+ from .function_field_polymod import FunctionField_integral
55
+
56
+ if isinstance(field, FunctionField_integral):
57
+ basis = field._maximal_order_basis()
58
+ else:
59
+ model, from_model, to_model = field.monic_integral_model('z')
60
+ basis = [from_model(g) for g in model._maximal_order_basis()]
61
+
62
+ V, fr, to = field.vector_space()
63
+ R = field.base_field().maximal_order()
64
+
65
+ # This module is over R, but linear algebra over R (MaximalOrder)
66
+ # is not well supported in Sage. So we keep it as a vector space
67
+ # over rational function field.
68
+ self._module = V.span_of_basis([to(b) for b in basis])
69
+ self._module_base_ring = R
70
+ self._basis = tuple(basis)
71
+ self._from_module = fr
72
+ self._to_module = to
73
+
74
+ # multiplication table (lower triangular)
75
+ n = len(basis)
76
+ self._mtable = []
77
+ for i in range(n):
78
+ row = [self._coordinate_vector(basis[i] * basis[j])
79
+ for j in range(n)]
80
+ self._mtable.append(row)
81
+
82
+ zero = vector(R._ring, n * [0])
83
+
84
+ def mul_vecs(f, g):
85
+ s = zero
86
+ for i in range(n):
87
+ if f[i].is_zero():
88
+ continue
89
+ for j in range(n):
90
+ if g[j].is_zero():
91
+ continue
92
+ s += f[i] * g[j] * self._mtable[i][j]
93
+ return s
94
+ self._mul_vecs = mul_vecs
95
+
96
+ # We prepare for using Kummer's theorem to decompose primes. Note
97
+ # that Kummer's theorem applies to most places. Here we find
98
+ # places for which the theorem does not apply.
99
+
100
+ # this element is integral over k[x] and a generator of the field.
101
+ for gen in basis:
102
+ phi = gen.minimal_polynomial()
103
+ if phi.degree() == n:
104
+ break
105
+
106
+ assert phi.degree() == n
107
+
108
+ gen_vec = self._coordinate_vector(gen)
109
+ g = gen_vec.parent().gen(0) # x
110
+ gen_vec_pow = [g]
111
+ for i in range(n):
112
+ g = mul_vecs(g, gen_vec)
113
+ gen_vec_pow.append(g)
114
+
115
+ # find places where {1,gen,...,gen^(n-1)} is not integral basis
116
+ W = V.span_of_basis([to(gen ** i) for i in range(phi.degree())])
117
+
118
+ supp = []
119
+ for g in basis:
120
+ for c in W.coordinate_vector(to(g), check=False):
121
+ if not c.is_zero():
122
+ supp += [f for f,_ in c.denominator().factor()]
123
+ supp = set(supp)
124
+
125
+ self._kummer_gen = gen
126
+ self._kummer_gen_vec_pow = gen_vec_pow
127
+ self._kummer_polynomial = phi
128
+ self._kummer_places = supp
129
+
130
+ def _element_constructor_(self, f):
131
+ """
132
+ Construct an element of this order from ``f``.
133
+
134
+ INPUT:
135
+
136
+ - ``f`` -- element convertible to the function field
137
+
138
+ EXAMPLES::
139
+
140
+ sage: # needs sage.rings.finite_rings
141
+ sage: K.<x> = FunctionField(GF(4)); _.<Y> = K[]
142
+ sage: L.<y> = K.extension(Y^2 - x*Y + x^2 + 1)
143
+ sage: O = L.maximal_order()
144
+ sage: y in O
145
+ True
146
+ sage: 1/y in O
147
+ False
148
+ sage: x in O
149
+ True
150
+ sage: 1/x in O
151
+ False
152
+ sage: L.<y> = K.extension(Y^2 + Y + x + 1/x)
153
+ sage: O = L.maximal_order()
154
+ sage: 1 in O
155
+ True
156
+ sage: y in O
157
+ False
158
+ sage: x*y in O
159
+ True
160
+ sage: x^2*y in O
161
+ True
162
+ """
163
+ F = self.function_field()
164
+ f = F(f)
165
+ # check if f is in this order
166
+ if not all(e in self._module_base_ring for e in self.coordinate_vector(f)):
167
+ raise TypeError( "{} is not an element of {}".format(f, self) )
168
+
169
+ return f
170
+
171
+ def ideal_with_gens_over_base(self, gens):
172
+ """
173
+ Return the fractional ideal with basis ``gens`` over the
174
+ maximal order of the base field.
175
+
176
+ INPUT:
177
+
178
+ - ``gens`` -- list of elements that generates the ideal over the
179
+ maximal order of the base field
180
+
181
+ EXAMPLES::
182
+
183
+ sage: # needs sage.rings.finite_rings
184
+ sage: K.<x> = FunctionField(GF(7)); R.<y> = K[]
185
+ sage: L.<y> = K.extension(y^2 - x^3 - 1)
186
+ sage: O = L.maximal_order(); O
187
+ Maximal order of Function field in y defined by y^2 + 6*x^3 + 6
188
+ sage: I = O.ideal_with_gens_over_base([1, y]); I
189
+ Ideal (1) of Maximal order of Function field in y defined by y^2 + 6*x^3 + 6
190
+ sage: I.module()
191
+ Free module of degree 2 and rank 2 over
192
+ Maximal order of Rational function field in x over Finite Field of size 7
193
+ Echelon basis matrix:
194
+ [1 0]
195
+ [0 1]
196
+
197
+ There is no check if the resulting object is really an ideal::
198
+
199
+ sage: # needs sage.rings.finite_rings
200
+ sage: K.<x> = FunctionField(GF(7)); R.<y> = K[]
201
+ sage: L.<y> = K.extension(y^2 - x^3 - 1)
202
+ sage: O = L.equation_order()
203
+ sage: I = O.ideal_with_gens_over_base([y]); I
204
+ Ideal (y) of Order in Function field in y defined by y^2 + 6*x^3 + 6
205
+ sage: y in I
206
+ True
207
+ sage: y^2 in I
208
+ False
209
+ """
210
+ return self._ideal_from_vectors([self.coordinate_vector(g) for g in gens])
211
+
212
+ def _ideal_from_vectors(self, vecs):
213
+ """
214
+ Return an ideal generated as a module by vectors over rational function
215
+ field.
216
+
217
+ INPUT:
218
+
219
+ - ``vec`` -- list of vectors
220
+
221
+ EXAMPLES::
222
+
223
+ sage: # needs sage.rings.finite_rings
224
+ sage: K.<x> = FunctionField(GF(7)); R.<y> = K[]
225
+ sage: L.<y> = K.extension(y^2 - x^3 - 1)
226
+ sage: O = L.maximal_order()
227
+ sage: v1 = O.coordinate_vector(x^3 + 1)
228
+ sage: v2 = O.coordinate_vector(y)
229
+ sage: v1
230
+ (x^3 + 1, 0)
231
+ sage: v2
232
+ (0, 1)
233
+ sage: O._ideal_from_vectors([v1, v2])
234
+ Ideal (y) of Maximal order of Function field in y
235
+ defined by y^2 + 6*x^3 + 6
236
+ """
237
+ d = lcm([v.denominator() for v in vecs])
238
+ vecs = [[(d*c).numerator() for c in v] for v in vecs]
239
+ return self._ideal_from_vectors_and_denominator(vecs, d, check=False)
240
+
241
+ def _ideal_from_vectors_and_denominator(self, vecs, d=1, check=True):
242
+ """
243
+ Return an ideal generated as a module by vectors divided by ``d`` over
244
+ the polynomial ring underlying the rational function field.
245
+
246
+ INPUT:
247
+
248
+ - ``vec`` -- list of vectors over the polynomial ring
249
+
250
+ - ``d`` -- (default: 1) a nonzero element of the polynomial ring
251
+
252
+ - ``check`` -- boolean (default: ``True``); if ``True``, compute the
253
+ real denominator of the vectors, possibly different from ``d``
254
+
255
+ EXAMPLES::
256
+
257
+ sage: # needs sage.rings.finite_rings
258
+ sage: K.<x> = FunctionField(GF(7)); R.<y> = K[]
259
+ sage: L.<y> = K.extension(y^2 - x^3 - 1)
260
+ sage: O = L.maximal_order()
261
+ sage: I = O.ideal(y^2)
262
+ sage: m = I.basis_matrix()
263
+ sage: v1 = m[0]
264
+ sage: v2 = m[1]
265
+ sage: v1
266
+ (x^3 + 1, 0)
267
+ sage: v2
268
+ (0, x^3 + 1)
269
+ sage: O._ideal_from_vectors([v1, v2]) # indirect doctest
270
+ Ideal (x^3 + 1) of Maximal order of Function field in y
271
+ defined by y^2 + 6*x^3 + 6
272
+ """
273
+ from sage.matrix.constructor import matrix
274
+ from .hermite_form_polynomial import reversed_hermite_form
275
+
276
+ R = self._module_base_ring._ring
277
+
278
+ d = R(d) # make it sure that d is in the polynomial ring
279
+
280
+ if check and not d.is_one(): # check if d is true denominator
281
+ M = []
282
+ g = d
283
+ for v in vecs:
284
+ for c in v:
285
+ g = g.gcd(c)
286
+ if g.is_one():
287
+ break
288
+ else:
289
+ M += list(v)
290
+ continue # for v in vecs
291
+ mat = matrix(R, vecs)
292
+ break
293
+ else:
294
+ d = d // g
295
+ mat = matrix(R, len(vecs), [c // g for c in M])
296
+ else:
297
+ mat = matrix(R, vecs)
298
+
299
+ # IMPORTANT: make it sure that pivot polynomials monic
300
+ # so that we get a unique hnf. Here the hermite form
301
+ # algorithm also makes the pivots monic.
302
+
303
+ # compute the reversed hermite form with zero rows deleted
304
+ reversed_hermite_form(mat)
305
+ i = 0
306
+ while i < mat.nrows() and mat.row(i).is_zero():
307
+ i += 1
308
+ hnf = mat[i:] # remove zero rows
309
+
310
+ return self.ideal_monoid().element_class(self, hnf, d)
311
+
312
+ def ideal(self, *gens, **kwargs):
313
+ """
314
+ Return the fractional ideal generated by the elements in ``gens``.
315
+
316
+ INPUT:
317
+
318
+ - ``gens`` -- list of generators
319
+
320
+ EXAMPLES::
321
+
322
+ sage: # needs sage.rings.finite_rings
323
+ sage: K.<x> = FunctionField(GF(7)); R.<y> = K[]
324
+ sage: O = K.maximal_order()
325
+ sage: I = O.ideal(x^2 - 4)
326
+ sage: L.<y> = K.extension(y^2 - x^3 - 1)
327
+ sage: S = L.maximal_order()
328
+ sage: S.ideal(1/y)
329
+ Ideal ((1/(x^3 + 1))*y) of Maximal order of Function field
330
+ in y defined by y^2 + 6*x^3 + 6
331
+ sage: I2 = S.ideal(x^2 - 4); I2
332
+ Ideal (x^2 + 3) of Maximal order of Function field in y defined by y^2 + 6*x^3 + 6
333
+ sage: I2 == S.ideal(I)
334
+ True
335
+
336
+ sage: K.<x> = FunctionField(QQ); R.<y> = K[]
337
+ sage: O = K.maximal_order()
338
+ sage: I = O.ideal(x^2 - 4)
339
+ sage: L.<y> = K.extension(y^2 - x^3 - 1)
340
+ sage: S = L.maximal_order()
341
+ sage: S.ideal(1/y)
342
+ Ideal ((1/(x^3 + 1))*y) of
343
+ Maximal order of Function field in y defined by y^2 - x^3 - 1
344
+ sage: I2 = S.ideal(x^2-4); I2
345
+ Ideal (x^2 - 4) of Maximal order of Function field in y defined by y^2 - x^3 - 1
346
+ sage: I2 == S.ideal(I)
347
+ True
348
+ """
349
+ if len(gens) == 1:
350
+ gens = gens[0]
351
+ if not isinstance(gens, (list, tuple)):
352
+ if isinstance(gens, FunctionFieldIdeal):
353
+ gens = gens.gens()
354
+ else:
355
+ gens = (gens,)
356
+ F = self.function_field()
357
+ mgens = [b*F(g) for g in gens for b in self.basis()]
358
+ return self.ideal_with_gens_over_base(mgens)
359
+
360
+ def polynomial(self):
361
+ """
362
+ Return the defining polynomial of the function field of which this is an order.
363
+
364
+ EXAMPLES::
365
+
366
+ sage: # needs sage.rings.finite_rings
367
+ sage: K.<x> = FunctionField(GF(7)); R.<y> = K[]
368
+ sage: L.<y> = K.extension(y^4 + x*y + 4*x + 1)
369
+ sage: O = L.equation_order()
370
+ sage: O.polynomial()
371
+ y^4 + x*y + 4*x + 1
372
+
373
+ sage: K.<x> = FunctionField(QQ); R.<y> = K[]
374
+ sage: L.<y> = K.extension(y^4 + x*y + 4*x + 1)
375
+ sage: O = L.equation_order()
376
+ sage: O.polynomial()
377
+ y^4 + x*y + 4*x + 1
378
+ """
379
+ return self._field.polynomial()
380
+
381
+ def basis(self):
382
+ """
383
+ Return a basis of the order over the maximal order of the base function
384
+ field.
385
+
386
+ EXAMPLES::
387
+
388
+ sage: # needs sage.rings.finite_rings
389
+ sage: K.<x> = FunctionField(GF(7)); R.<y> = K[]
390
+ sage: L.<y> = K.extension(y^4 + x*y + 4*x + 1)
391
+ sage: O = L.equation_order()
392
+ sage: O.basis()
393
+ (1, y, y^2, y^3)
394
+
395
+ sage: K.<x> = FunctionField(QQ)
396
+ sage: R.<t> = PolynomialRing(K)
397
+ sage: F.<y> = K.extension(t^4 + x^12*t^2 + x^18*t + x^21 + x^18)
398
+ sage: O = F.maximal_order()
399
+ sage: O.basis()
400
+ (1, 1/x^4*y, 1/x^9*y^2, 1/x^13*y^3)
401
+ """
402
+ return self._basis
403
+
404
+ def gen(self, n=0):
405
+ """
406
+ Return the ``n``-th generator of the order.
407
+
408
+ The basis elements of the order are generators.
409
+
410
+ EXAMPLES::
411
+
412
+ sage: # needs sage.rings.finite_rings
413
+ sage: K.<x> = FunctionField(GF(2)); _.<t> = K[]
414
+ sage: L.<y> = K.extension(t^3 - x^2*(x^2 + x + 1)^2)
415
+ sage: O = L.maximal_order()
416
+ sage: O.gen()
417
+ 1
418
+ sage: O.gen(1)
419
+ y
420
+ sage: O.gen(2)
421
+ (1/(x^3 + x^2 + x))*y^2
422
+ sage: O.gen(3)
423
+ Traceback (most recent call last):
424
+ ...
425
+ IndexError: there are only 3 generators
426
+ """
427
+ if not ( n >= 0 and n < self.ngens() ):
428
+ raise IndexError("there are only {} generators".format(self.ngens()))
429
+
430
+ return self._basis[n]
431
+
432
+ def ngens(self):
433
+ """
434
+ Return the number of generators of the order.
435
+
436
+ EXAMPLES::
437
+
438
+ sage: # needs sage.rings.finite_rings
439
+ sage: K.<x> = FunctionField(GF(2)); _.<t> = K[]
440
+ sage: L.<y> = K.extension(t^3 - x^2*(x^2 + x + 1)^2)
441
+ sage: Oinf = L.maximal_order()
442
+ sage: Oinf.ngens()
443
+ 3
444
+ """
445
+ return len(self._basis)
446
+
447
+ def free_module(self):
448
+ """
449
+ Return the free module formed by the basis over the maximal order of the base field.
450
+
451
+ EXAMPLES::
452
+
453
+ sage: # needs sage.rings.finite_rings
454
+ sage: K.<x> = FunctionField(GF(7)); R.<y> = K[]
455
+ sage: L.<y> = K.extension(y^4 + x*y + 4*x + 1)
456
+ sage: O = L.maximal_order()
457
+ sage: O.free_module()
458
+ Free module of degree 4 and rank 4 over
459
+ Maximal order of Rational function field in x over Finite Field of size 7
460
+ User basis matrix:
461
+ [1 0 0 0]
462
+ [0 1 0 0]
463
+ [0 0 1 0]
464
+ [0 0 0 1]
465
+ """
466
+ return self._module.change_ring(self._module_base_ring)
467
+
468
+ def coordinate_vector(self, e):
469
+ """
470
+ Return the coordinates of ``e`` with respect to the basis of this order.
471
+
472
+ EXAMPLES::
473
+
474
+ sage: # needs sage.rings.finite_rings
475
+ sage: K.<x> = FunctionField(GF(7)); R.<y> = K[]
476
+ sage: L.<y> = K.extension(y^4 + x*y + 4*x + 1)
477
+ sage: O = L.maximal_order()
478
+ sage: O.coordinate_vector(y)
479
+ (0, 1, 0, 0)
480
+ sage: O.coordinate_vector(x*y)
481
+ (0, x, 0, 0)
482
+
483
+ sage: K.<x> = FunctionField(QQ); R.<y> = K[]
484
+ sage: L.<y> = K.extension(y^4 + x*y + 4*x + 1)
485
+ sage: O = L.equation_order()
486
+ sage: f = (x + y)^3
487
+ sage: O.coordinate_vector(f)
488
+ (x^3, 3*x^2, 3*x, 1)
489
+ """
490
+ return self._module.coordinate_vector(self._to_module(e))
491
+
492
+ def _coordinate_vector(self, e):
493
+ """
494
+ Return the coordinate vector of ``e`` with respect to the basis
495
+ of the order.
496
+
497
+ Assuming ``e`` is in the maximal order, the coordinates are given
498
+ as univariate polynomials in the underlying ring of the maximal
499
+ order of the rational function field.
500
+
501
+ EXAMPLES::
502
+
503
+ sage: K.<x> = FunctionField(GF(7)); R.<y> = K[]
504
+ sage: L.<y> = K.extension(y^4 + x*y + 4*x + 1)
505
+ sage: O = L.maximal_order()
506
+ sage: O._coordinate_vector(y)
507
+ (0, 1, 0, 0)
508
+ sage: O._coordinate_vector(x*y)
509
+ (0, x, 0, 0)
510
+ """
511
+ from sage.modules.free_module_element import vector
512
+
513
+ v = self._module.coordinate_vector(self._to_module(e), check=False)
514
+ return vector([c.numerator() for c in v])
515
+
516
+ @cached_method
517
+ def different(self):
518
+ """
519
+ Return the different ideal of the function field.
520
+
521
+ EXAMPLES::
522
+
523
+ sage: # needs sage.rings.finite_rings
524
+ sage: K.<x> = FunctionField(GF(7)); R.<y> = K[]
525
+ sage: L.<y> = K.extension(y^4 + x*y + 4*x + 1)
526
+ sage: O = L.maximal_order()
527
+ sage: O.different()
528
+ Ideal (y^3 + 2*x)
529
+ of Maximal order of Function field in y defined by y^4 + x*y + 4*x + 1
530
+ """
531
+ return ~self.codifferent()
532
+
533
+ @cached_method
534
+ def codifferent(self):
535
+ """
536
+ Return the codifferent ideal of the function field.
537
+
538
+ EXAMPLES::
539
+
540
+ sage: # needs sage.rings.finite_rings
541
+ sage: K.<x> = FunctionField(GF(7)); R.<y> = K[]
542
+ sage: L.<y> = K.extension(y^4 + x*y + 4*x + 1)
543
+ sage: O = L.maximal_order()
544
+ sage: O.codifferent()
545
+ Ideal (1, (1/(x^4 + 4*x^3 + 3*x^2 + 6*x + 4))*y^3
546
+ + ((5*x^3 + 6*x^2 + x + 6)/(x^4 + 4*x^3 + 3*x^2 + 6*x + 4))*y^2
547
+ + ((x^3 + 2*x^2 + 2*x + 2)/(x^4 + 4*x^3 + 3*x^2 + 6*x + 4))*y
548
+ + 6*x/(x^4 + 4*x^3 + 3*x^2 + 6*x + 4)) of Maximal order of Function field
549
+ in y defined by y^4 + x*y + 4*x + 1
550
+ """
551
+ T = self._codifferent_matrix()
552
+ return self._ideal_from_vectors(T.inverse().columns())
553
+
554
+ @cached_method
555
+ def _codifferent_matrix(self):
556
+ """
557
+ Return the matrix `T` defined in Proposition 4.8.19 of [Coh1993]_.
558
+
559
+ EXAMPLES::
560
+
561
+ sage: # needs sage.rings.finite_rings
562
+ sage: K.<x> = FunctionField(GF(7)); R.<y> = K[]
563
+ sage: L.<y> = K.extension(y^4 + x*y + 4*x + 1)
564
+ sage: O = L.maximal_order()
565
+ sage: O._codifferent_matrix()
566
+ [ 4 0 0 4*x]
567
+ [ 0 0 4*x 5*x + 3]
568
+ [ 0 4*x 5*x + 3 0]
569
+ [ 4*x 5*x + 3 0 3*x^2]
570
+ """
571
+ from sage.matrix.constructor import matrix
572
+
573
+ rows = []
574
+ for u in self.basis():
575
+ row = []
576
+ for v in self.basis():
577
+ row.append((u*v).trace())
578
+ rows.append(row)
579
+ T = matrix(rows)
580
+ return T
581
+
582
+ @cached_method
583
+ def decomposition(self, ideal):
584
+ """
585
+ Return the decomposition of the prime ideal.
586
+
587
+ INPUT:
588
+
589
+ - ``ideal`` -- prime ideal of the base maximal order
590
+
591
+ EXAMPLES::
592
+
593
+ sage: # needs sage.rings.finite_rings
594
+ sage: K.<x> = FunctionField(GF(2)); R.<t> = K[]
595
+ sage: F.<y> = K.extension(t^3 - x^2*(x^2 + x + 1)^2)
596
+ sage: o = K.maximal_order()
597
+ sage: O = F.maximal_order()
598
+ sage: p = o.ideal(x + 1)
599
+ sage: O.decomposition(p)
600
+ [(Ideal (x + 1, y + 1) of Maximal order
601
+ of Function field in y defined by y^3 + x^6 + x^4 + x^2, 1, 1),
602
+ (Ideal (x + 1, (1/(x^3 + x^2 + x))*y^2 + y + 1) of Maximal order
603
+ of Function field in y defined by y^3 + x^6 + x^4 + x^2, 2, 1)]
604
+
605
+ ALGORITHM:
606
+
607
+ In principle, we're trying to compute a primary decomposition
608
+ of the extension of ``ideal`` in ``self`` (an order, and therefore
609
+ a ring). However, while we have primary decomposition methods
610
+ for polynomial rings, we lack any such method for an order.
611
+ Therefore, we construct ``self`` mod ``ideal`` as a
612
+ finite-dimensional algebra, a construct for which we do
613
+ support primary decomposition.
614
+
615
+ See :issue:`28094` and https://github.com/sagemath/sage/files/10659303/decomposition.pdf.gz
616
+
617
+ .. TODO::
618
+
619
+ Use Kummer's theorem to shortcut this code if possible, like as
620
+ done in :meth:`FunctionFieldMaximalOrder_global.decomposition()`
621
+ """
622
+ from sage.algebras.finite_dimensional_algebras.finite_dimensional_algebra import FiniteDimensionalAlgebra
623
+ from sage.matrix.constructor import matrix
624
+ from sage.modules.free_module_element import vector
625
+
626
+ F = self.function_field()
627
+ n = F.degree()
628
+
629
+ # Base rational function field
630
+ K = self.function_field().base_field()
631
+
632
+ # Univariate polynomial ring isomorphic to the maximal order of K
633
+ o = PolynomialRing(K.constant_field(), K.gen())
634
+
635
+ # Prime ideal in o defined by the generator of ideal in the maximal
636
+ # order of K
637
+ p = o(ideal.gen().numerator())
638
+
639
+ # Residue field k = o mod p
640
+ k = o.quo(p)
641
+
642
+ # Given an element of the function field expressed as a K-vector times
643
+ # the basis of this order, construct the n n-by-n matrices that show
644
+ # how to multiply by each of the basis elements.
645
+ matrices = [matrix(o, [self.coordinate_vector(b1*b2) for b1 in self.basis()])
646
+ for b2 in self.basis()]
647
+
648
+ # Let O denote the maximal order self. When reduced modulo p,
649
+ # matrices_reduced give the multiplication matrices used to form the
650
+ # algebra O mod pO.
651
+ matrices_reduced = [M.mod(p) for M in matrices]
652
+ cat = CommutativeAlgebras(k).FiniteDimensional().WithBasis()
653
+ A = FiniteDimensionalAlgebra(k, matrices_reduced, category=cat)
654
+
655
+ # Each prime ideal of the algebra A corresponds to a prime ideal of O,
656
+ # and since the algebra is an Artinian ring, all of its prime ideals
657
+ # are maximal [stacks 00JA]. Thus, we find all of our factors by
658
+ # iterating over the algebra's maximal ideals.
659
+ factors = []
660
+ for q in A.maximal_ideals():
661
+ if q == A.zero_ideal():
662
+ # The zero ideal is the unique maximal ideal, which means that
663
+ # A is a field, and the ideal itself is a prime ideal.
664
+ P = self.ideal(p)
665
+
666
+ P.is_prime.set_cache(True)
667
+ P._prime_below = ideal
668
+ P._relative_degree = n
669
+ P._ramification_index = 1
670
+ P._beta = [1] + [0]*(n-1)
671
+ else:
672
+ Q = q.basis_matrix().apply_map(lambda e: e.lift())
673
+ P = self.ideal(p, *Q*vector(self.basis()))
674
+
675
+ # Now we compute an element beta in O but not in pO such that
676
+ # beta*P in pO.
677
+
678
+ # Since beta is in k[x]-module O, we keep beta as a vector
679
+ # in k[x] with respect to the basis of O. As long as at least
680
+ # one element in this vector is not divisible by p, beta will
681
+ # not be in pO. To ensure that beta*P is in pO, multiplying
682
+ # beta by each of P's generators must produce a vector whose
683
+ # elements are multiples of p. We can ensure that all this
684
+ # occurs by constructing a matrix in k, and finding a nonzero
685
+ # vector in the kernel of the matrix.
686
+
687
+ m = []
688
+ for g in q.basis_matrix():
689
+ m.extend(matrix([g * mr for mr in matrices_reduced]).columns())
690
+ beta = [c.lift() for c in matrix(m).right_kernel().basis()[0]]
691
+
692
+ r = q
693
+ index = 1
694
+ while True:
695
+ rq = r*q
696
+ if rq == r:
697
+ break
698
+ r = rq
699
+ index = index + 1
700
+
701
+ P.is_prime.set_cache(True)
702
+ P._prime_below = ideal
703
+ P._relative_degree = n - q.basis_matrix().nrows()
704
+ P._ramification_index = index
705
+ P._beta = beta
706
+
707
+ factors.append((P, P._relative_degree, P._ramification_index))
708
+
709
+ return factors
710
+
711
+
712
+ class FunctionFieldMaximalOrderInfinite_polymod(FunctionFieldMaximalOrderInfinite):
713
+ """
714
+ Maximal infinite orders of function fields.
715
+
716
+ INPUT:
717
+
718
+ - ``field`` -- function field
719
+
720
+ EXAMPLES::
721
+
722
+ sage: K.<x> = FunctionField(GF(2)); _.<t> = PolynomialRing(K) # needs sage.rings.finite_rings
723
+ sage: F.<y> = K.extension(t^3 - x^2*(x^2+x+1)^2) # needs sage.rings.finite_rings
724
+ sage: F.maximal_order_infinite() # needs sage.rings.finite_rings
725
+ Maximal infinite order of Function field in y defined by y^3 + x^6 + x^4 + x^2
726
+
727
+ sage: K.<x> = FunctionField(GF(2)); _.<Y> = K[] # needs sage.rings.finite_rings
728
+ sage: L.<y> = K.extension(Y^2 + Y + x + 1/x) # needs sage.rings.finite_rings
729
+ sage: L.maximal_order_infinite() # needs sage.rings.finite_rings
730
+ Maximal infinite order of Function field in y defined by y^2 + y + (x^2 + 1)/x
731
+ """
732
+ def __init__(self, field, category=None):
733
+ """
734
+ Initialize.
735
+
736
+ TESTS::
737
+
738
+ sage: # needs sage.rings.finite_rings
739
+ sage: K.<x> = FunctionField(GF(2)); _.<t> = PolynomialRing(K)
740
+ sage: F.<y> = K.extension(t^3 - x^2*(x^2+x+1)^2)
741
+ sage: O = F.maximal_order_infinite()
742
+ sage: TestSuite(O).run()
743
+ """
744
+ FunctionFieldMaximalOrderInfinite.__init__(self, field, ideal_class=FunctionFieldIdealInfinite_polymod)
745
+
746
+ M, from_M, to_M = field._inversion_isomorphism()
747
+ basis = [from_M(g) for g in M.maximal_order().basis()]
748
+
749
+ V, from_V, to_V = field.vector_space()
750
+ R = field.base_field().maximal_order_infinite()
751
+
752
+ self._basis = tuple(basis)
753
+ self._module = V.span_of_basis([to_V(v) for v in basis])
754
+ self._module_base_ring = R
755
+ self._to_module = to_V
756
+
757
+ def _element_constructor_(self, f):
758
+ """
759
+ Make ``f`` an element of this order.
760
+
761
+ EXAMPLES::
762
+
763
+ sage: # needs sage.rings.finite_rings
764
+ sage: K.<x> = FunctionField(GF(2)); _.<Y> = K[]
765
+ sage: L.<y> = K.extension(Y^2 + Y + x + 1/x)
766
+ sage: Oinf = L.maximal_order_infinite()
767
+ sage: Oinf.basis()
768
+ (1, 1/x*y)
769
+ sage: 1 in Oinf
770
+ True
771
+ sage: 1/x*y in Oinf
772
+ True
773
+ sage: x*y in Oinf
774
+ False
775
+ sage: 1/x in Oinf
776
+ True
777
+ """
778
+ F = self.function_field()
779
+
780
+ try:
781
+ f = F(f)
782
+ except TypeError:
783
+ raise TypeError("unable to convert to an element of {}".format(F))
784
+
785
+ O = F.base_field().maximal_order_infinite()
786
+ coordinates = self.coordinate_vector(f)
787
+ if not all(c in O for c in coordinates):
788
+ raise TypeError("%r is not an element of %r" % (f,self))
789
+
790
+ return f
791
+
792
+ def basis(self):
793
+ """
794
+ Return a basis of this order as a module over the maximal order
795
+ of the base function field.
796
+
797
+ EXAMPLES::
798
+
799
+ sage: # needs sage.rings.finite_rings
800
+ sage: K.<x> = FunctionField(GF(2)); _.<t> = K[]
801
+ sage: L.<y> = K.extension(t^3 - x^2*(x^2 + x + 1)^2)
802
+ sage: Oinf = L.maximal_order_infinite()
803
+ sage: Oinf.basis()
804
+ (1, 1/x^2*y, (1/(x^4 + x^3 + x^2))*y^2)
805
+
806
+ ::
807
+
808
+ sage: # needs sage.rings.finite_rings
809
+ sage: K.<x> = FunctionField(GF(2)); _.<Y> = K[]
810
+ sage: L.<y> = K.extension(Y^2 + Y + x + 1/x)
811
+ sage: Oinf = L.maximal_order_infinite()
812
+ sage: Oinf.basis()
813
+ (1, 1/x*y)
814
+ """
815
+ return self._basis
816
+
817
+ def gen(self, n=0):
818
+ """
819
+ Return the ``n``-th generator of the order.
820
+
821
+ The basis elements of the order are generators.
822
+
823
+ EXAMPLES::
824
+
825
+ sage: # needs sage.rings.finite_rings
826
+ sage: K.<x> = FunctionField(GF(2)); _.<t> = K[]
827
+ sage: L.<y> = K.extension(t^3 - x^2*(x^2 + x + 1)^2)
828
+ sage: Oinf = L.maximal_order_infinite()
829
+ sage: Oinf.gen()
830
+ 1
831
+ sage: Oinf.gen(1)
832
+ 1/x^2*y
833
+ sage: Oinf.gen(2)
834
+ (1/(x^4 + x^3 + x^2))*y^2
835
+ sage: Oinf.gen(3)
836
+ Traceback (most recent call last):
837
+ ...
838
+ IndexError: there are only 3 generators
839
+ """
840
+ if not ( n >= 0 and n < self.ngens() ):
841
+ raise IndexError("there are only {} generators".format(self.ngens()))
842
+
843
+ return self._basis[n]
844
+
845
+ def ngens(self):
846
+ """
847
+ Return the number of generators of the order.
848
+
849
+ EXAMPLES::
850
+
851
+ sage: # needs sage.rings.finite_rings
852
+ sage: K.<x> = FunctionField(GF(2)); _.<t> = K[]
853
+ sage: L.<y> = K.extension(t^3 - x^2*(x^2 + x + 1)^2)
854
+ sage: Oinf = L.maximal_order_infinite()
855
+ sage: Oinf.ngens()
856
+ 3
857
+ """
858
+ return len(self._basis)
859
+
860
+ def ideal(self, *gens):
861
+ """
862
+ Return the ideal generated by ``gens``.
863
+
864
+ INPUT:
865
+
866
+ - ``gens`` -- tuple of elements of the function field
867
+
868
+ EXAMPLES::
869
+
870
+ sage: # needs sage.rings.finite_rings
871
+ sage: K.<x> = FunctionField(GF(2)); _.<t> = K[]
872
+ sage: F.<y> = K.extension(t^3 - x^2*(x^2 + x + 1)^2)
873
+ sage: Oinf = F.maximal_order_infinite()
874
+ sage: I = Oinf.ideal(x, y); I
875
+ Ideal (y) of Maximal infinite order of Function field
876
+ in y defined by y^3 + x^6 + x^4 + x^2
877
+
878
+ ::
879
+
880
+ sage: # needs sage.rings.finite_rings
881
+ sage: K.<x> = FunctionField(GF(2)); _.<Y> = K[]
882
+ sage: L.<y> = K.extension(Y^2 + Y + x + 1/x)
883
+ sage: Oinf = L.maximal_order_infinite()
884
+ sage: I = Oinf.ideal(x, y); I
885
+ Ideal (x) of Maximal infinite order of Function field
886
+ in y defined by y^2 + y + (x^2 + 1)/x
887
+ """
888
+ if len(gens) == 1:
889
+ gens = gens[0]
890
+ if type(gens) not in (list,tuple):
891
+ gens = (gens,)
892
+ mgens = [g * b for g in gens for b in self._basis]
893
+ return self.ideal_with_gens_over_base(mgens)
894
+
895
+ def ideal_with_gens_over_base(self, gens):
896
+ """
897
+ Return the ideal generated by ``gens`` as a module.
898
+
899
+ INPUT:
900
+
901
+ - ``gens`` -- tuple of elements of the function field
902
+
903
+ EXAMPLES::
904
+
905
+ sage: K.<x> = FunctionField(GF(2)); R.<t> = K[]
906
+ sage: F.<y> = K.extension(t^3 - x^2*(x^2 + x + 1)^2)
907
+ sage: Oinf = F.maximal_order_infinite()
908
+ sage: Oinf.ideal_with_gens_over_base((x^2, y, (1/(x^2 + x + 1))*y^2))
909
+ Ideal (y) of Maximal infinite order of Function field in y
910
+ defined by y^3 + x^6 + x^4 + x^2
911
+ """
912
+ F = self.function_field()
913
+ iF, from_iF, to_iF = F._inversion_isomorphism()
914
+ iO = iF.maximal_order()
915
+
916
+ ideal = iO.ideal_with_gens_over_base([to_iF(g) for g in gens])
917
+
918
+ if not ideal.is_zero():
919
+ # Now the ideal does not correspond exactly to the ideal in the
920
+ # maximal infinite order through the inversion isomorphism. The
921
+ # reason is that the ideal also has factors not lying over x.
922
+ # The following procedure removes the spurious factors. The idea
923
+ # is that for an integral ideal I, J_n = I + (xO)^n stabilizes
924
+ # if n is large enough, and then J_n is the I with the spurious
925
+ # factors removed. For a fractional ideal, we also need to find
926
+ # the largest factor x^m that divides the denominator.
927
+ from sage.matrix.special import block_matrix
928
+ from .hermite_form_polynomial import reversed_hermite_form
929
+
930
+ d = ideal.denominator()
931
+ h = ideal.hnf()
932
+ x = d.parent().gen()
933
+
934
+ # find the largest factor x^m that divides the denominator
935
+ i = 0
936
+ while d[i].is_zero():
937
+ i += 1
938
+ d = x ** i
939
+
940
+ # find the largest n such that I + (xO)^n stabilizes
941
+ h1 = h
942
+ MS = h1.matrix_space()
943
+ k = MS.identity_matrix()
944
+ while True:
945
+ k = x * k
946
+
947
+ h2 = block_matrix([[h],[k]])
948
+ reversed_hermite_form(h2)
949
+ i = 0
950
+ while i < h2.nrows() and h2.row(i).is_zero():
951
+ i += 1
952
+ h2 = h2[i:] # remove zero rows
953
+
954
+ if h2 == h1:
955
+ break
956
+ h1 = h2
957
+
958
+ # reconstruct ideal
959
+ ideal = iO._ideal_from_vectors_and_denominator(list(h1), d)
960
+
961
+ return self.ideal_monoid().element_class(self, ideal)
962
+
963
+ def _to_iF(self, I):
964
+ """
965
+ Return the ideal in the inverted function field from ``I``.
966
+
967
+ INPUT:
968
+
969
+ - ``I`` -- ideal of the function field
970
+
971
+ EXAMPLES::
972
+
973
+ sage: # needs sage.rings.finite_rings
974
+ sage: K.<x> = FunctionField(GF(2)); _.<Y> = K[]
975
+ sage: L.<y> = K.extension(Y^2 + Y + x + 1/x)
976
+ sage: Oinf = L.maximal_order_infinite()
977
+ sage: I = Oinf.ideal(y)
978
+ sage: Oinf._to_iF(I)
979
+ Ideal (1, 1/x*s) of Maximal order of Function field in s
980
+ defined by s^2 + x*s + x^3 + x
981
+ """
982
+ F = self.function_field()
983
+ iF,from_iF,to_iF = F._inversion_isomorphism()
984
+ iO = iF.maximal_order()
985
+ iI = iO.ideal_with_gens_over_base([to_iF(b) for b in I.gens_over_base()])
986
+ return iI
987
+
988
+ def decomposition(self):
989
+ r"""
990
+ Return prime ideal decomposition of `pO_\infty` where `p` is the unique
991
+ prime ideal of the maximal infinite order of the rational function field.
992
+
993
+ EXAMPLES::
994
+
995
+ sage: # needs sage.rings.finite_rings
996
+ sage: K.<x> = FunctionField(GF(2)); _.<t> = K[]
997
+ sage: F.<y> = K.extension(t^3 - x^2*(x^2 + x + 1)^2)
998
+ sage: Oinf = F.maximal_order_infinite()
999
+ sage: Oinf.decomposition()
1000
+ [(Ideal ((1/(x^4 + x^3 + x^2))*y^2 + 1) of Maximal infinite order
1001
+ of Function field in y defined by y^3 + x^6 + x^4 + x^2, 1, 1),
1002
+ (Ideal ((1/(x^4 + x^3 + x^2))*y^2 + 1/x^2*y + 1) of Maximal infinite order
1003
+ of Function field in y defined by y^3 + x^6 + x^4 + x^2, 2, 1)]
1004
+
1005
+ ::
1006
+
1007
+ sage: # needs sage.rings.finite_rings
1008
+ sage: K.<x> = FunctionField(GF(2)); _.<Y> = K[]
1009
+ sage: L.<y> = K.extension(Y^2 + Y + x + 1/x)
1010
+ sage: Oinf = L.maximal_order_infinite()
1011
+ sage: Oinf.decomposition()
1012
+ [(Ideal (1/x*y) of Maximal infinite order of Function field in y
1013
+ defined by y^2 + y + (x^2 + 1)/x, 1, 2)]
1014
+
1015
+ ::
1016
+
1017
+ sage: K.<x> = FunctionField(QQ); _.<Y> = K[]
1018
+ sage: F.<y> = K.extension(Y^3 - x^2*(x^2 + x + 1)^2)
1019
+ sage: Oinf = F.maximal_order_infinite()
1020
+ sage: Oinf.decomposition()
1021
+ [(Ideal (1/x^2*y - 1) of Maximal infinite order
1022
+ of Function field in y defined by y^3 - x^6 - 2*x^5 - 3*x^4 - 2*x^3 - x^2, 1, 1),
1023
+ (Ideal ((1/(x^4 + x^3 + x^2))*y^2 + 1/x^2*y + 1) of Maximal infinite order
1024
+ of Function field in y defined by y^3 - x^6 - 2*x^5 - 3*x^4 - 2*x^3 - x^2, 2, 1)]
1025
+
1026
+ ::
1027
+
1028
+ sage: K.<x> = FunctionField(QQ); _.<Y> = K[]
1029
+ sage: L.<y> = K.extension(Y^2 + Y + x + 1/x)
1030
+ sage: Oinf = L.maximal_order_infinite()
1031
+ sage: Oinf.decomposition()
1032
+ [(Ideal (1/x*y) of Maximal infinite order of Function field in y
1033
+ defined by y^2 + y + (x^2 + 1)/x, 1, 2)]
1034
+ """
1035
+ F = self.function_field()
1036
+ iF,from_iF,to_iF = F._inversion_isomorphism()
1037
+
1038
+ x = iF.base_field().gen()
1039
+ iO = iF.maximal_order()
1040
+ io = iF.base_field().maximal_order()
1041
+ ip = io.ideal(x)
1042
+
1043
+ dec = []
1044
+ for iprime, deg, exp in iO.decomposition(ip):
1045
+ prime = self.ideal_monoid().element_class(self, iprime)
1046
+ dec.append((prime, deg, exp))
1047
+ return dec
1048
+
1049
+ def different(self):
1050
+ """
1051
+ Return the different ideal of the maximal infinite order.
1052
+
1053
+ EXAMPLES::
1054
+
1055
+ sage: # needs sage.rings.finite_rings
1056
+ sage: K.<x> = FunctionField(GF(2)); _.<Y> = K[]
1057
+ sage: L.<y> = K.extension(Y^2 + Y + x + 1/x)
1058
+ sage: Oinf = L.maximal_order_infinite()
1059
+ sage: Oinf.different()
1060
+ Ideal (1/x) of Maximal infinite order of Function field in y
1061
+ defined by y^2 + y + (x^2 + 1)/x
1062
+ """
1063
+ T = self._codifferent_matrix()
1064
+ codiff_gens = []
1065
+ for c in T.inverse().columns():
1066
+ codiff_gens.append(sum([ci*bi for ci,bi in zip(c,self.basis())]))
1067
+ codiff = self.ideal_with_gens_over_base(codiff_gens)
1068
+ return ~codiff
1069
+
1070
+ @cached_method
1071
+ def _codifferent_matrix(self):
1072
+ """
1073
+ Return the codifferent matrix of the maximal infinite order.
1074
+
1075
+ EXAMPLES::
1076
+
1077
+ sage: # needs sage.rings.finite_rings
1078
+ sage: K.<x> = FunctionField(GF(2)); _.<Y> = K[]
1079
+ sage: L.<y> = K.extension(Y^2 + Y + x + 1/x)
1080
+ sage: Oinf = L.maximal_order_infinite()
1081
+ sage: Oinf._codifferent_matrix()
1082
+ [ 0 1/x]
1083
+ [ 1/x 1/x^2]
1084
+ """
1085
+ from sage.matrix.constructor import matrix
1086
+
1087
+ rows = []
1088
+ for u in self.basis():
1089
+ row = []
1090
+ for v in self.basis():
1091
+ row.append((u*v).trace())
1092
+ rows.append(row)
1093
+ T = matrix(rows)
1094
+ return T
1095
+
1096
+ def coordinate_vector(self, e):
1097
+ """
1098
+ Return the coordinates of ``e`` with respect to the basis of the order.
1099
+
1100
+ INPUT:
1101
+
1102
+ - ``e`` -- element of the function field
1103
+
1104
+ The returned coordinates are in the base maximal infinite order if and only
1105
+ if the element is in the order.
1106
+
1107
+ EXAMPLES::
1108
+
1109
+ sage: # needs sage.rings.finite_rings
1110
+ sage: K.<x> = FunctionField(GF(2)); _.<Y> = K[]
1111
+ sage: L.<y> = K.extension(Y^2 + Y + x + 1/x)
1112
+ sage: Oinf = L.maximal_order_infinite()
1113
+ sage: f = 1/y^2
1114
+ sage: f in Oinf
1115
+ True
1116
+ sage: Oinf.coordinate_vector(f)
1117
+ ((x^3 + x^2 + x)/(x^4 + 1), x^3/(x^4 + 1))
1118
+ """
1119
+ return self._module.coordinate_vector(self._to_module(e))
1120
+
1121
+
1122
+ class FunctionFieldMaximalOrder_global(FunctionFieldMaximalOrder_polymod):
1123
+ """
1124
+ Maximal orders of global function fields.
1125
+
1126
+ INPUT:
1127
+
1128
+ - ``field`` -- function field to which this maximal order belongs
1129
+
1130
+ EXAMPLES::
1131
+
1132
+ sage: K.<x> = FunctionField(GF(7)); R.<y> = K[] # needs sage.rings.finite_rings
1133
+ sage: L.<y> = K.extension(y^4 + x*y + 4*x + 1) # needs sage.rings.finite_rings
1134
+ sage: L.maximal_order() # needs sage.rings.finite_rings
1135
+ Maximal order of Function field in y defined by y^4 + x*y + 4*x + 1
1136
+ """
1137
+
1138
+ def __init__(self, field):
1139
+ """
1140
+ Initialize.
1141
+
1142
+ TESTS::
1143
+
1144
+ sage: # needs sage.rings.finite_rings
1145
+ sage: K.<x> = FunctionField(GF(7)); R.<y> = K[]
1146
+ sage: L.<y> = K.extension(y^4 + x*y + 4*x + 1)
1147
+ sage: O = L.maximal_order()
1148
+ sage: TestSuite(O).run()
1149
+ """
1150
+ FunctionFieldMaximalOrder_polymod.__init__(self, field, ideal_class=FunctionFieldIdeal_global)
1151
+
1152
+ @cached_method
1153
+ def p_radical(self, prime):
1154
+ """
1155
+ Return the ``prime``-radical of the maximal order.
1156
+
1157
+ INPUT:
1158
+
1159
+ - ``prime`` -- prime ideal of the maximal order of the base
1160
+ rational function field
1161
+
1162
+ The algorithm is outlined in Section 6.1.3 of [Coh1993]_.
1163
+
1164
+ EXAMPLES::
1165
+
1166
+ sage: # needs sage.rings.finite_rings
1167
+ sage: K.<x> = FunctionField(GF(2)); _.<t> = K[]
1168
+ sage: F.<y> = K.extension(t^3 - x^2 * (x^2 + x + 1)^2)
1169
+ sage: o = K.maximal_order()
1170
+ sage: O = F.maximal_order()
1171
+ sage: p = o.ideal(x + 1)
1172
+ sage: O.p_radical(p)
1173
+ Ideal (x + 1) of Maximal order of Function field in y
1174
+ defined by y^3 + x^6 + x^4 + x^2
1175
+ """
1176
+ from sage.matrix.constructor import matrix
1177
+ from sage.modules.free_module_element import vector
1178
+
1179
+ g = prime.gens()[0]
1180
+
1181
+ if not (g.denominator() == 1 and g.numerator().is_irreducible()):
1182
+ raise ValueError('not a prime ideal')
1183
+
1184
+ F = self.function_field()
1185
+ n = F.degree()
1186
+ o = prime.ring()
1187
+ p = g.numerator()
1188
+
1189
+ # Fp is isomorphic to the residue field o/p
1190
+ Fp, fr_Fp, to_Fp = o._residue_field_global(p)
1191
+
1192
+ # exp = q^j should be at least extension degree where q is
1193
+ # the order of the residue field o/p
1194
+ q = F.constant_base_field().order()**p.degree()
1195
+ exp = q
1196
+ while exp <= F.degree():
1197
+ exp = exp**q
1198
+
1199
+ # radical equals to the kernel of the map x |-> x^exp
1200
+ mat = []
1201
+ for g in self.basis():
1202
+ v = [to_Fp(c) for c in self._coordinate_vector(g**exp)]
1203
+ mat.append(v)
1204
+ mat = matrix(Fp, mat)
1205
+ ker = mat.kernel()
1206
+
1207
+ # construct module generators of the p-radical
1208
+ vecs = []
1209
+ for i in range(n):
1210
+ v = vector([p if j == i else 0 for j in range(n)])
1211
+ vecs.append(v)
1212
+ for b in ker.basis():
1213
+ v = vector([fr_Fp(c) for c in b])
1214
+ vecs.append(v)
1215
+
1216
+ return self._ideal_from_vectors(vecs)
1217
+
1218
+ @cached_method
1219
+ def decomposition(self, ideal):
1220
+ """
1221
+ Return the decomposition of the prime ideal.
1222
+
1223
+ INPUT:
1224
+
1225
+ - ``ideal`` -- prime ideal of the base maximal order
1226
+
1227
+ EXAMPLES::
1228
+
1229
+ sage: # needs sage.rings.finite_rings
1230
+ sage: K.<x> = FunctionField(GF(2)); R.<t> = K[]
1231
+ sage: F.<y> = K.extension(t^3 - x^2*(x^2 + x + 1)^2)
1232
+ sage: o = K.maximal_order()
1233
+ sage: O = F.maximal_order()
1234
+ sage: p = o.ideal(x + 1)
1235
+ sage: O.decomposition(p)
1236
+ [(Ideal (x + 1, y + 1) of Maximal order
1237
+ of Function field in y defined by y^3 + x^6 + x^4 + x^2, 1, 1),
1238
+ (Ideal (x + 1, (1/(x^3 + x^2 + x))*y^2 + y + 1) of Maximal order
1239
+ of Function field in y defined by y^3 + x^6 + x^4 + x^2, 2, 1)]
1240
+ """
1241
+ from sage.matrix.constructor import matrix
1242
+
1243
+ F = self.function_field()
1244
+ n = F.degree()
1245
+
1246
+ p = ideal.gen().numerator()
1247
+ o = ideal.ring()
1248
+
1249
+ # Fp is isomorphic to the residue field o/p
1250
+ Fp, fr, to = o._residue_field_global(p)
1251
+ P,X = Fp['X'].objgen()
1252
+
1253
+ V = Fp**n # Ob = O/pO
1254
+
1255
+ mtable = []
1256
+ for i in range(n):
1257
+ row = []
1258
+ for j in range(n):
1259
+ row.append( V([to(e) for e in self._mtable[i][j]]) )
1260
+ mtable.append(row)
1261
+
1262
+ if p not in self._kummer_places:
1263
+ #####################################
1264
+ # Decomposition by Kummer's theorem #
1265
+ #####################################
1266
+ # gen is self._kummer_gen
1267
+ gen_vec_pow = self._kummer_gen_vec_pow
1268
+ mul_vecs = self._mul_vecs
1269
+
1270
+ f = self._kummer_polynomial
1271
+ fp = P([to(c.numerator()) for c in f.list()])
1272
+ decomposition = []
1273
+ for q, exp in fp.factor():
1274
+ # construct O.ideal([p,q(gen)])
1275
+ gen_vecs = list(matrix.diagonal(n * [p]))
1276
+ c = q.list()
1277
+
1278
+ # q(gen) in vector form
1279
+ qgen = sum(fr(c[i]) * gen_vec_pow[i] for i in range(len(c)))
1280
+
1281
+ I = matrix.identity(o._ring, n)
1282
+ for i in range(n):
1283
+ gen_vecs.append(mul_vecs(qgen,I[i]))
1284
+ prime = self._ideal_from_vectors_and_denominator(gen_vecs)
1285
+
1286
+ # Compute an element beta in O but not in pO. How to find beta
1287
+ # is explained in Section 4.8.3 of [Coh1993]. We keep beta
1288
+ # as a vector over k[x] with respect to the basis of O.
1289
+
1290
+ # p and qgen generates the prime; modulo pO, qgenb generates the prime
1291
+ qgenb = [to(qgen[i]) for i in range(n)]
1292
+ m = []
1293
+ for i in range(n):
1294
+ m.append(sum(qgenb[j] * mtable[i][j] for j in range(n)))
1295
+ beta = [fr(coeff) for coeff in matrix(m).left_kernel().basis()[0]]
1296
+
1297
+ prime.is_prime.set_cache(True)
1298
+ prime._prime_below = ideal
1299
+ prime._relative_degree = q.degree()
1300
+ prime._ramification_index = exp
1301
+ prime._beta = beta
1302
+
1303
+ prime._kummer_form = (p, qgen)
1304
+
1305
+ decomposition.append((prime, q.degree(), exp))
1306
+ else:
1307
+ #############################
1308
+ # Buchman-Lenstra algorithm #
1309
+ #############################
1310
+ from sage.matrix.special import block_matrix
1311
+ from sage.modules.free_module_element import vector
1312
+
1313
+ pO = self.ideal(p)
1314
+ Ip = self.p_radical(ideal)
1315
+ Ob = matrix.identity(Fp, n)
1316
+
1317
+ def bar(I): # transfer to O/pO
1318
+ m = []
1319
+ for v in I._hnf:
1320
+ m.append([to(e) for e in v])
1321
+ h = matrix(m).echelon_form()
1322
+ return cut_last_zero_rows(h)
1323
+
1324
+ def liftb(Ib):
1325
+ m = [vector([fr(e) for e in v]) for v in Ib]
1326
+ m.extend(pO._hnf)
1327
+ return self._ideal_from_vectors_and_denominator(m, 1)
1328
+
1329
+ def cut_last_zero_rows(h):
1330
+ i = h.nrows()
1331
+ while i > 0 and h.row(i-1).is_zero():
1332
+ i -= 1
1333
+ return h[:i]
1334
+
1335
+ def mul_vec(v1, v2):
1336
+ s = 0
1337
+ for i in range(n):
1338
+ for j in range(n):
1339
+ s += v1[i] * v2[j] * mtable[i][j]
1340
+ return s
1341
+
1342
+ def pow(v, r): # r > 0
1343
+ m = v
1344
+ while r > 1:
1345
+ m = mul_vec(m, v)
1346
+ r -= 1
1347
+ return m
1348
+
1349
+ # Algorithm 6.2.7 of [Coh1993]
1350
+ def div(Ib, Jb):
1351
+ # compute a basis of Jb/Ib
1352
+ sJb = Jb.row_space()
1353
+ sIb = Ib.row_space()
1354
+ sJbsIb,proj_sJbsIb,lift_sJbsIb = sJb.quotient_abstract(sIb)
1355
+ supplement_basis = [lift_sJbsIb(v) for v in sJbsIb.basis()]
1356
+
1357
+ m = []
1358
+ for b in V.gens(): # basis of Ob = O/pO
1359
+ b_row = [] # row vector representation of the map a -> a*b
1360
+ for a in supplement_basis:
1361
+ b_row += lift_sJbsIb(proj_sJbsIb( mul_vec(a,b) ))
1362
+ m.append(b_row)
1363
+ return matrix(Fp,n,m).left_kernel().basis_matrix()
1364
+
1365
+ # Algorithm 6.2.5 of [Coh1993]
1366
+ def mul(Ib, Jb):
1367
+ m = []
1368
+ for v1 in Ib:
1369
+ for v2 in Jb:
1370
+ m.append(mul_vec(v1,v2))
1371
+ h = matrix(m).echelon_form()
1372
+ return cut_last_zero_rows(h)
1373
+
1374
+ def add(Ib, Jb):
1375
+ m = block_matrix([[Ib], [Jb]])
1376
+ h = m.echelon_form()
1377
+ return cut_last_zero_rows(h)
1378
+
1379
+ # K_1, K_2, ...
1380
+ Lb = IpOb = bar(Ip+pO)
1381
+ Kb = [Lb]
1382
+ while not Lb.is_zero():
1383
+ Lb = mul(Lb,IpOb)
1384
+ Kb.append(Lb)
1385
+
1386
+ # J_1, J_2, ...
1387
+ Jb = [Kb[0]] + [div(Kb[j],Kb[j-1]) for j in range(1,len(Kb))]
1388
+
1389
+ # H_1, H_2, ...
1390
+ Hb = [div(Jb[j],Jb[j+1]) for j in range(len(Jb)-1)] + [Jb[-1]]
1391
+
1392
+ q = Fp.order()
1393
+
1394
+ def split(h):
1395
+ # VsW represents O/H as a vector space
1396
+ W = h.row_space() # H/pO
1397
+ VsW,to_VsW,lift_to_V = V.quotient_abstract(W)
1398
+
1399
+ # compute the space K of elements in O/H that satisfy a^q-a=0
1400
+ l = [lift_to_V(b) for b in VsW.basis()]
1401
+
1402
+ images = [to_VsW(pow(x, q) - x) for x in l]
1403
+ K = VsW.hom(images, VsW).kernel()
1404
+
1405
+ if K.dimension() == 0:
1406
+ return []
1407
+ if K.dimension() == 1: # h is prime
1408
+ return [(liftb(h),VsW.dimension())] # relative degree
1409
+
1410
+ # choose a such that a^q - a is 0 but a is not in Fp
1411
+ for a in K.basis():
1412
+ # IMPORTANT: This criterion is based on the assumption
1413
+ # that O.basis() starts with 1.
1414
+ if a.support() != [0]:
1415
+ break
1416
+ else:
1417
+ raise AssertionError("no appropriate value found")
1418
+
1419
+ a = lift_to_V(a)
1420
+ # compute the minimal polynomial of a
1421
+ m = [to_VsW(Ob[0])] # 1 in VsW
1422
+ apow = a
1423
+ while True:
1424
+ v = to_VsW(apow)
1425
+ try:
1426
+ sol = matrix(m).solve_left(v)
1427
+ except ValueError:
1428
+ m.append(v)
1429
+ apow = mul_vec(apow, a)
1430
+ continue
1431
+ break
1432
+
1433
+ minpol = X**len(sol) - P(list(sol))
1434
+
1435
+ # The minimal polynomial of a has only linear factors and at least two
1436
+ # of them. We set f to the first factor and g to the product of the rest.
1437
+ fac = minpol.factor()
1438
+ f = fac[0][0]
1439
+ g = (fac/f).expand()
1440
+ d,u,v = f.xgcd(g)
1441
+
1442
+ assert d == 1, "Not relatively prime {} and {}".format(f,g)
1443
+
1444
+ # finally, idempotent!
1445
+ e = lift_to_V(sum([c1*c2 for c1,c2 in zip(u*f,m)]))
1446
+
1447
+ h1 = add(h, matrix([mul_vec(e,Ob[i]) for i in range(n)]))
1448
+ h2 = add(h, matrix([mul_vec(Ob[0]-e,Ob[i]) for i in range(n)]))
1449
+
1450
+ return split(h1) + split(h2)
1451
+
1452
+ decomposition = []
1453
+ for i in range(len(Hb)):
1454
+ index = i + 1 # Hb starts with H_1
1455
+ for prime, degree in split(Hb[i]):
1456
+ # Compute an element beta in O but not in pO. How to find beta
1457
+ # is explained in Section 4.8.3 of [Coh1993]. We keep beta
1458
+ # as a vector over k[x] with respect to the basis of O.
1459
+ m = []
1460
+ for i in range(n):
1461
+ r = []
1462
+ for g in prime._hnf:
1463
+ r += sum(to(g[j]) * mtable[i][j] for j in range(n))
1464
+ m.append(r)
1465
+ beta = [fr(e) for e in matrix(m).left_kernel().basis()[0]]
1466
+
1467
+ prime.is_prime.set_cache(True)
1468
+ prime._prime_below = ideal
1469
+ prime._relative_degree = degree
1470
+ prime._ramification_index = index
1471
+ prime._beta = beta
1472
+
1473
+ decomposition.append((prime, degree, index))
1474
+
1475
+ return decomposition