Why is sage not recognizing symmetric polynomials as symmetric?
I am trying to decompose symmetric polynomials into polynomial combinations of elementary symmetric polynomials. It has been driving me absolutely up the wall, and I would be very grateful for any help.
It works perfectly with 2 variables.
S.<x0,x1>=QQ[]
f = (x0-x1)*(x1-x0)
Sym = SymmetricFunctions(QQ)
g = Sym.from_polynomial(f)
print g
For 3 variables it fails. Sage throws a type error and says the polynomial f is not symmetric, even though it is certainly invariant under the action of the symmetric group of order 3.
S.<x0,x1,x2>=QQ[]
f = (x0-x1)*(x1-x2)*(x2-x0)
Sym = SymmetricFunctions(QQ)
g = Sym.from_polynomial(f)
print g
The type error is as folliows:
/sage/combinat/sf/sf.pyc in from_polynomial(self, f)
1372 ValueError: x0 + 2*x1 + x2 is not a symmetric polynomial
1373 """
-> 1374 return self.m().from_polynomial(f)
1375
1376 def register_isomorphism(self, morphism, only_conversion=False):
However, the following does not throw a type error, perhaps because it is a linear combination of the elementary basis rather than a polynomial one. I don't understand what is going on. Why is this type error being triggered for a valid symmetric polynomial? Thank you very much for your time.
S.<x0,x1,x2>=QQ[]
f = (x0+x1)*(x1+x2)*(x2+x0)
Sym = SymmetricFunctions(QQ)
g = Sym.from_polynomial(f)