# 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.
{"ft_lang_label":"__label__en","ft_lang_prob":0.7841074,"math_prob":0.96052855,"size":924,"snap":"2021-43-2021-49","text_gpt3_token_len":257,"char_repetition_ratio":0.11521739,"word_repetition_ratio":0.0,"special_character_ratio":0.28030303,"punctuation_ratio":0.22705314,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9994604,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2021-10-28T10:09:21Z\",\"WARC-Record-ID\":\"<urn:uuid:aba170f2-ed75-4558-862c-439e521847df>\",\"Content-Length\":\"17056\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:60144c93-1f12-468b-a609-ec67e17b2020>\",\"WARC-Concurrent-To\":\"<urn:uuid:e1b6429d-ba9d-4546-aa28-129012f34917>\",\"WARC-IP-Address\":\"78.31.107.13\",\"WARC-Target-URI\":\"https://cadabra.science/qa/1212/eliminate_kronecker-with-index-hierarchy\",\"WARC-Payload-Digest\":\"sha1:ZBNCK6TB6Y64PRWLDOBFVE6AJSNTY5AZ\",\"WARC-Block-Digest\":\"sha1:SQCJB2BQHQDTSU7KWSTIAAXDNQFOZ7WW\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2021/CC-MAIN-2021-43/CC-MAIN-2021-43_segments_1634323588284.71_warc_CC-MAIN-20211028100619-20211028130619-00698.warc.gz\"}"}