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.

2) If you read the square brackets as "subscript" (not an unusual
convention) then it is a direct reflection of how differential
operators are often written: D_x, D_{xx} etc. Here we have to settle
for positional indicators, because the parameter positions can't be
uniquely identified by a variable name (compare D_x(f)(x,y) and D_x(f)
(y,x) with D[0](f)(x,y) and D[0](f)(y,x) )

3) D[0] really is something mathematical: It's a differential
operator. You can't express these directly with the other notations. I
guess you could do

D0 = lambda f: diff(f(x),x).function(x)

but then sage would know very little of the nature of D0 (not to
mention that it changes what arguments of the function are)

4) [I'd say this one would need more work] If we allow arithmetic with
these you could write

Lambda = D[0,0]+D[1,1]
Dt = D[2]

(Lambda - Dt)(f) == 0

to express the heat equation. I think this would be better implemented
in a stricter, more well-defined way as
"the differential operator ring on differentiable functions over K in
variables (x,y,t)" or something like that, but that might be too
algebraic an approach for the people who would be using it most.

> What about D(f, 0) or D(f, 0, 1) ?

That's essentially the syntax we already have for FDerivativeOperator.

> which can also be like f.D(0) and f.D(0,1) ?

I think that has merit, but it doesn't solve the problem that sage
should probably have some notational convention for the mathematical
entities called differential operators.

-- 
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

Reply via email to