colorfull is hosted by Hepforge, IPPP Durham
ColorFull  1.1

#include <Col_basis.h>

Inheritance diagram for ColorFull::Col_basis:
ColorFull::Orthogonal_basis ColorFull::Trace_type_basis ColorFull::Trace_basis ColorFull::Tree_level_gluon_basis

Public Member Functions

 Col_basis ()
 
virtual ~Col_basis ()
 
bool is_Trace_basis () const
 
bool is_Orthogonal_basis () const
 
bool is_Tree_level_gluon_basis () const
 
uint size () const
 
const Col_ampat (const int i) const
 
Col_ampat (const int i)
 
bool empty () const
 
void clear ()
 
void append (Col_amp Ca)
 
void append (col_basis cb_in)
 
void scalar_product_matrix ()
 
void scalar_product_matrix_num ()
 
virtual void scalar_product_matrix_no_mem ()
 
void scalar_product_matrix_num_no_mem ()
 
void leading_scalar_product_matrix ()
 
virtual Polynomial scalar_product (const Col_amp &Ca1, const Col_amp &Ca2)
 
virtual cnum scalar_product_num (const Col_amp &Ca1, const Col_amp &Ca2)
 
virtual cnum scalar_product_num (const cvec &v1, const cvec &v2)
 
cnum scalar_product_num_diagonal (const cvec &v1, const cvec &v2)
 
std::string basis_file_name () const
 
std::string spm_file_name (const bool leading, const bool poly) const
 
virtual void read_in_Col_basis (std::string filename)
 
virtual void read_in_Col_basis ()
 
void read_in_d_spm (std::string filename)
 
void read_in_d_spm ()
 
void read_in_leading_d_spm (std::string filename)
 
void read_in_leading_d_spm ()
 
void read_in_P_spm (std::string filename)
 
void read_in_P_spm ()
 
void read_in_leading_P_spm (std::string filename)
 
void read_in_leading_P_spm ()
 
virtual void write_out_Col_basis (std::string filename) const
 
virtual void write_out_Col_basis () const
 
void write_out_d_spm (std::string filename) const
 
void write_out_d_spm () const
 
void write_out_P_spm (std::string filename) const
 
void write_out_P_spm () const
 
void write_out_leading_d_spm (std::string filename) const
 
void write_out_leading_d_spm () const
 
void write_out_leading_P_spm (std::string filename) const
 
void write_out_leading_P_spm () const
 
void simplify ()
 
virtual Poly_vec decompose (const Col_amp &Ca)
 
Col_amp exchange_gluon (uint vec, int p1, int p2)
 
Poly_matr color_gamma (int p1, int p2)
 
int n_quark_check () const
 
int n_gluon_check () const
 
void rename_indices (Col_str &Cs1, Col_str &Cs2) const
 

Public Attributes

int nq
 
int ng
 
col_basis cb
 
Poly_matr P_spm
 
Poly_matr leading_P_spm
 
dmatr d_spm
 
dmatr leading_d_spm
 
Col_functions Col_fun
 

Protected Member Functions

virtual void scalar_product_matrix (bool save_P_spm, bool save_d_spm, bool use_mem)
 
virtual Polynomial ij_entry (const int i, const int j) const
 
bool check_diagonal (const dmatr &matr) const
 
bool check_symmetry (const dmatr &matr) const
 
void check_spm () const
 
void Col_basis_of_str (std::string str)
 
virtual std::ostream & write_out_Col_basis_to_stream (std::ostream &out) const
 

Protected Attributes

bool trace_basis
 
bool tree_level_gluon_basis
 
bool orthogonal_basis
 

Friends

std::ostream & operator<< (std::ostream &out, const Col_basis &Cb)
 

Detailed Description

To contain a color basis, where each basis vector is a Col_amp. Technically the color information is contained in the member cb, which is a vector of Col_amps, a col_basis.

Constructor & Destructor Documentation

◆ Col_basis()

ColorFull::Col_basis::Col_basis ( )
inline

Default constructor.

◆ ~Col_basis()

virtual ColorFull::Col_basis::~Col_basis ( )
inlinevirtual

Destructor.

Member Function Documentation

◆ append() [1/2]

void ColorFull::Col_basis::append ( Col_amp  Ca)
inline

