Hi Alfonso,
This is a very nice idea! I think it might be usefully expanded as
follows. If you know that there is a total derivative in your
expression, you can use MapAt to apply a similar rule to one term, and
get the rest to cancel:
ToHoldDerivativeRule = {outside_ cd_?CovDQ[a_]@inside_ :>
cd[a]@HoldDerivative[outside inside] - inside cd[a]@outside};
ToHoldDerivative[expr_] := expr /. ToHoldDerivativeRule
Then for example, on some expanded expression,
In[] := CD[-a][v[b] w[c]]
Out[] := w[c] CD[-a]@v[b] + v[b] CD[-a]@[w[c]
Using MapAt,
In[] := MapAt[ToHoldDerivative, %, 1]
Out[] := CD[-a]@HoldDerivative[v[b] w[c]]
Unfortunately, I don't think there's any way to know in advance to
which term to apply this rule. After all, and expression may not have
any total derivatives.
Best
Leo
> --
> You received this message because you are subscribed to the Google Groups "xAct Tensor Computer Algebra" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
xact+uns...@googlegroups.com.
> For more options, visit
https://groups.google.com/groups/opt_out.
>
>