S.from_polynomial(f) -- convert a polynomial to symmetric functions BUT with a parameter
I thought I'd ask a variation of an earlier question that was unanswered.
I use:
P.<x,y>=PolynomialRing(QQ)
S=SymmetricFunctions(QQ)
S.inject_shorthands()
f=x+y
e(S.from_polynomial(f))
resulting in e[1]
(or x+y)
So that works, but when I try to do that for a polynomial with parameters, say
f=x+y+a+b
it complains that a
and b
are not defined. If I add them to the ring I get e[1]
, but I suspect this is equivalent now to x+y+a+b
(I didn't check because it should be e[1]+a+b
).
Do I need to keep the ring defined the same but define maybe S as;
S = SymmetricFunctions(QQ[x,y])
?
This causes the error claiming that the function is not a symmetric polynomial.
By the way, I know I could use something like,
a=maxima.eval('elem([2,e1,e2],(x+y+a+b)/2,[x,y])')
to get e1/2 + (a+b)/2
, but I then can't use eval
or sage_eval
on the result because there are parsing errors for larger equations, e.g. python complains about the use of '^' instead of '**' for exponentiation, etc. My other posted question, http://ask.sagemath.org/question/2672..., is in direct relation to this phenomena.