First time here? Check out the FAQ!
answered 0 years ago
(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