FORM v5.0.0-35-g6318119
grccparam.h
1#ifdef GRCC_PARAM_H
2#else
3#define GRCC_PARAM_H
4
5/* #[ License : */
6/*
7 * Copyright (C) 2023-2026 T. Kaneko
8 * When using this file you are requested to refer to the publication
9 * Comput.Phys.Commun. 92 (1995) 127-152
10 *
11 * This file is part of FORM.
12 *
13 * FORM is free software: you can redistribute it and/or modify it under the
14 * terms of the GNU General Public License as published by the Free Software
15 * Foundation, either version 3 of the License, or (at your option) any later
16 * version.
17 *
18 * FORM is distributed in the hope that it will be useful, but WITHOUT ANY
19 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
20 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
21 * details.
22 *
23 * You should have received a copy of the GNU General Public License along
24 * with FORM. If not, see <http://www.gnu.org/licenses/>.
25 */
26/* #] License : */
27
28/*==============================================================
29 * Parameters
30 */
31/*
32#define GRCC_NAMESPACE
33*/
34
35#define GRCC_MAXNCPLG 4
36#define GRCC_MAXLEGS 10
37#define GRCC_MAXMPARTICLES 50
38#define GRCC_MAXMINTERACT 500
39#define GRCC_MAXSUBPROCS 500
40#define GRCC_MAXNODES 20
41#define GRCC_MAXEDGES 100
42#define GRCC_MAXNSTACK 50
43#define GRCC_MAXESTACK 50
44#define GRCC_MAXGROUP 1000
45#define GRCC_MAXPSLIST 500
46
47#define GRCC_MAXMPARTICLES2 (2*GRCC_MAXMPARTICLES-1)
48#define GRCC_MAXFLINES GRCC_MAXEDGES
49
50#define GRCC_FRACERROR (1.0e-10)
51
52/* Standard and error message destination */
53#define GRCC_Stdout stdout
54#define GRCC_Stderr stdout
55
56#ifndef NOFORM
57 #define GRCC_ABORT() Terminate(-1);
58#else
59 #define GRCC_ABORT() exit(1)
60#endif
61
62/*---------------------------------------------------------------
63 * Constants
64 */
65
66/* model definition */
67#define GRCC_DEFBYNAME 1 /* define interactions by particle name */
68#define GRCC_DEFBYCODE 2 /* define interactions by particle code */
69
70/* types of particles */
71#define GRCC_PT_Undef 0
72#define GRCC_PT_Scalar 1
73#define GRCC_PT_Dirac 2
74#define GRCC_PT_Majorana 3
75#define GRCC_PT_Vector 4
76#define GRCC_PT_Ghost 5
77#define GRCC_PT_Size 6
78
79#define GRCC_PTS_Undef "undef"
80#define GRCC_PTS_Scalar "scalar"
81#define GRCC_PTS_Dirac "dirac"
82#define GRCC_PTS_Majorana "majorana"
83#define GRCC_PTS_Vector "vector"
84#define GRCC_PTS_Ghost "ghost"
85
86#define GRCC_PT_Table { GRCC_PTS_Undef, GRCC_PTS_Scalar, GRCC_PTS_Dirac, GRCC_PTS_Majorana, GRCC_PTS_Vector, GRCC_PTS_Ghost}
87
88#define GRCC_PT_GTable { "Undef", "Scalar", "Fermion", "Majorana", "Vector", "Ghost"}
89
90/* for mgraph generation */
91#define GRCC_AT_Vertex 0
92#define GRCC_AT_External -1
93#define GRCC_AT_Initial -2
94#define GRCC_AT_Final -3
95
96#define GRCC_AT_NdStr(x) ((x)>=GRCC_AT_Vertex ?"Vertex": \
97 ((x)==GRCC_AT_External ?"External": \
98 ((x)==GRCC_AT_Final ?"Final": \
99 ((x)==GRCC_AT_Initial ?"Initial":"Undef"))))
100
101/* graph generation */
102#define GRCC_MGraph 0 /* mgraph (topology) generation */
103#define GRCC_AGraph 1 /* agraph generation */
104
105/* options for graph greneration */
106#define GRCC_OPT_Step 0
107#define GRCC_OPT_Outgrf 1
108#define GRCC_OPT_Outgrp 2
109#define GRCC_OPT_1PI 3
110#define GRCC_OPT_NoSelfLoop 4
111#define GRCC_OPT_NoTadpole 5
112#define GRCC_OPT_No1PtBlock 6
113#define GRCC_OPT_No2PtL1PI 7
114#define GRCC_OPT_NoExtSelf 8
115#define GRCC_OPT_NoAdj2PtV 9
116#define GRCC_OPT_Block 10
117#define GRCC_OPT_NoMultiEdge 11
118#define GRCC_OPT_SymmInitial 12
119#define GRCC_OPT_SymmFinal 13
120#define GRCC_OPT_Size 14
121
122typedef unsigned long ULong;
123
124typedef struct {
125 const char *name;
126 const char *mean;
127 int defaultv;
128 int DUMMYPADDING;
129} OptDef;
130
131typedef struct {
132 const char *name;
133 const char *cname;
134 const char *mean;
135} OptQGDef;
136
137typedef struct {
138 const char *name;
139 int index;
140 int sign;
141} OptQGRef;
142
143/*---------------------------------------------------------------
144 * QGRAF options
145 */
146#define GRCC_QGRAF_OPT_ONEPI 0
147#define GRCC_QGRAF_OPT_ONSHELL 1
148#define GRCC_QGRAF_OPT_NOSIGMA 2
149#define GRCC_QGRAF_OPT_NOSNAIL 3
150#define GRCC_QGRAF_OPT_NOTADPOLE 4
151#define GRCC_QGRAF_OPT_SIMPLE 5
152#define GRCC_QGRAF_OPT_BIPART 6
153#define GRCC_QGRAF_OPT_CYCLI 7
154#define GRCC_QGRAF_OPT_FLOOP 8
155//TODO what does this do? Does it work?
156//#define GRCC_QGRAF_OPT_TOPOL 9
157
158#ifdef GRCC_QGRAF_OPT_TOPOL
159#define GRCC_QGRAF_OPT_Size 10
160#else
161#define GRCC_QGRAF_OPT_Size 9
162#endif
163
164/*---------------------------------------------------------------
165 * Conversion of
166 * eind : index (ed) of EGraph.edges[ed]
167 * sind : value (v) of EGraph.nodes[nd]->edges[j])
168 */
169#define I2Vedge(eind, sign) (((sign<=0)?(-1):(1))*((eind)+1))
170#define V2Iedge(sind) (abs(sind)-1)
171#define V2Ileg(sind) ((sind)<0 ? 0 : 1)
172/*---------------------------------------------------------------
173 * data types for model definition
174 */
175typedef struct {
176 const char *name; /* name of the model */
177 int defpart; /* particle is defined by name or code */
178 /* GRCC_DEFBYNAME or GRCC_DEFBYCODE */
179 int ncouple; /* No. of coupling constants */
180 const char *cnamlist[GRCC_MAXNCPLG]; /* Names of coupling constants */
181} MInput;
182
183typedef struct {
184 const char *name; /* name of particle */
185 const char *aname; /* name of anti-particle */
186 int pcode; /* code of particle */
187 int acode; /* code of anti-particle */
188 const char *ptypen; /* type : 'GRCC_PTS_Scalar' etc */
189 int ptypec; /* type : 'GRCC_PT_Scalar' etc */
190 int extonly; /* only as external particle */
191} PInput;
192
193typedef struct {
194 const char *name; /* name of interaction */
195 int icode; /* code of interaction */
196 int nplistn; /* the number of legs */
197 const char *plistn[GRCC_MAXLEGS]; /* list of particle names */
198 int plistc[GRCC_MAXLEGS]; /* list of particle codes */
199 int cvallist[GRCC_MAXNCPLG]; /* coupling constants */
200} IInput;
201
202/*---------------------------------------------------------------
203 * data type for node class input
204 */
205typedef struct {
206 /* used as input to MGraph() and SProcess() */
207 int cldeg;
208 int clnum;
209 int cltyp;
210 int cmind;
211 int cmaxd;
212
213 /* used as input to SProcess() */
214 int ptcl;
215 int cple;
216} NCInput;
217
218/*---------------------------------------------------------------
219 * data types for process definition
220 */
221typedef struct {
222 long ninitl; /* the number of initial particles */
223 const char *initln[GRCC_MAXNODES]; /* list of initial particles (name) */
224 int initlc[GRCC_MAXNODES]; /* list of final particles (code) */
225 long nfinal; /* the number of final particles */
226 const char *finaln[GRCC_MAXNODES]; /* list of final particles (name) */
227 int finalc[GRCC_MAXNODES]; /* list of final particles (code) */
228 int coupl[GRCC_MAXNCPLG]; /* list of orders of c. consts */
229} FGInput;
230
231/* class of node : input for SProcess */
232typedef struct {
233 int cdeg; /* degree of each node */
234 int ctyp; /* type : GRCC_AT_xxx */
235 int cnum; /* the number of nodes in the class */
236 int cple; /* total order of c.c. of each node */
237 /* = 0 for external particle */
238 const char *pname; /* particle name defined in the model */
239 /* = NULL for vertex */
240 long pcode; /* particle code defined in the model */
241 /* = 0 for vertex */
242 /* long = int + padding */
243} PGInput;
244
245/*---------------------------------------------------------------
246 * minimum input data to EGraph
247 */
248typedef struct {
249 int extloop; /* external/loop */
250 int intrct; /* particl/interaction */
251} DNode;
252
253typedef int DEdge[2]; /* {node0, node1} */
254
255typedef struct {
256 int nnodes;
257 int nedges;
258 DNode *nodes;
259 DEdge *edges;
260} DGraph;
261
262/*---------------------------------------------------------------
263 */
264#endif