# eliminate_kronecker() with index hierarchy

Hello,

I have a problem contracting Kronecker symbols where I have parent indices and child indices. A minimal example:

{a,b,c,d,e}::Indices(fourD, position=independent)
{a,b,c,d,e}::Integer(0..4)
{\alpha,\beta,\gamma,\delta,\epsilon}::Indices(threeD, position=independent, parent=fourD)
{\alpha,\beta,\gamma,\delta,\epsilon}::Integer(1..3)
\delta{#}::KroneckerDelta()

> ex := \gamma^{\alpha \beta} \delta^{0}_{p} \delta^{p}_{\alpha};
γ^{α β} δ^{0}_{p} δ^{p}_{α}

> eliminate_kronecker(ex);
γ^{0 β}

The result should be zero -- well, it actually were, if I replaced the 0 \beta part of \gamma with zero, but I have many tensors and this would be quite tedious. Also I could define manual substitution rules for contractions of deltas with different indices an then substitute a delta with mixed indices with zero. Also very tedious. Is there anything I can do so that I can just work with eliminate_kronecker()?

Thanks a lot!

substitute(ex, $\delta^{a?}_{b?} \delta^{b?}_{c?} = \delta^{a?}_{c?}$);
substitute(ex, $\delta^{0}_{\beta} -> 0$);