Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

It looks like Sage is (incorrectly? naively?) applying the chain rule to conjugate(q(x,t)), since conjugate is a pure symbolic thing in Sage a priori. In fact, the multiple variables are irrelevant:

sage: r = function('r',x)
sage: g = r*r.conjugate()
sage: g.derivative(x)
r(x)*D[0](conjugate)(r(x))*D[0](r)(x) + conjugate(r(x))*D[0](r)(x)

sage: r.conjugate().derivative(x)
D[0](conjugate)(r(x))*D[0](r)(x)
sage: r.derivative().conjugate()
conjugate(D[0](r)(x))

Ginac (and hence Pynac) does not appear to support doing this - see this. However, presumably one could implement a trivial conjugation to the fderivative or tderivative ... the problem is that I'm not sure whether we should automatically assume that this makes sense. See, for instance, the convoluted discussion at The Maple equivalent of ask.sagemath. On the other hand, Sympy allows this. If there is a consensus, a ticket should be opened, though!

It looks like Sage is (incorrectly? naively?) applying the chain rule to conjugate(q(x,t)), since conjugate is a pure symbolic thing in Sage a priori. In fact, the multiple variables are irrelevant:

sage: r = function('r',x)
sage: g = r*r.conjugate()
sage: g.derivative(x)
r(x)*D[0](conjugate)(r(x))*D[0](r)(x) + conjugate(r(x))*D[0](r)(x)

sage: r.conjugate().derivative(x)
D[0](conjugate)(r(x))*D[0](r)(x)
sage: r.derivative().conjugate()
conjugate(D[0](r)(x))

Ginac (and hence Pynac) does not appear to support doing this - see this. However, presumably one could implement a trivial conjugation to the fderivative or tderivative ... the problem is that I'm not sure whether we should automatically assume that this makes sense. See, for instance, the convoluted discussion at The Maple equivalent of ask.sagemath. On the other hand, Sympy allows this. If there is a consensus, a ticket should be opened, though!