Cadabra
a field-theory motivated approach to computer algebra

Derivatives and implicit dependence on coordinates

There is no fixed notation for derivatives; as with all other objects you have to declare derivatives by associating a property to them, in this case the Derivative property.
\nabla{#}::Derivative;
\(\displaystyle{}\text{Attached property Derivative to }\nabla{\#}.\)
Derivative objects can be used in various ways. You can just write the derivative symbol, as in
ex:=\nabla{ A_{\mu} };
\(\displaystyle{}\nabla{A_{\mu}}\)
\nabla(A_{\mu})
Or you can write the coordinate with respect to which the derivative is taken,
s::Coordinate; A_{\mu}::Depends(s); ex:=\nabla_{s}{ A_{\mu} };
\(\displaystyle{}\text{Attached property Coordinate to }s.\)
\(\displaystyle{}\text{Attached property Depends to }A_{\mu}.\)
\(\displaystyle{}\nabla_{s}{A_{\mu}}\)
\nabla_{s}(A_{\mu})
Finally, you can use an index as the subscript argument, as in
{ \mu, \nu }::Indices(vector); ex:=\nabla_{\nu}{ A_{\mu} };
\(\displaystyle{}\text{Attached property Indices(position=free) to }\left[\mu, \nu\right].\)
\(\displaystyle{}\nabla_{\nu}{A_{\mu}}\)
\nabla_{\nu}(A_{\mu})
(in which case the first line is, for the purpose of using the derivative operator, actually unnecessary).
The main point of associating the Derivative property to an object is to make the object obey the Leibnitz or product rule, as illustrated by the following example,
\nabla{#}::Derivative; ex:= \nabla{ A_{\mu} * B_{\nu} }; product_rule(_);
\(\displaystyle{}\text{Attached property Derivative to }\nabla{\#}.\)
\(\displaystyle{}\nabla\left(A_{\mu} B_{\nu}\right)\)
\nabla(A_{\mu} B_{\nu})
\(\displaystyle{}\nabla{A_{\mu}} B_{\nu}+A_{\mu} \nabla{B_{\nu}}\)
\nabla(A_{\mu}) B_{\nu} + A_{\mu} \nabla(B_{\nu})
This behaviour is a consequence of the fact that Derivative derives from Distributable. Note that the Derivative property does not automatically give you commuting derivatives, so that you can e.g. use it to write covariant derivatives.
More specific derivative types exist too. An example are partial derivatives, declared using the PartialDerivative property. Partial derivatives are commuting and therefore automatically symmetric in their indices,
\partial{#}::PartialDerivative; {a,b,m,n}::Indices(vector); C_{m n}::Symmetric; ex:=T^{b a} \partial_{a b}( C_{m n} D_{n m} );
\(\displaystyle{}\text{Attached property PartialDerivative to }\partial{\#}.\)
\(\displaystyle{}\text{Attached property Indices(position=free) to }\left[a, b, m, n\right].\)
\(\displaystyle{}\text{Attached property Symmetric to }C_{m n}.\)
\(\displaystyle{}T^{b a} \partial_{a b}\left(C_{m n} D_{n m}\right)\)
T^{b a} \partial_{a b}(C_{m n} D_{n m})
canonicalise(_);
\(\displaystyle{}T^{a b} \partial_{a b}\left(C_{m n} D_{m n}\right)\)
T^{a b} \partial_{a b}(C_{m n} D_{m n})
Copyright © 2001-2018 Kasper Peeters
Questions? info@cadabra.science