herwig is hosted by Hepforge, IPPP Durham
Herwig  7.2.1
Herwig::ColourBasis Class Referenceabstract

ColourBasis is an interface to a colour basis implementation. More...

#include <ColourBasis.h>

Inheritance diagram for Herwig::ColourBasis:

Classes

struct  matchRep
 Match colour representation. More...
 

Public Member Functions

Ptr< MatchboxFactory >::tptr factory () const
 Return the factory which produced this matrix element.
 
Ptr< ColourBasis >::ptr cloneMe () const
 Clone this colour basis.
 
virtual void clear ()
 Clear this colour basis.
 
size_t prepare (const cPDVector &, bool)
 Prepare for the given sub process and return the basis dimensionality.
 
size_t prepare (const MEBase::DiagramVector &, bool)
 Prepare for the given diagrams.
 
const map< cPDVector, map< size_t, size_t > > & indexMap () const
 Return the index map.
 
virtual map< size_t, vector< vector< size_t > > > basisList (const vector< PDT::Colour > &) const
 Return a map of basis tensor indices to vectors identifying a certain ordering corresponding to the given colour structure. More...
 
const string & orderingString (const cPDVector &sub, const map< size_t, size_t > &colourToAmplitude, size_t tensorId)
 Given a physical subprocess, a colour to amplitude label map and a basis tensor index, return an identifier of the ordering coresponding to the given colour structure. More...
 
const set< vector< size_t > > & ordering (const cPDVector &sub, const map< size_t, size_t > &colourToAmplitude, size_t tensorId, size_t shift=0)
 Given a physical subprocess, a colour to amplitude label map and a basis tensor index, return an identifier of the ordering coresponding to the given colour structure. More...
 
double me2 (const cPDVector &, const map< vector< int >, CVector > &) const
 For the given subprocess and amplitude vectors calculate the amplitude squared.
 
double interference (const cPDVector &, const map< vector< int >, CVector > &, const map< vector< int >, CVector > &) const
 For the given subprocess and amplitude vectors calculate the interference.
 
double colourCorrelatedME2 (const pair< size_t, size_t > &, const cPDVector &, const map< vector< int >, CVector > &) const
 For the given subprocess and amplitude vector calculate the colour correlated amplitude.
 
Complex interference (const cPDVector &, const CVector &, const CVector &) const
 For the given subprocess and amplitude vector calculate the amplitude squared.
 
Complex colourCorrelatedInterference (const pair< size_t, size_t > &, const cPDVector &, const CVector &, const CVector &) const
 For the given subprocess and amplitude vector calculate the colour correlated amplitude.
 
double me2 (const cPDVector &, const matrix< Complex > &) const
 For the given subprocess and amplitude given as amp amp^ calculate the amplitude squared.
 
double colourCorrelatedME2 (const pair< size_t, size_t > &, const cPDVector &, const matrix< Complex > &) const
 For the given subprocess and amplitude given as amp amp^ calculate the colour correlated amplitude.
 
const symmetric_matrix< double, upper > & scalarProducts (const cPDVector &) const
 Return the scalar product matrix for the given process.
 
const symmetric_matrix< double, upper > & correlator (const cPDVector &, const pair< size_t, size_t > &) const
 Return the correlator matrix for the given process.
 
virtual bool haveColourFlows () const
 Return true, if the colour basis is capable of assigning colour flows.
 
Selector< const ColourLines * > colourGeometries (tcDiagPtr diag, const map< vector< int >, CVector > &amps)
 Return a Selector with possible colour geometries for the selected diagram weighted by their relative probabilities.
 
size_t tensorIdFromFlow (tcDiagPtr diag, const ColourLines *cl)
 Return the colour tensor used for the selected colour flow.
 
virtual bool largeN () const
 Return true, if this basis is running in large-N mode.
 
void doLargeN (bool yes=true)
 Switch to large n.
 
vector< PDT::ColourprojectColour (const cPDVector &) const
 Convert particle data to colour information.
 
virtual vector< PDT::ColournormalOrder (const vector< PDT::Colour > &) const
 Perform a normal ordering of the external legs. More...
 
vector< PDT::ColournormalOrderMap (const cPDVector &sub)
 Determine the mapping of process to colour indices and return the normal ordered vector of colour indices.
 