Appends a Col_amp to the basis, stored in cb.

◆ append() [2/2]

void ColorFull::Col_basis::append ( col_basis  cb_in)

Appends the Col_amps in cb_in to the col_basis member cb.

◆ at() [1/2]

const Col_amp& ColorFull::Col_basis::at ( const int  i) const
inline

Returns the Col_amp (basis vector) at place i.

◆ at() [2/2]

Col_amp& ColorFull::Col_basis::at ( const int  i)
inline

Returns the Col_amp (basis vector) at place i.

◆ basis_file_name()

std::string ColorFull::Col_basis::basis_file_name ( ) const

Returns a standard filename, used for writing out the basis to a file.

◆ check_diagonal()

bool ColorFull::Col_basis::check_diagonal ( const dmatr matr) const
protected

Checking that a numerical (double) matrix is diagonal. Used for the leading version of the scalar product matrix. Returns true if the matrix is diagonal and false otherwise.

◆ check_spm()

void ColorFull::Col_basis::check_spm ( ) const
protected

Makes consistency checks on the scalar product matrix.

◆ check_symmetry()

bool ColorFull::Col_basis::check_symmetry ( const dmatr matr) const
protected

Checking that a numerical (double) matrix (the scalar product matrix) is symmetric. Returns true if the matrix is symmetric and false otherwise.

◆ clear()

void ColorFull::Col_basis::clear ( )
inline

Erase the basis, stored in cb.

◆ Col_basis_of_str()

void ColorFull::Col_basis::Col_basis_of_str ( std::string  str)
protected

Converts a text string (in a file) to a basis, used by the read_in_basis functions.

◆ color_gamma()

Poly_matr ColorFull::Col_basis::color_gamma ( int  p1,
int  p2 
)

Function for calculating the color structure part of the soft anomalous dimension matrix. First calculates the effect of gluon exchange on a basis vector and then decomposes the result into the basis. For this to work the basis must clearly contain all resulting basis vectors, meaning for example that it can not be used for Tree_level_gluon_basis. The function is only available for the Trace_basis and the Orthogonal_basis classes. The ij-component of the resulting matrix gives the amplitude for ending up in component i if starting in component j.

◆ decompose()

virtual Poly_vec ColorFull::Col_basis::decompose ( const Col_amp Ca)
virtual

Each type of color basis has to implement a function for decomposing an amplitude in the color basis.

Reimplemented in ColorFull::Orthogonal_basis, and ColorFull::Trace_type_basis.

◆ empty()

bool ColorFull::Col_basis::empty ( ) const
inline

Is the col_basis empty?

◆ exchange_gluon()

Col_amp ColorFull::Col_basis::exchange_gluon ( uint  vec,
int  p1,
int  p2 
)

Function for finding the resulting Col_amp after exchanging a gluon between parton p1 and parton p2 in the basis vector vec.

◆ ij_entry()

virtual Polynomial ColorFull::Col_basis::ij_entry ( const int  i,
const int  j 
) const
protectedvirtual

Calculates element i,j in scalar product matrix using the scalar product.

◆ is_Orthogonal_basis()

bool ColorFull::Col_basis::is_Orthogonal_basis ( ) const
inline

Is it an Orthogonal_basis?

◆ is_Trace_basis()

bool ColorFull::Col_basis::is_Trace_basis ( ) const
inline

Is it a Trace_basis?

◆ is_Tree_level_gluon_basis()

bool ColorFull::Col_basis::is_Tree_level_gluon_basis ( ) const
inline

◆ leading_scalar_product_matrix()

void ColorFull::Col_basis::leading_scalar_product_matrix ( )

Finds the leading Nc scalar product matrices, leading_P_spm and leading_d_spm. If the polynomial scalar product matrix, P_spm has been calculated, P_spm is used, otherwise P_spm is first calculated and the leading Nc limit is then taken of P_spm.

◆ n_gluon_check()

int ColorFull::Col_basis::n_gluon_check ( ) const

Returns the number of gluons in the Col_basis after checking that each Col_str in each Col_amp has the same number of gluons.

◆ n_quark_check()

int ColorFull::Col_basis::n_quark_check ( ) const

