Every multivariate polynomial f∈F[x1,…,xn] of degree d can be written as f=f0+f1+⋯+fd, where fi is a homogeneous polynomial of degree i. Is there a direct way to get each fi given f in SageMath? For a specific application I have where I only need fd I am homogenizing and then setting h=0, and based on this I wrote an ugly script that recursively finds fi.
Is there a cleaner (and more efficient) way to do this?
Thanks for the help!