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
|
|
|
|
2017-02-22 18:09:33 +00:00
|
|
|
#include <Grid/perfmon/Stat.h>
|
2016-10-12 11:45:22 +01:00
|
|
|
|
2015-05-31 15:09:02 +01:00
|
|
|
namespace Grid {
|
2016-10-22 18:14:27 +01:00
|
|
|
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-05-31 15:09:02 +01:00
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// 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-12-08 17:28:28 +00:00
|
|
|
FermionField _tmp;
|
|
|
|
FermionField &tmp(void) { return _tmp; }
|
|
|
|
|
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;
|
2017-02-07 06:37:10 +00:00
|
|
|
double DhopComputeTime2;
|
|
|
|
double DhopFaceTime;
|
|
|
|
double DhopTotalTime;
|
2016-10-06 17:52:45 +01:00
|
|
|
|
|
|
|
double DerivCalls;
|
|
|
|
double DerivCommTime;
|
|
|
|
double DerivComputeTime;
|
|
|
|
double DerivDhopComputeTime;
|
2016-06-09 09:12:36 +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
|
|
|
|
2018-05-03 12:31:36 +01:00
|
|
|
void MomentumSpacePropagatorHt_5d(FermionField &out,const FermionField &in,RealD mass,std::vector<double> twist) ;
|
|
|
|
void MomentumSpacePropagatorHt(FermionField &out,const FermionField &in,RealD mass,std::vector<double> twist) ;
|
|
|
|
void MomentumSpacePropagatorHw(FermionField &out,const FermionField &in,RealD mass,std::vector<double> twist) ;
|
2016-09-26 09:39:09 +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.
|
2016-10-22 18:14:27 +01:00
|
|
|
void DhopDir(const FermionField &in, FermionField &out,int dir,int disp);
|
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////
|
|
|
|
// New methods added
|
|
|
|
///////////////////////////////////////////////////////////////
|
|
|
|
void DerivInternal(StencilImpl & st,
|
|
|
|
DoubledGaugeField & U,
|
|
|
|
GaugeField &mat,
|
|
|
|
const FermionField &A,
|
|
|
|
const FermionField &B,
|
|
|
|
int dag);
|
|
|
|
|
|
|
|
void DhopInternal(StencilImpl & st,
|
|
|
|
LebesgueOrder &lo,
|
|
|
|
DoubledGaugeField &U,
|
|
|
|
const FermionField &in,
|
|
|
|
FermionField &out,
|
|
|
|
int dag);
|
2017-02-07 06:37:10 +00:00
|
|
|
|
|
|
|
void DhopInternalOverlappedComms(StencilImpl & st,
|
|
|
|
LebesgueOrder &lo,
|
|
|
|
DoubledGaugeField &U,
|
|
|
|
const FermionField &in,
|
|
|
|
FermionField &out,
|
|
|
|
int dag);
|
|
|
|
|
|
|
|
void DhopInternalSerialComms(StencilImpl & st,
|
|
|
|
LebesgueOrder &lo,
|
|
|
|
DoubledGaugeField &U,
|
|
|
|
const FermionField &in,
|
|
|
|
FermionField &out,
|
|
|
|
int dag);
|
2016-10-22 18:14:27 +01:00
|
|
|
|
|
|
|
// Constructors
|
|
|
|
WilsonFermion5D(GaugeField &_Umu,
|
|
|
|
GridCartesian &FiveDimGrid,
|
|
|
|
GridRedBlackCartesian &FiveDimRedBlackGrid,
|
|
|
|
GridCartesian &FourDimGrid,
|
|
|
|
GridRedBlackCartesian &FourDimRedBlackGrid,
|
|
|
|
double _M5,const ImplParams &p= ImplParams());
|
|
|
|
|
|
|
|
// Constructors
|
|
|
|
/*
|
2016-04-19 23:38:01 +01:00
|
|
|
WilsonFermion5D(int simd,
|
2016-10-22 18:14:27 +01:00
|
|
|
GaugeField &_Umu,
|
|
|
|
GridCartesian &FiveDimGrid,
|
|
|
|
GridRedBlackCartesian &FiveDimRedBlackGrid,
|
|
|
|
GridCartesian &FourDimGrid,
|
|
|
|
double _M5,const ImplParams &p= ImplParams());
|
|
|
|
*/
|
|
|
|
|
|
|
|
// DoubleStore
|
|
|
|
void ImportGauge(const GaugeField &_Umu);
|
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////
|
|
|
|
// Data members require to support the functionality
|
|
|
|
///////////////////////////////////////////////////////////////
|
|
|
|
public:
|
|
|
|
|
|
|
|
// 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
|
|
|
|
StencilImpl Stencil;
|
|
|
|
StencilImpl StencilEven;
|
|
|
|
StencilImpl StencilOdd;
|
|
|
|
|
|
|
|
// Copy of the gauge field , with even and odd subsets
|
|
|
|
DoubledGaugeField Umu;
|
|
|
|
DoubledGaugeField UmuEven;
|
|
|
|
DoubledGaugeField UmuOdd;
|
|
|
|
|
|
|
|
LebesgueOrder Lebesgue;
|
|
|
|
LebesgueOrder LebesgueEvenOdd;
|
|
|
|
|
|
|
|
// Comms buffer
|
|
|
|
std::vector<SiteHalfSpinor,alignedAllocator<SiteHalfSpinor> > comm_buf;
|
|
|
|
|
2017-04-25 18:00:24 +01:00
|
|
|
///////////////////////////////////////////////////////////////
|
|
|
|
// Conserved current utilities
|
|
|
|
///////////////////////////////////////////////////////////////
|
|
|
|
void ContractConservedCurrent(PropagatorField &q_in_1,
|
|
|
|
PropagatorField &q_in_2,
|
|
|
|
PropagatorField &q_out,
|
|
|
|
Current curr_type,
|
|
|
|
unsigned int mu);
|
2018-02-12 09:36:08 +00:00
|
|
|
void SeqConservedCurrent(PropagatorField &q_in,
|
2017-04-25 18:00:24 +01:00
|
|
|
PropagatorField &q_out,
|
2018-02-12 09:36:08 +00:00
|
|
|
Current curr_type,
|
2017-04-25 18:00:24 +01:00
|
|
|
unsigned int mu,
|
2018-02-12 09:36:08 +00:00
|
|
|
unsigned int tmin,
|
|
|
|
unsigned int tmax,
|
2018-03-02 11:47:38 +00:00
|
|
|
ComplexField &lattice_cmplx);
|
2016-10-22 18:14:27 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
}}
|
2015-05-31 15:09:02 +01:00
|
|
|
|
|
|
|
#endif
|