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

Hi guys,

I want to exchange two indices, and i write following code, but it does't work. What is wrong here?

ex:=V^{a b} A^{c} A^{c} C^{a b}-V^{a b} A^{a} A^{b} C^{c c};
rename_dummies(_, "one", "two");
in General questions by (1.2k points)

1 Answer

0 votes

That won't work, you can't declare {a,b,c} to be index set 'one' and then declare that same index set to be also called 'two', but with indices re-ordered. The order of indices in a set does not mean anything.

It does work with


as the 2nd line, but I assume that that's not what you want.

If your computation relies on the explicit names of dummy indices, you are probably doing something 'wrong' (in the sense of: there is a much better way to do it with Cadabra). Can you say a little bit more about what you are aiming to do?

by (71.6k points)

Following is my complete code

ex:=\int{\nabla^{\alpha}{{V^{\mu\nu} \nabla^{\mu}{C^{\alpha\nu}}};
integrate_by_parts(_, $V^{\mu?\nu?}$);

I want to make

$$ V^{\alpha \mu} (-\nabla^{\nu}\nabla^{\nu}{C^{\alpha \mu}}-\nabla^{\nu}\nabla^{\alpha}{C^{\mu \nu}}+\nabla^{\nu}\nabla^{\alpha}{C^{\nu \mu}})=0 $$


$$ V^{\mu\nu}(\nabla^{\alpha}\nabla^{\alpha}C^{\mu\nu}+\nabla^{\alpha}\nabla^{\mu}C^{\alpha\nu}+\nabla^{\alpha}\nabla^{\mu}C^{\nu\alpha})=0 $$

where $V^{\mu\nu}$ is antisymmetric.

So the question would be: 'Why do you want to rewrite it in that form?'. What makes that 2nd line better than the 1st? I'm guessing that you want to compare to some expression in the literature? Why not simply write out that expression and let Cadabra show that the two are the same? Or is it something else?

Just for the sake of unity with the context. Of course, they are mathematically equivalent.