herwig is hosted by Hepforge, IPPP Durham
Herwig  7.2.1
ColorFull::Col_basis Class Reference

To contain a color basis, where each basis vector is a Col_amp. More...

#include <Col_basis.h>

Inheritance diagram for ColorFull::Col_basis:

Public Member Functions

 Col_basis ()
 Default constructor.
 
virtual ~Col_basis ()
 Destructor.
 
bool is_Trace_basis () const
 Is it a Trace_basis?
 
bool is_Orthogonal_basis () const
 Is it an Orthogonal_basis?
 
bool is_Tree_level_gluon_basis () const
 Is it a Tree_level_gluon_basis?
 
uint size () const
 Returns the number of basis vectors.
 
const Col_ampat (const int i) const
 Returns the Col_amp (basis vector) at place i.
 
Col_ampat (const int i)
 Returns the Col_amp (basis vector) at place i.
 
bool empty () const
 Is the col_basis empty?
 
void clear ()
 Erase the basis, stored in cb.
 
void append (Col_amp Ca)
 Appends a Col_amp to the basis, stored in cb.
 
void append (col_basis cb_in)
 Appends the Col_amps in cb_in to the col_basis member cb.
 
void scalar_product_matrix ()
 Function for calculating the scalar products matrix. More...
 
void scalar_product_matrix_num ()
 This function works as scalar_product_matrix, but does the calculation numerically. More...
 
virtual void scalar_product_matrix_no_mem ()
 This function works like scalar_product_matrix, but does not use memoization. More...
 
void scalar_product_matrix_num_no_mem ()
 This function works like scalar_product_matrix_num, but does not use memoization. More...
 
void leading_scalar_product_matrix ()
 Finds the leading Nc scalar product matrices, leading_P_spm and leading_d_spm. More...
 
virtual Polynomial scalar_product (const Col_amp &Ca1, const Col_amp &Ca2)
 Function for calculating scalar products algebraically using the basis and the scalar product matrix (Poly_matr) in the basis. More...
 
virtual cnum scalar_product_num (const Col_amp &Ca1, const Col_amp &Ca2)
 Function for calculating scalar products numerically, knowing the basis and the scalar product matrix in numerical form. More...
 
virtual cnum scalar_product_num (const cvec &v1, const cvec &v2)
 Calculates the scalar product between numerical (complex) amplitudes v1, V2 using the numerical scalar product matrix, d_spm. More...
 
cnum 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. More...
 
std::string basis_file_name () const
 Returns a standard filename, used for writing out the basis to a file. More...
 
std::string spm_file_name (const bool leading, const bool poly) const
 Returns a standard filename, used for writing out scalar product matrices. More...
 
virtual void read_in_Col_basis (std::string filename)
 Function for reading in the basis from the file filename. More...
 
virtual void read_in_Col_basis ()
 Function for reading in the basis from default filename (see basis_file_name). More...
 
void 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. More...
 
void 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. More...
 
void 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. More...
 
void 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. More...
 
void 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. More...
 
void 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. More...
 
void 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. More...
 
void 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. More...
 
virtual void write_out_Col_basis (std::string filename) const
 Function for writing out the basis to a file with name filename.
 
virtual void write_out_Col_basis () const
 Function for writing out the basis to a file with default name (see basis_file_name). More...
 
void write_out_d_spm (std::string filename) const
 Writes out d_spm to the file filename.
 
void write_out_d_spm () const
 Writes out d_spm to the standard filename, see spm_file_name.
 
void write_out_P_spm (std::string filename) const
 Writes out P_spm to the file filename.
 
void write_out_P_spm () const
 Writes out P_spm to the standard filename, see spm_file_name.
 
void write_out_leading_d_spm (std::string filename) const
 Writes out leading_d_spm to the file filename.
 
void write_out_leading_d_spm () const
 Writes out leading_d_spm to the standard filename, see spm_file_name.
 
void write_out_leading_P_spm (std::string filename) const
 Writes out leading_P_spm to the file filename.
 
void write_out_leading_P_spm () const
 Writes out leading_P_spm to the standard filename, see spm_file_name.
 
void simplify ()
 Simplifies all the basis vectors by using simplify on the individual Col_amps in the basis. More...
 
