Hi Samuel,
Both issues are tied to the matrix Lie algebra implementation:
sage: e1.monomial_coefficients()
NotImplementedError: the basis is not defined
For the immuability issue: probably what should be done is for the matrix
Lie algebras, all elements should be made immutable. This is an easy enough
fix with the class hierarchy I believe. I will create a ticket for this and
cc you.
For the other issue: for Lie algebras that are defined from associative
algebras, in general I cannot construct a basis for a generic Lie algebra
in finite time (even to check if it is finite-dimensional, which is
probably equivalent). So the safe thing to do was to just not do anything
that required an explicit basis unless we knew it was the entire
associative algebra. Now for the matrix Lie algebras (well, any Lie algebra
constructed from a finite-dimensional associative algebra), we definitely
can do better because we know it is finite-dimensional.
Now why it needs to get the elements expressed in the basis is because the
morphism() does not require you to specify the image on the entire basis.
It also might be too specialized right now with assuming the target is also
a LieAlgebraWithStructureCoefficients.
Best,
Travis
On Saturday, January 4, 2020 at 1:16:24 AM UTC+10, slelievre wrote:
>
> Dear sage-support,
>
> At Sage Days 106 we are trying to learn some of the
> Lie algebra functionality in SageMath and have two
> small questions regarding Lie algebra morphisms.
>
> We define the Lie algebra sl_2(QQ) in two ways as follows:
>
> sage: sl2 = lie_algebras.sl(QQ, 2, representation='matrix')
> sage: sl2.inject_variables()
> Defining e1, f1, h1
> sage: sl2bis = LieAlgebra(QQ, {('e', 'h'): {'e': -2}, ('f', 'h'):
> {'f': 2}, ('e', 'f'): {'h': 1}}, names='e, f, h')
> sage: sl2bis.inject_variables()
> Defining e, f, h
>
> Trying to define a Lie algebra morphism between the two
> fails with this error:
>
> sage: sl2.morphism({e1: e, f1: f, h1: h})
> Traceback (most recent call last)
> ...
> TypeError: mutable matrices are unhashable
>
> and I was wondering why the basis is not made
> of immutable matrices.
>
> Trying to define the morphism the other way around,
> fails with this error:
>
> sage: sl2bis.morphism({e: e1, f: f1, h: h1})
> Traceback (most recent call last)
> ...
> NotImplementedError: the basis is not defined
>
> and I was wondering what is the problem here.
>
> Kind regards,
> Samuel Lelièvre
>
--
You received this message because you are subscribed to the Google Groups
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/sage-support/3b719343-8670-411e-8130-12211a1fefb8%40googlegroups.com.