Page MenuHomeHEPForge

No OneTemporary

diff --git a/MatrixElement/Matchbox/Utility/ColourBasis.cc b/MatrixElement/Matchbox/Utility/ColourBasis.cc
--- a/MatrixElement/Matchbox/Utility/ColourBasis.cc
+++ b/MatrixElement/Matchbox/Utility/ColourBasis.cc
@@ -1,1131 +1,1151 @@
// -*- C++ -*-
//
// ColourBasis.cc is a part of Herwig++ - A multi-purpose Monte Carlo event generator
// Copyright (C) 2002-2012 The Herwig Collaboration
//
// Herwig++ is licenced under version 2 of the GPL, see COPYING for details.
// Please respect the MCnet academic guidelines, see GUIDELINES for details.
//
//
// This is the implementation of the non-inlined, non-templated member
// functions of the ColourBasis class.
//
#include "ColourBasis.h"
#include "ThePEG/Interface/ClassDocumentation.h"
#include "ThePEG/Interface/Parameter.h"
#include "ThePEG/EventRecord/Particle.h"
#include "ThePEG/Repository/UseRandom.h"
#include "ThePEG/Repository/EventGenerator.h"
#include "ThePEG/Utilities/DescribeClass.h"
#include "ThePEG/Persistency/PersistentOStream.h"
#include "ThePEG/Persistency/PersistentIStream.h"
#include <boost/numeric/ublas/io.hpp>
#include <boost/numeric/ublas/matrix_proxy.hpp>
#include <iterator>
using std::ostream_iterator;
#include "DiagramDrawer.h"
using namespace Herwig;
using boost::numeric::ublas::trans;
using boost::numeric::ublas::conj;
using boost::numeric::ublas::row;
using boost::numeric::ublas::column;
using boost::numeric::ublas::prod;
ColourBasis::ColourBasis()
: theSearchPath("."),didRead(false), didWrite(false) {}
ColourBasis::~ColourBasis() {
for ( map<Ptr<Tree2toNDiagram>::tcptr,vector<ColourLines*> >::iterator cl =
theColourLineMap.begin(); cl != theColourLineMap.end(); ++cl ) {
for ( vector<ColourLines*>::iterator c = cl->second.begin();
c != cl->second.end(); ++c ) {
if ( *c )
delete *c;
}
}
theColourLineMap.clear();
}
// If needed, insert default implementations of virtual function defined
// in the InterfacedBase class here (using ThePEG-interfaced-impl in Emacs).
+bool ColourBasis::colourConnected(const cPDVector& sub,
+ const vector<PDT::Colour>& basis,
+ const pair<int,bool>& i,
+ const pair<int,bool>& j,
+ size_t a) const {
+
+ // translate process to basis ids
+ map<cPDVector,map<size_t,size_t> >::const_iterator trans
+ = indexMap().find(sub);
+ assert(trans != indexMap().end());
+
+ int idColoured = i.second ? j.first : i.first;
+ idColoured = trans->second.find(idColoured)->second;
+ int idAntiColoured = i.second ? i.first : j.first;
+ idAntiColoured = trans->second.find(idAntiColoured)->second;
+
+ return colourConnected(basis,idColoured,idAntiColoured,a);
+
+}
+
const string& ColourBasis::ordering(const cPDVector& sub,
const map<size_t,size_t>& colourToAmplitude,
size_t tensorId) {
const vector<PDT::Colour>& basis = normalOrderedLegs(sub);
map<size_t,string>& orderings = theOrderingIdentifiers[basis][colourToAmplitude];
if ( orderings.empty() ) {
map<size_t,vector<vector<size_t> > > tensors =
basisList(basis);
for ( map<size_t,vector<vector<size_t> > >::const_iterator t =
tensors.begin(); t != tensors.end(); ++t ) {
ostringstream oid;
for ( vector<vector<size_t> >::const_iterator s = t->second.begin();
s != t->second.end(); ++s ) {
oid << "[";
for ( vector<size_t>::const_iterator l = s->begin();
l != s->end(); ++l ) {
map<size_t,size_t>::const_iterator trans =
colourToAmplitude.find(*l);
assert(trans != colourToAmplitude.end());
oid << trans->second << (l != --(s->end()) ? "," : "");
}
oid << "]";
}
orderings[t->first] = oid.str();
}
}
return orderings[tensorId];
}
vector<PDT::Colour> ColourBasis::normalOrderMap(const cPDVector& sub) {
vector<PDT::Colour> allLegs = projectColour(sub);
vector<PDT::Colour> legs = normalOrder(allLegs);
if ( allLegs[0] == PDT::Colour3 )
allLegs[0] = PDT::Colour3bar;
else if ( allLegs[0] == PDT::Colour3bar )
allLegs[0] = PDT::Colour3;
if ( allLegs[1] == PDT::Colour3 )
allLegs[1] = PDT::Colour3bar;
else if ( allLegs[1] == PDT::Colour3bar )
allLegs[1] = PDT::Colour3;
if ( theIndexMap.find(sub) == theIndexMap.end() ) {
map<size_t,size_t> trans;
vector<PDT::Colour> checkLegs = legs;
size_t n = checkLegs.size();
for ( size_t i = 0; i < allLegs.size(); ++i ) {
size_t j = 0;
while ( checkLegs[j] != allLegs[i] ) {
++j; if ( j == n ) break;
}
if ( j == n ) continue;
trans[i] = j;
checkLegs[j] = PDT::ColourUndefined;
}
theIndexMap[sub] = trans;
}
return legs;
}
const vector<PDT::Colour>& ColourBasis::normalOrderedLegs(const cPDVector& sub) const {
static vector<PDT::Colour> empty;
map<cPDVector,vector<PDT::Colour> >::const_iterator n =
theNormalOrderedLegs.find(sub);
if ( n != theNormalOrderedLegs.end() )
return n->second;
return empty;
}
size_t ColourBasis::prepare(const cPDVector& sub,
bool noCorrelations) {
vector<PDT::Colour> legs = normalOrderMap(sub);
bool doPrepare = false;
if ( theNormalOrderedLegs.find(sub) == theNormalOrderedLegs.end() )
theNormalOrderedLegs[sub] = legs;
if ( theScalarProducts.find(legs) == theScalarProducts.end() )
doPrepare = true;
if ( doPrepare )
doPrepare = !readBasis(legs);
size_t dim = doPrepare ? prepareBasis(legs) : theScalarProducts[legs].size1();
if ( theCharges.find(legs) != theCharges.end() )
return dim;
if ( !doPrepare && noCorrelations )
return dim;
symmetric_matrix<double,upper>& sp =
theScalarProducts.insert(make_pair(legs,symmetric_matrix<double,upper>(dim,dim))).first->second;
for ( size_t a = 0; a < dim; ++a )
for ( size_t b = a; b < dim; ++b )
sp(a,b) = scalarProduct(a,b,legs);
if ( noCorrelations )
return dim;
vector<PDT::Colour> legsPlus = legs;
legsPlus.push_back(PDT::Colour8);
legsPlus = normalOrder(legsPlus);
bool doPreparePlus = theScalarProducts.find(legsPlus) == theScalarProducts.end();
size_t dimPlus = doPreparePlus ? prepareBasis(legsPlus) : theScalarProducts[legsPlus].size1();
symmetric_matrix<double,upper>& spPlus =
doPreparePlus ?
theScalarProducts.insert(make_pair(legsPlus,symmetric_matrix<double,upper>(dimPlus,dimPlus))).first->second :
theScalarProducts[legsPlus];
if ( doPreparePlus ) {
for ( size_t a = 0; a < dimPlus; ++a )
for ( size_t b = a; b < dimPlus; ++b )
spPlus(a,b) = scalarProduct(a,b,legsPlus);
}
typedef map<size_t,compressed_matrix<double> > cMap;
cMap& cm = theCharges.insert(make_pair(legs,cMap())).first->second;
typedef map<size_t,vector<pair<size_t,size_t> > > ccMap;
ccMap& ccm = theChargeNonZeros.insert(make_pair(legs,ccMap())).first->second;
tmp.resize(dimPlus,dim);
for ( size_t i = 0; i < legs.size(); ++i ) {
size_t nonZero = 0;
vector<pair<size_t,size_t> > nonZeros;
for ( size_t a = 0; a < dimPlus; ++a )
for ( size_t b = 0; b < dim; ++b ) {
tmp(a,b) = tMatrixElement(i,a,b,legsPlus,legs);
if ( tmp(a,b) != 0. ) {
++nonZero;
nonZeros.push_back(make_pair(a,b));
}
}
ccm.insert(make_pair(i,nonZeros));
compressed_matrix<double>& tm =
cm.insert(make_pair(i,compressed_matrix<double>(dimPlus,dim,nonZero))).first->second;
for ( size_t a = 0; a < dimPlus; ++a )
for ( size_t b = 0; b < dim; ++b ) {
if ( tmp(a,b) != 0. )
tm(a,b) = tmp(a,b);
}
}
map<pair<size_t,size_t>,symmetric_matrix<double,upper> >& xm = theCorrelators[legs];
for ( size_t i = 0; i < legs.size(); ++i )
for ( size_t j = i+1; j < legs.size(); ++j ) {
symmetric_matrix<double,upper>& mm =
xm.insert(make_pair(make_pair(i,j),symmetric_matrix<double,upper>(dim,dim))).first->second;
chargeProduct(cm[i],ccm[i],spPlus,cm[j],ccm[j],mm);
}
return dim;
}
void ColourBasis::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 {
for ( size_t i = 0; i < result.size1(); ++i )
for ( size_t j = i; j < result.size1(); ++j )
result(i,j) = 0.;
for ( vector<pair<size_t,size_t> >::const_iterator i = tiNonZero.begin();
i != tiNonZero.end(); ++i )
for ( vector<pair<size_t,size_t> >::const_iterator j = tjNonZero.begin();
j != tjNonZero.end(); ++j ) {
if ( j->second < i->second )
continue;
result(i->second,j->second) +=
ti(i->first,i->second)*tj(j->first,j->second)*X(i->first,j->first);
}
}
void ColourBasis::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) const {
for ( vector<pair<size_t,size_t> >::const_iterator i = tiNonZero.begin();
i != tiNonZero.end(); ++i )
for ( vector<pair<size_t,size_t> >::const_iterator j = tjNonZero.begin();
j != tjNonZero.end(); ++j ) {
result(i->first,j->first) += factor*
ti(i->first,i->second)*tj(j->first,j->second)*X(i->second,j->second);
}
}
string ColourBasis::cfstring(const list<list<pair<int,bool> > >& flow) {
ostringstream out("");
for ( list<list<pair<int,bool> > >::const_iterator line =
flow.begin(); line != flow.end(); ++line ) {
for ( list<pair<int,bool> >::const_iterator node =
line->begin(); node != line->end(); ++node ) {
out << (node->second ? "-" : "") << (node->first+1) << " ";
}
if ( line != --(flow.end()) )
out << ", ";
}
return out.str();
}
vector<string> ColourBasis::makeFlows(Ptr<Tree2toNDiagram>::tcptr diag,
size_t dim) const {
vector<string> res(dim);
list<list<list<pair<int,bool> > > > fdata =
colourFlows(diag);
cPDVector ext;
tcPDVector dext = diag->external();
copy(dext.begin(),dext.end(),back_inserter(ext));
vector<PDT::Colour> colouredLegs =
normalOrder(projectColour(ext));
for ( list<list<list<pair<int,bool> > > >::const_iterator flow =
fdata.begin(); flow != fdata.end(); ++flow ) {
for ( size_t i = 0; i < dim; ++i ) {
bool matches = true;
for ( list<list<pair<int,bool> > >::const_iterator line =
flow->begin(); line != flow->end(); ++line ) {
pair<int,bool> front(diag->externalId(line->front().first),line->front().second);
if ( front.first < 2 )
front.second = !front.second;
pair<int,bool> back(diag->externalId(line->back().first),line->back().second);
if ( back.first < 2 )
back.second = !back.second;
if ( !colourConnected(ext,colouredLegs,front,back,i) ) {
matches = false;
break;
}
}
if ( matches ) {
res[i] = cfstring(*flow);
}
}
}
bool gotone = false;
for ( vector<string>::const_iterator f = res.begin();
f != res.end(); ++f ) {
if ( *f != "" ) {
gotone = true;
break;
}
}
if ( !gotone ) {
generator()->log() << "warning no color flow found for diagram\n";
DiagramDrawer::drawDiag(generator()->log(),*diag);
}
return res;
}
size_t ColourBasis::prepare(const MEBase::DiagramVector& diags,
bool noCorrelations) {
size_t dim = 0;
for ( MEBase::DiagramVector::const_iterator d = diags.begin();
d != diags.end(); ++d ) {
Ptr<Tree2toNDiagram>::tcptr dd = dynamic_ptr_cast<Ptr<Tree2toNDiagram>::ptr>(*d);
assert(dd);
dim = prepare(dd->partons(),noCorrelations);
if ( !haveColourFlows() || theFlowMap.find(dd) != theFlowMap.end() )
continue;
theFlowMap[dd] = makeFlows(dd,dim);
}
return dim;
}
bool matchEnd(int a, pair<int,bool> b,
Ptr<Tree2toNDiagram>::tcptr diag) {
if ( a != b.first )
return false;
if ( b.first != diag->nSpace()-1 ) {
return
!b.second ?
diag->allPartons()[b.first]->hasColour() :
diag->allPartons()[b.first]->hasAntiColour();
} else {
return
!b.second ?
diag->allPartons()[b.first]->hasAntiColour() :
diag->allPartons()[b.first]->hasColour();
}
return false;
}
bool findPath(pair<int,bool> a, pair<int,bool> b,
Ptr<Tree2toNDiagram>::tcptr diag,
list<pair<int,bool> >& path,
bool backward) {
assert(a.first==0 ? !backward : true);
if ( path.empty() )
path.push_back(a);
if ( !backward ) {
if ( diag->children(a.first).first == -1 )
return matchEnd(a.first,b,diag);
pair<int,int> children = diag->children(a.first);
bool cc = (children.first == diag->nSpace()-1);
if ( diag->allPartons()[children.first]->coloured() )
if ( !cc ?
(!a.second ?
diag->allPartons()[children.first]->hasColour() :
diag->allPartons()[children.first]->hasAntiColour()) :
(!a.second ?
diag->allPartons()[children.first]->hasAntiColour() :
diag->allPartons()[children.first]->hasColour()) ) {
pair<int,bool> next(children.first,a.second);
path.push_back(next);
if ( !findPath(next,b,diag,path,false) ) {
path.pop_back();
} else return true;
}
cc = (children.second == diag->nSpace()-1);
if ( diag->allPartons()[children.second]->coloured() )
if ( !cc ?
(!a.second ?
diag->allPartons()[children.second]->hasColour() :
diag->allPartons()[children.second]->hasAntiColour()) :
(!a.second ?
diag->allPartons()[children.second]->hasAntiColour() :
diag->allPartons()[children.second]->hasColour()) ) {
pair<int,bool> next(children.second,a.second);
path.push_back(next);
if ( !findPath(next,b,diag,path,false) ) {
path.pop_back();
} else return true;
}
if ( path.size() == 1 )
path.pop_back();
return false;
} else {
int parent = diag->parent(a.first);
pair<int,int> neighbours = diag->children(parent);
int neighbour = a.first == neighbours.first ? neighbours.second : neighbours.first;
if ( matchEnd(parent,b,diag) ) {
path.push_back(b);
return true;
}
if ( matchEnd(neighbour,b,diag) ) {
path.push_back(b);
return true;
}
if ( diag->allPartons()[neighbour]->coloured() )
if ( a.second ?
diag->allPartons()[neighbour]->hasColour() :
diag->allPartons()[neighbour]->hasAntiColour() ) {
pair<int,bool> next(neighbour,!a.second);
path.push_back(next);
if ( !findPath(next,b,diag,path,false) ) {
path.pop_back();
} else return true;
}
if ( parent == 0 ) {
if ( path.size() == 1 )
path.pop_back();
return false;
}
if ( diag->allPartons()[parent]->coloured() )
if ( !a.second ?
diag->allPartons()[parent]->hasColour() :
diag->allPartons()[parent]->hasAntiColour() ) {
pair<int,bool> next(parent,a.second);
path.push_back(next);
if ( !findPath(next,b,diag,path,true) ) {
path.pop_back();
} else return true;
}
if ( path.size() == 1 )
path.pop_back();
return false;
}
return false;
}
list<pair<int,bool> > ColourBasis::colouredPath(pair<int,bool> a, pair<int,bool> b,
Ptr<Tree2toNDiagram>::tcptr diag) {
list<pair<int,bool> > res;
if ( a.first == b.first )
return res;
bool aIn = (a.first < 2);
bool bIn = (b.first < 2);
if ( (aIn && bIn) || (!aIn && !bIn) )
if ( (a.second && b.second) ||
(!a.second && !b.second) )
return res;
if ( (aIn && !bIn) || (!aIn && bIn) )
if ( (!a.second && b.second) ||
(a.second && !b.second) )
return res;
if ( a.first > b.first )
swap(a,b);
a.first = diag->diagramId(a.first);
b.first = diag->diagramId(b.first);
if ( a.first == diag->nSpace()-1 )
a.second = !a.second;
if ( b.first == diag->nSpace()-1 )
b.second = !b.second;
if ( !findPath(a,b,diag,res,a.first != 0) )
return res;
if ( b.first == diag->nSpace()-1 ) {
res.back().second = !res.back().second;
}
if ( a.first == diag->nSpace()-1 ) {
res.front().second = !res.front().second;
}
return res;
}
list<list<list<pair<int,bool> > > >
ColourBasis::colourFlows(Ptr<Tree2toNDiagram>::tcptr diag) {
vector<pair<int,bool> > connectSource;
vector<pair<int,bool> > connectSink;
for ( size_t i = 0; i != diag->partons().size(); ++i ) {
if ( i < 2 && diag->partons()[i]->hasAntiColour() )
connectSource.push_back(make_pair(i,true));
if ( i < 2 && diag->partons()[i]->hasColour() )
connectSink.push_back(make_pair(i,false));
if ( i > 1 && diag->partons()[i]->hasColour() )
connectSource.push_back(make_pair(i,false));
if ( i > 1 && diag->partons()[i]->hasAntiColour() )
connectSink.push_back(make_pair(i,true));
}
assert(connectSource.size() == connectSink.size());
list<list<list<pair<int,bool> > > > ret;
do {
vector<pair<int,bool> >::iterator source =
connectSource.begin();
vector<pair<int,bool> >::iterator sink =
connectSink.begin();
list<list<pair<int,bool> > > res;
for ( ; source != connectSource.end(); ++source, ++sink ) {
if ( source->first == sink->first ) {
res.clear();
break;
}
list<pair<int,bool> > line =
colouredPath(*source,*sink,diag);
if ( line.empty() ) {
res.clear();
break;
}
res.push_back(line);
}
if ( !res.empty() ) {
// check, if all dressed properly
vector<pair<int,int> > dressed((*diag).allPartons().size(),make_pair(0,0));
for ( size_t p = 0; p < diag->allPartons().size(); ++p ) {
if ( diag->allPartons()[p]->hasColour() &&
!diag->allPartons()[p]->hasAntiColour() )
dressed[p].first = 1;
if ( diag->allPartons()[p]->hasAntiColour() &&
!diag->allPartons()[p]->hasColour() )
dressed[p].second = 1;
if ( diag->allPartons()[p]->hasAntiColour() &&
diag->allPartons()[p]->hasColour() ) {
dressed[p].first = 1; dressed[p].second = 1;
}
}
for ( list<list<pair<int,bool> > >::const_iterator l = res.begin();
l != res.end(); ++l ) {
for ( list<pair<int,bool> >::const_iterator n = l->begin();
n != l->end(); ++n ) {
if ( !(n->second) )
dressed[n->first].first -= 1;
else
dressed[n->first].second -= 1;
}
}
for ( vector<pair<int,int> >::const_iterator d = dressed.begin();
d != dressed.end(); ++d ) {
if ( d->first != 0 || d->second != 0 ) {
res.clear();
break;
}
}
if ( !res.empty() )
ret.push_back(res);
}
} while ( std::next_permutation(connectSink.begin(),connectSink.end()) );
return ret;
}
map<Ptr<Tree2toNDiagram>::tcptr,vector<ColourLines*> >&
ColourBasis::colourLineMap() {
if ( !theColourLineMap.empty() )
return theColourLineMap;
for ( map<Ptr<Tree2toNDiagram>::tcptr,vector<string> >::const_iterator cl =
theFlowMap.begin(); cl != theFlowMap.end(); ++cl ) {
vector<ColourLines*> clines(cl->second.size());
for ( size_t k = 0; k < cl->second.size(); ++k ) {
if ( cl->second[k] == "" ) {
clines[k] = 0;
continue;
}
clines[k] = new ColourLines(cl->second[k]);
}
theColourLineMap[cl->first] = clines;
}
return theColourLineMap;
}
Selector<const ColourLines *> ColourBasis::colourGeometries(tcDiagPtr diag,
const map<vector<int>,CVector>& amps) {
Ptr<Tree2toNDiagram>::tcptr dd =
dynamic_ptr_cast<Ptr<Tree2toNDiagram>::tcptr>(diag);
assert(dd && theFlowMap.find(dd) != theFlowMap.end());
const vector<ColourLines*>& cl = colourLineMap()[dd];
Selector<const ColourLines *> sel;
size_t dim = amps.begin()->second.size();
assert(dim == cl.size());
double w = 0.;
for ( size_t i = 0; i < dim; ++i ) {
if ( !cl[i] )
continue;
w = 0.;
for ( map<vector<int>,CVector>::const_iterator a = amps.begin();
a != amps.end(); ++a )
w += real(conj((a->second)(i))*((a->second)(i)));
if ( w > 0. )
sel.insert(w,cl[i]);
}
assert(!sel.empty());
return sel;
}
const symmetric_matrix<double,upper>& ColourBasis::scalarProducts(const cPDVector& sub) const {
map<cPDVector,vector<PDT::Colour> >::const_iterator lit =
theNormalOrderedLegs.find(sub);
assert(lit != theNormalOrderedLegs.end());
ScalarProductMap::const_iterator spit =
theScalarProducts.find(lit->second);
assert(spit != theScalarProducts.end());
return spit->second;
}
const compressed_matrix<double>& ColourBasis::charge(const cPDVector& sub, size_t iIn) const {
map<cPDVector,vector<PDT::Colour> >::const_iterator lit =
theNormalOrderedLegs.find(sub);
assert(lit != theNormalOrderedLegs.end());
ChargeMap::const_iterator ct =
theCharges.find(lit->second);
assert(ct != theCharges.end());
map<cPDVector,map<size_t,size_t> >::const_iterator trans
= theIndexMap.find(sub);
assert(trans != theIndexMap.end());
size_t i = trans->second.find(iIn)->second;
map<size_t,compressed_matrix<double> >::const_iterator cit
= ct->second.find(i);
assert(cit != ct->second.end());
return cit->second;
}
const vector<pair<size_t,size_t> >& ColourBasis::chargeNonZero(const cPDVector& sub, size_t iIn) const {
map<cPDVector,vector<PDT::Colour> >::const_iterator lit =
theNormalOrderedLegs.find(sub);
assert(lit != theNormalOrderedLegs.end());
ChargeNonZeroMap::const_iterator ct =
theChargeNonZeros.find(lit->second);
assert(ct != theChargeNonZeros.end());
map<cPDVector,map<size_t,size_t> >::const_iterator trans
= theIndexMap.find(sub);
assert(trans != theIndexMap.end());
size_t i = trans->second.find(iIn)->second;
map<size_t,vector<pair<size_t,size_t> > >::const_iterator cit
= ct->second.find(i);
assert(cit != ct->second.end());
return cit->second;
}
const symmetric_matrix<double,upper>& ColourBasis::correlator(const cPDVector& sub,
const pair<size_t,size_t>& ijIn) const {
map<cPDVector,vector<PDT::Colour> >::const_iterator lit =
theNormalOrderedLegs.find(sub);
assert(lit != theNormalOrderedLegs.end());
CorrelatorMap::const_iterator cit =
theCorrelators.find(lit->second);
assert(cit != theCorrelators.end());
map<cPDVector,map<size_t,size_t> >::const_iterator trans
= theIndexMap.find(sub);
assert(trans != theIndexMap.end());
pair<size_t,size_t> ij(trans->second.find(ijIn.first)->second,
trans->second.find(ijIn.second)->second);
if ( ij.first > ij.second )
swap(ij.first,ij.second);
map<pair<size_t,size_t>,symmetric_matrix<double,upper> >::const_iterator cijit
= cit->second.find(ij);
assert(cijit != cit->second.end());
return cijit->second;
}
double ColourBasis::me2(const cPDVector& sub,
const map<vector<int>,CVector>& amps) const {
const symmetric_matrix<double,upper>& sp = scalarProducts(sub);
double res = 0.;
for ( map<vector<int>,CVector>::const_iterator a = amps.begin();
a != amps.end(); ++a ) {
res += real(inner_prod(conj(a->second),prod(sp,a->second)));
}
return res;
}
double ColourBasis::interference(const cPDVector& sub,
const map<vector<int>,CVector>& amps1,
const map<vector<int>,CVector>& amps2) const {
const symmetric_matrix<double,upper>& sp = scalarProducts(sub);
double res = 0.;
map<vector<int>,CVector>::const_iterator a = amps1.begin();
map<vector<int>,CVector>::const_iterator b = amps2.begin();
for ( ; a != amps1.end(); ++a, ++b ) {
assert(a->first == b->first);
res += 2.*real(inner_prod(conj(a->second),prod(sp,b->second)));
}
assert(!isnan(res));
return res;
}
double ColourBasis::colourCorrelatedME2(const pair<size_t,size_t>& ij,
const cPDVector& sub,
const map<vector<int>,CVector>& amps) const {
const symmetric_matrix<double,upper>& cij = correlator(sub,ij);
double res = 0.;
for ( map<vector<int>,CVector>::const_iterator a = amps.begin();
a != amps.end(); ++a ) {
res += real(inner_prod(conj(a->second),prod(cij,a->second)));
}
return res;
}
Complex ColourBasis::interference(const cPDVector& sub,
const CVector& left,
const CVector& right) const {
const symmetric_matrix<double,upper>& sp = scalarProducts(sub);
return inner_prod(conj(left),prod(sp,right));
}
Complex ColourBasis::colourCorrelatedInterference(const pair<size_t,size_t>& ij,
const cPDVector& sub,
const CVector& left,
const CVector& right) const {
const symmetric_matrix<double,upper>& cij = correlator(sub,ij);
return inner_prod(conj(left),prod(cij,right));
}
double ColourBasis::me2(const cPDVector& sub,
const matrix<Complex>& amp) const {
const symmetric_matrix<double,upper>& sp = scalarProducts(sub);
double tr = 0;
size_t n = amp.size1();
for ( size_t i = 0; i < n; ++i ) {
tr += real(inner_prod(row(sp,i),column(amp,i)));
}
return tr;
}
double ColourBasis::colourCorrelatedME2(const pair<size_t,size_t>& ij,
const cPDVector& sub,
const matrix<Complex>& amp) const {
const symmetric_matrix<double,upper>& cij = correlator(sub,ij);
double tr = 0;
size_t n = amp.size1();
for ( size_t i = 0; i < n; ++i ) {
tr += real(inner_prod(row(cij,i),column(amp,i)));
}
return tr;
}
struct pickColour {
PDT::Colour operator()(tcPDPtr p) const {
return p->iColour();
}
};
vector<PDT::Colour> ColourBasis::projectColour(const cPDVector& sub) const {
vector<PDT::Colour> res(sub.size());
transform(sub.begin(),sub.end(),res.begin(),pickColour());
return res;
}
vector<PDT::Colour> ColourBasis::normalOrder(const vector<PDT::Colour>& legs) const {
vector<PDT::Colour> crosslegs = legs;
if ( crosslegs[0] == PDT::Colour3 )
crosslegs[0] = PDT::Colour3bar;
else if ( crosslegs[0] == PDT::Colour3bar )
crosslegs[0] = PDT::Colour3;
if ( crosslegs[1] == PDT::Colour3 )
crosslegs[1] = PDT::Colour3bar;
else if ( crosslegs[1] == PDT::Colour3bar )
crosslegs[1] = PDT::Colour3;
int n3 = count_if(crosslegs.begin(),crosslegs.end(),matchRep(PDT::Colour3));
int n8 = count_if(crosslegs.begin(),crosslegs.end(),matchRep(PDT::Colour8));
vector<PDT::Colour> ordered(2*n3+n8,PDT::Colour8);
int i = 0;
while ( i < 2*n3 ) {
ordered[i] = PDT::Colour3;
ordered[i+1] = PDT::Colour3bar;
i+=2;
}
return ordered;
}
string ColourBasis::file(const vector<PDT::Colour>& sub) const {
string res = "";
for ( vector<PDT::Colour>::const_iterator lit = sub.begin();
lit != sub.end(); ++lit ) {
if ( *lit == PDT::Colour3 )
res += "3";
if ( *lit == PDT::Colour3bar )
res += "3bar";
if ( *lit == PDT::Colour8 )
res += "8";
}
if ( largeN() )
res += "largeN";
return res;
}
void ColourBasis::writeBasis(const string& prefix) const {
if ( didWrite )
return;
set<vector<PDT::Colour> > legs;
for ( map<cPDVector,vector<PDT::Colour> >::const_iterator lit
= theNormalOrderedLegs.begin(); lit != theNormalOrderedLegs.end(); ++lit ) {
legs.insert(lit->second);
}
string searchPath = theSearchPath;
if ( searchPath != "" )
if ( *(--searchPath.end()) != '/' )
searchPath += "/";
for ( set<vector<PDT::Colour> >::const_iterator known = legs.begin();
known != legs.end(); ++known ) {
string fname = searchPath + prefix + file(*known) + ".cdat";
ifstream check(fname.c_str());
if ( check ) continue;
ofstream out(fname.c_str());
if ( !out )
throw Exception() << "ColourBasis failed to open "
<< fname << " for storing colour basis information."
<< Exception::abortnow;
out << setprecision(18);
const symmetric_matrix<double,upper>& sp =
theScalarProducts.find(*known)->second;
write(sp,out);
if ( theCharges.find(*known) != theCharges.end() ) {
out << "#charges\n";
const map<size_t,compressed_matrix<double> >& tm =
theCharges.find(*known)->second;
const map<size_t,vector<pair<size_t,size_t> > >& tc =
theChargeNonZeros.find(*known)->second;
map<size_t,vector<pair<size_t,size_t> > >::const_iterator kc =
tc.begin();
for ( map<size_t,compressed_matrix<double> >::const_iterator k = tm.begin();
k != tm.end(); ++k, ++kc ) {
out << k->first << "\n";
write(k->second,out,kc->second);
}
const map<pair<size_t,size_t>,symmetric_matrix<double,upper> >& cm =
theCorrelators.find(*known)->second;
for ( map<pair<size_t,size_t>,symmetric_matrix<double,upper> >::const_iterator k =
cm.begin(); k != cm.end(); ++k ) {
out << k->first.first << "\n" << k->first.second << "\n";
write(k->second,out);
}
} else {
out << "#nocharges\n";
}
out << flush;
}
didWrite = true;
}
bool ColourBasis::readBasis(const vector<PDT::Colour>& legs) {
string searchPath = theSearchPath;
if ( searchPath != "" )
if ( *(--searchPath.end()) != '/' )
searchPath += "/";
string fname = searchPath + file(legs) + ".cdat";
ifstream in(fname.c_str());
if ( !in )
return false;
read(theScalarProducts[legs],in);
string tag; in >> tag;
if ( tag != "#nocharges" ) {
for ( size_t k = 0; k < legs.size(); ++k ) {
size_t i; in >> i;
read(theCharges[legs][i],in,theChargeNonZeros[legs][i]);
}
for ( size_t k = 0; k < legs.size()*(legs.size()-1)/2; ++k ) {
size_t i,j; in >> i >> j;
read(theCorrelators[legs][make_pair(i,j)],in);
}
}
readBasisDetails(legs);
return true;
}
void ColourBasis::readBasis() {
if ( didRead )
return;
string searchPath = theSearchPath;
if ( searchPath != "" )
if ( *(--searchPath.end()) != '/' )
searchPath += "/";
set<vector<PDT::Colour> > legs;
for ( map<cPDVector,vector<PDT::Colour> >::const_iterator lit
= theNormalOrderedLegs.begin(); lit != theNormalOrderedLegs.end(); ++lit )
legs.insert(lit->second);
for ( set<vector<PDT::Colour> >::const_iterator known = legs.begin();
known != legs.end(); ++known ) {
if ( theScalarProducts.find(*known) != theScalarProducts.end() )
continue;
string fname = searchPath + file(*known) + ".cdat";
if ( !readBasis(*known) )
throw Exception() << "ColourBasis failed to open "
<< fname << " for reading colour basis information."
<< Exception::abortnow;
}
didRead = true;
}
void ColourBasis::write(const symmetric_matrix<double,upper>& m, ostream& os) const {
os << m.size1() << "\n";
for ( size_t i = 0; i < m.size1(); ++i )
for ( size_t j = i; j < m.size1(); ++j )
os << m(i,j) << "\n";
os << flush;
}
void ColourBasis::read(symmetric_matrix<double,upper>& m, istream& is) {
size_t s; is >> s;
m.resize(s);
for ( size_t i = 0; i < m.size1(); ++i )
for ( size_t j = i; j < m.size1(); ++j )
is >> m(i,j);
}
void ColourBasis::write(const compressed_matrix<double>& m, ostream& os,
const vector<pair<size_t,size_t> >& nonZeros) const {
os << nonZeros.size() << "\n"
<< m.size1() << "\n"
<< m.size2() << "\n";
for ( vector<pair<size_t,size_t> >::const_iterator nz = nonZeros.begin();
nz != nonZeros.end(); ++nz )
os << nz->first << "\n" << nz->second << "\n"
<< m(nz->first,nz->second) << "\n";
os << flush;
}
void ColourBasis::read(compressed_matrix<double>& m, istream& is,
vector<pair<size_t,size_t> >& nonZeros) {
size_t nonZero, size1, size2;
is >> nonZero >> size1 >> size2;
nonZeros.resize(nonZero);
m = compressed_matrix<double>(size1,size2,nonZero);
for ( size_t k = 0; k < nonZero; ++k ) {
size_t i,j; double val;
is >> i >> j >> val;
nonZeros[k] = make_pair(i,j);
m(i,j) = val;
}
}
void ColourBasis::doinit() {
HandlerBase::doinit();
readBasis();
}
void ColourBasis::dofinish() {
HandlerBase::dofinish();
writeBasis();
}
void ColourBasis::doinitrun() {
HandlerBase::doinitrun();
readBasis();
}
void ColourBasis::persistentOutput(PersistentOStream & os) const {
os << theSearchPath << theNormalOrderedLegs
<< theIndexMap << theFlowMap << theOrderingIdentifiers;
writeBasis();
}
void ColourBasis::persistentInput(PersistentIStream & is, int) {
is >> theSearchPath >> theNormalOrderedLegs
>> theIndexMap >> theFlowMap >> theOrderingIdentifiers;
}
// *** Attention *** The following static variable is needed for the type
// description system in ThePEG. Please check that the template arguments
// are correct (the class and its base class), and that the constructor
// arguments are correct (the class name and the name of the dynamically
// loadable library where the class implementation can be found).
DescribeAbstractClass<ColourBasis,HandlerBase>
describeColourBasis("Herwig::ColourBasis", "HwMatchbox.so");
void ColourBasis::Init() {
static ClassDocumentation<ColourBasis> documentation
("ColourBasis is an interface to a colour basis "
"implementation.");
static Parameter<ColourBasis,string> interfaceSearchPath
("SearchPath",
"Set the search path for pre-computed colour basis data.",
&ColourBasis::theSearchPath, ".",
false, false);
}
diff --git a/MatrixElement/Matchbox/Utility/ColourBasis.h b/MatrixElement/Matchbox/Utility/ColourBasis.h
--- a/MatrixElement/Matchbox/Utility/ColourBasis.h
+++ b/MatrixElement/Matchbox/Utility/ColourBasis.h
@@ -1,518 +1,525 @@
// -*- C++ -*-
//
// ColourBasis.h is a part of Herwig++ - A multi-purpose Monte Carlo event generator
// Copyright (C) 2002-2012 The Herwig Collaboration
//
// Herwig++ is licenced under version 2 of the GPL, see COPYING for details.
// Please respect the MCnet academic guidelines, see GUIDELINES for details.
//
#ifndef HERWIG_ColourBasis_H
#define HERWIG_ColourBasis_H
//
// This is the declaration of the ColourBasis class.
//
#include "ThePEG/Handlers/HandlerBase.h"
#include "ThePEG/MatrixElement/Tree2toNDiagram.h"
#include "ThePEG/MatrixElement/MEBase.h"
#include <boost/numeric/ublas/matrix.hpp>
#include <boost/numeric/ublas/matrix_sparse.hpp>
#include <boost/numeric/ublas/symmetric.hpp>
#include <boost/numeric/ublas/vector.hpp>
#include <iterator>
namespace Herwig {
using std::iterator_traits;
using std::distance;
using namespace ThePEG;
using boost::numeric::ublas::matrix;
using boost::numeric::ublas::symmetric_matrix;
using boost::numeric::ublas::compressed_matrix;
using boost::numeric::ublas::upper;
/**
* \ingroup Matchbox
* \author Simon Platzer
*
* \brief Define compolex vector from boost::uBLAS
*
*/
typedef boost::numeric::ublas::vector<Complex> CVector;
/**
* \ingroup Matchbox
* \author Simon Platzer
*
* \brief ColourBasis is an interface to a colour basis
* implementation.
*
*/
class ColourBasis: public HandlerBase {
public:
/** @name Standard constructors and destructors. */
//@{
/**
* The default constructor.
*/
ColourBasis();
/**
* The destructor.
*/
virtual ~ColourBasis();
//@}
public:
/**
* Prepare for the given sub process and return the basis
* dimensionality.
*/
size_t prepare(const cPDVector&, bool);
/**
* Prepare for the given diagrams.
*/
size_t prepare(const MEBase::DiagramVector&, bool);
/**
* Return the index map.
*/
const map<cPDVector,map<size_t,size_t> >& indexMap() const { return theIndexMap; }
/**
* 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.
*/
virtual map<size_t,vector<vector<size_t> > > basisList(const vector<PDT::Colour>&) const {
return map<size_t,vector<vector<size_t> > >();
}
/**
* 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.
*/
const string& ordering(const cPDVector& sub,
const map<size_t,size_t>& colourToAmplitude,
size_t tensorId);
/**
* For the given subprocess and amplitude vectors
* calculate the amplitude squared.
*/
double me2(const cPDVector&, const map<vector<int>,CVector>&) const;
/**
* For the given subprocess and amplitude vectors
* calculate the interference.
*/
double interference(const cPDVector&,
const map<vector<int>,CVector>&,
const map<vector<int>,CVector>&) const;
/**
* For the given subprocess and amplitude vector
* calculate the colour correlated amplitude.
*/
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 amplitude squared.
*/
Complex interference(const cPDVector&,
const CVector&, const CVector&) const;
/**
* For the given subprocess and amplitude vector
* calculate the colour correlated amplitude.
*/
Complex colourCorrelatedInterference(const pair<size_t,size_t>&,
const cPDVector&,
const CVector&, const CVector&) const;
/**
* For the given subprocess and amplitude given as amp amp^\dagger
* calculate the amplitude squared.
*/
double me2(const cPDVector&, const matrix<Complex>&) const;
/**
* For the given subprocess and amplitude given as amp amp^\dagger
* calculate the colour correlated amplitude.
*/
double colourCorrelatedME2(const pair<size_t,size_t>&,
const cPDVector&,
const matrix<Complex>&) const;
/**
* Return the scalar product matrix for the given process.
*/
const symmetric_matrix<double,upper>& scalarProducts(const cPDVector&) const;
/**
* Return the matrix representation of a colour charge.
*/
const compressed_matrix<double>& charge(const cPDVector&, size_t) const;
/**
* Return the non-vanishing elements of a colour charge.
*/
const vector<pair<size_t,size_t> >& chargeNonZero(const cPDVector&, size_t) const;
/**
* Return the correlator matrix for the given process.
*/
const symmetric_matrix<double,upper>& correlator(const cPDVector&,
const pair<size_t,size_t>&) const;
/**
* Return true, if the colour basis is capable of assigning colour
* flows.
*/
virtual bool haveColourFlows() const { return false; }
/**
* Return a Selector with possible colour geometries for the selected
* diagram weighted by their relative probabilities.
*/
Selector<const ColourLines *> colourGeometries(tcDiagPtr diag,
const map<vector<int>,CVector>& amps);
/**
* Match colour representation.
*/
struct matchRep {
PDT::Colour m;
matchRep(PDT::Colour n)
: m(n) {}
bool operator()(PDT::Colour c) const {
return c == m;
}
};
/**
* Return true, if this basis is running in large-N mode
*/
virtual bool largeN() const { return false; }
/**
* Convert particle data to colour information
*/
vector<PDT::Colour> projectColour(const cPDVector&) const;
/**
* 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.
*/
virtual vector<PDT::Colour> normalOrder(const vector<PDT::Colour>&) const;
/**
* Determine the mapping of process to colour indices and return the
* normal ordered vector of colour indices
*/
vector<PDT::Colour> normalOrderMap(const cPDVector& sub);
/**
* Get the normal ordered legs
*/
const vector<PDT::Colour>& normalOrderedLegs(const cPDVector& sub) const;
/**
* Convert the legs to a string.
*/
string file(const vector<PDT::Colour>&) const;
/**
* Calculate T_i^\dagger X T_j
*/
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^\dagger
*/
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;
public:
/**
* Find a coloured path from a to b within the given diagram.
*/
static list<pair<int,bool> > colouredPath(pair<int,bool> a, pair<int,bool> b,
Ptr<Tree2toNDiagram>::tcptr);
/**
* Get all colour flows for the given diagram.
*/
static list<list<list<pair<int,bool> > > > colourFlows(Ptr<Tree2toNDiagram>::tcptr);
/**
* Convert a flow to a string representation appropriate for
* ColourLines
*/
static string cfstring(const list<list<pair<int,bool> > >&);
protected:
/**
* Prepare the basis for the normal ordered legs and return the
* dimensionality of the basis.
*/
virtual size_t prepareBasis(const vector<PDT::Colour>&) = 0;
/**
* Return the scalar product of basis tensors labelled a and b in
* the basis used for the given normal ordered legs.
*/
virtual double scalarProduct(size_t a, size_t b,
const vector<PDT::Colour>& abBasis) const = 0;
/**
* Return the matrix element of a colour charge
* <c_{n+1,a}|T_i|c_{n,b}> between basis tensors a and b, with
* respect to aBasis and bBasis
*/
virtual double tMatrixElement(size_t i, size_t a, size_t b,
const vector<PDT::Colour>& aBasis,
const vector<PDT::Colour>& bBasis) const = 0;
/**
* Return true, if a large-N colour connection exists for the
* given external legs and basis tensor.
*/
virtual bool colourConnected(const cPDVector&,
const vector<PDT::Colour>&,
const pair<int,bool>&,
const pair<int,bool>&,
- size_t) const {
+ 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 false;
}
/**
* Match up colour flows for given diagram to basis tensors.
*/
vector<string> makeFlows(Ptr<Tree2toNDiagram>::tcptr, size_t) const;
/**
* Return the colour line map.
*/
map<Ptr<Tree2toNDiagram>::tcptr,vector<ColourLines*> >&
colourLineMap();
public:
/** @name Functions used by the persistent I/O system. */
//@{
/**
* Function used to write out object persistently.
* @param os the persistent output stream written to.
*/
void persistentOutput(PersistentOStream & os) const;
/**
* Function used to read in object persistently.
* @param is the persistent input stream read from.
* @param version the version number of the object when written.
*/
void persistentInput(PersistentIStream & is, int version);
//@}
/**
* 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.
*/
static void Init();
// If needed, insert declarations of virtual function defined in the
// InterfacedBase class here (using ThePEG-interfaced-decl in Emacs).
protected:
/** @name Standard Interfaced functions. */
//@{
/**
* Initialize this object after the setup phase before saving an
* EventGenerator to disk.
* @throws InitException if object could not be initialized properly.
*/
virtual void doinit();
/**
* Initialize this object. Called in the run phase just before
* a run begins.
*/
virtual void doinitrun();
/**
* Finalize this object. Called in the run phase just after a
* run has ended. Used eg. to write out statistics.
*/
virtual void dofinish();
//@}
private:
typedef map<vector<PDT::Colour>,symmetric_matrix<double,upper> >
ScalarProductMap;
typedef map<vector<PDT::Colour>,map<size_t,compressed_matrix<double> > > ChargeMap;
typedef map<vector<PDT::Colour>,map<size_t,vector<pair<size_t,size_t > > > > ChargeNonZeroMap;
typedef map<vector<PDT::Colour>,map<pair<size_t,size_t>,symmetric_matrix<double,upper> > > CorrelatorMap;
/**
* A search path for already calculated and stored matrices.
*/
string theSearchPath;
/**
* Map external legs to normal ordered versions
*/
map<cPDVector,vector<PDT::Colour> > theNormalOrderedLegs;
/**
* Index mappings to normal order from given leg assignments,
* indexed by the original leg assignment.
*/
map<cPDVector,map<size_t,size_t> > theIndexMap;
/**
* The scalar product matrix S_n = <c_{n,a}|c_{n,b}> , indexed
* by normal ordered leg assignments.
*/
ScalarProductMap theScalarProducts;
/**
* The colour charge matrices <c_{n+1,a}|T_i|c_{n,b}> indexed by
* the `n' normal ordered legs and the index i.
*/
ChargeMap theCharges;
/**
* The nonzero elements of the charge matrices.
*/
ChargeNonZeroMap theChargeNonZeros;
/**
* The correlator matrices T_i\cdot T_j -> T_i^\dagger 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
*/
CorrelatorMap theCorrelators;
/**
* Map diagrams to colour flows indexed by basis tensor.
*/
map<Ptr<Tree2toNDiagram>::tcptr,vector<string> > theFlowMap;
/**
* Map diagrams to colour line objects.
*/
map<Ptr<Tree2toNDiagram>::tcptr,vector<ColourLines*> > theColourLineMap;
/**
* Store ordering identifiers
*/
map<vector<PDT::Colour>,map<map<size_t,size_t>,map<size_t,string> > > theOrderingIdentifiers;
/**
* Write out yet unknown basis computations.
*/
void writeBasis(const string& prefix = "") const;
/**
* Read in the basis computation which are supposed to be known.
*/
void readBasis();
/**
* Read in the basis computation which are supposed to be known.
*/
bool readBasis(const vector<PDT::Colour>&);
/**
* Gather any implementation dependend details when reading a basis
*/
virtual void readBasisDetails(const vector<PDT::Colour>&) {}
/**
* Write out symmetric matrices.
*/
void write(const symmetric_matrix<double,upper>&, ostream&) const;
/**
* Read in symmetric matrices.
*/
void read(symmetric_matrix<double,upper>&, istream&);
/**
* Write out compressed matrices.
*/
void write(const compressed_matrix<double>&, ostream&,
const vector<pair<size_t,size_t> >&) const;
/**
* Read in compressed matrices.
*/
void read(compressed_matrix<double>&, istream&,
vector<pair<size_t,size_t> >&);
/**
* True, if an attempt to read in basis information has been
* completed.
*/
bool didRead;
/**
* True, if an attempt to write out basis information has been
* completed.
*/
mutable bool didWrite;
/**
* Temporary storage.
*/
matrix<double> tmp;
/**
* The assignment operator is private and must never be called.
* In fact, it should not even be implemented.
*/
ColourBasis & operator=(const ColourBasis &);
};
}
#endif /* HERWIG_ColourBasis_H */
diff --git a/MatrixElement/Matchbox/Utility/SimpleColourBasis2.cc b/MatrixElement/Matchbox/Utility/SimpleColourBasis2.cc
--- a/MatrixElement/Matchbox/Utility/SimpleColourBasis2.cc
+++ b/MatrixElement/Matchbox/Utility/SimpleColourBasis2.cc
@@ -1,2822 +1,2822 @@
// -*- C++ -*-
//
// SimpleColourBasis2.h is a part of Herwig++ - A multi-purpose Monte Carlo event generator
// Copyright (C) 2002-2012 The Herwig Collaboration
//
// Herwig++ is licenced under version 2 of the GPL, see COPYING for details.
// Please respect the MCnet academic guidelines, see GUIDELINES for details.
//
//
// This is the implementation of the non-inlined, non-templated member
// functions of the SimpleColourBasis2 class.
//
#include "SimpleColourBasis2.h"
#include "ThePEG/Interface/ClassDocumentation.h"
#include "ThePEG/EventRecord/Particle.h"
#include "ThePEG/Repository/UseRandom.h"
#include "ThePEG/Repository/EventGenerator.h"
#include "ThePEG/Utilities/DescribeClass.h"
#include "ThePEG/StandardModel/StandardModelBase.h"
#include "ThePEG/Persistency/PersistentOStream.h"
#include "ThePEG/Persistency/PersistentIStream.h"
using namespace Herwig;
SimpleColourBasis2::SimpleColourBasis2() {}
SimpleColourBasis2::~SimpleColourBasis2() {}
IBPtr SimpleColourBasis2::clone() const {
return new_ptr(*this);
}
IBPtr SimpleColourBasis2::fullclone() const {
return new_ptr(*this);
}
size_t SimpleColourBasis2::prepareBasis(const vector<PDT::Colour>& basis) {
if ( id33bar.empty() )
makeIds();
if ( basis == id88 ) {
return 1;
}
if ( basis == id33bar ) {
return 1;
}
if ( basis == id888 ) {
return 2;
}
if ( basis == id33bar8 ) {
return 1;
}
if ( basis == id8888 ) {
return 9;
}
if ( basis == id33bar88 ) {
return 3;
}
if ( basis == id33bar33bar ) {
return 2;
}
if ( basis == id88888 ) {
return 44;
}
if ( basis == id33bar888 ) {
return 11;
}
if ( basis == id33bar33bar8 ) {
return 4;
}
throw Exception() << "Cannot handle colour configuration" << Exception::abortnow;
return 0;
}
double SimpleColourBasis2::scalarProduct(size_t a, size_t b,
const vector<PDT::Colour>& basis) const {
if ( id33bar.empty() )
makeIds();
double Nc = SM().Nc();
double Nc2 = sqr(Nc);
double Nc3 = Nc*Nc2;
double Nc4 = sqr(Nc2);
double Nc6 = Nc2*Nc4;
double Nc8 = Nc2*Nc6;
if ( a > b )
swap(a,b);
if ( basis == id88 ) {
if( ( a == 0 ) ||
( b == 0 ) )
return (-1 + Nc2)/4.;
}
if ( basis == id33bar ) {
if( ( a == 0 ) ||
( b == 0 ) )
return Nc;
}
if ( basis == id888 ) {
if( ( a == 0 && b == 0 ) ||
( a == 1 && b == 1 ) )
return (2 - 3*Nc2 + Nc4)/(8.*Nc);
if( ( a == 0 ) ||
( b == 1 ) )
return -(-1 + Nc2)/(4.*Nc);
}
if ( basis == id33bar8 ) {
if( ( a == 0 ) ||
( b == 0 ) )
return (-1 + Nc2)/2.;
}
if ( basis == id8888 ) {
if( ( a == 0 && b == 0 ) ||
( a == 1 && b == 1 ) ||
( a == 2 && b == 2 ) )
return sqr(-1 + Nc2)/16.;
if( ( a == 0 && b == 1 ) ||
( a == 0 && b == 2 ) ||
( a == 1 && b == 2 ) )
return (-1 + Nc2)/16.;
if( ( a == 0 && b == 3 ) ||
( a == 0 && b == 5 ) ||
( a == 0 && b == 7 ) ||
( a == 0 && b == 8 ) ||
( a == 1 && b == 4 ) ||
( a == 1 && b == 5 ) ||
( a == 1 && b == 6 ) ||
( a == 1 && b == 7 ) ||
( a == 2 && b == 3 ) ||
( a == 2 && b == 4 ) ||
( a == 2 && b == 6 ) ||
( a == 2 && b == 8 ) )
return sqr(-1 + Nc2)/(16.*Nc);
if( ( a == 0 && b == 4 ) ||
( a == 0 && b == 6 ) ||
( a == 1 && b == 3 ) ||
( a == 1 && b == 8 ) ||
( a == 2 && b == 5 ) ||
( a == 2 && b == 7 ) )
return -(-1 + Nc2)/(16.*Nc);
if( ( a == 3 && b == 3 ) ||
( a == 4 && b == 4 ) ||
( a == 5 && b == 5 ) ||
( a == 6 && b == 6 ) ||
( a == 7 && b == 7 ) ||
( a == 8 && b == 8 ) )
return (-3 + 6*Nc2 - 4*Nc4 + Nc6)/(16.*Nc2);
if( ( a == 3 && b == 4 ) ||
( a == 3 && b == 5 ) ||
( a == 3 && b == 6 ) ||
( a == 3 && b == 7 ) ||
( a == 4 && b == 5 ) ||
( a == 4 && b == 7 ) ||
( a == 4 && b == 8 ) ||
( a == 5 && b == 6 ) ||
( a == 5 && b == 8 ) ||
( a == 6 && b == 7 ) ||
( a == 6 && b == 8 ) ||
( a == 7 && b == 8 ) )
return (4 - 3/Nc2 - Nc2)/16.;
if( ( a == 3 && b == 8 ) ||
( a == 4 && b == 6 ) ||
( a == 5 && b == 7 ) )
return (-3 + 2*Nc2 + Nc4)/(16.*Nc2);
}
if ( basis == id33bar88 ) {
if( ( a == 0 ) ||
( b == 0 ) )
return (Nc*(-1 + Nc2))/4.;
if( ( a == 0 && b == 1 ) ||
( a == 0 && b == 2 ) )
return (-1 + Nc2)/4.;
if( ( a == 1 && b == 1 ) ||
( a == 2 && b == 2 ) )
return sqr(-1 + Nc2)/(4.*Nc);
if( ( a == 1 ) ||
( b == 2 ) )
return -(-1 + Nc2)/(4.*Nc);
}
if ( basis == id33bar33bar ) {
if( ( a == 0 && b == 0 ) ||
( a == 1 && b == 1 ) )
return Nc2;
if( ( a == 0 ) ||
( b == 1 ) )
return Nc;
}
if ( basis == id88888 ) {
if( ( a == 0 && b == 0 ) ||
( a == 1 && b == 1 ) ||
( a == 2 && b == 2 ) ||
( a == 3 && b == 3 ) ||
( a == 4 && b == 4 ) ||
( a == 5 && b == 5 ) ||
( a == 6 && b == 6 ) ||
( a == 7 && b == 7 ) ||
( a == 8 && b == 8 ) ||
( a == 9 && b == 9 ) ||
( a == 10 && b == 10 ) ||
( a == 11 && b == 11 ) ||
( a == 12 && b == 12 ) ||
( a == 13 && b == 13 ) ||
( a == 14 && b == 14 ) ||
( a == 15 && b == 15 ) ||
( a == 16 && b == 16 ) ||
( a == 17 && b == 17 ) ||
( a == 18 && b == 18 ) ||
( a == 19 && b == 19 ) )
return ((-2 + Nc2)*sqr(-1 + Nc2))/(32.*Nc);
if( ( a == 0 && b == 1 ) ||
( a == 0 && b == 2 ) ||
( a == 0 && b == 7 ) ||
( a == 0 && b == 10 ) ||
( a == 0 && b == 12 ) ||
( a == 0 && b == 13 ) ||
( a == 1 && b == 2 ) ||
( a == 1 && b == 4 ) ||
( a == 1 && b == 11 ) ||
( a == 1 && b == 14 ) ||
( a == 1 && b == 15 ) ||
( a == 2 && b == 5 ) ||
( a == 2 && b == 8 ) ||
( a == 2 && b == 16 ) ||
( a == 2 && b == 17 ) ||
( a == 3 && b == 4 ) ||
( a == 3 && b == 5 ) ||
( a == 3 && b == 6 ) ||
( a == 3 && b == 9 ) ||
( a == 3 && b == 14 ) ||
( a == 3 && b == 16 ) ||
( a == 4 && b == 5 ) ||
( a == 4 && b == 11 ) ||
( a == 4 && b == 12 ) ||
( a == 4 && b == 18 ) ||
( a == 5 && b == 8 ) ||
( a == 5 && b == 13 ) ||
( a == 5 && b == 19 ) ||
( a == 6 && b == 7 ) ||
( a == 6 && b == 8 ) ||
( a == 6 && b == 9 ) ||
( a == 6 && b == 12 ) ||
( a == 6 && b == 17 ) ||
( a == 7 && b == 8 ) ||
( a == 7 && b == 10 ) ||
( a == 7 && b == 14 ) ||
( a == 7 && b == 19 ) ||
( a == 8 && b == 15 ) ||
( a == 8 && b == 18 ) ||
( a == 9 && b == 10 ) ||
( a == 9 && b == 11 ) ||
( a == 9 && b == 13 ) ||
( a == 9 && b == 15 ) ||
( a == 10 && b == 11 ) ||
( a == 10 && b == 16 ) ||
( a == 10 && b == 18 ) ||
( a == 11 && b == 17 ) ||
( a == 11 && b == 19 ) ||
( a == 12 && b == 13 ) ||
( a == 12 && b == 17 ) ||
( a == 12 && b == 18 ) ||
( a == 13 && b == 15 ) ||
( a == 13 && b == 19 ) ||
( a == 14 && b == 15 ) ||
( a == 14 && b == 16 ) ||
( a == 14 && b == 19 ) ||
( a == 15 && b == 18 ) ||
( a == 16 && b == 17 ) ||
( a == 16 && b == 18 ) ||
( a == 17 && b == 19 ) )
return (2 - 3*Nc2 + Nc4)/(32.*Nc);
if( ( a == 0 && b == 3 ) ||
( a == 1 && b == 6 ) ||
( a == 2 && b == 9 ) ||
( a == 4 && b == 7 ) ||
( a == 5 && b == 10 ) ||
( a == 8 && b == 11 ) ||
( a == 12 && b == 14 ) ||
( a == 13 && b == 16 ) ||
( a == 15 && b == 17 ) ||
( a == 18 && b == 19 ) )
return -sqr(-1 + Nc2)/(16.*Nc);
if( ( a == 0 && b == 4 ) ||
( a == 0 && b == 5 ) ||
( a == 0 && b == 6 ) ||
( a == 0 && b == 9 ) ||
( a == 0 && b == 14 ) ||
( a == 0 && b == 16 ) ||
( a == 1 && b == 3 ) ||
( a == 1 && b == 7 ) ||
( a == 1 && b == 8 ) ||
( a == 1 && b == 9 ) ||
( a == 1 && b == 12 ) ||
( a == 1 && b == 17 ) ||
( a == 2 && b == 3 ) ||
( a == 2 && b == 6 ) ||
( a == 2 && b == 10 ) ||
( a == 2 && b == 11 ) ||
( a == 2 && b == 13 ) ||
( a == 2 && b == 15 ) ||
( a == 3 && b == 7 ) ||
( a == 3 && b == 10 ) ||
( a == 3 && b == 12 ) ||
( a == 3 && b == 13 ) ||
( a == 4 && b == 6 ) ||
( a == 4 && b == 8 ) ||
( a == 4 && b == 10 ) ||
( a == 4 && b == 14 ) ||
( a == 4 && b == 19 ) ||
( a == 5 && b == 7 ) ||
( a == 5 && b == 9 ) ||
( a == 5 && b == 11 ) ||
( a == 5 && b == 16 ) ||
( a == 5 && b == 18 ) ||
( a == 6 && b == 11 ) ||
( a == 6 && b == 14 ) ||
( a == 6 && b == 15 ) ||
( a == 7 && b == 11 ) ||
( a == 7 && b == 12 ) ||
( a == 7 && b == 18 ) ||
( a == 8 && b == 9 ) ||
( a == 8 && b == 10 ) ||
( a == 8 && b == 17 ) ||
( a == 8 && b == 19 ) ||
( a == 9 && b == 16 ) ||
( a == 9 && b == 17 ) ||
( a == 10 && b == 13 ) ||
( a == 10 && b == 19 ) ||
( a == 11 && b == 15 ) ||
( a == 11 && b == 18 ) ||
( a == 12 && b == 15 ) ||
( a == 12 && b == 16 ) ||
( a == 12 && b == 19 ) ||
( a == 13 && b == 14 ) ||
( a == 13 && b == 17 ) ||
( a == 13 && b == 18 ) ||
( a == 14 && b == 17 ) ||
( a == 14 && b == 18 ) ||
( a == 15 && b == 16 ) ||
( a == 15 && b == 19 ) ||
( a == 16 && b == 19 ) ||
( a == 17 && b == 18 ) )
return -(-1 + Nc2)/(16.*Nc);
if( ( a == 0 && b == 8 ) ||
( a == 0 && b == 11 ) ||
( a == 0 && b == 15 ) ||
( a == 0 && b == 17 ) ||
( a == 0 && b == 18 ) ||
( a == 0 && b == 19 ) ||
( a == 1 && b == 5 ) ||
( a == 1 && b == 10 ) ||
( a == 1 && b == 13 ) ||
( a == 1 && b == 16 ) ||
( a == 1 && b == 18 ) ||
( a == 1 && b == 19 ) ||
( a == 2 && b == 4 ) ||
( a == 2 && b == 7 ) ||
( a == 2 && b == 12 ) ||
( a == 2 && b == 14 ) ||
( a == 2 && b == 18 ) ||
( a == 2 && b == 19 ) ||
( a == 3 && b == 8 ) ||
( a == 3 && b == 11 ) ||
( a == 3 && b == 15 ) ||
( a == 3 && b == 17 ) ||
( a == 3 && b == 18 ) ||
( a == 3 && b == 19 ) ||
( a == 4 && b == 9 ) ||
( a == 4 && b == 13 ) ||
( a == 4 && b == 15 ) ||
( a == 4 && b == 16 ) ||
( a == 4 && b == 17 ) ||
( a == 5 && b == 6 ) ||
( a == 5 && b == 12 ) ||
( a == 5 && b == 14 ) ||
( a == 5 && b == 15 ) ||
( a == 5 && b == 17 ) ||
( a == 6 && b == 10 ) ||
( a == 6 && b == 13 ) ||
( a == 6 && b == 16 ) ||
( a == 6 && b == 18 ) ||
( a == 6 && b == 19 ) ||
( a == 7 && b == 9 ) ||
( a == 7 && b == 13 ) ||
( a == 7 && b == 15 ) ||
( a == 7 && b == 16 ) ||
( a == 7 && b == 17 ) ||
( a == 8 && b == 12 ) ||
( a == 8 && b == 13 ) ||
( a == 8 && b == 14 ) ||
( a == 8 && b == 16 ) ||
( a == 9 && b == 12 ) ||
( a == 9 && b == 14 ) ||
( a == 9 && b == 18 ) ||
( a == 9 && b == 19 ) ||
( a == 10 && b == 12 ) ||
( a == 10 && b == 14 ) ||
( a == 10 && b == 15 ) ||
( a == 10 && b == 17 ) ||
( a == 11 && b == 12 ) ||
( a == 11 && b == 13 ) ||
( a == 11 && b == 14 ) ||
( a == 11 && b == 16 ) )
return 0;
if( ( a == 0 && b == 20 ) ||
( a == 0 && b == 21 ) ||
( a == 0 && b == 23 ) ||
( a == 0 && b == 25 ) ||
( a == 0 && b == 36 ) ||
( a == 0 && b == 42 ) ||
( a == 1 && b == 21 ) ||
( a == 1 && b == 22 ) ||
( a == 1 && b == 23 ) ||
( a == 1 && b == 24 ) ||
( a == 1 && b == 30 ) ||
( a == 1 && b == 40 ) ||
( a == 2 && b == 20 ) ||
( a == 2 && b == 22 ) ||
( a == 2 && b == 24 ) ||
( a == 2 && b == 25 ) ||
( a == 2 && b == 28 ) ||
( a == 2 && b == 34 ) ||
( a == 3 && b == 26 ) ||
( a == 3 && b == 27 ) ||
( a == 3 && b == 29 ) ||
( a == 3 && b == 31 ) ||
( a == 3 && b == 37 ) ||
( a == 3 && b == 43 ) ||
( a == 4 && b == 24 ) ||
( a == 4 && b == 27 ) ||
( a == 4 && b == 28 ) ||
( a == 4 && b == 29 ) ||
( a == 4 && b == 30 ) ||
( a == 4 && b == 38 ) ||
( a == 5 && b == 22 ) ||
( a == 5 && b == 26 ) ||
( a == 5 && b == 28 ) ||
( a == 5 && b == 30 ) ||
( a == 5 && b == 31 ) ||
( a == 5 && b == 32 ) ||
( a == 6 && b == 31 ) ||
( a == 6 && b == 32 ) ||
( a == 6 && b == 33 ) ||
( a == 6 && b == 35 ) ||
( a == 6 && b == 37 ) ||
( a == 6 && b == 41 ) ||
( a == 7 && b == 25 ) ||
( a == 7 && b == 33 ) ||
( a == 7 && b == 34 ) ||
( a == 7 && b == 35 ) ||
( a == 7 && b == 36 ) ||
( a == 7 && b == 39 ) ||
( a == 8 && b == 20 ) ||
( a == 8 && b == 26 ) ||
( a == 8 && b == 32 ) ||
( a == 8 && b == 34 ) ||
( a == 8 && b == 36 ) ||
( a == 8 && b == 37 ) ||
( a == 9 && b == 29 ) ||
( a == 9 && b == 35 ) ||
( a == 9 && b == 38 ) ||
( a == 9 && b == 39 ) ||
( a == 9 && b == 41 ) ||
( a == 9 && b == 43 ) ||
( a == 10 && b == 23 ) ||
( a == 10 && b == 33 ) ||
( a == 10 && b == 39 ) ||
( a == 10 && b == 40 ) ||
( a == 10 && b == 41 ) ||
( a == 10 && b == 42 ) ||
( a == 11 && b == 21 ) ||
( a == 11 && b == 27 ) ||
( a == 11 && b == 38 ) ||
( a == 11 && b == 40 ) ||
( a == 11 && b == 42 ) ||
( a == 11 && b == 43 ) ||
( a == 12 && b == 20 ) ||
( a == 12 && b == 28 ) ||
( a == 12 && b == 32 ) ||
( a == 12 && b == 38 ) ||
( a == 12 && b == 41 ) ||
( a == 12 && b == 42 ) ||
( a == 13 && b == 21 ) ||
( a == 13 && b == 30 ) ||
( a == 13 && b == 32 ) ||
( a == 13 && b == 35 ) ||
( a == 13 && b == 36 ) ||
( a == 13 && b == 38 ) ||
( a == 14 && b == 22 ) ||
( a == 14 && b == 26 ) ||
( a == 14 && b == 34 ) ||
( a == 14 && b == 39 ) ||
( a == 14 && b == 40 ) ||
( a == 14 && b == 43 ) ||
( a == 15 && b == 23 ) ||
( a == 15 && b == 26 ) ||
( a == 15 && b == 29 ) ||
( a == 15 && b == 30 ) ||
( a == 15 && b == 36 ) ||
( a == 15 && b == 39 ) ||
( a == 16 && b == 24 ) ||
( a == 16 && b == 27 ) ||
( a == 16 && b == 33 ) ||
( a == 16 && b == 34 ) ||
( a == 16 && b == 37 ) ||
( a == 16 && b == 40 ) ||
( a == 17 && b == 25 ) ||
( a == 17 && b == 27 ) ||
( a == 17 && b == 28 ) ||
( a == 17 && b == 31 ) ||
( a == 17 && b == 33 ) ||
( a == 17 && b == 42 ) ||
( a == 18 && b == 20 ) ||
( a == 18 && b == 23 ) ||
( a == 18 && b == 24 ) ||
( a == 18 && b == 29 ) ||
( a == 18 && b == 37 ) ||
( a == 18 && b == 41 ) ||
( a == 19 && b == 21 ) ||
( a == 19 && b == 22 ) ||
( a == 19 && b == 25 ) ||
( a == 19 && b == 31 ) ||
( a == 19 && b == 35 ) ||
( a == 19 && b == 43 ) )
return ((-2 + Nc2)*sqr(-1 + Nc2))/(32.*Nc2);
if( ( a == 0 && b == 22 ) ||
( a == 0 && b == 24 ) ||
( a == 0 && b == 32 ) ||
( a == 0 && b == 33 ) ||
( a == 0 && b == 38 ) ||
( a == 0 && b == 39 ) ||
( a == 1 && b == 20 ) ||
( a == 1 && b == 25 ) ||
( a == 1 && b == 26 ) ||
( a == 1 && b == 27 ) ||
( a == 1 && b == 38 ) ||
( a == 1 && b == 39 ) ||
( a == 2 && b == 21 ) ||
( a == 2 && b == 23 ) ||
( a == 2 && b == 26 ) ||
( a == 2 && b == 27 ) ||
( a == 2 && b == 32 ) ||
( a == 2 && b == 33 ) ||
( a == 3 && b == 28 ) ||
( a == 3 && b == 30 ) ||
( a == 3 && b == 34 ) ||
( a == 3 && b == 35 ) ||
( a == 3 && b == 40 ) ||
( a == 3 && b == 41 ) ||
( a == 4 && b == 20 ) ||
( a == 4 && b == 21 ) ||
( a == 4 && b == 26 ) ||
( a == 4 && b == 31 ) ||
( a == 4 && b == 40 ) ||
( a == 4 && b == 41 ) ||
( a == 5 && b == 20 ) ||
( a == 5 && b == 21 ) ||
( a == 5 && b == 27 ) ||
( a == 5 && b == 29 ) ||
( a == 5 && b == 34 ) ||
( a == 5 && b == 35 ) ||
( a == 6 && b == 28 ) ||
( a == 6 && b == 29 ) ||
( a == 6 && b == 34 ) ||
( a == 6 && b == 36 ) ||
( a == 6 && b == 42 ) ||
( a == 6 && b == 43 ) ||
( a == 7 && b == 22 ) ||
( a == 7 && b == 23 ) ||
( a == 7 && b == 32 ) ||
( a == 7 && b == 37 ) ||
( a == 7 && b == 42 ) ||
( a == 7 && b == 43 ) ||
( a == 8 && b == 22 ) ||
( a == 8 && b == 23 ) ||
( a == 8 && b == 28 ) ||
( a == 8 && b == 29 ) ||
( a == 8 && b == 33 ) ||
( a == 8 && b == 35 ) ||
( a == 9 && b == 30 ) ||
( a == 9 && b == 31 ) ||
( a == 9 && b == 36 ) ||
( a == 9 && b == 37 ) ||
( a == 9 && b == 40 ) ||
( a == 9 && b == 42 ) ||
( a == 10 && b == 24 ) ||
( a == 10 && b == 25 ) ||
( a == 10 && b == 36 ) ||
( a == 10 && b == 37 ) ||
( a == 10 && b == 38 ) ||
( a == 10 && b == 43 ) ||
( a == 11 && b == 24 ) ||
( a == 11 && b == 25 ) ||
( a == 11 && b == 30 ) ||
( a == 11 && b == 31 ) ||
( a == 11 && b == 39 ) ||
( a == 11 && b == 41 ) ||
( a == 12 && b == 21 ) ||
( a == 12 && b == 24 ) ||
( a == 12 && b == 29 ) ||
( a == 12 && b == 31 ) ||
( a == 12 && b == 33 ) ||
( a == 12 && b == 36 ) ||
( a == 13 && b == 20 ) ||
( a == 13 && b == 22 ) ||
( a == 13 && b == 29 ) ||
( a == 13 && b == 31 ) ||
( a == 13 && b == 39 ) ||
( a == 13 && b == 42 ) ||
( a == 14 && b == 23 ) ||
( a == 14 && b == 25 ) ||
( a == 14 && b == 27 ) ||
( a == 14 && b == 30 ) ||
( a == 14 && b == 35 ) ||
( a == 14 && b == 37 ) ||
( a == 15 && b == 20 ) ||
( a == 15 && b == 22 ) ||
( a == 15 && b == 35 ) ||
( a == 15 && b == 37 ) ||
( a == 15 && b == 38 ) ||
( a == 15 && b == 40 ) ||
( a == 16 && b == 23 ) ||
( a == 16 && b == 25 ) ||
( a == 16 && b == 26 ) ||
( a == 16 && b == 28 ) ||
( a == 16 && b == 41 ) ||
( a == 16 && b == 43 ) ||
( a == 17 && b == 21 ) ||
( a == 17 && b == 24 ) ||
( a == 17 && b == 32 ) ||
( a == 17 && b == 34 ) ||
( a == 17 && b == 41 ) ||
( a == 17 && b == 43 ) ||
( a == 18 && b == 26 ) ||
( a == 18 && b == 28 ) ||
( a == 18 && b == 33 ) ||
( a == 18 && b == 36 ) ||
( a == 18 && b == 38 ) ||
( a == 18 && b == 40 ) ||
( a == 19 && b == 27 ) ||
( a == 19 && b == 30 ) ||
( a == 19 && b == 32 ) ||
( a == 19 && b == 34 ) ||
( a == 19 && b == 39 ) ||
( a == 19 && b == 42 ) )
return -(2 - 3*Nc2 + Nc4)/(32.*Nc2);
if( ( a == 0 && b == 26 ) ||
( a == 0 && b == 27 ) ||
( a == 0 && b == 29 ) ||
( a == 0 && b == 31 ) ||
( a == 0 && b == 37 ) ||
( a == 0 && b == 43 ) ||
( a == 1 && b == 31 ) ||
( a == 1 && b == 32 ) ||
( a == 1 && b == 33 ) ||
( a == 1 && b == 35 ) ||
( a == 1 && b == 37 ) ||
( a == 1 && b == 41 ) ||
( a == 2 && b == 29 ) ||
( a == 2 && b == 35 ) ||
( a == 2 && b == 38 ) ||
( a == 2 && b == 39 ) ||
( a == 2 && b == 41 ) ||
( a == 2 && b == 43 ) ||
( a == 3 && b == 20 ) ||
( a == 3 && b == 21 ) ||
( a == 3 && b == 23 ) ||
( a == 3 && b == 25 ) ||
( a == 3 && b == 36 ) ||
( a == 3 && b == 42 ) ||
( a == 4 && b == 25 ) ||
( a == 4 && b == 33 ) ||
( a == 4 && b == 34 ) ||
( a == 4 && b == 35 ) ||
( a == 4 && b == 36 ) ||
( a == 4 && b == 39 ) ||
( a == 5 && b == 23 ) ||
( a == 5 && b == 33 ) ||
( a == 5 && b == 39 ) ||
( a == 5 && b == 40 ) ||
( a == 5 && b == 41 ) ||
( a == 5 && b == 42 ) ||
( a == 6 && b == 21 ) ||
( a == 6 && b == 22 ) ||
( a == 6 && b == 23 ) ||
( a == 6 && b == 24 ) ||
( a == 6 && b == 30 ) ||
( a == 6 && b == 40 ) ||
( a == 7 && b == 24 ) ||
( a == 7 && b == 27 ) ||
( a == 7 && b == 28 ) ||
( a == 7 && b == 29 ) ||
( a == 7 && b == 30 ) ||
( a == 7 && b == 38 ) ||
( a == 8 && b == 21 ) ||
( a == 8 && b == 27 ) ||
( a == 8 && b == 38 ) ||
( a == 8 && b == 40 ) ||
( a == 8 && b == 42 ) ||
( a == 8 && b == 43 ) ||
( a == 9 && b == 20 ) ||
( a == 9 && b == 22 ) ||
( a == 9 && b == 24 ) ||
( a == 9 && b == 25 ) ||
( a == 9 && b == 28 ) ||
( a == 9 && b == 34 ) ||
( a == 10 && b == 22 ) ||
( a == 10 && b == 26 ) ||
( a == 10 && b == 28 ) ||
( a == 10 && b == 30 ) ||
( a == 10 && b == 31 ) ||
( a == 10 && b == 32 ) ||
( a == 11 && b == 20 ) ||
( a == 11 && b == 26 ) ||
( a == 11 && b == 32 ) ||
( a == 11 && b == 34 ) ||
( a == 11 && b == 36 ) ||
( a == 11 && b == 37 ) ||
( a == 12 && b == 22 ) ||
( a == 12 && b == 26 ) ||
( a == 12 && b == 34 ) ||
( a == 12 && b == 39 ) ||
( a == 12 && b == 40 ) ||
( a == 12 && b == 43 ) ||
( a == 13 && b == 24 ) ||
( a == 13 && b == 27 ) ||
( a == 13 && b == 33 ) ||
( a == 13 && b == 34 ) ||
( a == 13 && b == 37 ) ||
( a == 13 && b == 40 ) ||
( a == 14 && b == 20 ) ||
( a == 14 && b == 28 ) ||
( a == 14 && b == 32 ) ||
( a == 14 && b == 38 ) ||
( a == 14 && b == 41 ) ||
( a == 14 && b == 42 ) ||
( a == 15 && b == 25 ) ||
( a == 15 && b == 27 ) ||
( a == 15 && b == 28 ) ||
( a == 15 && b == 31 ) ||
( a == 15 && b == 33 ) ||
( a == 15 && b == 42 ) ||
( a == 16 && b == 21 ) ||
( a == 16 && b == 30 ) ||
( a == 16 && b == 32 ) ||
( a == 16 && b == 35 ) ||
( a == 16 && b == 36 ) ||
( a == 16 && b == 38 ) ||
( a == 17 && b == 23 ) ||
( a == 17 && b == 26 ) ||
( a == 17 && b == 29 ) ||
( a == 17 && b == 30 ) ||
( a == 17 && b == 36 ) ||
( a == 17 && b == 39 ) ||
( a == 18 && b == 21 ) ||
( a == 18 && b == 22 ) ||
( a == 18 && b == 25 ) ||
( a == 18 && b == 31 ) ||
( a == 18 && b == 35 ) ||
( a == 18 && b == 43 ) ||
( a == 19 && b == 20 ) ||
( a == 19 && b == 23 ) ||
( a == 19 && b == 24 ) ||
( a == 19 && b == 29 ) ||
( a == 19 && b == 37 ) ||
( a == 19 && b == 41 ) )
return -sqr(-1 + Nc2)/(16.*Nc2);
if( ( a == 0 && b == 28 ) ||
( a == 0 && b == 30 ) ||
( a == 0 && b == 34 ) ||
( a == 0 && b == 35 ) ||
( a == 0 && b == 40 ) ||
( a == 0 && b == 41 ) ||
( a == 1 && b == 28 ) ||
( a == 1 && b == 29 ) ||
( a == 1 && b == 34 ) ||
( a == 1 && b == 36 ) ||
( a == 1 && b == 42 ) ||
( a == 1 && b == 43 ) ||
( a == 2 && b == 30 ) ||
( a == 2 && b == 31 ) ||
( a == 2 && b == 36 ) ||
( a == 2 && b == 37 ) ||
( a == 2 && b == 40 ) ||
( a == 2 && b == 42 ) ||
( a == 3 && b == 22 ) ||
( a == 3 && b == 24 ) ||
( a == 3 && b == 32 ) ||
( a == 3 && b == 33 ) ||
( a == 3 && b == 38 ) ||
( a == 3 && b == 39 ) ||
( a == 4 && b == 22 ) ||
( a == 4 && b == 23 ) ||
( a == 4 && b == 32 ) ||
( a == 4 && b == 37 ) ||
( a == 4 && b == 42 ) ||
( a == 4 && b == 43 ) ||
( a == 5 && b == 24 ) ||
( a == 5 && b == 25 ) ||
( a == 5 && b == 36 ) ||
( a == 5 && b == 37 ) ||
( a == 5 && b == 38 ) ||
( a == 5 && b == 43 ) ||
( a == 6 && b == 20 ) ||
( a == 6 && b == 25 ) ||
( a == 6 && b == 26 ) ||
( a == 6 && b == 27 ) ||
( a == 6 && b == 38 ) ||
( a == 6 && b == 39 ) ||
( a == 7 && b == 20 ) ||
( a == 7 && b == 21 ) ||
( a == 7 && b == 26 ) ||
( a == 7 && b == 31 ) ||
( a == 7 && b == 40 ) ||
( a == 7 && b == 41 ) ||
( a == 8 && b == 24 ) ||
( a == 8 && b == 25 ) ||
( a == 8 && b == 30 ) ||
( a == 8 && b == 31 ) ||
( a == 8 && b == 39 ) ||
( a == 8 && b == 41 ) ||
( a == 9 && b == 21 ) ||
( a == 9 && b == 23 ) ||
( a == 9 && b == 26 ) ||
( a == 9 && b == 27 ) ||
( a == 9 && b == 32 ) ||
( a == 9 && b == 33 ) ||
( a == 10 && b == 20 ) ||
( a == 10 && b == 21 ) ||
( a == 10 && b == 27 ) ||
( a == 10 && b == 29 ) ||
( a == 10 && b == 34 ) ||
( a == 10 && b == 35 ) ||
( a == 11 && b == 22 ) ||
( a == 11 && b == 23 ) ||
( a == 11 && b == 28 ) ||
( a == 11 && b == 29 ) ||
( a == 11 && b == 33 ) ||
( a == 11 && b == 35 ) ||
( a == 12 && b == 23 ) ||
( a == 12 && b == 25 ) ||
( a == 12 && b == 27 ) ||
( a == 12 && b == 30 ) ||
( a == 12 && b == 35 ) ||
( a == 12 && b == 37 ) ||
( a == 13 && b == 23 ) ||
( a == 13 && b == 25 ) ||
( a == 13 && b == 26 ) ||
( a == 13 && b == 28 ) ||
( a == 13 && b == 41 ) ||
( a == 13 && b == 43 ) ||
( a == 14 && b == 21 ) ||
( a == 14 && b == 24 ) ||
( a == 14 && b == 29 ) ||
( a == 14 && b == 31 ) ||
( a == 14 && b == 33 ) ||
( a == 14 && b == 36 ) ||
( a == 15 && b == 21 ) ||
( a == 15 && b == 24 ) ||
( a == 15 && b == 32 ) ||
( a == 15 && b == 34 ) ||
( a == 15 && b == 41 ) ||
( a == 15 && b == 43 ) ||
( a == 16 && b == 20 ) ||
( a == 16 && b == 22 ) ||
( a == 16 && b == 29 ) ||
( a == 16 && b == 31 ) ||
( a == 16 && b == 39 ) ||
( a == 16 && b == 42 ) ||
( a == 17 && b == 20 ) ||
( a == 17 && b == 22 ) ||
( a == 17 && b == 35 ) ||
( a == 17 && b == 37 ) ||
( a == 17 && b == 38 ) ||
( a == 17 && b == 40 ) ||
( a == 18 && b == 27 ) ||
( a == 18 && b == 30 ) ||
( a == 18 && b == 32 ) ||
( a == 18 && b == 34 ) ||
( a == 18 && b == 39 ) ||
( a == 18 && b == 42 ) ||
( a == 19 && b == 26 ) ||
( a == 19 && b == 28 ) ||
( a == 19 && b == 33 ) ||
( a == 19 && b == 36 ) ||
( a == 19 && b == 38 ) ||
( a == 19 && b == 40 ) )
return (1 - 1/Nc2)/16.;
if( ( a == 20 && b == 20 ) ||
( a == 21 && b == 21 ) ||
( a == 22 && b == 22 ) ||
( a == 23 && b == 23 ) ||
( a == 24 && b == 24 ) ||
( a == 25 && b == 25 ) ||
( a == 26 && b == 26 ) ||
( a == 27 && b == 27 ) ||
( a == 28 && b == 28 ) ||
( a == 29 && b == 29 ) ||
( a == 30 && b == 30 ) ||
( a == 31 && b == 31 ) ||
( a == 32 && b == 32 ) ||
( a == 33 && b == 33 ) ||
( a == 34 && b == 34 ) ||
( a == 35 && b == 35 ) ||
( a == 36 && b == 36 ) ||
( a == 37 && b == 37 ) ||
( a == 38 && b == 38 ) ||
( a == 39 && b == 39 ) ||
( a == 40 && b == 40 ) ||
( a == 41 && b == 41 ) ||
( a == 42 && b == 42 ) ||
( a == 43 && b == 43 ) )
return (4 - 10*Nc2 + 10*Nc4 - 5*Nc6 + Nc8)/(32.*Nc3);
if( ( a == 20 && b == 21 ) ||
( a == 20 && b == 22 ) ||
( a == 20 && b == 26 ) ||
( a == 20 && b == 29 ) ||
( a == 20 && b == 38 ) ||
( a == 21 && b == 24 ) ||
( a == 21 && b == 27 ) ||
( a == 21 && b == 31 ) ||
( a == 21 && b == 32 ) ||
( a == 22 && b == 23 ) ||
( a == 22 && b == 32 ) ||
( a == 22 && b == 35 ) ||
( a == 22 && b == 39 ) ||
( a == 23 && b == 25 ) ||
( a == 23 && b == 26 ) ||
( a == 23 && b == 33 ) ||
( a == 23 && b == 37 ) ||
( a == 24 && b == 25 ) ||
( a == 24 && b == 33 ) ||
( a == 24 && b == 38 ) ||
( a == 24 && b == 41 ) ||
( a == 25 && b == 27 ) ||
( a == 25 && b == 39 ) ||
( a == 25 && b == 43 ) ||
( a == 26 && b == 27 ) ||
( a == 26 && b == 28 ) ||
( a == 26 && b == 40 ) ||
( a == 27 && b == 30 ) ||
( a == 27 && b == 34 ) ||
( a == 28 && b == 29 ) ||
( a == 28 && b == 33 ) ||
( a == 28 && b == 34 ) ||
( a == 28 && b == 41 ) ||
( a == 29 && b == 31 ) ||
( a == 29 && b == 35 ) ||
( a == 29 && b == 36 ) ||
( a == 30 && b == 31 ) ||
( a == 30 && b == 35 ) ||
( a == 30 && b == 39 ) ||
( a == 30 && b == 40 ) ||
( a == 31 && b == 41 ) ||
( a == 31 && b == 42 ) ||
( a == 32 && b == 33 ) ||
( a == 32 && b == 34 ) ||
( a == 32 && b == 42 ) ||
( a == 33 && b == 36 ) ||
( a == 34 && b == 35 ) ||
( a == 34 && b == 43 ) ||
( a == 35 && b == 37 ) ||
( a == 36 && b == 37 ) ||
( a == 36 && b == 38 ) ||
( a == 36 && b == 42 ) ||
( a == 37 && b == 40 ) ||
( a == 37 && b == 43 ) ||
( a == 38 && b == 39 ) ||
( a == 38 && b == 40 ) ||
( a == 39 && b == 42 ) ||
( a == 40 && b == 41 ) ||
( a == 41 && b == 43 ) ||
( a == 42 && b == 43 ) )
return -(-4 + 7*Nc2 - 4*Nc4 + Nc6)/(32.*Nc3);
if( ( a == 20 && b == 23 ) ||
( a == 20 && b == 24 ) ||
( a == 20 && b == 28 ) ||
( a == 20 && b == 32 ) ||
( a == 20 && b == 36 ) ||
( a == 21 && b == 22 ) ||
( a == 21 && b == 25 ) ||
( a == 21 && b == 30 ) ||
( a == 21 && b == 38 ) ||
( a == 21 && b == 42 ) ||
( a == 22 && b == 25 ) ||
( a == 22 && b == 26 ) ||
( a == 22 && b == 30 ) ||
( a == 22 && b == 34 ) ||
( a == 23 && b == 24 ) ||
( a == 23 && b == 36 ) ||
( a == 23 && b == 39 ) ||
( a == 23 && b == 40 ) ||
( a == 24 && b == 27 ) ||
( a == 24 && b == 28 ) ||
( a == 24 && b == 40 ) ||
( a == 25 && b == 33 ) ||
( a == 25 && b == 34 ) ||
( a == 25 && b == 42 ) ||
( a == 26 && b == 29 ) ||
( a == 26 && b == 30 ) ||
( a == 26 && b == 34 ) ||
( a == 26 && b == 37 ) ||
( a == 27 && b == 28 ) ||
( a == 27 && b == 31 ) ||
( a == 27 && b == 40 ) ||
( a == 27 && b == 43 ) ||
( a == 28 && b == 31 ) ||
( a == 28 && b == 32 ) ||
( a == 29 && b == 30 ) ||
( a == 29 && b == 37 ) ||
( a == 29 && b == 38 ) ||
( a == 29 && b == 41 ) ||
( a == 30 && b == 38 ) ||
( a == 31 && b == 32 ) ||
( a == 31 && b == 35 ) ||
( a == 31 && b == 43 ) ||
( a == 32 && b == 35 ) ||
( a == 32 && b == 36 ) ||
( a == 33 && b == 34 ) ||
( a == 33 && b == 37 ) ||
( a == 33 && b == 41 ) ||
( a == 33 && b == 42 ) ||
( a == 34 && b == 37 ) ||
( a == 35 && b == 36 ) ||
( a == 35 && b == 39 ) ||
( a == 35 && b == 43 ) ||
( a == 36 && b == 39 ) ||
( a == 37 && b == 41 ) ||
( a == 38 && b == 41 ) ||
( a == 38 && b == 42 ) ||
( a == 39 && b == 40 ) ||
( a == 39 && b == 43 ) ||
( a == 40 && b == 43 ) ||
( a == 41 && b == 42 ) )
return (2 - 3*Nc2 + Nc4)/(16.*Nc3);
if( ( a == 20 && b == 25 ) ||
( a == 20 && b == 34 ) ||
( a == 20 && b == 37 ) ||
( a == 20 && b == 41 ) ||
( a == 20 && b == 42 ) ||
( a == 21 && b == 23 ) ||
( a == 21 && b == 35 ) ||
( a == 21 && b == 36 ) ||
( a == 21 && b == 40 ) ||
( a == 21 && b == 43 ) ||
( a == 22 && b == 24 ) ||
( a == 22 && b == 28 ) ||
( a == 22 && b == 31 ) ||
( a == 22 && b == 40 ) ||
( a == 22 && b == 43 ) ||
( a == 23 && b == 29 ) ||
( a == 23 && b == 30 ) ||
( a == 23 && b == 41 ) ||
( a == 23 && b == 42 ) ||
( a == 24 && b == 29 ) ||
( a == 24 && b == 30 ) ||
( a == 24 && b == 34 ) ||
( a == 24 && b == 37 ) ||
( a == 25 && b == 28 ) ||
( a == 25 && b == 31 ) ||
( a == 25 && b == 35 ) ||
( a == 25 && b == 36 ) ||
( a == 26 && b == 31 ) ||
( a == 26 && b == 32 ) ||
( a == 26 && b == 36 ) ||
( a == 26 && b == 39 ) ||
( a == 26 && b == 43 ) ||
( a == 27 && b == 29 ) ||
( a == 27 && b == 33 ) ||
( a == 27 && b == 37 ) ||
( a == 27 && b == 38 ) ||
( a == 27 && b == 42 ) ||
( a == 28 && b == 30 ) ||
( a == 28 && b == 38 ) ||
( a == 28 && b == 42 ) ||
( a == 29 && b == 39 ) ||
( a == 29 && b == 43 ) ||
( a == 30 && b == 32 ) ||
( a == 30 && b == 36 ) ||
( a == 31 && b == 33 ) ||
( a == 31 && b == 37 ) ||
( a == 32 && b == 37 ) ||
( a == 32 && b == 38 ) ||
( a == 32 && b == 41 ) ||
( a == 33 && b == 35 ) ||
( a == 33 && b == 39 ) ||
( a == 33 && b == 40 ) ||
( a == 34 && b == 36 ) ||
( a == 34 && b == 39 ) ||
( a == 34 && b == 40 ) ||
( a == 35 && b == 38 ) ||
( a == 35 && b == 41 ) ||
( a == 38 && b == 43 ) ||
( a == 39 && b == 41 ) ||
( a == 40 && b == 42 ) )
return (4 - 3*Nc2 - 2*Nc4 + Nc6)/(32.*Nc3);
if( ( a == 20 && b == 27 ) ||
( a == 20 && b == 31 ) ||
( a == 20 && b == 35 ) ||
( a == 20 && b == 39 ) ||
( a == 20 && b == 40 ) ||
( a == 21 && b == 26 ) ||
( a == 21 && b == 29 ) ||
( a == 21 && b == 33 ) ||
( a == 21 && b == 34 ) ||
( a == 21 && b == 41 ) ||
( a == 22 && b == 29 ) ||
( a == 22 && b == 33 ) ||
( a == 22 && b == 37 ) ||
( a == 22 && b == 38 ) ||
( a == 22 && b == 42 ) ||
( a == 23 && b == 27 ) ||
( a == 23 && b == 28 ) ||
( a == 23 && b == 32 ) ||
( a == 23 && b == 35 ) ||
( a == 23 && b == 43 ) ||
( a == 24 && b == 31 ) ||
( a == 24 && b == 32 ) ||
( a == 24 && b == 36 ) ||
( a == 24 && b == 39 ) ||
( a == 24 && b == 43 ) ||
( a == 25 && b == 26 ) ||
( a == 25 && b == 30 ) ||
( a == 25 && b == 37 ) ||
( a == 25 && b == 38 ) ||
( a == 25 && b == 41 ) ||
( a == 26 && b == 33 ) ||
( a == 26 && b == 38 ) ||
( a == 26 && b == 41 ) ||
( a == 27 && b == 32 ) ||
( a == 27 && b == 35 ) ||
( a == 27 && b == 39 ) ||
( a == 28 && b == 35 ) ||
( a == 28 && b == 36 ) ||
( a == 28 && b == 40 ) ||
( a == 28 && b == 43 ) ||
( a == 29 && b == 33 ) ||
( a == 29 && b == 34 ) ||
( a == 29 && b == 42 ) ||
( a == 30 && b == 34 ) ||
( a == 30 && b == 37 ) ||
( a == 30 && b == 41 ) ||
( a == 30 && b == 42 ) ||
( a == 31 && b == 36 ) ||
( a == 31 && b == 39 ) ||
( a == 31 && b == 40 ) ||
( a == 32 && b == 39 ) ||
( a == 32 && b == 43 ) ||
( a == 33 && b == 38 ) ||
( a == 34 && b == 41 ) ||
( a == 34 && b == 42 ) ||
( a == 35 && b == 40 ) ||
( a == 36 && b == 40 ) ||
( a == 36 && b == 43 ) ||
( a == 37 && b == 38 ) ||
( a == 37 && b == 42 ) )
return -(-1 + Nc2)/(8.*Nc3);
if( ( a == 20 && b == 30 ) ||
( a == 20 && b == 33 ) ||
( a == 21 && b == 28 ) ||
( a == 21 && b == 39 ) ||
( a == 22 && b == 27 ) ||
( a == 22 && b == 36 ) ||
( a == 23 && b == 34 ) ||
( a == 23 && b == 38 ) ||
( a == 24 && b == 26 ) ||
( a == 24 && b == 42 ) ||
( a == 25 && b == 32 ) ||
( a == 25 && b == 40 ) ||
( a == 26 && b == 35 ) ||
( a == 27 && b == 41 ) ||
( a == 28 && b == 37 ) ||
( a == 29 && b == 32 ) ||
( a == 29 && b == 40 ) ||
( a == 30 && b == 43 ) ||
( a == 31 && b == 34 ) ||
( a == 31 && b == 38 ) ||
( a == 33 && b == 43 ) ||
( a == 35 && b == 42 ) ||
( a == 36 && b == 41 ) ||
( a == 37 && b == 39 ) )
return (4 - 5*Nc2 + Nc4)/(32.*Nc3);
if( ( a == 20 && b == 43 ) ||
( a == 21 && b == 37 ) ||
( a == 22 && b == 41 ) ||
( a == 23 && b == 31 ) ||
( a == 24 && b == 35 ) ||
( a == 25 && b == 29 ) ||
( a == 26 && b == 42 ) ||
( a == 27 && b == 36 ) ||
( a == 28 && b == 39 ) ||
( a == 30 && b == 33 ) ||
( a == 32 && b == 40 ) ||
( a == 34 && b == 38 ) )
return -(-1 + Nc4)/(8.*Nc3);
}
if ( basis == id33bar888 ) {
if( ( a == 0 && b == 0 ) ||
( a == 1 && b == 1 ) )
return (2 - 3*Nc2 + Nc4)/8.;
if( ( a == 0 ) ||
( b == 1 ) )
return (1 - Nc2)/4.;
if( ( a == 0 && b == 2 ) ||
( a == 0 && b == 3 ) ||
( a == 0 && b == 4 ) ||
( a == 1 && b == 2 ) ||
( a == 1 && b == 3 ) ||
( a == 1 && b == 4 ) )
return 0;
if( ( a == 0 && b == 5 ) ||
( a == 0 && b == 8 ) ||
( a == 0 && b == 9 ) ||
( a == 1 && b == 6 ) ||
( a == 1 && b == 7 ) ||
( a == 1 && b == 10 ) )
return (2 - 3*Nc2 + Nc4)/(8.*Nc);
if( ( a == 0 && b == 6 ) ||
( a == 0 && b == 7 ) ||
( a == 0 && b == 10 ) ||
( a == 1 && b == 5 ) ||
( a == 1 && b == 8 ) ||
( a == 1 && b == 9 ) )
return -(-1 + Nc2)/(4.*Nc);
if( ( a == 2 && b == 2 ) ||
( a == 3 && b == 3 ) ||
( a == 4 && b == 4 ) )
return sqr(-1 + Nc2)/8.;
if( ( a == 2 && b == 3 ) ||
( a == 2 && b == 4 ) ||
( a == 3 && b == 4 ) )
return (-1 + Nc2)/8.;
if( ( a == 2 && b == 5 ) ||
( a == 2 && b == 6 ) ||
( a == 2 && b == 8 ) ||
( a == 2 && b == 10 ) ||
( a == 3 && b == 6 ) ||
( a == 3 && b == 7 ) ||
( a == 3 && b == 8 ) ||
( a == 3 && b == 9 ) ||
( a == 4 && b == 5 ) ||
( a == 4 && b == 7 ) ||
( a == 4 && b == 9 ) ||
( a == 4 && b == 10 ) )
return sqr(-1 + Nc2)/(8.*Nc);
if( ( a == 2 && b == 7 ) ||
( a == 2 && b == 9 ) ||
( a == 3 && b == 5 ) ||
( a == 3 && b == 10 ) ||
( a == 4 && b == 6 ) ||
( a == 4 && b == 8 ) )
return -(-1 + Nc2)/(8.*Nc);
if( ( a == 5 && b == 5 ) ||
( a == 6 && b == 6 ) ||
( a == 7 && b == 7 ) ||
( a == 8 && b == 8 ) ||
( a == 9 && b == 9 ) ||
( a == 10 && b == 10 ) )
return pow(-1 + Nc2,3.)/(8.*Nc2);
if( ( a == 5 && b == 6 ) ||
( a == 5 && b == 7 ) ||
( a == 6 && b == 9 ) ||
( a == 7 && b == 8 ) ||
( a == 8 && b == 10 ) ||
( a == 9 && b == 10 ) )
return -sqr(-1 + Nc2)/(8.*Nc2);
if( ( a == 5 && b == 8 ) ||
( a == 5 && b == 9 ) ||
( a == 6 && b == 7 ) ||
( a == 6 && b == 10 ) ||
( a == 7 && b == 10 ) ||
( a == 8 && b == 9 ) )
return 0.125 - 1/(8.*Nc2);
if( ( a == 5 && b == 10 ) ||
( a == 6 && b == 8 ) ||
( a == 7 && b == 9 ) )
return (-1 + Nc4)/(8.*Nc2);
}
if ( basis == id33bar33bar8 ) {
if( ( a == 0 && b == 0 ) ||
( a == 1 && b == 1 ) ||
( a == 2 && b == 2 ) ||
( a == 3 && b == 3 ) )
return (Nc*(-1 + Nc2))/2.;
if( ( a == 0 && b == 1 ) ||
( a == 0 && b == 3 ) ||
( a == 1 && b == 2 ) ||
( a == 2 && b == 3 ) )
return (-1 + Nc2)/2.;
if( ( a == 0 && b == 2 ) ||
( a == 1 && b == 3 ) )
return 0;
}
throw Exception() << "Cannot handle colour configuration" << Exception::abortnow;
}
double SimpleColourBasis2::tMatrixElement(size_t i, size_t a,
size_t b,
const vector<PDT::Colour>&,
const vector<PDT::Colour>& basis) const {
if ( id33bar.empty() )
makeIds();
if ( basis == id88 ) {
if(i == 0 && a == 0 && b == 0) return -1;
if(i == 0 && a == 1 && b == 0) return 1;
if(i == 1 && a == 0 && b == 0) return 1;
if(i == 1 && a == 1 && b == 0) return -1;
return 0.;
}
if ( basis == id33bar ) {
if(i == 0 && a == 0 && b == 0) return 1;
if(i == 1 && a == 0 && b == 0) return -1;
return 0.;
}
if ( basis == id888 ) {
if(i == 0 && a == 3 && b == 0) return -1;
if(i == 0 && a == 5 && b == 1) return -1;
if(i == 0 && a == 7 && b == 0) return 1;
if(i == 0 && a == 8 && b == 1) return 1;
if(i == 1 && a == 4 && b == 0) return 1;
if(i == 1 && a == 5 && b == 1) return 1;
if(i == 1 && a == 6 && b == 1) return -1;
if(i == 1 && a == 7 && b == 0) return -1;
if(i == 2 && a == 3 && b == 0) return 1;
if(i == 2 && a == 4 && b == 0) return -1;
if(i == 2 && a == 6 && b == 1) return 1;
if(i == 2 && a == 8 && b == 1) return -1;
return 0.;
}
if ( basis == id33bar8 ) {
if(i == 0 && a == 2 && b == 0) return 1;
if(i == 1 && a == 1 && b == 0) return -1;
if(i == 2 && a == 1 && b == 0) return 1;
if(i == 2 && a == 2 && b == 0) return -1;
return 0.;
}
if ( basis == id8888 ) {
if(i == 0 && a == 2 && b == 2) return -1;
if(i == 0 && a == 5 && b == 1) return -1;
if(i == 0 && a == 8 && b == 0) return -1;
if(i == 0 && a == 9 && b == 2) return 1;
if(i == 0 && a == 10 && b == 1) return 1;
if(i == 0 && a == 11 && b == 0) return 1;
if(i == 0 && a == 20 && b == 3) return -1;
if(i == 0 && a == 22 && b == 4) return -1;
if(i == 0 && a == 26 && b == 5) return -1;
if(i == 0 && a == 28 && b == 6) return -1;
if(i == 0 && a == 32 && b == 7) return -1;
if(i == 0 && a == 34 && b == 8) return -1;
if(i == 0 && a == 38 && b == 3) return 1;
if(i == 0 && a == 39 && b == 4) return 1;
if(i == 0 && a == 40 && b == 5) return 1;
if(i == 0 && a == 41 && b == 6) return 1;
if(i == 0 && a == 42 && b == 7) return 1;
if(i == 0 && a == 43 && b == 8) return 1;
if(i == 1 && a == 2 && b == 2) return 1;
if(i == 1 && a == 9 && b == 2) return -1;
if(i == 1 && a == 13 && b == 0) return -1;
if(i == 1 && a == 15 && b == 1) return -1;
if(i == 1 && a == 16 && b == 0) return 1;
if(i == 1 && a == 17 && b == 1) return 1;
if(i == 1 && a == 24 && b == 3) return 1;
if(i == 1 && a == 25 && b == 4) return 1;
if(i == 1 && a == 27 && b == 5) return 1;
if(i == 1 && a == 28 && b == 6) return 1;
if(i == 1 && a == 29 && b == 6) return -1;
if(i == 1 && a == 30 && b == 5) return -1;
if(i == 1 && a == 33 && b == 7) return 1;
if(i == 1 && a == 34 && b == 8) return 1;
if(i == 1 && a == 35 && b == 8) return -1;
if(i == 1 && a == 36 && b == 7) return -1;
if(i == 1 && a == 38 && b == 3) return -1;
if(i == 1 && a == 39 && b == 4) return -1;
if(i == 2 && a == 5 && b == 1) return 1;
if(i == 2 && a == 10 && b == 1) return -1;
if(i == 2 && a == 13 && b == 0) return 1;
if(i == 2 && a == 16 && b == 0) return -1;
if(i == 2 && a == 18 && b == 2) return -1;
if(i == 2 && a == 19 && b == 2) return 1;
if(i == 2 && a == 21 && b == 3) return 1;
if(i == 2 && a == 22 && b == 4) return 1;
if(i == 2 && a == 23 && b == 4) return -1;
if(i == 2 && a == 24 && b == 3) return -1;
if(i == 2 && a == 30 && b == 5) return 1;
if(i == 2 && a == 31 && b == 6) return 1;
if(i == 2 && a == 32 && b == 7) return 1;
if(i == 2 && a == 33 && b == 7) return -1;
if(i == 2 && a == 35 && b == 8) return 1;
if(i == 2 && a == 37 && b == 8) return -1;
if(i == 2 && a == 40 && b == 5) return -1;
if(i == 2 && a == 41 && b == 6) return -1;
if(i == 3 && a == 8 && b == 0) return 1;
if(i == 3 && a == 11 && b == 0) return -1;
if(i == 3 && a == 15 && b == 1) return 1;
if(i == 3 && a == 17 && b == 1) return -1;
if(i == 3 && a == 18 && b == 2) return 1;
if(i == 3 && a == 19 && b == 2) return -1;
if(i == 3 && a == 20 && b == 3) return 1;
if(i == 3 && a == 21 && b == 3) return -1;
if(i == 3 && a == 23 && b == 4) return 1;
if(i == 3 && a == 25 && b == 4) return -1;
if(i == 3 && a == 26 && b == 5) return 1;
if(i == 3 && a == 27 && b == 5) return -1;
if(i == 3 && a == 29 && b == 6) return 1;
if(i == 3 && a == 31 && b == 6) return -1;
if(i == 3 && a == 36 && b == 7) return 1;
if(i == 3 && a == 37 && b == 8) return 1;
if(i == 3 && a == 42 && b == 7) return -1;
if(i == 3 && a == 43 && b == 8) return -1;
return 0.;
}
if ( basis == id33bar88 ) {
if(i == 0 && a == 4 && b == 0) return 1;
if(i == 0 && a == 9 && b == 1) return 1;
if(i == 0 && a == 10 && b == 2) return 1;
if(i == 1 && a == 4 && b == 0) return -1;
if(i == 1 && a == 5 && b == 1) return -1;
if(i == 1 && a == 7 && b == 2) return -1;
if(i == 2 && a == 0 && b == 0) return -1;
if(i == 2 && a == 1 && b == 0) return 1;
if(i == 2 && a == 6 && b == 1) return 1;
if(i == 2 && a == 7 && b == 2) return 1;
if(i == 2 && a == 8 && b == 2) return -1;
if(i == 2 && a == 9 && b == 1) return -1;
if(i == 3 && a == 0 && b == 0) return 1;
if(i == 3 && a == 1 && b == 0) return -1;
if(i == 3 && a == 5 && b == 1) return 1;
if(i == 3 && a == 6 && b == 1) return -1;
if(i == 3 && a == 8 && b == 2) return 1;
if(i == 3 && a == 10 && b == 2) return -1;
return 0.;
}
if ( basis == id33bar33bar ) {
if(i == 0 && a == 0 && b == 0) return 1;
if(i == 0 && a == 1 && b == 1) return 1;
if(i == 1 && a == 1 && b == 1) return -1;
if(i == 1 && a == 2 && b == 0) return -1;
if(i == 2 && a == 2 && b == 0) return 1;
if(i == 2 && a == 3 && b == 1) return 1;
if(i == 3 && a == 0 && b == 0) return -1;
if(i == 3 && a == 3 && b == 1) return -1;
return 0.;
}
throw Exception() << "Cannot handle colour configuration" << Exception::abortnow;
return 0.;
}
bool SimpleColourBasis2::colourConnected(const cPDVector& sub,
const vector<PDT::Colour>& basis,
const pair<int,bool>& i,
const pair<int,bool>& j,
size_t a) const {
if ( id33bar.empty() )
makeIds();
// translate process to basis ids
map<cPDVector,map<size_t,size_t> >::const_iterator trans
= indexMap().find(sub);
assert(trans != indexMap().end());
int idColoured = i.second ? j.first : i.first;
idColoured = trans->second.find(idColoured)->second;
int idAntiColoured = i.second ? i.first : j.first;
idAntiColoured = trans->second.find(idAntiColoured)->second;
if ( basis == id88 ) {
return
a == 0 &&
((idColoured == 0 && idAntiColoured == 1) ||
(idColoured == 1 && idAntiColoured == 0));
}
if ( basis == id33bar ) {
return
a == 0 &&
(idColoured == 0 && idAntiColoured == 1);
}
if ( basis == id888 ) {
-return
-(a == 0 &&
-((idColoured == 0 && idAntiColoured == 1) ||
-(idColoured == 1 && idAntiColoured == 2) ||
-(idColoured == 2 && idAntiColoured == 0))) ||
-(a == 1 &&
-((idColoured == 0 && idAntiColoured == 2) ||
-(idColoured == 2 && idAntiColoured == 1) ||
-(idColoured == 1 && idAntiColoured == 0)));
+ return
+ (a == 0 &&
+ ((idColoured == 0 && idAntiColoured == 1) ||
+ (idColoured == 1 && idAntiColoured == 2) ||
+ (idColoured == 2 && idAntiColoured == 0))) ||
+ (a == 1 &&
+ ((idColoured == 0 && idAntiColoured == 2) ||
+ (idColoured == 2 && idAntiColoured == 1) ||
+ (idColoured == 1 && idAntiColoured == 0)));
}
if ( basis == id33bar8 ) {
return
a == 0 &&
((idColoured == 0 && idAntiColoured == 2) ||
(idColoured == 2 && idAntiColoured == 1));
}
if ( basis == id8888 ) {
return
(a == 0 &&
((idColoured == 0 && idAntiColoured == 3) ||
(idColoured == 3 && idAntiColoured == 0) ||
(idColoured == 1 && idAntiColoured == 2) ||
(idColoured == 2 && idAntiColoured == 1))) ||
(a == 1 &&
((idColoured == 0 && idAntiColoured == 2) ||
(idColoured == 2 && idAntiColoured == 0) ||
(idColoured == 1 && idAntiColoured == 3) ||
(idColoured == 3 && idAntiColoured == 1))) ||
(a == 2 &&
((idColoured == 0 && idAntiColoured == 1) ||
(idColoured == 1 && idAntiColoured == 0) ||
(idColoured == 2 && idAntiColoured == 3) ||
(idColoured == 3 && idAntiColoured == 2))) ||
(a == 3 &&
((idColoured == 0 && idAntiColoured == 1) ||
(idColoured == 1 && idAntiColoured == 2) ||
(idColoured == 2 && idAntiColoured == 3) ||
(idColoured == 3 && idAntiColoured == 0))) ||
(a == 4 &&
((idColoured == 0 && idAntiColoured == 1) ||
(idColoured == 1 && idAntiColoured == 3) ||
(idColoured == 3 && idAntiColoured == 2) ||
(idColoured == 2 && idAntiColoured == 0))) ||
(a == 5 &&
((idColoured == 0 && idAntiColoured == 2) ||
(idColoured == 2 && idAntiColoured == 1) ||
(idColoured == 1 && idAntiColoured == 3) ||
(idColoured == 3 && idAntiColoured == 0))) ||
(a == 6 &&
((idColoured == 0 && idAntiColoured == 2) ||
(idColoured == 2 && idAntiColoured == 3) ||
(idColoured == 3 && idAntiColoured == 1) ||
(idColoured == 1 && idAntiColoured == 0))) ||
(a == 7 &&
((idColoured == 0 && idAntiColoured == 3) ||
(idColoured == 3 && idAntiColoured == 1) ||
(idColoured == 1 && idAntiColoured == 2) ||
(idColoured == 2 && idAntiColoured == 0))) ||
(a == 8 &&
((idColoured == 0 && idAntiColoured == 3) ||
(idColoured == 3 && idAntiColoured == 2) ||
(idColoured == 2 && idAntiColoured == 1) ||
(idColoured == 1 && idAntiColoured == 0)));
}
if ( basis == id33bar88 ) {
return
(a == 0 &&
((idColoured == 2 && idAntiColoured == 3) ||
(idColoured == 3 && idAntiColoured == 2) ||
(idColoured == 0 && idAntiColoured == 1))) ||
(a == 1 &&
((idColoured == 0 && idAntiColoured == 2) ||
(idColoured == 3 && idAntiColoured == 1) ||
(idColoured == 2 && idAntiColoured == 3))) ||
(a == 2 &&
((idColoured == 0 && idAntiColoured == 3) ||
(idColoured == 2 && idAntiColoured == 1) ||
(idColoured == 3 && idAntiColoured == 2)));
}
if ( basis == id33bar33bar ) {
return
(a == 0 &&
((idColoured == 0 && idAntiColoured == 3) ||
(idColoured == 2 && idAntiColoured == 1))) ||
(a == 1 &&
((idColoured == 0 && idAntiColoured == 1) ||
(idColoured == 2 && idAntiColoured == 3)));
}
if ( basis == id88888 ) {
return
(a == 0 &&
((idColoured == 3 && idAntiColoured == 4) ||
(idColoured == 4 && idAntiColoured == 3) ||
(idColoured == 0 && idAntiColoured == 1) ||
(idColoured == 1 && idAntiColoured == 2) ||
(idColoured == 2 && idAntiColoured == 0))) ||
(a == 1 &&
((idColoured == 2 && idAntiColoured == 4) ||
(idColoured == 4 && idAntiColoured == 2) ||
(idColoured == 0 && idAntiColoured == 1) ||
(idColoured == 1 && idAntiColoured == 3) ||
(idColoured == 3 && idAntiColoured == 0))) ||
(a == 2 &&
((idColoured == 2 && idAntiColoured == 3) ||
(idColoured == 3 && idAntiColoured == 2) ||
(idColoured == 0 && idAntiColoured == 1) ||
(idColoured == 1 && idAntiColoured == 4) ||
(idColoured == 4 && idAntiColoured == 0))) ||
(a == 3 &&
((idColoured == 3 && idAntiColoured == 4) ||
(idColoured == 4 && idAntiColoured == 3) ||
(idColoured == 0 && idAntiColoured == 2) ||
(idColoured == 2 && idAntiColoured == 1) ||
(idColoured == 1 && idAntiColoured == 0))) ||
(a == 4 &&
((idColoured == 1 && idAntiColoured == 4) ||
(idColoured == 4 && idAntiColoured == 1) ||
(idColoured == 0 && idAntiColoured == 2) ||
(idColoured == 2 && idAntiColoured == 3) ||
(idColoured == 3 && idAntiColoured == 0))) ||
(a == 5 &&
((idColoured == 1 && idAntiColoured == 3) ||
(idColoured == 3 && idAntiColoured == 1) ||
(idColoured == 0 && idAntiColoured == 2) ||
(idColoured == 2 && idAntiColoured == 4) ||
(idColoured == 4 && idAntiColoured == 0))) ||
(a == 6 &&
((idColoured == 2 && idAntiColoured == 4) ||
(idColoured == 4 && idAntiColoured == 2) ||
(idColoured == 0 && idAntiColoured == 3) ||
(idColoured == 3 && idAntiColoured == 1) ||
(idColoured == 1 && idAntiColoured == 0))) ||
(a == 7 &&
((idColoured == 1 && idAntiColoured == 4) ||
(idColoured == 4 && idAntiColoured == 1) ||
(idColoured == 0 && idAntiColoured == 3) ||
(idColoured == 3 && idAntiColoured == 2) ||
(idColoured == 2 && idAntiColoured == 0))) ||
(a == 8 &&
((idColoured == 1 && idAntiColoured == 2) ||
(idColoured == 2 && idAntiColoured == 1) ||
(idColoured == 0 && idAntiColoured == 3) ||
(idColoured == 3 && idAntiColoured == 4) ||
(idColoured == 4 && idAntiColoured == 0))) ||
(a == 9 &&
((idColoured == 2 && idAntiColoured == 3) ||
(idColoured == 3 && idAntiColoured == 2) ||
(idColoured == 0 && idAntiColoured == 4) ||
(idColoured == 4 && idAntiColoured == 1) ||
(idColoured == 1 && idAntiColoured == 0))) ||
(a == 10 &&
((idColoured == 1 && idAntiColoured == 3) ||
(idColoured == 3 && idAntiColoured == 1) ||
(idColoured == 0 && idAntiColoured == 4) ||
(idColoured == 4 && idAntiColoured == 2) ||
(idColoured == 2 && idAntiColoured == 0))) ||
(a == 11 &&
((idColoured == 1 && idAntiColoured == 2) ||
(idColoured == 2 && idAntiColoured == 1) ||
(idColoured == 0 && idAntiColoured == 4) ||
(idColoured == 4 && idAntiColoured == 3) ||
(idColoured == 3 && idAntiColoured == 0))) ||
(a == 12 &&
((idColoured == 0 && idAntiColoured == 4) ||
(idColoured == 4 && idAntiColoured == 0) ||
(idColoured == 1 && idAntiColoured == 2) ||
(idColoured == 2 && idAntiColoured == 3) ||
(idColoured == 3 && idAntiColoured == 1))) ||
(a == 13 &&
((idColoured == 0 && idAntiColoured == 3) ||
(idColoured == 3 && idAntiColoured == 0) ||
(idColoured == 1 && idAntiColoured == 2) ||
(idColoured == 2 && idAntiColoured == 4) ||
(idColoured == 4 && idAntiColoured == 1))) ||
(a == 14 &&
((idColoured == 0 && idAntiColoured == 4) ||
(idColoured == 4 && idAntiColoured == 0) ||
(idColoured == 1 && idAntiColoured == 3) ||
(idColoured == 3 && idAntiColoured == 2) ||
(idColoured == 2 && idAntiColoured == 1))) ||
(a == 15 &&
((idColoured == 0 && idAntiColoured == 2) ||
(idColoured == 2 && idAntiColoured == 0) ||
(idColoured == 1 && idAntiColoured == 3) ||
(idColoured == 3 && idAntiColoured == 4) ||
(idColoured == 4 && idAntiColoured == 1))) ||
(a == 16 &&
((idColoured == 0 && idAntiColoured == 3) ||
(idColoured == 3 && idAntiColoured == 0) ||
(idColoured == 1 && idAntiColoured == 4) ||
(idColoured == 4 && idAntiColoured == 2) ||
(idColoured == 2 && idAntiColoured == 1))) ||
(a == 17 &&
((idColoured == 0 && idAntiColoured == 2) ||
(idColoured == 2 && idAntiColoured == 0) ||
(idColoured == 1 && idAntiColoured == 4) ||
(idColoured == 4 && idAntiColoured == 3) ||
(idColoured == 3 && idAntiColoured == 1))) ||
(a == 18 &&
((idColoured == 0 && idAntiColoured == 1) ||
(idColoured == 1 && idAntiColoured == 0) ||
(idColoured == 2 && idAntiColoured == 3) ||
(idColoured == 3 && idAntiColoured == 4) ||
(idColoured == 4 && idAntiColoured == 2))) ||
(a == 19 &&
((idColoured == 0 && idAntiColoured == 1) ||
(idColoured == 1 && idAntiColoured == 0) ||
(idColoured == 2 && idAntiColoured == 4) ||
(idColoured == 4 && idAntiColoured == 3) ||
(idColoured == 3 && idAntiColoured == 2))) ||
(a == 20 &&
((idColoured == 0 && idAntiColoured == 1) ||
(idColoured == 1 && idAntiColoured == 2) ||
(idColoured == 2 && idAntiColoured == 3) ||
(idColoured == 3 && idAntiColoured == 4) ||
(idColoured == 4 && idAntiColoured == 0))) ||
(a == 21 &&
((idColoured == 0 && idAntiColoured == 1) ||
(idColoured == 1 && idAntiColoured == 2) ||
(idColoured == 2 && idAntiColoured == 4) ||
(idColoured == 4 && idAntiColoured == 3) ||
(idColoured == 3 && idAntiColoured == 0))) ||
(a == 22 &&
((idColoured == 0 && idAntiColoured == 1) ||
(idColoured == 1 && idAntiColoured == 3) ||
(idColoured == 3 && idAntiColoured == 2) ||
(idColoured == 2 && idAntiColoured == 4) ||
(idColoured == 4 && idAntiColoured == 0))) ||
(a == 23 &&
((idColoured == 0 && idAntiColoured == 1) ||
(idColoured == 1 && idAntiColoured == 3) ||
(idColoured == 3 && idAntiColoured == 4) ||
(idColoured == 4 && idAntiColoured == 2) ||
(idColoured == 2 && idAntiColoured == 0))) ||
(a == 24 &&
((idColoured == 0 && idAntiColoured == 1) ||
(idColoured == 1 && idAntiColoured == 4) ||
(idColoured == 4 && idAntiColoured == 2) ||
(idColoured == 2 && idAntiColoured == 3) ||
(idColoured == 3 && idAntiColoured == 0))) ||
(a == 25 &&
((idColoured == 0 && idAntiColoured == 1) ||
(idColoured == 1 && idAntiColoured == 4) ||
(idColoured == 4 && idAntiColoured == 3) ||
(idColoured == 3 && idAntiColoured == 2) ||
(idColoured == 2 && idAntiColoured == 0))) ||
(a == 26 &&
((idColoured == 0 && idAntiColoured == 2) ||
(idColoured == 2 && idAntiColoured == 1) ||
(idColoured == 1 && idAntiColoured == 3) ||
(idColoured == 3 && idAntiColoured == 4) ||
(idColoured == 4 && idAntiColoured == 0))) ||
(a == 27 &&
((idColoured == 0 && idAntiColoured == 2) ||
(idColoured == 2 && idAntiColoured == 1) ||
(idColoured == 1 && idAntiColoured == 4) ||
(idColoured == 4 && idAntiColoured == 3) ||
(idColoured == 3 && idAntiColoured == 0))) ||
(a == 28 &&
((idColoured == 0 && idAntiColoured == 2) ||
(idColoured == 2 && idAntiColoured == 3) ||
(idColoured == 3 && idAntiColoured == 1) ||
(idColoured == 1 && idAntiColoured == 4) ||
(idColoured == 4 && idAntiColoured == 0))) ||
(a == 29 &&
((idColoured == 0 && idAntiColoured == 2) ||
(idColoured == 2 && idAntiColoured == 3) ||
(idColoured == 3 && idAntiColoured == 4) ||
(idColoured == 4 && idAntiColoured == 1) ||
(idColoured == 1 && idAntiColoured == 0))) ||
(a == 30 &&
((idColoured == 0 && idAntiColoured == 2) ||
(idColoured == 2 && idAntiColoured == 4) ||
(idColoured == 4 && idAntiColoured == 1) ||
(idColoured == 1 && idAntiColoured == 3) ||
(idColoured == 3 && idAntiColoured == 0))) ||
(a == 31 &&
((idColoured == 0 && idAntiColoured == 2) ||
(idColoured == 2 && idAntiColoured == 4) ||
(idColoured == 4 && idAntiColoured == 3) ||
(idColoured == 3 && idAntiColoured == 1) ||
(idColoured == 1 && idAntiColoured == 0))) ||
(a == 32 &&
((idColoured == 0 && idAntiColoured == 3) ||
(idColoured == 3 && idAntiColoured == 1) ||
(idColoured == 1 && idAntiColoured == 2) ||
(idColoured == 2 && idAntiColoured == 4) ||
(idColoured == 4 && idAntiColoured == 0))) ||
(a == 33 &&
((idColoured == 0 && idAntiColoured == 3) ||
(idColoured == 3 && idAntiColoured == 1) ||
(idColoured == 1 && idAntiColoured == 4) ||
(idColoured == 4 && idAntiColoured == 2) ||
(idColoured == 2 && idAntiColoured == 0))) ||
(a == 34 &&
((idColoured == 0 && idAntiColoured == 3) ||
(idColoured == 3 && idAntiColoured == 2) ||
(idColoured == 2 && idAntiColoured == 1) ||
(idColoured == 1 && idAntiColoured == 4) ||
(idColoured == 4 && idAntiColoured == 0))) ||
(a == 35 &&
((idColoured == 0 && idAntiColoured == 3) ||
(idColoured == 3 && idAntiColoured == 2) ||
(idColoured == 2 && idAntiColoured == 4) ||
(idColoured == 4 && idAntiColoured == 1) ||
(idColoured == 1 && idAntiColoured == 0))) ||
(a == 36 &&
((idColoured == 0 && idAntiColoured == 3) ||
(idColoured == 3 && idAntiColoured == 4) ||
(idColoured == 4 && idAntiColoured == 1) ||
(idColoured == 1 && idAntiColoured == 2) ||
(idColoured == 2 && idAntiColoured == 0))) ||
(a == 37 &&
((idColoured == 0 && idAntiColoured == 3) ||
(idColoured == 3 && idAntiColoured == 4) ||
(idColoured == 4 && idAntiColoured == 2) ||
(idColoured == 2 && idAntiColoured == 1) ||
(idColoured == 1 && idAntiColoured == 0))) ||
(a == 38 &&
((idColoured == 0 && idAntiColoured == 4) ||
(idColoured == 4 && idAntiColoured == 1) ||
(idColoured == 1 && idAntiColoured == 2) ||
(idColoured == 2 && idAntiColoured == 3) ||
(idColoured == 3 && idAntiColoured == 0))) ||
(a == 39 &&
((idColoured == 0 && idAntiColoured == 4) ||
(idColoured == 4 && idAntiColoured == 1) ||
(idColoured == 1 && idAntiColoured == 3) ||
(idColoured == 3 && idAntiColoured == 2) ||
(idColoured == 2 && idAntiColoured == 0))) ||
(a == 40 &&
((idColoured == 0 && idAntiColoured == 4) ||
(idColoured == 4 && idAntiColoured == 2) ||
(idColoured == 2 && idAntiColoured == 1) ||
(idColoured == 1 && idAntiColoured == 3) ||
(idColoured == 3 && idAntiColoured == 0))) ||
(a == 41 &&
((idColoured == 0 && idAntiColoured == 4) ||
(idColoured == 4 && idAntiColoured == 2) ||
(idColoured == 2 && idAntiColoured == 3) ||
(idColoured == 3 && idAntiColoured == 1) ||
(idColoured == 1 && idAntiColoured == 0))) ||
(a == 42 &&
((idColoured == 0 && idAntiColoured == 4) ||
(idColoured == 4 && idAntiColoured == 3) ||
(idColoured == 3 && idAntiColoured == 1) ||
(idColoured == 1 && idAntiColoured == 2) ||
(idColoured == 2 && idAntiColoured == 0))) ||
(a == 43 &&
((idColoured == 0 && idAntiColoured == 4) ||
(idColoured == 4 && idAntiColoured == 3) ||
(idColoured == 3 && idAntiColoured == 2) ||
(idColoured == 2 && idAntiColoured == 1) ||
(idColoured == 1 && idAntiColoured == 0)));
}
if ( basis == id33bar888 ) {
return
(a == 0 &&
((idColoured == 2 && idAntiColoured == 3) ||
(idColoured == 3 && idAntiColoured == 4) ||
(idColoured == 4 && idAntiColoured == 2) ||
(idColoured == 0 && idAntiColoured == 1))) ||
(a == 1 &&
((idColoured == 2 && idAntiColoured == 4) ||
(idColoured == 4 && idAntiColoured == 3) ||
(idColoured == 3 && idAntiColoured == 2) ||
(idColoured == 0 && idAntiColoured == 1))) ||
(a == 2 &&
((idColoured == 3 && idAntiColoured == 4) ||
(idColoured == 4 && idAntiColoured == 3) ||
(idColoured == 0 && idAntiColoured == 2) ||
(idColoured == 2 && idAntiColoured == 1))) ||
(a == 3 &&
((idColoured == 2 && idAntiColoured == 4) ||
(idColoured == 4 && idAntiColoured == 2) ||
(idColoured == 0 && idAntiColoured == 3) ||
(idColoured == 3 && idAntiColoured == 1))) ||
(a == 4 &&
((idColoured == 2 && idAntiColoured == 3) ||
(idColoured == 3 && idAntiColoured == 2) ||
(idColoured == 0 && idAntiColoured == 4) ||
(idColoured == 4 && idAntiColoured == 1))) ||
(a == 5 &&
((idColoured == 0 && idAntiColoured == 2) ||
(idColoured == 4 && idAntiColoured == 1) ||
(idColoured == 2 && idAntiColoured == 3) ||
(idColoured == 3 && idAntiColoured == 4))) ||
(a == 6 &&
((idColoured == 0 && idAntiColoured == 2) ||
(idColoured == 3 && idAntiColoured == 1) ||
(idColoured == 2 && idAntiColoured == 4) ||
(idColoured == 4 && idAntiColoured == 3))) ||
(a == 7 &&
((idColoured == 0 && idAntiColoured == 3) ||
(idColoured == 4 && idAntiColoured == 1) ||
(idColoured == 3 && idAntiColoured == 2) ||
(idColoured == 2 && idAntiColoured == 4))) ||
(a == 8 &&
((idColoured == 0 && idAntiColoured == 3) ||
(idColoured == 2 && idAntiColoured == 1) ||
(idColoured == 3 && idAntiColoured == 4) ||
(idColoured == 4 && idAntiColoured == 2))) ||
(a == 9 &&
((idColoured == 0 && idAntiColoured == 4) ||
(idColoured == 3 && idAntiColoured == 1) ||
(idColoured == 4 && idAntiColoured == 2) ||
(idColoured == 2 && idAntiColoured == 3))) ||
(a == 10 &&
((idColoured == 0 && idAntiColoured == 4) ||
(idColoured == 2 && idAntiColoured == 1) ||
(idColoured == 4 && idAntiColoured == 3) ||
(idColoured == 3 && idAntiColoured == 2)));
}
if ( basis == id33bar33bar8 ) {
return
(a == 0 &&
((idColoured == 0 && idAntiColoured == 4) ||
(idColoured == 4 && idAntiColoured == 3) ||
(idColoured == 2 && idAntiColoured == 1))) ||
(a == 1 &&
((idColoured == 0 && idAntiColoured == 4) ||
(idColoured == 4 && idAntiColoured == 1) ||
(idColoured == 2 && idAntiColoured == 3))) ||
(a == 2 &&
((idColoured == 0 && idAntiColoured == 3) ||
(idColoured == 2 && idAntiColoured == 4) ||
(idColoured == 4 && idAntiColoured == 1))) ||
(a == 3 &&
((idColoured == 0 && idAntiColoured == 1) ||
(idColoured == 2 && idAntiColoured == 4) ||
(idColoured == 4 && idAntiColoured == 3)));
}
throw Exception() << "Cannot handle colour configuration" << Exception::abortnow;
return false;
}
map<size_t,vector<vector<size_t> > > SimpleColourBasis2::basisList(const vector<PDT::Colour>& basis) const {
if ( id33bar.empty() )
makeIds();
map<size_t,vector<vector<size_t> > > blist;
vector<vector<size_t> > structures;
vector<size_t> structure;
if ( basis == id88 ) {
structures.clear();
structure.clear();
structure.push_back(0);
structure.push_back(1);
structures.push_back(structure);
blist[0] = structures;
return blist;
}
if ( basis == id33bar ) {
structures.clear();
structure.clear();
structure.push_back(0);
structure.push_back(1);
structures.push_back(structure);
blist[0] = structures;
return blist;
}
if ( basis == id888 ) {
structures.clear();
structure.clear();
structure.push_back(0);
structure.push_back(1);
structure.push_back(2);
structures.push_back(structure);
blist[0] = structures;
structures.clear();
structure.clear();
structure.push_back(0);
structure.push_back(2);
structure.push_back(1);
structures.push_back(structure);
blist[1] = structures;
return blist;
}
if ( basis == id33bar8 ) {
structures.clear();
structure.clear();
structure.push_back(0);
structure.push_back(2);
structure.push_back(1);
structures.push_back(structure);
blist[0] = structures;
return blist;
}
if ( basis == id8888 ) {
structures.clear();
structure.clear();
structure.push_back(0);
structure.push_back(3);
structures.push_back(structure);
structure.clear();
structure.push_back(1);
structure.push_back(2);
structures.push_back(structure);
blist[0] = structures;
structures.clear();
structure.clear();
structure.push_back(0);
structure.push_back(2);
structures.push_back(structure);
structure.clear();
structure.push_back(1);
structure.push_back(3);
structures.push_back(structure);
blist[1] = structures;
structures.clear();
structure.clear();
structure.push_back(0);
structure.push_back(1);
structures.push_back(structure);
structure.clear();
structure.push_back(2);
structure.push_back(3);
structures.push_back(structure);
blist[2] = structures;
structures.clear();
structure.clear();
structure.push_back(0);
structure.push_back(1);
structure.push_back(2);
structure.push_back(3);
structures.push_back(structure);
blist[3] = structures;
structures.clear();
structure.clear();
structure.push_back(0);
structure.push_back(1);
structure.push_back(3);
structure.push_back(2);
structures.push_back(structure);
blist[4] = structures;
structures.clear();
structure.clear();
structure.push_back(0);
structure.push_back(2);
structure.push_back(1);
structure.push_back(3);
structures.push_back(structure);
blist[5] = structures;
structures.clear();
structure.clear();
structure.push_back(0);
structure.push_back(2);
structure.push_back(3);
structure.push_back(1);
structures.push_back(structure);
blist[6] = structures;
structures.clear();
structure.clear();
structure.push_back(0);
structure.push_back(3);
structure.push_back(1);
structure.push_back(2);
structures.push_back(structure);
blist[7] = structures;
structures.clear();
structure.clear();
structure.push_back(0);
structure.push_back(3);
structure.push_back(2);
structure.push_back(1);
structures.push_back(structure);
blist[8] = structures;
return blist;
}
if ( basis == id33bar88 ) {
structures.clear();
structure.clear();
structure.push_back(2);
structure.push_back(3);
structures.push_back(structure);
structure.clear();
structure.push_back(0);
structure.push_back(1);
structures.push_back(structure);
blist[0] = structures;
structures.clear();
structure.clear();
structure.push_back(0);
structure.push_back(2);
structure.push_back(3);
structure.push_back(1);
structures.push_back(structure);
blist[1] = structures;
structures.clear();
structure.clear();
structure.push_back(0);
structure.push_back(3);
structure.push_back(2);
structure.push_back(1);
structures.push_back(structure);
blist[2] = structures;
return blist;
}
if ( basis == id33bar33bar ) {
structures.clear();
structure.clear();
structure.push_back(0);
structure.push_back(3);
structures.push_back(structure);
structure.clear();
structure.push_back(2);
structure.push_back(1);
structures.push_back(structure);
blist[0] = structures;
structures.clear();
structure.clear();
structure.push_back(0);
structure.push_back(1);
structures.push_back(structure);
structure.clear();
structure.push_back(2);
structure.push_back(3);
structures.push_back(structure);
blist[1] = structures;
return blist;
}
if ( basis == id88888 ) {
structures.clear();
structure.clear();
structure.push_back(3);
structure.push_back(4);
structures.push_back(structure);
structure.clear();
structure.push_back(0);
structure.push_back(1);
structure.push_back(2);
structures.push_back(structure);
blist[0] = structures;
structures.clear();
structure.clear();
structure.push_back(2);
structure.push_back(4);
structures.push_back(structure);
structure.clear();
structure.push_back(0);
structure.push_back(1);
structure.push_back(3);
structures.push_back(structure);
blist[1] = structures;
structures.clear();
structure.clear();
structure.push_back(2);
structure.push_back(3);
structures.push_back(structure);
structure.clear();
structure.push_back(0);
structure.push_back(1);
structure.push_back(4);
structures.push_back(structure);
blist[2] = structures;
structures.clear();
structure.clear();
structure.push_back(3);
structure.push_back(4);
structures.push_back(structure);
structure.clear();
structure.push_back(0);
structure.push_back(2);
structure.push_back(1);
structures.push_back(structure);
blist[3] = structures;
structures.clear();
structure.clear();
structure.push_back(1);
structure.push_back(4);
structures.push_back(structure);
structure.clear();
structure.push_back(0);
structure.push_back(2);
structure.push_back(3);
structures.push_back(structure);
blist[4] = structures;
structures.clear();
structure.clear();
structure.push_back(1);
structure.push_back(3);
structures.push_back(structure);
structure.clear();
structure.push_back(0);
structure.push_back(2);
structure.push_back(4);
structures.push_back(structure);
blist[5] = structures;
structures.clear();
structure.clear();
structure.push_back(2);
structure.push_back(4);
structures.push_back(structure);
structure.clear();
structure.push_back(0);
structure.push_back(3);
structure.push_back(1);
structures.push_back(structure);
blist[6] = structures;
structures.clear();
structure.clear();
structure.push_back(1);
structure.push_back(4);
structures.push_back(structure);
structure.clear();
structure.push_back(0);
structure.push_back(3);
structure.push_back(2);
structures.push_back(structure);
blist[7] = structures;
structures.clear();
structure.clear();
structure.push_back(1);
structure.push_back(2);
structures.push_back(structure);
structure.clear();
structure.push_back(0);
structure.push_back(3);
structure.push_back(4);
structures.push_back(structure);
blist[8] = structures;
structures.clear();
structure.clear();
structure.push_back(2);
structure.push_back(3);
structures.push_back(structure);
structure.clear();
structure.push_back(0);
structure.push_back(4);
structure.push_back(1);
structures.push_back(structure);
blist[9] = structures;
structures.clear();
structure.clear();
structure.push_back(1);
structure.push_back(3);
structures.push_back(structure);
structure.clear();
structure.push_back(0);
structure.push_back(4);
structure.push_back(2);
structures.push_back(structure);
blist[10] = structures;
structures.clear();
structure.clear();
structure.push_back(1);
structure.push_back(2);
structures.push_back(structure);
structure.clear();
structure.push_back(0);
structure.push_back(4);
structure.push_back(3);
structures.push_back(structure);
blist[11] = structures;
structures.clear();
structure.clear();
structure.push_back(0);
structure.push_back(4);
structures.push_back(structure);
structure.clear();
structure.push_back(1);
structure.push_back(2);
structure.push_back(3);
structures.push_back(structure);
blist[12] = structures;
structures.clear();
structure.clear();
structure.push_back(0);
structure.push_back(3);
structures.push_back(structure);
structure.clear();
structure.push_back(1);
structure.push_back(2);
structure.push_back(4);
structures.push_back(structure);
blist[13] = structures;
structures.clear();
structure.clear();
structure.push_back(0);
structure.push_back(4);
structures.push_back(structure);
structure.clear();
structure.push_back(1);
structure.push_back(3);
structure.push_back(2);
structures.push_back(structure);
blist[14] = structures;
structures.clear();
structure.clear();
structure.push_back(0);
structure.push_back(2);
structures.push_back(structure);
structure.clear();
structure.push_back(1);
structure.push_back(3);
structure.push_back(4);
structures.push_back(structure);
blist[15] = structures;
structures.clear();
structure.clear();
structure.push_back(0);
structure.push_back(3);
structures.push_back(structure);
structure.clear();
structure.push_back(1);
structure.push_back(4);
structure.push_back(2);
structures.push_back(structure);
blist[16] = structures;
structures.clear();
structure.clear();
structure.push_back(0);
structure.push_back(2);
structures.push_back(structure);
structure.clear();
structure.push_back(1);
structure.push_back(4);
structure.push_back(3);
structures.push_back(structure);
blist[17] = structures;
structures.clear();
structure.clear();
structure.push_back(0);
structure.push_back(1);
structures.push_back(structure);
structure.clear();
structure.push_back(2);
structure.push_back(3);
structure.push_back(4);
structures.push_back(structure);
blist[18] = structures;
structures.clear();
structure.clear();
structure.push_back(0);
structure.push_back(1);
structures.push_back(structure);
structure.clear();
structure.push_back(2);
structure.push_back(4);
structure.push_back(3);
structures.push_back(structure);
blist[19] = structures;
structures.clear();
structure.clear();
structure.push_back(0);
structure.push_back(1);
structure.push_back(2);
structure.push_back(3);
structure.push_back(4);
structures.push_back(structure);
blist[20] = structures;
structures.clear();
structure.clear();
structure.push_back(0);
structure.push_back(1);
structure.push_back(2);
structure.push_back(4);
structure.push_back(3);
structures.push_back(structure);
blist[21] = structures;
structures.clear();
structure.clear();
structure.push_back(0);
structure.push_back(1);
structure.push_back(3);
structure.push_back(2);
structure.push_back(4);
structures.push_back(structure);
blist[22] = structures;
structures.clear();
structure.clear();
structure.push_back(0);
structure.push_back(1);
structure.push_back(3);
structure.push_back(4);
structure.push_back(2);
structures.push_back(structure);
blist[23] = structures;
structures.clear();
structure.clear();
structure.push_back(0);
structure.push_back(1);
structure.push_back(4);
structure.push_back(2);
structure.push_back(3);
structures.push_back(structure);
blist[24] = structures;
structures.clear();
structure.clear();
structure.push_back(0);
structure.push_back(1);
structure.push_back(4);
structure.push_back(3);
structure.push_back(2);
structures.push_back(structure);
blist[25] = structures;
structures.clear();
structure.clear();
structure.push_back(0);
structure.push_back(2);
structure.push_back(1);
structure.push_back(3);
structure.push_back(4);
structures.push_back(structure);
blist[26] = structures;
structures.clear();
structure.clear();
structure.push_back(0);
structure.push_back(2);
structure.push_back(1);
structure.push_back(4);
structure.push_back(3);
structures.push_back(structure);
blist[27] = structures;
structures.clear();
structure.clear();
structure.push_back(0);
structure.push_back(2);
structure.push_back(3);
structure.push_back(1);
structure.push_back(4);
structures.push_back(structure);
blist[28] = structures;
structures.clear();
structure.clear();
structure.push_back(0);
structure.push_back(2);
structure.push_back(3);
structure.push_back(4);
structure.push_back(1);
structures.push_back(structure);
blist[29] = structures;
structures.clear();
structure.clear();
structure.push_back(0);
structure.push_back(2);
structure.push_back(4);
structure.push_back(1);
structure.push_back(3);
structures.push_back(structure);
blist[30] = structures;
structures.clear();
structure.clear();
structure.push_back(0);
structure.push_back(2);
structure.push_back(4);
structure.push_back(3);
structure.push_back(1);
structures.push_back(structure);
blist[31] = structures;
structures.clear();
structure.clear();
structure.push_back(0);
structure.push_back(3);
structure.push_back(1);
structure.push_back(2);
structure.push_back(4);
structures.push_back(structure);
blist[32] = structures;
structures.clear();
structure.clear();
structure.push_back(0);
structure.push_back(3);
structure.push_back(1);
structure.push_back(4);
structure.push_back(2);
structures.push_back(structure);
blist[33] = structures;
structures.clear();
structure.clear();
structure.push_back(0);
structure.push_back(3);
structure.push_back(2);
structure.push_back(1);
structure.push_back(4);
structures.push_back(structure);
blist[34] = structures;
structures.clear();
structure.clear();
structure.push_back(0);
structure.push_back(3);
structure.push_back(2);
structure.push_back(4);
structure.push_back(1);
structures.push_back(structure);
blist[35] = structures;
structures.clear();
structure.clear();
structure.push_back(0);
structure.push_back(3);
structure.push_back(4);
structure.push_back(1);
structure.push_back(2);
structures.push_back(structure);
blist[36] = structures;
structures.clear();
structure.clear();
structure.push_back(0);
structure.push_back(3);
structure.push_back(4);
structure.push_back(2);
structure.push_back(1);
structures.push_back(structure);
blist[37] = structures;
structures.clear();
structure.clear();
structure.push_back(0);
structure.push_back(4);
structure.push_back(1);
structure.push_back(2);
structure.push_back(3);
structures.push_back(structure);
blist[38] = structures;
structures.clear();
structure.clear();
structure.push_back(0);
structure.push_back(4);
structure.push_back(1);
structure.push_back(3);
structure.push_back(2);
structures.push_back(structure);
blist[39] = structures;
structures.clear();
structure.clear();
structure.push_back(0);
structure.push_back(4);
structure.push_back(2);
structure.push_back(1);
structure.push_back(3);
structures.push_back(structure);
blist[40] = structures;
structures.clear();
structure.clear();
structure.push_back(0);
structure.push_back(4);
structure.push_back(2);
structure.push_back(3);
structure.push_back(1);
structures.push_back(structure);
blist[41] = structures;
structures.clear();
structure.clear();
structure.push_back(0);
structure.push_back(4);
structure.push_back(3);
structure.push_back(1);
structure.push_back(2);
structures.push_back(structure);
blist[42] = structures;
structures.clear();
structure.clear();
structure.push_back(0);
structure.push_back(4);
structure.push_back(3);
structure.push_back(2);
structure.push_back(1);
structures.push_back(structure);
blist[43] = structures;
return blist;
}
if ( basis == id33bar888 ) {
structures.clear();
structure.clear();
structure.push_back(2);
structure.push_back(3);
structure.push_back(4);
structures.push_back(structure);
structure.clear();
structure.push_back(0);
structure.push_back(1);
structures.push_back(structure);
blist[0] = structures;
structures.clear();
structure.clear();
structure.push_back(2);
structure.push_back(4);
structure.push_back(3);
structures.push_back(structure);
structure.clear();
structure.push_back(0);
structure.push_back(1);
structures.push_back(structure);
blist[1] = structures;
structures.clear();
structure.clear();
structure.push_back(3);
structure.push_back(4);
structures.push_back(structure);
structure.clear();
structure.push_back(0);
structure.push_back(2);
structure.push_back(1);
structures.push_back(structure);
blist[2] = structures;
structures.clear();
structure.clear();
structure.push_back(2);
structure.push_back(4);
structures.push_back(structure);
structure.clear();
structure.push_back(0);
structure.push_back(3);
structure.push_back(1);
structures.push_back(structure);
blist[3] = structures;
structures.clear();
structure.clear();
structure.push_back(2);
structure.push_back(3);
structures.push_back(structure);
structure.clear();
structure.push_back(0);
structure.push_back(4);
structure.push_back(1);
structures.push_back(structure);
blist[4] = structures;
structures.clear();
structure.clear();
structure.push_back(0);
structure.push_back(2);
structure.push_back(3);
structure.push_back(4);
structure.push_back(1);
structures.push_back(structure);
blist[5] = structures;
structures.clear();
structure.clear();
structure.push_back(0);
structure.push_back(2);
structure.push_back(4);
structure.push_back(3);
structure.push_back(1);
structures.push_back(structure);
blist[6] = structures;
structures.clear();
structure.clear();
structure.push_back(0);
structure.push_back(3);
structure.push_back(2);
structure.push_back(4);
structure.push_back(1);
structures.push_back(structure);
blist[7] = structures;
structures.clear();
structure.clear();
structure.push_back(0);
structure.push_back(3);
structure.push_back(4);
structure.push_back(2);
structure.push_back(1);
structures.push_back(structure);
blist[8] = structures;
structures.clear();
structure.clear();
structure.push_back(0);
structure.push_back(4);
structure.push_back(2);
structure.push_back(3);
structure.push_back(1);
structures.push_back(structure);
blist[9] = structures;
structures.clear();
structure.clear();
structure.push_back(0);
structure.push_back(4);
structure.push_back(3);
structure.push_back(2);
structure.push_back(1);
structures.push_back(structure);
blist[10] = structures;
return blist;
}
if ( basis == id33bar33bar8 ) {
structures.clear();
structure.clear();
structure.push_back(0);
structure.push_back(4);
structure.push_back(3);
structures.push_back(structure);
structure.clear();
structure.push_back(2);
structure.push_back(1);
structures.push_back(structure);
blist[0] = structures;
structures.clear();
structure.clear();
structure.push_back(0);
structure.push_back(4);
structure.push_back(1);
structures.push_back(structure);
structure.clear();
structure.push_back(2);
structure.push_back(3);
structures.push_back(structure);
blist[1] = structures;
structures.clear();
structure.clear();
structure.push_back(0);
structure.push_back(3);
structures.push_back(structure);
structure.clear();
structure.push_back(2);
structure.push_back(4);
structure.push_back(1);
structures.push_back(structure);
blist[2] = structures;
structures.clear();
structure.clear();
structure.push_back(0);
structure.push_back(1);
structures.push_back(structure);
structure.clear();
structure.push_back(2);
structure.push_back(4);
structure.push_back(3);
structures.push_back(structure);
blist[3] = structures;
return blist;
}
throw Exception() << "Cannot handle colour configuration" << Exception::abortnow;
return blist;
}
void SimpleColourBasis2::makeIds() const {
id88 = vector<PDT::Colour>(2,PDT::Colour8);
id33bar.push_back(PDT::Colour3);
id33bar.push_back(PDT::Colour3bar);
id888 = vector<PDT::Colour>(3,PDT::Colour8);
id33bar8 = id33bar;
id33bar8.push_back(PDT::Colour8);
id8888 = vector<PDT::Colour>(4,PDT::Colour8);
id33bar88 = id33bar8;
id33bar88.push_back(PDT::Colour8);
id33bar33bar = id33bar;
id33bar33bar.push_back(PDT::Colour3);
id33bar33bar.push_back(PDT::Colour3bar);
id88888 = vector<PDT::Colour>(5,PDT::Colour8);
id33bar888 = id33bar88;
id33bar888.push_back(PDT::Colour8);
id33bar33bar8 = id33bar33bar;
id33bar33bar8.push_back(PDT::Colour8);
}
// If needed, insert default implementations of virtual function defined
// in the InterfacedBase class here (using ThePEG-interfaced-impl in Emacs).
void SimpleColourBasis2::persistentOutput(PersistentOStream &) const {}
void SimpleColourBasis2::persistentInput(PersistentIStream &, int) {}
// *** Attention *** The following static variable is needed for the type
// description system in ThePEG. Please check that the template arguments
// are correct (the class and its base class), and that the constructor
// arguments are correct (the class name and the name of the dynamically
// loadable library where the class implementation can be found).
DescribeClass<SimpleColourBasis2,ColourBasis>
describeHerwigSimpleColourBasis2("Herwig::SimpleColourBasis2", "HwMatchbox.so");
void SimpleColourBasis2::Init() {
static ClassDocumentation<SimpleColourBasis2> documentation
("SimpleColourBasis2 implements the colour algebra needed for "
"processes with four coloured legs at NLO. It mainly "
"serves as an example for the general ColourBasis interface.");
}

File Metadata

Mime Type
text/x-diff
Expires
Tue, Nov 19, 4:33 PM (1 d, 11 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3805188
Default Alt Text
(131 KB)

Event Timeline