Ask Your Question

Revision history [back]

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

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