Hardcoded 'VG' and 'g3' in calchep.m

Report the bugs you found
Post Reply
JPEllis
Posts: 71
Joined: 28. Apr 2016, 10:34

Hardcoded 'VG' and 'g3' in calchep.m

Post by JPEllis » 21. Feb 2018, 11:16

Hi,

While generating the calcHEP output, I noticed that the gluons are hardcoded with the variable 'VG' near line 527 of calchep.m, and similarly 'g3' is hardcoded for the strong coupling constant.

One fix is the define a (local) variable tmpVG and tmpg3 as follows:

Code: Select all

tmpVG = Select[ParticleDefinitions[EigenstateName], MemberQ[#[[2]], Rule[Description, "Gluon"]] &, \[Infinity]][[1, 1]];
tmpg3 = Select[ParameterDefinitions, MemberQ[#[[2]], Rule[Description, "Strong-Coupling"]] &, \[Infinity]][[1, 1]];
and replace all VG with tmpVG and g3 with tmpg3 in that file. For instances of g3 which appear in strings, one needs to use CHForm[tmpStrongCoupling] and the appropriate use of <> to concatenate the strings.

The following patch works for me, but it is only a quick fix.

Code: Select all

From a255aaa0fd7860e6560bb99d5b6ab57bd6ef89fb Mon Sep 17 00:00:00 2001
From: JP-Ellis <josh@jpellis.me>
Date: Wed, 21 Feb 2018 21:14:53 +1100
Subject: [PATCH] [calchep] Fix for hard-coded gluons and strong coupling

Signed-off-by: JP-Ellis <josh@jpellis.me>
---
 Package/Outputs/calchep.m | 26 ++++++++++++++------------
 1 file changed, 14 insertions(+), 12 deletions(-)

diff --git a/Package/Outputs/calchep.m b/Package/Outputs/calchep.m
index cda4133..8cae5d3 100755
--- a/Package/Outputs/calchep.m
+++ b/Package/Outputs/calchep.m
@@ -523,11 +523,13 @@ If[FreeQ[exclude,SSVV],
 WriteVerticesCHep4[SA`VertexList[SSVV],CPViolation,FeynmanGauge, SSVV,NoSplitWith,NoSplitOnly,False];
 ];
 
+tmpVG = Select[ParticleDefinitions[EigenstateName], MemberQ[#[[2]], Rule[Description, "Gluon"]] &, \[Infinity]][[1, 1]];
+tmpg3 = Select[ParameterDefinitions, MemberQ[#[[2]], Rule[Description, "Strong-Coupling"]] &, \[Infinity]][[1, 1]];
 WriteString[lagrangeFile," "];
-WriteString[lagrangeFile,InsString[CalcHepName[VG,1,1],lP]<>"|"];
-WriteString[lagrangeFile,InsString[CalcHepName[VG,1,1],lP]<>"|"];
-WriteString[lagrangeFile,InsString[CalcHepName[VG,1,1]<>".t",lP]<>"|        |"];
-WriteString[lagrangeFile,InsString["g3/sqrt2",lF]];
+WriteString[lagrangeFile,InsString[CalcHepName[tmpVG,1,1],lP]<>"|"];
+WriteString[lagrangeFile,InsString[CalcHepName[tmpVG,1,1],lP]<>"|"];
+WriteString[lagrangeFile,InsString[CalcHepName[tmpVG,1,1]<>".t",lP]<>"|        |"];
+WriteString[lagrangeFile,InsString[CHForm[tmpg3]<>"/sqrt2",lF]];
 WriteString[lagrangeFile,"|m1.M3*m2.m3-m1.m3*m2.M3 \n"];
 
 
@@ -556,7 +558,7 @@ If[c2===1,c2="+";,If[c2<0,c2=CHForm[c2]<>"*";,c2="+"<>CHForm[c2]<>"*"]];
 If[c3===1,c3="+";,If[c3<0,c3=CHForm[c3]<>"*";,c3="+"<>CHForm[c3]<>"*"]];
 
 subVertexGen={"gt1"-> Hold[ToString[iter1]],"gt2"-> Hold[ToString[iter2]],"gt3"-> Hold[ToString[iter3]]};
-If[D[D[value,g3],g3]===0,
+If[D[D[value,tmpg3],tmpg3]===0,
 
 particle1=SA`VertexList[VVVV][[i,1,1]] /. A_[{a__}]->A;
 particle2=SA`VertexList[VVVV][[i,1,2]] /. A_[{a__}]->A;
@@ -607,23 +609,23 @@ Print["   ... Generic class: ",StyleForm[SVA,"Section",FontSize->10],". Expandin
 
 For[i=1,i<=Length[PART[S]],
 progressNrCH[SVA]=i;
-progressCoupCH[SVA]={PART[S][[i,1]],VG,conj[partGA[[i,1]]]};
+progressCoupCH[SVA]={PART[S][[i,1]],tmpVG,conj[partGA[[i,1]]]};
 
 If[FreeQ[getIndizes[PART[S][[i,1]]],color]==False  && (SA`DynL[PART[S][[i,1]],color] ==={1,1} || SA`DynL[PART[S][[i,1]],color] ==={1,0} || SA`DynL[PART[S][[i,1]],color] ==={0,1} ),
 For[iter1=1,iter1<=getGen[PART[S][[i,1]]],
 For[fiter1=1,fiter1<=getFla[PART[S][[i,1]]],
 WriteString[lagrangeFile," "];
 WriteString[lagrangeFile,InsString[CalcHepName[PART[S][[i,1]],iter1,fiter1],lP]<>"|"];
-WriteString[lagrangeFile,InsString[CHepName[VG,1,1],lP]<>"|"];
+WriteString[lagrangeFile,InsString[CHepName[tmpVG,1,1],lP]<>"|"];
 WriteString[lagrangeFile,InsString[CalcHepName[conj[partGA[[i,1]]],iter1,fiter1],lP]<>"|        |"];
-WriteString[lagrangeFile,InsString["i*Maux*g3",lF]];
+WriteString[lagrangeFile,InsString["i*Maux*"<>CHForm[tmpg3],lF]];
 WriteString[lagrangeFile,"| m2.m3 \n"];
 
 WriteString[lagrangeFile," "];
 WriteString[lagrangeFile,InsString[CalcHepName[conj[PART[S][[i,1]]],iter1,fiter1],lP]<>"|"];
-WriteString[lagrangeFile,InsString[CHepName[VG,1,1],lP]<>"|"];
+WriteString[lagrangeFile,InsString[CHepName[tmpVG,1,1],lP]<>"|"];
 WriteString[lagrangeFile,InsString[CalcHepName[partGA[[i,1]],iter1,fiter1],lP]<>"|        |"];
-WriteString[lagrangeFile,InsString["i*Maux*g3",lF]];
+WriteString[lagrangeFile,InsString["i*Maux*"<>CHForm[tmpg3],lF]];
 WriteString[lagrangeFile,"| m2.m3 \n"];
 fiter1++;];
 iter1++;];
@@ -2053,7 +2055,7 @@ For[i=1,i<=Length[vlist],
 progressNrCH[type]=i;
 progressCoupCH[type]=vlist[[i,1]];
 
-If[D[D[vlist[[i,2,1]],g3],g3]===0,
+If[D[D[vlist[[i,2,1]],tmpg3],tmpg3]===0,
 cfsupported=CheckCHsupportedColor[vlist[[i,1]]];,
 cfsupported=True;
 ];
@@ -2081,7 +2083,7 @@ WriteCompleteVertex=True;
 
 If[WriteCompleteVertex==True,
 
-If[D[D[vlist[[i,2,1]],g3],g3]===0,
+If[D[D[vlist[[i,2,1]],tmpg3],tmpg3]===0,
 subVertexGen={"gt1"-> Hold[ToString[iter1]],"gt2"-> Hold[ToString[iter2]],"gt3"-> Hold[ToString[iter3]],"gt4"-> Hold[ToString[iter4]],"ft1"-> Hold[ToString[fiter1]],"ft2"-> Hold[ToString[fiter2]],"ft3"-> Hold[ToString[fiter3]],"ft4"-> Hold[ToString[fiter4]]};
 value=CalcHepVertex[vlist[[i,2,1]]];
 
-- 
2.16.2
Joshua Ellis jpellis.me

FStaub
Site Admin
Posts: 822
Joined: 13. Apr 2016, 14:05

Re: Hardcoded 'VG' and 'g3' in calchep.m

Post by FStaub » 23. Feb 2018, 14:30

Hi,

Thanks, it's changed. However, no need to define tmpVG and tmpg3. For these purposes the variables 'Gluon" and 'strongCoupling' exist.

Cheers,
Florian

JPEllis
Posts: 71
Joined: 28. Apr 2016, 10:34

Re: Hardcoded 'VG' and 'g3' in calchep.m

Post by JPEllis » 23. Feb 2018, 14:43

Thanks for that. I wasn't sure whether they were defined somewhere else already, hence why I (re)defined them :)
Joshua Ellis jpellis.me

Post Reply