# \delta^\mu_\mu fails to contract to 4.

0 votes

I can't get the trace of a Kronecker delta to give me 4.

With all the usual index declarations, etc,...

\delta_{\mu}^{\nu}::KroneckerDelta.
\delta^{\mu}_{\nu}::KroneckerDelta.

Z := Z = \delta^\mu_\mu;
eliminate_kronecker(Z);
canonicalise(Z);


gives back only Z = \delta^\mu_\mu;
I would have expected it to give Z = 4.

Have I done something wrong?

asked

## 1 Answer

0 votes

Cadabra does not automatically assume that the dimension of space-time is 4. So you have to declare the range of the indices. If you do

{\mu,\nu}::Indices.
{\mu,\nu}::Integer(0..3).
\delta^{\mu}_{\nu}::KroneckerDelta.

Z := Z = \delta^\mu_\mu;
eliminate_kronecker(Z);


you get Z=4 as expected.

answered by (61.5k points)