[sage-support] Re: Lie algebra morphism, mutable matrices, basis not defined

2020-01-06 Thread Travis Scrimshaw
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 sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/3b719343-8670-411e-8130-12211a1fefb8%40googlegroups.com.


[sage-support] Re: Semisimple Lie algebra generators in Sage? (physics edition)

2020-06-01 Thread 'Travis Scrimshaw' via sage-support
Hi Emil,
   Kind of. So what you are looking for is the compact real form I think:

sage: L = LieAlgebra(QQ, cartan_type=['A',1], representation="compact real")
sage: list(L.basis())
[
[ 0  1]  [ i  0]  [0 i]
[-1  0], [ 0 -i], [i 0]
]
sage: L = LieAlgebra(QQ, cartan_type=['A',2], representation="compact real")
sage: list(L.basis())
[
[ 0  1  0]  [ 0  0  1]  [ 0  0  0]  [ i  0  0]  [0 i 0]  [0 0 i]
[-1  0  0]  [ 0  0  0]  [ 0  0  1]  [ 0  0  0]  [i 0 0]  [0 0 0]
[ 0  0  0], [-1  0  0], [ 0 -1  0], [ 0  0 -i], [0 0 0], [i 0 0],

[ 0  0  0]  [0 0 0]
[ 0  i  0]  [0 0 i]
[ 0  0 -i], [0 i 0]
]

Now the i in the above is just a little bit of extra processing as it is 
considered as a basis in QQ, not QQ[i]. You can of couse look at the Lie 
algebras over the corresponding field extension to get the elements you 
want. Now this doesn't give you the generators for the Lie groups (a 
priori), and it is not implemented for E_8 since that is not given as a 
matrix Lie algebra (although that could be fixed by using the adjoint 
representation). Also, it is not easy to extract the matrix (at least, I 
didn't need it for what I wanted to compute):

sage: L = LieAlgebra(QQ, cartan_type=['A',1], representation="compact real")
sage: M = list(L.basis())[-1]
sage: M
[0 i]
[i 0]
sage: (M._real, M._imag)
(
[0 0]  [0 1]
[0 0], [1 0]
)

Implementing getting the matrix would make a nice improvement to Sage.

Best,
Travis


On Thursday, May 28, 2020 at 9:52:14 AM UTC+10, Emil Kozuch wrote:
>
> I am sorry if this question has been asked before.
>
> Is there a way to get the fundamental Lie algebra generators in sage 
> (those that physicists use, eq. the Paule matrices, Gellmann matrices and 
> so forth)?
> The only thing I can find in the documentation is the generators in the 
> Chevalley basis, but they do not satisfy the orthogonality condition 
> tr(T^aT^b)=\delta_{ab}.
>
> I am looking for the generators for all the semisimple Lie groups 
> (A_n,B_n,C_n,D_n,G_2,F_4,E_6,E_7,E_8).
> The reason i need this is because I am trying to verify some calculations 
> done with the birdtrack method for Lie algebras.
>

-- 
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 sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/b0196d4f-2920-4f69-8926-134b6cda94aa%40googlegroups.com.