colorfull is hosted by Hepforge, IPPP Durham
ColorFull  1.1
/data/Documents/eclipse/workspace/ColorFull/Col_functions.h
Go to the documentation of this file.
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 
18 namespace ColorFull {
19 
20 using std::shared_ptr;
21 
26 
27 private:
28 
31 double Nc;
32 
37 double TR;
38 
41 double CF;
42 
53 bool full_CF;
54 
55 
56 public:
57 
60  : Nc(3.0), TR(0.5), CF(4.0/3.0), full_CF( false ) {}
61 
64 void set_Nc( double n) {
65  Nc = n;
66  CF = TR*(Nc*Nc-1.)/Nc;
67 }
68 
71 void set_TR( double tr) {
72  CF *= tr/TR;
73  TR = tr;
74 }
75 
78 void set_CF( double cf) {
79  CF = cf;
80 }
81 
83 void set_full_CF( bool is_full ) { full_CF = is_full; }
84 
86 double get_Nc() const { return Nc; }
87 
90 double get_TR() const { return TR; }
91 
93 double get_CF() const { return CF; }
94 
96 bool 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 
106 int leading_Nc_pow( const Polynomial & Poly ) const;
107 
109 int leading_Nc_pow( const Poly_vec & Pv ) const;
110 
111 /*
114 int leading_Nc_pow( const std::vector< shared_ptr<Polynomial> > & Pvp) const;
115 */
116 
120 Polynomial leading( const Polynomial & Poly ) const;
121 
129 // Used only by Poly_matr version of leading
130 Poly_vec leading( const Poly_vec & Pv ) const;
131 
138 // Used only once in Col_basis
139 Poly_matr leading( const Poly_matr & Pm ) const;
140 
141 /*
144 // Currently never used
145 Poly_vec leading( const std::vector<shared_ptr<Polynomial> > & Pvp) const;
146 
150 // used only by scalar_product_matrix_mem in Col_functions
151 dmatr 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 
161 cnum cnum_num( const Monomial & Mon ) const;
162 
164 cnum cnum_num( const Polynomial & Poly ) const;
165 
168 cvec cnum_num( const Poly_vec & Pv ) const;
169 
172 cmatr cnum_num( const Poly_matr & Pm ) const;
173 
175 double double_num( const Monomial & Mon ) const;
176 
178 double double_num( const Polynomial & Poly ) const;
179 
182 dvec double_num( const Poly_vec & Pv ) const;
183 
186 dmatr double_num( const Poly_matr & Pm ) const;
187 
188 /*
190 dvec double_num( const std::vector<std::shared_ptr<Polynomial> > & Pv ) const;
191 
193 // (not used 14 06 08)
194 dmatr double_num( const std::vector<std::vector<std::shared_ptr<Polynomial> > > & Pm ) const;
195 
197 // (not used 14 06 08)
198 std::map< std::string, double > double_num( std::map< std::string, std::shared_ptr<Polynomial> > mem_map ) const;
199 
201 // (not used 14 06 08)
202 std::map< std::string, double > double_num( std::map< std::string, Polynomial > mem_map ) const;
203 */
204 
207 Polynomial Polynomial_cnum_num( const Polynomial & Poly ) const;
208 
212 Poly_vec Poly_vec_cnum_num( const Poly_vec & Pv ) const;
213 
216 Poly_matr Poly_matr_cnum_num( const Poly_matr & Pm ) const;
217 
218 
219 /****************** Functions for scalar products *************************/
220 
223 Polynomial scalar_product( const Col_amp & Ca1, const Col_amp & Ca2 ) const;
224 
227 Polynomial scalar_product( const Col_str & Cs1, const Col_str & Cs2 ) const;
228 
229 
230 /****************** Functions for gluon emission exchange, and splitting *************/
231 
235 Col_amp emit_gluon( const Col_str & in_Col_str, int emitter, int g_new ) const;
236 
240 Col_amp emit_gluon( const Col_amp & Ca_in, int emitter, int g_new ) const;
241 
243 Col_amp split_gluon( const Col_str & in_Col_str, int g_old, int q_new, int qbar_new ) const;
244 
246 Col_amp split_gluon( const Col_amp & in_Col_amp, int g_old, int q_new, int qbar_new ) const;
247 
248 
252 Col_amp exchange_gluon( const Col_str & Cs, int p1, int p2 ) const;
253 
258 Col_amp exchange_gluon( const Col_amp & Ca, int p1, int p2 ) const;
259 
267 Polynomial 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 
279 dvec read_in_dvec( std::string filename ) const;
280 
287 dmatr read_in_dmatr( std::string filename ) const;
288 
291 void write_out_dvec( const dvec & dv, std::string filename ) const;
292 
295 void write_out_dmatr( const dmatr & matr, std::string filename ) const;
296 
298 int factorial( int i ) const;
299 
306 std::map<int, int> default_parton_numbers( const Col_str &, int g_old, int q_new, int qbar_new ) const;
307 
308 
313 Col_str rename_partons( const Col_str &, const std::map <int, int> replacements ) const;
314 
315 
320 Col_amp rename_partons( const Col_amp &, const std::map <int, int> replacements ) const;
321 
322 
323 }; // end class Col_functions
324 
325 
327 
329 std::list<int>::iterator operator+( std::list<int>::iterator x, int n );
330 
331 std::list<int>::iterator operator-( std::list<int>::iterator x, int n );
332 
334 std::list< Quark_line >::iterator operator+( std::list < Quark_line >::iterator x, int n );
335 
336 col_str::iterator operator-( col_str::iterator x, int n );
337 
339 std::ostream& operator<<( std::ostream& out, const std::vector<int> & vec );
340 
342 std::ostream& operator<<( std::ostream& out, const cvec & cv );
343 
345 std::ostream& operator<<( std::ostream& out, const dvec & dv );
346 
348 std::ostream& operator<<( std::ostream& out, const cmatr & cm );
349 
351 std::ostream& operator<<( std::ostream& out, const dmatr & matr );
352 
354 std::ostream& operator<<( std::ostream& out, std::pair<int, int> pair );
355 } // end namespace ColorFull
356 
357 #endif /* COLORFULL_Col_functions_h */
void set_TR(double tr)
Definition: Col_functions.h:71
dvec read_in_dvec(std::string filename) const
Definition: Col_amp.h:24
std::vector< cnum > cvec
A vector of complex numbers.
Definition: types.h:23
Col_functions()
Default constructor.
Definition: Col_functions.h:59
int factorial(int i) const
The factorial of an int, 0! is defined as 1.
Poly_vec Poly_vec_cnum_num(const Poly_vec &Pv) const
Definition: Poly_vec.h:25
void write_out_dmatr(const dmatr &matr, std::string filename) const
Polynomial scalar_product(const Col_amp &Ca1, const Col_amp &Ca2) const
Polynomial Polynomial_cnum_num(const Polynomial &Poly) const
Col_amp emit_gluon(const Col_str &in_Col_str, int emitter, int g_new) const
Polynomial leading(const Polynomial &Poly) const
double get_TR() const
Definition: Col_functions.h:90
Col_str rename_partons(const Col_str &, const std::map< int, int > replacements) const
Definition: Col_amp.h:15
Definition: Polynomial.h:30
bool get_full_CF() const
Returns true, if full CF is used.
Definition: Col_functions.h:96
std::vector< std::vector< double > > dmatr
A matrix of double numbers.
Definition: types.h:32
std::ostream & operator<<(std::ostream &out, const col_amp &ca)
Define the operator << for col_amp.
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.
Definition: Col_functions.h:25
Col_amp operator+(const Col_amp &Ca, const Col_str &Cs)
Define the operator + for Col_amp and Col_str, adds Col_str Cs to ca.
Polynomial color_correlator(const Col_amp Ca, int i, int j) const
std::complex< double > cnum
A complex number, needed as amplitudes in general are complex.
Definition: types.h:20
Definition: Monomial.h:23
std::map< int, int > default_parton_numbers(const Col_str &, int g_old, int q_new, int qbar_new) const
void set_full_CF(bool is_full)
Switch on/off full_CF.
Definition: Col_functions.h:83
std::vector< double > dvec
A vector of double numbers.
Definition: types.h:29
void set_Nc(double n)
Definition: Col_functions.h:64
void set_CF(double cf)
Definition: Col_functions.h:78
Poly_matr Poly_matr_cnum_num(const Poly_matr &Pm) const
Col_amp exchange_gluon(const Col_str &Cs, int p1, int p2) const
std::vector< std::vector< cnum > > cmatr
A matrix of complex numbers.
Definition: types.h:26
Definition: Poly_matr.h:26
int leading_Nc_pow(const Polynomial &Poly) const
cnum cnum_num(const Monomial &Mon) const
Numerically evaluates a Monomial using the Nc, TR and CF data members.
double get_Nc() const
Returns the number of colors.
Definition: Col_functions.h:86
Definition: Col_str.h:26
double double_num(const Monomial &Mon) const
Numerically evaluates a Monomial to a double using the Nc, TR and CF data members.
double get_CF() const
Returns the value of CF.
Definition: Col_functions.h:93
void write_out_dvec(const dvec &dv, std::string filename) const
dmatr read_in_dmatr(std::string filename) const
Col_amp operator-(const Col_amp &Ca1, const Col_amp &Ca2)