Skip to content

Setting a value to a scalar product using Mathematica List #85

Answered by vsht
YangPhy asked this question in Q&A
Discussion options

You must be logged in to vote

Unfortunately, it is not possible to set FeynCalc scalar products via direct list assignments.

The code

{SPD[p1]}={0}

actually assigns 0 only to SPD[p1], but not to the more fundamental Pair[Momentum[p1,D],Momentum[p1,D]],
so it doesn't work as expected neither for SPD[p1] nor for SPD[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.

SP/:
	Set[SP[a_, b_] , c_]:=
		(ScalarProduct[a,b,Dimension->4,SetDimensions->{4}]=c)

but a definition s…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@YangPhy
Comment options

@vsht
Comment options

@YangPhy
Comment options

Answer selected by YangPhy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants