Hi Guillaume,
Indeed, those Kronecker deltas should be absorbed if there is enough information to make sure that the indices are in the proper ranges to guarantee coincidences. We are working on this problem, but it will take a bit more time to be in the system.
In the meantime, there are some tricks that you can use in simple cases. For example let us build the simplifyDelta function:
restrictedSum[e_, {{a_, ___}}, a_] := e;
restrictedSum[e_, {l___, {a_, ___}, r___}, a_] := Sum[e, l, r];
simplifyDelta[expr_] := expr //. {
HoldPattern[Sum[e_ KroneckerDelta[a_, b_], inds__]] :> restrictedSum[ReplaceAll[e, a -> b], {inds}, a] /; ! FreeQ[e, a],
HoldPattern[Sum[e_ KroneckerDelta[a_, b_], inds__]] :> restrictedSum[ReplaceAll[e, b -> a], {inds}, b] /; ! FreeQ[e, b]
};
Now take for example a case with two sums:
mySum = Sum[a[i] m[i, j] b[j], {i, 1, n}, {j, 1, n}]
and take a second derivative, so we get two deltas:
In[]:= D[mySum, a[k], b[l]]
Out[]= Sum[KroneckerDelta[i, k] KroneckerDelta[j, l] m[i, j], {i, 1, n}, {j, 1, n}]
In[]:= % // simplifyDelta
Out[]= m[k, l]
Of course, you need to avoid repetition of symbols (both in indices and in names of indexed objects). The eventual algorithm in WL will handle all these things automatically.
Let me finally point out that there are several powerful Wolfram Language packages to handle indexed objects, and probably one of them can help you already. See for example xAct (www.xact.es).