Maple Symmetric polynomials in Maple?

AI Thread Summary
Generating elementary symmetric polynomials in Maple version 12 is not straightforward due to the removal of the "symmpoly" command in earlier versions. Users have noted that while the command was useful, its absence has led to alternative methods for creating these polynomials. The current approach involves using the PolynomialTools[IsSelfReciprocal] function, which is more focused on self-reciprocal polynomials rather than elementary symmetric functions. One suggested method for generating these polynomials is to manually expand the product of linear factors and extract coefficients, which can be done with a specific formula. Users have shared custom procedures to create elementary symmetric polynomials, indicating that while it may require more effort, it is feasible to implement a solution without built-in functions. The discussion highlights the balance between searching for quick fixes and developing personalized solutions in programming.
mrbohn1
Messages
95
Reaction score
0
Does anyone know if it possible to generate elementary symmetric polynomials in Maple (I am using version 12), and if so, how?

I have scoured all the help files, and indeed the whole internet, but the only thing I have found is a reference to a command "symmpoly", which was apparently included in earlier versions, but does not seem to be available now.

Why would they delete this capability? Surely there must be a way to do this...any help much appreciated!
 
Physics news on Phys.org
symmpoly is not what you want. It was introduced in 4.0, and removed in 4.3. Currently that feature is PolynomialTools[IsSelfReciprocal] ... since "self-reciprocal" is a better term than "symmetric" to describe polynomials like 2*x^3-4*x^2-4*x+2 . But it is not about elementary symmetric functions.

Why didn't they include it? I don't know. Maybe because it is easy to do yourself...

(-1)^k*coeff(expand((X-a)*(X-b)*(X-c)*(X-d)),X,4-k):

for example

(-1)^3*coeff(expand((X-a)*(X-b)*(X-c)*(X-d)),X,4-3);
b c d + a c d + a b d + a b c
 
Thanks for the reply. I disagree it is easier to do it yourself than use a pre-programmed routine! However you're right that it is easy...I was just being lazy. In the end I gave up looking and did it like this (for elementary symmetric polynomials in the variables yi)

symmpoly:=proc(m,n);
S:={};
for i from 1 to m do
S:=S union {y};
od;
for k from 1 to n do
Tk:=choose(S,k);
s[k]:=sum(product(Tk[j],j=1..k),i=1..nops(Tk));
od;
end proc;

A bit more complicated than your version! I hadn't thought of utilizing the neat factorization.

Anyway, this was a good lesson for me: often it is much quicker to do something for yourself than to search for a quick a fix on google...
 
Here's mine :smile:

P := proc (n, k)

(-1)^(n+k)*coeff(collect(expand(product(x-a, i = 1 .. n)), x), x, k)

end proc;

This gives the symmetric polynomials for degree n, k = 0 .. n-1
 
Back
Top