HepLib
Loading...
Searching...
No Matches
QGRAF.h
Go to the documentation of this file.
1
6#pragma once
7
8#include "HEP.h"
9
13namespace HepLib::QGRAF {
14
15 using namespace std;
16 using namespace GiNaC;
17 using namespace HepLib;
18
19 //-----------------------------------------------------------
20 // Filed/Propagator/Vertex Function
21 //-----------------------------------------------------------
22 DECLARE_FUNCTION_3P(Propagator)
23 DECLARE_FUNCTION_3P(InField)
24 DECLARE_FUNCTION_3P(OutField)
25
26 #ifndef DOXYGEN_SKIP
27
28 class Field2_SERIAL { public: static unsigned serial; };
29 template<typename T1, typename T2>
30 inline GiNaC::function Field(const T1 & p1, const T2 & p2) {
31 return GiNaC::function(Field2_SERIAL::serial, ex(p1), ex(p2));
32 }
33
34 class Field3_SERIAL { public: static unsigned serial; };
35 template<typename T1, typename T2, typename T3>
36 inline GiNaC::function Field(const T1 & p1, const T2 & p2, const T3 & p3) {
37 return GiNaC::function(Field3_SERIAL::serial, ex(p1), ex(p2), ex(p3));
38 }
39
40 class Vertex2_SERIAL { public: static unsigned serial; };
41 template<typename T1, typename T2>
42 inline GiNaC::function Vertex(const T1 & p1, const T2 & p2) {
43 return GiNaC::function(Vertex2_SERIAL::serial, ex(p1), ex(p2));
44 }
45
46 class Vertex3_SERIAL { public: static unsigned serial; };
47 template<typename T1, typename T2, typename T3>
48 inline GiNaC::function Vertex(const T1 & p1, const T2 & p2, const T3 & p3) {
49 return GiNaC::function(Vertex3_SERIAL::serial, ex(p1), ex(p2), ex(p3));
50 }
51
52 class Vertex4_SERIAL { public: static unsigned serial; };
53 template<typename T1, typename T2, typename T3, typename T4>
54 inline GiNaC::function Vertex(const T1 & p1, const T2 & p2, const T3 & p3, const T4 & p4) {
55 return GiNaC::function(Vertex4_SERIAL::serial, ex(p1), ex(p2), ex(p3), ex(p4));
56 }
57
58 class Vertex5_SERIAL { public: static unsigned serial; };
59 template<typename T1, typename T2, typename T3, typename T4, typename T5>
60 inline GiNaC::function Vertex(const T1 & p1, const T2 & p2, const T3 & p3, const T4 & p4, const T5 & p5) {
61 return GiNaC::function(Vertex5_SERIAL::serial, ex(p1), ex(p2), ex(p3), ex(p4), ex(p5));
62 }
63
64 class Vertex6_SERIAL { public: static unsigned serial; };
65 template<typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>
66 inline GiNaC::function Vertex(const T1 & p1, const T2 & p2, const T3 & p3, const T4 & p4, const T5 & p5, const T6 & p6) {
67 return GiNaC::function(Vertex6_SERIAL::serial, ex(p1), ex(p2), ex(p3), ex(p4), ex(p5), ex(p6));
68 }
69
70 #endif
71
75 class Process {
76 public:
77 static string Style;
78 string Model;
79 string In;
80 string Out;
81 string LoopPrefix = "q";
82 int Loops;
83 string Options;
84 vector<string> Others;
85 lst Amplitudes(symtab st);
86
87 #ifndef DOXYGEN_SKIP
88 class _init {
89 public: _init();
90 };
91 private:
92 static _init Process_init;
93 #endif
94 };
95
96 lst TopoLines(const ex & amp);
97 void DrawPDF(const lst & amps, string fn);
98 vector<lst> ShrinkCut(ex amp, lst prop, int n=1);
99 bool HasLoop(ex amp, lst prop);
100 extern map<ex,string,ex_is_less> LineTeX;
101 extern map<ex,string,ex_is_less> VerTeX;
102 extern map<ex,string,ex_is_less> InOutTeX;
103
104 Index LI(ex fn);
105 Index DI(ex fn);
106 Index TI(ex fn);
107 Index FI(ex fn);
108 Index CI(ex fn);
109 Index AI(ex fn);
110 Index RLI(ex fn);
111 Index RDI(ex fn);
112 Index RTI(ex fn);
113 Index RFI(ex fn);
114 Index RCI(ex fn);
115 Index RAI(ex fn);
116
117 // Propagator @ SM https://arxiv.org/abs/1209.6213v2
118 ex QuarkPropagator(const ex & e, const ex & m=0);
119 ex LeptonPropagator(const ex & e, const ex & m=0);
120 ex GluonPropagator(const ex & e, const ex & xi=1);
121 ex GluonGhostPropagator(const ex & e, const ex & xi=1, const ex & eta_G=1);
122 ex AZWPropagator(const ex & e, const ex & m=0, const ex & xi=1);
123 ex AZWGhostPropagator(const ex & e, const ex & m=0, const ex & xi=1, const ex & eta_G=1);
124 ex ScalarPropagator(const ex & e, const ex & m, const ex & xi=1);
125
126 // Vertex @ SM https://arxiv.org/abs/1209.6213v2
127 ex QuarkGluonVertex(const ex & e, const ex & eta_s=-1);
128 ex Gluon3Vertex(const ex & e, const ex & eta_s=-1);
129 ex Gluon4Vertex(const ex & e, const ex & eta_s=-1);
130 ex GhostGluonVertex(const ex & e, const ex & eta_s=-1, const ex & eta_G=1);
131 ex QuarkAVertex(const ex & e, const ex & eq, const ex & eta_e=-1);
132 ex LeptonAVertex(const ex & e, const ex & eq, const ex & eta_e=-1);
133
134 ex IndexL2R(ex e, bool all=true);
135 ex IndexCC(ex e, bool all=true);
136
137 ex GluonSumL(int qi, bool color=true);
138 ex QuarkSumL(int qi, ex p, ex m, bool color=true);
139 ex AntiQuarkSumL(int qi, ex p, ex m, bool color=true);
140 ex GhostSumL(int qi);
141 ex AntiGhostSumL(int qi);
142 ex J1SumL(int qi, ex p);
143
144 ex GluonSumR(int qi, bool color=true);
145 ex QuarkSumR(int qi, ex p, ex m, bool color=true);
146 ex AntiQuarkSumR(int qi, ex p, ex m, bool color=true);
147 ex GhostSumR(int qi);
148 ex AntiGhostSumR(int qi);
149 ex J1SumL(int qi, ex p);
150
151 inline ex GluonSum(int qi, bool color=true) { return GluonSumL(qi,color); };
152 inline ex QuarkSum(int qi, ex p, ex m, bool color=true) { return QuarkSumL(qi,p,m,color); };
153 inline ex AntiQuarkSum(int qi, ex p, ex m, bool color=true) { return AntiQuarkSumL(qi,p,m,color); };
154 inline ex GhostSum(int qi) { return GhostSumL(qi); };
155 inline ex AntiGhostSum(int qi) { return AntiGhostSumL(qi); };
156 inline ex J1Sum(int qi, ex p) { return J1SumL(qi,p); };
157
158 class Models {
159 public:
160 static string GluonFF;
161 static string QuarkFF;
162 static string SM;
163 static string QCD;
164
165 static ex FeynRulesSM(const ex & amp, const ex & xi=1);
166 static lst FeynRulesSM(const lst & amps, const ex & xi=1);
167 static ex FeynRulesQCD(const ex & amp, const ex & xi=1);
168 static lst FeynRulesQCD(const lst & amps, const ex & xi=1);
169 };
170
171}
172
HEP header file.
class for index object
Definition HEP.h:104
static string QuarkFF
Definition QGRAF.h:161
static ex FeynRulesQCD(const ex &amp, const ex &xi=1)
Definition QGRAF.cpp:1222
static string SM
Definition QGRAF.h:162
static string QCD
Definition QGRAF.h:163
static string GluonFF
Definition QGRAF.h:160
static ex FeynRulesSM(const ex &amp, const ex &xi=1)
Definition QGRAF.cpp:758
main interface to qgraf program
Definition QGRAF.h:75
static string Style
Definition QGRAF.h:77
vector< string > Others
Definition QGRAF.h:84
lst Amplitudes(symtab st)
generte the Amplitudes
Definition QGRAF.cpp:63
namespace for generating Feynman diagrams or amplitudes.
Definition QGRAF.cpp:8
ex AntiQuarkSumL(int qi, ex p, ex m, bool color)
polarization sum for anti-quark
Definition QGRAF.cpp:676
bool HasLoop(ex amp, lst prop)
check a amplitude has a loop w.r.t. propapagtor
Definition QGRAF.cpp:373
ex AntiGhostSumL(int qi)
polarization sum for anti-ghost, note that we will add extra - here
Definition QGRAF.cpp:717
ex IndexL2R(ex e, bool all)
Change Index from left to right, only affect li/di/ci/ti, external index start with dim/lim/cim/tim w...
Definition QGRAF.cpp:598
ex GluonPropagator(const ex &e, const ex &xi)
Propagator for gluon.
Definition QGRAF.cpp:436
ex LeptonAVertex(const ex &e, const ex &eq, const ex &eta_e)
l-lbar-A vertex
Definition QGRAF.cpp:585
ex Gluon3Vertex(const ex &e, const ex &eta_s)
g-g-g vertex
Definition QGRAF.cpp:517
ex GhostSumL(int qi)
polarization sum for ghost
Definition QGRAF.cpp:699
Index RDI(ex fn)
Definition QGRAF.cpp:51
ex AntiGhostSumR(int qi)
polarization sum for anti-ghost, note that we will add extra - here
Definition QGRAF.cpp:726
void DrawPDF(const lst &amps, string fn)
generate Feynman diagrams for the amplitudes, in PDF format
Definition QGRAF.cpp:165
ex QuarkGluonVertex(const ex &e, const ex &eta_s)
q-qbar-g vertex
Definition QGRAF.cpp:504
ex ScalarPropagator(const ex &e, const ex &m, const ex &xi)
Propagator for scalar.
Definition QGRAF.cpp:491
ex J1SumL(int qi, ex p)
polarization sum for total angular momentum
Definition QGRAF.cpp:736
map< ex, string, ex_is_less > LineTeX
Definition Init.cpp:183
Index RTI(ex fn)
Definition QGRAF.cpp:53
ex LeptonPropagator(const ex &e, const ex &m)
Propagator for lepton.
Definition QGRAF.cpp:423
vector< lst > ShrinkCut(ex amp, lst prop, int n)
cut the amplitude, and return the connected parts, may have many different cuts
Definition QGRAF.cpp:285
ex AntiQuarkSumR(int qi, ex p, ex m, bool color)
polarization sum for anti-quark
Definition QGRAF.cpp:689
Index RCI(ex fn)
Definition QGRAF.cpp:55
Index CI(ex fn)
Definition QGRAF.cpp:49
Index DI(ex fn)
Definition QGRAF.cpp:45
Index RLI(ex fn)
Definition QGRAF.cpp:52
ex AZWGhostPropagator(const ex &e, const ex &m, const ex &xi, const ex &eta_G)
Propagator for A/Z/W ghost.
Definition QGRAF.cpp:477
map< ex, string, ex_is_less > VerTeX
Definition Init.cpp:184
ex GhostSum(int qi)
Definition QGRAF.h:154
ex Gluon4Vertex(const ex &e, const ex &eta_s)
g-g-g-g vertex
Definition QGRAF.cpp:537
ex AntiQuarkSum(int qi, ex p, ex m, bool color=true)
Definition QGRAF.h:153
ex GluonSum(int qi, bool color=true)
Definition QGRAF.h:151
ex IndexCC(ex e, bool all)
Definition QGRAF.cpp:616
ex GhostGluonVertex(const ex &e, const ex &eta_s, const ex &eta_G)
ghbar-gh-g vertex
Definition QGRAF.cpp:556
Index RAI(ex fn)
Definition QGRAF.cpp:56
ex QuarkPropagator(const ex &e, const ex &m)
Propagator for quark.
Definition QGRAF.cpp:410
Index AI(ex fn)
Definition QGRAF.cpp:50
ex QuarkSumR(int qi, ex p, ex m, bool color)
polarization sum for quark
Definition QGRAF.cpp:663
ex AntiGhostSum(int qi)
Definition QGRAF.h:155
ex QuarkSumL(int qi, ex p, ex m, bool color)
polarization sum for quark
Definition QGRAF.cpp:650
ex J1Sum(int qi, ex p)
Definition QGRAF.h:156
ex GhostSumR(int qi)
polarization sum for ghost
Definition QGRAF.cpp:708
Index LI(ex fn)
Definition QGRAF.cpp:46
map< ex, string, ex_is_less > InOutTeX
Definition Init.cpp:185
ex AZWPropagator(const ex &e, const ex &m, const ex &xi)
Propagator for A/Z/W boson.
Definition QGRAF.cpp:463
ex QuarkAVertex(const ex &e, const ex &eq, const ex &eta_e)
qbar-q-A vertex
Definition QGRAF.cpp:571
Index TI(ex fn)
Definition QGRAF.cpp:47
ex GluonGhostPropagator(const ex &e, const ex &xi, const ex &eta_G)
Propagator for gluon ghost.
Definition QGRAF.cpp:449
Index FI(ex fn)
Definition QGRAF.cpp:48
Index RFI(ex fn)
Definition QGRAF.cpp:54
lst TopoLines(const ex &amp)
generate the topological lines for the amplitude
Definition QGRAF.cpp:120
ex QuarkSum(int qi, ex p, ex m, bool color=true)
Definition QGRAF.h:152
ex GluonSumR(int qi, bool color)
polarization sum for gluon
Definition QGRAF.cpp:637
ex GluonSumL(int qi, bool color)
polarization sum for gluon
Definition QGRAF.cpp:626
HepLib namespace.
Definition BASIC.cpp:17