Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

You can find out what you're dealing with by looking at the object's parent:

sage: my_E = E([0,1,1]); my_E
((-t + 1)/(-q*t + 1))*x0*x1 + ((-t + 1)/(-q*t + 1))*x0*x2 + x1*x2
sage: my_E.parent()
Multivariate Polynomial Ring in x0, x1, x2 over Fraction Field of Multivariate Polynomial Ring in q, t over Rational Field

So you can read about multivariate polynomials in the reference manual. In this case you can do

sage: q, t = my_E.parent().base_ring().gens()
sage: my_E.map_coefficients(lambda c: c.subs({t : 0}))
x0*x1 + x0*x2 + x1*x2

This last polynomial still belongs to the same ring as my_E, but you could change that using the change_ring() method if you want. You can also get at the x's:

sage: x = my_E.parent().gens()
sage: x[0]
sage: my_E.subs({x[0] : 0})

Alternatively you can convert the whole thing into the symbolic ring:

sage: var('t')
sage: SR(my_E).subs(t=0)
x0*x1 + x0*x2 + x1*x2