Returns the number of quarks in the Col_basis after checking that each Col_str in each Col_amp has the same number of quarks.

◆ read_in_Col_basis() [1/2]

virtual void ColorFull::Col_basis::read_in_Col_basis ( std::string  filename)
virtual

Function for reading in the basis from the file filename. The basis should be in human readable format, of form:
0 [{1,3,4,2}]
1 [{1,4,3,2}]
2 [{1,2}(3,4)]
i.e. first basis vector number 0,1,2..., then the Col_amp corresponding to the basis vector in question. The Col_amps may consist of several Col_strs, for example
0 [(1,2,3,4)]+[(1,4,3,2)]
1 [(1,2,4,3)]+[(1,3,4,2)]
2 [(1,3,4,2)]+[(1,2,4,3)]
and each Col_str may also contain a Polynomial. (The Polynomial should multiply the whole col_str, rather than a quark_line inside the []-brackets.)

Reimplemented in ColorFull::Tree_level_gluon_basis.

◆ read_in_Col_basis() [2/2]

virtual void ColorFull::Col_basis::read_in_Col_basis ( )
virtual

Function for reading in the basis from default filename (see basis_file_name).

Reimplemented in ColorFull::Tree_level_gluon_basis.

◆ read_in_d_spm() [1/2]

void ColorFull::Col_basis::read_in_d_spm ( std::string  filename)

Read in a numerical matrix from a file filename (see spm_file_name) and save it as a double matrix, dmatr, in the member variable d_spm. The file should be in the format
{{d11,...,d1n},
...,
{dn1,....dnn}},
and may contain comment lines starting with # at the top.

◆ read_in_d_spm() [2/2]

void ColorFull::Col_basis::read_in_d_spm ( )

Read in a numerical matrix from a file with default filename (see spm_file_name) and save it as a double matrix, dmatr, in the member variable d_spm. The file should be in the format {{d11,...,d1n},
...,
{dn1,....dnn}},
and may contain comment lines starting with # at the top.

◆ read_in_leading_d_spm() [1/2]

void ColorFull::Col_basis::read_in_leading_d_spm ( std::string  filename)

Read in a numerical matrix from the file filename and save it as a double matrix, dmatr, in the member variable leading_d_spm. The file should be in the format
{{d11,0,...,0},
...,
{0,0,....dnn}},
and may contain comment lines starting with # at the top.

◆ read_in_leading_d_spm() [2/2]

void ColorFull::Col_basis::read_in_leading_d_spm ( )

Read in a numerical matrix from a file with default filename (see spm_file_name) and save it as a double matrix, dmatr, in the member variable leading_d_spm. The file should be in the format
{{d11,0,...,0},
...,
{0,0,....dnn}},
and may contain comment lines starting with # at the top.

◆ read_in_leading_P_spm() [1/2]

void ColorFull::Col_basis::read_in_leading_P_spm ( std::string  filename)

Read in a Polynomial matrix from a file with default filename (see spm_file_name) and save it as a Poly_matr in the member variable leading_P_spm. The file should be in the format
{{Poly11,0...,0},
...,
{0,...,Polynn}},
and may contain comment lines starting with # at the top.

◆ read_in_leading_P_spm() [2/2]

void ColorFull::Col_basis::read_in_leading_P_spm ( )

Reads in a Polynomial matrix from default filename (see spm_file_name) and save it as a Poly_matr in the member variable leading_P_spm. The file should be in the format
{{Poly11,0...,0},
...,
{0,...,Polynn}},
and may contain comment lines starting with # at the top.

◆ read_in_P_spm() [1/2]

void ColorFull::Col_basis::read_in_P_spm ( std::string  filename)

Read in a Polynomial matrix from the file filename and save it as a Poly_matr in the member variable P_spm. The file should be in the format
{{Poly11,...,Poly1n},
...,
{Polyn1,...,Polynn}},
and may contain comment lines starting with # at the top.

◆ read_in_P_spm() [2/2]

void ColorFull::Col_basis::read_in_P_spm ( )

Read in a Polynomial matrix from a file with default filename (see spm_file_name) and save it as a Poly_matr in the member variable P_spm. The file should be in the format
{{Poly11,...,Poly1n},
...,
{Polyn1,...,Polynn}},
and may contain comment lines starting with # at the top.

