Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The substitution needs to happen in each coefficient.

The following works.

sage: E.<x,y> = ExteriorAlgebra(SR)
sage: _ = var('t')
sage: theta = 3*x+t*y
sage: print "theta =", theta
theta = 3*x + t*y
sage: theta.map_coefficients(lambda x: x.substitute({t:0}))
3*x
click to hide/show revision 2
No.2 Revision

The substitution needs to happen in each coefficient.

The following works.

sage: E.<x,y> = ExteriorAlgebra(SR)
sage: _ = var('t')
sage: theta = 3*x+t*y
sage: print "theta =", theta
theta = 3*x + t*y
sage: theta.map_coefficients(lambda x: x.substitute({t:0}))
c: c.substitute({t:0}))
3*x