Kronecker Delta
- To: mathgroup at smc.vnet.net
- Subject: [mg9788] Kronecker Delta
- From: "Arturas Acus" <acus at itpa.lt>
- Date: Fri, 28 Nov 1997 05:35:04 -0500
- Sender: owner-wri-mathgroup at wolfram.com
> Two things I love about Mathematica. A) the amount of help you get, and > B) the fact that anything can be done in at least... umm... 5 ways. Ok, I agree. It seems I have rather interesting programming problem. Any help will be greatly appreciated. Suppose I want to implement Kronecker Delta (KD) properties, when using it together with summation (dummy) indices. For example, A[a]*B[b]*KD[a,b] should simplify to A[b]*B[b], where sumation over a and b are understood. If one knows exactly how many indices must occur in the expression, then it is simple task: we simply count them before replacing. Unfortunately, when working on curved space (say SU(2) group manifold) Aditional summation phase factors may occur (but may not). For example on SU(2) manifold in circular coordinates we have (-1)^a *A1[a]*A2[a]=(-1)^1 *A1[1]*A2[1]+(-1)^0 *A1[0]*A2[0]+(-1)^(-1) *A1[-1]*A2[-1]. On the other hand summation with Clebsch-Gordan coefficients can not involve phase factors. So we do not have fixed number of summation indices here. Then implementation of KD properties becomes problematic. Indeed simple solution like: KD/: Times[any_,KD[b_Symbol,c_]]:=ReplaceAll[any,b->c] works well for Times[(-1)^a, A[a],B[b],KD[a,b]] but NOT for Times[(-1)^a,Times[ A[a],B[b],KD[a,b]]] In the last case (-1)^a is not replaced, of course. Assuming that expressions of type (a+b)*(c+d) are not allowed (expanding always) one can try something like Plus[a_,Times[b_,KD[]]:=.... Pattern to eliminate previous case. But this solution is very bad (and inefficent): one needs Unprotect Times or Plus. KD is too deep. I hope that solution could be found if I managed to control absolute Level where pattern matching take place. Then again making assumptions about expression complexity I could allow substitutions at levels before some particular level and forbid below that level. So, could I control absolute pattern matching Level? Other ideas also are welcome. Please answer also to: acus at itpa.lt Ps. Of course, I always can introduce Kontravariant and Kovariant components and eliminate summation phase, but there are other reasons not to do that. I Arturas Acus Institute of Theoretical Physics and Astronomy Gostauto 12, 2600,Vilnius Lithuania E-mail: acus at itpa.lt Fax: 370-2-225361 Tel: 370-2-612906