herwig is hosted by Hepforge, IPPP Durham
Herwig 7.3.0
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.
 
void scalar_product_matrix_num ()
 This function works as scalar_product_matrix, but does the calculation numerically.
 
virtual void scalar_product_matrix_no_mem ()
 This function works like scalar_product_matrix, but does not use memoization.
 
void scalar_product_matrix_num_no_mem ()
 This function works like scalar_product_matrix_num, but does not use memoization.
 
void leading_scalar_product_matrix ()
 Finds the leading Nc scalar product matrices, leading_P_spm and leading_d_spm.
 
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.
 
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.
 
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.
 
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.
 
std::string basis_file_name () const
 Returns a standard filename, used for writing out the basis to a file.
 
std::string spm_file_name (const bool leading, const bool poly) const
 Returns a standard filename, used for writing out scalar product matrices.
 
virtual void read_in_Col_basis (std::string filename)
 Function for reading in the basis from the file filename.
 
virtual void read_in_Col_basis ()
 Function for reading in the basis from default filename (see basis_file_name).
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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).
 
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.
 
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.
 
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.
 
Poly_matr color_gamma (int p1, int p2)
 Function for calculating the color structure part of the soft anomalous dimension matrix.
 
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.
 
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.
 
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.
 

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.
 
int ng
 The number of gluons, initially set to 0 and (possibly) changed with create_basis, or while reading in the basis.
 
col_basis cb
 To actually contain the info about the basis vectors cb= vector1, vector2... .
 
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.
 
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.
 
bool check_symmetry (const dmatr &matr) const
 Checking that a numerical (double) matrix (the scalar product matrix) is symmetric.
 
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.
 
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.
 

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.
 

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.

Constructor & Destructor Documentation

◆ Col_basis()

ColorFull::Col_basis::Col_basis ( )
inline

Default constructor.

Definition at line 29 of file Col_basis.h.

References ng, and nq.

◆ ~Col_basis()

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

Destructor.

Definition at line 38 of file Col_basis.h.

Member Function Documentation

◆ append()

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

Appends a Col_amp to the basis, stored in cb.

Definition at line 92 of file Col_basis.h.

References cb.

◆ at() [1/2]

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

Returns the Col_amp (basis vector) at place i.

Definition at line 83 of file Col_basis.h.

References cb.

◆ at() [2/2]

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

Returns the Col_amp (basis vector) at place i.

Definition at line 80 of file Col_basis.h.

References cb.

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

Definition at line 89 of file Col_basis.h.

References cb.

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

Definition at line 86 of file Col_basis.h.

References cb.

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

Reimplemented in ColorFull::Tree_level_gluon_basis.

◆ is_Orthogonal_basis()

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

Is it an Orthogonal_basis?

Definition at line 71 of file Col_basis.h.

◆ is_Trace_basis()

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

Is it a Trace_basis?

Definition at line 68 of file Col_basis.h.

◆ is_Tree_level_gluon_basis()

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

Is it a Tree_level_gluon_basis?

Definition at line 74 of file Col_basis.h.

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

◆ read_in_Col_basis() [1/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_Col_basis() [2/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_d_spm() [1/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_d_spm() [2/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_leading_d_spm() [1/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_d_spm() [2/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_P_spm() [1/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_leading_P_spm() [2/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_P_spm() [1/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.

◆ read_in_P_spm() [2/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.

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

Reimplemented in ColorFull::Orthogonal_basis.

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

◆ size()

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

Returns the number of basis vectors.

Definition at line 77 of file Col_basis.h.

References cb.

◆ 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 ( ) 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() [2/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_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.

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(), at(), clear(), empty(), and size().

◆ Col_fun

Col_functions ColorFull::Col_basis::Col_fun

To contain the set of Col_functions used.

Definition at line 65 of file Col_basis.h.

◆ d_spm

dmatr ColorFull::Col_basis::d_spm

To contain the double version of the scalar product matrix.

Definition at line 59 of file Col_basis.h.

◆ leading_d_spm

dmatr ColorFull::Col_basis::leading_d_spm

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

Definition at line 62 of file Col_basis.h.

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

Definition at line 56 of file Col_basis.h.

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

◆ orthogonal_basis

bool ColorFull::Col_basis::orthogonal_basis
protected

Definition at line 349 of file Col_basis.h.

◆ P_spm

Poly_matr ColorFull::Col_basis::P_spm

To contain the Polynomial version of the scalar product matrix.

Definition at line 53 of file Col_basis.h.

◆ trace_basis

bool ColorFull::Col_basis::trace_basis
protected

Definition at line 347 of file Col_basis.h.

◆ tree_level_gluon_basis

bool ColorFull::Col_basis::tree_level_gluon_basis
protected

Definition at line 348 of file Col_basis.h.


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