passagemath-modules 10.6.31rc3__cp314-cp314-musllinux_1_2_aarch64.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-modules might be problematic. Click here for more details.

Files changed (807) hide show
  1. passagemath_modules-10.6.31rc3.dist-info/METADATA +281 -0
  2. passagemath_modules-10.6.31rc3.dist-info/RECORD +807 -0
  3. passagemath_modules-10.6.31rc3.dist-info/WHEEL +5 -0
  4. passagemath_modules-10.6.31rc3.dist-info/top_level.txt +2 -0
  5. passagemath_modules.libs/libgcc_s-2d945d6c.so.1 +0 -0
  6. passagemath_modules.libs/libgfortran-67378ab2.so.5.0.0 +0 -0
  7. passagemath_modules.libs/libgmp-28992bcb.so.10.5.0 +0 -0
  8. passagemath_modules.libs/libgsl-23768756.so.28.0.0 +0 -0
  9. passagemath_modules.libs/libmpc-7897025b.so.3.3.1 +0 -0
  10. passagemath_modules.libs/libmpfr-e34bb864.so.6.2.1 +0 -0
  11. passagemath_modules.libs/libopenblasp-r0-503f0c35.3.29.so +0 -0
  12. sage/algebras/all__sagemath_modules.py +20 -0
  13. sage/algebras/catalog.py +148 -0
  14. sage/algebras/clifford_algebra.py +3107 -0
  15. sage/algebras/clifford_algebra_element.cpython-314-aarch64-linux-musl.so +0 -0
  16. sage/algebras/clifford_algebra_element.pxd +16 -0
  17. sage/algebras/clifford_algebra_element.pyx +997 -0
  18. sage/algebras/commutative_dga.py +4252 -0
  19. sage/algebras/exterior_algebra_groebner.cpython-314-aarch64-linux-musl.so +0 -0
  20. sage/algebras/exterior_algebra_groebner.pxd +55 -0
  21. sage/algebras/exterior_algebra_groebner.pyx +727 -0
  22. sage/algebras/finite_dimensional_algebras/all.py +2 -0
  23. sage/algebras/finite_dimensional_algebras/finite_dimensional_algebra.py +1029 -0
  24. sage/algebras/finite_dimensional_algebras/finite_dimensional_algebra_element.cpython-314-aarch64-linux-musl.so +0 -0
  25. sage/algebras/finite_dimensional_algebras/finite_dimensional_algebra_element.pxd +12 -0
  26. sage/algebras/finite_dimensional_algebras/finite_dimensional_algebra_element.pyx +706 -0
  27. sage/algebras/finite_dimensional_algebras/finite_dimensional_algebra_ideal.py +196 -0
  28. sage/algebras/finite_dimensional_algebras/finite_dimensional_algebra_morphism.py +255 -0
  29. sage/algebras/finite_gca.py +528 -0
  30. sage/algebras/group_algebra.py +232 -0
  31. sage/algebras/lie_algebras/abelian.py +197 -0
  32. sage/algebras/lie_algebras/affine_lie_algebra.py +1213 -0
  33. sage/algebras/lie_algebras/all.py +25 -0
  34. sage/algebras/lie_algebras/all__sagemath_modules.py +1 -0
  35. sage/algebras/lie_algebras/bch.py +177 -0
  36. sage/algebras/lie_algebras/bgg_dual_module.py +1184 -0
  37. sage/algebras/lie_algebras/bgg_resolution.py +232 -0
  38. sage/algebras/lie_algebras/center_uea.py +767 -0
  39. sage/algebras/lie_algebras/classical_lie_algebra.py +2516 -0
  40. sage/algebras/lie_algebras/examples.py +683 -0
  41. sage/algebras/lie_algebras/free_lie_algebra.py +973 -0
  42. sage/algebras/lie_algebras/heisenberg.py +820 -0
  43. sage/algebras/lie_algebras/lie_algebra.py +1562 -0
  44. sage/algebras/lie_algebras/lie_algebra_element.cpython-314-aarch64-linux-musl.so +0 -0
  45. sage/algebras/lie_algebras/lie_algebra_element.pxd +68 -0
  46. sage/algebras/lie_algebras/lie_algebra_element.pyx +2122 -0
  47. sage/algebras/lie_algebras/morphism.py +661 -0
  48. sage/algebras/lie_algebras/nilpotent_lie_algebra.py +457 -0
  49. sage/algebras/lie_algebras/onsager.py +1324 -0
  50. sage/algebras/lie_algebras/poincare_birkhoff_witt.py +816 -0
  51. sage/algebras/lie_algebras/quotient.py +462 -0
  52. sage/algebras/lie_algebras/rank_two_heisenberg_virasoro.py +355 -0
  53. sage/algebras/lie_algebras/representation.py +1040 -0
  54. sage/algebras/lie_algebras/structure_coefficients.py +459 -0
  55. sage/algebras/lie_algebras/subalgebra.py +967 -0
  56. sage/algebras/lie_algebras/symplectic_derivation.py +289 -0
  57. sage/algebras/lie_algebras/verma_module.py +1630 -0
  58. sage/algebras/lie_algebras/virasoro.py +1186 -0
  59. sage/algebras/octonion_algebra.cpython-314-aarch64-linux-musl.so +0 -0
  60. sage/algebras/octonion_algebra.pxd +20 -0
  61. sage/algebras/octonion_algebra.pyx +987 -0
  62. sage/algebras/orlik_solomon.py +907 -0
  63. sage/algebras/orlik_terao.py +779 -0
  64. sage/algebras/steenrod/all.py +7 -0
  65. sage/algebras/steenrod/steenrod_algebra.py +4258 -0
  66. sage/algebras/steenrod/steenrod_algebra_bases.py +1179 -0
  67. sage/algebras/steenrod/steenrod_algebra_misc.py +1167 -0
  68. sage/algebras/steenrod/steenrod_algebra_mult.py +954 -0
  69. sage/algebras/weyl_algebra.py +1126 -0
  70. sage/all__sagemath_modules.py +62 -0
  71. sage/calculus/all__sagemath_modules.py +19 -0
  72. sage/calculus/expr.py +205 -0
  73. sage/calculus/integration.cpython-314-aarch64-linux-musl.so +0 -0
  74. sage/calculus/integration.pyx +698 -0
  75. sage/calculus/interpolation.cpython-314-aarch64-linux-musl.so +0 -0
  76. sage/calculus/interpolation.pxd +13 -0
  77. sage/calculus/interpolation.pyx +387 -0
  78. sage/calculus/interpolators.cpython-314-aarch64-linux-musl.so +0 -0
  79. sage/calculus/interpolators.pyx +326 -0
  80. sage/calculus/ode.cpython-314-aarch64-linux-musl.so +0 -0
  81. sage/calculus/ode.pxd +5 -0
  82. sage/calculus/ode.pyx +610 -0
  83. sage/calculus/riemann.cpython-314-aarch64-linux-musl.so +0 -0
  84. sage/calculus/riemann.pyx +1521 -0
  85. sage/calculus/test_sympy.py +201 -0
  86. sage/calculus/transforms/all.py +7 -0
  87. sage/calculus/transforms/dft.py +844 -0
  88. sage/calculus/transforms/dwt.cpython-314-aarch64-linux-musl.so +0 -0
  89. sage/calculus/transforms/dwt.pxd +7 -0
  90. sage/calculus/transforms/dwt.pyx +160 -0
  91. sage/calculus/transforms/fft.cpython-314-aarch64-linux-musl.so +0 -0
  92. sage/calculus/transforms/fft.pxd +12 -0
  93. sage/calculus/transforms/fft.pyx +487 -0
  94. sage/calculus/wester.py +662 -0
  95. sage/coding/abstract_code.py +1108 -0
  96. sage/coding/ag_code.py +868 -0
  97. sage/coding/ag_code_decoders.cpython-314-aarch64-linux-musl.so +0 -0
  98. sage/coding/ag_code_decoders.pyx +2639 -0
  99. sage/coding/all.py +15 -0
  100. sage/coding/bch_code.py +494 -0
  101. sage/coding/binary_code.cpython-314-aarch64-linux-musl.so +0 -0
  102. sage/coding/binary_code.pxd +124 -0
  103. sage/coding/binary_code.pyx +4139 -0
  104. sage/coding/bounds_catalog.py +43 -0
  105. sage/coding/channel.py +819 -0
  106. sage/coding/channels_catalog.py +29 -0
  107. sage/coding/code_bounds.py +755 -0
  108. sage/coding/code_constructions.py +804 -0
  109. sage/coding/codes_catalog.py +111 -0
  110. sage/coding/cyclic_code.py +1329 -0
  111. sage/coding/databases.py +316 -0
  112. sage/coding/decoder.py +373 -0
  113. sage/coding/decoders_catalog.py +88 -0
  114. sage/coding/delsarte_bounds.py +709 -0
  115. sage/coding/encoder.py +390 -0
  116. sage/coding/encoders_catalog.py +64 -0
  117. sage/coding/extended_code.py +468 -0
  118. sage/coding/gabidulin_code.py +1058 -0
  119. sage/coding/golay_code.py +404 -0
  120. sage/coding/goppa_code.py +441 -0
  121. sage/coding/grs_code.py +2371 -0
  122. sage/coding/guava.py +107 -0
  123. sage/coding/guruswami_sudan/all.py +1 -0
  124. sage/coding/guruswami_sudan/gs_decoder.py +897 -0
  125. sage/coding/guruswami_sudan/interpolation.py +409 -0
  126. sage/coding/guruswami_sudan/utils.py +176 -0
  127. sage/coding/hamming_code.py +176 -0
  128. sage/coding/information_set_decoder.py +1032 -0
  129. sage/coding/kasami_codes.cpython-314-aarch64-linux-musl.so +0 -0
  130. sage/coding/kasami_codes.pyx +351 -0
  131. sage/coding/linear_code.py +3067 -0
  132. sage/coding/linear_code_no_metric.py +1354 -0
  133. sage/coding/linear_rank_metric.py +961 -0
  134. sage/coding/parity_check_code.py +353 -0
  135. sage/coding/punctured_code.py +719 -0
  136. sage/coding/reed_muller_code.py +999 -0
  137. sage/coding/self_dual_codes.py +942 -0
  138. sage/coding/source_coding/all.py +2 -0
  139. sage/coding/source_coding/huffman.py +553 -0
  140. sage/coding/subfield_subcode.py +423 -0
  141. sage/coding/two_weight_db.py +399 -0
  142. sage/combinat/all__sagemath_modules.py +7 -0
  143. sage/combinat/cartesian_product.py +347 -0
  144. sage/combinat/family.py +11 -0
  145. sage/combinat/free_module.py +1977 -0
  146. sage/combinat/root_system/all.py +147 -0
  147. sage/combinat/root_system/ambient_space.py +527 -0
  148. sage/combinat/root_system/associahedron.py +471 -0
  149. sage/combinat/root_system/braid_move_calculator.py +143 -0
  150. sage/combinat/root_system/braid_orbit.cpython-314-aarch64-linux-musl.so +0 -0
  151. sage/combinat/root_system/braid_orbit.pyx +144 -0
  152. sage/combinat/root_system/branching_rules.py +2301 -0
  153. sage/combinat/root_system/cartan_matrix.py +1245 -0
  154. sage/combinat/root_system/cartan_type.py +3069 -0
  155. sage/combinat/root_system/coxeter_group.py +162 -0
  156. sage/combinat/root_system/coxeter_matrix.py +1261 -0
  157. sage/combinat/root_system/coxeter_type.py +681 -0
  158. sage/combinat/root_system/dynkin_diagram.py +900 -0
  159. sage/combinat/root_system/extended_affine_weyl_group.py +2993 -0
  160. sage/combinat/root_system/fundamental_group.py +795 -0
  161. sage/combinat/root_system/hecke_algebra_representation.py +1203 -0
  162. sage/combinat/root_system/integrable_representations.py +1227 -0
  163. sage/combinat/root_system/non_symmetric_macdonald_polynomials.py +1965 -0
  164. sage/combinat/root_system/pieri_factors.py +1147 -0
  165. sage/combinat/root_system/plot.py +1615 -0
  166. sage/combinat/root_system/root_lattice_realization_algebras.py +1214 -0
  167. sage/combinat/root_system/root_lattice_realizations.py +4628 -0
  168. sage/combinat/root_system/root_space.py +487 -0
  169. sage/combinat/root_system/root_system.py +882 -0
  170. sage/combinat/root_system/type_A.py +348 -0
  171. sage/combinat/root_system/type_A_affine.py +227 -0
  172. sage/combinat/root_system/type_A_infinity.py +241 -0
  173. sage/combinat/root_system/type_B.py +347 -0
  174. sage/combinat/root_system/type_BC_affine.py +287 -0
  175. sage/combinat/root_system/type_B_affine.py +216 -0
  176. sage/combinat/root_system/type_C.py +317 -0
  177. sage/combinat/root_system/type_C_affine.py +188 -0
  178. sage/combinat/root_system/type_D.py +357 -0
  179. sage/combinat/root_system/type_D_affine.py +208 -0
  180. sage/combinat/root_system/type_E.py +641 -0
  181. sage/combinat/root_system/type_E_affine.py +231 -0
  182. sage/combinat/root_system/type_F.py +387 -0
  183. sage/combinat/root_system/type_F_affine.py +137 -0
  184. sage/combinat/root_system/type_G.py +293 -0
  185. sage/combinat/root_system/type_G_affine.py +132 -0
  186. sage/combinat/root_system/type_H.py +105 -0
  187. sage/combinat/root_system/type_I.py +110 -0
  188. sage/combinat/root_system/type_Q.py +150 -0
  189. sage/combinat/root_system/type_affine.py +509 -0
  190. sage/combinat/root_system/type_dual.py +704 -0
  191. sage/combinat/root_system/type_folded.py +301 -0
  192. sage/combinat/root_system/type_marked.py +748 -0
  193. sage/combinat/root_system/type_reducible.py +601 -0
  194. sage/combinat/root_system/type_relabel.py +730 -0
  195. sage/combinat/root_system/type_super_A.py +837 -0
  196. sage/combinat/root_system/weight_lattice_realizations.py +1188 -0
  197. sage/combinat/root_system/weight_space.py +639 -0
  198. sage/combinat/root_system/weyl_characters.py +2238 -0
  199. sage/crypto/__init__.py +4 -0
  200. sage/crypto/all.py +28 -0
  201. sage/crypto/block_cipher/all.py +7 -0
  202. sage/crypto/block_cipher/des.py +1065 -0
  203. sage/crypto/block_cipher/miniaes.py +2171 -0
  204. sage/crypto/block_cipher/present.py +909 -0
  205. sage/crypto/block_cipher/sdes.py +1527 -0
  206. sage/crypto/boolean_function.cpython-314-aarch64-linux-musl.so +0 -0
  207. sage/crypto/boolean_function.pxd +10 -0
  208. sage/crypto/boolean_function.pyx +1487 -0
  209. sage/crypto/cipher.py +78 -0
  210. sage/crypto/classical.py +3668 -0
  211. sage/crypto/classical_cipher.py +569 -0
  212. sage/crypto/cryptosystem.py +387 -0
  213. sage/crypto/key_exchange/all.py +7 -0
  214. sage/crypto/key_exchange/catalog.py +24 -0
  215. sage/crypto/key_exchange/diffie_hellman.py +323 -0
  216. sage/crypto/key_exchange/key_exchange_scheme.py +107 -0
  217. sage/crypto/lattice.py +312 -0
  218. sage/crypto/lfsr.py +295 -0
  219. sage/crypto/lwe.py +840 -0
  220. sage/crypto/mq/__init__.py +4 -0
  221. sage/crypto/mq/mpolynomialsystemgenerator.py +204 -0
  222. sage/crypto/mq/rijndael_gf.py +2345 -0
  223. sage/crypto/mq/sbox.py +7 -0
  224. sage/crypto/mq/sr.py +3344 -0
  225. sage/crypto/public_key/all.py +5 -0
  226. sage/crypto/public_key/blum_goldwasser.py +776 -0
  227. sage/crypto/sbox.cpython-314-aarch64-linux-musl.so +0 -0
  228. sage/crypto/sbox.pyx +2090 -0
  229. sage/crypto/sboxes.py +2090 -0
  230. sage/crypto/stream.py +390 -0
  231. sage/crypto/stream_cipher.py +297 -0
  232. sage/crypto/util.py +519 -0
  233. sage/ext/all__sagemath_modules.py +1 -0
  234. sage/ext/interpreters/__init__.py +1 -0
  235. sage/ext/interpreters/all__sagemath_modules.py +2 -0
  236. sage/ext/interpreters/wrapper_cc.cpython-314-aarch64-linux-musl.so +0 -0
  237. sage/ext/interpreters/wrapper_cc.pxd +30 -0
  238. sage/ext/interpreters/wrapper_cc.pyx +252 -0
  239. sage/ext/interpreters/wrapper_cdf.cpython-314-aarch64-linux-musl.so +0 -0
  240. sage/ext/interpreters/wrapper_cdf.pxd +26 -0
  241. sage/ext/interpreters/wrapper_cdf.pyx +245 -0
  242. sage/ext/interpreters/wrapper_rdf.cpython-314-aarch64-linux-musl.so +0 -0
  243. sage/ext/interpreters/wrapper_rdf.pxd +23 -0
  244. sage/ext/interpreters/wrapper_rdf.pyx +221 -0
  245. sage/ext/interpreters/wrapper_rr.cpython-314-aarch64-linux-musl.so +0 -0
  246. sage/ext/interpreters/wrapper_rr.pxd +28 -0
  247. sage/ext/interpreters/wrapper_rr.pyx +335 -0
  248. sage/geometry/all__sagemath_modules.py +5 -0
  249. sage/geometry/toric_lattice.py +1745 -0
  250. sage/geometry/toric_lattice_element.cpython-314-aarch64-linux-musl.so +0 -0
  251. sage/geometry/toric_lattice_element.pyx +432 -0
  252. sage/groups/abelian_gps/abelian_group.py +1925 -0
  253. sage/groups/abelian_gps/abelian_group_element.py +164 -0
  254. sage/groups/abelian_gps/all__sagemath_modules.py +5 -0
  255. sage/groups/abelian_gps/dual_abelian_group.py +421 -0
  256. sage/groups/abelian_gps/dual_abelian_group_element.py +179 -0
  257. sage/groups/abelian_gps/element_base.py +341 -0
  258. sage/groups/abelian_gps/values.py +488 -0
  259. sage/groups/additive_abelian/additive_abelian_group.py +476 -0
  260. sage/groups/additive_abelian/additive_abelian_wrapper.py +857 -0
  261. sage/groups/additive_abelian/all.py +4 -0
  262. sage/groups/additive_abelian/qmodnz.py +231 -0
  263. sage/groups/additive_abelian/qmodnz_element.py +349 -0
  264. sage/groups/affine_gps/affine_group.py +535 -0
  265. sage/groups/affine_gps/all.py +1 -0
  266. sage/groups/affine_gps/catalog.py +17 -0
  267. sage/groups/affine_gps/euclidean_group.py +246 -0
  268. sage/groups/affine_gps/group_element.py +562 -0
  269. sage/groups/all__sagemath_modules.py +12 -0
  270. sage/groups/galois_group.py +479 -0
  271. sage/groups/matrix_gps/all.py +4 -0
  272. sage/groups/matrix_gps/all__sagemath_modules.py +13 -0
  273. sage/groups/matrix_gps/catalog.py +26 -0
  274. sage/groups/matrix_gps/coxeter_group.py +927 -0
  275. sage/groups/matrix_gps/finitely_generated.py +487 -0
  276. sage/groups/matrix_gps/group_element.cpython-314-aarch64-linux-musl.so +0 -0
  277. sage/groups/matrix_gps/group_element.pxd +11 -0
  278. sage/groups/matrix_gps/group_element.pyx +431 -0
  279. sage/groups/matrix_gps/linear.py +440 -0
  280. sage/groups/matrix_gps/matrix_group.py +617 -0
  281. sage/groups/matrix_gps/named_group.py +296 -0
  282. sage/groups/matrix_gps/orthogonal.py +544 -0
  283. sage/groups/matrix_gps/symplectic.py +251 -0
  284. sage/groups/matrix_gps/unitary.py +436 -0
  285. sage/groups/misc_gps/all__sagemath_modules.py +1 -0
  286. sage/groups/misc_gps/argument_groups.py +1905 -0
  287. sage/groups/misc_gps/imaginary_groups.py +479 -0
  288. sage/groups/perm_gps/all__sagemath_modules.py +1 -0
  289. sage/groups/perm_gps/partn_ref/all__sagemath_modules.py +1 -0
  290. sage/groups/perm_gps/partn_ref/refinement_binary.cpython-314-aarch64-linux-musl.so +0 -0
  291. sage/groups/perm_gps/partn_ref/refinement_binary.pxd +41 -0
  292. sage/groups/perm_gps/partn_ref/refinement_binary.pyx +1167 -0
  293. sage/groups/perm_gps/partn_ref/refinement_matrices.cpython-314-aarch64-linux-musl.so +0 -0
  294. sage/groups/perm_gps/partn_ref/refinement_matrices.pxd +31 -0
  295. sage/groups/perm_gps/partn_ref/refinement_matrices.pyx +385 -0
  296. sage/homology/algebraic_topological_model.py +595 -0
  297. sage/homology/all.py +2 -0
  298. sage/homology/all__sagemath_modules.py +8 -0
  299. sage/homology/chain_complex.py +2148 -0
  300. sage/homology/chain_complex_homspace.py +165 -0
  301. sage/homology/chain_complex_morphism.py +629 -0
  302. sage/homology/chain_homotopy.py +604 -0
  303. sage/homology/chains.py +653 -0
  304. sage/homology/free_resolution.py +923 -0
  305. sage/homology/graded_resolution.py +567 -0
  306. sage/homology/hochschild_complex.py +756 -0
  307. sage/homology/homology_group.py +188 -0
  308. sage/homology/homology_morphism.py +422 -0
  309. sage/homology/homology_vector_space_with_basis.py +1454 -0
  310. sage/homology/koszul_complex.py +169 -0
  311. sage/homology/matrix_utils.py +205 -0
  312. sage/libs/all__sagemath_modules.py +1 -0
  313. sage/libs/gsl/__init__.py +1 -0
  314. sage/libs/gsl/airy.pxd +56 -0
  315. sage/libs/gsl/all.pxd +66 -0
  316. sage/libs/gsl/array.cpython-314-aarch64-linux-musl.so +0 -0
  317. sage/libs/gsl/array.pxd +5 -0
  318. sage/libs/gsl/array.pyx +102 -0
  319. sage/libs/gsl/bessel.pxd +208 -0
  320. sage/libs/gsl/blas.pxd +116 -0
  321. sage/libs/gsl/blas_types.pxd +34 -0
  322. sage/libs/gsl/block.pxd +52 -0
  323. sage/libs/gsl/chebyshev.pxd +37 -0
  324. sage/libs/gsl/clausen.pxd +12 -0
  325. sage/libs/gsl/combination.pxd +47 -0
  326. sage/libs/gsl/complex.pxd +151 -0
  327. sage/libs/gsl/coulomb.pxd +30 -0
  328. sage/libs/gsl/coupling.pxd +21 -0
  329. sage/libs/gsl/dawson.pxd +12 -0
  330. sage/libs/gsl/debye.pxd +24 -0
  331. sage/libs/gsl/dilog.pxd +14 -0
  332. sage/libs/gsl/eigen.pxd +46 -0
  333. sage/libs/gsl/elementary.pxd +12 -0
  334. sage/libs/gsl/ellint.pxd +48 -0
  335. sage/libs/gsl/elljac.pxd +8 -0
  336. sage/libs/gsl/erf.pxd +32 -0
  337. sage/libs/gsl/errno.pxd +26 -0
  338. sage/libs/gsl/exp.pxd +44 -0
  339. sage/libs/gsl/expint.pxd +44 -0
  340. sage/libs/gsl/fermi_dirac.pxd +44 -0
  341. sage/libs/gsl/fft.pxd +121 -0
  342. sage/libs/gsl/fit.pxd +50 -0
  343. sage/libs/gsl/gamma.pxd +94 -0
  344. sage/libs/gsl/gegenbauer.pxd +26 -0
  345. sage/libs/gsl/histogram.pxd +176 -0
  346. sage/libs/gsl/hyperg.pxd +52 -0
  347. sage/libs/gsl/integration.pxd +69 -0
  348. sage/libs/gsl/interp.pxd +109 -0
  349. sage/libs/gsl/laguerre.pxd +24 -0
  350. sage/libs/gsl/lambert.pxd +16 -0
  351. sage/libs/gsl/legendre.pxd +90 -0
  352. sage/libs/gsl/linalg.pxd +185 -0
  353. sage/libs/gsl/log.pxd +26 -0
  354. sage/libs/gsl/math.pxd +43 -0
  355. sage/libs/gsl/matrix.pxd +143 -0
  356. sage/libs/gsl/matrix_complex.pxd +130 -0
  357. sage/libs/gsl/min.pxd +67 -0
  358. sage/libs/gsl/monte.pxd +56 -0
  359. sage/libs/gsl/ntuple.pxd +32 -0
  360. sage/libs/gsl/odeiv.pxd +70 -0
  361. sage/libs/gsl/permutation.pxd +78 -0
  362. sage/libs/gsl/poly.pxd +40 -0
  363. sage/libs/gsl/pow_int.pxd +12 -0
  364. sage/libs/gsl/psi.pxd +28 -0
  365. sage/libs/gsl/qrng.pxd +29 -0
  366. sage/libs/gsl/random.pxd +257 -0
  367. sage/libs/gsl/rng.pxd +100 -0
  368. sage/libs/gsl/roots.pxd +72 -0
  369. sage/libs/gsl/sort.pxd +36 -0
  370. sage/libs/gsl/statistics.pxd +59 -0
  371. sage/libs/gsl/sum.pxd +55 -0
  372. sage/libs/gsl/synchrotron.pxd +16 -0
  373. sage/libs/gsl/transport.pxd +24 -0
  374. sage/libs/gsl/trig.pxd +58 -0
  375. sage/libs/gsl/types.pxd +137 -0
  376. sage/libs/gsl/vector.pxd +101 -0
  377. sage/libs/gsl/vector_complex.pxd +83 -0
  378. sage/libs/gsl/wavelet.pxd +49 -0
  379. sage/libs/gsl/zeta.pxd +28 -0
  380. sage/libs/mpc/__init__.pxd +114 -0
  381. sage/libs/mpc/types.pxd +28 -0
  382. sage/libs/mpfr/__init__.pxd +299 -0
  383. sage/libs/mpfr/types.pxd +26 -0
  384. sage/libs/mpmath/__init__.py +1 -0
  385. sage/libs/mpmath/all.py +27 -0
  386. sage/libs/mpmath/all__sagemath_modules.py +1 -0
  387. sage/libs/mpmath/utils.cpython-314-aarch64-linux-musl.so +0 -0
  388. sage/libs/mpmath/utils.pxd +4 -0
  389. sage/libs/mpmath/utils.pyx +319 -0
  390. sage/matrix/action.cpython-314-aarch64-linux-musl.so +0 -0
  391. sage/matrix/action.pxd +26 -0
  392. sage/matrix/action.pyx +596 -0
  393. sage/matrix/all.py +9 -0
  394. sage/matrix/args.cpython-314-aarch64-linux-musl.so +0 -0
  395. sage/matrix/args.pxd +144 -0
  396. sage/matrix/args.pyx +1668 -0
  397. sage/matrix/benchmark.py +1258 -0
  398. sage/matrix/berlekamp_massey.py +95 -0
  399. sage/matrix/compute_J_ideal.py +926 -0
  400. sage/matrix/constructor.cpython-314-aarch64-linux-musl.so +0 -0
  401. sage/matrix/constructor.pyx +750 -0
  402. sage/matrix/docs.py +430 -0
  403. sage/matrix/echelon_matrix.cpython-314-aarch64-linux-musl.so +0 -0
  404. sage/matrix/echelon_matrix.pyx +155 -0
  405. sage/matrix/matrix.pxd +2 -0
  406. sage/matrix/matrix0.cpython-314-aarch64-linux-musl.so +0 -0
  407. sage/matrix/matrix0.pxd +68 -0
  408. sage/matrix/matrix0.pyx +6324 -0
  409. sage/matrix/matrix1.cpython-314-aarch64-linux-musl.so +0 -0
  410. sage/matrix/matrix1.pxd +8 -0
  411. sage/matrix/matrix1.pyx +2851 -0
  412. sage/matrix/matrix2.cpython-314-aarch64-linux-musl.so +0 -0
  413. sage/matrix/matrix2.pxd +25 -0
  414. sage/matrix/matrix2.pyx +20181 -0
  415. sage/matrix/matrix_cdv.cpython-314-aarch64-linux-musl.so +0 -0
  416. sage/matrix/matrix_cdv.pxd +4 -0
  417. sage/matrix/matrix_cdv.pyx +93 -0
  418. sage/matrix/matrix_complex_double_dense.cpython-314-aarch64-linux-musl.so +0 -0
  419. sage/matrix/matrix_complex_double_dense.pxd +5 -0
  420. sage/matrix/matrix_complex_double_dense.pyx +98 -0
  421. sage/matrix/matrix_dense.cpython-314-aarch64-linux-musl.so +0 -0
  422. sage/matrix/matrix_dense.pxd +5 -0
  423. sage/matrix/matrix_dense.pyx +343 -0
  424. sage/matrix/matrix_domain_dense.pxd +5 -0
  425. sage/matrix/matrix_domain_sparse.pxd +5 -0
  426. sage/matrix/matrix_double_dense.cpython-314-aarch64-linux-musl.so +0 -0
  427. sage/matrix/matrix_double_dense.pxd +7 -0
  428. sage/matrix/matrix_double_dense.pyx +3906 -0
  429. sage/matrix/matrix_double_sparse.cpython-314-aarch64-linux-musl.so +0 -0
  430. sage/matrix/matrix_double_sparse.pxd +6 -0
  431. sage/matrix/matrix_double_sparse.pyx +248 -0
  432. sage/matrix/matrix_generic_dense.cpython-314-aarch64-linux-musl.so +0 -0
  433. sage/matrix/matrix_generic_dense.pxd +7 -0
  434. sage/matrix/matrix_generic_dense.pyx +354 -0
  435. sage/matrix/matrix_generic_sparse.cpython-314-aarch64-linux-musl.so +0 -0
  436. sage/matrix/matrix_generic_sparse.pxd +7 -0
  437. sage/matrix/matrix_generic_sparse.pyx +461 -0
  438. sage/matrix/matrix_laurent_mpolynomial_dense.cpython-314-aarch64-linux-musl.so +0 -0
  439. sage/matrix/matrix_laurent_mpolynomial_dense.pxd +5 -0
  440. sage/matrix/matrix_laurent_mpolynomial_dense.pyx +115 -0
  441. sage/matrix/matrix_misc.py +313 -0
  442. sage/matrix/matrix_numpy_dense.cpython-314-aarch64-linux-musl.so +0 -0
  443. sage/matrix/matrix_numpy_dense.pxd +14 -0
  444. sage/matrix/matrix_numpy_dense.pyx +450 -0
  445. sage/matrix/matrix_numpy_integer_dense.cpython-314-aarch64-linux-musl.so +0 -0
  446. sage/matrix/matrix_numpy_integer_dense.pxd +7 -0
  447. sage/matrix/matrix_numpy_integer_dense.pyx +59 -0
  448. sage/matrix/matrix_polynomial_dense.cpython-314-aarch64-linux-musl.so +0 -0
  449. sage/matrix/matrix_polynomial_dense.pxd +5 -0
  450. sage/matrix/matrix_polynomial_dense.pyx +5341 -0
  451. sage/matrix/matrix_real_double_dense.cpython-314-aarch64-linux-musl.so +0 -0
  452. sage/matrix/matrix_real_double_dense.pxd +7 -0
  453. sage/matrix/matrix_real_double_dense.pyx +122 -0
  454. sage/matrix/matrix_space.py +2848 -0
  455. sage/matrix/matrix_sparse.cpython-314-aarch64-linux-musl.so +0 -0
  456. sage/matrix/matrix_sparse.pxd +5 -0
  457. sage/matrix/matrix_sparse.pyx +1222 -0
  458. sage/matrix/matrix_window.cpython-314-aarch64-linux-musl.so +0 -0
  459. sage/matrix/matrix_window.pxd +37 -0
  460. sage/matrix/matrix_window.pyx +242 -0
  461. sage/matrix/misc_mpfr.cpython-314-aarch64-linux-musl.so +0 -0
  462. sage/matrix/misc_mpfr.pyx +80 -0
  463. sage/matrix/operation_table.py +1182 -0
  464. sage/matrix/special.py +3666 -0
  465. sage/matrix/strassen.cpython-314-aarch64-linux-musl.so +0 -0
  466. sage/matrix/strassen.pyx +851 -0
  467. sage/matrix/symplectic_basis.py +541 -0
  468. sage/matrix/template.pxd +6 -0
  469. sage/matrix/tests.py +71 -0
  470. sage/matroids/advanced.py +77 -0
  471. sage/matroids/all.py +13 -0
  472. sage/matroids/basis_exchange_matroid.cpython-314-aarch64-linux-musl.so +0 -0
  473. sage/matroids/basis_exchange_matroid.pxd +96 -0
  474. sage/matroids/basis_exchange_matroid.pyx +2344 -0
  475. sage/matroids/basis_matroid.cpython-314-aarch64-linux-musl.so +0 -0
  476. sage/matroids/basis_matroid.pxd +45 -0
  477. sage/matroids/basis_matroid.pyx +1217 -0
  478. sage/matroids/catalog.py +44 -0
  479. sage/matroids/chow_ring.py +473 -0
  480. sage/matroids/chow_ring_ideal.py +849 -0
  481. sage/matroids/circuit_closures_matroid.cpython-314-aarch64-linux-musl.so +0 -0
  482. sage/matroids/circuit_closures_matroid.pxd +16 -0
  483. sage/matroids/circuit_closures_matroid.pyx +559 -0
  484. sage/matroids/circuits_matroid.cpython-314-aarch64-linux-musl.so +0 -0
  485. sage/matroids/circuits_matroid.pxd +38 -0
  486. sage/matroids/circuits_matroid.pyx +947 -0
  487. sage/matroids/constructor.py +1086 -0
  488. sage/matroids/database_collections.py +365 -0
  489. sage/matroids/database_matroids.py +5338 -0
  490. sage/matroids/dual_matroid.py +583 -0
  491. sage/matroids/extension.cpython-314-aarch64-linux-musl.so +0 -0
  492. sage/matroids/extension.pxd +34 -0
  493. sage/matroids/extension.pyx +519 -0
  494. sage/matroids/flats_matroid.cpython-314-aarch64-linux-musl.so +0 -0
  495. sage/matroids/flats_matroid.pxd +28 -0
  496. sage/matroids/flats_matroid.pyx +715 -0
  497. sage/matroids/gammoid.py +600 -0
  498. sage/matroids/graphic_matroid.cpython-314-aarch64-linux-musl.so +0 -0
  499. sage/matroids/graphic_matroid.pxd +39 -0
  500. sage/matroids/graphic_matroid.pyx +2024 -0
  501. sage/matroids/lean_matrix.cpython-314-aarch64-linux-musl.so +0 -0
  502. sage/matroids/lean_matrix.pxd +126 -0
  503. sage/matroids/lean_matrix.pyx +3667 -0
  504. sage/matroids/linear_matroid.cpython-314-aarch64-linux-musl.so +0 -0
  505. sage/matroids/linear_matroid.pxd +180 -0
  506. sage/matroids/linear_matroid.pyx +6649 -0
  507. sage/matroids/matroid.cpython-314-aarch64-linux-musl.so +0 -0
  508. sage/matroids/matroid.pxd +243 -0
  509. sage/matroids/matroid.pyx +8759 -0
  510. sage/matroids/matroids_catalog.py +190 -0
  511. sage/matroids/matroids_plot_helpers.py +890 -0
  512. sage/matroids/minor_matroid.py +480 -0
  513. sage/matroids/minorfix.h +9 -0
  514. sage/matroids/named_matroids.py +5 -0
  515. sage/matroids/rank_matroid.py +268 -0
  516. sage/matroids/set_system.cpython-314-aarch64-linux-musl.so +0 -0
  517. sage/matroids/set_system.pxd +38 -0
  518. sage/matroids/set_system.pyx +800 -0
  519. sage/matroids/transversal_matroid.cpython-314-aarch64-linux-musl.so +0 -0
  520. sage/matroids/transversal_matroid.pxd +14 -0
  521. sage/matroids/transversal_matroid.pyx +893 -0
  522. sage/matroids/union_matroid.cpython-314-aarch64-linux-musl.so +0 -0
  523. sage/matroids/union_matroid.pxd +20 -0
  524. sage/matroids/union_matroid.pyx +331 -0
  525. sage/matroids/unpickling.cpython-314-aarch64-linux-musl.so +0 -0
  526. sage/matroids/unpickling.pyx +843 -0
  527. sage/matroids/utilities.py +809 -0
  528. sage/misc/all__sagemath_modules.py +20 -0
  529. sage/misc/c3.cpython-314-aarch64-linux-musl.so +0 -0
  530. sage/misc/c3.pyx +238 -0
  531. sage/misc/compat.py +87 -0
  532. sage/misc/element_with_label.py +173 -0
  533. sage/misc/func_persist.py +79 -0
  534. sage/misc/pickle_old.cpython-314-aarch64-linux-musl.so +0 -0
  535. sage/misc/pickle_old.pyx +19 -0
  536. sage/misc/proof.py +7 -0
  537. sage/misc/replace_dot_all.py +472 -0
  538. sage/misc/sagedoc_conf.py +168 -0
  539. sage/misc/sphinxify.py +167 -0
  540. sage/misc/test_class_pickling.py +85 -0
  541. sage/modules/all.py +42 -0
  542. sage/modules/complex_double_vector.py +25 -0
  543. sage/modules/diamond_cutting.py +380 -0
  544. sage/modules/fg_pid/all.py +1 -0
  545. sage/modules/fg_pid/fgp_element.py +456 -0
  546. sage/modules/fg_pid/fgp_module.py +2091 -0
  547. sage/modules/fg_pid/fgp_morphism.py +550 -0
  548. sage/modules/filtered_vector_space.py +1271 -0
  549. sage/modules/finite_submodule_iter.cpython-314-aarch64-linux-musl.so +0 -0
  550. sage/modules/finite_submodule_iter.pxd +27 -0
  551. sage/modules/finite_submodule_iter.pyx +452 -0
  552. sage/modules/fp_graded/all.py +1 -0
  553. sage/modules/fp_graded/element.py +346 -0
  554. sage/modules/fp_graded/free_element.py +298 -0
  555. sage/modules/fp_graded/free_homspace.py +53 -0
  556. sage/modules/fp_graded/free_module.py +1060 -0
  557. sage/modules/fp_graded/free_morphism.py +217 -0
  558. sage/modules/fp_graded/homspace.py +563 -0
  559. sage/modules/fp_graded/module.py +1340 -0
  560. sage/modules/fp_graded/morphism.py +1990 -0
  561. sage/modules/fp_graded/steenrod/all.py +1 -0
  562. sage/modules/fp_graded/steenrod/homspace.py +65 -0
  563. sage/modules/fp_graded/steenrod/module.py +477 -0
  564. sage/modules/fp_graded/steenrod/morphism.py +404 -0
  565. sage/modules/fp_graded/steenrod/profile.py +241 -0
  566. sage/modules/free_module.py +8447 -0
  567. sage/modules/free_module_element.cpython-314-aarch64-linux-musl.so +0 -0
  568. sage/modules/free_module_element.pxd +22 -0
  569. sage/modules/free_module_element.pyx +5445 -0
  570. sage/modules/free_module_homspace.py +369 -0
  571. sage/modules/free_module_integer.py +896 -0
  572. sage/modules/free_module_morphism.py +823 -0
  573. sage/modules/free_module_pseudohomspace.py +352 -0
  574. sage/modules/free_module_pseudomorphism.py +578 -0
  575. sage/modules/free_quadratic_module.py +1706 -0
  576. sage/modules/free_quadratic_module_integer_symmetric.py +1790 -0
  577. sage/modules/matrix_morphism.py +1745 -0
  578. sage/modules/misc.py +103 -0
  579. sage/modules/module_functors.py +192 -0
  580. sage/modules/multi_filtered_vector_space.py +719 -0
  581. sage/modules/ore_module.py +2208 -0
  582. sage/modules/ore_module_element.py +178 -0
  583. sage/modules/ore_module_homspace.py +147 -0
  584. sage/modules/ore_module_morphism.py +968 -0
  585. sage/modules/quotient_module.py +699 -0
  586. sage/modules/real_double_vector.py +22 -0
  587. sage/modules/submodule.py +255 -0
  588. sage/modules/tensor_operations.py +567 -0
  589. sage/modules/torsion_quadratic_module.py +1352 -0
  590. sage/modules/tutorial_free_modules.py +248 -0
  591. sage/modules/vector_complex_double_dense.cpython-314-aarch64-linux-musl.so +0 -0
  592. sage/modules/vector_complex_double_dense.pxd +6 -0
  593. sage/modules/vector_complex_double_dense.pyx +117 -0
  594. sage/modules/vector_double_dense.cpython-314-aarch64-linux-musl.so +0 -0
  595. sage/modules/vector_double_dense.pxd +6 -0
  596. sage/modules/vector_double_dense.pyx +604 -0
  597. sage/modules/vector_integer_dense.cpython-314-aarch64-linux-musl.so +0 -0
  598. sage/modules/vector_integer_dense.pxd +15 -0
  599. sage/modules/vector_integer_dense.pyx +361 -0
  600. sage/modules/vector_integer_sparse.cpython-314-aarch64-linux-musl.so +0 -0
  601. sage/modules/vector_integer_sparse.pxd +29 -0
  602. sage/modules/vector_integer_sparse.pyx +406 -0
  603. sage/modules/vector_modn_dense.cpython-314-aarch64-linux-musl.so +0 -0
  604. sage/modules/vector_modn_dense.pxd +12 -0
  605. sage/modules/vector_modn_dense.pyx +394 -0
  606. sage/modules/vector_modn_sparse.cpython-314-aarch64-linux-musl.so +0 -0
  607. sage/modules/vector_modn_sparse.pxd +21 -0
  608. sage/modules/vector_modn_sparse.pyx +298 -0
  609. sage/modules/vector_numpy_dense.cpython-314-aarch64-linux-musl.so +0 -0
  610. sage/modules/vector_numpy_dense.pxd +15 -0
  611. sage/modules/vector_numpy_dense.pyx +304 -0
  612. sage/modules/vector_numpy_integer_dense.cpython-314-aarch64-linux-musl.so +0 -0
  613. sage/modules/vector_numpy_integer_dense.pxd +7 -0
  614. sage/modules/vector_numpy_integer_dense.pyx +54 -0
  615. sage/modules/vector_rational_dense.cpython-314-aarch64-linux-musl.so +0 -0
  616. sage/modules/vector_rational_dense.pxd +15 -0
  617. sage/modules/vector_rational_dense.pyx +387 -0
  618. sage/modules/vector_rational_sparse.cpython-314-aarch64-linux-musl.so +0 -0
  619. sage/modules/vector_rational_sparse.pxd +30 -0
  620. sage/modules/vector_rational_sparse.pyx +413 -0
  621. sage/modules/vector_real_double_dense.cpython-314-aarch64-linux-musl.so +0 -0
  622. sage/modules/vector_real_double_dense.pxd +6 -0
  623. sage/modules/vector_real_double_dense.pyx +126 -0
  624. sage/modules/vector_space_homspace.py +430 -0
  625. sage/modules/vector_space_morphism.py +989 -0
  626. sage/modules/with_basis/all.py +15 -0
  627. sage/modules/with_basis/cell_module.py +494 -0
  628. sage/modules/with_basis/indexed_element.cpython-314-aarch64-linux-musl.so +0 -0
  629. sage/modules/with_basis/indexed_element.pxd +13 -0
  630. sage/modules/with_basis/indexed_element.pyx +1058 -0
  631. sage/modules/with_basis/invariant.py +1075 -0
  632. sage/modules/with_basis/morphism.py +1636 -0
  633. sage/modules/with_basis/representation.py +2939 -0
  634. sage/modules/with_basis/subquotient.py +685 -0
  635. sage/numerical/all__sagemath_modules.py +6 -0
  636. sage/numerical/gauss_legendre.cpython-314-aarch64-linux-musl.so +0 -0
  637. sage/numerical/gauss_legendre.pyx +381 -0
  638. sage/numerical/optimize.py +910 -0
  639. sage/probability/all.py +10 -0
  640. sage/probability/probability_distribution.cpython-314-aarch64-linux-musl.so +0 -0
  641. sage/probability/probability_distribution.pyx +1242 -0
  642. sage/probability/random_variable.py +411 -0
  643. sage/quadratic_forms/all.py +4 -0
  644. sage/quadratic_forms/all__sagemath_modules.py +15 -0
  645. sage/quadratic_forms/binary_qf.py +2042 -0
  646. sage/quadratic_forms/bqf_class_group.py +748 -0
  647. sage/quadratic_forms/constructions.py +93 -0
  648. sage/quadratic_forms/count_local_2.cpython-314-aarch64-linux-musl.so +0 -0
  649. sage/quadratic_forms/count_local_2.pyx +365 -0
  650. sage/quadratic_forms/extras.py +195 -0
  651. sage/quadratic_forms/quadratic_form.py +1753 -0
  652. sage/quadratic_forms/quadratic_form__count_local_2.py +221 -0
  653. sage/quadratic_forms/quadratic_form__equivalence_testing.py +708 -0
  654. sage/quadratic_forms/quadratic_form__evaluate.cpython-314-aarch64-linux-musl.so +0 -0
  655. sage/quadratic_forms/quadratic_form__evaluate.pyx +139 -0
  656. sage/quadratic_forms/quadratic_form__local_density_congruence.py +977 -0
  657. sage/quadratic_forms/quadratic_form__local_field_invariants.py +1072 -0
  658. sage/quadratic_forms/quadratic_form__neighbors.py +424 -0
  659. sage/quadratic_forms/quadratic_form__reduction_theory.py +488 -0
  660. sage/quadratic_forms/quadratic_form__split_local_covering.py +416 -0
  661. sage/quadratic_forms/quadratic_form__ternary_Tornaria.py +657 -0
  662. sage/quadratic_forms/quadratic_form__theta.py +352 -0
  663. sage/quadratic_forms/quadratic_form__variable_substitutions.py +370 -0
  664. sage/quadratic_forms/random_quadraticform.py +209 -0
  665. sage/quadratic_forms/ternary.cpython-314-aarch64-linux-musl.so +0 -0
  666. sage/quadratic_forms/ternary.pyx +1154 -0
  667. sage/quadratic_forms/ternary_qf.py +2027 -0
  668. sage/rings/all__sagemath_modules.py +28 -0
  669. sage/rings/asymptotic/all__sagemath_modules.py +1 -0
  670. sage/rings/asymptotic/misc.py +1252 -0
  671. sage/rings/cc.py +4 -0
  672. sage/rings/cfinite_sequence.py +1306 -0
  673. sage/rings/complex_conversion.cpython-314-aarch64-linux-musl.so +0 -0
  674. sage/rings/complex_conversion.pxd +8 -0
  675. sage/rings/complex_conversion.pyx +23 -0
  676. sage/rings/complex_double.cpython-314-aarch64-linux-musl.so +0 -0
  677. sage/rings/complex_double.pxd +21 -0
  678. sage/rings/complex_double.pyx +2654 -0
  679. sage/rings/complex_mpc.cpython-314-aarch64-linux-musl.so +0 -0
  680. sage/rings/complex_mpc.pxd +21 -0
  681. sage/rings/complex_mpc.pyx +2576 -0
  682. sage/rings/complex_mpfr.cpython-314-aarch64-linux-musl.so +0 -0
  683. sage/rings/complex_mpfr.pxd +18 -0
  684. sage/rings/complex_mpfr.pyx +3602 -0
  685. sage/rings/derivation.py +2334 -0
  686. sage/rings/finite_rings/all__sagemath_modules.py +1 -0
  687. sage/rings/finite_rings/maps_finite_field.py +191 -0
  688. sage/rings/function_field/all__sagemath_modules.py +8 -0
  689. sage/rings/function_field/derivations.py +102 -0
  690. sage/rings/function_field/derivations_rational.py +132 -0
  691. sage/rings/function_field/differential.py +853 -0
  692. sage/rings/function_field/divisor.py +1107 -0
  693. sage/rings/function_field/drinfeld_modules/action.py +199 -0
  694. sage/rings/function_field/drinfeld_modules/all.py +1 -0
  695. sage/rings/function_field/drinfeld_modules/charzero_drinfeld_module.py +673 -0
  696. sage/rings/function_field/drinfeld_modules/drinfeld_module.py +2087 -0
  697. sage/rings/function_field/drinfeld_modules/finite_drinfeld_module.py +1131 -0
  698. sage/rings/function_field/drinfeld_modules/homset.py +420 -0
  699. sage/rings/function_field/drinfeld_modules/morphism.py +820 -0
  700. sage/rings/function_field/hermite_form_polynomial.cpython-314-aarch64-linux-musl.so +0 -0
  701. sage/rings/function_field/hermite_form_polynomial.pyx +188 -0
  702. sage/rings/function_field/khuri_makdisi.cpython-314-aarch64-linux-musl.so +0 -0
  703. sage/rings/function_field/khuri_makdisi.pyx +935 -0
  704. sage/rings/invariants/all.py +4 -0
  705. sage/rings/invariants/invariant_theory.py +4597 -0
  706. sage/rings/invariants/reconstruction.py +395 -0
  707. sage/rings/polynomial/all__sagemath_modules.py +17 -0
  708. sage/rings/polynomial/integer_valued_polynomials.py +1230 -0
  709. sage/rings/polynomial/laurent_polynomial_mpair.cpython-314-aarch64-linux-musl.so +0 -0
  710. sage/rings/polynomial/laurent_polynomial_mpair.pxd +15 -0
  711. sage/rings/polynomial/laurent_polynomial_mpair.pyx +2023 -0
  712. sage/rings/polynomial/ore_function_element.py +952 -0
  713. sage/rings/polynomial/ore_function_field.py +1028 -0
  714. sage/rings/polynomial/ore_polynomial_element.cpython-314-aarch64-linux-musl.so +0 -0
  715. sage/rings/polynomial/ore_polynomial_element.pxd +48 -0
  716. sage/rings/polynomial/ore_polynomial_element.pyx +3145 -0
  717. sage/rings/polynomial/ore_polynomial_ring.py +1334 -0
  718. sage/rings/polynomial/polynomial_real_mpfr_dense.cpython-314-aarch64-linux-musl.so +0 -0
  719. sage/rings/polynomial/polynomial_real_mpfr_dense.pyx +788 -0
  720. sage/rings/polynomial/q_integer_valued_polynomials.py +1264 -0
  721. sage/rings/polynomial/skew_polynomial_element.cpython-314-aarch64-linux-musl.so +0 -0
  722. sage/rings/polynomial/skew_polynomial_element.pxd +9 -0
  723. sage/rings/polynomial/skew_polynomial_element.pyx +684 -0
  724. sage/rings/polynomial/skew_polynomial_finite_field.cpython-314-aarch64-linux-musl.so +0 -0
  725. sage/rings/polynomial/skew_polynomial_finite_field.pxd +19 -0
  726. sage/rings/polynomial/skew_polynomial_finite_field.pyx +1093 -0
  727. sage/rings/polynomial/skew_polynomial_finite_order.cpython-314-aarch64-linux-musl.so +0 -0
  728. sage/rings/polynomial/skew_polynomial_finite_order.pxd +10 -0
  729. sage/rings/polynomial/skew_polynomial_finite_order.pyx +567 -0
  730. sage/rings/polynomial/skew_polynomial_ring.py +908 -0
  731. sage/rings/real_double_element_gsl.cpython-314-aarch64-linux-musl.so +0 -0
  732. sage/rings/real_double_element_gsl.pxd +8 -0
  733. sage/rings/real_double_element_gsl.pyx +794 -0
  734. sage/rings/real_field.py +58 -0
  735. sage/rings/real_mpfr.cpython-314-aarch64-linux-musl.so +0 -0
  736. sage/rings/real_mpfr.pxd +29 -0
  737. sage/rings/real_mpfr.pyx +6122 -0
  738. sage/rings/ring_extension.cpython-314-aarch64-linux-musl.so +0 -0
  739. sage/rings/ring_extension.pxd +42 -0
  740. sage/rings/ring_extension.pyx +2779 -0
  741. sage/rings/ring_extension_conversion.cpython-314-aarch64-linux-musl.so +0 -0
  742. sage/rings/ring_extension_conversion.pxd +16 -0
  743. sage/rings/ring_extension_conversion.pyx +462 -0
  744. sage/rings/ring_extension_element.cpython-314-aarch64-linux-musl.so +0 -0
  745. sage/rings/ring_extension_element.pxd +21 -0
  746. sage/rings/ring_extension_element.pyx +1635 -0
  747. sage/rings/ring_extension_homset.py +64 -0
  748. sage/rings/ring_extension_morphism.cpython-314-aarch64-linux-musl.so +0 -0
  749. sage/rings/ring_extension_morphism.pxd +35 -0
  750. sage/rings/ring_extension_morphism.pyx +920 -0
  751. sage/schemes/all__sagemath_modules.py +1 -0
  752. sage/schemes/projective/all__sagemath_modules.py +1 -0
  753. sage/schemes/projective/coherent_sheaf.py +300 -0
  754. sage/schemes/projective/cohomology.py +510 -0
  755. sage/stats/all.py +15 -0
  756. sage/stats/basic_stats.py +489 -0
  757. sage/stats/distributions/all.py +7 -0
  758. sage/stats/distributions/catalog.py +34 -0
  759. sage/stats/distributions/dgs.h +50 -0
  760. sage/stats/distributions/dgs.pxd +111 -0
  761. sage/stats/distributions/dgs_bern.h +400 -0
  762. sage/stats/distributions/dgs_gauss.h +614 -0
  763. sage/stats/distributions/dgs_misc.h +104 -0
  764. sage/stats/distributions/discrete_gaussian_integer.cpython-314-aarch64-linux-musl.so +0 -0
  765. sage/stats/distributions/discrete_gaussian_integer.pxd +14 -0
  766. sage/stats/distributions/discrete_gaussian_integer.pyx +498 -0
  767. sage/stats/distributions/discrete_gaussian_lattice.py +908 -0
  768. sage/stats/distributions/discrete_gaussian_polynomial.py +141 -0
  769. sage/stats/hmm/all.py +15 -0
  770. sage/stats/hmm/chmm.cpython-314-aarch64-linux-musl.so +0 -0
  771. sage/stats/hmm/chmm.pyx +1595 -0
  772. sage/stats/hmm/distributions.cpython-314-aarch64-linux-musl.so +0 -0
  773. sage/stats/hmm/distributions.pxd +29 -0
  774. sage/stats/hmm/distributions.pyx +531 -0
  775. sage/stats/hmm/hmm.cpython-314-aarch64-linux-musl.so +0 -0
  776. sage/stats/hmm/hmm.pxd +17 -0
  777. sage/stats/hmm/hmm.pyx +1388 -0
  778. sage/stats/hmm/util.cpython-314-aarch64-linux-musl.so +0 -0
  779. sage/stats/hmm/util.pxd +7 -0
  780. sage/stats/hmm/util.pyx +165 -0
  781. sage/stats/intlist.cpython-314-aarch64-linux-musl.so +0 -0
  782. sage/stats/intlist.pxd +14 -0
  783. sage/stats/intlist.pyx +588 -0
  784. sage/stats/r.py +49 -0
  785. sage/stats/time_series.cpython-314-aarch64-linux-musl.so +0 -0
  786. sage/stats/time_series.pxd +6 -0
  787. sage/stats/time_series.pyx +2546 -0
  788. sage/tensor/all.py +2 -0
  789. sage/tensor/modules/all.py +8 -0
  790. sage/tensor/modules/alternating_contr_tensor.py +761 -0
  791. sage/tensor/modules/comp.py +5598 -0
  792. sage/tensor/modules/ext_pow_free_module.py +824 -0
  793. sage/tensor/modules/finite_rank_free_module.py +3589 -0
  794. sage/tensor/modules/format_utilities.py +333 -0
  795. sage/tensor/modules/free_module_alt_form.py +858 -0
  796. sage/tensor/modules/free_module_automorphism.py +1207 -0
  797. sage/tensor/modules/free_module_basis.py +1074 -0
  798. sage/tensor/modules/free_module_element.py +284 -0
  799. sage/tensor/modules/free_module_homset.py +652 -0
  800. sage/tensor/modules/free_module_linear_group.py +564 -0
  801. sage/tensor/modules/free_module_morphism.py +1581 -0
  802. sage/tensor/modules/free_module_tensor.py +3289 -0
  803. sage/tensor/modules/reflexive_module.py +386 -0
  804. sage/tensor/modules/tensor_free_module.py +780 -0
  805. sage/tensor/modules/tensor_free_submodule.py +538 -0
  806. sage/tensor/modules/tensor_free_submodule_basis.py +140 -0
  807. sage/tensor/modules/tensor_with_indices.py +1043 -0
