Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Same idea as in @FrédéricC's answer applied to the OP's example:

I want to know the value $(x^2-x-2)(y^2-y-2)(z^2-z-2)$ when $x+y+z=0, xy+yz+zx=-3, xyz=-1$.

e_value = [1, 0, -3, -1]     # given values for e[i], i=0..3
e = SymmetricFunctions(QQ).e()
x, y, z = polygens(QQ, 'x,y,z')
f = e.from_polynomial( (x^2-x-2)*(y^2-y-2)*(z^2-z-2) )
v = sum( c * prod(e_value[ti] for ti in t) for t,c in f if max(t,default=0)<=3 )
print(v)

It gives value 9.

Same idea as in @FrédéricC's answer applied to the OP's example:

I want to know the value $(x^2-x-2)(y^2-y-2)(z^2-z-2)$ when $x+y+z=0, xy+yz+zx=-3, xyz=-1$.

e_value = [1, 0, -3, -1]     # given values for e[i], i=0..3
e = SymmetricFunctions(QQ).e()
x, y, z = polygens(QQ, 'x,y,z')
f = e.from_polynomial( (x^2-x-2)*(y^2-y-2)*(z^2-z-2) )
v = sum( c * prod(e_value[ti] for ti in t) t if ti<=3) for t,c in f if max(t,default=0)<=3 )
print(v)

It gives value 9.

Same idea as in @FrédéricC's answer applied to the OP's example:

I want to know the value $(x^2-x-2)(y^2-y-2)(z^2-z-2)$ when $x+y+z=0, xy+yz+zx=-3, xyz=-1$.

e_value = [1, 0, -3, -1]     # given values for e[i], i=0..3
e = SymmetricFunctions(QQ).e()
x, y, z = polygens(QQ, 'x,y,z')
f = e.from_polynomial( (x^2-x-2)*(y^2-y-2)*(z^2-z-2) )
v = sum( c * prod(e_value[ti] if ti<=3 else 0 for ti in t if ti<=3) t) for t,c in f )
print(v)

It gives value 9.

Same idea as in @FrédéricC's answer applied to the OP's example:

I want to know the value $(x^2-x-2)(y^2-y-2)(z^2-z-2)$ when $x+y+z=0, xy+yz+zx=-3, xyz=-1$.

e_value = [1, 0, -3, -1]     # given values for e[i], i=0..3
e = SymmetricFunctions(QQ).e()
x, y, z = polygens(QQ, 'x,y,z')
f = e.from_polynomial( (x^2-x-2)*(y^2-y-2)*(z^2-z-2) )
v = sum( c * prod(e_value[ti] if ti<=3 ti<#e_value else 0 for ti in t) for t,c in f )
print(v)

It gives value 9.

Same idea as in @FrédéricC's answer applied to the OP's example:

I want to know the value $(x^2-x-2)(y^2-y-2)(z^2-z-2)$ when $x+y+z=0, xy+yz+zx=-3, xyz=-1$.

e_value = [1, 0, -3, -1]     # given values for e[i], i=0..3
e = SymmetricFunctions(QQ).e()
x, y, z = polygens(QQ, 'x,y,z')
f = e.from_polynomial( (x^2-x-2)*(y^2-y-2)*(z^2-z-2) )
v = sum( c * prod(e_value[ti] if ti<#e_value ti<len(e_value) else 0 for ti in t) for t,c in f )
print(v)

It gives value 9.