# Monomial coefficients in a PBW basis

Hi,

I'm using the PBW basis. I can't add a link but one finds it easily by googling "PBW basis sage".

I have to multiply a lot of monomial and store their coefficients. So given a PBW monomial and an expression, is there a command which can give me the corresponding coefficient, i.e something like coefficient(degrees) but in the Lie algebra setting, where the monomials are PBW monomials ?

edit retag close merge delete

Please post a minimal example of the code that you use, so that can see the exact objects that you look at.

( 2019-05-03 20:29:46 +0100 )edit

Please provide code that creates an instance of the objects in the question. What is a "PBW" monomial (and a suitable expression) in the given context? And to fix a framework, given the following link, http://doc.sagemath.org/html/en/refer..., which coefficient of which expression is needed? (Providing a concrete situation, best a simple one, with code, with concrete links to mathematical and/or sage objects is always helpful for potential answerers. Not doing this echoes a guessing pyramid among them.) I will post a guessing answer in some seconds...

( 2019-05-03 20:35:22 +0100 )edit

Sort by » oldest newest most voted

I guess i have to guess. Do we need the following simple data extraction?!

sage: L = lie_algebras.three_dimensional_by_rank(QQ, 3, names=['E','F','H'])
sage: A = L.pbw_basis()
sage: E, F, H = A.algebra_generators()
sage: expression = E^3*F^2 - F^3*E^2

sage: expression
PBW['E']^3*PBW['F']^2 - PBW['E']^2*PBW['F']^3 + 6*PBW['E']*PBW['F']^2*PBW['H'] - 6*PBW['E']*PBW['F']^2 - 6*PBW['F']*PBW['H']^2 + 6*PBW['F']*PBW['H']

sage: for monomial, coeff in expression:
....:     print "Coeff=%3s Monomial=%s" % (coeff, monomial)
....:
Coeff=  6 Monomial=PBW['F']*PBW['H']
Coeff=  1 Monomial=PBW['E']^3*PBW['F']^2
Coeff=  6 Monomial=PBW['E']*PBW['F']^2*PBW['H']
Coeff= -6 Monomial=PBW['F']*PBW['H']^2
Coeff= -6 Monomial=PBW['E']*PBW['F']^2
Coeff= -1 Monomial=PBW['E']^2*PBW['F']^3

sage: fixed_monomial = F*H^2
sage: for monomial, coeff in expression:
....:     if monomial == fixed_monomial:
....:         print "Coeff=%3s for fixed monomial=%s" % (coeff, fixed_monomial)
....:

sage: for monomial, coeff in expression:
....:     if A(monomial) == A(fixed_monomial):
....:         print "Coeff=%3s for fixed monomial=%s" % (coeff, fixed_monomial)
....:
....:
Coeff= -6 for fixed monomial=PBW['F']*PBW['H']^2
sage:


The above sample code illustrates some ways to proceed and some traps to avoid.

more

Thanks a lot for your answer and sorry for the delay. It seems what I was looking for, I'll look at it more carefully tomorrow.

( 2019-05-05 22:52:33 +0100 )edit

## Stats

Seen: 235 times

Last updated: May 03 '19