First time here? Check out the FAQ!
answered 2024-07-01 03:46:46 +0100
(f^2).monomials() works. If you do g=f^2 and then type g.<TAB>, you will get a list of methods attached to g, one of which is monomials. Others may also be of interest.
(f^2).monomials()
g=f^2
g.<TAB>
g
monomials