Ask Your Question

Why is sage not recognizing symmetric polynomials as symmetric?

asked 2020-04-19 05:36:04 +0100

tzeentch gravatar image

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.

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.

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

f = (x0+x1)*(x1+x2)*(x2+x0)
Sym = SymmetricFunctions(QQ)
g = Sym.from_polynomial(f)
edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2020-04-19 07:55:32 +0100

FrédéricC gravatar image

Because it is not a symmetric polynomial:

sage: f==f(x0=x1,x1=x0)
sage: f==-f(x0=x1,x1=x0)
edit flag offensive delete link more


Ah! Thank you very much.

tzeentch gravatar imagetzeentch ( 2020-04-19 20:54:05 +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: 2020-04-19 05:36:04 +0100

Seen: 416 times

Last updated: Apr 19 '20