ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Thu, 16 May 2019 15:41:08 +0200Coercion from PBW to universal enveloping algebrahttps://ask.sagemath.org/question/46483/coercion-from-pbw-to-universal-enveloping-algebra/I'm using *sage.algebras.lie_algebras.poincare_birkhoff_witt* to do computations in the universal enveloping algebras of some Lie algebras. I want to then use the resulting elements in the PBW basis to act on (a subalgebra) of the Lie algebra. For this I need to use the Lie algebra's bracket() method, which only works with elements of the Lie algebra.
Hence I need to coerce elements of PBW back into (NC polynomials of) elements of the Lie algebra. How do I do this?
Example
sage: lie_algebra = LieAlgebra(QQ, cartan_type='A4')
sage: pbw_basis = lie_algebra.pbw_basis()
sage: pbw_basis.an_element()
>>> PBW[alpha[4]]^2*PBW[alpha[3]]^2*PBW[alpha[2]]^3 + 2*PBW[alpha[4]] + 3*PBW[alpha[3]] + 1
Then I want to obtain
>>> E[alpha[4]]^2*E[alpha[3]]^2*E[alpha[2]]^3 + 2*E[alpha[4]] + 3*E[alpha[3]] + 1
Or rather it's enough if I can convert a term like PBW[alpha[4]] to E[alpha[4]], because I want to essentially use the following function
def universal_enveloping_algebra_action(pbw_elt,e):
result=0
for term,coefficient in pbw_elt:
sub_result=e
for factor,power in term:
for _ in range(power):
sub_result=lie_algebra.bracket(factor,sub_result)
result+=sub_result
return result
Here pbw_elt is an element of the PBW basis, and e is in the Lie algebra. In this case 'factor' needs to be coerced into an element of the Lie algebra.
Right now I solved the problem by making a dictionary converting algebra generators of pbw_basis into basis elements of the Lie algebra, but it feels like there should be a much more elegant solution.
Fri, 10 May 2019 18:35:29 +0200https://ask.sagemath.org/question/46483/coercion-from-pbw-to-universal-enveloping-algebra/Answer by Tilpo for <p>I'm using <em>sage.algebras.lie_algebras.poincare_birkhoff_witt</em> to do computations in the universal enveloping algebras of some Lie algebras. I want to then use the resulting elements in the PBW basis to act on (a subalgebra) of the Lie algebra. For this I need to use the Lie algebra's bracket() method, which only works with elements of the Lie algebra.
Hence I need to coerce elements of PBW back into (NC polynomials of) elements of the Lie algebra. How do I do this?</p>
<p>Example</p>
<pre><code>sage: lie_algebra = LieAlgebra(QQ, cartan_type='A4')
sage: pbw_basis = lie_algebra.pbw_basis()
sage: pbw_basis.an_element()
>>> PBW[alpha[4]]^2*PBW[alpha[3]]^2*PBW[alpha[2]]^3 + 2*PBW[alpha[4]] + 3*PBW[alpha[3]] + 1
</code></pre>
<p>Then I want to obtain</p>
<pre><code>>>> E[alpha[4]]^2*E[alpha[3]]^2*E[alpha[2]]^3 + 2*E[alpha[4]] + 3*E[alpha[3]] + 1
</code></pre>
<p>Or rather it's enough if I can convert a term like PBW[alpha[4]] to E[alpha[4]], because I want to essentially use the following function</p>
<pre><code>def universal_enveloping_algebra_action(pbw_elt,e):
result=0
for term,coefficient in pbw_elt:
sub_result=e
for factor,power in term:
for _ in range(power):
sub_result=lie_algebra.bracket(factor,sub_result)
result+=sub_result
return result
</code></pre>
<p>Here pbw_elt is an element of the PBW basis, and e is in the Lie algebra. In this case 'factor' needs to be coerced into an element of the Lie algebra.</p>
<p>Right now I solved the problem by making a dictionary converting algebra generators of pbw_basis into basis elements of the Lie algebra, but it feels like there should be a much more elegant solution.</p>
https://ask.sagemath.org/question/46483/coercion-from-pbw-to-universal-enveloping-algebra/?answer=46546#post-id-46546One can use the .to_word_list() method on a monomial in PBW basis.
E.g.
sage: PBW[-alpha[1]-alpha[2]]*PBW[-alpha[1]].to_word_list()
>>>> [-alpha[1]-alpha[2],-alpha[1]]
The resulting list of roots are keys in the basis of the original Lie algebra, and can hence be easily converted. This solves my problem. Thu, 16 May 2019 15:41:08 +0200https://ask.sagemath.org/question/46483/coercion-from-pbw-to-universal-enveloping-algebra/?answer=46546#post-id-46546