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

Hi! When I run the following code, Cadabra gives me ConsistencyException: Free indices in different terms in a sum do not match.


_:= \nabla^{i}{v_{i}} - 2 \nabla_{i}{v^{i}} ;

Is something wrong with the code? Substituting

 substitute(_, $\nabla^{i}{v_{i}} -> \nabla_{i}{v^{i}}$)

did not help. Can I force Cadabra to combine the two terms in another way?

Many thanks! Andreas

in General questions by (320 points)

1 Answer

0 votes
Best answer

Cadabra does not make any assumptions about the symbol you use for the derivative. You need to explicitly declare \nabla to be a derivative:

_:= \nabla^{i}{v_{i}} - 2 \nabla_{i}{v^{i}} ;

does the trick.

by (70.8k points)
selected by