On Apr 1, 11:06 am, Nils Bruin <nbr...@sfu.ca> wrote: > On Apr 1, 4:56 am, Harald Schilly <harald.schi...@gmail.com> wrote: > > > > sage: D[0](f)(x, y)/x + D[0, 1](f)(x, y) > > > For me, this just looks quite awkward. > > OK, some reasons *for* the notation then. > > 1) It's how sage prints the expression. It's very desirable to ensure > that output is also valid input. >
Yes. I agree completely about the usefulness of arithmetic on differential operators. Another necessary feature is some way to extract coefficients of the various D operators. For example the following breaks with 'diff' or 'D' queries: sage: a=f.diff(x,2)*x*x sage: a x^2*D[0, 0](f)(x) sage: a.coeffs(x) [[D[0, 0](f)(x), 2]] sage: a.coeffs(diff(f,x)) /home/jlh/wrk/sage-5.0.beta11/local/lib/python2.7/site-packages/ IPython/iplib.py:2260: DeprecationWarning: Substitution using function- call syntax and unnamed arguments is deprecated and will be removed from a future release of Sage; you can use named arguments instead, like EXPR(x=..., y=...) exec code_obj in self.user_global_ns, self.user_ns --------------------------------------------------------------------------- ValueError Traceback (most recent call last) ... ValueError: The name "D[0](f)(x)" is not a valid Python identifier. sage: -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org