# Coefficients of symmetric polynomials

Hi everyone,

I want to get the coefficients of symmetric polynomials, and then make them a vector. I tried the following code:

Sym = SymmetricFunctions(QQ)
e = Sym.elementary()
g = e[2, 1] - 3*e
g.coefficients()


The output is [1, -3], but my desired result is [0, 1, -3], where the zero is the coefficient of e[1, 1, 1]. I found this question get the coefficients from the polynomial, but it seems .coefficients(sparse=False) and .list() only work for the univariate polynomial ring. Thank you in advance for your answer and comments!

Edit: I would like to make some clarification about the desired result. What I want is a vector of dimension p(n) where p is the partition function. And each of its components is the coefficient of g under the basis e(part), where part ranges over all the partitions of n.

edit retag close merge delete

Sort by » oldest newest most voted

The question is not well posed as it's unclear what particular zero coefficients you want to see and in what order. Say, you want that of e[1,1,1] but why not, say, of e or e[7,4,2]?

Anyway, you can query any particular coefficient like g.coefficient([1,1,1]). And if you have a list of terms in mind (say, partitions of 3) you get all the corresponding coefficients as a list using list comprehension:

[ g.coefficient(p) for p in Partitions(3) ]

more

Sorry for the ambiguity in the question, and I would edit it to make it precise. Your answer is exactly what I wanted, thank you very much!