Ask Your Question

Revision history [back]

abs is a Python builtin function (so as sum, len, iter or next). The symbolic absolute value function is named abs_symbolic in Sage. Note the difference

sage: type(abs)
<type 'builtin_function_or_method'>
sage: abs_symbolic
abs

Using abs_symbolic works as expected

sage: h(x) = abs(x)^2
sage: h.substitute_function(abs_symbolic, sin)
sin(x)^2