◆ rename_indices()

void ColorFull::Col_basis::rename_indices ( Col_str Cs1,
Col_str Cs2 
) const

A function to rename the indices in two Col_strs, such that in the first they are called 1,2,3..., and in the second the relative order is kept.

◆ scalar_product()

virtual Polynomial ColorFull::Col_basis::scalar_product ( const Col_amp Ca1,
const Col_amp Ca2 
)
virtual

Function for calculating scalar products algebraically using the basis and the scalar product matrix (Poly_matr) in the basis. (Does add implicit conjugated part for Tree_level_gluon_basis, as these terms are contained in the matrix of scalar products.)

Reimplemented in ColorFull::Orthogonal_basis.

◆ scalar_product_matrix() [1/2]

void ColorFull::Col_basis::scalar_product_matrix ( )

Function for calculating the scalar products matrix. This function loops over all basis vectors and stores the value of the scalar product between basis vector i and basis vector j in the i,j -entry in P_spm and d_spm. The calculation is done using memoization. The symmetry of the scalar product matrix is not used for the calculation, instead it is checked that the resulting matrix is indeed symmetric.

◆ scalar_product_matrix() [2/2]

virtual void ColorFull::Col_basis::scalar_product_matrix ( bool  save_P_spm,
bool  save_d_spm,
bool  use_mem 
)
protectedvirtual

The underlying function for calculation of scalar product matrices. Calculation depends on the arguments: save_P_spm, save_d_spm and use_mem. If save_P_spm is true the Polynomial scalar product matrix is saved to P_spm. If save_d_spm is true, the numerical scalar product matrix is saved to d_spm. The leading_d_spm is only calculated and written out if save_P_spm is true. If use_mem is true memoization is used in order to calculate a color topology only once.

◆ scalar_product_matrix_no_mem()

virtual void ColorFull::Col_basis::scalar_product_matrix_no_mem ( )
virtual

This function works like scalar_product_matrix, but does not use memoization.

◆ scalar_product_matrix_num()

void ColorFull::Col_basis::scalar_product_matrix_num ( )

This function works as scalar_product_matrix, but does the calculation numerically. It hence only calculates d_spm.

◆ scalar_product_matrix_num_no_mem()

void ColorFull::Col_basis::scalar_product_matrix_num_no_mem ( )

This function works like scalar_product_matrix_num, but does not use memoization.

◆ scalar_product_num() [1/2]

virtual cnum ColorFull::Col_basis::scalar_product_num ( const Col_amp Ca1,
const Col_amp Ca2 
)
virtual

Function for calculating scalar products numerically, knowing the basis and the scalar product matrix in numerical form. (Does add implicit conjugated part for Tree_level_gluon_basis, as these terms are contained in the matrix of scalar products.)

Reimplemented in ColorFull::Orthogonal_basis.

◆ scalar_product_num() [2/2]

virtual cnum ColorFull::Col_basis::scalar_product_num ( const cvec v1,
const cvec v2 
)
virtual

Calculates the scalar product between numerical (complex) amplitudes v1, V2 using the numerical scalar product matrix, d_spm. The vectors thus needs to be expressed in the basis contained in cb. (Does add implicit conjugated part for Tree_level_gluon_basis, as these terms are contained in the matrix of scalar products.)

Reimplemented in ColorFull::Orthogonal_basis.

◆ scalar_product_num_diagonal()

cnum ColorFull::Col_basis::scalar_product_num_diagonal ( const cvec v1,
const cvec v2 
)

Calculates the scalar product between numerical (complex) amplitudes v1, v2 using the numerical scalar product matrix, d_spm. Assumes that there are only diagonal contributions. This is useful for calculations in leading Nc limit. (Does add implicit conjugated part for Tree_level_gluon_basis, as these terms are contained in the matrix of scalar products.)

◆ simplify()

void ColorFull::Col_basis::simplify ( )

Simplifies all the basis vectors by using simplify on the individual Col_amps in the basis.

◆ size()

uint ColorFull::Col_basis::size ( ) const
inline

Returns the number of basis vectors.

◆ spm_file_name()

std::string ColorFull::Col_basis::spm_file_name ( const bool  leading,
const bool  poly 
) const

