2016-04-06 11:00:07 +01:00
|
|
|
|
2016-01-02 14:51:32 +00:00
|
|
|
/*************************************************************************************
|
|
|
|
|
|
|
|
Grid physics library, www.github.com/paboyle/Grid
|
|
|
|
|
|
|
|
Source file: ./lib/qcd/action/fermion/WilsonFermion5D.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-06-04 13:28:37 +01:00
|
|
|
#ifndef GRID_QCD_WILSON_FERMION_5D_H
|
|
|
|
#define GRID_QCD_WILSON_FERMION_5D_H
|
2015-05-31 15:09:02 +01:00
|
|
|
|
2016-10-12 11:45:22 +01:00
|
|
|
#include <Grid/Stat.h>
|
|
|
|
|
2015-05-31 15:09:02 +01:00
|
|
|
namespace Grid {
|
|
|
|
|
|
|
|
namespace QCD {
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// This is the 4d red black case appropriate to support
|
|
|
|
//
|
|
|
|
// parity = (x+y+z+t)|2;
|
|
|
|
// generalised five dim fermions like mobius, zolotarev etc..
|
|
|
|
//
|
|
|
|
// i.e. even even contains fifth dim hopping term.
|
|
|
|
//
|
|
|
|
// [DIFFERS from original CPS red black implementation parity = (x+y+z+t+s)|2 ]
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
2015-08-10 20:47:44 +01:00
|
|
|
|
|
|
|
class WilsonFermion5DStatic {
|
|
|
|
public:
|
|
|
|
// S-direction is INNERMOST and takes no part in the parity.
|
|
|
|
static const std::vector<int> directions;
|
|
|
|
static const std::vector<int> displacements;
|
|
|
|
const int npoint = 8;
|
|
|
|
};
|
|
|
|
|
|
|
|
template<class Impl>
|
2015-08-15 23:25:49 +01:00
|
|
|
class WilsonFermion5D : public WilsonKernels<Impl>, public WilsonFermion5DStatic
|
2015-05-31 15:09:02 +01:00
|
|
|
{
|
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;
|
2016-10-12 11:45:22 +01:00
|
|
|
PmuStat stat;
|
2016-06-09 09:12:36 +01:00
|
|
|
|
2016-10-06 09:25:12 +01:00
|
|
|
void Report(void);
|
|
|
|
void ZeroCounters(void);
|
2016-10-06 17:52:45 +01:00
|
|
|
double DhopCalls;
|
|
|
|
double DhopCommTime;
|
|
|
|
double DhopComputeTime;
|
|
|
|
|
|
|
|
double DerivCalls;
|
|
|
|
double DerivCommTime;
|
|
|
|
double DerivComputeTime;
|
|
|
|
double DerivDhopComputeTime;
|
2016-10-06 09:25:12 +01:00
|
|
|
|
2015-05-31 15:09:02 +01:00
|
|
|
///////////////////////////////////////////////////////////////
|
|
|
|
// Implement the abstract base
|
|
|
|
///////////////////////////////////////////////////////////////
|
|
|
|
GridBase *GaugeGrid(void) { return _FourDimGrid ;}
|
|
|
|
GridBase *GaugeRedBlackGrid(void) { return _FourDimRedBlackGrid ;}
|
|
|
|
GridBase *FermionGrid(void) { return _FiveDimGrid;}
|
|
|
|
GridBase *FermionRedBlackGrid(void) { return _FiveDimRedBlackGrid;}
|
|
|
|
|
2015-06-02 16:57:12 +01:00
|
|
|
// full checkerboard operations; leave unimplemented as abstract for now
|
2015-08-10 20:47:44 +01:00
|
|
|
virtual RealD M (const FermionField &in, FermionField &out){assert(0); return 0.0;};
|
|
|
|
virtual RealD Mdag (const FermionField &in, FermionField &out){assert(0); return 0.0;};
|
2015-06-02 16:57:12 +01:00
|
|
|
|
|
|
|
// half checkerboard operations; leave unimplemented as abstract for now
|
2015-08-10 20:47:44 +01:00
|
|
|
virtual void Meooe (const FermionField &in, FermionField &out){assert(0);};
|
|
|
|
virtual void Mooee (const FermionField &in, FermionField &out){assert(0);};
|
|
|
|
virtual void MooeeInv (const FermionField &in, FermionField &out){assert(0);};
|
2015-07-26 02:54:38 +01:00
|
|
|
|
2015-08-10 20:47:44 +01:00
|
|
|
virtual void MeooeDag (const FermionField &in, FermionField &out){assert(0);};
|
|
|
|
virtual void MooeeDag (const FermionField &in, FermionField &out){assert(0);};
|
|
|
|
virtual void MooeeInvDag (const FermionField &in, FermionField &out){assert(0);};
|
2016-04-19 23:38:01 +01:00
|
|
|
virtual void Mdir (const FermionField &in, FermionField &out,int dir,int disp){assert(0);}; // case by case Wilson, Clover, Cayley, ContFrac, PartFrac
|
2015-06-02 16:57:12 +01:00
|
|
|
|
2015-08-10 20:47:44 +01:00
|
|
|
// These can be overridden by fancy 5d chiral action
|
|
|
|
virtual void DhopDeriv (GaugeField &mat,const FermionField &U,const FermionField &V,int dag);
|
|
|
|
virtual void DhopDerivEO(GaugeField &mat,const FermionField &U,const FermionField &V,int dag);
|
|
|
|
virtual void DhopDerivOE(GaugeField &mat,const FermionField &U,const FermionField &V,int dag);
|
2015-07-26 02:54:38 +01:00
|
|
|
|
2015-06-02 16:57:12 +01:00
|
|
|
// Implement hopping term non-hermitian hopping term; half cb or both
|
|
|
|
// Implement s-diagonal DW
|
2015-08-10 20:47:44 +01:00
|
|
|
void DW (const FermionField &in, FermionField &out,int dag);
|
|
|
|
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-06-08 12:04:59 +01:00
|
|
|
// add a DhopComm
|
|
|
|
// -- suboptimal interface will presently trigger multiple comms.
|
2015-08-10 20:47:44 +01:00
|
|
|
void DhopDir(const FermionField &in, FermionField &out,int dir,int disp);
|
2015-06-08 12:04:59 +01:00
|
|
|
|
2015-05-31 15:09:02 +01:00
|
|
|
///////////////////////////////////////////////////////////////
|
|
|
|
// New methods added
|
|
|
|
///////////////////////////////////////////////////////////////
|
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,
|
2015-07-26 02:54:38 +01:00
|
|
|
int dag);
|
|
|
|
|
2015-11-06 11:30:17 +00:00
|
|
|
void DhopInternal(StencilImpl & st,
|
2015-05-31 15:09:02 +01:00
|
|
|
LebesgueOrder &lo,
|
2015-08-10 20:47:44 +01:00
|
|
|
DoubledGaugeField &U,
|
|
|
|
const FermionField &in,
|
|
|
|
FermionField &out,
|
2015-05-31 15:09:02 +01:00
|
|
|
int dag);
|
|
|
|
|
|
|
|
// Constructors
|
2015-08-10 20:47:44 +01:00
|
|
|
WilsonFermion5D(GaugeField &_Umu,
|
|
|
|
GridCartesian &FiveDimGrid,
|
|
|
|
GridRedBlackCartesian &FiveDimRedBlackGrid,
|
|
|
|
GridCartesian &FourDimGrid,
|
|
|
|
GridRedBlackCartesian &FourDimRedBlackGrid,
|
2015-08-15 23:25:49 +01:00
|
|
|
double _M5,const ImplParams &p= ImplParams());
|
2015-05-31 15:09:02 +01:00
|
|
|
|
2016-04-19 23:38:01 +01:00
|
|
|
// Constructors
|
2016-07-14 23:55:26 +01:00
|
|
|
/*
|
2016-04-19 23:38:01 +01:00
|
|
|
WilsonFermion5D(int simd,
|
|
|
|
GaugeField &_Umu,
|
|
|
|
GridCartesian &FiveDimGrid,
|
|
|
|
GridRedBlackCartesian &FiveDimRedBlackGrid,
|
|
|
|
GridCartesian &FourDimGrid,
|
|
|
|
double _M5,const ImplParams &p= ImplParams());
|
2016-07-14 23:55:26 +01:00
|
|
|
*/
|
2016-04-19 23:38:01 +01:00
|
|
|
|
2015-05-31 15:09:02 +01:00
|
|
|
// DoubleStore
|
2015-08-10 20:47:44 +01:00
|
|
|
void ImportGauge(const GaugeField &_Umu);
|
2015-05-31 15:09:02 +01:00
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////
|
|
|
|
// Data members require to support the functionality
|
|
|
|
///////////////////////////////////////////////////////////////
|
2016-04-06 11:00:07 +01:00
|
|
|
public:
|
2015-05-31 15:09:02 +01:00
|
|
|
|
|
|
|
// Add these to the support from Wilson
|
|
|
|
GridBase *_FourDimGrid;
|
|
|
|
GridBase *_FourDimRedBlackGrid;
|
|
|
|
GridBase *_FiveDimGrid;
|
|
|
|
GridBase *_FiveDimRedBlackGrid;
|
|
|
|
|
|
|
|
double M5;
|
|
|
|
int Ls;
|
|
|
|
|
|
|
|
//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
|
|
|
|
|
|
|
LebesgueOrder Lebesgue;
|
|
|
|
LebesgueOrder LebesgueEvenOdd;
|
|
|
|
|
|
|
|
// 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
|
|
|
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|