/************************************************************************************* Grid physics library, www.github.com/paboyle/Grid Source file: ./lib/qcd/action/fermion/DomainWallFermion.h Copyright (C) 2015 Author: Peter Boyle Author: Peter Boyle Author: Vera Guelpers 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 */ #ifndef GRID_QCD_DOMAIN_WALL_FERMION_H #define GRID_QCD_DOMAIN_WALL_FERMION_H #include NAMESPACE_BEGIN(Grid); template class DomainWallFermion : public CayleyFermion5D { public: INHERIT_IMPL_TYPES(Impl); public: void FreePropagator(const FermionField &in,FermionField &out,RealD mass,std::vector boundary, std::vector twist, bool fiveD) { FermionField in_k(in.Grid()); FermionField prop_k(in.Grid()); FFT theFFT((GridCartesian *) in.Grid()); //phase for boundary condition ComplexField coor(in.Grid()); ComplexField ph(in.Grid()); ph = Zero(); FermionField in_buf(in.Grid()); in_buf = Zero(); typedef typename Simd::scalar_type Scalar; Scalar ci(0.0,1.0); assert(twist.size() == Nd);//check that twist is Nd assert(boundary.size() == Nd);//check that boundary conditions is Nd int shift = 0; if(fiveD) shift = 1; for(unsigned int nu = 0; nu < Nd; nu++) { // Shift coordinate lattice index by 1 to account for 5th dimension. LatticeCoordinate(coor, nu + shift); double boundary_phase = ::acos(real(boundary[nu])); ph = ph + boundary_phase*coor*((1./(in.Grid()->_fdimensions[nu+shift]))); //momenta for propagator shifted by twist+boundary twist[nu] = twist[nu] + boundary_phase/((2.0*M_PI)); } in_buf = exp(ci*ph*(-1.0))*in; if(fiveD){//FFT only on temporal and spatial dimensions std::vector mask(Nd+1,1); mask[0] = 0; theFFT.FFT_dim_mask(in_k,in_buf,mask,FFT::forward); this->MomentumSpacePropagatorHt_5d(prop_k,in_k,mass,twist); theFFT.FFT_dim_mask(out,prop_k,mask,FFT::backward); } else{ theFFT.FFT_all_dim(in_k,in,FFT::forward); this->MomentumSpacePropagatorHt(prop_k,in_k,mass,twist); theFFT.FFT_all_dim(out,prop_k,FFT::backward); } //phase for boundary condition out = out * exp(ci*ph); }; virtual void FreePropagator(const FermionField &in,FermionField &out,RealD mass,std::vector boundary,std::vector twist) { bool fiveD = true; //5d propagator by default FreePropagator(in,out,mass,boundary,twist,fiveD); }; virtual void FreePropagator(const FermionField &in,FermionField &out,RealD mass, bool fiveD) { std::vector twist(Nd,0.0); //default: periodic boundarys in all directions std::vector boundary; for(int i=0;i twist(Nd,0.0); //default: twist angle 0 std::vector boundary; for(int i=0;i(_Umu, FiveDimGrid, FiveDimRedBlackGrid, FourDimGrid, FourDimRedBlackGrid,_mass,_M5,p) { RealD eps = 1.0; Approx::zolotarev_data *zdata = Approx::higham(eps,this->Ls);// eps is ignored for higham assert(zdata->n==this->Ls); // std::cout<