Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
""" Classical Lie Algebras
These are the Lie algebras corresponding to types `A_n`, `B_n`, `C_n`, and `D_n`. We also include support for the exceptional types `E_{6,7,8}`, `F_4`, and `G_2` in the Chevalley basis, and we give the matrix representation given in [HRT2000]_.
AUTHORS:
- Travis Scrimshaw (2013-05-03): Initial version """
#***************************************************************************** # Copyright (C) 2013-2017 Travis Scrimshaw <tcscrims at gmail.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 2 of the License, or # (at your option) any later version. # http://www.gnu.org/licenses/ #*****************************************************************************
from sage.misc.abstract_method import abstract_method from sage.misc.cachefunc import cached_method from sage.misc.misc import repr_lincomb from sage.structure.parent import Parent from sage.structure.unique_representation import UniqueRepresentation from sage.structure.element import RingElement from sage.structure.indexed_generators import IndexedGenerators from sage.categories.algebras import Algebras from sage.categories.lie_algebras import LieAlgebras
from sage.algebras.algebra import Algebra from sage.algebras.free_algebra import FreeAlgebra from sage.algebras.lie_algebras.lie_algebra import FinitelyGeneratedLieAlgebra, LieAlgebraFromAssociative from sage.algebras.lie_algebras.lie_algebra_element import LieAlgebraElement from sage.algebras.lie_algebras.structure_coefficients import LieAlgebraWithStructureCoefficients from sage.combinat.root_system.cartan_type import CartanType from sage.combinat.root_system.cartan_matrix import CartanMatrix from sage.combinat.root_system.dynkin_diagram import DynkinDiagram_class from sage.combinat.free_module import CombinatorialFreeModule from sage.matrix.matrix_space import MatrixSpace from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing from sage.sets.family import Family
class ClassicalMatrixLieAlgebra(LieAlgebraFromAssociative): """ A classical Lie algebra represented using matrices.
INPUT:
- ``R`` -- the base ring - ``ct`` -- the finite Cartan type
EXAMPLES::
sage: lie_algebras.ClassicalMatrix(QQ, ['A', 4]) Special linear Lie algebra of rank 5 over Rational Field sage: lie_algebras.ClassicalMatrix(QQ, CartanType(['B',4])) Special orthogonal Lie algebra of rank 9 over Rational Field sage: lie_algebras.ClassicalMatrix(QQ, 'C4') Symplectic Lie algebra of rank 8 over Rational Field sage: lie_algebras.ClassicalMatrix(QQ, cartan_type=['D',4]) Special orthogonal Lie algebra of rank 8 over Rational Field """ @staticmethod def __classcall_private__(cls, R, cartan_type): """ Return the correct parent based on input.
EXAMPLES::
sage: lie_algebras.ClassicalMatrix(QQ, ['A', 4]) Special linear Lie algebra of rank 5 over Rational Field sage: lie_algebras.ClassicalMatrix(QQ, CartanType(['B',4])) Special orthogonal Lie algebra of rank 9 over Rational Field sage: lie_algebras.ClassicalMatrix(QQ, 'C4') Symplectic Lie algebra of rank 8 over Rational Field sage: lie_algebras.ClassicalMatrix(QQ, cartan_type=['D',4]) Special orthogonal Lie algebra of rank 8 over Rational Field """ cartan_type = cartan_type.cartan_type() else:
raise ValueError("only for finite types")
if cartan_type.rank() in [7,8]: raise NotImplementedError("not yet implemented") raise ValueError("invalid Cartan type")
def __init__(self, R, ct, e, f, h): """ Initialize ``self``.
EXAMPLES::
sage: g = lie_algebras.sl(QQ, 3, representation='matrix') sage: TestSuite(g).run()
TESTS:
Check that :trac:`23266` is fixed::
sage: sl2 = lie_algebras.sl(QQ, 2, 'matrix') sage: isinstance(sl2.indices(), FiniteEnumeratedSet) True """ gens=tuple(e + f + h), names=tuple(names), index_set=index_set, category=category)
def e(self, i): r""" Return the generator `e_i`.
EXAMPLES::
sage: g = lie_algebras.sl(QQ, 3, representation='matrix') sage: g.e(2) [0 0 0] [0 0 1] [0 0 0] """
def f(self, i): r""" Return the generator `f_i`.-
EXAMPLES::
sage: g = lie_algebras.sl(QQ, 3, representation='matrix') sage: g.f(2) [0 0 0] [0 0 0] [0 1 0] """
def h(self, i): """ Return the generator `h_i`.
EXAMPLES::
sage: g = lie_algebras.sl(QQ, 3, representation='matrix') sage: g.h(2) [ 0 0 0] [ 0 1 0] [ 0 0 -1] """
@cached_method def index_set(self): """ Return the index_set of ``self``.
EXAMPLES::
sage: g = lie_algebras.sl(QQ, 3, representation='matrix') sage: g.index_set() (1, 2) """
def cartan_type(self): """ Return the Cartan type of ``self``.
EXAMPLES::
sage: g = lie_algebras.sl(QQ, 3, representation='matrix') sage: g.cartan_type() ['A', 2] """
def epsilon(self, i, h): r""" Return the action of the functional `\varepsilon_i \colon \mathfrak{h} \to R`, where `R` is the base ring of ``self``, on the element ``h``.
EXAMPLES::
sage: g = lie_algebras.sl(QQ, 3, representation='matrix') sage: g.epsilon(1, g.h(1)) 1 sage: g.epsilon(2, g.h(1)) -1 sage: g.epsilon(3, g.h(1)) 0 """
# Do we want this to be optional or requried? # There probably is a generic implementation we can do. @abstract_method(optional=True) def simple_root(self, i, h): r""" Return the action of the simple root `\alpha_i \colon \mathfrak{h} \to R`, where `R` is the base ring of ``self``, on the element ``h``.
EXAMPLES::
sage: g = lie_algebras.sl(QQ, 3, representation='matrix') sage: g.simple_root(1, g.h(1)) 2 sage: g.simple_root(1, g.h(2)) -1 """
def highest_root_basis_elt(self, pos=True): r""" Return the basis element corresponding to the highest root `\theta`. If ``pos`` is ``True``, then returns `e_{\theta}`, otherwise it returns `f_{\theta}`.
EXAMPLES::
sage: g = lie_algebras.sl(QQ, 3, representation='matrix') sage: g.highest_root_basis_elt() [0 0 1] [0 0 0] [0 0 0] """ else: gens = self._f
@cached_method def basis(self): """ Return a basis of ``self``.
EXAMPLES::
sage: M = LieAlgebra(ZZ, cartan_type=['A',2], representation='matrix') sage: list(M.basis()) [ [ 1 0 0] [0 1 0] [0 0 1] [0 0 0] [ 0 0 0] [0 0 0] [0 0 0] [ 0 0 0] [0 0 0] [0 0 0] [1 0 0] [ 0 1 0] [0 0 1] [0 0 0] [ 0 0 -1], [0 0 0], [0 0 0], [0 0 0], [ 0 0 -1], [0 0 0], [1 0 0], <BLANKLINE> [0 0 0] [0 0 0] [0 1 0] ] """ # This is a fairly generic method of constructing a basis
for i in range(mat.rank())]
def affine(self, kac_moody=False): """ Return the affine (Kac-Moody) Lie algebra of ``self``.
EXAMPLES::
sage: so5 = lie_algebras.so(QQ, 5, 'matrix') sage: so5 Special orthogonal Lie algebra of rank 5 over Rational Field sage: so5.affine() Affine Special orthogonal Kac-Moody algebra of rank 5 over Rational Field """
class gl(LieAlgebraFromAssociative): r""" The matrix Lie algebra `\mathfrak{gl}_n`.
The Lie algebra `\mathfrak{gl}_n` which consists of all `n \times n` matrices.
INPUT:
- ``R`` -- the base ring - ``n`` -- the size of the matrix """ def __init__(self, R, n): """ Initialize ``self``.
EXAMPLES::
sage: g = lie_algebras.gl(QQ, 4) sage: TestSuite(g).run()
TESTS:
Check that :trac:`23266` is fixed::
sage: gl2 = lie_algebras.gl(QQ, 2) sage: isinstance(gl2.basis().keys(), FiniteEnumeratedSet) True sage: Ugl2 = gl2.pbw_basis() sage: prod(Ugl2.gens()) PBW['E_0_0']*PBW['E_0_1']*PBW['E_1_0']*PBW['E_1_1'] """ names=tuple(names), index_set=index_set, category=category)
def _repr_(self): """ Return a string representation of ``self``.
EXAMPLES::
sage: lie_algebras.gl(QQ, 4) General linear Lie algebra of rank 4 over Rational Field """
def killing_form(self, x, y): r""" Return the Killing form on ``x`` and ``y``.
The Killing form on `\mathfrak{gl}_n` is:
.. MATH::
\langle x \mid y \rangle = 2n \mathrm{tr}(xy) - 2 \mathrm{tr}(x) \mathrm{tr}(y).
EXAMPLES::
sage: g = lie_algebras.gl(QQ, 4) sage: x = g.an_element() sage: y = g.gens()[1] sage: g.killing_form(x, y) 8 """ - 2 * x.value.trace() * y.value.trace())
@cached_method def basis(self): """ Return the basis of ``self``.
EXAMPLES::
sage: g = lie_algebras.gl(QQ, 2) sage: tuple(g.basis()) ( [1 0] [0 1] [0 0] [0 0] [0 0], [0 0], [1 0], [0 1] ) """
def monomial(self, i): r""" Return the basis element indexed by ``i``.
INPUT:
- ``i`` -- an element of the index set
EXAMPLES::
sage: gl4 = lie_algebras.gl(QQ, 4) sage: gl4.monomial('E_2_1') [0 0 0 0] [0 0 0 0] [0 1 0 0] [0 0 0 0] sage: gl4.monomial((2,1)) [0 0 0 0] [0 0 0 0] [0 1 0 0] [0 0 0 0] """
class Element(LieAlgebraFromAssociative.Element): def monomial_coefficients(self, copy=True): r""" Return the monomial coefficients of ``self``.
EXAMPLES::
sage: gl4 = lie_algebras.gl(QQ, 4) sage: x = gl4.monomial('E_2_1') + 3*gl4.monomial('E_0_3') sage: x.monomial_coefficients() {'E_0_3': 3, 'E_2_1': 1} """
class sl(ClassicalMatrixLieAlgebra): r""" The matrix Lie algebra `\mathfrak{sl}_n`.
The Lie algebra `\mathfrak{sl}_n`, which consists of all `n \times n` matrices with trace 0. This is the Lie algebra of type `A_{n-1}`. """ def __init__(self, R, n): """ Initialize ``self``.
EXAMPLES::
sage: g = lie_algebras.sl(QQ, 5, representation='matrix') sage: TestSuite(g).run() """
def _repr_(self): """ Return a string representation of ``self``.
EXAMPLES::
sage: lie_algebras.sl(QQ, 5, representation='matrix') Special linear Lie algebra of rank 5 over Rational Field """
def killing_form(self, x, y): r""" Return the Killing form on ``x`` and ``y``.
The Killing form on `\mathfrak{sl}_n` is:
.. MATH::
\langle x \mid y \rangle = 2n \mathrm{tr}(xy).
EXAMPLES::
sage: g = lie_algebras.sl(QQ, 5, representation='matrix') sage: x = g.an_element() sage: y = g.lie_algebra_generators()['e1'] sage: g.killing_form(x, y) 10 """
def simple_root(self, i, h): r""" Return the action of the simple root `\alpha_i \colon \mathfrak{h} \to R`, where `R` is the base ring of ``self``, on the element ``j``.
EXAMPLES::
sage: g = lie_algebras.sl(QQ, 5, representation='matrix') sage: matrix([[g.simple_root(i, g.h(j)) for i in g.index_set()] for j in g.index_set()]) [ 2 -1 0 0] [-1 2 -1 0] [ 0 -1 2 -1] [ 0 0 -1 2] """
class so(ClassicalMatrixLieAlgebra): r""" The matrix Lie algebra `\mathfrak{so}_n`.
The Lie algebra `\mathfrak{so}_n`, which consists of all real anti-symmetric `n \times n` matrices. This is the Lie algebra of type `B_{(n-1)/2}` or `D_{n/2}` if `n` is odd or even respectively. """ def __init__(self, R, n): """ Initialize ``self``.
EXAMPLES::
sage: g = lie_algebras.so(QQ, 8, representation='matrix') sage: TestSuite(g).run() sage: g = lie_algebras.so(QQ, 9, representation='matrix') sage: TestSuite(g).run() """ else: # Odd
def _repr_(self): """ Return a string representation of ``self``.
EXAMPLES::
sage: LieAlgebra(QQ, cartan_type=['B', 4], representation='matrix') Special orthogonal Lie algebra of rank 9 over Rational Field sage: LieAlgebra(QQ, cartan_type=['D', 4], representation='matrix') Special orthogonal Lie algebra of rank 8 over Rational Field """
def killing_form(self, x, y): r""" Return the Killing form on ``x`` and ``y``.
The Killing form on `\mathfrak{so}_n` is:
.. MATH::
\langle x \mid y \rangle = (n - 2) \mathrm{tr}(xy).
EXAMPLES::
sage: g = lie_algebras.so(QQ, 8, representation='matrix') sage: x = g.an_element() sage: y = g.lie_algebra_generators()['e1'] sage: g.killing_form(x, y) 12 sage: g = lie_algebras.so(QQ, 9, representation='matrix') sage: x = g.an_element() sage: y = g.lie_algebra_generators()['e1'] sage: g.killing_form(x, y) 14 """
def simple_root(self, i, h): r""" Return the action of the simple root `\alpha_i \colon \mathfrak{h} \to R`, where `R` is the base ring of ``self``, on the element ``j``.
EXAMPLES:
The even or type `D` case::
sage: g = lie_algebras.so(QQ, 8, representation='matrix') sage: matrix([[g.simple_root(i, g.h(j)) for i in g.index_set()] for j in g.index_set()]) [ 2 -1 0 0] [-1 2 -1 -1] [ 0 -1 2 0] [ 0 -1 0 2]
The odd or type `B` case::
sage: g = lie_algebras.so(QQ, 9, representation='matrix') sage: matrix([[g.simple_root(i, g.h(j)) for i in g.index_set()] for j in g.index_set()]) [ 2 -1 0 0] [-1 2 -1 0] [ 0 -1 2 -1] [ 0 0 -2 2] """ # otherwise we are odd
class sp(ClassicalMatrixLieAlgebra): r""" The matrix Lie algebra `\mathfrak{sp}_n`.
The Lie algebra `\mathfrak{sp}_{2k}`, which consists of all `2k \times 2k` matrices `X` that satisfy the equation:
.. MATH::
X^T M - M X = 0
where
.. MATH::
M = \begin{pmatrix} 0 & I_k \\ -I_k & 0 \end{pmatrix}.
This is the Lie algebra of type `C_k`. """ def __init__(self, R, n): """ Initialize ``self``.
EXAMPLES::
sage: g = lie_algebras.sp(QQ, 8, representation='matrix') sage: TestSuite(g).run() """
def _repr_(self): """ Return a string representation of ``self``.
EXAMPLES::
sage: lie_algebras.sp(QQ, 8, representation='matrix') Symplectic Lie algebra of rank 8 over Rational Field """
def killing_form(self, x, y): r""" Return the Killing form on ``x`` and ``y``.
The Killing form on `\mathfrak{sp}_n` is:
.. MATH::
\langle x \mid y \rangle = (2n + 2) \mathrm{tr}(xy).
EXAMPLES::
sage: g = lie_algebras.sp(QQ, 8, representation='matrix') sage: x = g.an_element() sage: y = g.lie_algebra_generators()['e1'] sage: g.killing_form(x, y) 36 """
def simple_root(self, i, h): r""" Return the action of the simple root `\alpha_i \colon \mathfrak{h} \to R`, where `R` is the base ring of ``self``, on the element ``j``.
EXAMPLES::
sage: g = lie_algebras.sp(QQ, 8, representation='matrix') sage: matrix([[g.simple_root(i, g.h(j)) for i in g.index_set()] for j in g.index_set()]) [ 2 -1 0 0] [-1 2 -1 0] [ 0 -1 2 -2] [ 0 0 -1 2] """
class ExceptionalMatrixLieAlgebra(ClassicalMatrixLieAlgebra): """ A matrix Lie algebra of exceptional type. """ def __init__(self, R, cartan_type, e, f, h=None): """ Initialize ``self``.
EXAMPLES::
sage: g = LieAlgebra(QQ, cartan_type=['E',6], representation='matrix') sage: all(g.h(i) == g.e(i).bracket(g.f(i)) for i in range(1,7)) True """
def _repr_(self): """ Return a string representation of ``self``.
EXAMPLES::
sage: LieAlgebra(QQ, cartan_type=['G',2], representation='matrix') Simple matrix Lie algebra of type ['G', 2] over Rational Field """
class e6(ExceptionalMatrixLieAlgebra): r""" The matrix Lie algebra `\mathfrak{e}_6`.
The simple Lie algebra `\mathfrak{e}_6` of type `E_6`. The matrix representation is given following [HRT2000]_. """ def __init__(self, R): """ Initialize ``self``.
EXAMPLES::
sage: g = LieAlgebra(QQ, cartan_type=['E',6], representation='matrix') sage: TestSuite(g).run() # long time """ [(3,4), (5,6), (7,9), (18,20), (19,21), (22,23)], [(1,2), (8,10), (11,13), (14,16), (19,22), (21,23)], [(2,3), (6,8), (9,11), (16,18), (17,19), (23,24)], [(3,5), (4,6), (11,14), (13,16), (15,17), (24,25)], [(5,7), (6,9), (8,11), (10,13), (12,15), (25,26)]]
class f4(ExceptionalMatrixLieAlgebra): r""" The matrix Lie algebra `\mathfrak{f}_4`.
The simple Lie algebra `\mathfrak{f}_f` of type `F_4`. The matrix representation is given following [HRT2000]_ but indexed in the reversed order (i.e., interchange 1 with 4 and 2 with 3). """ def __init__(self, R): """ Initialize ``self``.
EXAMPLES::
sage: g = LieAlgebra(QQ, cartan_type=['F',4], representation='matrix') sage: TestSuite(g).run() # long time """
(15,16), (17,18), (19,20), (24,25)], [(1,2), (3,5), (4,6), (8,10), (11,12), (11,13), (13,15), (14,16), (18,21), (20,22), (23,24)], [(2,3), (6,8), (9,11), (15,17), (16,18), (22,23)], [(3,4), (5,6), (7,9), (17,19), (18,20), (21,22)]] # Double (10, 12) in e1 and (11,13) in e2
(16,15), (18,17), (20,19), (25,24)], [(2,1), (5,3), (6,4), (10,8), (13,11), (15,12), (15,13), (16,14), (21,18), (22,20), (24,23)], [(3,2), (8,6), (11,9), (17,15), (18,16), (23,22)], [(4,3), (6,5), (9,7), (19,17), (20,18), (22,21)]] # Double (14, 12) in f1 and (15,13) in f2
# Our Cartan matrix convention is dual to that of [HRT2000]_
class g2(ExceptionalMatrixLieAlgebra): r""" The matrix Lie algebra `\mathfrak{g}_2`.
The simple Lie algebra `\mathfrak{g}_2` of type `G_2`. The matrix representation is given following [HRT2000]_. """ def __init__(self, R): """ Initialize ``self``.
EXAMPLES::
sage: g = LieAlgebra(QQ, cartan_type=['G',2], representation='matrix') sage: TestSuite(g).run() """ MS({(1,2): one, (4,5): one})] MS({(2,1): one, (5,4): one})] MS({(1,1): one, (2,2): -one, (4,4): one, (5,5): -one})]
####################################### ## Chevalley Basis
class LieAlgebraChevalleyBasis(LieAlgebraWithStructureCoefficients): r""" A simple finite dimensional Lie algebra in the Chevalley basis.
Let `L` be a simple (complex) Lie algebra with roots `\Phi`, then the Chevalley basis is given by `e_{\alpha}` for all `\alpha \in \Phi` and `h_{\alpha_i} := h_i` where `\alpha_i` is a simple root subject. These generators are subject to the relations:
.. MATH::
\begin{aligned} [h_i, h_j] & = 0 \\ [h_i, e_{\beta}] & = A_{\alpha_i, \beta} e_{\beta} \\ [e_{\beta}, e_{-\beta}] & = \sum_i A_{\beta, \alpha_i} h_i \\ [e_{\beta}, e_{\gamma}] & = \begin{cases} N_{\beta,\gamma} e_{\beta + \gamma} & \beta + \gamma \in \Phi \\ 0 & \text{otherwise.} \end{cases} \end{aligned}
where `A_{\alpha, \beta} = \frac{2 (\alpha, \beta)}{(\alpha, \alpha)}` and `N_{\alpha, \beta}` is the maximum such that `\alpha - N_{\alpha, \beta} \beta \in \Phi`.
For computing the signs of the coefficients, see Section 3 of [CMT2003]_. """ @staticmethod def __classcall_private__(cls, R, cartan_type): """ Normalize ``self`` to ensure a unique representation.
TESTS::
sage: L1 = LieAlgebra(QQ, cartan_type=['A', 2]) sage: L2 = LieAlgebra(QQ, cartan_type=CartanType(['A', 2])) sage: L3 = LieAlgebra(QQ, cartan_type=CartanMatrix(['A', 2])) sage: L1 is L2 and L2 is L3 True """ else: cls, R, cartan_type)
def __init__(self, R, cartan_type): r""" Initialize ``self``.
TESTS::
sage: L = LieAlgebra(QQ, cartan_type=['A',2]) sage: TestSuite(L).run() # long time """
# Determine the signs for the structure coefficients from the root system # We first create the special roots
# Compute the sign for the extra special pair
# This swap is so the structure coefficients match with GAP and str(x) > str(y)): continue
* sp_sign[(x, b-x)] * sp_sign[(a, y-a)]) else: * sp_sign[(x, a-x)] * sp_sign[(b, y-b)]) else:
# Function to construct the structure coefficients (up to sign)
# Now we can compute all necessary structure coefficients # [e_r, h_i] and [h_i, f_r]
# [e_r, f_r] for j, c in r.associated_coroot()}
# [e_r, e_s] and [e_r, f_s] with r != +/-s # We assume s is positive, as otherwise we negate # both r and s and the resulting coefficient # Since h(s) >= h(r), we have s - r > 0 when s - r is a root # [f_r, e_s] else:
# [e_r, e_s] # (r, s) is a special pair
# Lastly, make sure a < b for all (a, b) in the coefficients and flip if necessary else:
category, prefix='E', bracket='[', sorting_key=self._basis_key)
def _repr_(self): """ Return a string representation of ``self``.
EXAMPLES::
sage: LieAlgebra(QQ, cartan_type=['A', 2]) Lie algebra of ['A', 2] in the Chevalley basis """
def _test_structure_coeffs(self, **options): """ Check the structure coefficients against the GAP implementation.
EXAMPLES::
sage: L = LieAlgebra(ZZ, cartan_type=['G',2]) sage: L._test_structure_coeffs() """
# Setup the GAP objects #E, F, H = libgap.CanonicalGenerators(L)
# Setup the conversion between the Sage roots and GAP roots. # The GAP roots are given in terms of the weight lattice. for i, rt in enumerate(gap_p_roots)}
# Run the check c * pos_B[index[x+y]], "extra special pair differ for [{}, {}]".format(x, y)) else: c * pos_B[index[x+y]], "incorrect structure coefficient for [{}, {}]".format(x, y)) c = basis[x].bracket(basis[-y]).leading_coefficient() tester.assertEqual(pos_B[index[x]] * neg_B[index[y]], c * neg_B[index[x-y]], "incorrect structure coefficient for [{}, {}]".format(x, y))
def _repr_generator(self, m): """ Return a string representation of the basis element indexed by ``m``.
EXAMPLES::
sage: L = LieAlgebra(QQ, cartan_type=['A', 2]) sage: K = L.basis().keys() sage: L._repr_generator(K[0]) 'E[alpha[2]]' sage: L._repr_generator(K[4]) 'h2' """
def _latex_generator(self, m): r""" Return a latex representation of the basis element indexed by ``m``.
EXAMPLES::
sage: L = LieAlgebra(QQ, cartan_type=['A', 2]) sage: K = L.basis().keys() sage: L._latex_generator(K[0]) 'E_{\\alpha_{2}}' sage: L._latex_generator(K[4]) 'h_{2}' """
def _basis_key(self, x): """ Compare two basis element indices. We order the basis elements by positive roots, coroots, and negative roots and then according to height.
OUTPUT:
If ``x == y``, return 0. If ``x < y``, return -1. Else return 1.
EXAMPLES::
sage: L = LieAlgebra(QQ, cartan_type=['B', 2]) sage: K = L.basis().keys() sage: S = sorted(K, key=L._basis_key); S [alpha[2], alpha[1], alpha[1] + alpha[2], alpha[1] + 2*alpha[2], alphacheck[1], alphacheck[2], -alpha[2], -alpha[1], -alpha[1] - alpha[2], -alpha[1] - 2*alpha[2]] sage: S == K False """ + self._cartan_type.rank() + self._p_roots_index[-x])
def cartan_type(self): """ Return the Cartan type of ``self``.
EXAMPLES::
sage: L = LieAlgebra(QQ, cartan_type=['A', 2]) sage: L.cartan_type() ['A', 2] """
def weyl_group(self): """ Return the Weyl group of ``self``.
EXAMPLES::
sage: L = LieAlgebra(QQ, cartan_type=['A', 2]) sage: L.weyl_group() Weyl Group of type ['A', 2] (as a matrix group acting on the ambient space) """
def affine(self, kac_moody=False): """ Return the affine Lie algebra of ``self``.
EXAMPLES::
sage: sp6 = lie_algebras.sp(QQ, 6) sage: sp6 Lie algebra of ['C', 3] in the Chevalley basis sage: sp6.affine() Affine Kac-Moody algebra of ['C', 3] in the Chevalley basis """
# Useful in creating the UEA @cached_method def indices_to_positive_roots_map(self): """ Return the map from indices to positive roots.
EXAMPLES::
sage: L = LieAlgebra(QQ, cartan_type=['A', 2]) sage: L.indices_to_positive_roots_map() {1: alpha[1], 2: alpha[2], 3: alpha[1] + alpha[2]} """
def lie_algebra_generators(self, str_keys=False): r""" Return the Chevalley Lie algebra generators of ``self``.
INPUT:
- ``str_keys`` -- (default: ``False``) set to ``True`` to have the indices indexed by strings instead of simple (co)roots
EXAMPLES::
sage: L = LieAlgebra(QQ, cartan_type=['A', 1]) sage: L.lie_algebra_generators() Finite family {-alpha[1]: E[-alpha[1]], alpha[1]: E[alpha[1]], alphacheck[1]: h1} sage: L.lie_algebra_generators(True) Finite family {'f1': E[-alpha[1]], 'h1': h1, 'e1': E[alpha[1]]} """
else:
@cached_method def gens(self): """ Return the generators of ``self`` in the order of `e_i`, `f_i`, and `h_i`.
EXAMPLES::
sage: L = LieAlgebra(QQ, cartan_type=['A', 2]) sage: L.gens() (E[alpha[1]], E[alpha[2]], E[-alpha[1]], E[-alpha[2]], h1, h2) """
def highest_root_basis_elt(self, pos=True): r""" Return the basis element corresponding to the highest root `\theta`.
INPUT:
- ``pos`` -- (default: ``True``) if ``True``, then return `e_{\theta}`, otherwise return `f_{\theta}`
EXAMPLES::
sage: L = LieAlgebra(QQ, cartan_type=['A', 2]) sage: L.highest_root_basis_elt() E[alpha[1] + alpha[2]] sage: L.highest_root_basis_elt(False) E[-alpha[1] - alpha[2]] """
|