Lie Algebra Elements#

AUTHORS:

  • Travis Scrimshaw (2013-05-04): Initial implementation

class sage.algebras.lie_algebras.lie_algebra_element.FreeLieAlgebraElement#

Bases: LieAlgebraElement

An element of a free Lie algebra.

lift()#

Lift self to the universal enveloping algebra.

EXAMPLES:

sage: L = LieAlgebra(QQ, 'x,y,z')
sage: Lyn = L.Lyndon()
sage: x,y,z = Lyn.gens()
sage: a = Lyn([z, [[x, y], x]]); a
[x, [x, [y, z]]] + [x, [[x, z], y]] - [[x, y], [x, z]]
sage: a.lift()
x^2*y*z - 2*x*y*x*z + y*x^2*z - z*x^2*y + 2*z*x*y*x - z*y*x^2
list()#

Return self as a list of pairs (m, c) where m is a basis key (i.e., a key of one of the basis elements) and c is its coefficient.

This list is sorted from highest to lowest degree.

EXAMPLES:

sage: L.<x, y> = LieAlgebra(QQ)
sage: elt = x + L.bracket(y, x)
sage: elt.list()
[([x, y], -1), (x, 1)]
class sage.algebras.lie_algebras.lie_algebra_element.GradedLieBracket#

Bases: LieBracket

A Lie bracket (LieBracket) for a graded Lie algebra.

Unlike the vanilla Lie bracket class, this also stores a degree, and uses it as a first criterion when comparing graded Lie brackets. (Graded Lie brackets still compare greater than Lie generators.)

class sage.algebras.lie_algebras.lie_algebra_element.LieAlgebraElement#

Bases: IndexedFreeModuleElement

A Lie algebra element.

lift()#

Lift self to the universal enveloping algebra.

EXAMPLES:

sage: L.<x,y,z> = LieAlgebra(QQ, {('x','y'):{'z':1}})
sage: x.lift().parent() == L.universal_enveloping_algebra()
True
class sage.algebras.lie_algebras.lie_algebra_element.LieAlgebraElementWrapper#

Bases: ElementWrapper

Wrap an element as a Lie algebra element.

class sage.algebras.lie_algebras.lie_algebra_element.LieAlgebraMatrixWrapper#

Bases: LieAlgebraElementWrapper

Lie algebra element wrapper around a matrix.

class sage.algebras.lie_algebras.lie_algebra_element.LieBracket#

Bases: LieObject

An abstract Lie bracket (formally, just a binary tree).

lift(UEA_gens_dict)#

Lift self to the universal enveloping algebra.

UEA_gens_dict should be the dictionary for the generators of the universal enveloping algebra.

EXAMPLES:

sage: L = LieAlgebra(QQ, 'x,y,z')
sage: Lyn = L.Lyndon()
sage: x,y,z = Lyn.gens()
sage: a = Lyn([z, [[x, y], x]]); a
[x, [x, [y, z]]] + [x, [[x, z], y]] - [[x, y], [x, z]]
sage: a.lift() # indirect doctest
x^2*y*z - 2*x*y*x*z + y*x^2*z - z*x^2*y + 2*z*x*y*x - z*y*x^2
to_word()#

Return the word (“flattening”) of self.

If self is a tree of Lie brackets, this word is usually obtained by “forgetting the brackets”.

EXAMPLES:

sage: from sage.algebras.lie_algebras.lie_algebra_element import LieGenerator, LieBracket
sage: x = LieGenerator('x', 0)
sage: y = LieGenerator('y', 1)
sage: b = LieBracket(x, y)
sage: c = LieBracket(b, x)
sage: c.to_word()
('x', 'y', 'x')
class sage.algebras.lie_algebras.lie_algebra_element.LieGenerator#

Bases: LieObject

A wrapper around an object so it can ducktype with and do comparison operations with LieBracket.

lift(UEA_gens_dict)#

