1 | initial version |
sage: var('a y')
(a, y)
sage: F = function('F',x)
sage: G = F.derivative(x)
sage: G
D[0](F)(x)
sage: exp = x^2*G + a + x - x^2*y
sage: p(h) = h^2-h+1
sage: p(exp)
x^2*y - x^2*D[0](F)(x) + (x^2*y - x^2*D[0](F)(x) - a - x)^2 - a - x + 1
Downside: these aren't really differential operators or D-module thingies, just derivatives of a dummy function. There is this functionality, but:
sage: from sage.tensor.differential_form_element import d
sage: exp1 = x^2*d + a + x - x^2*y
TypeError: unsupported operand parent(s) for '*': 'Symbolic Ring' and '<type 'function'>'
so I don't think it's immediately usable. See also this Trac ticket about implementing more general pseudo-differential operators.
2 | No.2 Revision |
sage: var('a y')
(a, y)
sage: F = function('F',x)
sage: G = F.derivative(x)
sage: G
D[0](F)(x)
sage: exp = x^2*G + a + x - x^2*y
sage: p(h) = h^2-h+1
sage: p(exp)
x^2*y - x^2*D[0](F)(x) + (x^2*y - x^2*D[0](F)(x) - a - x)^2 - a - x + 1
sage: p(exp).expand()
x^4*y^2 - 2*x^4*y*D[0](F)(x) + x^4*D[0](F)(x)^2 - 2*a*x^2*y + 2*a*x^2*D[0](F)(x) - 2*x^3*y + 2*x^3*D[0](F)(x) + x^2*y - x^2*D[0](F)(x) + a^2 + 2*a*x + x^2 - a - x + 1
Downside: these aren't really differential operators or D-module thingies, just derivatives of a dummy function. There is this functionality, but:
sage: from sage.tensor.differential_form_element import d
sage: exp1 = x^2*d + a + x - x^2*y
TypeError: unsupported operand parent(s) for '*': 'Symbolic Ring' and '<type 'function'>'
so I don't think it's immediately usable. See also this Trac ticket about implementing more general pseudo-differential operators.