Ask Your Question
0

Creating symmetric polynomials of squares of variables?

asked 2013-01-31 22:14:19 +0100

Alasdair gravatar image

I have five variables: a,b,c,d,e, for which I want to use the elementary symmetric polynomials of their squares:

s1 = a^2+b^2+c^2+d^2+e^2

s2 = a^2b^2 + a^2c^2 + ... + d^2e^2

and so on, to:

s5 = a^2b^2c^2d^2e^2.

Now, I can do this by hand, or by pulling out the coefficients of the polynomial

P = (x+a^2)(x+b^2)...(x+e^2)

However, is there a nicer way which uses Sage's own extensive symmetric polynomial functionality?

edit retag flag offensive close merge delete

Comments

1 Answer

Sort by » oldest newest most voted
0

answered 2013-02-01 03:33:30 +0100

ppurka gravatar image

updated 2013-02-01 03:35:12 +0100

You can probably proceed like the code below, or some version of it. I am not very familiar with symmetric polynomials in Sage, so this is something I could figure out in the 5min I looked at the docs. The main thing used is to determine the variables and use the .subs() method to substitute the squares of the variables. This can be extended so that it is all handled programmatically, instead of manually as I have done below.

sage: s = SymmetricFunctionAlgebra(QQ)
sage: f = s([2,1])
sage: p = f.expand(2); p
x0^2*x1 + x0*x1^2
sage: (x0, x1) = p.variables() # p.inject_variables() seems to be missing?
sage: p.subs(x0=x0^2, x1=x1^2)
x0^4*x1^2 + x0^2*x1^4

I must say the docs need a fair amount of work. I get zero idea from the documentation what s([2,1]) does. And there could be an elementary introduction in the SymmetricFunctionAlgebra function about the effect of the different basis, or at least some examples which show the differences.

edit flag offensive delete link more

Your Answer

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

Add Answer

Question Tools

Stats

Asked: 2013-01-31 22:14:19 +0100

Seen: 535 times

Last updated: Feb 01 '13