Suppose I have this expression

    Sum[F[i, j] KroneckerDelta[j, k], {j, 1, 3}]

(* F[i, 1] KroneckerDelta[1, k] + F[i, 2] KroneckerDelta[2, k] +
            F[i, 3] KroneckerDelta[3, k] *)

Is it possible for Mathematica to present the contracted result



  • $\begingroup$ note this is only true for i,k integers in {1,2,3}. That said even with appropriate assumptions it doesn't simplify as you'd like. $\endgroup$ – george2079 Jun 24 '14 at 18:56

While doing the Sum over j, you turn the second argument of F into a number. This concrete substitution has to be avoided.

To do this, we have to tell Mathematica that F[i,j] with a concrete number for j should be rewritten immediately as an expression that can be simplified to something involving F[i,k]. To do this, I add the following symbolic rule for F:

Clear[i, j, k];
F[i_, j_?NumericQ] := F[i, k] KroneckerDelta[k, j]

Assuming[k > 0 && k ∈ Integers && k < 4,
 Simplify[Sum[F[i, j] KroneckerDelta[j, k], {j, 1, 3}]

(* ==> F[i, k] *)
  • $\begingroup$ interesting but it seems not all that useful in general since you can only handle the one specific symbol k that way. $\endgroup$ – george2079 Jun 25 '14 at 15:58
  • $\begingroup$ @george2079 Well, that's what the question is about. $\endgroup$ – Jens Jun 25 '14 at 16:58

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.