# 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!

The issue here is that \delta^{0}_{p} \delta^{p}_{\alpha} gets correctly changed to \delta^{0}_{\alpha}, but is then not recognised to be zero, and used to convert the \alpha index on your \gamma^{\alpha\beta} tensor. Unfortunately eliminate_kronecker does not allow you to hook into these individual steps (otherwise you could set this mixed-index delta to zero using a custom post_process function). I'll put this on the todo list.
 substitute(ex, $\delta^{a?}_{b?} \delta^{b?}_{c?} = \delta^{a?}_{c?}$);
substitute(ex, $\delta^{0}_{\beta} -> 0$);

Then follow that with an eliminate_kronecker to eliminate deltas contracted with other tensors.