herwig is hosted by Hepforge, IPPP Durham
Herwig 7.3.0
Col_amp.h
1// -*- C++ -*-
2
3/*
4 * Col_amp.h
5 * Contains the declarations of the class Col_amp, related types and operators
6 * Created on: Jul 7, 2010
7 * Author: Malin Sjodahl
8 */
9
10#ifndef COLORFULL_Col_amp_h
11#define COLORFULL_Col_amp_h
12
13#include "Col_str.h"
14
15namespace ColorFull {
16
19typedef std::vector<Col_str> col_amp;
20
21
24class Col_amp {
25
26public:
27
30
38 Col_amp( const std::string str ){Col_amp_of_str( str );}
39
42 Scalar = Scalar * 0;
43 ca.push_back(Cs);
44 }
45
48 col_amp ca;
49
55
59 void read_in_Col_amp( std::string filename );
60
63 void write_out_Col_amp( std::string filename ) const;
64
66 const Col_str & at( int i ) const{ return ca.at(i); }
67
69 Col_str & at( int i ) {return ca.at(i);}
70
72 uint size() const {return ca.size();}
73
75 bool empty() const { return ca.empty(); }
76
78 void clear() { ca.clear(); }
79
81 void erase( int i );
82
84 void append( Col_str Cs ) {ca.push_back( Cs );}
85
87 void append( col_amp ca_in );
88
89
90 // Functions for probing the Col_amp
91
93 bool gluons_only() const;
94
98 int n_gluon() const;
99
103 int n_quark() const;
104
107 int n_quark_check() const;
108
111 int n_gluon_check() const;
112
115
116 // Functions for manipulating the Col_amp
117
120
123
128
132
135
140
146 void simplify();
147
151 void conjugate();
152
156
163
167
171
175
178 void contract_quarks( const Col_amp & Ca1, const Col_amp & Ca2 );
179
180private:
181
182
187
194
203
209
216 void Col_amp_of_str( const std::string str );
217
218};
219
220// Define operators involving Col_amp
221
223std::ostream& operator<<( std::ostream& out, const col_amp & ca );
224
226std::ostream& operator<<( std::ostream& out, const Col_amp & Ca );
227
229bool operator==( const Col_amp & Ca1, const Col_amp & Ca2 );
230
232bool operator!=( const Col_amp & Ca1, const Col_amp & Ca2 );
233
235Col_amp operator+( const Col_amp & Ca, const Col_str & Cs );
236
238Col_amp operator+( const Col_str & Cs, const Col_amp & Ca );
239
242Col_amp operator+( const Col_amp & Ca1, const Col_amp & Ca2 );
243
245Col_amp operator+=( Col_amp & Ca, const Col_str & Cs );
246
248Col_amp operator+=( Col_amp & Ca1, const Col_amp & Ca2 );
249
252Col_amp operator-( const Col_amp & Ca1, const Col_amp & Ca2 );
253
255Col_amp operator-( const Col_amp & Ca, const Col_str & Cs );
256
258Col_amp operator-( const Col_amp & Ca, const Col_str & Cs );
259
261Col_amp operator*( const Col_amp & Ca, const int i );
262
264Col_amp operator*( const int i, const Col_amp & Ca );
265
267Col_amp operator*( const Col_amp & Ca, const cnum c );
268
270Col_amp operator*( const cnum c, const Col_amp & Ca );
271
273Col_amp operator*( const Col_amp & Ca, const double d );
274
276Col_amp operator*( const double d, const Col_amp & Ca );
277
279Col_amp operator*( const Col_amp & Ca, const Monomial & Mon );
280
282Col_amp operator*( const Monomial & Mon, const Col_amp & Ca );
283
285Col_amp operator*( const Col_amp & Ca, const Polynomial & Poly );
286
288Col_amp operator*( const Polynomial & Poly, const Col_amp & Ca );
289
291Col_amp operator*( const Col_amp & Ca, const Quark_line & Ql );
292
294Col_amp operator*( const Quark_line & Ql, const Col_amp & Ca );
295
297Col_amp operator*( const Col_amp & Ca, const Col_str & Cs );
298
300Col_amp operator*( const Col_str & Cs, const Col_amp & Ca );
301
303Col_amp operator*( const Col_amp & Ca1, const Col_amp & Ca2 );
304
306Col_amp operator*=( Col_amp & Ca1, const Col_amp & Ca2 );
307
308}// end namespace ColorFull
309
310#endif /* COLORFULL_Col_amp_h */
The full color amplitude is Scalar + Cs1+Cs2+Cs3... Col_amp is a class to contain info on several Col...
Definition: Col_amp.h:24
Col_amp(const std::string str)
Constructor taking a string as argument.
Definition: Col_amp.h:38
void contract_a_gluon(Col_str &Cs)
Contracts one gluon, the first gluon in first Quark_line, only intended for closed Quark_lines.
bool gluons_only() const
Checks if the Col_amp only contains gluons, i.e., if all Quark_lines are closed.
void contract_Quark_line_gluons(Quark_line &Ql)
Function for contracting gluon indices within the same Quark_line.
void Col_amp_of_str(const std::string str)
Converts a text string to a Col_amp, used by string constructor, and by read_in_Col_amp.
int n_quark_check() const
Returns the number of quarks in the Col_amp after checking that each Col_str has the same number of q...
void contract_quarks(const Col_amp &Ca1, const Col_amp &Ca2)
Function for contracting the (anti-)quarks in Ca1 with those in Ca2.
void contract_all_gluons()
Function for contracting all gluon indices in a Col_amp, only intended for closed Quark_lines.
const Col_str & at(int i) const
Returns the Col_str at place i.
Definition: Col_amp.h:66
void contract_all_gluons(Col_str &Cs)
Function for contracting all gluon indices in a Col_str, assumes quarks already contracted and is onl...
void erase(int i)
Erases the Col_str at place i.
int n_gluon() const
Returns the number of gluons in the Col_amp as the number of gluons in the first Col_str.
Col_amp()
Default constructor, sets Scalar=0, and leaves ca empty.
Definition: Col_amp.h:29
uint size() const
The size of the col_amp ca.
Definition: Col_amp.h:72
void normal_order()
Normal orders the individual col_strs and then orders the Col_strs using the order defined in the Col...
void contract_next_neighboring_gluons()
Contracts up to next to neighboring gluons in each Quark_line in each Col_str in each Col_amp,...
void conjugate()
Function for taking the conjugate of the Col_amp by conjugating each Col_str in ca and the Polynomial...
void read_in_Col_amp(std::string filename)
Reads in the Col_amp to the member ca from the file filename.
void clear()
Erases the information in the col_amp.
Definition: Col_amp.h:78
void write_out_Col_amp(std::string filename) const
Function for writing out the Col_amp to a file with name filename.
bool empty() const
Is the col_amp empty?
Definition: Col_amp.h:75
int n_quark() const
Returns the number of quarks in the Col_amp as the number of quarks in the first Col_str.
int longest_quark_line() const
Returns the length of the longest Quark_line in any Col_str.
void contract_Quark_line_gluons()
Function for contracting gluon indices within the Quark_lines.
Polynomial Scalar
Scalar is Polynomial for collecting color factors appearing when the color structure has been fully c...
Definition: Col_amp.h:54
void remove_empty_Col_strs()
Removes empty Col_strs, an empty Col_str means that all indices have been contracted,...
Col_str & at(int i)
Returns the Col_str at place i.
Definition: Col_amp.h:69
Col_amp(Col_str Cs)
Constructor converting a Col_str to a Col_amp.
Definition: Col_amp.h:41
void append(col_amp ca_in)
Appends the Col_strs in ca_in to the col_amp member ca.
void remove_1_rings()
Remove Col_strs with quark_lines with just 1 gluon, they are 0 as Tr[t^a]=0.
void contract_2_rings()
Contract closed Quark_lines with only 2 gluons in each Quark_line in each Col_str in the Col_amp.
void normal_order_col_strs()
Normal orders all col_strs in ca.
col_amp ca
To actually contain the information about the Col_strs, ca=Cs1+Cs2+Cs3+... .
Definition: Col_amp.h:48
void append(Col_str Cs)
Appends a Col_str to the data member ca.
Definition: Col_amp.h:84
void remove_0_rings()
Remove quark_lines with no gluons, they are Nc if closed, and defined to be 1 if open.
void collect_col_strs()
Compares col_strs in a Col_amp to collect similar col_strs and only store once in ca.
void simplify()
Function for simplifying an amplitude, removes 0 and 1-rings, compares col_strs, removes Col_strs mul...
void contract_a_gluon()
Contracts one gluon, the first gluon in first Quark_line (in each Col_str), only intended for closed ...
int n_gluon_check() const
Returns the number of gluons in the Col_amp after checking that each Col_str has the same number of g...
void contract_Quark_line_gluons(Col_str &Cs)
Function for contracting gluon indices within the same Quark_line.
A class to contain ONE color structure, a direct product of Quark_lines, multiplying a Polynomial,...
Definition: Col_str.h:26
A class to contain the factor of form TR^a*Nc^b*CF^c*int_part*cnum_part, where the powers a,...
Definition: Monomial.h:23
For containing a Polynomial (in Nc, CF and TR), as a sum of Monomials.
Definition: Polynomial.h:30
A class to contain one quark-line with gluons attached multiplying a Polynomial, Poly.
Definition: Quark_line.h:31
bool operator==(const LorentzVector< Value > &a, const LorentzVector< Value > &b)
XSecStat operator+(const XSecStat &x1, const XSecStat &x2)
string operator*(double, string)
ostream & operator<<(ostream &, const Collision &)