ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sun, 19 Apr 2020 05:36:04 +0200Why is sage not recognizing symmetric polynomials as symmetric?https://ask.sagemath.org/question/50852/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)
masseygirlSun, 19 Apr 2020 05:36:04 +0200https://ask.sagemath.org/question/50852/