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

I can't quite understand the scope of Depends(). If I run this:

{a, b, c, d, e, f#}::Indices(full, position=independent).

\nabla{#}::Derivative.
\partial{#}::PartialDerivative.
A{#}::Depends(\partial{#}).
A{#}::Depends(\nabla{#}).

ex:= \partial_{ a }{\nabla_{ b }{ A_{ c d }}} -> \nabla_{ a }{ \nabla_{ b } {A_{ c d }}} + \Gamma^{ e }_{ a b } \nabla_{e}{A_{ c d }} + \Gamma^{ e }_{ a c } \nabla_{ b }{ A_{ e d }}
+ \Gamma^{ e }_{ a d } \nabla_{ b }{A_{ c e }};
unwrap(_);

I see that ex doesn't contain the double nabla on the rhs after evaluation. Moreover, unwrap() reveals that the lhs of ex is evaluated to zero.

Why is that? How can this be treated correctly?

in General questions by (740 points)
edited by

1 Answer

+2 votes
 
Best answer

Two issues here. Firstly, make sure you do not write a space between the nabla and the thing on which it acts, so write

\nabla_{a}{ A_{b c} }

not

\nabla_{a} { A_{b c} }

If you do that, the double-nabla stays.

Secondly, you need to merge all the Depends properties into one, otherwise the 2nd one overwrites the first. So make that

A{#}::Depends(\partial{#}, \nabla{#}).

Then unwrap works as expected.

by (83.1k points)
selected by
...