colorfull is hosted by Hepforge, IPPP Durham
ColorFull  1.1
/data/Documents/eclipse/workspace/ColorFull/Quark_line.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 /*
3  * Quark_line.h
4  * Contains declaration of the class Quark_line and associated types and operators.
5  * Created on: Jul 7, 2010
6  * Author: Malin Sjodahl
7  */
8 
9 #ifndef COLORFULL_Quark_line_h
10 #define COLORFULL_Quark_line_h
11 
12 #include "Polynomial.h"
13 
14 
15 namespace ColorFull {
16 
17 
21 typedef std::vector <int> quark_line;
22 
31 class Quark_line {
32 
33 public:
34 
45  Quark_line( const std::string str );
46 
48  Quark_line();
49 
52  quark_line ql;
53 
56 
58  bool open;
59 
62  void read_in_Quark_line( std::string filename );
63 
66  void write_out_Quark_line( std::string filename ) const;
67 
70  int at( int j ) const;
71 
73  uint size() const{ return ql.size();}
74 
76  void clear() { ql.clear(); }
77 
79  bool empty() const { return ql.empty(); }
80 
84  void normal_order();
85 
87  void erase( int i );
88 
91  void conjugate();
92 
94  void append( int p ) { ql.push_back( p ); }
95 
97  void append( const std::vector<int> & in_ql );
98 
100  void prepend( int p );
101 
103  void prepend( std::vector<int> in_ql );
104 
106  void insert( int j, int p );
107 
110  Quark_line before( int j ) const;
111 
114  Quark_line after( int j ) const;
115 
119  std::pair<Quark_line, Quark_line> split_Quark_line( int j1, int j2 ) const;
120 
130  int smallest( const Quark_line & Ql1 , const Quark_line & Ql2 ) const;
131 
134  void contract_neighboring_gluons( int j );
135 
139 
143  void contract_next_neighboring_gluons( int j );
144 
148 
149 
150 private:
151 
160  void Quark_line_of_str( const std::string str );
161 
165  void quark_line_of_str( std::string str );
166 
167 };
168 
171 Quark_line operator*( const Quark_line & Ql, const int i );
172 
175 Quark_line operator*( const int i, const Quark_line & Ql );
176 
179 Quark_line operator*( const Quark_line & Ql, const cnum c );
180 
183 Quark_line operator*( const cnum c, const Quark_line & Ql );
184 
187 
188 Quark_line operator*( const Quark_line & Ql, const double d );
190 
192 Quark_line operator*( const double d, const Quark_line & Ql );
193 
196 Quark_line operator*( const Quark_line & Ql, const Monomial & Mon );
197 
200 Quark_line operator*( const Monomial & Mon, const Quark_line & Ql );
201 
204 Quark_line operator*( const Quark_line & Ql, const Polynomial & Poly );
205 
208 Quark_line operator*( const Polynomial & Poly, const Quark_line & Ql );
209 
213 bool operator==( const Quark_line & Ql1, const Quark_line & Ql2 );
214 
216 bool operator!=( const Quark_line & Ql1, const Quark_line & Ql2 );
217 
218 
220 std::ostream& operator<<( std::ostream& out, const Quark_line & Ql );
221 
222 
223 }// end namespace ColorFull
224 
225 #endif /* COLORFULL_Quark_line_h */
unsigned int uint
An unsigned int.
Definition: types.h:35
void insert(int j, int p)
Inserting parton p at place j.
void clear()
Erase information in quark_line ql.
Definition: Quark_line.h:76
std::pair< Quark_line, Quark_line > split_Quark_line(int j1, int j2) const
uint size() const
The size of the quark_line.
Definition: Quark_line.h:73
Quark_line before(int j) const
void erase(int i)
To erase the parton at place i.
void write_out_Quark_line(std::string filename) const
void contract_neighboring_gluons()
void contract_next_neighboring_gluons()
Definition: Quark_line.h:31
void prepend(int p)
Prepends parton p to the Quark_line.
quark_line ql
Definition: Quark_line.h:52
Col_amp operator*(const Col_amp &Ca, const int i)
Define the operator * for Col_amps and integers.
bool operator==(const Col_amp &Ca1, const Col_amp &Ca2)
Define the operator == for two Col_amps.
Polynomial Poly
Polynomial factor, multiplying the quark_line.
Definition: Quark_line.h:55
Definition: Col_amp.h:15
Definition: Polynomial.h:30
bool open
Is the string open, with a q in the beginning and a qbar in the end, or not?
Definition: Quark_line.h:58
std::ostream & operator<<(std::ostream &out, const col_amp &ca)
Define the operator << for col_amp.
int at(int j) const
void read_in_Quark_line(std::string filename)
std::complex< double > cnum
A complex number, needed as amplitudes in general are complex.
Definition: types.h:20
Definition: Monomial.h:23
std::vector< int > quark_line
Definition: Quark_line.h:21
void append(int p)
Appends parton p to the Quark_line.
Definition: Quark_line.h:94
bool operator!=(const Col_amp &Ca1, const Col_amp &Ca2)
Define the operator != for two Col_amps.
int smallest(const Quark_line &Ql1, const Quark_line &Ql2) const
Quark_line()
Default constructor.
Quark_line after(int j) const
bool empty() const
Is the quark_line empty?
Definition: Quark_line.h:79