Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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.

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.

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.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.