Ask Your Question
0

Coefficients of symmetric polynomials

asked 2022-03-14 17:07:30 +0100

timaeus gravatar image

updated 2022-03-15 01:31:33 +0100

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[3]
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 flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2022-03-14 21:46:53 +0100

Max Alekseyev gravatar image

updated 2022-03-14 21:50:37 +0100

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[4] 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) ]
edit flag offensive delete link more

Comments

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!

timaeus gravatar imagetimaeus ( 2022-03-15 01:24:27 +0100 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2022-03-14 17:07:30 +0100

Seen: 268 times

Last updated: Mar 15 '22