herwig is hosted by Hepforge, IPPP Durham
Herwig  7.2.1
DensityOperator.h
1 // -*- C++ -*-
2 //
3 // DensityOperator.h is a part of Herwig - A multi-purpose Monte Carlo event generator
4 // Copyright (C) 2002-2019 The Herwig Collaboration
5 //
6 // Herwig is licenced under version 2 of the GPL, see COPYING for details.
7 // Please respect the MCnet academic guidelines, see GUIDELINES for details.
8 //
9 #ifndef Herwig_DensityOperator_H
10 #define Herwig_DensityOperator_H
11 //
12 // This is the declaration of the DensityOperator class.
13 //
14 
15 #include "ThePEG/Handlers/HandlerBase.h"
16 
17 #include "Herwig/MatrixElement/Matchbox/Utility/ColourBasis.h"
18 
19 #include <tuple>
20 #include <boost/numeric/ublas/matrix.hpp>
21 #include <boost/numeric/ublas/vector.hpp>
22 
23 namespace Herwig {
24 
25 using namespace ThePEG;
26 
27 typedef boost::numeric::ublas::vector<Complex> CVector;
28 
29 
30 
38 
39 public:
40 
47 
51  virtual ~DensityOperator();
53 
54 public:
55 
59  void clear();
60 
64  void prepare(const cPDVector&);
65 
70  void fill(const Ptr<MatchboxXComb>::ptr,
71  const cPDVector&, const vector<Lorentz5Momentum>& momenta);
72 
79  void evolve(const map<pair<size_t,size_t>,Complex>& Vijk,
80  const cPDVector& before,
81  const cPDVector& after,
82  const map<std::tuple<size_t,size_t,size_t>,map<size_t,size_t> >& emissionsMap,
83  const bool splitAGluon,
84  const bool initialGluonSplitting);
85 
95  double colourMatrixElementCorrection(const std::tuple<size_t,size_t,long>& ikemission,
96  const cPDVector& particles);
97 
101  void colourConservation(const cPDVector& particles);
102 
106  Ptr<ColourBasis>::tptr colourBasis() { return theColourBasis; }
107 
111  const Ptr<ColourBasis>::tptr colourBasis() const { return theColourBasis; }
112 
116  void colourBasis(Ptr<ColourBasis>::ptr ptr) { theColourBasis = ptr; }
117 
121  const map<pair<vector<PDT::Colour>,pair<size_t,size_t> >,double>& correlatorMap() const {
122  return theCorrelatorMap;
123  }
124 
131  void persistentOutput(PersistentOStream & os) const;
132 
138  void persistentInput(PersistentIStream & is, int version);
140 
147  static void Init();
148 
149 protected:
150 
157  virtual IBPtr clone() const;
158 
163  virtual IBPtr fullclone() const;
165 
166 
167 // If needed, insert declarations of virtual function defined in the
168 // InterfacedBase class here (using ThePEG-interfaced-decl in Emacs).
169 
170 
171 private:
172 
176  double Nc;
177 
181  double TR;
182 
186  double colourNorm(const cPDPtr particle);
187 
193  matrix<Complex> prodSparseDense(const compressed_matrix<double>&,
194  const matrix<Complex>&);
201  matrix<Complex> prodDenseSparse(const matrix<Complex>&,
202  const compressed_matrix<double>&);
203 
209  vector<Lorentz5Momentum> boostToRestFrame(const vector<Lorentz5Momentum>& momenta);
210 
214  bool compareMomentum(const Lorentz5Momentum& p, const Lorentz5Momentum& q);
215 
220  map<vector<PDT::Colour>,matrix<Complex> > theDensityOperatorMap;
221 
225  map<pair<vector<PDT::Colour>,pair<size_t,size_t> >,double> theCorrelatorMap;
226 
231  map<cPDVector, map<size_t,size_t> > theColourBasisToColourBasisMap;
232 
236  Ptr<ColourBasis>::ptr theColourBasis;
237 
242  DensityOperator & operator=(const DensityOperator &);
243 
244 };
245 
246 }
247 
248 #endif /* Herwig_DensityOperator_H */
const map< pair< vector< PDT::Colour >, pair< size_t, size_t > >, double > & correlatorMap() const
Get the correlator map.
std::complex< double > Complex
Here is the documentation of the DensityOperator class.
map< pair< vector< PDT::Colour >, pair< size_t, size_t > >, double > theCorrelatorMap
Mapping of colour structures and legs to colour correlators.
double TR
QCD vertex normalization.
ThePEG::Ptr< InterfacedBase >::pointer IBPtr
ThePEG::Ptr< ParticleData >::const_pointer cPDPtr
const Ptr< ColourBasis >::tptr colourBasis() const
Get the colour basis.
Ptr< ColourBasis >::tptr colourBasis()
Get the colour basis.
double Nc
Number of colours used in colourNorm.
map< vector< PDT::Colour >, matrix< Complex > > theDensityOperatorMap
Mapping of colour structures to density operator matrices.
map< cPDVector, map< size_t, size_t > > theColourBasisToColourBasisMap
A map from the hard subprocess particles to a map of amplitude colour basis order to the normal order...
vector< cPDPtr > cPDVector
Ptr< ColourBasis >::ptr theColourBasis
Colour basis used.
void colourBasis(Ptr< ColourBasis >::ptr ptr)
Set the colour basis.
-*- C++ -*-
boost::numeric::ublas::vector< Complex > CVector
Define complex vector from boost::uBLAS.