Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-08-06 09:24:11

0001 // -*- C++ -*-
0002 //
0003 // ColourFlowBasis.h is a part of CVolver
0004 // Copyright (C) 2013-2019 Simon Platzer, The Herwig Collaboration
0005 //
0006 // CVolver is licenced under version 3 of the GPL, see COPYING for details.
0007 // Please respect the MCnet academic guidelines, see GUIDELINES for details.
0008 //
0009 #ifndef CVOLVER_ColourFlowBasis_H
0010 #define CVOLVER_ColourFlowBasis_H
0011 //
0012 // This is the declaration of the ColourFlowBasis class.
0013 //
0014 
0015 #include "Herwig/MatrixElement/Matchbox/Utility/ColourBasis.h"
0016 #include "ColourFlows.h"
0017 
0018 namespace CVolver {
0019 
0020 using namespace ThePEG;
0021 using namespace Herwig;
0022 
0023 /**
0024  * Specify particle data traits for ThePEG
0025  */
0026 template<>
0027 struct ParticleDataTraits<ThePEG::PDT::Colour> {
0028 
0029   /**
0030    * Return true, if singlet
0031    */
0032   static bool isSinglet(const ThePEG::PDT::Colour& pd) { 
0033     return pd == PDT::Colour0;
0034   }
0035 
0036   /**
0037    * Return true, if anti-fundamental
0038    */
0039   static bool isAntiFundamental(const ThePEG::PDT::Colour& pd) {
0040     return pd == PDT::Colour3bar;
0041   }
0042 
0043   /**
0044    * Return true, if fundamental
0045    */
0046   static bool isFundamental(const ThePEG::PDT::Colour& pd) {
0047     return pd == PDT::Colour3;
0048   }
0049 
0050   /**
0051    * Return true, if adjoint
0052    */
0053   static bool isAdjoint(const ThePEG::PDT::Colour& pd) {
0054     return pd == PDT::Colour8;
0055   }
0056 
0057 };
0058 
0059 /**
0060  * ColourFlowBasis implements the colour flow basis.
0061  *
0062  * @see \ref ColourFlowBasisInterfaces "The interfaces"
0063  * defined for ColourFlowBasis.
0064  */
0065 class ColourFlowBasis: public Herwig::ColourBasis {
0066 
0067 public:
0068 
0069   /** @name Standard constructors and destructors. */
0070   //@{
0071   /**
0072    * The default constructor.
0073    */
0074   ColourFlowBasis();
0075 
0076   /**
0077    * The destructor.
0078    */
0079   virtual ~ColourFlowBasis();
0080   //@}
0081 
0082 public:
0083 
0084   /**
0085    * Clear this colour basis
0086    */
0087   virtual void clear();
0088 
0089   /**
0090    * Return a map of basis tensor indices to vectors identifying a
0091    * certain ordering corresponding to the given colour structure. May
0092    * not be supported by all colour basis implementations.
0093    */
0094   virtual map<size_t,vector<vector<size_t> > > basisList(const vector<PDT::Colour>&) const;
0095 
0096   /**
0097    * Prepare the basis for the normal ordered legs and return the
0098    * dimensionality of the basis.
0099    */
0100   virtual size_t prepareBasis(const vector<PDT::Colour>&);
0101 
0102   /**
0103    * Gather any implementation dependend details when reading a basis
0104    */
0105   virtual void readBasisDetails(const vector<PDT::Colour>&);
0106 
0107   /**
0108    * Return the scalar product of basis tensors labelled a and b in
0109    * the basis used for the given normal ordered legs.
0110    */
0111   virtual double scalarProduct(size_t a, size_t b,
0112                    const vector<PDT::Colour>& abBasis) const;
0113 
0114   /**
0115    * Return the matrix element of a colour charge
0116    * <c_{n+1,a}|T_i|c_{n,b}> between basis tensors a and b, with
0117    * respect to aBasis and bBasis
0118    */
0119   virtual double tMatrixElement(size_t i, size_t a, size_t b,
0120                 const vector<PDT::Colour>& aBasis,
0121                 const vector<PDT::Colour>& bBasis,
0122                 size_t k, size_t l,
0123                 const map<size_t,size_t>& dict) const;
0124 
0125   /**
0126    * Return true, if this colour basis supports gluon splittings.
0127    */
0128   virtual bool canSplitGluons() const {
0129     return false;
0130   }
0131 
0132   /**
0133    * Return the matrix element of a quark splitting matrix
0134    * <c_{n+1,a}|T_i|c_{n,b}> between basis tensors a and b, with
0135    * respect to aBasis and bBasis
0136    */
0137   virtual double sMatrixElement(size_t i, size_t a, size_t b,
0138                 const vector<PDT::Colour>& aBasis,
0139                 const vector<PDT::Colour>& bBasis,
0140                 size_t k, size_t l,
0141                 const map<size_t,size_t>& dict) const;
0142 
0143   /**
0144    * Return true, if the colour basis is capable of assigning colour
0145    * flows.
0146    */
0147   virtual bool haveColourFlows() const { return true; }
0148 
0149   /**
0150    * Return true, if a large-N colour connection exists for the
0151    * given external legs and basis tensor.
0152    */
0153   virtual bool colourConnected(const cPDVector&,
0154                    const vector<PDT::Colour>&,
0155                    const pair<int,bool>&, 
0156                    const pair<int,bool>&, 
0157                    size_t) const;
0158 
0159 public:
0160 
0161   /** @name Functions used by the persistent I/O system. */
0162   //@{
0163   /**
0164    * Function used to write out object persistently.
0165    * @param os the persistent output stream written to.
0166    */
0167   void persistentOutput(PersistentOStream & os) const;
0168 
0169   /**
0170    * Function used to read in object persistently.
0171    * @param is the persistent input stream read from.
0172    * @param version the version number of the object when written.
0173    */
0174   void persistentInput(PersistentIStream & is, int version);
0175   //@}
0176 
0177   /**
0178    * The standard Init function used to initialize the interfaces.
0179    * Called exactly once for each class by the class description system
0180    * before the main function starts or
0181    * when this class is dynamically loaded.
0182    */
0183   static void Init();
0184 
0185 protected:
0186 
0187   /** @name Clone Methods. */
0188   //@{
0189   /**
0190    * Make a simple clone of this object.
0191    * @return a pointer to the new object.
0192    */
0193   virtual IBPtr clone() const;
0194 
0195   /** Make a clone of this object, possibly modifying the cloned object
0196    * to make it sane.
0197    * @return a pointer to the new object.
0198    */
0199   virtual IBPtr fullclone() const;
0200   //@}
0201 
0202 
0203 // If needed, insert declarations of virtual function defined in the
0204 // InterfacedBase class here (using ThePEG-interfaced-decl in Emacs).
0205 
0206 private:
0207 
0208   /**
0209    * Map colour signatures to colour crossings
0210    */
0211   map<vector<PDT::Colour>,ColourFlowCrossing> theCrossings;
0212 
0213   /**
0214    * Colour flows indexed by basis size; note this is a unique
0215    * assignment
0216    */
0217   map<size_t,vector<ColourFlow> > theFlows;
0218 
0219 private:
0220 
0221   /**
0222    * The assignment operator is private and must never be called.
0223    * In fact, it should not even be implemented.
0224    */
0225   ColourFlowBasis & operator=(const ColourFlowBasis &) = delete;
0226 
0227 };
0228 
0229 }
0230 
0231 #endif /* CVOLVER_ColourFlowBasis_H */