Returns a standard filename, used for writing out scalar product matrices. If leading is true, "_l" is appended to the filename. If "poly" is true "P_" is added to the filename, and if it is false "d_", as in double, is added to the filename.

◆ write_out_Col_basis() [1/2]

virtual void ColorFull::Col_basis::write_out_Col_basis ( std::string  filename) const
virtual

Function for writing out the basis to a file with name filename.

Reimplemented in ColorFull::Tree_level_gluon_basis.

◆ write_out_Col_basis() [2/2]

virtual void ColorFull::Col_basis::write_out_Col_basis ( ) const
virtual

Function for writing out the basis to a file with default name (see basis_file_name).

Reimplemented in ColorFull::Tree_level_gluon_basis.

◆ write_out_Col_basis_to_stream()

virtual std::ostream& ColorFull::Col_basis::write_out_Col_basis_to_stream ( std::ostream &  out) const
protectedvirtual

Function for writing out the basis in a human readable format to an ostream.

Reimplemented in ColorFull::Tree_level_gluon_basis.

◆ write_out_d_spm() [1/2]

void ColorFull::Col_basis::write_out_d_spm ( std::string  filename) const

Writes out d_spm to the file filename.

◆ write_out_d_spm() [2/2]

void ColorFull::Col_basis::write_out_d_spm ( ) const

Writes out d_spm to the standard filename, see spm_file_name.

◆ write_out_leading_d_spm() [1/2]

void ColorFull::Col_basis::write_out_leading_d_spm ( std::string  filename) const

Writes out leading_d_spm to the file filename.

◆ write_out_leading_d_spm() [2/2]

void ColorFull::Col_basis::write_out_leading_d_spm ( ) const

Writes out leading_d_spm to the standard filename, see spm_file_name.

◆ write_out_leading_P_spm() [1/2]

void ColorFull::Col_basis::write_out_leading_P_spm ( std::string  filename) const

Writes out leading_P_spm to the file filename.

◆ write_out_leading_P_spm() [2/2]

void ColorFull::Col_basis::write_out_leading_P_spm ( ) const

Writes out leading_P_spm to the standard filename, see spm_file_name.

◆ write_out_P_spm() [1/2]

void ColorFull::Col_basis::write_out_P_spm ( std::string  filename) const

Writes out P_spm to the file filename.

◆ write_out_P_spm() [2/2]

void ColorFull::Col_basis::write_out_P_spm ( ) const

Writes out P_spm to the standard filename, see spm_file_name.

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  out,
const Col_basis Cb 
)
friend

Define the operator << for Col_basis.

The operator << for Col_basis operator must be able to access the write_out_Col_basis_to_stream operator.

Member Data Documentation

◆ cb

col_basis ColorFull::Col_basis::cb

To actually contain the info about the basis vectors cb= vector1, vector2... . Technically cb is a col_basis, a vector of Col_amps.

◆ Col_fun

Col_functions ColorFull::Col_basis::Col_fun

To contain the set of Col_functions used.

◆ d_spm

dmatr ColorFull::Col_basis::d_spm

To contain the double version of the scalar product matrix.

◆ leading_d_spm

dmatr ColorFull::Col_basis::leading_d_spm

To contain the double version of the leading part of the scalar product matrix.

◆ leading_P_spm

Poly_matr ColorFull::Col_basis::leading_P_spm

To contain the Polynomial version of the leading part of the scalar product matrix.

◆ ng

int ColorFull::Col_basis::ng

The number of gluons, initially set to 0 and (possibly) changed with create_basis, or while reading in the basis.

◆ nq

int ColorFull::Col_basis::nq

The number of qqbar-pairs, initially set to 0 and (possibly) changed with create_basis, or while reading in the basis.

◆ orthogonal_basis

bool ColorFull::Col_basis::orthogonal_basis
protected

◆ P_spm

Poly_matr ColorFull::Col_basis::P_spm

To contain the Polynomial version of the scalar product matrix.

◆ trace_basis

bool ColorFull::Col_basis::trace_basis
protected

◆ tree_level_gluon_basis

bool ColorFull::Col_basis::tree_level_gluon_basis
protected

The documentation for this class was generated from the following file:
  • /data/Documents/eclipse/workspace/ColorFull/Col_basis.h