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

Example:

{a, b, c, d}::Indices.
D{#}::Derivative.
ex:= D_{a}{D_{b}{A_{c}}} -D_{b}{D_{a}{A_{c}}};
substitute(_,$ D_{a}{D_{b}{A_{c}}} -> D_{b}{D_{a}{A_{c}}} +R_{a b c d} A^{d} $ )

I hope the substitute returns zero directly. So maybe a new feature for substitute like following:

substitute(_,$ D_{#a}{D_{#b}{A_{c}}} -> D_{b}{D_{a}{A_{c}}} +R_{a b c d} A^{d} $ )

Thus, substitute only substitutes the first term with the "absolute" indices, i.e. D_{a}{D_{b}{A_{c}}}, and do nothing to the second term, i.e. D_{b}{D_{a}{A_{c}}}.

In short, I need to be able to suppress automatic recognition for indices.

By the way, some features in Cadabra.1 such as regular expression, ? and ?? etc. are very helpful for my work.

in Feature requests by (400 points)
edited by

1 Answer

+2 votes
 
Best answer

Instead of relying on index names, substitute like this:

substitute(_,$ D_{a}{D_{b}{A_{c}}} -> 1/2 D_{b}{D_{a}{A_{c}}} + 1/2 D_{a}{D_{b}{A_{c}}} + 1/2 R_{a b c d} A^{d} $ );

Or in other words, decompose the double derivative into a symmetric bit and an anti-symmetric bit. The symmetric bits will then cancel in your original expression, leaving the Riemann tensor.

by (82.5k points)
selected by

Thanks a lot!

...