Grid 0.7.0
AbstractEOFAFermion.h
Go to the documentation of this file.
1/*************************************************************************************
2
3Grid physics library, www.github.com/paboyle/Grid
4
5Source file: ./lib/qcd/action/fermion/AbstractEOFAFermion.h
6
7Copyright (C) 2017
8
9Author: Peter Boyle <pabobyle@ph.ed.ac.uk>
10Author: Peter Boyle <paboyle@ph.ed.ac.uk>
11Author: David Murphy <dmurphy@phys.columbia.edu>
12
13This program is free software; you can redistribute it and/or modify
14it under the terms of the GNU General Public License as published by
15the Free Software Foundation; either version 2 of the License, or
16(at your option) any later version.
17
18This program is distributed in the hope that it will be useful,
19but WITHOUT ANY WARRANTY; without even the implied warranty of
20MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21GNU General Public License for more details.
22
23You should have received a copy of the GNU General Public License along
24with this program; if not, write to the Free Software Foundation, Inc.,
2551 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
26
27See the full license in the file "LICENSE" in the top level distribution directory
28*************************************************************************************/
29 /* END LEGAL */
30#ifndef GRID_QCD_ABSTRACT_EOFA_FERMION_H
31#define GRID_QCD_ABSTRACT_EOFA_FERMION_H
32
34
36
37// DJM: Abstract base class for EOFA fermion types.
38// Defines layout of additional EOFA-specific parameters and operators.
39// Use to construct EOFA pseudofermion actions that are agnostic to
40// Shamir / Mobius / etc., and ensure that no one can construct EOFA
41// pseudofermion action with non-EOFA fermion type.
42template<class Impl>
44public:
46
47public:
48 // Fermion operator: D(mq1) + shift*\gamma_{5}*R_{5}*\Delta_{\pm}(mq2,mq3)*P_{\pm}
53 int pm;
54
55 RealD alpha; // Mobius scale
56 RealD k; // EOFA normalization constant
57
58 // Device resident
62
63 virtual void Instantiatable(void) = 0;
64
65 // EOFA-specific operations
66 // Force user to implement in derived classes
67 virtual void Omega (const FermionField& in, FermionField& out, int sign, int dag) = 0;
68 virtual void Dtilde (const FermionField& in, FermionField& out) = 0;
69 virtual void DtildeInv(const FermionField& in, FermionField& out) = 0;
70
71 // Implement derivatives in base class:
72 // for EOFA both DWF and Mobius just need d(Dw)/dU
73 virtual void MDeriv(GaugeField& mat, const FermionField& U, const FermionField& V, int dag){
74 this->DhopDeriv(mat, U, V, dag);
75 };
76 virtual void MoeDeriv(GaugeField& mat, const FermionField& U, const FermionField& V, int dag){
77 this->DhopDerivOE(mat, U, V, dag);
78 };
79 virtual void MeoDeriv(GaugeField& mat, const FermionField& U, const FermionField& V, int dag){
80 this->DhopDerivEO(mat, U, V, dag);
81 };
82
83 // Recompute 5D coefficients for different value of shift constant
84 // (needed for heatbath loop over poles)
85 virtual void RefreshShiftCoefficients(RealD new_shift) = 0;
86
87 // Constructors
88 AbstractEOFAFermion(GaugeField& _Umu, GridCartesian& FiveDimGrid, GridRedBlackCartesian& FiveDimRedBlackGrid,
89 GridCartesian& FourDimGrid, GridRedBlackCartesian& FourDimRedBlackGrid,
90 RealD _mq1, RealD _mq2, RealD _mq3, RealD _shift, int _pm,
91 RealD _M5, RealD _b, RealD _c, const ImplParams& p=ImplParams())
92 : CayleyFermion5D<Impl>(_Umu, FiveDimGrid, FiveDimRedBlackGrid, FourDimGrid, FourDimRedBlackGrid,
93 _mq1, _M5, p), mq1(_mq1), mq2(_mq2), mq3(_mq3), shift(_shift), pm(_pm)
94 {
95 int Ls = this->Ls;
96 this->alpha = _b + _c;
97 this->k = this->alpha * (_mq3-_mq2) * std::pow(this->alpha+1.0,2*Ls) /
98 ( std::pow(this->alpha+1.0,Ls) + _mq2*std::pow(this->alpha-1.0,Ls) ) /
99 ( std::pow(this->alpha+1.0,Ls) + _mq3*std::pow(this->alpha-1.0,Ls) );
100
101 d_shift_coefficients.resize(Ls);
102 d_MooeeInv_shift_lc.resize(Ls);
104
105 };
106};
107
109
110#endif
std::vector< T, devAllocator< T > > deviceVector
#define NAMESPACE_BEGIN(A)
Definition Namespace.h:35
#define NAMESPACE_END(A)
Definition Namespace.h:36
double RealD
Definition Simd.h:61
static INTERNAL_PRECISION U
Definition Zolotarev.cc:230
deviceVector< Coeff_t > d_MooeeInv_shift_lc
virtual void Omega(const FermionField &in, FermionField &out, int sign, int dag)=0
deviceVector< Coeff_t > d_shift_coefficients
virtual void DtildeInv(const FermionField &in, FermionField &out)=0
virtual void MDeriv(GaugeField &mat, const FermionField &U, const FermionField &V, int dag)
virtual void Instantiatable(void)=0
virtual void MoeDeriv(GaugeField &mat, const FermionField &U, const FermionField &V, int dag)
virtual void MeoDeriv(GaugeField &mat, const FermionField &U, const FermionField &V, int dag)
virtual void Dtilde(const FermionField &in, FermionField &out)=0
AbstractEOFAFermion(GaugeField &_Umu, GridCartesian &FiveDimGrid, GridRedBlackCartesian &FiveDimRedBlackGrid, GridCartesian &FourDimGrid, GridRedBlackCartesian &FourDimRedBlackGrid, RealD _mq1, RealD _mq2, RealD _mq3, RealD _shift, int _pm, RealD _M5, RealD _b, RealD _c, const ImplParams &p=ImplParams())
virtual void RefreshShiftCoefficients(RealD new_shift)=0
deviceVector< Coeff_t > d_MooeeInv_shift_norm
CayleyFermion5D(GaugeField &_Umu, GridCartesian &FiveDimGrid, GridRedBlackCartesian &FiveDimRedBlackGrid, GridCartesian &FourDimGrid, GridRedBlackCartesian &FourDimRedBlackGrid, RealD _mass, RealD _M5, const ImplParams &p=ImplParams())
virtual void DhopDerivEO(GaugeField &mat, const FermionField &U, const FermionField &V, int dag)
virtual void DhopDeriv(GaugeField &mat, const FermionField &U, const FermionField &V, int dag)
virtual void DhopDerivOE(GaugeField &mat, const FermionField &U, const FermionField &V, int dag)