Welcome to Cadabra Q&A, where you can ask questions and receive answers from other members of the community.
0 votes

Is there any simple way to have multiple indices on a single derivative? If I define a derivative in the usual way


then \delta{\mu\nu} is interpreted as a second derivative. I would like \delta{\mu\nu} to represent a single derivative (thus satisfying the product rule) but with multiple indices. This is important for the implementation of derivatives with respect to tensors for example.

asked in General questions by (130 points)

Are you really looking for derivatives like that, or is the actual aim to be able to write something like $\delta{S}/\delta{A_{\mu\nu}}$?

Well, I actually need something like $\delta B^{\mu\nu}/{\delta A^{\rho\sigma}}$. At the moment I have to use 'vary' to compute $\delta B^{\mu\nu}$ and then set $\delta A^{\rho\sigma} \to 1$ at the end to extract $\delta B^{\mu\nu}/{\delta A^{\rho\sigma}}$. But then if I have a more complicated expression such as $\delta B^{\mu\nu}/{\delta A^{\rho\sigma}} + B^{\mu\nu}B_{\rho\sigma}$, I cannot simply substitute whatever expression I have for $B^{\mu\nu}$ into it as the derivatives aren't automatically calculated. So I calculate the derivative separately and substitute in the expression. The problem with that is that I still have to define $\delta_{\mu\nu} (= \delta/\delta A^{\mu\nu})$ as a derivative so that Cadabra gets the indices right in the substitutions. Since $\delta_{\mu\nu}$ is a second derivative, my calculation would clash if I perform an operation such as product_rule, thus I don't use $\delta_{\mu\nu}$ for anything other than a dummy variable that gets replaced by the derivative I obtained with vary. I was just wondering if there is any easier/cleaner route to this and it seems that a derivative with multiple indices would solve my problem.

Please log in or register to answer this question.