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
.
2 | No.2 Revision |
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
.
3 | No.3 Revision |
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
.
4 | No.4 Revision |
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
.
5 | No.5 Revision |
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
.