3
$\begingroup$

What is the reason why the following expression does not simplify to True?

Assuming[
  i > 0 && j > 0 && k > 0 && Element[{i, j, k}, Integers],
  FullSimplify[
    KroneckerDelta[i, j] * KroneckerDelta[i, k] == KroneckerDelta[i, j, k]
  ]
]

(* KroneckerDelta[i, j] KroneckerDelta[i, k] == KroneckerDelta[i, j, k] *)

Is there a corner case where this equation is actually false? Does Mathematica simply not know about this identity? If the latter is the case, how could I define a rule for FullSimplify to simplify products like the one on the left hand side?

$\endgroup$
  • $\begingroup$ If you use Einstein summation convention then you would probably prefer KroneckerDelta[i, j] * KroneckerDelta[i, k] to simplify to KroneckerDelta[j,k], for example. So it is likely easier to just allow the user to specify their desired behavior. $\endgroup$ – evanb Oct 21 '15 at 18:44
4
$\begingroup$

You may be able to "teach" KroneckerDelta about this:

Unprotect[KroneckerDelta];
KroneckerDelta /: (Times[KroneckerDelta[i_, j_], KroneckerDelta[k_, m_]] /; i == k) := 
      KroneckerDelta[i, j, m]
Protect[KroneckerDelta];

After the above, here is the new behavior:

KroneckerDelta[a, b] KroneckerDelta[c, d] (* this doesn't match *)
KroneckerDelta[a, b] KroneckerDelta[a, d] (* your use case *)

(* Out:
KroneckerDelta[a, b] KroneckerDelta[c, d]
KroneckerDelta[a, b, d]
*)
$\endgroup$
  • $\begingroup$ Thanks. That got me on the right track. I currently use KroneckerDelta /: (Times[KroneckerDelta[i_, j__], KroneckerDelta[i_, k__]]) := KroneckerDelta[i, j, k], which is a little bit more general, I think. $\endgroup$ – David Zwicker Oct 21 '15 at 20:09
  • $\begingroup$ @DavidZwicker Glad it helped! $\endgroup$ – MarcoB Oct 21 '15 at 20:15
2
$\begingroup$

Adding PiecewiseExpand[] forces the conversion of KroneckerDelta[] into Piecewise[] equivalents, which play nicer with simplification:

Assuming[i > 0 && j > 0 && k > 0 && {i, j, k} ∈ Integers, 
         KroneckerDelta[i, j] KroneckerDelta[i, k] == KroneckerDelta[i, j, k]
         // PiecewiseExpand // Simplify]

Another method consists of converting KroneckerDelta[] expressions into the equivalent Iverson brackets (i.e., Boole[]):

KroneckerDelta[i, j] KroneckerDelta[i, k] == KroneckerDelta[i, j, k] /.
k_KroneckerDelta :> Boole[Equal @@ k] // FullSimplify
$\endgroup$

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.