Representing symmetric polynomials

107 views
Skip to first unread message

Fulvio Gesmundo

unread,
Dec 7, 2021, 8:38:51 AM12/7/21
to Macaulay2
Hi,

Is there a way to express a symmetric polynomial in terms of elementary symmetric functions (or power sums, or Schur functions or etc)?

The SchurRings package has commands to pass from one representation to the other (toE, toP, toH) but I could not find a way to start from an actual polynomial in, say, x_1, ... , x_5 which happens to be symmetric and obtain its representation in terms of, for instance, elementary symmetric functions.

Thank you

Best
Fulvio

Paul Zinn-Justin

unread,
Dec 7, 2021, 9:06:44 AM12/7/21
to maca...@googlegroups.com
not sure if it's already coded somewhere, but
here's the code I use in my upcoming package "CotangentSchubert":

elem := (i,vrs) -> sum(subsets(vrs,i), product);
expandElem := (P,vrs,els) -> (
    if P == 0 then return 0;
    c := coefficients(P,Variables=>vrs);
    M := c#0_(0,0); C := c#1_(0,0);
    e := append((first exponents M)_(apply(vrs,index)),0);
    ee := apply(#vrs, i -> e#i - e#(i+1));
    if any(ee, i->i<0) then error "nonsymmetric polynomial";
    Q := P - C * product(#vrs, i -> (elem(i+1,vrs))^(ee#i));
    sub(C,ring first els) * product(#vrs, i -> (els#i)^(ee#i)) + expandElem(Q,vrs,els)
    )

ex of use:

i3 : R=QQ[x_1..x_5]

o3 = R

o3 : PolynomialRing

i4 : S=QQ[e_1..e_5]

o4 = S

o4 : PolynomialRing

i5 : expandElem(sum(1..5,i->x_i^3),gens R,gens S)

      3
o5 = e  - 3e e  + 3e
      1     1 2     3

--
You received this message because you are subscribed to the Google Groups "Macaulay2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to macaulay2+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/macaulay2/9eb77bf6-1eff-438b-a7b7-c14c564d8eccn%40googlegroups.com.

d.markushevich

unread,
Dec 7, 2021, 9:57:33 AM12/7/21
to Macaulay2
You can use the command "elementarySymmetric" from the package "SymmetricPolynomials".
(Not appropriate when the number of variables is big.)

An example of use:

R=QQ[x_0..x_5];
loadPackage "SymmetricPolynomials";
-- Sum of powers of variables:
SumP = n -> sum(#(gens R),i->R_i^n);
for i from 1 to 6 do (print "\n"; print elementarySymmetric (SumP i));

Output:

i4 : for i from 1 to 6 do (print "\n"; print elementarySymmetric (SumP i));

e
 1


 2
e  - 2e
 1     2


 3

e  - 3e e  + 3e
 1     1 2     3


 4     2               2
e  - 4e e  + 4e e  + 2e  - 4e
 1     1 2     1 3     2     4


 5     3       2         2
e  - 5e e  + 5e e  + 5e e  - 5e e  - 5e e  + 5e
 1     1 2     1 3     1 2     1 4     2 3     5


 6     4       3       2 2     2                          3             2
e  - 6e e  + 6e e  + 9e e  - 6e e  - 12e e e  + 6e e  - 2e  + 6e e  + 3e  - 6e
 1     1 2     1 3     1 2     1 4      1 2 3     1 5     2     2 4     3     6

Luke Oeding

unread,
Dec 7, 2021, 3:27:48 PM12/7/21
to Macaulay2
I stumbled across this in my inbox. Here's a sample of code I've used to get the change of basis matrices between different bases of the ring of symmetric functions:


--
s = 5
R = QQ[x_0..x_s]
L  = apply(partitions(s), k-> toList k)
E = id_(ZZ^(s));
repeats = P -> entries sum(P,p-> E_(p-1))
Mon1 = P-> product(#P, j-> x_j^(P_j))
Mon = L -> 1/(product(repeats L, l-> l!))* sum(subsets(s,#L), p -> sum(permutations p, q-> product(#L, i-> x_(q_i)^(L_i))))
Mon {2,2}
Pow = L -> product(L, l-> sum(s, i->x_i^l))
Pow {3,2}

elem = r-> sum(subsets(s,r), L-> product(L, l-> x_l))
elem1 = r-> product(0..(r-1), l-> x_l)

Elem = L -> product(L, l-> elem l)
Elem {1,1}
Elem1 = L -> product(L, l-> elem1 l)
Elem1 {1,1}
Elem {3,2}

elem 3


homog1 = r-> sum(partitions r, P-> product(#P, l-> x_l^(P_l)))
homog1 5
homog = r -> sum(partitions r, P -> Mon toList P  )
Homog = L -> product(L, l-> homog l)
Homog1 = L -> product(L, l-> homog1 l)
homog 3


MM = matrix apply(L, l-> apply(L, k-> contract(Mon1 k, Mon l)))
contract(x_0+x_1, x_0^3 + x_1^2*x_0)

contract( Mon1 {5}, Elem {5})

ElM = matrix  apply(L, l-> apply(L, k-> contract(Mon1 k, Elem l)))

PM = matrix apply(L, l-> apply(L, k-> contract(Mon1 k, Pow l)))

HM = matrix apply(L, l-> apply(L, k-> contract(Mon1 k, Homog l)))

EE = matrix apply(L, l-> apply(L, k-> contract(Elem1 k, Elem l)))
ME = matrix apply(L, l-> apply(L, k-> contract(Elem1 k, Mon l)))
PE = matrix apply(L, l-> apply(L, k-> contract(Elem1 k, Pow l)))
HE = matrix apply(L, l-> apply(L, k-> contract(Elem1 k, Homog l)))


HoH = matrix apply(L, l-> apply(L, k-> contract(Homog1 k, Homog l)))
EH = matrix apply(L, l-> apply(L, k-> contract(Homog1 k, Elem l)))
MH = matrix apply(L, l-> apply(L, k-> contract(Homog1 k, Mon l)))
PH = matrix apply(L, l-> apply(L, k-> contract(Homog1 k, Pow l)))

Fulvio Gesmundo

unread,
Dec 14, 2021, 6:00:28 AM12/14/21
to Macaulay2
Thank you for the answers!

Best
Fulvio

Reply all
Reply to author
Forward
0 new messages