const vector< PDT::Colour > & normalOrderedLegs (const cPDVector &sub) const
 Get the normal ordered legs.
 
const std::tuple< vector< PDT::Colour >, vector< PDT::Colour >, size_t, size_t, size_t, map< size_t, size_t > > & normalOrderEmissionMap (const cPDVector &subFrom, const cPDVector &subTo, size_t ij, size_t i, size_t j, const map< size_t, size_t > &emissionMap)
 Generate the emission/splitting map for basis labels from sub-process information; we consider the splitting of leg ij from subprocess subFrom with the legs not participating in the splitting relabelled according to emissionMap.
 
const pair< compressed_matrix< double >, vector< pair< size_t, size_t > > > & charge (const cPDVector &subFrom, const cPDVector &subTo, size_t ij, size_t i, size_t j, const map< size_t, size_t > &emissionMap)
 Return the colour charge matrix representation for the given splitting ij -> i,j with other legs relabbeled as indicated by the dictionary map.
 
string file (const vector< PDT::Colour > &) const
 Convert the legs to a string.
 
void chargeProduct (const compressed_matrix< double > &ti, const vector< pair< size_t, size_t > > &tiNonZero, const symmetric_matrix< double, upper > &X, const compressed_matrix< double > &tj, const vector< pair< size_t, size_t > > &tjNonZero, symmetric_matrix< double, upper > &result) const
 Calculate T_i^ X T_j.
 
void chargeProductAdd (const compressed_matrix< double > &ti, const vector< pair< size_t, size_t > > &tiNonZero, const matrix< Complex > &X, const compressed_matrix< double > &tj, const vector< pair< size_t, size_t > > &tjNonZero, matrix< Complex > &result, double factor=1.) const
 Calculate T_i X T_j^.
 
virtual map< size_t, size_t > indexChange (const vector< PDT::Colour > &, const size_t, const map< size_t, size_t > &) const
 Returns a map of how the order of the vectors of a colour basis are changed when the indices are changed.
 
Standard constructors and destructors.
 ColourBasis ()
 The default constructor.
 
virtual ~ColourBasis ()
 The destructor.
 
Functions used by the persistent I/O system.
void persistentOutput (PersistentOStream &os) const
 Function used to write out object persistently. More...
 
void persistentInput (PersistentIStream &is, int version)
 Function used to read in object persistently. More...
 
- Public Member Functions inherited from HandlerBaseT< UseRandom >
double rnd () const
 
double rnd (double xu) const
 
double rnd (double xl, double xu) const
 
bool rndbool () const
 
bool rndbool (double p) const
 
bool rndbool (double p1, double p2) const
 
int rndsign (double p1, double p2, double p3) const
 
int rnd2 (double p0, double p1) const
 
int rnd3 (double p0, double p1, double p2) const
 
int rnd4 (double p0, double p1, double p2, double p3) const
 
long irnd (long xu=2) const
 
long irnd (long xl, long xu) const
 
const StandardModelBase & SM () const
 
tSMPtr standardModel () const
 
- Public Member Functions inherited from ThePEG::Interfaced
virtual bool defaultInit ()
 
PPtr getParticle (PID) const
 
PDPtr getParticleData (PID) const
 
bool used () const
 
void useMe () const
 
tEGPtr generator () const
 
void persistentOutput (PersistentOStream &os) const
 
void persistentInput (PersistentIStream &is, int version)
 
PPtr getParticle (PID) const
 
PDPtr getParticleData (PID) const
 
bool used () const
 
void useMe () const
 
tEGPtr generator () const
 
void persistentOutput (PersistentOStream &os) const
 
void persistentInput (PersistentIStream &is, int version)
 
- Public Member Functions inherited from ThePEG::InterfacedBase
string fullName () const
 
string name () const
 
string path () const
 
string comment () const
 
void setup (istream &is)
 
virtual IBPtr fullclone () const
 
virtual void debugme () const
 
void update ()
 
void init ()
 
virtual bool preInitialize () const
 
void initrun ()
 
void finish ()
 
void touch ()
 
void reset ()
 
void clear ()
 
InitState state () const
 
bool locked () const
 
bool touched () const
 
