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

Hi, I have $\delta$-symbols involving a color index $a$ that runs from 1 to 3 and a Euclidian index $\mu$ from 1 to 4.

{\mu,\nu}::Indices(Euklid, position=free).
{a,b}::Indices(Color, position=independent).

But when I try to contract them like in

ex := \delta_{a \mu} \delta_{a \mu} ;

I get 4 but it should be 3. When I reverse the order of the indices I get the correct number:

ex2 := \delta_{\mu a} \delta_{\mu a} ;

This gives 3.

I suppose cadabra contracts the first two indices first so in the first case we get

$\delta{a \mu} \delta^{a \mu} = \delta{\mu}^{\mu} = 4$

and in the second it becomes

$\delta{\mu a} \delta^{\mu a} = \delta{a}^{a} = 3$.

Maybe this behavior could be avoided by always first contracting the indices of higher dimension? In the meantime, can somebody think of a workaround?

In the interest of completeness:

ex3 := \delta_{\mu a} \delta_{a \mu} ;

gives 4 and

ex4 := \delta_{a \mu} \delta_{\mu a} ;

returns 3.

Thank you

EDIT: Directly after asking I think I found a workaround by adding a substitution to the post_process function that sorts the indices such that the Euclidian one gets contracted first.

def post_process(ex):
    substitute( ex, $\delta_{a \mu} = \delta_{\mu a}$ )
in Bug reports by (130 points)
edited by

It might be a dull comment but, Have you tried to use the vielbein property Link to github

Please log in or register to answer this question.