diff --git a/lib/qcd/action/Actions.h b/lib/qcd/action/Actions.h index 8a8c4642..b31e9136 100644 --- a/lib/qcd/action/Actions.h +++ b/lib/qcd/action/Actions.h @@ -55,6 +55,8 @@ // Continued fraction ////////////////////// #include +#include +#include ////////////////////// // Partial fraction diff --git a/lib/qcd/action/fermion/ContinuedFractionFermion5D.cc b/lib/qcd/action/fermion/ContinuedFractionFermion5D.cc index 250e365f..92f6473e 100644 --- a/lib/qcd/action/fermion/ContinuedFractionFermion5D.cc +++ b/lib/qcd/action/fermion/ContinuedFractionFermion5D.cc @@ -3,11 +3,11 @@ namespace Grid { namespace QCD { - void ContinuedFractionFermion5D::SetCoefficientsTanh(Approx::zolotarev_data *zdata,RealD b,RealD c) + void ContinuedFractionFermion5D::SetCoefficientsTanh(Approx::zolotarev_data *zdata,RealD scale) { - SetCoefficientsZolotarev(1.0,zdata,b,c); + SetCoefficientsZolotarev(1.0/scale,zdata); } - void ContinuedFractionFermion5D::SetCoefficientsZolotarev(RealD zolo_hi,Approx::zolotarev_data *zdata,RealD b,RealD c) + void ContinuedFractionFermion5D::SetCoefficientsZolotarev(RealD zolo_hi,Approx::zolotarev_data *zdata) { R=(1+this->mass)/(1-this->mass); @@ -164,9 +164,6 @@ namespace Grid { mass(_mass) { assert((Ls&0x1)==1); // Odd Ls required - int nrational=Ls-1;// Even rational order - zdata = Approx::grid_higham(1.0,nrational);// eps is ignored for higham - SetCoefficientsTanh(zdata,1.0,0.0); } } diff --git a/lib/qcd/action/fermion/ContinuedFractionFermion5D.h b/lib/qcd/action/fermion/ContinuedFractionFermion5D.h index 99365009..f363878f 100644 --- a/lib/qcd/action/fermion/ContinuedFractionFermion5D.h +++ b/lib/qcd/action/fermion/ContinuedFractionFermion5D.h @@ -22,7 +22,7 @@ namespace Grid { virtual void MooeeInvDag (const LatticeFermion &in, LatticeFermion &out); // virtual void Instantiatable(void)=0; - virtual void Instantiatable(void) {}; + virtual void Instantiatable(void) =0; // Constructors ContinuedFractionFermion5D(LatticeGaugeField &_Umu, @@ -34,8 +34,8 @@ namespace Grid { protected: - void SetCoefficientsTanh(Approx::zolotarev_data *zdata,RealD b,RealD c); - void SetCoefficientsZolotarev(RealD zolo_hi,Approx::zolotarev_data *zdata,RealD b,RealD c); + void SetCoefficientsTanh(Approx::zolotarev_data *zdata,RealD scale); + void SetCoefficientsZolotarev(RealD zolo_hi,Approx::zolotarev_data *zdata);; Approx::zolotarev_data *zdata; diff --git a/lib/qcd/action/fermion/OverlapWilsonContfracTanhFermion.h b/lib/qcd/action/fermion/OverlapWilsonContfracTanhFermion.h new file mode 100644 index 00000000..4865f169 --- /dev/null +++ b/lib/qcd/action/fermion/OverlapWilsonContfracTanhFermion.h @@ -0,0 +1,39 @@ +#ifndef OVERLAP_WILSON_CAYLEY_TANH_FERMION_H +#define OVERLAP_WILSON_CAYLEY_TANH_FERMION_H + +#include + +namespace Grid { + + namespace QCD { + + class OverlapWilsonContFracTanhFermion : public ContinuedFractionFermion5D + { + public: + + virtual void Instantiatable(void){}; + // Constructors + OverlapWilsonContFracTanhFermion(LatticeGaugeField &_Umu, + GridCartesian &FiveDimGrid, + GridRedBlackCartesian &FiveDimRedBlackGrid, + GridCartesian &FourDimGrid, + GridRedBlackCartesian &FourDimRedBlackGrid, + RealD _mass,RealD _M5, + RealD scale) : + + // b+c=scale, b-c = 0 <=> b =c = scale/2 + ContinuedFractionFermion5D(_Umu, + FiveDimGrid, + FiveDimRedBlackGrid, + FourDimGrid, + FourDimRedBlackGrid,_mass) + { + assert((Ls&0x1)==1); // Odd Ls required + int nrational=Ls-1;// Even rational order + zdata = Approx::grid_higham(1.0,nrational);// eps is ignored for higham + SetCoefficientsTanh(zdata,scale); + } + }; + } +} +#endif diff --git a/lib/qcd/action/fermion/OverlapWilsonContfracZolotarevFermion.h b/lib/qcd/action/fermion/OverlapWilsonContfracZolotarevFermion.h new file mode 100644 index 00000000..7478c062 --- /dev/null +++ b/lib/qcd/action/fermion/OverlapWilsonContfracZolotarevFermion.h @@ -0,0 +1,44 @@ +#ifndef OVERLAP_WILSON_CAYLEY_TANH_FERMION_H +#define OVERLAP_WILSON_CAYLEY_TANH_FERMION_H + +#include + +namespace Grid { + + namespace QCD { + + class OverlapWilsonContFracZolotarevFermion : public ContinuedFractionFermion5D + { + public: + + virtual void Instantiatable(void){}; + // Constructors + OverlapWilsonContFracZolotarevFermion(LatticeGaugeField &_Umu, + GridCartesian &FiveDimGrid, + GridRedBlackCartesian &FiveDimRedBlackGrid, + GridCartesian &FourDimGrid, + GridRedBlackCartesian &FourDimRedBlackGrid, + RealD _mass,RealD _M5, + RealD lo,RealD hi): + + // b+c=scale, b-c = 0 <=> b =c = scale/2 + ContinuedFractionFermion5D(_Umu, + FiveDimGrid, + FiveDimRedBlackGrid, + FourDimGrid, + FourDimRedBlackGrid,_mass) + { + assert((Ls&0x1)==1); // Odd Ls required + + int nrational=Ls-1;// Even rational order + RealD eps = lo/hi; + + Approx::zolotarev_data *zdata = Approx::grid_zolotarev(eps,nrational,0); + + SetCoefficientsZolotarev(hi,zdata); + + } + }; + } +} +#endif