void persistentOutput (PersistentOStream &os) const
 
void persistentInput (PersistentIStream &is, int version)
 
void update ()
 
void init ()
 
virtual bool preInitialize () const
 
void initrun ()
 
void finish ()
 
void touch ()
 
void reset ()
 
void clear ()
 
InitState state () const
 
bool locked () const
 
bool touched () const
 
void persistentOutput (PersistentOStream &os) const
 
void persistentInput (PersistentIStream &is, int version)
 
- Public Member Functions inherited from ThePEG::Base
void debug () const
 
- Public Member Functions inherited from ThePEG::Pointer::ReferenceCounted
CounterType referenceCount () const
 
- Public Member Functions inherited from ThePEG::Named
 Named (const string &newName=string())
 
 Named (const Named &)=default
 
const string & name () const
 
bool operator== (const Named &other) const
 
bool operator< (const Named &other) const
 

Static Public Member Functions

static list< pair< int, bool > > colouredPath (pair< int, bool > a, pair< int, bool > b, Ptr< Tree2toNDiagram >::tcptr)
 Find a coloured path from a to b within the given diagram.
 
static list< list< list< pair< int, bool > > > > colourFlows (Ptr< Tree2toNDiagram >::tcptr)
 Get all colour flows for the given diagram.
 
static string cfstring (const list< list< pair< int, bool > > > &)
 Convert a flow to a string representation appropriate for ColourLines.
 
static void Init ()
 The standard Init function used to initialize the interfaces. More...
 
- Static Public Member Functions inherited from ThePEG::HandlerBase
static void Init ()
 
- Static Public Member Functions inherited from ThePEG::Interfaced
static void Init ()
 
- Static Public Member Functions inherited from ThePEG::InterfacedBase
static void Init ()
 
- Static Public Member Functions inherited from ThePEG::Base
static void Init ()
 

Protected Member Functions

virtual size_t prepareBasis (const vector< PDT::Colour > &)=0
 Prepare the basis for the normal ordered legs and return the dimensionality of the basis.
 
virtual double scalarProduct (size_t a, size_t b, const vector< PDT::Colour > &abBasis) const =0
 Return the scalar product of basis tensors labelled a and b in the basis used for the given normal ordered legs.
 
virtual double tMatrixElement (size_t i, size_t a, size_t b, const vector< PDT::Colour > &aBasis, const vector< PDT::Colour > &bBasis, size_t k, size_t l, const map< size_t, size_t > &dict) const =0
 Return the matrix element of a colour charge or quark splitting <c_{n+1,a}|T_i|c_{n,b}> between basis tensors a and b, with respect to aBasis and bBasis; k and l index the splitting product's labels, and dict encodes how legs not participating in the splitting are relabeled to the larger basis.
 
virtual bool colourConnected (const cPDVector &, const vector< PDT::Colour > &, const pair< int, bool > &, const pair< int, bool > &, size_t) const
 Return true, if a large-N colour connection exists for the given external legs and basis tensor.
 
virtual bool colourConnected (const vector< PDT::Colour > &, int, int, size_t) const
 Return true, if a large-N colour connection exists for the given external legs and basis tensor.
 
vector< string > makeFlows (Ptr< Tree2toNDiagram >::tcptr, size_t) const
 Match up colour flows for given diagram to basis tensors.
 
map< Ptr< Tree2toNDiagram >::tcptr, vector< ColourLines * > > & colourLineMap ()
 Return the colour line map.
 
void updateColourLines (Ptr< Tree2toNDiagram >::tcptr)
 Update the colour line map for a given diagram.
 
Standard Interfaced functions.
virtual void doinit ()
 Initialize this object after the setup phase before saving an EventGenerator to disk. More...
 
virtual void doinitrun ()
 Initialize this object. More...
 
virtual void dofinish ()
 Finalize this object. More...
 
- Protected Member Functions inherited from ThePEG::Interfaced
void reporeg (IBPtr object, string name) const
 
bool setDefaultReference (PtrT &ptr, string classname, string objectname)
 
 Interfaced (const string &newName)
 
 Interfaced (const Interfaced &i)
 
void setGenerator (tEGPtr generator)
 
