Port of SymPy's PartialDerivative (sympy/tensor/toperators.py): the
derivative of a tensor expression expr with respect to tensors or
symbols. The indices of a tensor variable enter with opposite valence;
repeated indices are contracted. Nested derivatives are flattened.
pd_perform_derivative() evaluates the derivative with Kronecker deltas
and metrics; pd_expand() applies the sum and product rules.
Examples
L <- TensorIndexType("L")
i <- TensorIndex("i", L); j <- TensorIndex("j", L)
A <- TensorHead("A", list(L))
PartialDerivative(A(i), A(j))
#> PartialDerivative(A(i), A(j))
pd_perform_derivative(PartialDerivative(A(i), A(j)))
#> KD(i, -j)