virtual Poly_vec decompose (const Col_amp &Ca)
 Each type of color basis has to implement a function for decomposing an amplitude in the color basis. More...
 
Col_amp 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. More...
 
Poly_matr color_gamma (int p1, int p2)
 Function for calculating the color structure part of the soft anomalous dimension matrix. More...
 
int 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. More...
 
int 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. More...
 
void 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. More...
 

Public Attributes

int nq
 The number of qqbar-pairs, initially set to 0 and (possibly) changed with create_basis, or while reading in the basis. More...
 
int ng
 The number of gluons, initially set to 0 and (possibly) changed with create_basis, or while reading in the basis. More...
 
col_basis cb
 To actually contain the info about the basis vectors cb= vector1, vector2... More...
 
Poly_matr P_spm
 To contain the Polynomial version of the scalar product matrix.
 
Poly_matr leading_P_spm
 To contain the Polynomial version of the leading part of the scalar product matrix.
 
dmatr d_spm
 To contain the double version of the scalar product matrix.
 
dmatr leading_d_spm
 To contain the double version of the leading part of the scalar product matrix.
 
Col_functions Col_fun
 To contain the set of Col_functions used.
 

Protected Member Functions

virtual void scalar_product_matrix (bool save_P_spm, bool save_d_spm, bool use_mem)
 The underlying function for calculation of scalar product matrices. More...
 
virtual Polynomial ij_entry (const int i, const int j) const
 Calculates element i,j in scalar product matrix using the scalar product.
 
bool check_diagonal (const dmatr &matr) const
 Checking that a numerical (double) matrix is diagonal. More...
 
bool check_symmetry (const dmatr &matr) const
 Checking that a numerical (double) matrix (the scalar product matrix) is symmetric. More...
 
void check_spm () const
 Makes consistency checks on the scalar product matrix.
 
void Col_basis_of_str (std::string str)
 Converts a text string (in a file) to a basis, used by the read_in_basis functions. More...
 
virtual std::ostream & write_out_Col_basis_to_stream (std::ostream &out) const
 Function for writing out the basis in a human readable format to an ostream. More...
 

Protected Attributes

bool trace_basis
 
bool tree_level_gluon_basis
 
bool orthogonal_basis
 

Friends

std::ostream & operator<< (std::ostream &out, const Col_basis &Cb)
 The operator << for Col_basis operator must be able to access the write_out_Col_basis_to_stream operator. More...
 

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.

Definition at line 24 of file Col_basis.h.

Member Function Documentation

◆ 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.

Referenced by append().

◆ 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.

Referenced by append().

◆ 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.

Referenced by append().

◆ 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.

Referenced by append().

◆ 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.

Referenced by append().

◆ 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.

Referenced by append().

◆ 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.

Referenced by append().

◆ 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.

Referenced by append().

◆ 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.

Referenced by append().

◆ 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.

Referenced by append().

◆ 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.

Referenced by append().

◆ 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.

Referenced by append().

◆ 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.

Referenced by append().

◆ 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.

Referenced by append().

◆ 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.

Referenced by append().

◆ 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.

Referenced by append().

◆ 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.

Referenced by append().

◆ 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.

Referenced by append().

◆ 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.

Reimplemented in ColorFull::Orthogonal_basis.

◆ 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.

Referenced by append().

◆ 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.

Referenced by append().

◆ 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.

Referenced by append().

◆ 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.

Referenced by append().

◆ 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.)

Referenced by append().

◆ simplify()

void ColorFull::Col_basis::simplify ( )

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

Referenced by append().

◆ 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.

Referenced by append().

◆ write_out_Col_basis()

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.

Referenced by append().

◆ 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.

Referenced by append().

Friends And Related Function Documentation

◆ operator<<

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

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

Referenced by append().

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.

Definition at line 50 of file Col_basis.h.

Referenced by append().

◆ 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.

Definition at line 46 of file Col_basis.h.

Referenced by Col_basis(), and ColorFull::Trace_basis::initialize().

◆ 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.

Definition at line 42 of file Col_basis.h.

Referenced by Col_basis(), and ColorFull::Trace_basis::initialize().


The documentation for this class was generated from the following file: