ASKSAGE: Sage Q&A Forum - Latest question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Fri, 22 May 2015 23:26:52 -0500elementary symmetric functionshttp://ask.sagemath.org/question/26923/elementary-symmetric-functions/Hi, this is a continuation (though self-contained) on a previous question I luckily received an answer for;
http://ask.sagemath.org/question/26913/sfrom_polynomialf-convert-a-polynomial-to-symmetric-functions-but-with-a-parameter/
For those of you experts that know Maxima, I essentially want to do the following (to a polynomial);
elem([2,f1,f2],elem([2,e1,e2],x+y+a+b,[x,y]),[a,b])
which results in: `(x+y)+(a+b) = e1 + f1`, where Sage would (which is what I'm trying to do) return `e[1] + f[1]`.
This is what I tried (among others), mostly from the above referenced link;
P.<x,y>=PolynomialRing(QQ['a','b'])
[a,b]=P.base_ring().gens()
S=SymmetricFunctions(P.base_ring())
exy=S.elementary()
f=x+y+a+b
exy._prefix='exy'
o=exy(S.from_polynomial(f))
P2.<a,b>=PolynomialRing(QQ['x','y'])
[x,y]=P2.base_ring().gens()
S2.SymmetricFunctions(P2.base_ring())
eab=S2.elementary()
eab._prefix='eab'
oo=eab(S2.from_polynomial(o)); oo
I was hoping to see: `eab[1]+exy[1]`, but here an error is thrown saying that the polynomial is not symmetric. I've tried also (trying) to establish a base ring `QQ['x','y','a','b']` and then subrings but that also doesn't seem to work for me.
I think Sage is great and I'm sure there's something equivalent to the very simple task done in Maxima. For instance, this
maxima.eval('elem:2')
oo=maxima.eval('elem([2,f1,f2],elem([2,e1,e2],x+y+a+b,[x,y]),[a,b])')
does return the proper answer, `e1+f1`, but I cannot use this result because I need to process it further with Sage and have not found a way to **translate** this Maxima type of object to a Sage polynomial - especially since the parsing seems to bring up errors for larger equations and my real equations are extremely large.
Thanks all, again!
natepowerFri, 22 May 2015 23:26:52 -0500http://ask.sagemath.org/question/26923/