- Protected Member Functions inherited from ThePEG::InterfacedBase
virtual IBPtr clone () const=0
 
 InterfacedBase (string newName)
 
 InterfacedBase (const InterfacedBase &i)
 
virtual void readSetup (istream &is)
 
virtual void doupdate ()
 
virtual IVector getReferences ()
 
virtual void rebind (const TranslationMap &)
 
virtual void readSetup (istream &is)
 
virtual void doupdate ()
 
virtual IVector getReferences ()
 
virtual void rebind (const TranslationMap &)
 
- Protected Member Functions inherited from ThePEG::Pointer::ReferenceCounted
 ReferenceCounted (const ReferenceCounted &)
 
ReferenceCountedoperator= (const ReferenceCounted &)
 
 ReferenceCounted (const ReferenceCounted &)
 
ReferenceCountedoperator= (const ReferenceCounted &)
 
- Protected Member Functions inherited from ThePEG::Named
const Namedoperator= (const Named &other)
 
const string & name (const string &newName)
 

Private Types

typedef map< vector< PDT::Colour >, symmetric_matrix< double, upper > > ScalarProductMap
 
typedef map< vector< PDT::Colour >, map< pair< size_t, size_t >, symmetric_matrix< double, upper > > > CorrelatorMap
 
typedef map< std::tuple< vector< PDT::Colour >, vector< PDT::Colour >, size_t, size_t, size_t, map< size_t, size_t > >, pair< compressed_matrix< double >, vector< pair< size_t, size_t > > > > TSMap
 

Private Member Functions

void writeBasis (const string &prefix="") const
 Write out yet unknown basis computations.
 
void readBasis ()
 Read in the basis computation which are supposed to be known.
 
bool readBasis (const vector< PDT::Colour > &)
 Read in the basis computation which are supposed to be known.
 
virtual void readBasisDetails (const vector< PDT::Colour > &)
 Gather any implementation dependend details when reading a basis.
 
void write (const symmetric_matrix< double, upper > &, ostream &) const
 Write out symmetric matrices.
 
void read (symmetric_matrix< double, upper > &, istream &)
 Read in symmetric matrices.
 
void write (const compressed_matrix< double > &, ostream &, const vector< pair< size_t, size_t > > &) const
 Write out compressed matrices.
 
void read (compressed_matrix< double > &, istream &, vector< pair< size_t, size_t > > &)
 Read in compressed matrices.
 
ColourBasisoperator= (const ColourBasis &)=delete
 The assignment operator is private and must never be called. More...
 

Private Attributes

bool theLargeN
 True, if this basis is running in large-N mode.
 
map< cPDVector, vector< PDT::Colour > > theNormalOrderedLegs
 Map external legs to normal ordered versions.
 
map< cPDVector, map< size_t, size_t > > theIndexMap
 Index mappings to normal order from given leg assignments, indexed by the original leg assignment.
 
map< std::tuple< cPDVector, cPDVector, size_t, size_t, size_t, map< size_t, size_t > >, std::tuple< vector< PDT::Colour >, vector< PDT::Colour >, size_t, size_t, size_t, map< size_t, size_t > > > theEmissionMaps
 Translations of emission maps.
 
ScalarProductMap theScalarProducts
 The scalar product matrix S_n = <c_{n,a}|c_{n,b}> , indexed by normal ordered leg assignments.
 
