herwig is hosted by Hepforge, IPPP Durham
Herwig 7.3.0
Col_functions.h
1// -*- C++ -*-
2/*
3 * Col_functions.h
4 * Contains declarations of the class Col_str and associated types and operators
5 * Author: Malin Sjodahl
6 */
7
8#ifndef COLORFULL_Col_functions_h
9#define COLORFULL_Col_functions_h
10
11
12#include "Col_amp.h"
13#include "Poly_matr.h"
14#include <list>
15#include <map>
16#include <memory>
17
18namespace ColorFull {
19
20using std::shared_ptr;
21
26
27private:
28
31double Nc;
32
37double TR;
38
41double CF;
42
54
55
56public:
57
60 : Nc(3.0), TR(0.5), CF(4.0/3.0), full_CF( false ) {}
61
64void set_Nc( double n) {
65 Nc = n;
66 CF = TR*(Nc*Nc-1.)/Nc;
67}
68
71void set_TR( double tr) {
72 CF *= tr/TR;
73 TR = tr;
74}
75
78void set_CF( double cf) {
79 CF = cf;
80}
81
83void set_full_CF( bool is_full ) { full_CF = is_full; }
84
86double get_Nc() const { return Nc; }
87
90double get_TR() const { return TR; }
91
93double get_CF() const { return CF; }
94
96bool get_full_CF() const { return full_CF; }
97
98
99/****************** Functions for leading terms *************************/
100// The functions called leading(...) depend on the variable full_CF.
101// As it would be messy to let each Polynomial carry around
102// its own full_CF, these functions are kept here.
103
106int leading_Nc_pow( const Polynomial & Poly ) const;
107
109int leading_Nc_pow( const Poly_vec & Pv ) const;
110
111/*
114int leading_Nc_pow( const std::vector< shared_ptr<Polynomial> > & Pvp) const;
115*/
116
120Polynomial leading( const Polynomial & Poly ) const;
121
129// Used only by Poly_matr version of leading
130Poly_vec leading( const Poly_vec & Pv ) const;
131
138// Used only once in Col_basis
139Poly_matr leading( const Poly_matr & Pm ) const;
140
141/*
144// Currently never used
145Poly_vec leading( const std::vector<shared_ptr<Polynomial> > & Pvp) const;
146
150// used only by scalar_product_matrix_mem in Col_functions
151dmatr leading( const std::vector< std::vector< shared_ptr<Polynomial> > > & Pm ) const;
152*/
153
154/********************* Functions for numerical evaluation *************************/
155// These functions has to be kept in Col_functions class as they need numerical
156// values for evaluation. Letting each Polynomial carry around its own Nc etc.
157// would be messy.
158
159
161cnum cnum_num( const Monomial & Mon ) const;
162
164cnum cnum_num( const Polynomial & Poly ) const;
165
168cvec cnum_num( const Poly_vec & Pv ) const;
169
172cmatr cnum_num( const Poly_matr & Pm ) const;
173
175double double_num( const Monomial & Mon ) const;
176
178double double_num( const Polynomial & Poly ) const;
179
182dvec double_num( const Poly_vec & Pv ) const;
183
186dmatr double_num( const Poly_matr & Pm ) const;
187
188/*
190dvec double_num( const std::vector<std::shared_ptr<Polynomial> > & Pv ) const;
191
193// (not used 14 06 08)
194dmatr double_num( const std::vector<std::vector<std::shared_ptr<Polynomial> > > & Pm ) const;
195
197// (not used 14 06 08)
198std::map< std::string, double > double_num( std::map< std::string, std::shared_ptr<Polynomial> > mem_map ) const;
199
201// (not used 14 06 08)
202std::map< std::string, double > double_num( std::map< std::string, Polynomial > mem_map ) const;
203*/
204
208
213
217
218
219/****************** Functions for scalar products *************************/
220
223Polynomial scalar_product( const Col_amp & Ca1, const Col_amp & Ca2 ) const;
224
227Polynomial scalar_product( const Col_str & Cs1, const Col_str & Cs2 ) const;
228
229
230/****************** Functions for gluon emission exchange, and splitting *************/
231
235Col_amp emit_gluon( const Col_str & in_Col_str, int emitter, int g_new ) const;
236
240Col_amp emit_gluon( const Col_amp & Ca_in, int emitter, int g_new ) const;
241
243Col_amp split_gluon( const Col_str & in_Col_str, int g_old, int q_new, int qbar_new ) const;
244
246Col_amp split_gluon( const Col_amp & in_Col_amp, int g_old, int q_new, int qbar_new ) const;
247
248
252Col_amp exchange_gluon( const Col_str & Cs, int p1, int p2 ) const;
253
258Col_amp exchange_gluon( const Col_amp & Ca, int p1, int p2 ) const;
259
267Polynomial color_correlator( const Col_amp Ca, int i, int j ) const;
268
269
270/********************* Other functions *************************/
271
272// As dvec and dmatr are not classes some read and write functions
273// are contained here.
274
279dvec read_in_dvec( std::string filename ) const;
280
287dmatr read_in_dmatr( std::string filename ) const;
288
291void write_out_dvec( const dvec & dv, std::string filename ) const;
292
295void write_out_dmatr( const dmatr & matr, std::string filename ) const;
296
298int factorial( int i ) const;
299
306std::map<int, int> default_parton_numbers( const Col_str &, int g_old, int q_new, int qbar_new ) const;
307
308
313Col_str rename_partons( const Col_str &, const std::map <int, int> replacements ) const;
314
315
320Col_amp rename_partons( const Col_amp &, const std::map <int, int> replacements ) const;
321
322
323}; // end class Col_functions
324
325
327
329std::list<int>::iterator operator+( std::list<int>::iterator x, int n );
330
331std::list<int>::iterator operator-( std::list<int>::iterator x, int n );
332
334std::list< Quark_line >::iterator operator+( std::list < Quark_line >::iterator x, int n );
335
336col_str::iterator operator-( col_str::iterator x, int n );
337
339std::ostream& operator<<( std::ostream& out, const std::vector<int> & vec );
340
342std::ostream& operator<<( std::ostream& out, const cvec & cv );
343
345std::ostream& operator<<( std::ostream& out, const dvec & dv );
346
348std::ostream& operator<<( std::ostream& out, const cmatr & cm );
349
351std::ostream& operator<<( std::ostream& out, const dmatr & matr );
352
354std::ostream& operator<<( std::ostream& out, std::pair<int, int> pair );
355} // end namespace ColorFull
356
357#endif /* COLORFULL_Col_functions_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
Library class containing functions for index contraction and numerical evaluation.
Definition: Col_functions.h:25
Polynomial color_correlator(const Col_amp Ca, int i, int j) const
Calculates < M | T_i T_j | M >, the "color correlator" relevant for coherent gluon emission of gluon ...
dvec double_num(const Poly_vec &Pv) const
Numerically evaluates a Poly_vec (vector of Polynomial) using the Nc, TR and CF data members.
cmatr cnum_num(const Poly_matr &Pm) const
Numerically evaluates a Poly_matr (vector of Poly_vec), using cnum_num( Poly_vec ) for each Poly_vec.
Col_amp rename_partons(const Col_amp &, const std::map< int, int > replacements) const
Function that renames the partons in a Col_amp using a map where, in each pair, the first number is t...
Polynomial leading(const Polynomial &Poly) const
Takes the leading Nc terms of a Polynonmial, i.e.
Col_amp split_gluon(const Col_str &in_Col_str, int g_old, int q_new, int qbar_new) const
Function for splitting the gluon g_old in a Col_str to a qqbar pair.
double double_num(const Monomial &Mon) const
Numerically evaluates a Monomial to a double using the Nc, TR and CF data members.
void set_TR(double tr)
Set the normalization of the generators.
Definition: Col_functions.h:71
int leading_Nc_pow(const Polynomial &Poly) const
Function for finding the leading power of Nc in a Poly_vec, i.e., the power of Nc plus the power of C...
void write_out_dmatr(const dmatr &matr, std::string filename) const
Writes out the double version of a (scalar product) matrix to the file filename.
double get_Nc() const
Returns the number of colors.
Definition: Col_functions.h:86
dmatr double_num(const Poly_matr &Pm) const
Numerically evaluates a Poly_matr (vector of Poly_vec), using the Nc, TR and CF data members.
void set_Nc(double n)
Set the number of colors.
Definition: Col_functions.h:64
Poly_matr Poly_matr_cnum_num(const Poly_matr &Pm) const
Numerically evaluates a Poly_matr (vector of Poly_vec) and stores in the form of a Poly_matr.
bool full_CF
While evaluating leading terms one may want to keep the full value of CF for TR(Nc^2-1)/Nc,...
Definition: Col_functions.h:53
int leading_Nc_pow(const Poly_vec &Pv) const
Function for finding the leading power of Nc in a Poly_vec.
Col_amp split_gluon(const Col_amp &in_Col_amp, int g_old, int q_new, int qbar_new) const
Function for splitting the gluon g_old in a Col_amp to a qqbar pair.
double double_num(const Polynomial &Poly) const
Numerically evaluates a Polynomial to a double using the Nc, TR and CF data members.
Col_functions()
Default constructor.
Definition: Col_functions.h:59
void set_CF(double cf)
Set the value of CF.
Definition: Col_functions.h:78
dvec read_in_dvec(std::string filename) const
Reads in a numerical vector and save it as a double vector, dvec.
double Nc
The number of colors, used in numerical results, changed by using set_Nc.
Definition: Col_functions.h:31
int factorial(int i) const
The factorial of an int, 0! is defined as 1.
Polynomial scalar_product(const Col_amp &Ca1, const Col_amp &Ca2) const
Function for calculating the scalar products between Col_amps.
void write_out_dvec(const dvec &dv, std::string filename) const
Function for writing out a numerical vector, to the file filename.
Col_str rename_partons(const Col_str &, const std::map< int, int > replacements) const
Function that renames the partons in a Col_str using a map where, in each pair, the first number is t...
Poly_vec leading(const Poly_vec &Pv) const
Take the leading part of a Poly_vec.
Polynomial Polynomial_cnum_num(const Polynomial &Poly) const
Numerically evaluates a Polynomial using the value of the data member Nc, and stores in the format of...
double get_CF() const
Returns the value of CF.
Definition: Col_functions.h:93
cnum cnum_num(const Monomial &Mon) const
Numerically evaluates a Monomial using the Nc, TR and CF data members.
cnum cnum_num(const Polynomial &Poly) const
Numerically evaluates a Polynomial, using the Nc, TR and CF data members.
Col_amp emit_gluon(const Col_amp &Ca_in, int emitter, int g_new) const
Function for emitting a gluon from a Col_amp.
dmatr read_in_dmatr(std::string filename) const
Reads in a numerical matrix and save it as a double matrix, dmatr.
Col_amp exchange_gluon(const Col_amp &Ca, int p1, int p2) const
Function for exchanging a gluon between two partons p1 and p2 in the Col_amp Ca.
bool get_full_CF() const
Returns true, if full CF is used.
Definition: Col_functions.h:96
cvec cnum_num(const Poly_vec &Pv) const
Numerically evaluates a Poly_vec (vector of Polynomial), using cnum_num (Polynomial).
Poly_vec Poly_vec_cnum_num(const Poly_vec &Pv) const
Numerically evaluates a Poly_vec (vector of Polynomial) and stores in the form of a Poly_vec,...
double TR
The trace convention Tr( t^a t^a )=TR (no sum).
Definition: Col_functions.h:37
double CF
The value of CF=TR*Nc-TR/Nc, changed by using set_CF.
Definition: Col_functions.h:41
void set_full_CF(bool is_full)
Switch on/off full_CF.
Definition: Col_functions.h:83
Col_amp exchange_gluon(const Col_str &Cs, int p1, int p2) const
Function for exchanging a gluon between the partons p1 and p2 in the Col_str Cs.
std::map< int, int > default_parton_numbers(const Col_str &, int g_old, int q_new, int qbar_new) const
Function that finds the default parton numbers for a Col_str.
double get_TR() const
Returns the normalization of the generators, tr(t^a t^b)=TR*delta^{a,b}.
Definition: Col_functions.h:90
Polynomial scalar_product(const Col_str &Cs1, const Col_str &Cs2) const
Function for calculating the scalar product between two Col_strs.
Poly_matr leading(const Poly_matr &Pm) const
Takes the leading part of a matrix of Polynomials, keeping only those with maximal power of CF plus N...
Col_amp emit_gluon(const Col_str &in_Col_str, int emitter, int g_new) const
Function for emitting a gluon from a Col_str.
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
Class for containing a Polynomial matrix, and functions for Polynomial matrices.
Definition: Poly_matr.h:26
Class for containing vector of Polynomials, and functions for Polynomial vectors.
Definition: Poly_vec.h:25
For containing a Polynomial (in Nc, CF and TR), as a sum of Monomials.
Definition: Polynomial.h:30
XSecStat operator+(const XSecStat &x1, const XSecStat &x2)
ostream & operator<<(ostream &, const Collision &)