commit d45cf66bdfe53d22fe6cfdb7229b21212216549b
parent be275c871536e3e3d01ab74ab58b434a78e567da
Author: Bakar Chargeishvili <bakar@bcharge.de>
Date: Tue, 3 May 2022 17:22:12 +0200
Fix amplitudes
Diffstat:
M | webs.c | | | 71 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------ |
1 file changed, 65 insertions(+), 6 deletions(-)
diff --git a/webs.c b/webs.c
@@ -126,6 +126,13 @@ main(int argc, char *argv[])
char *final[] = {"q","qbar", "g"};
//char *final[] = {"q","qbar", "q", "qbar", "q", "qbar","q", "qbar","q", "qbar","q","qbar", "q", "qbar", "q", "qbar","q", "qbar"};
+ FILE *fcol = fopen("colorFactors.h","w");
+ FILE *fkin = fopen("kinFactors.h","w");
+
+ if (fcol == NULL || fkin == NULL) {
+ die("Error while creation files for writing!");
+ }
+
int nLoops = 1;
size_t nLegs = NELEMS(initial) + NELEMS(final);
@@ -181,19 +188,68 @@ main(int argc, char *argv[])
char *color = (char*)malloc(10000 * sizeof(char));
char *kin = (char*)malloc(10000 * sizeof(char));
+ char *Delta1 = (char*)malloc(sizeof(char));
+ char *Delta2 = (char*)malloc(sizeof(char));
+ char *delta1 = (char*)malloc(sizeof(char));
+ char *delta2 = (char*)malloc(sizeof(char));
+
+ if(!strcmp(Legs[emitterLegId].name,"q")){
+ Delta1 = "+";
+ }
+ else if(!strcmp(Legs[emitterLegId].name,"qbar")){
+ Delta1 = "-";
+ }
+ if(!strcmp(Legs[absorberLegId].name,"q")){
+ Delta2 = "+";
+ }
+ else if(!strcmp(Legs[absorberLegId].name,"qbar")){
+ Delta2 = "-";
+ }
+
+ if(Legs[emitterLegId].init && Legs[absorberLegId].init)
+ {
+ delta1 = "-";
+ delta2 = "+";
+ if(!strcmp(Legs[emitterLegId].name,"g"))
+ Delta1 = "-";
+ if(!strcmp(Legs[absorberLegId].name,"g"))
+ Delta2 = "-";
+ }
+ else if(Legs[emitterLegId].init && !Legs[absorberLegId].init)
+ {
+ delta1 = "+";
+ delta2 = "-";
+ if(!strcmp(Legs[emitterLegId].name,"g"))
+ Delta1 = "-";
+ if(!strcmp(Legs[absorberLegId].name,"g"))
+ Delta2 = "-";
+ }
+ else if(!Legs[emitterLegId].init && !Legs[absorberLegId].init)
+ {
+ delta1 = "+";
+ delta2 = "-";
+ if(!strcmp(Legs[emitterLegId].name,"g"))
+ Delta1 = "-";
+ if(!strcmp(Legs[absorberLegId].name,"g"))
+ Delta2 = "-";
+ }
+
+ sprintf(color, "L C%dx%d = ", emitterLegId, absorberLegId);
+ sprintf(kin, "L A%dx%d = ", emitterLegId, absorberLegId);
+ sprintf(kin+strlen(kin), "(%sv%d(n1))/(%sv%d.l)*(%sv%d(m1))/(%sv%d.l)*Ngluon(n1,m1)/l.l;\n",Delta1,emitterLegId,delta1,emitterLegId,Delta2,absorberLegId,delta2,absorberLegId);
if (Legs[emitterLegId].init && !strcmp(Legs[emitterLegId].name,"q")){
- sprintf(color+strlen(color), "\tSUNT(Glu99,Col%d%d,Col%d)*",emitterLegId,emitterNxtId,emitterLegId);
- sprintf(kin+strlen(kin), "\tv%d(n1)/(v%d.l)*",emitterLegId,emitterLegId);
+ sprintf(color+strlen(color), "SUNT(Glu99,Col%d%d,Col%d)*",emitterLegId,emitterNxtId,emitterLegId);
+ sprintf(kin+strlen(kin), "v%d(n1)/(v%d.l)*",emitterLegId,emitterLegId);
}
else if (!Legs[emitterLegId].init && !strcmp(Legs[emitterLegId].name,"q")){
- sprintf(color+strlen(color), "\tSUNT(Glu99,Col%d,Col%d%d)*",emitterLegId,emitterLegId,emitterNxtId);
+ sprintf(color+strlen(color), "SUNT(Glu99,Col%d,Col%d%d)*",emitterLegId,emitterLegId,emitterNxtId);
}
else if (Legs[emitterLegId].init && !strcmp(Legs[emitterLegId].name,"qbar")){
- sprintf(color+strlen(color), "\tSUNT(Glu99,Col%d,Col%d%d)*",emitterLegId,emitterLegId,emitterNxtId);
+ sprintf(color+strlen(color), "SUNT(Glu99,Col%d,Col%d%d)*",emitterLegId,emitterLegId,emitterNxtId);
}
else if (!Legs[emitterLegId].init && !strcmp(Legs[emitterLegId].name,"qbar")){
- sprintf(color+strlen(color), "\tSUNT(Glu99,Col%d%d,Col%d)*",emitterLegId,emitterNxtId,emitterLegId);
+ sprintf(color+strlen(color), "SUNT(Glu99,Col%d%d,Col%d)*",emitterLegId,emitterNxtId,emitterLegId);
}
if (Legs[absorberLegId].init && !strcmp(Legs[absorberLegId].name,"q")){
@@ -229,9 +285,12 @@ main(int argc, char *argv[])
}
}
sprintf(color+strlen(color), "1;\n");
- printf("%s\n", color);
+ fprintf(fcol,"%s", color);
+ fprintf(fkin,"%s", kin);
}
}
+ fclose(fcol);
+ fclose(fkin);
return 0;
/*