CorrelatorMap theCorrelators
 The correlator matrices T_i T_j -> T_i^ S_{n+1} T_j with T_i = <c_{n+1,a}|T_i|c_{n,b}> indexed by the `n' basis normal ordered legs and indices i,j.
 
TSMap theCharges
 Colour charge or quark splitting matrix representations.
 
map< Ptr< Tree2toNDiagram >::tcptr, vector< string > > theFlowMap
 Map diagrams to colour flows indexed by basis tensor.
 
map< Ptr< Tree2toNDiagram >::tcptr, vector< ColourLines * > > theColourLineMap
 Map diagrams to colour line objects.
 
map< cPDVector, map< size_t, string > > theOrderingStringIdentifiers
 Store ordering identifiers.
 
map< cPDVector, map< size_t, set< vector< size_t > > > > theOrderingIdentifiers
 Store ordering identifiers.
 
bool didRead
 True, if an attempt to read in basis information has been completed.
 
bool didWrite
 True, if an attempt to write out basis information has been completed.
 
matrix< double > tmp
 Temporary storage.
 
string theSearchPath
 The search path.
 

Additional Inherited Members

- Public Types inherited from ThePEG::InterfacedBase
enum  InitState
 
- Public Types inherited from ThePEG::Pointer::ReferenceCounted
typedef unsigned int CounterType
 
- Public Attributes inherited from ThePEG::InterfacedBase
 initializing
 
 uninitialized
 
 initialized
 
 runready
 
- Public Attributes inherited from ThePEG::Pointer::ReferenceCounted
const unsigned long uniqueId
 
- Static Protected Member Functions inherited from ThePEG::Interfaced
static void registerRepository (IBPtr)
 
static void registerRepository (IBPtr, string newName)
 

Detailed Description

ColourBasis is an interface to a colour basis implementation.

Author
Simon Platzer

Definition at line 46 of file ColourBasis.h.

Member Function Documentation

◆ basisList()

virtual map<size_t,vector<vector<size_t> > > Herwig::ColourBasis::basisList ( const vector< PDT::Colour > &  ) const
inlinevirtual

Return a map of basis tensor indices to vectors identifying a certain ordering corresponding to the given colour structure.

May not be supported by all colour basis implementations.

Reimplemented in Herwig::SimpleColourBasis2, CVolver::ColourFlowBasis, and ColorFull::TraceBasis.

Definition at line 103 of file ColourBasis.h.

◆ dofinish()

virtual void Herwig::ColourBasis::dofinish ( )
protectedvirtual

Finalize this object.

Called in the run phase just after a run has ended. Used eg. to write out statistics.

Reimplemented from ThePEG::InterfacedBase.

◆ doinit()

virtual void Herwig::ColourBasis::doinit ( )
protectedvirtual

Initialize this object after the setup phase before saving an EventGenerator to disk.

Exceptions
InitExceptionif object could not be initialized properly.

Reimplemented from ThePEG::InterfacedBase.

◆ doinitrun()

virtual void Herwig::ColourBasis::doinitrun ( )
protectedvirtual

Initialize this object.

Called in the run phase just before a run begins.

Reimplemented from ThePEG::InterfacedBase.

◆ Init()

static void Herwig::ColourBasis::Init ( )
static

The standard Init function used to initialize the interfaces.

Called exactly once for each class by the class description system before the main function starts or when this class is dynamically loaded.

◆ normalOrder()

virtual vector<PDT::Colour> Herwig::ColourBasis::normalOrder ( const vector< PDT::Colour > &  ) const
virtual

Perform a normal ordering of the external legs.

This default implementation assumes normal ordered legs as 3 3bar ... 3 3bar 8 ... 8 while removing all non-coloured particles.

◆ operator=()

ColourBasis& Herwig::ColourBasis::operator= ( const ColourBasis )
privatedelete

The assignment operator is private and must never be called.

In fact, it should not even be implemented.

◆ ordering()

const set<vector<size_t> >& Herwig::ColourBasis::ordering ( const cPDVector sub,
const map< size_t, size_t > &  colourToAmplitude,
size_t  tensorId,
size_t  shift = 0 
)

Given a physical subprocess, a colour to amplitude label map and a basis tensor index, return an identifier of the ordering coresponding to the given colour structure.

This will only return sensible results for colour bases which implement the basisList query.

◆ orderingString()

const string& Herwig::ColourBasis::orderingString ( const cPDVector sub,
const map< size_t, size_t > &  colourToAmplitude,
size_t  tensorId 
)

Given a physical subprocess, a colour to amplitude label map and a basis tensor index, return an identifier of the ordering coresponding to the given colour structure.

This will only return sensible results for colour bases which implement the basisList query.

◆ persistentInput()

void Herwig::ColourBasis::persistentInput ( PersistentIStream is,
int  version 
)

Function used to read in object persistently.

Parameters
isthe persistent input stream read from.
versionthe version number of the object when written.

◆ persistentOutput()

void Herwig::ColourBasis::persistentOutput ( PersistentOStream os) const

Function used to write out object persistently.

Parameters
osthe persistent output stream written to.

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