FeynCalc / feyncalc

Mathematica package for algebraic calculations in elementary particle physics.
https://feyncalc.github.io
GNU General Public License v3.0
309 stars 87 forks source link

PairContract Error #78

Closed Ferrylodge closed 3 years ago

Ferrylodge commented 3 years ago

The output is "( User Mathematica initialization file )".

Problem

In[2]:= << FeynCalc`

In[5]:= SP[v, M] = 0; SP[M, M] = 1; SP[v, v] = -1; FV[R, la_] := FV[M, la] + FV[v, la];

In[9]:= B3comm[la, be, cu] := FV[v, la] FV[v, be] FV[v, cu]; H1[a] := Contract[B3comm[om, om, a]];

In[11]:= T1[a, b] := H1[a] FV[v, b] + H1[b] FV[v, a]; res1 = Contract[T1[mu, om] FV[R, om]]

During evaluation of In[11]:= PairContract::failmsg: Error! PairContract has encountered a fatal problem and must abort the computation. The problem reads: The expression Pair[LorentzIndex[om], Momentum[v]]^3 violates Lorentz covariance!

Out[12]= $Aborted

The result should be 2v^mu. I don't understand why I've gotten an error instead. Thanks.

vsht commented 3 years ago

You introduce a dummy index om in the definition of H1 and then use the same index when calling T1. Combined with delayed evaluation via := this inevitably leads to a situation where you have three identical indices in a term, thus violating Einstein's convention.

The dummy indices must be always chosen such, that they are unique, otherwise errors (obvious and nonobvious) are inevitable. A workaround would be e.g.

SP[v, M] = 0;
SP[M, M] = 1;
SP[v, v] = -1;
FV[R, la_] := FV[M, la] + FV[v, la];
B3comm[la_, be_, cu_] := FV[v, la] FV[v, be] FV[v, cu];

H1[a_] := (li = Unique[]; Contract[B3comm[li, li, a]]);
T1[a_, b_] := H1[a] FV[v, b] + H1[b] FV[v, a];

res1 = Contract[T1[mu, om] FV[R, om]]

where li is a uniquely generated dummy index.

Ferrylodge commented 3 years ago

Thanks so much for explaining what is happening vsht. I will omit your code "li = Unique[]" but use "li" instead of "om" in "B3comm[li, li, a]" and then the error message is avoided. Please go ahead and close this issue.

Ferrylodge commented 3 years ago

I guess I can leave a comment even after this thread is closed. So, I just want to mention that I stopped getting error messages, but still the results did not check out. Therefore I tried inserting the code you suggested

(li = Unique[]

and now everything checks out so far as I can tell. :-)

vsht commented 3 years ago

Well, I added a Unique[] for a reason. FeynCalc doesn't perform automatic dummy index renaming, so one should pay attention to that.