Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Symmetric polynomials in Maple?

  1. Apr 6, 2010 #1
    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!
     
  2. jcsd
  3. Apr 7, 2010 #2
    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
     
  4. Apr 8, 2010 #3
    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...
     
  5. Apr 9, 2010 #4

    LCKurtz

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    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
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Symmetric polynomials in Maple?
  1. Tab in maple (Replies: 3)

  2. A Maple Problem (Replies: 1)

  3. Symmetrical charges (Replies: 3)

  4. Maple functions (Replies: 2)

Loading...