sumSimplifyKD

◼ sumSimplifyKD[expr] simplifies sums. In particular, it correctly handles KroneckerDelta functions.

◼ sumSimplifyKD also splits sums over several indexes into sums over only those indexes that feature in the addends.

◼ See also: sum, sumThread, sumExpand, sumCollect, sumFullSimplify, sumAbstractIndex, sumNameIndex.

Further examples

Load sneg and declare some quantities.

<< sneg`sneg`;
snegfermionoperators[c]
snegfreeindexes[k, k1, σ]

Handle KroneckerDelta function

sum[
      KroneckerDelta[k, k1] nc[c[CR, k], c[AN, k1]], {k, 
        k1}]
sumSimplifyKD[%]

In this case, the expression needs to be expanded first using sumExpand.

expr = 
      nc[sum[number[c[], σ], {σ}], 
        sum[number[c[], σ], {σ}]]
sumSimplifyKD[%]

    
sumExpand[expr]
sumSimplifyKD[%]

Splitting into several sums

sum[f[k] number[c[k1], UP], {k, k1}]
sumSimplifyKD[%]

sum[number[c[k]] + number[c[k1]], {k, k1}]
sumSimplifyKD[%]