I see that:

Sum[u[q] u[k] v[k1] v[k + k1 + q] KroneckerDelta[k1 - q], {k1, -\[Infinity], \[Infinity]}]

produces the correct result: u[k] u[q] v[q] v[k + 2 q]


Sum[u[q] u[k] v[k1] v[k + k1 + q] KroneckerDelta[k - q], {k1, -\[Infinity], \[Infinity]}]

does not give

Sum[u[q] u[q] v[k1] v[k1+2*q], {k1, -\[Infinity], \[Infinity]}]

as I would like to. Can this be done?

Also, a similar thing occurs in multiple summations involving KroneckerDelta or DiscreteDelta, e.g:

Sum[u[q] u[k] v[k1] v[k + k1 + q] KroneckerDelta[k1 - q], 
{q, -\[Infinity], \[Infinity]}, {k,-\[Infinity], \[Infinity]}, {k1, -\[Infinity], \[Infinity]}]

doesn't give as output:

Sum[u[q] *u[k]*v[q]*v[k + 2*q] KroneckerDelta[k1 - q], 
{q,-\[Infinity], \[Infinity]}, {k,-\[Infinity],\[Infinity]}]

Any suggestions?

  • 1
    $\begingroup$ The output of the second example is correct, because MMA can not know if q==k or q !=k. However the problem is here: if one sums over k1 and k, the output is not evaluated. $\endgroup$ Dec 17, 2020 at 20:42
  • $\begingroup$ How can MMA not know that q=k in the second example since KroneckerDelta[k - q] is included? $\endgroup$
    – geom
    Dec 17, 2020 at 21:17
  • $\begingroup$ Your are summing over k1 not k. If k != q the sum is zero. $\endgroup$ Dec 17, 2020 at 21:24
  • $\begingroup$ true, so how can I make it understand that I want q==k and not q!=k ? $\endgroup$
    – geom
    Dec 17, 2020 at 22:09
  • $\begingroup$ Simple, use k everywhere instead of q. (or the other way round) $\endgroup$ Dec 18, 2020 at 8:27


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.