I would like to define a tensor $A_i^j$ which is traceless ($A_i^i = 0$) and to obtain $A_i^j \delta^i_j = 0$ with xAct / xTensor / xCoba.
I first tried defining an antisymmetric tensor, since they are automatically traceless, but the final answer of the following code is not zero, but still $A_i^j \delta^i_j$.
<< xAct`xTensor`
<< xAct`xCoba`
dim = 3;
DefManifold[M, dim, {i, j, k, l, a, b, c, d}]
DefChart[ch, M, {1, 2, 3}, {x[], y[], z[]}, ChartColor -> Red]
metric = CTensor[DiagonalMatrix[{1, 1, 1}], {-ch, -ch}]
SetCMetric[metric, ch, SignatureOfMetric -> {2, 0, 0}]
DefTensor[A[-i, -j], M, Antisymmetric[{-i, -j}]]
A[-i, -j] metric[i, j]
How can I obtain the answer 0 for the above code?
And how can I define a general traceless tensor, not necessarily antisymmetric?