| 1 | initial version |
Thank you all,
Indeed, considering sum of all monomials does the trick! As a reference, a slightly tweaked solution below that worked for me:
g # the polynomial
list(g) # convert polynomial to list
g1=sum(mon for coeff, mon in g) # get the sum of all monomials
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.