Ask Your Question

Revision history [back]

Substitutions can be explicitely defined through dictionaries. How about:

sage: R.<x,y> = ZZ[]
sage: f = 1+x+y^2
sage: [p.substitute({y:x}) for p in f.monomials()]
[x^2, x, 1]