Lift self to the universal enveloping algebra.

UEA_gens_dict should be the dictionary for the generators of the universal enveloping algebra.

EXAMPLES:

sage: L = LieAlgebra(QQ, 'x,y,z')
sage: Lyn = L.Lyndon()
sage: x,y,z = Lyn.gens()
sage: x.lift()
x
sage: x.lift().parent()
Free Algebra on 3 generators (x, y, z) over Rational Field
to_word()#

Return the word (“flattening”) of self.

If self is a tree of Lie brackets, this word is usually obtained by “forgetting the brackets”.

EXAMPLES:

sage: from sage.algebras.lie_algebras.lie_algebra_element import LieGenerator
sage: x = LieGenerator('x', 0)
sage: x.to_word()
('x',)
class sage.algebras.lie_algebras.lie_algebra_element.LieObject#

Bases: SageObject

Abstract base class for LieGenerator and LieBracket.

to_word()#

Return the word (“flattening”) of self.

If self is a tree of Lie brackets, this word is usually obtained by “forgetting the brackets”.

class sage.algebras.lie_algebras.lie_algebra_element.LieSubalgebraElementWrapper#

Bases: LieAlgebraElementWrapper

Wrap an element of the ambient Lie algebra as an element.

monomial_coefficients(copy=True)#

Return a dictionary whose keys are indices of basis elements in the support of self and whose values are the corresponding coefficients.

INPUT:

  • copy – (default: True) if self is internally represented by a dictionary d, then make a copy of d; if False, then this can cause undesired behavior by mutating d

EXAMPLES:

sage: L.<X,Y,Z> = LieAlgebra(ZZ, {('X','Y'): {'Z': 3}})
sage: S = L.subalgebra([X, Y])
sage: S(2*Y + 9*Z).monomial_coefficients()
{1: 2, 2: 3}
sage: S2 = L.subalgebra([Y, Z])
sage: S2(2*Y + 9*Z).monomial_coefficients()
{0: 2, 1: 9}
to_vector(order=None, sparse=False)#

Return the vector in g.module() corresponding to the element self of g (where g is the parent of self).

EXAMPLES:

sage: L.<X,Y,Z> = LieAlgebra(ZZ, {('X','Y'): {'Z': 3}})
sage: S = L.subalgebra([X, Y])
sage: S.basis()
Family (X, Y, 3*Z)
sage: S(2*Y + 9*Z).to_vector()
(0, 2, 9)
sage: S2 = L.subalgebra([Y, Z])
sage: S2.basis()
Family (Y, Z)
sage: S2(2*Y + 9*Z).to_vector()
(0, 2, 9)
class sage.algebras.lie_algebras.lie_algebra_element.LyndonBracket#

Bases: GradedLieBracket

A Lie bracket (LieBracket) tailored for the Lyndon basis.

The order on these brackets is defined by \(l < r\) if \(w(l) < w(r)\), where \(w(l)\) is the word corresponding to \(l\). (This is also true if one or both of \(l\) and \(r\) is a LieGenerator.)

class sage.algebras.lie_algebras.lie_algebra_element.StructureCoefficientsElement#

Bases: LieAlgebraMatrixWrapper

An element of a Lie algebra given by structure coefficients.

bracket(right)#

Return the Lie bracket [self, right].

EXAMPLES:

sage: L.<x,y,z> = LieAlgebra(QQ, {('x','y'): {'z':1}, ('y','z'): {'x':1}, ('z','x'): {'y':1}})
sage: x.bracket(y)
z
sage: y.bracket(x)
-z
sage: (x + y - z).bracket(x - y + z)
-2*y - 2*z
lift()#

Return the lift of self to the universal enveloping algebra.

EXAMPLES:

sage: L.<x,y> = LieAlgebra(QQ, {('x','y'): {'x':1}})
sage: elt = x - 3/2 * y
sage: l = elt.lift(); l
x - 3/2*y
sage: l.parent()
Noncommutative Multivariate Polynomial Ring in x, y
 over Rational Field, nc-relations: {y*x: x*y - x}
