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.Sun, 05 May 2019 22:52:33 +0200Monomial coefficients in a PBW basishttps://ask.sagemath.org/question/46432/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 ?
Thanks in advance. Fri, 03 May 2019 14:59:57 +0200https://ask.sagemath.org/question/46432/monomial-coefficients-in-a-pbw-basis/Comment by FrédéricC for <p>Hi, </p>
<p>I'm using the PBW basis. I can't add a link but one finds it easily by googling "PBW basis sage".</p>
<p>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 ?</p>
<p>Thanks in advance. </p>
https://ask.sagemath.org/question/46432/monomial-coefficients-in-a-pbw-basis/?comment=46439#post-id-46439Please post a minimal example of the code that you use, so that can see the exact objects that you look at.Fri, 03 May 2019 20:29:46 +0200https://ask.sagemath.org/question/46432/monomial-coefficients-in-a-pbw-basis/?comment=46439#post-id-46439Comment by dan_fulea for <p>Hi, </p>
<p>I'm using the PBW basis. I can't add a link but one finds it easily by googling "PBW basis sage".</p>
<p>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 ?</p>
<p>Thanks in advance. </p>
https://ask.sagemath.org/question/46432/monomial-coefficients-in-a-pbw-basis/?comment=46440#post-id-46440Please 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/reference/algebras/sage/algebras/lie_algebras/poincare_birkhoff_witt.html, 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...Fri, 03 May 2019 20:35:22 +0200https://ask.sagemath.org/question/46432/monomial-coefficients-in-a-pbw-basis/?comment=46440#post-id-46440Answer by dan_fulea for <p>Hi, </p>
<p>I'm using the PBW basis. I can't add a link but one finds it easily by googling "PBW basis sage".</p>
<p>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 ?</p>
<p>Thanks in advance. </p>
https://ask.sagemath.org/question/46432/monomial-coefficients-in-a-pbw-basis/?answer=46441#post-id-46441I 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.
Fri, 03 May 2019 20:45:04 +0200https://ask.sagemath.org/question/46432/monomial-coefficients-in-a-pbw-basis/?answer=46441#post-id-46441Comment by Nicolas for <p>I guess i have to guess. Do we need the following simple data extraction?!</p>
<pre><code>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:
</code></pre>
<p>The above sample code illustrates some ways to proceed and some traps to avoid.</p>
https://ask.sagemath.org/question/46432/monomial-coefficients-in-a-pbw-basis/?comment=46457#post-id-46457Thanks 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.Sun, 05 May 2019 22:52:33 +0200https://ask.sagemath.org/question/46432/monomial-coefficients-in-a-pbw-basis/?comment=46457#post-id-46457