2015-05-31 15:09:02 +01:00
|
|
|
#ifndef GRID_QCD_WILSON_FERMION_H
|
|
|
|
#define GRID_QCD_WILSON_FERMION_H
|
|
|
|
|
|
|
|
namespace Grid {
|
|
|
|
|
|
|
|
namespace QCD {
|
|
|
|
|
2015-08-10 20:47:44 +01:00
|
|
|
class WilsonFermionStatic {
|
|
|
|
public:
|
|
|
|
static int HandOptDslash; // these are a temporary hack
|
|
|
|
static int MortonOrder;
|
|
|
|
static const std::vector<int> directions ;
|
|
|
|
static const std::vector<int> displacements;
|
|
|
|
static const int npoint=8;
|
|
|
|
};
|
|
|
|
|
|
|
|
template<class Impl>
|
|
|
|
class WilsonFermion : public FermionOperator<Impl>, public WilsonFermionStatic
|
2015-05-31 15:09:02 +01:00
|
|
|
{
|
2015-08-10 20:47:44 +01:00
|
|
|
#include <qcd/action/fermion/FermionImplTypedefs.h>
|
|
|
|
|
2015-05-31 15:09:02 +01:00
|
|
|
public:
|
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////
|
|
|
|
// Implement the abstract base
|
|
|
|
///////////////////////////////////////////////////////////////
|
|
|
|
GridBase *GaugeGrid(void) { return _grid ;}
|
|
|
|
GridBase *GaugeRedBlackGrid(void) { return _cbgrid ;}
|
|
|
|
GridBase *FermionGrid(void) { return _grid;}
|
|
|
|
GridBase *FermionRedBlackGrid(void) { return _cbgrid;}
|
|
|
|
|
2015-08-10 20:47:44 +01:00
|
|
|
//////////////////////////////////////////////////////////////////
|
|
|
|
// override multiply; cut number routines if pass dagger argument
|
|
|
|
// and also make interface more uniformly consistent
|
|
|
|
//////////////////////////////////////////////////////////////////
|
|
|
|
RealD M(const FermionField &in, FermionField &out);
|
|
|
|
RealD Mdag(const FermionField &in, FermionField &out);
|
|
|
|
|
|
|
|
/////////////////////////////////////////////////////////
|
|
|
|
// half checkerboard operations
|
|
|
|
// could remain virtual so we can derive Clover from Wilson base
|
|
|
|
/////////////////////////////////////////////////////////
|
|
|
|
void Meooe(const FermionField &in, FermionField &out) ;
|
|
|
|
void MeooeDag(const FermionField &in, FermionField &out) ;
|
|
|
|
void Mooee(const FermionField &in, FermionField &out) ;
|
|
|
|
void MooeeDag(const FermionField &in, FermionField &out) ;
|
|
|
|
void MooeeInv(const FermionField &in, FermionField &out) ;
|
|
|
|
void MooeeInvDag(const FermionField &in, FermionField &out) ;
|
2015-05-31 15:09:02 +01:00
|
|
|
|
2015-07-26 02:54:38 +01:00
|
|
|
////////////////////////
|
2015-08-10 20:47:44 +01:00
|
|
|
// Derivative interface
|
2015-07-26 02:54:38 +01:00
|
|
|
////////////////////////
|
2015-08-10 20:47:44 +01:00
|
|
|
// Interface calls an internal routine
|
|
|
|
void DhopDeriv(GaugeField &mat,const FermionField &U,const FermionField &V,int dag);
|
|
|
|
void DhopDerivOE(GaugeField &mat,const FermionField &U,const FermionField &V,int dag);
|
|
|
|
void DhopDerivEO(GaugeField &mat,const FermionField &U,const FermionField &V,int dag);
|
2015-07-26 02:54:38 +01:00
|
|
|
|
|
|
|
|
2015-08-10 20:47:44 +01:00
|
|
|
///////////////////////////////////////////////////////////////
|
2015-05-31 15:09:02 +01:00
|
|
|
// non-hermitian hopping term; half cb or both
|
2015-08-10 20:47:44 +01:00
|
|
|
///////////////////////////////////////////////////////////////
|
|
|
|
void Dhop(const FermionField &in, FermionField &out,int dag) ;
|
|
|
|
void DhopOE(const FermionField &in, FermionField &out,int dag) ;
|
|
|
|
void DhopEO(const FermionField &in, FermionField &out,int dag) ;
|
2015-05-31 15:09:02 +01:00
|
|
|
|
2015-08-10 20:47:44 +01:00
|
|
|
///////////////////////////////////////////////////////////////
|
|
|
|
// Multigrid assistance; force term uses too
|
|
|
|
///////////////////////////////////////////////////////////////
|
|
|
|
void Mdir (const FermionField &in, FermionField &out,int dir,int disp) ;
|
|
|
|
void DhopDir(const FermionField &in, FermionField &out,int dir,int disp);
|
|
|
|
void DhopDirDisp(const FermionField &in, FermionField &out,int dirdisp,int gamma,int dag) ;
|
2015-06-08 12:04:59 +01:00
|
|
|
|
2015-05-31 15:09:02 +01:00
|
|
|
///////////////////////////////////////////////////////////////
|
|
|
|
// Extra methods added by derived
|
|
|
|
///////////////////////////////////////////////////////////////
|
2015-08-10 20:47:44 +01:00
|
|
|
void DerivInternal(CartesianStencil & st,
|
|
|
|
DoubledGaugeField & U,
|
|
|
|
GaugeField &mat,
|
|
|
|
const FermionField &A,
|
|
|
|
const FermionField &B,
|
|
|
|
int dag);
|
|
|
|
|
|
|
|
void DhopInternal(CartesianStencil & st,DoubledGaugeField & U,
|
|
|
|
const FermionField &in, FermionField &out,int dag) ;
|
|
|
|
|
2015-05-31 15:09:02 +01:00
|
|
|
|
|
|
|
// Constructor
|
2015-08-10 20:47:44 +01:00
|
|
|
WilsonFermion(GaugeField &_Umu,
|
|
|
|
GridCartesian &Fgrid,
|
|
|
|
GridRedBlackCartesian &Hgrid,
|
|
|
|
RealD _mass) ;
|
2015-05-31 15:09:02 +01:00
|
|
|
|
2015-08-10 20:47:44 +01:00
|
|
|
// DoubleStore impl dependent
|
|
|
|
void ImportGauge(const GaugeField &_Umu);
|
2015-05-31 15:09:02 +01:00
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////
|
|
|
|
// Data members require to support the functionality
|
|
|
|
///////////////////////////////////////////////////////////////
|
|
|
|
|
2015-07-26 02:54:38 +01:00
|
|
|
// protected:
|
|
|
|
public:
|
2015-05-31 15:09:02 +01:00
|
|
|
|
2015-06-02 16:57:12 +01:00
|
|
|
RealD mass;
|
2015-05-31 15:09:02 +01:00
|
|
|
|
|
|
|
GridBase * _grid;
|
|
|
|
GridBase * _cbgrid;
|
|
|
|
|
|
|
|
//Defines the stencils for even and odd
|
|
|
|
CartesianStencil Stencil;
|
|
|
|
CartesianStencil StencilEven;
|
|
|
|
CartesianStencil StencilOdd;
|
|
|
|
|
|
|
|
// Copy of the gauge field , with even and odd subsets
|
2015-08-10 20:47:44 +01:00
|
|
|
DoubledGaugeField Umu;
|
|
|
|
DoubledGaugeField UmuEven;
|
|
|
|
DoubledGaugeField UmuOdd;
|
2015-05-31 15:09:02 +01:00
|
|
|
|
|
|
|
// Comms buffer
|
2015-08-10 20:47:44 +01:00
|
|
|
std::vector<SiteHalfSpinor,alignedAllocator<SiteHalfSpinor> > comm_buf;
|
2015-05-31 15:09:02 +01:00
|
|
|
|
|
|
|
};
|
|
|
|
|
2015-08-10 20:47:44 +01:00
|
|
|
typedef WilsonFermion<WilsonImplF> WilsonFermionF;
|
|
|
|
typedef WilsonFermion<WilsonImplD> WilsonFermionD;
|
|
|
|
|
2015-05-31 15:09:02 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|