2016-01-02 14:51:32 +00:00
|
|
|
/*************************************************************************************
|
|
|
|
|
|
|
|
Grid physics library, www.github.com/paboyle/Grid
|
|
|
|
|
|
|
|
Source file: ./lib/qcd/action/fermion/WilsonFermion.h
|
|
|
|
|
|
|
|
Copyright (C) 2015
|
|
|
|
|
|
|
|
Author: Peter Boyle <pabobyle@ph.ed.ac.uk>
|
|
|
|
Author: Peter Boyle <paboyle@ph.ed.ac.uk>
|
|
|
|
Author: paboyle <paboyle@ph.ed.ac.uk>
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License along
|
|
|
|
with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
|
|
|
|
See the full license in the file "LICENSE" in the top level distribution directory
|
|
|
|
*************************************************************************************/
|
|
|
|
/* END LEGAL */
|
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>
|
2015-08-15 23:25:49 +01:00
|
|
|
class WilsonFermion : public WilsonKernels<Impl>, public WilsonFermionStatic
|
2015-05-31 15:09:02 +01:00
|
|
|
{
|
|
|
|
public:
|
2015-08-15 23:25:49 +01:00
|
|
|
INHERIT_IMPL_TYPES(Impl);
|
|
|
|
typedef WilsonKernels<Impl> Kernels;
|
2015-05-31 15:09:02 +01:00
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////
|
|
|
|
// 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) ;
|
2015-12-17 22:34:28 +00:00
|
|
|
|
|
|
|
// allow override for twisted mass and clover
|
|
|
|
virtual void Mooee(const FermionField &in, FermionField &out) ;
|
|
|
|
virtual void MooeeDag(const FermionField &in, FermionField &out) ;
|
|
|
|
virtual void MooeeInv(const FermionField &in, FermionField &out) ;
|
|
|
|
virtual 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-11-06 11:30:17 +00:00
|
|
|
void DerivInternal(StencilImpl & st,
|
2015-08-10 20:47:44 +01:00
|
|
|
DoubledGaugeField & U,
|
|
|
|
GaugeField &mat,
|
|
|
|
const FermionField &A,
|
|
|
|
const FermionField &B,
|
|
|
|
int dag);
|
|
|
|
|
2015-11-06 11:30:17 +00:00
|
|
|
void DhopInternal(StencilImpl & st,DoubledGaugeField & U,
|
2015-08-10 20:47:44 +01:00
|
|
|
const FermionField &in, FermionField &out,int dag) ;
|
|
|
|
|
2016-01-04 14:18:40 +00:00
|
|
|
void DhopInternalCommsThenCompute(StencilImpl & st,DoubledGaugeField & U,
|
|
|
|
const FermionField &in, FermionField &out,int dag) ;
|
|
|
|
void DhopInternalCommsOverlapCompute(StencilImpl & st,DoubledGaugeField & U,
|
2016-01-03 01:38:11 +00:00
|
|
|
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,
|
2015-08-15 23:25:49 +01:00
|
|
|
RealD _mass,
|
|
|
|
const ImplParams &p= ImplParams()
|
|
|
|
) ;
|
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
|
2015-11-06 11:30:17 +00:00
|
|
|
StencilImpl Stencil;
|
|
|
|
StencilImpl StencilEven;
|
|
|
|
StencilImpl StencilOdd;
|
2015-05-31 15:09:02 +01:00
|
|
|
|
|
|
|
// 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
|
|
|
|
|
|
|
};
|
|
|
|
|
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
|