@@ -0,0 +1,2516 @@
1
+ # sage_setup: distribution = sagemath-modules
2
+ # sage.doctest: needs sage.graphs
3
+ """
4
+ Classical Lie Algebras
5
+
6
+ These are the Lie algebras corresponding to types `A_n`, `B_n`, `C_n`,
7
+ and `D_n`. We also include support for the exceptional types
8
+ `E_{6,7,8}`, `F_4`, and `G_2` in the Chevalley basis, and we
9
+ give the matrix representation given in [HRT2000]_.
10
+
11
+ AUTHORS:
12
+
13
+ - Travis Scrimshaw (2013-05-03): Initial version
14
+ - Sebastian Oehms (2018-03-18): matrix method of the element class
15
+ of ClassicalMatrixLieAlgebra added
16
+ - Travis Scrimshaw (2019-07-09): Implemented compact real form
17
+ """
18
+
19
+ # ****************************************************************************
20
+ # Copyright (C) 2013-2017 Travis Scrimshaw <tcscrims at gmail.com>
21
+ #
22
+ # This program is free software: you can redistribute it and/or modify
23
+ # it under the terms of the GNU General Public License as published by
24
+ # the Free Software Foundation, either version 2 of the License, or
25
+ # (at your option) any later version.
26
+ # https://www.gnu.org/licenses/
27
+ # ****************************************************************************
28
+ from collections import OrderedDict
29
+
30
+ from sage.misc.abstract_method import abstract_method
31
+ from sage.misc.cachefunc import cached_method
32
+ from sage.structure.indexed_generators import IndexedGenerators
33
+ from sage.structure.element import Element
34
+ from sage.structure.richcmp import richcmp
35
+ from sage.categories.lie_algebras import LieAlgebras
36
+ from sage.categories.triangular_kac_moody_algebras import TriangularKacMoodyAlgebras
37
+
38
+ from sage.algebras.lie_algebras.lie_algebra import MatrixLieAlgebraFromAssociative, FinitelyGeneratedLieAlgebra
39
+ from sage.algebras.lie_algebras.structure_coefficients import LieAlgebraWithStructureCoefficients
40
+ from sage.combinat.root_system.cartan_type import CartanType
41
+ from sage.combinat.root_system.cartan_matrix import CartanMatrix
42
+ from sage.combinat.root_system.dynkin_diagram import DynkinDiagram_class
43
+ from sage.matrix.matrix_space import MatrixSpace
44
+ from sage.sets.family import Family
45
+ from sage.modules.free_module import FreeModule
46
+
47
+
48
+ class ClassicalMatrixLieAlgebra(MatrixLieAlgebraFromAssociative):
49
+ """
50
+ A classical Lie algebra represented using matrices.
51
+
52
+ This means a classical Lie algebra given as a Lie
53
+ algebra of matrices, with commutator as Lie bracket.
54
+
55
+ INPUT:
56
+
57
+ - ``R`` -- the base ring
58
+ - ``ct`` -- the finite Cartan type
59
+
60
+ EXAMPLES::
61
+
62
+ sage: lie_algebras.ClassicalMatrix(QQ, ['A', 4])
63
+ Special linear Lie algebra of rank 5 over Rational Field
64
+ sage: lie_algebras.ClassicalMatrix(QQ, CartanType(['B',4]))
65
+ Special orthogonal Lie algebra of rank 9 over Rational Field
66
+ sage: lie_algebras.ClassicalMatrix(QQ, 'C4')
67
+ Symplectic Lie algebra of rank 8 over Rational Field
68
+ sage: lie_algebras.ClassicalMatrix(QQ, cartan_type=['D',4])
69
+ Special orthogonal Lie algebra of rank 8 over Rational Field
70
+ """
71
+ @staticmethod
72
+ def __classcall_private__(cls, R, cartan_type):
73
+ """
74
+ Return the correct parent based on input.
75
+
76
+ EXAMPLES::
77
+
78
+ sage: lie_algebras.ClassicalMatrix(QQ, ['A', 4])
79
+ Special linear Lie algebra of rank 5 over Rational Field
80
+ sage: lie_algebras.ClassicalMatrix(QQ, CartanType(['B',4]))
81
+ Special orthogonal Lie algebra of rank 9 over Rational Field
82
+ sage: lie_algebras.ClassicalMatrix(QQ, 'C4')
83
+ Symplectic Lie algebra of rank 8 over Rational Field
84
+ sage: lie_algebras.ClassicalMatrix(QQ, cartan_type=['D',4])
85
+ Special orthogonal Lie algebra of rank 8 over Rational Field
86
+ """
87
+ if isinstance(cartan_type, (CartanMatrix, DynkinDiagram_class)):
88
+ cartan_type = cartan_type.cartan_type()
89
+ else:
90
+ cartan_type = CartanType(cartan_type)
91
+
92
+ if not cartan_type.is_finite():
93
+ raise ValueError("only for finite types")
94
+
95
+ if cartan_type.type() == 'A':
96
+ return sl(R, cartan_type.rank() + 1)
97
+ if cartan_type.type() == 'B':
98
+ return so(R, 2*cartan_type.rank() + 1)
99
+ if cartan_type.type() == 'C':
100
+ return sp(R, 2*cartan_type.rank())
101
+ if cartan_type.type() == 'D':
102
+ return so(R, 2*cartan_type.rank())
103
+ if cartan_type.type() == 'E':
104
+ if cartan_type.rank() == 6:
105
+ return e6(R)
106
+ if cartan_type.rank() == 7:
107
+ return e7(R)
108
+ if cartan_type.rank() == 8:
109
+ return e8(R)
110
+ if cartan_type.type() == 'F' and cartan_type.rank() == 4:
111
+ return f4(R)
112
+ if cartan_type.type() == 'G' and cartan_type.rank() == 2:
113
+ return g2(R)
114
+ raise ValueError("invalid Cartan type")
115
+
116
+ def __init__(self, R, ct, e, f, h, sparse=True):
117
+ """
118
+ Initialize ``self``.
119
+
120
+ INPUT:
121
+
122
+ - ``R`` -- the base ring
123
+ - ``ct`` -- the Cartan type
124
+ - ``e`` -- the `e` generators
125
+ - ``f`` -- the `f` generators
126
+ - ``h`` -- the `h` generators
127
+ - ``sparse`` -- boolean (default: ``True``); use the sparse vectors
128
+ for the basis computation
129
+
130
+ EXAMPLES::
131
+
132
+ sage: g = lie_algebras.sl(QQ, 3, representation='matrix')
133
+ sage: TestSuite(g).run()
134
+
135
+ TESTS:
136
+
137
+ Check that :issue:`23266` is fixed::
138
+
139
+ sage: sl2 = lie_algebras.sl(QQ, 2, 'matrix')
140
+ sage: isinstance(sl2.indices(), FiniteEnumeratedSet)
141
+ True
142
+
143
+ Check that elements are hashable (see :issue:`28961`)::
144
+
145
+ sage: sl2 = lie_algebras.sl(QQ, 2, 'matrix')
146
+ sage: e,f,h = list(sl2.basis())
147
+ sage: len(set([e, e+f]))
148
+ 2
149
+ """
150
+ n = len(e)
151
+ I = ct.index_set()
152
+ names = ['e%s' % i for i in I]
153
+ names += ['f%s' % i for i in I]
154
+ names += ['h%s' % i for i in I]
155
+ category = LieAlgebras(R).FiniteDimensional().WithBasis()
156
+ from sage.sets.finite_enumerated_set import FiniteEnumeratedSet
157
+ index_set = FiniteEnumeratedSet(names)
158
+ MatrixLieAlgebraFromAssociative.__init__(self, e[0].parent(),
159
+ gens=tuple(e + f + h),
160
+ names=tuple(names),
161
+ index_set=index_set,
162
+ category=category)
163
+ self._cartan_type = ct
164
+ self._sparse = sparse
165
+
166
+ gens = tuple(self.gens())
167
+ self._e = Family({i: gens[c] for c, i in enumerate(I)})
168
+ self._f = Family({i: gens[n+c] for c, i in enumerate(I)})
169
+ self._h = Family({i: gens[2*n+c] for c, i in enumerate(I)})
170
+
171
+ def e(self, i):
172
+ r"""
173
+ Return the generator `e_i`.
174
+
175
+ EXAMPLES::
176
+
177
+ sage: g = lie_algebras.sl(QQ, 3, representation='matrix')
178
+ sage: g.e(2)
179
+ [0 0 0]
180
+ [0 0 1]
181
+ [0 0 0]
182
+ """
183
+ return self._e[i]
184
+
185
+ def f(self, i):
186
+ r"""
187
+ Return the generator `f_i`.
188
+
189
+ EXAMPLES::
190
+
191
+ sage: g = lie_algebras.sl(QQ, 3, representation='matrix')
192
+ sage: g.f(2)
193
+ [0 0 0]
194
+ [0 0 0]
195
+ [0 1 0]
196
+ """
197
+ return self._f[i]
198
+
199
+ def h(self, i):
200
+ """
201
+ Return the generator `h_i`.
202
+
203
+ EXAMPLES::
204
+
205
+ sage: g = lie_algebras.sl(QQ, 3, representation='matrix')
206
+ sage: g.h(2)
207
+ [ 0 0 0]
208
+ [ 0 1 0]
209
+ [ 0 0 -1]
210
+ """
211
+ return self._h[i]
212
+
213
+ @cached_method
214
+ def index_set(self):
215
+ """
216
+ Return the index_set of ``self``.
217
+
218
+ EXAMPLES::
219
+
220
+ sage: g = lie_algebras.sl(QQ, 3, representation='matrix')
221
+ sage: g.index_set()
222
+ (1, 2)
223
+ """
224
+ return self._cartan_type.index_set()
225
+
226
+ def cartan_type(self):
227
+ """
228
+ Return the Cartan type of ``self``.
229
+
230
+ EXAMPLES::
231
+
232
+ sage: g = lie_algebras.sl(QQ, 3, representation='matrix')
233
+ sage: g.cartan_type()
234
+ ['A', 2]
235
+ """
236
+ return self._cartan_type
237
+
238
+ def epsilon(self, i, h):
239
+ r"""
240
+ Return the action of the functional
241
+ `\varepsilon_i \colon \mathfrak{h} \to R`, where `R` is the base
242
+ ring of ``self``, on the element ``h``.
243
+
244
+ EXAMPLES::
245
+
246
+ sage: g = lie_algebras.sl(QQ, 3, representation='matrix')
247
+ sage: g.epsilon(1, g.h(1))
248
+ 1
249
+ sage: g.epsilon(2, g.h(1))
250
+ -1
251
+ sage: g.epsilon(3, g.h(1))
252
+ 0
253
+ """
254
+ return h[i-1,i-1]
255
+
256
+ # Do we want this to be optional or required?
257
+ # There probably is a generic implementation we can do.
258
+ @abstract_method(optional=True)
259
+ def simple_root(self, i, h):
260
+ r"""
261
+ Return the action of the simple root
262
+ `\alpha_i \colon \mathfrak{h} \to R`, where `R` is the base
263
+ ring of ``self``, on the element ``h``.
264
+
265
+ EXAMPLES::
266
+
267
+ sage: g = lie_algebras.sl(QQ, 3, representation='matrix')
268
+ sage: g.simple_root(1, g.h(1))
269
+ 2
270
+ sage: g.simple_root(1, g.h(2))
271
+ -1
272
+ """
273
+
274
+ def highest_root_basis_elt(self, pos=True):
275
+ r"""
276
+ Return the basis element corresponding to the highest root `\theta`.
277
+ If ``pos`` is ``True``, then returns `e_{\theta}`, otherwise it
278
+ returns `f_{\theta}`.
279
+
280
+ EXAMPLES::
281
+
282
+ sage: g = lie_algebras.sl(QQ, 3, representation='matrix')
283
+ sage: g.highest_root_basis_elt()
284
+ [0 0 1]
285
+ [0 0 0]
286
+ [0 0 0]
287
+ """
288
+ RL = self._cartan_type.root_system().root_lattice()
289
+ coroots = RL.simple_coroots()
290
+ theta = RL.highest_root()
291
+ i,w = theta.to_simple_root(True)
292
+ r = RL.simple_root(i)
293
+ if pos:
294
+ gens = self._e
295
+ else:
296
+ gens = self._f
297
+ cur = gens[i]
298
+ for j in reversed(w):
299
+ for _ in range(-r.scalar(coroots[j])):
300
+ cur = self.bracket(gens[j], cur)
301
+ r = r.reflection(coroots[j], True)
302
+ return cur
303
+
304
+ @cached_method
305
+ def basis(self):
306
+ r"""
307
+ Return a basis of ``self``.
308
+
309
+ EXAMPLES::
310
+
311
+ sage: M = LieAlgebra(ZZ, cartan_type=['A',2], representation='matrix')
312
+ sage: list(M.basis())
313
+ [
314
+ [ 1 0 0] [0 1 0] [0 0 1] [0 0 0] [ 0 0 0] [0 0 0] [0 0 0]
315
+ [ 0 0 0] [0 0 0] [0 0 0] [1 0 0] [ 0 1 0] [0 0 1] [0 0 0]
316
+ [ 0 0 -1], [0 0 0], [0 0 0], [0 0 0], [ 0 0 -1], [0 0 0], [1 0 0],
317
+ <BLANKLINE>
318
+ [0 0 0]
319
+ [0 0 0]
320
+ [0 1 0]
321
+ ]
322
+
323
+ Sparse version::
324
+
325
+ sage: e6 = LieAlgebra(QQ, cartan_type=['E',6], representation='matrix')
326
+ sage: len(e6.basis()) # long time
327
+ 78
328
+ """
329
+ # This is a fairly generic method of constructing a basis
330
+ from sage.matrix.constructor import matrix
331
+
332
+ R = self.base_ring()
333
+ basis_pivots = set()
334
+ gens = list(self.lie_algebra_generators())
335
+ added = gens
336
+ m = self._assoc.ncols()
337
+ adim = self._assoc.dimension()
338
+ cur_mat = matrix(R, 0, adim, sparse=self._sparse)
339
+
340
+ # Helper functions for sparse matrices
341
+ def set_row(mat, row, val):
342
+ for k, v in val.dict().items():
343
+ a, b = k
344
+ mat[row, a*m+b] = v
345
+
346
+ def build_assoc(row):
347
+ ret = {}
348
+ for i, v in row.dict().items():
349
+ ret[i//m, i % m] = v
350
+ return self._assoc(ret)
351
+
352
+ while added:
353
+ if self._sparse:
354
+ mat = {}
355
+ count = 0
356
+ for x in added:
357
+ set_row(mat, count, x.value)
358
+ count += 1
359
+ for y in gens:
360
+ ret = x.bracket(y)
361
+ if ret:
362
+ set_row(mat, count, ret.value)
363
+ count += 1
364
+ mat = matrix(R, count, adim, mat, sparse=True)
365
+ else:
366
+ mat = []
367
+ for x in added:
368
+ mat.append(x.value.list())
369
+ for y in gens:
370
+ ret = x.bracket(y)
371
+ if ret:
372
+ mat.append(ret.value.list())
373
+ mat = matrix(R, mat)
374
+ cur_mat = cur_mat.stack(mat)
375
+ cur_mat.echelonize()
376
+ pivots = cur_mat.pivots()
377
+ added = []
378
+ if len(pivots) != len(basis_pivots):
379
+ for i,p in enumerate(pivots):
380
+ if p in basis_pivots:
381
+ continue
382
+ basis_pivots.add(p)
383
+ if self._sparse:
384
+ added.append(self.element_class(self, build_assoc(cur_mat[i])))
385
+ else:
386
+ added.append(self.element_class(self, self._assoc(cur_mat[i].list())))
387
+ cur_mat = cur_mat.submatrix(nrows=len(pivots))
388
+ if self._sparse:
389
+ basis = [self.element_class(self, build_assoc(cur_mat[i]))
390
+ for i in range(cur_mat.rank())]
391
+ else:
392
+ basis = [self.element_class(self, self._assoc(cur_mat[i].list()))
393
+ for i in range(cur_mat.rank())]
394
+ return Family(basis)
395
+
396
+ def affine(self, kac_moody=True):
397
+ """
398
+ Return the affine (Kac-Moody) Lie algebra of ``self``.
399
+
400
+ EXAMPLES::
401
+
402
+ sage: so5 = lie_algebras.so(QQ, 5, 'matrix')
403
+ sage: so5
404
+ Special orthogonal Lie algebra of rank 5 over Rational Field
405
+ sage: so5.affine()
406
+ Affine Special orthogonal Kac-Moody algebra of rank 5 over Rational Field
407
+ sage: so5.affine(False)
408
+ Affine Special orthogonal Lie algebra of rank 5 over Rational Field
409
+ """
410
+ from sage.algebras.lie_algebras.affine_lie_algebra import AffineLieAlgebra
411
+ return AffineLieAlgebra(self, kac_moody=kac_moody)
412
+
413
+
414
+ class gl(MatrixLieAlgebraFromAssociative):
415
+ r"""
416
+ The matrix Lie algebra `\mathfrak{gl}_n`.
417
+
418
+ The Lie algebra `\mathfrak{gl}_n` which consists of all `n \times n`
419
+ matrices.
420
+
421
+ INPUT:
422
+
423
+ - ``R`` -- the base ring
424
+ - ``n`` -- the size of the matrix
425
+ """
426
+ def __init__(self, R, n):
427
+ """
428
+ Initialize ``self``.
429
+
430
+ EXAMPLES::
431
+
432
+ sage: g = lie_algebras.gl(QQ, 4)
433
+ sage: TestSuite(g).run()
434
+
435
+ TESTS:
436
+
437
+ Check that :issue:`23266` is fixed::
438
+
439
+ sage: gl2 = lie_algebras.gl(QQ, 2)
440
+ sage: isinstance(gl2.basis().keys(), FiniteEnumeratedSet)
441
+ True
442
+ sage: Ugl2 = gl2.pbw_basis()
443
+ sage: prod(Ugl2.gens())
444
+ PBW['E_0_0']*PBW['E_0_1']*PBW['E_1_0']*PBW['E_1_1']
445
+ """
446
+ MS = MatrixSpace(R, n, sparse=True)
447
+ one = R.one()
448
+ names = []
449
+ gens = []
450
+ for i in range(n):
451
+ for j in range(n):
452
+ names.append('E_{}_{}'.format(i, j))
453
+ mat = MS({(i, j): one})
454
+ mat.set_immutable()
455
+ gens.append(mat)
456
+ self._n = n
457
+ category = LieAlgebras(R).FiniteDimensional().WithBasis()
458
+ from sage.sets.finite_enumerated_set import FiniteEnumeratedSet
459
+ index_set = FiniteEnumeratedSet(names)
460
+ MatrixLieAlgebraFromAssociative.__init__(self, MS, tuple(gens),
461
+ names=tuple(names),
462
+ index_set=index_set,
463
+ category=category)
464
+
465
+ def _repr_(self):
466
+ """
467
+ Return a string representation of ``self``.
468
+
469
+ EXAMPLES::
470
+
471
+ sage: lie_algebras.gl(QQ, 4)
472
+ General linear Lie algebra of rank 4 over Rational Field
473
+ """
474
+ return "General linear Lie algebra of rank {} over {}".format(self._n, self.base_ring())
475
+
476
+ def killing_form(self, x, y):
477
+ r"""
478
+ Return the Killing form on ``x`` and ``y``.
479
+
480
+ The Killing form on `\mathfrak{gl}_n` is:
481
+
482
+ .. MATH::
483
+
484
+ \langle x \mid y \rangle = 2n \mathrm{tr}(xy) - 2 \mathrm{tr}(x)
485
+ \mathrm{tr}(y).
486
+
487
+ EXAMPLES::
488
+
489
+ sage: g = lie_algebras.gl(QQ, 4)
490
+ sage: x = g.an_element()
491
+ sage: y = g.gens()[1]
492
+ sage: g.killing_form(x, y)
493
+ 8
494
+ """
495
+ return (2 * self._n * (x.value * y.value).trace()
496
+ - 2 * x.value.trace() * y.value.trace())
497
+
498
+ @cached_method
499
+ def basis(self):
500
+ """
501
+ Return the basis of ``self``.
502
+
503
+ EXAMPLES::
504
+
505
+ sage: g = lie_algebras.gl(QQ, 2)
506
+ sage: tuple(g.basis())
507
+ (
508
+ [1 0] [0 1] [0 0] [0 0]
509
+ [0 0], [0 0], [1 0], [0 1]
510
+ )
511
+ """
512
+ G = self.gens()
513
+ return Family(self._indices, lambda i: G[self._indices.index(i)])
514
+
515
+ def monomial(self, i):
516
+ r"""
517
+ Return the basis element indexed by ``i``.
518
+
519
+ INPUT:
520
+
521
+ - ``i`` -- an element of the index set
522
+
523
+ EXAMPLES::
524
+
525
+ sage: gl4 = lie_algebras.gl(QQ, 4)
526
+ sage: gl4.monomial('E_2_1')
527
+ [0 0 0 0]
528
+ [0 0 0 0]
529
+ [0 1 0 0]
530
+ [0 0 0 0]
531
+ sage: gl4.monomial((2,1))
532
+ [0 0 0 0]
533
+ [0 0 0 0]
534
+ [0 1 0 0]
535
+ [0 0 0 0]
536
+ """
537
+ if isinstance(i, tuple):
538
+ return self.basis()['E_{}_{}'.format(*i)]
539
+ return self.basis()[i]
540
+
541
+ class Element(MatrixLieAlgebraFromAssociative.Element):
542
+ def monomial_coefficients(self, copy=True):
543
+ r"""
544
+ Return the monomial coefficients of ``self``.
545
+
546
+ EXAMPLES::
547
+
548
+ sage: gl4 = lie_algebras.gl(QQ, 4)
549
+ sage: x = gl4.monomial('E_2_1') + 3*gl4.monomial('E_0_3')
550
+ sage: x.monomial_coefficients()
551
+ {'E_0_3': 3, 'E_2_1': 1}
552
+ """
553
+ d = {}
554
+ for k in self.value.nonzero_positions():
555
+ d['E_{}_{}'.format(*k)] = self.value[k]
556
+ return d
557
+
558
+
559
+ class sl(ClassicalMatrixLieAlgebra):
560
+ r"""
561
+ The matrix Lie algebra `\mathfrak{sl}_n`.
562
+
563
+ The Lie algebra `\mathfrak{sl}_n`, which consists of all `n \times n`
564
+ matrices with trace 0. This is the Lie algebra of type `A_{n-1}`.
565
+ """
566
+ def __init__(self, R, n):
567
+ """
568
+ Initialize ``self``.
569
+
570
+ EXAMPLES::
571
+
572
+ sage: g = lie_algebras.sl(QQ, 5, representation='matrix')
573
+ sage: TestSuite(g).run()
574
+ """
575
+ MS = MatrixSpace(R, n, sparse=True)
576
+ one = R.one()
577
+ e = [MS({(i,i+1):one}) for i in range(n-1)]
578
+ f = [MS({(i+1,i):one}) for i in range(n-1)]
579
+ h = [MS({(i,i):one, (i+1,i+1):-one}) for i in range(n-1)]
580
+ self._n = n
581
+ ClassicalMatrixLieAlgebra.__init__(self, R, CartanType(['A', n-1]), e, f, h)
582
+
583
+ def _repr_(self):
584
+ """
585
+ Return a string representation of ``self``.
586
+
587
+ EXAMPLES::
588
+
589
+ sage: lie_algebras.sl(QQ, 5, representation='matrix')
590
+ Special linear Lie algebra of rank 5 over Rational Field
591
+ """
592
+ return "Special linear Lie algebra of rank {} over {}".format(self._n, self.base_ring())
593
+
594
+ def killing_form(self, x, y):
595
+ r"""
596
+ Return the Killing form on ``x`` and ``y``.
597
+
598
+ The Killing form on `\mathfrak{sl}_n` is:
599
+
600
+ .. MATH::
601
+
602
+ \langle x \mid y \rangle = 2n \mathrm{tr}(xy).
603
+
604
+ EXAMPLES::
605
+
606
+ sage: g = lie_algebras.sl(QQ, 5, representation='matrix')
607
+ sage: x = g.an_element()
608
+ sage: y = g.lie_algebra_generators()['e1']
609
+ sage: g.killing_form(x, y)
610
+ 10
611
+ """
612
+ return 2 * self._n * (x.value * y.value).trace()
613
+
614
+ def simple_root(self, i, h):
615
+ r"""
616
+ Return the action of the simple root
617
+ `\alpha_i \colon \mathfrak{h} \to R`, where `R` is the base
618
+ ring of ``self``, on the element ``j``.
619
+
620
+ EXAMPLES::
621
+
622
+ sage: g = lie_algebras.sl(QQ, 5, representation='matrix')
623
+ sage: matrix([[g.simple_root(i, g.h(j)) for i in g.index_set()] for j in g.index_set()])
624
+ [ 2 -1 0 0]
625
+ [-1 2 -1 0]
626
+ [ 0 -1 2 -1]
627
+ [ 0 0 -1 2]
628
+ """
629
+ i = self.index_set().index(i)
630
+ return h[i,i] - h[i+1,i+1]
631
+
632
+
633
+ class so(ClassicalMatrixLieAlgebra):
634
+ r"""
635
+ The matrix Lie algebra `\mathfrak{so}_n`.
636
+
637
+ The Lie algebra `\mathfrak{so}_n`, which is isomorphic to the
638
+ Lie algebra of all anti-symmetric `n \times n` matrices.
639
+ The implementation here uses a different bilinear form and follows
640
+ the description in Chapter 8 of [HK2002]_. More precisely, this
641
+ is the set of matrices:
642
+
643
+ .. MATH::
644
+
645
+ \begin{pmatrix}
646
+ A & B \\
647
+ C & D
648
+ \end{pmatrix}
649
+
650
+ such that `A^t = -D`, `B^t = -B`, `C^t = -C` for `n` even and
651
+
652
+ .. MATH::
653
+
654
+ \begin{pmatrix}
655
+ A & B & a \\
656
+ C & D & b \\
657
+ c & d & 0
658
+ \end{pmatrix}
659
+
660
+ such that `A^t = -D`, `B^t = -B`, `C^t = -C`, `a^t = -d`,
661
+ and `b^t = -c` for `n` odd.
662
+
663
+ This is the Lie algebra of type `B_{(n-1)/2}` or `D_{n/2}` if `n`
664
+ is odd or even respectively.
665
+ """
666
+ def __init__(self, R, n):
667
+ """
668
+ Initialize ``self``.
669
+
670
+ EXAMPLES::
671
+
672
+ sage: g = lie_algebras.so(QQ, 8, representation='matrix')
673
+ sage: TestSuite(g).run()
674
+ sage: g = lie_algebras.so(QQ, 9, representation='matrix')
675
+ sage: TestSuite(g).run()
676
+ """
677
+ MS = MatrixSpace(R, n)
678
+ one = R.one()
679
+ self._n = n
680
+ if n % 2 == 0: # Even
681
+ m = n // 2 - 1 # -1 for indexing
682
+ n -= 1
683
+ e = [MS({(m-1, n): one, (m, n-1): -one})]
684
+ f = [MS({(n, m-1): one, (n-1, m): -one})]
685
+ h = [MS({(m-1, m-1): one, (m, m): one, (n-1, n-1): -one, (n, n): -one})]
686
+ m += 1
687
+ ct = CartanType(['D', m])
688
+ else: # Odd
689
+ m = (n-1) // 2 - 1 # -1 for indexing
690
+ n -= 1
691
+ e = [MS({(m, n): 2, (n, n-1): -2})]
692
+ f = [MS({(n, m): one, (n-1, n): -one})]
693
+ h = [MS({(m, m): 2, (n-1, n-1): -2})]
694
+ m += 1
695
+ ct = CartanType(['B', m])
696
+ e = [MS({(i, i+1): one, (m+i+1, m+i): -one}) for i in range(m-1)] + e
697
+ f = [MS({(i+1, i): one, (m+i, m+i+1): -one}) for i in range(m-1)] + f
698
+ h = [MS({(i, i): one, (i+1, i+1): -one, (m+i, m+i): -one, (m+i+1, m+i+1): one})
699
+ for i in range(m-1)] + h
700
+ ClassicalMatrixLieAlgebra.__init__(self, R, ct, e, f, h)
701
+
702
+ def _repr_(self):
703
+ """
704
+ Return a string representation of ``self``.
705
+
706
+ EXAMPLES::
707
+
708
+ sage: LieAlgebra(QQ, cartan_type=['B', 4], representation='matrix')
709
+ Special orthogonal Lie algebra of rank 9 over Rational Field
710
+ sage: LieAlgebra(QQ, cartan_type=['D', 4], representation='matrix')
711
+ Special orthogonal Lie algebra of rank 8 over Rational Field
712
+ """
713
+ return "Special orthogonal Lie algebra of rank {} over {}".format(self._n, self.base_ring())
714
+
715
+ def killing_form(self, x, y):
716
+ r"""
717
+ Return the Killing form on ``x`` and ``y``.
718
+
719
+ The Killing form on `\mathfrak{so}_n` is:
720
+
721
+ .. MATH::
722
+
723
+ \langle x \mid y \rangle = (n - 2) \mathrm{tr}(xy).
724
+
725
+ EXAMPLES::
726
+
727
+ sage: g = lie_algebras.so(QQ, 8, representation='matrix')
728
+ sage: x = g.an_element()
729
+ sage: y = g.lie_algebra_generators()['e1']
730
+ sage: g.killing_form(x, y)
731
+ 12
732
+ sage: g = lie_algebras.so(QQ, 9, representation='matrix')
733
+ sage: x = g.an_element()
734
+ sage: y = g.lie_algebra_generators()['e1']
735
+ sage: g.killing_form(x, y)
736
+ 14
737
+ """
738
+ return (self._n - 2) * (x.value * y.value).trace()
739
+
740
+ def simple_root(self, i, h):
741
+ r"""
742
+ Return the action of the simple root
743
+ `\alpha_i \colon \mathfrak{h} \to R`, where `R` is the base
744
+ ring of ``self``, on the element ``j``.
745
+
746
+ EXAMPLES:
747
+
748
+ The even or type `D` case::
749
+
750
+ sage: g = lie_algebras.so(QQ, 8, representation='matrix')
751
+ sage: matrix([[g.simple_root(i, g.h(j)) for i in g.index_set()] for j in g.index_set()])
752
+ [ 2 -1 0 0]
753
+ [-1 2 -1 -1]
754
+ [ 0 -1 2 0]
755
+ [ 0 -1 0 2]
756
+
757
+ The odd or type `B` case::
758
+
759
+ sage: g = lie_algebras.so(QQ, 9, representation='matrix')
760
+ sage: matrix([[g.simple_root(i, g.h(j)) for i in g.index_set()] for j in g.index_set()])
761
+ [ 2 -1 0 0]
762
+ [-1 2 -1 0]
763
+ [ 0 -1 2 -1]
764
+ [ 0 0 -2 2]
765
+ """
766
+ i = self.index_set().index(i)
767
+ if i == len(self.index_set()) - 1:
768
+ if self._n % 2 == 0:
769
+ return h[i-1, i-1] + h[i, i]
770
+ # otherwise we are odd
771
+ return h[i, i]
772
+ return h[i, i] - h[i+1, i+1]
773
+
774
+
775
+ class sp(ClassicalMatrixLieAlgebra):
776
+ r"""
777
+ The matrix Lie algebra `\mathfrak{sp}_n`.
778
+
779
+ The Lie algebra `\mathfrak{sp}_{2k}`, which consists of all
780
+ `2k \times 2k` matrices `X` that satisfy the equation:
781
+
782
+ .. MATH::
783
+
784
+ X^T M - M X = 0
785
+
786
+ where
787
+
788
+ .. MATH::
789
+
790
+ M = \begin{pmatrix}
791
+ 0 & I_k \\
792
+ -I_k & 0
793
+ \end{pmatrix}.
794
+
795
+ This is the Lie algebra of type `C_k`.
796
+ """
797
+ def __init__(self, R, n):
798
+ """
799
+ Initialize ``self``.
800
+
801
+ EXAMPLES::
802
+
803
+ sage: g = lie_algebras.sp(QQ, 8, representation='matrix')
804
+ sage: TestSuite(g).run()
805
+ """
806
+ MS = MatrixSpace(R, n, sparse=True)
807
+ one = R.one()
808
+ self._n = n
809
+ n = n // 2
810
+ e = [MS({(i,i+1):one, (n+i+1,n+i):-one}) for i in range(n-1)]
811
+ e.append(MS({(n-1,2*n-1):one})) # -1 for indexing
812
+ f = [MS({(i+1,i):one, (n+i,n+i+1):-one}) for i in range(n-1)]
813
+ f.append(MS({(2*n-1,n-1):one})) # -1 for indexing
814
+ h = [MS({(i,i):one, (i+1,i+1):-one, (n+i,n+i):-one, (n+i+1,n+i+1):one}) for i in range(n-1)]
815
+ h.append(MS({(n-1,n-1):one, (2*n-1,2*n-1):-one})) # -1 for indexing
816
+ ClassicalMatrixLieAlgebra.__init__(self, R, CartanType(['C', n]), e, f, h)
817
+
818
+ def _repr_(self):
819
+ """
820
+ Return a string representation of ``self``.
821
+
822
+ EXAMPLES::
823
+
824
+ sage: lie_algebras.sp(QQ, 8, representation='matrix')
825
+ Symplectic Lie algebra of rank 8 over Rational Field
826
+ """
827
+ return "Symplectic Lie algebra of rank {} over {}".format(self._n, self.base_ring())
828
+
829
+ def killing_form(self, x, y):
830
+ r"""
831
+ Return the Killing form on ``x`` and ``y``.
832
+
833
+ The Killing form on `\mathfrak{sp}_n` is:
834
+
835
+ .. MATH::
836
+
837
+ \langle x \mid y \rangle = (2n + 2) \mathrm{tr}(xy).
838
+
839
+ EXAMPLES::
840
+
841
+ sage: g = lie_algebras.sp(QQ, 8, representation='matrix')
842
+ sage: x = g.an_element()
843
+ sage: y = g.lie_algebra_generators()['e1']
844
+ sage: g.killing_form(x, y)
845
+ 36
846
+ """
847
+ return (2 * self._n + 2) * (x.value * y.value).trace()
848
+
849
+ def simple_root(self, i, h):
850
+ r"""
851
+ Return the action of the simple root
852
+ `\alpha_i \colon \mathfrak{h} \to R`, where `R` is the base
853
+ ring of ``self``, on the element ``j``.
854
+
855
+ EXAMPLES::
856
+
857
+ sage: g = lie_algebras.sp(QQ, 8, representation='matrix')
858
+ sage: matrix([[g.simple_root(i, g.h(j)) for i in g.index_set()] for j in g.index_set()])
859
+ [ 2 -1 0 0]
860
+ [-1 2 -1 0]
861
+ [ 0 -1 2 -2]
862
+ [ 0 0 -1 2]
863
+ """
864
+ i = self.index_set().index(i)
865
+ if i == self._n / 2 - 1:
866
+ return 2*h[i,i]
867
+ return h[i,i] - h[i+1,i+1]
868
+
869
+
870
+ class ExceptionalMatrixLieAlgebra(ClassicalMatrixLieAlgebra):
871
+ """
872
+ A matrix Lie algebra of exceptional type.
873
+ """
874
+ def __init__(self, R, cartan_type, e, f, h=None, sparse=False):
875
+ """
876
+ Initialize ``self``.
877
+
878
+ EXAMPLES::
879
+
880
+ sage: g = LieAlgebra(QQ, cartan_type=['E',6], representation='matrix')
881
+ sage: all(g.h(i) == g.e(i).bracket(g.f(i)) for i in range(1,7))
882
+ True
883
+ """
884
+ if h is None:
885
+ h = [e[i] * f[i] - f[i] * e[i] for i in range(len(e))]
886
+ ClassicalMatrixLieAlgebra.__init__(self, R, cartan_type, e, f, h, sparse=sparse)
887
+
888
+ def _repr_(self):
889
+ """
890
+ Return a string representation of ``self``.
891
+
892
+ EXAMPLES::
893
+
894
+ sage: LieAlgebra(QQ, cartan_type=['G',2], representation='matrix')
895
+ Simple matrix Lie algebra of type ['G', 2] over Rational Field
896
+ """
897
+ return "Simple matrix Lie algebra of type {} over {}".format(self.cartan_type(), self.base_ring())
898
+
899
+
900
+ class e6(ExceptionalMatrixLieAlgebra):
901
+ r"""
902
+ The matrix Lie algebra `\mathfrak{e}_6`.
903
+
904
+ The simple Lie algebra `\mathfrak{e}_6` of type `E_6`. The matrix
905
+ representation is given following [HRT2000]_.
906
+ """
907
+ def __init__(self, R):
908
+ """
909
+ Initialize ``self``.
910
+
911
+ EXAMPLES::
912
+
913
+ sage: g = LieAlgebra(QQ, cartan_type=['E',6], representation='matrix')
914
+ sage: TestSuite(g).run() # long time
915
+ """
916
+ MS = MatrixSpace(R, 27, sparse=True)
917
+ one = R.one()
918
+ coords = [[(0,1), (10,12), (13,15), (16,17), (18,19), (20,21)],
919
+ [(3,4), (5,6), (7,9), (18,20), (19,21), (22,23)],
920
+ [(1,2), (8,10), (11,13), (14,16), (19,22), (21,23)],
921
+ [(2,3), (6,8), (9,11), (16,18), (17,19), (23,24)],
922
+ [(3,5), (4,6), (11,14), (13,16), (15,17), (24,25)],
923
+ [(5,7), (6,9), (8,11), (10,13), (12,15), (25,26)]]
924
+ e = [MS({c: one for c in coord}) for coord in coords]
925
+ f = [MS({(c[1],c[0]): one for c in coord}) for coord in coords]
926
+ ExceptionalMatrixLieAlgebra.__init__(self, R, CartanType(['E', 6]), e, f)
927
+
928
+
929
+ class e7(ExceptionalMatrixLieAlgebra):
930
+ r"""
931
+ The matrix Lie algebra `\mathfrak{e}_7`.
932
+
933
+ The simple Lie algebra `\mathfrak{e}_7` of type `E_7`. The matrix
934
+ representation is given following [HRT2000]_.
935
+ """
936
+ def __init__(self, R):
937
+ """
938
+ Initialize ``self``.
939
+
940
+ EXAMPLES::
941
+
942
+ sage: g = LieAlgebra(QQ, cartan_type=['E', 7], representation='matrix')
943
+ sage: g
944
+ Simple matrix Lie algebra of type ['E', 7] over Rational Field
945
+
946
+ sage: len(g.basis()) # long time
947
+ 133
948
+ sage: TestSuite(g).run() # long time
949
+ """
950
+ MS = MatrixSpace(R, 56, sparse=True)
951
+ one = R.one()
952
+ coords = [[(6,7), (8,9), (10,11), (12,14), (15,17), (18,21), (34,37), (38,40), (41,43), (44,45), (46,47), (48,49)],
953
+ [(4,5), (6,8), (7,9), (19,22), (23,25), (26,28), (27,29), (30,32), (33,36), (46,48), (47,49), (50,51)],
954
+ [(4,6), (5,8), (11,13), (14,16), (17,20), (21,24), (31,34), (35,38), (39,41), (42,44), (47,50), (49,51)],
955
+ [(3,4), (8,10), (9,11), (16,19), (20,23), (24,27), (28,31), (32,35), (36,39), (44,46), (45,47), (51,52)],
956
+ [(2,3), (10,12), (11,14), (13,16), (23,26), (25,28), (27,30), (29,32), (39,42), (41,44), (43,45), (52,53)],
957
+ [(1,2), (12,15), (14,17), (16,20), (19,23), (22,25), (30,33), (32,36), (35,39), (38,41), (40,43), (53,54)],
958
+ [(0,1), (15,18), (17,21), (20,24), (23,27), (25,29), (26,30), (28,32), (31,35), (34,38), (37,40), (54,55)]]
959
+ e = [MS({c: one for c in coord}) for coord in coords]
960
+ f = [MS({(c[1], c[0]): one for c in coord}) for coord in coords]
961
+ ExceptionalMatrixLieAlgebra.__init__(self, R, CartanType(['E', 7]), e, f)
962
+
963
+
964
+ class e8(ExceptionalMatrixLieAlgebra):
965
+ r"""
966
+ The matrix Lie algebra `\mathfrak{e}_8`.
967
+
968
+ The simple Lie algebra `\mathfrak{e}_8` of type `E_8` built from the
969
+ adjoint representation in the Chevalley basis.
970
+ """
971
+ def __init__(self, R):
972
+ """
973
+ Initialize ``self``.
974
+
975
+ TESTS::
976
+
977
+ sage: g = LieAlgebra(QQ, cartan_type=['E', 8], representation='matrix') # long time
978
+ sage: g # long time
979
+ Simple matrix Lie algebra of type ['E', 8] over Rational Field
980
+
981
+ We skip the not implemented methods test as it takes too much time::
982
+
983
+ sage: TestSuite(g).run(skip='_test_not_implemented_methods') # long time
984
+ """
985
+ ct = CartanType(['E', 8])
986
+ g = LieAlgebraChevalleyBasis(R, ct)
987
+ e = [ge.adjoint_matrix(sparse=True) for ge in g.e()]
988
+ f = [gf.adjoint_matrix(sparse=True) for gf in g.f()]
989
+ ExceptionalMatrixLieAlgebra.__init__(self, R, ct, e, f)
990
+
991
+ @cached_method
992
+ def basis(self):
993
+ r"""
994
+ Return a basis of ``self``.
995
+
996
+ EXAMPLES::
997
+
998
+ sage: g = LieAlgebra(QQ, cartan_type=['E', 8], representation='matrix') # long time
999
+ sage: len(g.basis()) # long time
1000
+ 248
1001
+ """
1002
+ g = LieAlgebraChevalleyBasis(self.base_ring(), self.cartan_type())
1003
+ return Family([ge.adjoint_matrix(sparse=True) for ge in g.basis()])
1004
+
1005
+
1006
+ class f4(ExceptionalMatrixLieAlgebra):
1007
+ r"""
1008
+ The matrix Lie algebra `\mathfrak{f}_4`.
1009
+
1010
+ The simple Lie algebra `\mathfrak{f}_f` of type `F_4`. The matrix
1011
+ representation is given following [HRT2000]_ but indexed in the
1012
+ reversed order (i.e., interchange 1 with 4 and 2 with 3).
1013
+ """
1014
+ def __init__(self, R):
1015
+ """
1016
+ Initialize ``self``.
1017
+
1018
+ EXAMPLES::
1019
+
1020
+ sage: g = LieAlgebra(QQ, cartan_type=['F',4], representation='matrix')
1021
+ sage: TestSuite(g).run() # long time
1022
+ """
1023
+ MS = MatrixSpace(R, 26, sparse=True)
1024
+ one = R.one()
1025
+
1026
+ coords = [[(0,1), (5,7), (6,9), (8,11), (10,12), (10,13), (12,14),
1027
+ (15,16), (17,18), (19,20), (24,25)],
1028
+ [(1,2), (3,5), (4,6), (8,10), (11,12), (11,13), (13,15),
1029
+ (14,16), (18,21), (20,22), (23,24)],
1030
+ [(2,3), (6,8), (9,11), (15,17), (16,18), (22,23)],
1031
+ [(3,4), (5,6), (7,9), (17,19), (18,20), (21,22)]]
1032
+ e = [MS({c: one for c in coord}) for coord in coords]
1033
+ # Double (10, 12) in e1 and (11,13) in e2
1034
+ e[0][10,12] = 2*one
1035
+ e[1][11,13] = 2*one
1036
+
1037
+ coords = [[(1,0), (7,5), (9,6), (11,8), (12,10), (14,12), (14,13),
1038
+ (16,15), (18,17), (20,19), (25,24)],
1039
+ [(2,1), (5,3), (6,4), (10,8), (13,11), (15,12), (15,13),
1040
+ (16,14), (21,18), (22,20), (24,23)],
1041
+ [(3,2), (8,6), (11,9), (17,15), (18,16), (23,22)],
1042
+ [(4,3), (6,5), (9,7), (19,17), (20,18), (22,21)]]
1043
+ f = [MS({c: one for c in coord}) for coord in coords]
1044
+ # Double (14, 12) in f1 and (15,13) in f2
1045
+ f[0][14,12] = 2*one
1046
+ f[1][15,13] = 2*one
1047
+
1048
+ # Our Cartan matrix convention is dual to that of [HRT2000]_
1049
+ e.reverse()
1050
+ f.reverse()
1051
+ ExceptionalMatrixLieAlgebra.__init__(self, R, CartanType(['F', 4]), e, f)
1052
+
1053
+
1054
+ class g2(ExceptionalMatrixLieAlgebra):
1055
+ r"""
1056
+ The matrix Lie algebra `\mathfrak{g}_2`.
1057
+
1058
+ The simple Lie algebra `\mathfrak{g}_2` of type `G_2`. The matrix
1059
+ representation is given following [HRT2000]_.
1060
+ """
1061
+ def __init__(self, R):
1062
+ """
1063
+ Initialize ``self``.
1064
+
1065
+ EXAMPLES::
1066
+
1067
+ sage: g = LieAlgebra(QQ, cartan_type=['G',2], representation='matrix')
1068
+ sage: TestSuite(g).run()
1069
+ """
1070
+ MS = MatrixSpace(R, 7, sparse=True)
1071
+ one = R.one()
1072
+ e = [MS({(0,1): one, (2,3): 2*one, (3,4): one, (5,6): one}),
1073
+ MS({(1,2): one, (4,5): one})]
1074
+ f = [MS({(1,0): one, (3,2): one, (4,3): 2*one, (6,5): one}),
1075
+ MS({(2,1): one, (5,4): one})]
1076
+ h = [MS({(0,0): one, (1,1): -one, (2,2): 2*one, (4,4): -2*one, (5,5): one, (6,6): -one}),
1077
+ MS({(1,1): one, (2,2): -one, (4,4): one, (5,5): -one})]
1078
+ ExceptionalMatrixLieAlgebra.__init__(self, R, CartanType(['G', 2]), e, f, h)
1079
+
1080
+
1081
+ #######################################
1082
+ # Compact real form
1083
+
1084
+ class MatrixCompactRealForm(FinitelyGeneratedLieAlgebra):
1085
+ r"""
1086
+ The compact real form of a matrix Lie algebra.
1087
+
1088
+ Let `L` be a classical (i.e., type `ABCD`) Lie algebra over `\RR`
1089
+ given as matrices that is invariant under matrix transpose (i.e.,
1090
+ `X^T \in L` for all `X \in L`). Then we can perform the
1091
+ *Cartan decomposition* of `L` by `L = K \oplus S`, where `K`
1092
+ (resp. `S`) is the set of skew-symmetric (resp. symmetric) matrices
1093
+ in `L`. Then the Lie algebra `U = K \oplus i S` is an `\RR`-subspace
1094
+ of the complexification of `L` that is closed under commutators and
1095
+ has skew-hermitian matrices. Hence, the Killing form is negative
1096
+ definitive (i.e., `U` is a compact Lie algebra), and thus `U` is
1097
+ the complex real form of the complexification of `L`.
1098
+
1099
+ EXAMPLES::
1100
+
1101
+ sage: U = LieAlgebra(QQ, cartan_type=['A',1], representation="compact real")
1102
+ sage: list(U.basis())
1103
+ [
1104
+ [ 0 1] [ i 0] [0 i]
1105
+ [-1 0], [ 0 -i], [i 0]
1106
+ ]
1107
+ sage: U.killing_form_matrix()
1108
+ [-8 0 0]
1109
+ [ 0 -8 0]
1110
+ [ 0 0 -8]
1111
+
1112
+ Computations are only (currently) possible if this is defined
1113
+ over a field::
1114
+
1115
+ sage: U = LieAlgebra(ZZ, cartan_type=['A',1], representation="compact real")
1116
+ sage: list(U.basis())
1117
+ Traceback (most recent call last):
1118
+ ...
1119
+ TypeError: no conversion of this rational to integer
1120
+ """
1121
+ def __init__(self, R, cartan_type):
1122
+ """
1123
+ Initialize ``self``.
1124
+
1125
+ TESTS::
1126
+
1127
+ sage: L = LieAlgebra(QQ, cartan_type=['A',2], representation="compact real")
1128
+ sage: TestSuite(L).run()
1129
+ """
1130
+ if not cartan_type.is_finite():
1131
+ raise ValueError("the Cartan type must be finite type")
1132
+
1133
+ self._classical = ClassicalMatrixLieAlgebra(R, cartan_type)
1134
+ self._MS = self._classical._assoc
1135
+ dim = self._classical.dimension()
1136
+ from sage.sets.finite_enumerated_set import FiniteEnumeratedSet
1137
+ index_set = FiniteEnumeratedSet(range(dim))
1138
+ names = tuple(['CR%s' % s for s in range(dim)])
1139
+ category = LieAlgebras(R).FiniteDimensional().WithBasis()
1140
+ FinitelyGeneratedLieAlgebra.__init__(self, R, names=names,
1141
+ index_set=index_set,
1142
+ category=category)
1143
+
1144
+ @cached_method
1145
+ def basis(self):
1146
+ """
1147
+ Compute a basis of ``self``.
1148
+
1149
+ EXAMPLES::
1150
+
1151
+ sage: L = LieAlgebra(QQ, cartan_type=['B',2], representation="compact real")
1152
+ sage: list(L.basis())
1153
+ [
1154
+ [ 0 1 0 0 0] [ 0 0 0 1 0] [ 0 0 0 0 1] [ 0 0 0 0 0]
1155
+ [-1 0 0 0 0] [ 0 0 -1 0 0] [ 0 0 0 0 0] [ 0 0 0 0 1]
1156
+ [ 0 0 0 1 0] [ 0 1 0 0 0] [ 0 0 0 0 1] [ 0 0 0 0 0]
1157
+ [ 0 0 -1 0 0] [-1 0 0 0 0] [ 0 0 0 0 0] [ 0 0 0 0 1]
1158
+ [ 0 0 0 0 0], [ 0 0 0 0 0], [-1 0 -1 0 0], [ 0 -1 0 -1 0],
1159
+ <BLANKLINE>
1160
+ [ i 0 0 0 0] [ 0 i 0 0 0] [ 0 0 0 i 0] [ 0 0 0 0 i]
1161
+ [ 0 0 0 0 0] [ i 0 0 0 0] [ 0 0 -i 0 0] [ 0 0 0 0 0]
1162
+ [ 0 0 -i 0 0] [ 0 0 0 -i 0] [ 0 -i 0 0 0] [ 0 0 0 0 -i]
1163
+ [ 0 0 0 0 0] [ 0 0 -i 0 0] [ i 0 0 0 0] [ 0 0 0 0 0]
1164
+ [ 0 0 0 0 0], [ 0 0 0 0 0], [ 0 0 0 0 0], [ i 0 -i 0 0],
1165
+ <BLANKLINE>
1166
+ [ 0 0 0 0 0] [ 0 0 0 0 0]
1167
+ [ 0 i 0 0 0] [ 0 0 0 0 i]
1168
+ [ 0 0 0 0 0] [ 0 0 0 0 0]
1169
+ [ 0 0 0 -i 0] [ 0 0 0 0 -i]
1170
+ [ 0 0 0 0 0], [ 0 i 0 -i 0]
1171
+ ]
1172
+ """
1173
+ from sage.matrix.constructor import matrix
1174
+ zero = self._MS.zero()
1175
+ basis = self._classical.basis()
1176
+ R = self.base_ring()
1177
+ mat = matrix(R, [((b.value - b.value.transpose()) / 2).list() for b in basis],
1178
+ sparse=self._MS.is_sparse())
1179
+ mat.echelonize()
1180
+ ret = [self.element_class(self, self._MS(mat[i].list()), zero)
1181
+ for i in range(mat.rank())]
1182
+ mat = matrix(R, [((b.value + b.value.transpose()) / 2).list() for b in basis],
1183
+ sparse=self._MS.is_sparse())
1184
+ mat.echelonize()
1185
+ ret += [self.element_class(self, zero, self._MS(mat[i].list()))
1186
+ for i in range(mat.rank())]
1187
+ return Family(ret)
1188
+
1189
+ @cached_method
1190
+ def zero(self):
1191
+ """
1192
+ Return the element `0`.
1193
+
1194
+ EXAMPLES::
1195
+
1196
+ sage: L = LieAlgebra(QQ, cartan_type=['D',4], representation="compact real")
1197
+ sage: L.zero()
1198
+ [0 0 0 0 0 0 0 0]
1199
+ [0 0 0 0 0 0 0 0]
1200
+ [0 0 0 0 0 0 0 0]
1201
+ [0 0 0 0 0 0 0 0]
1202
+ [0 0 0 0 0 0 0 0]
1203
+ [0 0 0 0 0 0 0 0]
1204
+ [0 0 0 0 0 0 0 0]
1205
+ [0 0 0 0 0 0 0 0]
1206
+ """
1207
+ return self.element_class(self, self._MS.zero(), self._MS.zero())
1208
+
1209
+ def monomial(self, i):
1210
+ """
1211
+ Return the monomial indexed by ``i``.
1212
+
1213
+ EXAMPLES::
1214
+
1215
+ sage: L = LieAlgebra(QQ, cartan_type=['A',3], representation="compact real")
1216
+ sage: L.monomial(0)
1217
+ [ 0 1 0 0]
1218
+ [-1 0 0 0]
1219
+ [ 0 0 0 0]
1220
+ [ 0 0 0 0]
1221
+ """
1222
+ return self.basis()[i]
1223
+
1224
+ def term(self, i, c=None):
1225
+ """
1226
+ Return the term indexed by ``i`` with coefficient ``c``.
1227
+
1228
+ EXAMPLES::
1229
+
1230
+ sage: L = LieAlgebra(QQ, cartan_type=['C',3], representation="compact real")
1231
+ sage: L.term(4, 7/2)
1232
+ [ 0 0 0 0 0 7/2]
1233
+ [ 0 0 0 0 0 0]
1234
+ [ 0 0 0 7/2 0 0]
1235
+ [ 0 0 -7/2 0 0 0]
1236
+ [ 0 0 0 0 0 0]
1237
+ [-7/2 0 0 0 0 0]
1238
+ """
1239
+ if c is None:
1240
+ c = self.base_ring().one()
1241
+ else:
1242
+ c = self.base_ring()(c)
1243
+ return c * self.basis()[i]
1244
+
1245
+ def _repr_option(self, key):
1246
+ """
1247
+ Metadata about the :meth:`_repr_` output.
1248
+
1249
+ EXAMPLES::
1250
+
1251
+ sage: L = LieAlgebra(QQ, cartan_type=['A',1], representation="compact real")
1252
+ sage: L._repr_option("element_ascii_art")
1253
+ True
1254
+ """
1255
+ if key == "element_ascii_art":
1256
+ return True
1257
+ return FinitelyGeneratedLieAlgebra._repr_option(self, key)
1258
+
1259
+ class Element(Element):
1260
+ """
1261
+ An element of a matrix Lie algebra in its compact real form.
1262
+ """
1263
+ def __init__(self, parent, real, imag):
1264
+ """
1265
+ Initialize ``self``.
1266
+
1267
+ EXAMPLES::
1268
+
1269
+ sage: L = LieAlgebra(QQ, cartan_type=['D',4], representation="compact real")
1270
+ sage: TestSuite(L.an_element()).run()
1271
+ """
1272
+ Element.__init__(self, parent)
1273
+ self._real = real
1274
+ self._imag = imag
1275
+ self._real.set_immutable()
1276
+ self._imag.set_immutable()
1277
+ self._mc = None
1278
+
1279
+ def _combined_matrix(self):
1280
+ r"""
1281
+ Return a single matrix representative of ``self``.
1282
+
1283
+ .. NOTE::
1284
+
1285
+ The resulting base ring is `R[i]`, where `R` is the
1286
+ base ring of the Lie algebra.
1287
+
1288
+ EXAMPLES::
1289
+
1290
+ sage: L = LieAlgebra(QQ, cartan_type=['A',2], representation="compact real")
1291
+ sage: x = L.sum((i+1)/7*b for i,b in enumerate(L.basis()))
1292
+ sage: M = x._combined_matrix()
1293
+ sage: M
1294
+ [ 4/7*i 5/7*i + 1/7 6/7*i + 2/7]
1295
+ [5/7*i - 1/7 i 8/7*i + 3/7]
1296
+ [6/7*i - 2/7 8/7*i - 3/7 -11/7*i]
1297
+ sage: M.parent()
1298
+ Full MatrixSpace of 3 by 3 sparse matrices over
1299
+ Univariate Polynomial Ring in i over Rational Field
1300
+ """
1301
+ from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing
1302
+ MS = self.parent()._MS
1303
+ R = PolynomialRing(MS.base_ring(), 'i')
1304
+ return self._real + R.gen() * self._imag
1305
+
1306
+ def _repr_(self):
1307
+ """
1308
+ Return a string representation of ``self``.
1309
+
1310
+ EXAMPLES::
1311
+
1312
+ sage: L = LieAlgebra(QQ, cartan_type=['B',2], representation="compact real")
1313
+ sage: L.sum((i+1)/7*b for i,b in enumerate(L.basis()))
1314
+ [ 5/7*i 6/7*i + 1/7 0 i + 2/7 8/7*i + 3/7]
1315
+ [ 6/7*i - 1/7 9/7*i -i - 2/7 0 10/7*i + 4/7]
1316
+ [ 0 -i + 2/7 -5/7*i -6/7*i + 1/7 -8/7*i + 3/7]
1317
+ [ i - 2/7 0 -6/7*i - 1/7 -9/7*i -10/7*i + 4/7]
1318
+ [ 8/7*i - 3/7 10/7*i - 4/7 -8/7*i - 3/7 -10/7*i - 4/7 0]
1319
+ """
1320
+ return repr(self._combined_matrix())
1321
+
1322
+ def _latex_(self):
1323
+ r"""
1324
+ Return a latex representation of ``self``.
1325
+
1326
+ EXAMPLES::
1327
+
1328
+ sage: L = LieAlgebra(QQ, cartan_type=['B',2], representation="compact real")
1329
+ sage: x = L.sum((i+1)/7*b for i,b in enumerate(L.basis()))
1330
+ sage: latex(x)
1331
+ \left(\begin{array}{rrrrr}
1332
+ \frac{5}{7} i & \frac{6}{7} i + \frac{1}{7} & 0 & i + \frac{2}{7} & \frac{8}{7} i + \frac{3}{7} \\
1333
+ \frac{6}{7} i - \frac{1}{7} & \frac{9}{7} i & -i - \frac{2}{7} & 0 & \frac{10}{7} i + \frac{4}{7} \\
1334
+ 0 & -i + \frac{2}{7} & -\frac{5}{7} i & -\frac{6}{7} i + \frac{1}{7} & -\frac{8}{7} i + \frac{3}{7} \\
1335
+ i - \frac{2}{7} & 0 & -\frac{6}{7} i - \frac{1}{7} & -\frac{9}{7} i & -\frac{10}{7} i + \frac{4}{7} \\
1336
+ \frac{8}{7} i - \frac{3}{7} & \frac{10}{7} i - \frac{4}{7} & -\frac{8}{7} i - \frac{3}{7} & -\frac{10}{7} i - \frac{4}{7} & 0
1337
+ \end{array}\right)
1338
+ """
1339
+ from sage.misc.latex import latex
1340
+ return latex(self._combined_matrix())
1341
+
1342
+ def _ascii_art_(self):
1343
+ """
1344
+ Return a string representation of ``self``.
1345
+
1346
+ EXAMPLES::
1347
+
1348
+ sage: L = LieAlgebra(QQ, cartan_type=['A',2], representation="compact real")
1349
+ sage: x = L.sum((i+1)/7*b for i,b in enumerate(L.basis()))
1350
+ sage: ascii_art(x)
1351
+ [ 4/7*i 5/7*i + 1/7 6/7*i + 2/7]
1352
+ [5/7*i - 1/7 i 8/7*i + 3/7]
1353
+ [6/7*i - 2/7 8/7*i - 3/7 -11/7*i]
1354
+ """
1355
+ from sage.typeset.ascii_art import ascii_art
1356
+ return ascii_art(self._combined_matrix())
1357
+
1358
+ def _unicode_art_(self):
1359
+ r"""
1360
+ Return a string representation of ``self``.
1361
+
1362
+ EXAMPLES::
1363
+
1364
+ sage: L = LieAlgebra(QQ, cartan_type=['A',2], representation="compact real")
1365
+ sage: x = L.sum((i+1)/7*b for i,b in enumerate(L.basis()))
1366
+ sage: unicode_art(x)
1367
+ ⎛ 4/7*i 5/7*i + 1/7 6/7*i + 2/7⎞
1368
+ ⎜5/7*i - 1/7 i 8/7*i + 3/7⎟
1369
+ ⎝6/7*i - 2/7 8/7*i - 3/7 -11/7*i⎠
1370
+ """
1371
+ from sage.typeset.unicode_art import unicode_art
1372
+ return unicode_art(self._combined_matrix())
1373
+
1374
+ def __bool__(self) -> bool:
1375
+ r"""
1376
+ Return if ``self`` is nonzero.
1377
+
1378
+ EXAMPLES::
1379
+
1380
+ sage: L = LieAlgebra(QQ, cartan_type=['C',3], representation="compact real")
1381
+ sage: all(b for b in L.basis() if b != 0)
1382
+ True
1383
+ sage: bool(L.zero())
1384
+ False
1385
+ """
1386
+ return bool(self._real) or bool(self._imag)
1387
+
1388
+ def __hash__(self):
1389
+ r"""
1390
+ Return the hash of ``self``.
1391
+
1392
+ EXAMPLES::
1393
+
1394
+ sage: L = LieAlgebra(QQ, cartan_type=['A',2], representation="compact real")
1395
+ sage: x = L.an_element()
1396
+ sage: hash(x) == hash((x._real, x._imag))
1397
+ True
1398
+ """
1399
+ return hash((self._real, self._imag))
1400
+
1401
+ def _richcmp_(self, other, op):
1402
+ r"""
1403
+ Return the richcmp of ``self`` and ``other`` by ``op``.
1404
+
1405
+ EXAMPLES::
1406
+
1407
+ sage: L = LieAlgebra(QQ, cartan_type=['A',1], representation="compact real")
1408
+ sage: sorted(L.basis())
1409
+ [
1410
+ [0 i] [ i 0] [ 0 1]
1411
+ [i 0], [ 0 -i], [-1 0]
1412
+ ]
1413
+ """
1414
+ return richcmp((self._real, self._imag), (other._real, other._imag), op)
1415
+
1416
+ def _add_(self, other):
1417
+ r"""
1418
+ Add ``self`` and ``other``.
1419
+
1420
+ EXAMPLES::
1421
+
1422
+ sage: L = LieAlgebra(QQ, cartan_type=['C',2], representation="compact real")
1423
+ sage: B = L.basis()
1424
+ sage: B[0] + B[6]
1425
+ [ 0 1 i 0]
1426
+ [-1 0 0 0]
1427
+ [ i 0 0 1]
1428
+ [ 0 0 -1 0]
1429
+ sage: L.sum(B)
1430
+ [ i i + 1 i + 1 i + 1]
1431
+ [ i - 1 i i + 1 i + 1]
1432
+ [ i - 1 i - 1 -i -i + 1]
1433
+ [ i - 1 i - 1 -i - 1 -i]
1434
+ """
1435
+ P = self.parent()
1436
+ return P.element_class(P, self._real + other._real,
1437
+ self._imag + other._imag)
1438
+
1439
+ def _sub_(self, other):
1440
+ r"""
1441
+ Subtract ``self`` and ``other``.
1442
+
1443
+ EXAMPLES::
1444
+
1445
+ sage: L = LieAlgebra(QQ, cartan_type=['C',2], representation="compact real")
1446
+ sage: B = L.basis()
1447
+ sage: B[0] - B[6]
1448
+ [ 0 1 -i 0]
1449
+ [-1 0 0 0]
1450
+ [-i 0 0 1]
1451
+ [ 0 0 -1 0]
1452
+ sage: all(b - b == L.zero() for b in B)
1453
+ True
1454
+ """
1455
+ P = self.parent()
1456
+ return P.element_class(P, self._real - other._real,
1457
+ self._imag - other._imag)
1458
+
1459
+ def _neg_(self):
1460
+ r"""
1461
+ Negate ``self``.
1462
+
1463
+ EXAMPLES::
1464
+
1465
+ sage: L = LieAlgebra(QQ, cartan_type=['C',2], representation="compact real")
1466
+ sage: B = L.basis()
1467
+ sage: -(B[0] + B[6])
1468
+ [ 0 -1 -i 0]
1469
+ [ 1 0 0 0]
1470
+ [-i 0 0 -1]
1471
+ [ 0 0 1 0]
1472
+ sage: all(-(-b) == b for b in B)
1473
+ True
1474
+ """
1475
+ P = self.parent()
1476
+ return P.element_class(P, -self._real, -self._imag)
1477
+
1478
+ def _bracket_(self, other):
1479
+ r"""
1480
+ Return the Lie bracket of ``self`` and ``other``.
1481
+
1482
+ EXAMPLES::
1483
+
1484
+ sage: L = LieAlgebra(QQ, cartan_type=['A',1], representation="compact real")
1485
+ sage: B = L.basis()
1486
+ sage: list(B)
1487
+ [
1488
+ [ 0 1] [ i 0] [0 i]
1489
+ [-1 0], [ 0 -i], [i 0]
1490
+ ]
1491
+ sage: [b._bracket_(bp) for b in B for bp in B]
1492
+ [
1493
+ [0 0] [ 0 -2*i] [ 2*i 0] [ 0 2*i] [0 0] [ 0 -2]
1494
+ [0 0], [-2*i 0], [ 0 -2*i], [2*i 0], [0 0], [ 2 0],
1495
+ <BLANKLINE>
1496
+ [-2*i 0] [ 0 2] [0 0]
1497
+ [ 0 2*i], [-2 0], [0 0]
1498
+ ]
1499
+ """
1500
+ A, B = self._real, self._imag
1501
+ X, Y = other._real, other._imag
1502
+ P = self.parent()
1503
+ return P.element_class(P, A*X - X*A - B*Y + Y*B,
1504
+ A*Y - Y*A + B*X - X*B)
1505
+
1506
+ def _acted_upon_(self, x, self_on_left):
1507
+ r"""
1508
+ Return the action of ``x`` on ``self``.
1509
+
1510
+ EXAMPLES::
1511
+
1512
+ sage: L = LieAlgebra(QQ, cartan_type=['D',4], representation="compact real")
1513
+ sage: B = L.basis()
1514
+ sage: (3/5) * B[21]
1515
+ [ 0 0 0 0 0 0 0 0]
1516
+ [ 0 0 0 3/5*i 0 0 0 0]
1517
+ [ 0 0 0 0 0 0 0 0]
1518
+ [ 0 3/5*i 0 0 0 0 0 0]
1519
+ [ 0 0 0 0 0 0 0 0]
1520
+ [ 0 0 0 0 0 0 0 -3/5*i]
1521
+ [ 0 0 0 0 0 0 0 0]
1522
+ [ 0 0 0 0 0 -3/5*i 0 0]
1523
+ sage: B[7] * 7
1524
+ [ 0 0 0 0 0 0 0 0]
1525
+ [ 0 0 0 7 0 0 0 0]
1526
+ [ 0 0 0 0 0 0 0 0]
1527
+ [ 0 -7 0 0 0 0 0 0]
1528
+ [ 0 0 0 0 0 0 0 0]
1529
+ [ 0 0 0 0 0 0 0 7]
1530
+ [ 0 0 0 0 0 0 0 0]
1531
+ [ 0 0 0 0 0 -7 0 0]
1532
+ """
1533
+ P = self.parent()
1534
+ return P.element_class(P, x*self._real, x*self._imag)
1535
+
1536
+ def monomial_coefficients(self, copy=False):
1537
+ """
1538
+ Return the monomial coefficients of ``self``.
1539
+
1540
+ EXAMPLES::
1541
+
1542
+ sage: L = LieAlgebra(QQ, cartan_type=['C',3], representation="compact real")
1543
+ sage: B = L.basis()
1544
+ sage: x = L.sum(i*B[i] for i in range(len(B)))
1545
+ sage: x.monomial_coefficients() == {i: i for i in range(1,len(B))}
1546
+ True
1547
+ """
1548
+ if self._mc is None:
1549
+ P = self.parent()
1550
+ B = [b._real.list() + b._imag.list() for b in P.basis()]
1551
+ B.append(self._real.list() + self._imag.list())
1552
+ R = self.base_ring()
1553
+ F = FreeModule(R, len(B[0]))
1554
+ dep = list(F.linear_dependence([F(b) for b in B])[0])
1555
+ last = dep.pop()
1556
+ self._mc = {i: R(-val / last) for i,val in enumerate(dep) if val != 0}
1557
+ if copy:
1558
+ return dict(self._mc)
1559
+ return self._mc
1560
+
1561
+
1562
+ #######################################
1563
+ # Chevalley Basis
1564
+
1565
+ class LieAlgebraChevalleyBasis(LieAlgebraWithStructureCoefficients):
1566
+ r"""
1567
+ A simple finite dimensional Lie algebra in the Chevalley basis.
1568
+
1569
+ Let `L` be a simple (complex) Lie algebra with roots `\Phi`, then the
1570
+ Chevalley basis is given by `e_{\alpha}` for all `\alpha \in \Phi` and
1571
+ `h_{\alpha_i} := h_i` where `\alpha_i` is a simple root subject. These
1572
+ generators are subject to the relations:
1573
+
1574
+ .. MATH::
1575
+
1576
+ \begin{aligned}
1577
+ [h_i, h_j] & = 0,
1578
+ \\ [h_i, e_{\beta}] & = A_{\alpha_i, \beta} e_{\beta},
1579
+ \\ [e_{\beta}, e_{-\beta}] & = \sum_i A_{\beta, \alpha_i} h_i,
1580
+ \\ [e_{\beta}, e_{\gamma}] & = \begin{cases}
1581
+ N_{\beta,\gamma} e_{\beta + \gamma} & \beta + \gamma \in \Phi, \\
1582
+ 0 & \text{otherwise,} \end{cases}
1583
+ \end{aligned}
1584
+
1585
+ where `A_{\alpha, \beta} = \frac{2 (\alpha, \beta)}{(\alpha, \alpha)}`
1586
+ and `N_{\alpha, \beta}` is the maximum such that
1587
+ `\alpha - N_{\alpha, \beta} \beta \in \Phi`.
1588
+
1589
+ For computing the signs of the coefficients, see Section 3 of [CMT2003]_.
1590
+
1591
+ .. SEEALSO::
1592
+
1593
+ For simply-laced types, an alternative construction using an asymmetry
1594
+ function is given by :class:`LieAlgebraChevalleyBasis_simply_laced`.
1595
+ """
1596
+ @staticmethod
1597
+ def __classcall_private__(cls, R, cartan_type, epsilon=None):
1598
+ """
1599
+ Normalize ``self`` to ensure a unique representation.
1600
+
1601
+ TESTS::
1602
+
1603
+ sage: L1 = LieAlgebra(QQ, cartan_type=['A', 2])
1604
+ sage: L2 = LieAlgebra(QQ, cartan_type=CartanType(['A', 2]))
1605
+ sage: L3 = LieAlgebra(QQ, cartan_type=CartanMatrix(['A', 2]))
1606
+ sage: L1 is L2 and L2 is L3
1607
+ True
1608
+
1609
+
1610
+ sage: L = LieAlgebra(QQ, cartan_type=['A', 2], epsilon=[(1,2)])
1611
+ sage: type(L)
1612
+ <class '...LieAlgebraChevalleyBasis_simply_laced_with_category'>
1613
+ sage: L = LieAlgebra(QQ, cartan_type=['A', 1], epsilon=[])
1614
+ sage: type(L)
1615
+ <class '...LieAlgebraChevalleyBasis_simply_laced_with_category'>
1616
+
1617
+ sage: L = LieAlgebra(QQ, cartan_type=['A', 2], epsilon=[(2,3)])
1618
+ Traceback (most recent call last):
1619
+ ...
1620
+ ValueError: not a valid Dynkin orientation
1621
+ sage: L = LieAlgebra(QQ, cartan_type=['A', 2], epsilon=[(1,2), (2,1)])
1622
+ Traceback (most recent call last):
1623
+ ...
1624
+ ValueError: not a valid Dynkin orientation
1625
+ sage: L = LieAlgebra(QQ, cartan_type=['A', 2], epsilon=[(1,2), (1,1)])
1626
+ Traceback (most recent call last):
1627
+ ...
1628
+ ValueError: not a valid Dynkin orientation
1629
+ sage: L = LieAlgebra(QQ, cartan_type=['A', 1], epsilon=[(1,1)])
1630
+ Traceback (most recent call last):
1631
+ ...
1632
+ ValueError: not a valid Dynkin orientation
1633
+ """
1634
+ if isinstance(cartan_type, (CartanMatrix, DynkinDiagram_class)):
1635
+ cartan_type = cartan_type.cartan_type()
1636
+ else:
1637
+ cartan_type = CartanType(cartan_type)
1638
+ if epsilon is not None:
1639
+ if not cartan_type.is_simply_laced():
1640
+ raise ValueError("the Cartan type must be simply-laced with an asymmetry function")
1641
+ epsilon = frozenset([tuple(p) for p in epsilon])
1642
+ if cartan_type.rank() == 1:
1643
+ if epsilon:
1644
+ raise ValueError("not a valid Dynkin orientation")
1645
+ else:
1646
+ from sage.graphs.graph import Graph
1647
+ G = Graph(epsilon, multiedges=True, loops=True, format='list_of_edges')
1648
+ if (G.has_multiple_edges() or G.has_loops()
1649
+ or cartan_type.dynkin_diagram().to_undirected() != G.to_simple()):
1650
+ raise ValueError("not a valid Dynkin orientation")
1651
+ return LieAlgebraChevalleyBasis_simply_laced(R, cartan_type, epsilon)
1652
+ return super().__classcall__(cls, R, cartan_type)
1653
+
1654
+ def __init__(self, R, cartan_type):
1655
+ r"""
1656
+ Initialize ``self``.
1657
+
1658
+ TESTS::
1659
+
1660
+ sage: L = LieAlgebra(QQ, cartan_type=['A',2])
1661
+ sage: TestSuite(L).run() # long time
1662
+ """
1663
+ self._cartan_type = cartan_type
1664
+ self._Q = cartan_type.root_system().root_lattice()
1665
+ p_roots = list(self._Q.positive_roots_by_height())
1666
+ n_roots = [-x for x in p_roots]
1667
+ self._p_roots_index = OrderedDict((al, i)
1668
+ for i, al in enumerate(p_roots))
1669
+
1670
+ alphacheck = self._Q.simple_coroots()
1671
+ # We pass p_roots and n_roots so we don't have to reconstruct them
1672
+ s_coeffs = self._construct_struct_coeffs(R, p_roots)
1673
+
1674
+ # Make sure a < b for all (a, b) in the coefficients and flip if necessary
1675
+ for k in list(s_coeffs):
1676
+ a, b = k
1677
+ if self._basis_key(a) > self._basis_key(b):
1678
+ s_coeffs[(b, a)] = [(index, -v) for index, v in s_coeffs[k].items()]
1679
+ del s_coeffs[k]
1680
+ else:
1681
+ s_coeffs[k] = s_coeffs[k].items()
1682
+
1683
+ I = self._cartan_type.index_set()
1684
+ names = ['e{}'.format(i) for i in I]
1685
+ names += ['f{}'.format(i) for i in I]
1686
+ names += ['h{}'.format(i) for i in I]
1687
+ category = TriangularKacMoodyAlgebras(R).FiniteDimensional()
1688
+ index_set = p_roots + list(alphacheck) + n_roots
1689
+ self._cartan_indices = range(len(p_roots), len(p_roots) + len(alphacheck))
1690
+ names = tuple(names)
1691
+ from sage.sets.finite_enumerated_set import FiniteEnumeratedSet
1692
+ index_set = FiniteEnumeratedSet(index_set)
1693
+ LieAlgebraWithStructureCoefficients.__init__(self, R, s_coeffs, names, index_set,
1694
+ category, prefix='E', bracket='[',
1695
+ sorting_key=self._basis_key)
1696
+
1697
+ def _construct_struct_coeffs(self, R, p_roots):
1698
+ """
1699
+ Construct the structure coefficients of ``self``.
1700
+
1701
+ EXAMPLES::
1702
+
1703
+ sage: L = LieAlgebra(QQ, cartan_type=['A',1], epsilon=[])
1704
+ sage: sorted(L._construct_struct_coeffs(QQ, list(L._Q.positive_roots())).items(), key=str)
1705
+ [((alpha[1], -alpha[1]), {alphacheck[1]: 1}),
1706
+ ((alpha[1], alphacheck[1]), {alpha[1]: -2}),
1707
+ ((alphacheck[1], -alpha[1]), {-alpha[1]: -2})]
1708
+
1709
+ TESTS:
1710
+
1711
+ Check that we can construct Lie algebras over positive characteristic
1712
+ fields (:issue:`37773`)::
1713
+
1714
+ sage: sl3 = LieAlgebra(GF(3), cartan_type=['A',2])
1715
+ sage: sl3.center().basis()
1716
+ Finite family {alphacheck[2]: 2*h1 + h2}
1717
+ sage: sl4 = lie_algebras.sl(GF(3), 4)
1718
+ sage: sl4.center().dimension()
1719
+ 0
1720
+ sage: sl4.is_nilpotent()
1721
+ False
1722
+ sage: sl4.lower_central_series()
1723
+ (Lie algebra of ['A', 3] in the Chevalley basis,)
1724
+ sage: sl4.is_solvable()
1725
+ False
1726
+ sage: sl4.is_semisimple()
1727
+ True
1728
+ sage: sl4.killing_form_matrix().det()
1729
+ 2
1730
+ sage: sl5 = lie_algebras.sl(GF(3), 5)
1731
+ sage: sl5.killing_form_matrix().det()
1732
+ 2
1733
+
1734
+ This also includes characteristic 2::
1735
+
1736
+ sage: sl4 = LieAlgebra(GF(2), cartan_type=['A',3])
1737
+ sage: sl4.center().basis()
1738
+ Finite family {alphacheck[3]: h1 + h3}
1739
+ sage: sp6 = LieAlgebra(GF(2), cartan_type=['C',3])
1740
+ sage: sp6.killing_form_matrix().det()
1741
+ 0
1742
+ sage: F4 = LieAlgebra(GF(2), cartan_type=['F',4])
1743
+ sage: F4.killing_form_matrix().det() # long time
1744
+ 0
1745
+ sage: G2 = LieAlgebra(GF(2), cartan_type=['G',2])
1746
+ sage: G2.killing_form_matrix().det()
1747
+ 0
1748
+ """
1749
+ alphacheck = self._Q.simple_coroots()
1750
+ roots = frozenset(self._Q.roots())
1751
+ # We do everything initially over QQ and then convert to R at the end
1752
+ # since this is a ZZ-basis.
1753
+ from sage.rings.rational_field import QQ
1754
+ one = QQ.one()
1755
+
1756
+ # Determine the signs for the structure coefficients from the root system
1757
+ # We first create the special roots
1758
+ sp_sign = {}
1759
+ for i,a in enumerate(p_roots):
1760
+ for b in p_roots[i+1:]:
1761
+ if a + b not in p_roots:
1762
+ continue
1763
+
1764
+ # Compute the sign for the extra special pair
1765
+ x, y = (a + b).extraspecial_pair()
1766
+
1767
+ if (x, y) == (a, b): # If it already is an extra special pair
1768
+ if (x, y) not in sp_sign:
1769
+ # This swap is so the structure coefficients match with GAP
1770
+ if (sum(x.coefficients()) == sum(y.coefficients())
1771
+ and str(x) > str(y)):
1772
+ y,x = x,y
1773
+ sp_sign[(x, y)] = -one
1774
+ sp_sign[(y, x)] = one
1775
+ continue
1776
+
1777
+ if b - x in roots:
1778
+ t1 = ((b-x).norm_squared() / b.norm_squared()
1779
+ * sp_sign[(x, b-x)] * sp_sign[(a, y-a)])
1780
+ else:
1781
+ t1 = 0
1782
+ if a - x in roots:
1783
+ t2 = ((a-x).norm_squared() / a.norm_squared()
1784
+ * sp_sign[(x, a-x)] * sp_sign[(b, y-b)])
1785
+ else:
1786
+ t2 = 0
1787
+
1788
+ if t1 - t2 > 0:
1789
+ sp_sign[(a,b)] = -one
1790
+ elif t2 - t1 > 0:
1791
+ sp_sign[(a,b)] = one
1792
+ sp_sign[(b,a)] = -sp_sign[(a,b)]
1793
+
1794
+ # Function to construct the structure coefficients (up to sign)
1795
+ def e_coeff(r, s):
1796
+ p = 1
1797
+ while r - p*s in roots:
1798
+ p += 1
1799
+ return p
1800
+
1801
+ # Now we can compute all necessary structure coefficients
1802
+ s_coeffs = {}
1803
+ for i,r in enumerate(p_roots):
1804
+ # [e_r, h_i] and [h_i, f_r]
1805
+ for ac in alphacheck:
1806
+ c = R(r.scalar(ac))
1807
+ if c == 0:
1808
+ continue
1809
+ s_coeffs[(r, ac)] = {r: -c}
1810
+ s_coeffs[(ac, -r)] = {-r: -c}
1811
+
1812
+ # [e_r, f_r]
1813
+ s_coeffs[(r, -r)] = {alphacheck[j]: Rc
1814
+ for j, c in r.associated_coroot() if (Rc := R(c))}
1815
+
1816
+ # [e_r, e_s] and [e_r, f_s] with r != +/-s
1817
+ # We assume s is positive, as otherwise we negate
1818
+ # both r and s and the resulting coefficient
1819
+ for j, s in enumerate(p_roots[i+1:], start=i+1):
1820
+ #j += i + 1 # Offset
1821
+ # Since h(s) >= h(r), we have s - r > 0 when s - r is a root
1822
+ # [f_r, e_s]
1823
+ if s - r in p_roots:
1824
+ c = e_coeff(r, -s)
1825
+ a, b = s-r, r
1826
+ if self._p_roots_index[a] > self._p_roots_index[b]: # Note a != b
1827
+ c *= -sp_sign[(b, a)]
1828
+ else:
1829
+ c *= sp_sign[(a, b)]
1830
+ c = R(c)
1831
+ if c:
1832
+ s_coeffs[(-r, s)] = {a: -c}
1833
+ s_coeffs[(r, -s)] = {-a: c}
1834
+
1835
+ # [e_r, e_s]
1836
+ a = r + s
1837
+ if a in p_roots:
1838
+ # (r, s) is a special pair
1839
+ c = R(e_coeff(r, s) * sp_sign[(r, s)])
1840
+ if c:
1841
+ s_coeffs[(r, s)] = {a: c}
1842
+ s_coeffs[(-r, -s)] = {-a: -c}
1843
+
1844
+ return s_coeffs
1845
+
1846
+ def _repr_(self):
1847
+ """
1848
+ Return a string representation of ``self``.
1849
+
1850
+ EXAMPLES::
1851
+
1852
+ sage: LieAlgebra(QQ, cartan_type=['A', 2])
1853
+ Lie algebra of ['A', 2] in the Chevalley basis
1854
+ """
1855
+ return "Lie algebra of {} in the Chevalley basis".format(self._cartan_type)
1856
+
1857
+ def _latex_(self):
1858
+ r"""
1859
+ Return a latex representation of ``self``.
1860
+
1861
+ EXAMPLES::
1862
+
1863
+ sage: g = LieAlgebra(QQ, cartan_type=['A', 2])
1864
+ sage: latex(g)
1865
+ \mathfrak{g}(A_{2})_{\Bold{Q}}
1866
+ """
1867
+ from sage.misc.latex import latex
1868
+ return r"\mathfrak{{g}}({})_{{{}}}".format(latex(self._cartan_type), latex(self.base_ring()))
1869
+
1870
+ def _test_structure_coeffs(self, **options):
1871
+ """
1872
+ Check the structure coefficients against the GAP implementation.
1873
+
1874
+ EXAMPLES::
1875
+
1876
+ sage: L = LieAlgebra(ZZ, cartan_type=['G',2])
1877
+ sage: L._test_structure_coeffs() # needs sage.libs.gap
1878
+ """
1879
+ tester = self._tester(**options)
1880
+ ct = self.cartan_type()
1881
+
1882
+ # Setup the GAP objects
1883
+ from sage.libs.gap.libgap import libgap
1884
+ L = libgap.SimpleLieAlgebra(ct.letter, ct.n, libgap(self.base_ring()))
1885
+ pos_B, neg_B, _ = libgap.ChevalleyBasis(L)
1886
+ gap_p_roots = libgap.PositiveRoots(libgap.RootSystem(L)).sage()
1887
+ # E, F, H = libgap.CanonicalGenerators(L)
1888
+
1889
+ # Setup the conversion between the Sage roots and GAP roots.
1890
+ # The GAP roots are given in terms of the weight lattice.
1891
+ p_roots = list(self._Q.positive_roots_by_height())
1892
+ WL = ct.root_system().weight_lattice()
1893
+ La = WL.fundamental_weights()
1894
+ convert = {WL(root): root for root in p_roots}
1895
+ index = {convert[sum(c*La[j+1] for j,c in enumerate(rt))]: i
1896
+ for i, rt in enumerate(gap_p_roots)}
1897
+
1898
+ # Run the check
1899
+ basis = self.basis()
1900
+ roots = frozenset(p_roots)
1901
+ for i,x in enumerate(p_roots):
1902
+ for y in p_roots[i+1:]:
1903
+ if x + y in roots:
1904
+ c = basis[x].bracket(basis[y]).leading_coefficient()
1905
+ a, b = (x + y).extraspecial_pair()
1906
+ if (x, y) == (a, b): # If it already is an extra special pair
1907
+ tester.assertEqual(pos_B[index[x]] * pos_B[index[y]],
1908
+ c * pos_B[index[x+y]],
1909
+ "extra special pair differ for [{}, {}]".format(x, y))
1910
+ else:
1911
+ tester.assertEqual(pos_B[index[x]] * pos_B[index[y]],
1912
+ c * pos_B[index[x+y]],
1913
+ "incorrect structure coefficient for [{}, {}]".format(x, y))
1914
+ if x - y in roots: # This must be a negative root if it is a root
1915
+ c = basis[x].bracket(basis[-y]).leading_coefficient()
1916
+ tester.assertEqual(pos_B[index[x]] * neg_B[index[y]],
1917
+ c * neg_B[index[x-y]],
1918
+ "incorrect structure coefficient for [{}, {}]".format(x, y))
1919
+
1920
+ def _repr_generator(self, m):
1921
+ """
1922
+ Return a string representation of the basis element indexed by ``m``.
1923
+
1924
+ EXAMPLES::
1925
+
1926
+ sage: L = LieAlgebra(QQ, cartan_type=['A', 2])
1927
+ sage: K = L.basis().keys()
1928
+ sage: L._repr_generator(K[0])
1929
+ 'E[alpha[2]]'
1930
+ sage: L._repr_generator(K[4])
1931
+ 'h2'
1932
+ """
1933
+ if m in self._Q.simple_coroots():
1934
+ return "h{}".format(m.support()[0])
1935
+ return IndexedGenerators._repr_generator(self, m)
1936
+
1937
+ def _latex_generator(self, m):
1938
+ r"""
1939
+ Return a latex representation of the basis element indexed by ``m``.
1940
+
1941
+ EXAMPLES::
1942
+
1943
+ sage: L = LieAlgebra(QQ, cartan_type=['A', 2])
1944
+ sage: K = L.basis().keys()
1945
+ sage: L._latex_generator(K[0])
1946
+ 'E_{\\alpha_{2}}'
1947
+ sage: L._latex_generator(K[4])
1948
+ 'h_{2}'
1949
+ """
1950
+ if m in self._Q.simple_coroots():
1951
+ return "h_{{{}}}".format(m.support()[0])
1952
+ return IndexedGenerators._latex_generator(self, m)
1953
+
1954
+ def _basis_key(self, x):
1955
+ """
1956
+ Compare two basis element indices. We order the basis elements by
1957
+ positive roots, coroots, and negative roots and then according to
1958
+ height.
1959
+
1960
+ OUTPUT:
1961
+
1962
+ If ``x == y``, return 0. If ``x < y``, return -1. Else return 1.
1963
+
1964
+ EXAMPLES::
1965
+
1966
+ sage: L = LieAlgebra(QQ, cartan_type=['B', 2])
1967
+ sage: K = L.basis().keys()
1968
+ sage: S = sorted(K, key=L._basis_key); S
1969
+ [alpha[2],
1970
+ alpha[1],
1971
+ alpha[1] + alpha[2],
1972
+ alpha[1] + 2*alpha[2],
1973
+ alphacheck[1],
1974
+ alphacheck[2],
1975
+ -alpha[2],
1976
+ -alpha[1],
1977
+ -alpha[1] - alpha[2],
1978
+ -alpha[1] - 2*alpha[2]]
1979
+ sage: S == K
1980
+ False
1981
+ """
1982
+ if x in self._p_roots_index:
1983
+ return self._p_roots_index[x]
1984
+ if -x in self._p_roots_index:
1985
+ return (len(self._p_roots_index)
1986
+ + self._cartan_type.rank()
1987
+ + self._p_roots_index[-x])
1988
+ alphacheck = list(self._Q.simple_coroots())
1989
+ try:
1990
+ return len(self._p_roots_index) + alphacheck.index(x)
1991
+ except ValueError:
1992
+ raise KeyError(x)
1993
+
1994
+ def degree_on_basis(self, m):
1995
+ """
1996
+ Return the degree of the basis element indexed by ``m``.
1997
+
1998
+ EXAMPLES::
1999
+
2000
+ sage: L = LieAlgebra(QQ, cartan_type=['G', 2])
2001
+ sage: [L.degree_on_basis(m) for m in L.basis().keys()]
2002
+ [alpha[2], alpha[1], alpha[1] + alpha[2],
2003
+ 2*alpha[1] + alpha[2], 3*alpha[1] + alpha[2],
2004
+ 3*alpha[1] + 2*alpha[2],
2005
+ 0, 0,
2006
+ -alpha[2], -alpha[1], -alpha[1] - alpha[2],
2007
+ -2*alpha[1] - alpha[2], -3*alpha[1] - alpha[2],
2008
+ -3*alpha[1] - 2*alpha[2]]
2009
+ """
2010
+ if m.parent() is self._Q:
2011
+ return m
2012
+ return self._Q.zero()
2013
+
2014
+ def _negative_half_index_set(self):
2015
+ """
2016
+ Return the index set of the basis for the negative half of ``self``.
2017
+
2018
+ EXAMPLES::
2019
+
2020
+ sage: L = lie_algebras.sp(QQ, 4)
2021
+ sage: L._negative_half_index_set()
2022
+ [-alpha[2], -alpha[1], -alpha[1] - alpha[2],
2023
+ -2*alpha[1] - alpha[2]]
2024
+ """
2025
+ return [-x for x in self._p_roots_index]
2026
+
2027
+ def _weight_action(self, m, wt):
2028
+ """
2029
+ Return the action of the basis element indexed by ``m`` on ``wt``.
2030
+
2031
+ INPUT:
2032
+
2033
+ - ``m`` -- an index of a basis element of the Cartan subalgebra
2034
+ - ``wt`` -- a weight
2035
+
2036
+ EXAMPLES::
2037
+
2038
+ sage: L = lie_algebras.sp(QQ, 6)
2039
+ sage: La = L.cartan_type().root_system().ambient_space().fundamental_weights()
2040
+ sage: mu = La[1] - 3/5*La[2]
2041
+ sage: ac = L.cartan_type().root_system().coroot_lattice().simple_roots()
2042
+ sage: L._weight_action(ac[1], mu)
2043
+ 1
2044
+ sage: L._weight_action(ac[2], mu)
2045
+ -3/5
2046
+ sage: L._weight_action(ac[3], mu)
2047
+ 0
2048
+ """
2049
+ ac = self._cartan_type.root_system().root_lattice().simple_coroots()
2050
+ aci = dict(ac.inverse_family())
2051
+ if m not in aci:
2052
+ raise ValueError("not an element in the Cartan subalgebra")
2053
+ R = self.base_ring()
2054
+ # This is a little ugly way to make sure we have the correct
2055
+ # coroots. However, it does work as :meth:`scalar` is not smart
2056
+ # enough in the ambient space to correctly convert things to do
2057
+ # the scalar product.
2058
+ alc = wt.parent().simple_coroots()
2059
+ return R(wt.scalar(alc[aci[m]]))
2060
+
2061
+ def affine(self, kac_moody=True):
2062
+ r"""
2063
+ Return the affine Lie algebra of ``self``.
2064
+
2065
+ EXAMPLES::
2066
+
2067
+ sage: sp6 = lie_algebras.sp(QQ, 6)
2068
+ sage: sp6
2069
+ Lie algebra of ['C', 3] in the Chevalley basis
2070
+ sage: sp6.affine()
2071
+ Affine Kac-Moody algebra of ['C', 3] in the Chevalley basis
2072
+
2073
+ sage: L = LieAlgebra(QQ, cartan_type=['A',3], epsilon=[(1,2),(3,2)])
2074
+ sage: L.affine(False)
2075
+ Affine Lie algebra of ['A', 3] in the Chevalley basis
2076
+ sage: L.affine(True)
2077
+ Affine Kac-Moody algebra of ['A', 3] in the Chevalley basis
2078
+ """
2079
+ from sage.algebras.lie_algebras.affine_lie_algebra import AffineLieAlgebra
2080
+ return AffineLieAlgebra(self, kac_moody=kac_moody)
2081
+
2082
+ # Useful in creating the UEA
2083
+ @cached_method
2084
+ def indices_to_positive_roots_map(self):
2085
+ r"""
2086
+ Return the map from indices to positive roots.
2087
+
2088
+ EXAMPLES::
2089
+
2090
+ sage: L = LieAlgebra(QQ, cartan_type=['A', 2])
2091
+ sage: L.indices_to_positive_roots_map()
2092
+ {1: alpha[1], 2: alpha[2], 3: alpha[1] + alpha[2]}
2093
+ """
2094
+ return {i+1: r for i, r in enumerate(self._Q.positive_roots())}
2095
+
2096
+ @cached_method
2097
+ def lie_algebra_generators(self, str_keys=False):
2098
+ r"""
2099
+ Return the Chevalley Lie algebra generators of ``self``.
2100
+
2101
+ INPUT:
2102
+
2103
+ - ``str_keys`` -- boolean (default: ``False``); set to ``True`` to have
2104
+ the indices indexed by strings instead of simple (co)roots
2105
+
2106
+ EXAMPLES::
2107
+
2108
+ sage: L = LieAlgebra(QQ, cartan_type=['A', 1])
2109
+ sage: L.lie_algebra_generators()
2110
+ Finite family {alpha[1]: E[alpha[1]], -alpha[1]: E[-alpha[1]], alphacheck[1]: h1}
2111
+ sage: L.lie_algebra_generators(True)
2112
+ Finite family {'e1': E[alpha[1]], 'f1': E[-alpha[1]], 'h1': h1}
2113
+ """
2114
+ index_set = self._cartan_type.index_set()
2115
+ alpha = self._Q.simple_roots()
2116
+ alphacheck = self._Q.simple_coroots()
2117
+ B = self.basis()
2118
+ ret = {}
2119
+
2120
+ if str_keys:
2121
+ for i in index_set:
2122
+ al = alpha[i]
2123
+ ret['e{}'.format(i)] = B[al]
2124
+ ret['f{}'.format(i)] = B[-al]
2125
+ ret['h{}'.format(i)] = B[alphacheck[i]]
2126
+ keys = (['e{}'.format(i) for i in index_set]
2127
+ + ['f{}'.format(i) for i in index_set]
2128
+ + ['h{}'.format(i) for i in index_set])
2129
+ else:
2130
+ for i in index_set:
2131
+ al = alpha[i]
2132
+ ret[al] = B[al]
2133
+ ret[-al] = B[-al]
2134
+ ret[alphacheck[i]] = B[alphacheck[i]]
2135
+ keys = ([alpha[i] for i in index_set]
2136
+ + [-alpha[i] for i in index_set]
2137
+ + [alphacheck[i] for i in index_set])
2138
+
2139
+ return Family(keys, ret.__getitem__)
2140
+
2141
+ @cached_method
2142
+ def _part_generators(self, positive=False):
2143
+ r"""
2144
+ Return the Lie algebra generators for the positive or
2145
+ negative half of ``self``.
2146
+
2147
+ INPUT:
2148
+
2149
+ - ``positive`` -- boolean (default: ``False``); if ``True``
2150
+ then return positive part generators, otherwise the return
2151
+ the negative part generators
2152
+
2153
+ OUTPUT:
2154
+
2155
+ A :func:`~sage.sets.family.Family` whose keys are the
2156
+ index set of ``self``.
2157
+
2158
+ EXAMPLES::
2159
+
2160
+ sage: L = LieAlgebra(QQ, cartan_type=['G', 2])
2161
+ sage: list(L._part_generators(True))
2162
+ [E[alpha[1]],
2163
+ E[alpha[2]]]
2164
+ """
2165
+ I = self._cartan_type.index_set()
2166
+ al = self._Q.simple_roots()
2167
+ G = self.lie_algebra_generators()
2168
+ if positive:
2169
+ d = {i: G[al[i]] for i in I}
2170
+ else:
2171
+ d = {i: G[-al[i]] for i in I}
2172
+ return Family(I, d.__getitem__)
2173
+
2174
+ @cached_method
2175
+ def gens(self) -> tuple:
2176
+ r"""
2177
+ Return the generators of ``self`` in the order of `e_i`, `f_i`,
2178
+ and `h_i`.
2179
+
2180
+ EXAMPLES::
2181
+
2182
+ sage: L = LieAlgebra(QQ, cartan_type=['A', 2])
2183
+ sage: L.gens()
2184
+ (E[alpha[1]], E[alpha[2]], E[-alpha[1]], E[-alpha[2]], h1, h2)
2185
+ """
2186
+ index_set = self._cartan_type.index_set()
2187
+ alpha = self._Q.simple_roots()
2188
+ alphacheck = self._Q.simple_coroots()
2189
+ B = self.basis()
2190
+
2191
+ ret = [B[alpha[i]] for i in index_set]
2192
+ ret.extend(B[-alpha[i]] for i in index_set)
2193
+ ret.extend(B[alphacheck[i]] for i in index_set)
2194
+ return tuple(ret)
2195
+
2196
+ def highest_root_basis_elt(self, pos=True):
2197
+ r"""
2198
+ Return the basis element corresponding to the highest root `\theta`.
2199
+
2200
+ INPUT:
2201
+
2202
+ - ``pos`` -- boolean (default: ``True``); if ``True``, then return
2203
+ `e_{\theta}`, otherwise return `f_{\theta}`
2204
+
2205
+ EXAMPLES::
2206
+
2207
+ sage: L = LieAlgebra(QQ, cartan_type=['A', 2])
2208
+ sage: L.highest_root_basis_elt()
2209
+ E[alpha[1] + alpha[2]]
2210
+ sage: L.highest_root_basis_elt(False)
2211
+ E[-alpha[1] - alpha[2]]
2212
+ """
2213
+ theta = self._Q.highest_root()
2214
+ B = self.basis()
2215
+ if pos:
2216
+ return B[theta]
2217
+ return B[-theta]
2218
+
2219
+ @cached_method
2220
+ def killing_form_matrix(self):
2221
+ r"""
2222
+ Return the matrix of the Killing form of ``self``.
2223
+
2224
+ The rows and the columns of this matrix are indexed by the
2225
+ elements of the basis of ``self`` (in the order provided by
2226
+ :meth:`basis`).
2227
+
2228
+ EXAMPLES::
2229
+
2230
+ sage: g = LieAlgebra(QQ, cartan_type=['A', 2])
2231
+ sage: g.killing_form_matrix()
2232
+ [ 0 0 0 0 0 6 0 0]
2233
+ [ 0 0 0 0 0 0 6 0]
2234
+ [ 0 0 0 0 0 0 0 6]
2235
+ [ 0 0 0 12 -6 0 0 0]
2236
+ [ 0 0 0 -6 12 0 0 0]
2237
+ [ 6 0 0 0 0 0 0 0]
2238
+ [ 0 6 0 0 0 0 0 0]
2239
+ [ 0 0 6 0 0 0 0 0]
2240
+ """
2241
+ B = self.basis()
2242
+ Q = self._Q
2243
+ from sage.matrix.constructor import matrix
2244
+ ret = matrix.zero(self.base_ring(), self._M.rank())
2245
+ keys = list(B.keys())
2246
+ for i, a in enumerate(keys):
2247
+ for j, b in enumerate(keys[i:], start=i):
2248
+ if ((a in Q) != (b in Q)) or (a in Q and a + b):
2249
+ continue
2250
+ # either a and b are both coroots or a + b == 0
2251
+ temp = self.killing_matrix(B[a], B[b]).trace()
2252
+ ret[i, j] = temp
2253
+ ret[j, i] = temp
2254
+ ret.set_immutable()
2255
+ return ret
2256
+
2257
+ def killing_form(self, x, y):
2258
+ r"""
2259
+ Return the Killing form on ``x`` and ``y``, where ``x``
2260
+ and ``y`` are two elements of ``self``.
2261
+
2262
+ The Killing form is defined as
2263
+
2264
+ .. MATH::
2265
+
2266
+ \langle x \mid y \rangle
2267
+ = \operatorname{tr}\left( \operatorname{ad}_x
2268
+ \circ \operatorname{ad}_y \right).
2269
+
2270
+ EXAMPLES::
2271
+
2272
+ sage: L = LieAlgebra(QQ, cartan_type=['A', 2])
2273
+ sage: L.killing_form(L.an_element(), L.an_element())
2274
+ 36
2275
+ sage: B = L.basis()
2276
+ sage: matrix([[L.killing_form(a, b) for a in B] for b in B])
2277
+ [ 0 0 0 0 0 6 0 0]
2278
+ [ 0 0 0 0 0 0 6 0]
2279
+ [ 0 0 0 0 0 0 0 6]
2280
+ [ 0 0 0 12 -6 0 0 0]
2281
+ [ 0 0 0 -6 12 0 0 0]
2282
+ [ 6 0 0 0 0 0 0 0]
2283
+ [ 0 6 0 0 0 0 0 0]
2284
+ [ 0 0 6 0 0 0 0 0]
2285
+ """
2286
+ return x.value * self.killing_form_matrix() * y.value
2287
+
2288
+
2289
+ class LieAlgebraChevalleyBasis_simply_laced(LieAlgebraChevalleyBasis):
2290
+ r"""
2291
+ A finite dimensional simply-laced Lie algebra in the Chevalley basis
2292
+ with structure coefficients given by an orientation of the Dynkin
2293
+ diagram.
2294
+
2295
+ We follow Chapter 7.7 of [Ka1990]_, where the structure coefficients
2296
+ are given by an :meth:`asymmetry function <asymmetry_function>` defined by
2297
+ `\varepsilon(\alpha_i, \alpha_j) = -1` if there is an arrow `i \to j` in
2298
+ the Dynkin quiver (an orientation of the Dynkin diagram). However we twist
2299
+ `E_{\alpha}` by `\mathrm{sign}(\alpha)` so that `F_i = E_{-\alpha_i}`
2300
+ rather than its negative.
2301
+
2302
+ EXAMPLES::
2303
+
2304
+ sage: L = LieAlgebra(QQ, cartan_type=['A', 2], epsilon=[(2, 1)])
2305
+ sage: L.e(1).bracket(L.e(2))
2306
+ E[alpha[1] + alpha[2]]
2307
+
2308
+ sage: L = LieAlgebra(QQ, cartan_type=['A', 2], epsilon=[(1, 2)])
2309
+ sage: L.e(1).bracket(L.e(2))
2310
+ -E[alpha[1] + alpha[2]]
2311
+ """
2312
+ def __init__(self, R, cartan_type, epsilon):
2313
+ """
2314
+ Initialize ``self``.
2315
+
2316
+ TESTS::
2317
+
2318
+ sage: L = LieAlgebra(QQ, cartan_type=['A', 2], epsilon=[(2,1)])
2319
+ sage: TestSuite(L).run(elements=list(L.basis()))
2320
+ sage: L = LieAlgebra(QQ, cartan_type=['D', 4], epsilon=[(2,1), (3,2), (4,2)])
2321
+ sage: TestSuite(L).run(elements=list(L.basis())) # long time
2322
+ """
2323
+ self._epsilon = epsilon
2324
+ super().__init__(R, cartan_type)
2325
+
2326
+ def _construct_struct_coeffs(self, R, p_roots):
2327
+ r"""
2328
+ Construct the structure coefficients of ``self``.
2329
+
2330
+ EXAMPLES::
2331
+
2332
+ sage: L = LieAlgebra(QQ, cartan_type=['A',1], epsilon=[])
2333
+ sage: sorted(L._construct_struct_coeffs(QQ, list(L._Q.positive_roots())).items(), key=str)
2334
+ [((alpha[1], -alpha[1]), {alphacheck[1]: 1}),
2335
+ ((alpha[1], alphacheck[1]), {alpha[1]: -2}),
2336
+ ((alphacheck[1], -alpha[1]), {-alpha[1]: -2})]
2337
+ """
2338
+ p_roots_set = set(p_roots)
2339
+ alphacheck = self._Q.simple_coroots()
2340
+
2341
+ s_coeffs = {}
2342
+ for i, r in enumerate(p_roots):
2343
+ # [e_r, h_i] and [h_i, f_r]
2344
+ for ac in alphacheck:
2345
+ c = r.scalar(ac)
2346
+ if c == 0:
2347
+ continue
2348
+ s_coeffs[(r, ac)] = {r: -c}
2349
+ s_coeffs[(ac, -r)] = {-r: -c}
2350
+
2351
+ # [e_r, f_r]
2352
+ s_coeffs[(r, -r)] = {alphacheck[j]: c
2353
+ for j, c in r.associated_coroot()}
2354
+
2355
+ # [e_r, e_s] and [e_r, f_s] with r != +/-s
2356
+ # We assume s is positive, as otherwise we negate
2357
+ # both r and s and the resulting coefficient
2358
+ for j, s in enumerate(p_roots[i+1:], start=i+1):
2359
+ if r + s in p_roots_set:
2360
+ coeff = R.prod((-1)**(ca*cb) if (ii, jj) in self._epsilon or ii == jj else 1
2361
+ for ii, ca in r._monomial_coefficients.items()
2362
+ for jj, cb in s._monomial_coefficients.items())
2363
+ s_coeffs[r, s] = {r+s: coeff}
2364
+ s_coeffs[-r, -s] = {-r-s: -coeff}
2365
+ if r - s in p_roots_set or s - r in p_roots_set:
2366
+ coeff = R.prod((-1)**(ca*cb) if (ii, jj) in self._epsilon or ii == jj else 1
2367
+ for ii, ca in r._monomial_coefficients.items()
2368
+ for jj, cb in s._monomial_coefficients.items())
2369
+ if r - s in p_roots_set:
2370
+ s_coeffs[r, -s] = {r-s: -coeff}
2371
+ s_coeffs[-r, s] = {s-r: coeff}
2372
+ else:
2373
+ s_coeffs[r, -s] = {r-s: coeff}
2374
+ s_coeffs[-r, s] = {s-r: -coeff}
2375
+
2376
+ return s_coeffs
2377
+
2378
+ def asymmetry_function(self):
2379
+ r"""
2380
+ Return the asymmetry function of ``self``.
2381
+
2382
+ An *asymmetry function* is a function `\varepsilon : Q \times Q
2383
+ \to \{1, -1\}` that satisfies the following properties:
2384
+
2385
+ 1. `\varepsilon(\alpha, \alpha) = (-1)^{(\alpha|\alpha)/2}`
2386
+ 2. bimultiplicativity `\varepsilon(alpha + \alpha', \beta) =
2387
+ \varepsilon(\alpha, \beta) \varepsilon(\alpha', \beta)` and
2388
+ `\varepsilon(alpha, \beta + \beta') =
2389
+ \varepsilon(\alpha, \beta) \varepsilon(\alpha', \beta)`,
2390
+
2391
+ where `(\alpha | \beta)` is the symmetric bilinear form on `Q` given
2392
+ by the Cartan matrix. Some consequences of these properties are that
2393
+ `\varepsilon(\alpha, 0) = \varepsilon(0, \beta) = 1` and
2394
+ `varepsilon(\alpha, \beta) \varepsilon(\beta, \alpha) =
2395
+ (-1)^{(\alpha|\beta)}`.
2396
+
2397
+ OUTPUT:
2398
+
2399
+ The asymmetry function as a ``dict`` consisting of pairs of all of
2400
+ the roots of `Q` and `0`.
2401
+
2402
+ EXAMPLES::
2403
+
2404
+ sage: L = LieAlgebra(QQ, cartan_type=['A',2], epsilon=[(2,1)])
2405
+ sage: ep = L.asymmetry_function()
2406
+ sage: al = L.cartan_type().root_system().root_lattice().simple_roots()
2407
+ sage: ep[al[1], al[2]]
2408
+ 1
2409
+ sage: ep[al[2],al[1]]
2410
+ -1
2411
+
2412
+ sage: L = LieAlgebra(QQ, cartan_type=['A',2], epsilon=[(1,2)])
2413
+ sage: ep = L.asymmetry_function()
2414
+ sage: al = L.cartan_type().root_system().root_lattice().simple_roots()
2415
+ sage: ep[al[1], al[2]]
2416
+ -1
2417
+ sage: ep[al[2],al[1]]
2418
+ 1
2419
+ """
2420
+ roots = set(self._Q.roots())
2421
+ al = self._Q.simple_roots()
2422
+
2423
+ ep = {(r, r): (-1)**(r.scalar(r.associated_coroot()) // 2) for r in roots}
2424
+ next_level = set()
2425
+ for i in self._Q.index_set():
2426
+ # ep[i,0] = ep[i,-j] * ep[i,j] = ep[i,0]^2
2427
+ # => ep[i,0] = 1 = ep[i,-j] * ep[i,j]
2428
+ # => ep[-i,0] = 1 = ep[-i,-j] * ep[-i,j]
2429
+ ep[al[i], self._Q.zero()] = 1
2430
+ ep[-al[i], self._Q.zero()] = 1
2431
+ for j in self._Q.index_set():
2432
+ if i == j or (i, j) in self._epsilon:
2433
+ ep[al[i], al[j]] = -1
2434
+ else:
2435
+ ep[al[i], al[j]] = 1
2436
+ next_level.add((al[i], al[j]))
2437
+ ep[al[i], -al[j]] = ep[al[i], al[j]]
2438
+ next_level.add((al[i], -al[j]))
2439
+ ep[-al[i], al[j]] = ep[al[i], al[j]]
2440
+ next_level.add((-al[i], al[j]))
2441
+ ep[-al[i], -al[j]] = ep[al[i], al[j]]
2442
+ next_level.add((-al[i], -al[j]))
2443
+
2444
+ while next_level:
2445
+ cur = next_level
2446
+ next_level = set()
2447
+ for r, s in cur:
2448
+ for a in al:
2449
+ prev = r
2450
+ temp = r + a
2451
+ while temp in roots or temp == 0:
2452
+ if (temp, s) in ep:
2453
+ break
2454
+ next_level.add((temp, s))
2455
+ ep[temp, s] = ep[prev, s] * ep[a, s]
2456
+ prev = temp
2457
+ temp += a
2458
+
2459
+ prev = r
2460
+ temp = r - a
2461
+ while temp in roots or temp == 0:
2462
+ if (temp, s) in ep:
2463
+ break
2464
+ next_level.add((temp, s))
2465
+ ep[temp, s] = ep[prev, s] * ep[-a, s]
2466
+ prev = temp
2467
+ temp -= a
2468
+
2469
+ prev = s
2470
+ temp = s + a
2471
+ while temp in roots or temp == 0:
2472
+ if (r, temp) in ep:
2473
+ break
2474
+ next_level.add((r, temp))
2475
+ ep[r, temp] = ep[r, prev] * ep[r, a]
2476
+ prev = temp
2477
+ temp += a
2478
+
2479
+ prev = s
2480
+ temp = s - a
2481
+ while temp in roots or temp == 0:
2482
+ if (r, temp) in ep:
2483
+ break
2484
+ next_level.add((r, temp))
2485
+ ep[r, temp] = ep[r, prev] * ep[r, -a]
2486
+ prev = temp
2487
+ temp -= a
2488
+
2489
+ return ep
2490
+
2491
+ def _test_structure_coeffs(self, **options):
2492
+ r"""
2493
+ Check the structure coefficients using the :meth:`asymmetry_function`.
2494
+
2495
+ EXAMPLES::
2496
+
2497
+ sage: L = LieAlgebra(ZZ, cartan_type=['A',4], epsilon=[(1,2), (3,2), (3,4)])
2498
+ sage: L._test_structure_coeffs()
2499
+ """
2500
+ tester = self._tester(**options)
2501
+
2502
+ ep = self.asymmetry_function()
2503
+
2504
+ roots = set(self._Q.roots())
2505
+ p_roots = set(self._Q.positive_roots())
2506
+ B = self.basis()
2507
+ for r in roots:
2508
+ for s in roots:
2509
+ if r + s not in roots:
2510
+ continue
2511
+ x = B[r].bracket(B[s])
2512
+ tester.assertEqual(list(x.support()), [r+s], f"[{r}, {s}] = {x} is not a root vector")
2513
+ sign = 1 if (r in p_roots) == (s in p_roots) else -1
2514
+ if (r + s) not in p_roots:
2515
+ sign = -sign
2516
+ tester.assertEqual(x[r+s], sign * ep[r, s], f"[{r}, {s}] = {x[r+s]} != {sign*ep[r,s]}")