Ask Your Question

S.from_polynomial(f) -- convert a polynomial to symmetric functions BUT with a parameter

asked 2015-05-22 02:38:23 +0100

natepower gravatar image

updated 2015-05-22 05:25:52 +0100

I thought I'd ask a variation of an earlier question that was unanswered.

I use:


resulting in e[1] (or x+y)

So that works, but when I try to do that for a polynomial with parameters, say


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,


to get e1/2 + (a+b)/2, but I then can't use eval or sage_evalon 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,, is in direct relation to this phenomena.

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2015-05-22 20:42:31 +0100

FrédéricC gravatar image

you just have to work over a base ring which is not QQ

sage: P.<x,y>=PolynomialRing(QQ['a'])
sage: a = P.base_ring().gen()
sage: f = x + y + a
sage: S=SymmetricFunctions(P.base_ring())
sage: S.from_polynomial(f)
a*m[] + m[1]
edit flag offensive delete link more


Thanks! I've got what you've done, including other bases. This is exactly what I asked for!

Now I will try to get it to work for two pairs of symmetric variables, e.g., x&y AND a&b. I'll try defining another base ring, though I feel I'll need to also redefine the returned 'functions', e.g. m[] or m[1] with another letter.... like n[] and n[1]... I think exy=S.elementary(); exy._prefix='exy' etc. I'll try this today, and hopefully I won't have to ask again - unless it is on the tip of your tongue already ;)

natepower gravatar imagenatepower ( 2015-05-22 21:08:24 +0100 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2015-05-22 02:38:23 +0100

Seen: 784 times

Last updated: May 22 '15