# Examples of a Lie algebra#

sage.categories.examples.lie_algebras.Example[source]#
class sage.categories.examples.lie_algebras.LieAlgebraFromAssociative(gens)[source]#

An example of a Lie algebra: a Lie algebra generated by a set of elements of an associative algebra.

This class illustrates a minimal implementation of a Lie algebra.

Let $$R$$ be a commutative ring, and $$A$$ an associative $$R$$-algebra. The Lie algebra $$A$$ (sometimes denoted $$A^-$$) is defined to be the $$R$$-module $$A$$ with Lie bracket given by the commutator in $$A$$: that is, $$[a, b] := ab - ba$$ for all $$a, b \in A$$.

What this class implements is not precisely $$A^-$$, however; it is the Lie subalgebra of $$A^-$$ generated by the elements of the iterable gens. This specific implementation does not provide a reasonable containment test (i.e., it does not allow you to check if a given element $$a$$ of $$A^-$$ belongs to this Lie subalgebra); it, however, allows computing inside it.

INPUT:

• gens – a nonempty iterable consisting of elements of an associative algebra $$A$$

OUTPUT:

The Lie subalgebra of $$A^-$$ generated by the elements of gens

EXAMPLES:

We create a model of $$\mathfrak{sl}_2$$ using matrices:

sage: gens = [matrix([[0,1],[0,0]]), matrix([[0,0],[1,0]]), matrix([[1,0],[0,-1]])]
sage: for g in gens:
....:     g.set_immutable()
sage: L = LieAlgebras(QQ).example(gens)
sage: e,f,h = L.lie_algebra_generators()
sage: e.bracket(f) == h
True
sage: h.bracket(e) == 2*e
True
sage: h.bracket(f) == -2*f
True

>>> from sage.all import *
>>> gens = [matrix([[Integer(0),Integer(1)],[Integer(0),Integer(0)]]), matrix([[Integer(0),Integer(0)],[Integer(1),Integer(0)]]), matrix([[Integer(1),Integer(0)],[Integer(0),-Integer(1)]])]
>>> for g in gens:
...     g.set_immutable()
>>> L = LieAlgebras(QQ).example(gens)
>>> e,f,h = L.lie_algebra_generators()
>>> e.bracket(f) == h
True
>>> h.bracket(e) == Integer(2)*e
True
>>> h.bracket(f) == -Integer(2)*f
True

class Element[source]#

Bases: ElementWrapper

Wrap an element as a Lie algebra element.

lie_algebra_generators()[source]#

Return the generators of self as a Lie algebra.

EXAMPLES:

sage: L = LieAlgebras(QQ).example()                                         # needs sage.combinat sage.groups
sage: L.lie_algebra_generators()                                            # needs sage.combinat sage.groups
Family ([2, 1, 3], [2, 3, 1])

>>> from sage.all import *
>>> L = LieAlgebras(QQ).example()                                         # needs sage.combinat sage.groups
>>> L.lie_algebra_generators()                                            # needs sage.combinat sage.groups
Family ([2, 1, 3], [2, 3, 1])

zero()[source]#

Return the element 0.

EXAMPLES:

sage: L = LieAlgebras(QQ).example()                                         # needs sage.combinat sage.groups
sage: L.zero()                                                              # needs sage.combinat sage.groups
0

>>> from sage.all import *
>>> L = LieAlgebras(QQ).example()                                         # needs sage.combinat sage.groups
>>> L.zero()                                                              # needs sage.combinat sage.groups
0