-
Hi all, Today I was trying to set a value to a scalar product using MMA List but it did now work well. Let me show what was happening: As we know, in FeynCalc, SPD[p] stands for the scalar product SPD[p,p], so it is understandable that SPD[p,p]=0 if we set SPD[p]=0. However, if one wants to set the values of several scalar products together, using {SPD[p1],SPD[p2],SPD[p3]}={0,0,0}, there would be SPD[p1]=0 but SPD[p1,p1]=p1^2--they are not equal to each other anymore! Does anyone else also see the same thing? Attached is an example in .nb file. Best, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Unfortunately, it is not possible to set FeynCalc scalar products via direct list assignments. The code
actually assigns The reason for this is a technical limitation within Mathematica: Scalar product assignments in FeynCalc are implemented
but a definition such as
is already too complex and is not allowed. Of course, one could redefine
which would make
work as expected. However, messing with the definitions of protected Mathematica symbols is almost always tl;dr Please do not use direct list assignments as in your example. This won't work.
This is perfectly fine and should always work as expected. I'll consider adding something like |
Beta Was this translation helpful? Give feedback.
Unfortunately, it is not possible to set FeynCalc scalar products via direct list assignments.
The code
actually assigns
0
only toSPD[p1]
, but not to the more fundamentalPair[Momentum[p1,D],Momentum[p1,D]]
,so it doesn't work as expected neither for
SPD[p1]
nor forSPD[p1,p1]
.The reason for this is a technical limitation within Mathematica: Scalar product assignments in FeynCalc are implemented
via UpValues using TagSetDelayed. However, the assignments cannot be arbitrarily complicated, as that would slow down Mathematica's
pattern matcher too much. One can have e.g.
but a definition s…