monomial_coefficients(copy=True)#

Return the monomial coefficients of self as a dictionary.

EXAMPLES:

sage: L.<x,y,z> = LieAlgebra(QQ, {('x','y'): {'z':1}})
sage: a = 2*x - 3/2*y + z
sage: a.monomial_coefficients()
{'x': 2, 'y': -3/2, 'z': 1}
sage: a = 2*x - 3/2*z
sage: a.monomial_coefficients()
{'x': 2, 'z': -3/2}
to_vector(sparse=False)#

Return self as a vector.

EXAMPLES:

sage: L.<x,y,z> = LieAlgebra(QQ, {('x','y'): {'z':1}})
sage: a = x + 3*y - z/2
sage: a.to_vector()
(1, 3, -1/2)
class sage.algebras.lie_algebras.lie_algebra_element.UntwistedAffineLieAlgebraElement#

Bases: Element

An element of an untwisted affine Lie algebra.

bracket(right)#

Return the Lie bracket [self, right].

EXAMPLES:

sage: L = LieAlgebra(QQ, cartan_type=['A',1,1])
sage: e1,f1,h1,e0,f0,c,d = list(L.lie_algebra_generators())
sage: e0.bracket(f0)
(-h1)#t^0 + 4*c
sage: e1.bracket(0)
0
sage: e1.bracket(1)
Traceback (most recent call last):
...
TypeError: no common canonical parent for objects with parents:
 'Affine Kac-Moody algebra of ['A', 1] in the Chevalley basis'
 and 'Integer Ring'
c_coefficient()#

Return the coefficient of \(c\) of self.

EXAMPLES:

sage: L = lie_algebras.Affine(QQ, ['A',1,1])
sage: x = L.an_element() - 3 * L.c()
sage: x.c_coefficient()
-2
canonical_derivation()#

Return the canonical derivation \(d\) applied to self.

The canonical derivation \(d\) is defined as

\[d(a \otimes t^m + \alpha c) = a \otimes m t^m.\]

Another formulation is by \(d = t \frac{d}{dt}\).

EXAMPLES:

sage: L = lie_algebras.Affine(QQ, ['E',6,1])
sage: al = RootSystem(['E',6]).root_lattice().simple_roots()
sage: x = L.basis()[al[2]+al[3]+2*al[4]+al[5],5] + 4*L.c() + L.d()
sage: x.canonical_derivation()
(5*E[alpha[2] + alpha[3] + 2*alpha[4] + alpha[5]])#t^5
d_coefficient()#

Return the coefficient of \(d\) of self.

EXAMPLES:

sage: L = lie_algebras.Affine(QQ, ['A',1,1])
sage: x = L.an_element() + L.d()
sage: x.d_coefficient()
2
monomial_coefficients(copy=True)#

Return the monomial coefficients of self.

EXAMPLES:

sage: L = lie_algebras.Affine(QQ, ['C',2,1])
sage: x = L.an_element()
sage: sorted(x.monomial_coefficients(), key=str)
[(-2*alpha[1] - alpha[2], 1),
 (-alpha[1], 0),
 (-alpha[2], 0),
 (2*alpha[1] + alpha[2], -1),
 (alpha[1], 0),
 (alpha[2], 0),
 (alphacheck[1], 0),
 (alphacheck[2], 0),
 'c',
 'd']
t_dict()#

Return the dict, whose keys are powers of \(t\) and values are elements of the classical Lie algebra, of self.

EXAMPLES:

sage: L = lie_algebras.Affine(QQ, ['A',1,1])
sage: x = L.an_element()
sage: x.t_dict()
{-1: E[alpha[1]],
 0: E[alpha[1]] + h1 + E[-alpha[1]],
 1: E[-alpha[1]]}