Ask Your Question
0

Individual terms in a sum

asked 2022-12-31 10:27:39 +0100

emiliocba gravatar image
G=WeylCharacterRing(['A',2])
G(1,0,0)*G(1,1,0)

returns

A2(1,1,1) + A2(2,1,0)

How can I get a list with the individual terms A2(1,1,1) and A2(2,1,0)?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2022-12-31 11:35:26 +0100

rburing gravatar image

Like this:

sage: G = WeylCharacterRing(['A',2])
sage: p = G(1,0,0)*G(1,1,0)
sage: p.monomials()
[A2(2,1,0), A2(1,1,1)]
sage: p.coefficients()
[1, 1]

See also:

sage: list(p)
[((2, 1, 0), 1), ((1, 1, 1), 1)]
sage: dict(p)
{(2, 1, 0): 1, (1, 1, 1): 1}
edit flag offensive delete link more

Comments

Great! Both options will be useful for me. Many thanks!!!

emiliocba gravatar imageemiliocba ( 2022-12-31 13:09:16 +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-12-31 10:27:39 +0100

Seen: 180 times

Last updated: Dec 31 '22