# Compute elementary Symmetrical functions on roots of a polynomial

How to compute the elementary symmetric functions e[1,1,..]'s of given variables a,b,c,..., typically computing "elements" on roots of a polynomial? This seems such a basic question, but I can't find anywhere.

edit retag close merge delete

Sort by » oldest newest most voted

Use the method expand with a specific alphabet. (If the default alphabet is not wanted.) For instance:

e = SymmetricFunctions( QQ ).e()
alphabet = 'a,b,c,d'

print "The elementary symmetric functions in the alphabet %s are:" % alphabet
for k in [0,1,2,3,4]:
print e( [k] ).expand( 4, alphabet=alphabet )

print "\ne(3,2,2,1) is:\n%s" % e( [3,2,2,1] ).expand( 4, alphabet=alphabet ).factor()


And we get:

The elementary symmetric functions in the alphabet a,b,c,d are:
1
a + b + c + d
a*b + a*c + b*c + a*d + b*d + c*d
a*b*c + a*b*d + a*c*d + b*c*d
a*b*c*d

e(3,2,2,1) is:
(a + b + c + d) * (a*b + a*c + b*c + a*d + b*d + c*d)^2 * (a*b*c + a*b*d + a*c*d + b*c*d)

more

Yes but this is not only symbolic computation as I have some calculated values for a,b,c.., say a=u1*u2 and b=u3*u4 and c=u5*u6. Then how to assign them to the e's? (and the ui's can be complicated !

e.expand(3) = ab+ac+bc=(u1*u2)*(u3*u4)+(u1*u2)*(u5*u6)+(u3*u4)*(u5*u6)

To compute the elem. sym pol. on some (calculated) roots y1,...,y6, I create the ring R=PolynomialRing(ZZ,6,'y') and RR.<T>=R[]. I can assign some calculated values to these yi's. Then one forms the the polynomial P=(T-y1)*...*(T-y6) and then:

[e(SymmetricFunctions(RR.base_ring().from_polynomial(P.coefficients()[i])) for i in range(0,P.degree()+1)]

withe=SymmetricFunctions().elementary()

then these coefficients appear in the form of a sum of elementary functions e[4,2,1..]=e*e*e...

Then I identify "by hand" the e[i]'s

more