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?

{a,b,c}::Indices("one");
{b,a,c}::Indices("two");
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.4k 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

{k,l,m}::Indices("two");

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 (76.4k points)

Following is my complete code

{\mu,\nu,\alpha}::Indices("one").
{a,b,c}::Indices("two").
{\mu,\alpha,\nu}::Indices("three").
V^{\mu?\nu?}::AntiSymmetric.
\nabla{#}::Derivative.
{C^{\nu?\alpha?},V^{\mu?\nu?}}::Depends(\nabla{#}).
{C^{\nu?\alpha?},V^{\mu?\nu?}}::NonCommuting.
ex:=\int{\nabla^{\alpha}{{V^{\mu\nu} \nabla^{\mu}{C^{\alpha\nu}}};
product_rule(_);
substitute(_,$\nabla^{\alpha}{V^{\mu\nu}}->-\nabla^{\mu}{V^{\nu\alpha}}-\nabla^{\nu}{V^{\alpha\mu}}$);
distribute(_);
integrate_by_parts(_, $V^{\mu?\nu?}$);
canonicalise(_);
factor_out(_,$V^{\alpha?\mu?}$);
rename_dummies(_,"one","two");
rename_dummies(_,"two","three");

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 $$

become

$$ 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.

...