mirror of
				https://github.com/paboyle/Grid.git
				synced 2025-11-03 21:44:33 +00:00 
			
		
		
		
	Merge branch 'develop' into feature/hadrons
# Conflicts: # lib/qcd/action/fermion/FermionOperator.h
This commit is contained in:
		@@ -52,6 +52,35 @@ namespace QCD {
 | 
			
		||||
 { 
 | 
			
		||||
 }
 | 
			
		||||
 | 
			
		||||
///////////////////////////////////////////////////////////////
 | 
			
		||||
// Physical surface field utilities
 | 
			
		||||
///////////////////////////////////////////////////////////////
 | 
			
		||||
template<class Impl>  
 | 
			
		||||
void CayleyFermion5D<Impl>::ExportPhysicalFermionSolution(const FermionField &solution5d,FermionField &exported4d)
 | 
			
		||||
{
 | 
			
		||||
  int Ls = this->Ls;
 | 
			
		||||
  FermionField tmp(this->FermionGrid());
 | 
			
		||||
  tmp = solution5d;
 | 
			
		||||
  conformable(solution5d._grid,this->FermionGrid());
 | 
			
		||||
  conformable(exported4d._grid,this->GaugeGrid());
 | 
			
		||||
  axpby_ssp_pminus(tmp, 0., solution5d, 1., solution5d, 0, 0);
 | 
			
		||||
  axpby_ssp_pplus (tmp, 1., tmp       , 1., solution5d, 0, Ls-1);
 | 
			
		||||
  ExtractSlice(exported4d, tmp, 0, 0);
 | 
			
		||||
}
 | 
			
		||||
template<class Impl>  
 | 
			
		||||
void CayleyFermion5D<Impl>::ImportPhysicalFermionSource(const FermionField &input4d,FermionField &imported5d)
 | 
			
		||||
{
 | 
			
		||||
  int Ls = this->Ls;
 | 
			
		||||
  FermionField tmp(this->FermionGrid());
 | 
			
		||||
  conformable(imported5d._grid,this->FermionGrid());
 | 
			
		||||
  conformable(input4d._grid   ,this->GaugeGrid());
 | 
			
		||||
  tmp = zero;
 | 
			
		||||
  InsertSlice(input4d, tmp, 0   , 0);
 | 
			
		||||
  InsertSlice(input4d, tmp, Ls-1, 0);
 | 
			
		||||
  axpby_ssp_pplus (tmp, 0., tmp, 1., tmp, 0, 0);
 | 
			
		||||
  axpby_ssp_pminus(tmp, 0., tmp, 1., tmp, Ls-1, Ls-1);
 | 
			
		||||
  Dminus(tmp,imported5d);
 | 
			
		||||
}
 | 
			
		||||
template<class Impl>  
 | 
			
		||||
void CayleyFermion5D<Impl>::Dminus(const FermionField &psi, FermionField &chi)
 | 
			
		||||
{
 | 
			
		||||
 
 | 
			
		||||
@@ -83,8 +83,13 @@ namespace Grid {
 | 
			
		||||
      virtual void   M5D   (const FermionField &psi, FermionField &chi);
 | 
			
		||||
      virtual void   M5Ddag(const FermionField &psi, FermionField &chi);
 | 
			
		||||
 | 
			
		||||
      ///////////////////////////////////////////////////////////////
 | 
			
		||||
      // Physical surface field utilities
 | 
			
		||||
      ///////////////////////////////////////////////////////////////
 | 
			
		||||
      virtual void   Dminus(const FermionField &psi, FermionField &chi);
 | 
			
		||||
      virtual void   DminusDag(const FermionField &psi, FermionField &chi);
 | 
			
		||||
      virtual void ExportPhysicalFermionSolution(const FermionField &solution5d,FermionField &exported4d);
 | 
			
		||||
      virtual void ImportPhysicalFermionSource(const FermionField &input4d,FermionField &imported5d);
 | 
			
		||||
 | 
			
		||||
      /////////////////////////////////////////////////////
 | 
			
		||||
      // Instantiate different versions depending on Impl
 | 
			
		||||
 
 | 
			
		||||
@@ -295,6 +295,27 @@ namespace Grid {
 | 
			
		||||
      assert((Ls&0x1)==1); // Odd Ls required
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    template<class Impl>
 | 
			
		||||
    void ContinuedFractionFermion5D<Impl>::ExportPhysicalFermionSolution(const FermionField &solution5d,FermionField &exported4d)
 | 
			
		||||
    {
 | 
			
		||||
      int Ls = this->Ls;
 | 
			
		||||
      conformable(solution5d._grid,this->FermionGrid());
 | 
			
		||||
      conformable(exported4d._grid,this->GaugeGrid());
 | 
			
		||||
      ExtractSlice(exported4d, solution5d, Ls-1, Ls-1);
 | 
			
		||||
    }
 | 
			
		||||
    template<class Impl>
 | 
			
		||||
    void ContinuedFractionFermion5D<Impl>::ImportPhysicalFermionSource(const FermionField &input4d,FermionField &imported5d)
 | 
			
		||||
    {
 | 
			
		||||
      int Ls = this->Ls;
 | 
			
		||||
      conformable(imported5d._grid,this->FermionGrid());
 | 
			
		||||
      conformable(input4d._grid   ,this->GaugeGrid());
 | 
			
		||||
      FermionField tmp(this->FermionGrid());
 | 
			
		||||
      tmp=zero;
 | 
			
		||||
      InsertSlice(input4d, tmp, Ls-1, Ls-1);
 | 
			
		||||
      tmp=Gamma(Gamma::Algebra::Gamma5)*tmp;
 | 
			
		||||
      this->Dminus(tmp,imported5d);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    FermOpTemplateInstantiate(ContinuedFractionFermion5D);
 | 
			
		||||
 | 
			
		||||
  }
 | 
			
		||||
 
 | 
			
		||||
@@ -65,6 +65,14 @@ namespace Grid {
 | 
			
		||||
      // Efficient support for multigrid coarsening
 | 
			
		||||
      virtual void  Mdir (const FermionField &in, FermionField &out,int dir,int disp);
 | 
			
		||||
 | 
			
		||||
      ///////////////////////////////////////////////////////////////
 | 
			
		||||
      // Physical surface field utilities
 | 
			
		||||
      ///////////////////////////////////////////////////////////////
 | 
			
		||||
      //      virtual void Dminus(const FermionField &psi, FermionField &chi);     // Inherit trivial case
 | 
			
		||||
      //      virtual void DminusDag(const FermionField &psi, FermionField &chi);  // Inherit trivial case
 | 
			
		||||
      virtual void ExportPhysicalFermionSolution(const FermionField &solution5d,FermionField &exported4d);
 | 
			
		||||
      virtual void ImportPhysicalFermionSource  (const FermionField &input4d,FermionField &imported5d);
 | 
			
		||||
 | 
			
		||||
      // Constructors
 | 
			
		||||
      ContinuedFractionFermion5D(GaugeField &_Umu,
 | 
			
		||||
				 GridCartesian         &FiveDimGrid,
 | 
			
		||||
 
 | 
			
		||||
@@ -127,7 +127,20 @@ namespace Grid {
 | 
			
		||||
                                       unsigned int mu,
 | 
			
		||||
                                       unsigned int tmin, 
 | 
			
		||||
                                       unsigned int tmax,
 | 
			
		||||
				       ComplexField &lattice_cmplx)=0;
 | 
			
		||||
                                       ComplexField &lattice_cmplx)=0;
 | 
			
		||||
      ///////////////////////////////////////////////
 | 
			
		||||
      // Physical field import/export
 | 
			
		||||
      ///////////////////////////////////////////////
 | 
			
		||||
      virtual void Dminus(const FermionField &psi, FermionField &chi)    { chi=psi; }
 | 
			
		||||
      virtual void DminusDag(const FermionField &psi, FermionField &chi) { chi=psi; }
 | 
			
		||||
      virtual void ImportPhysicalFermionSource(const FermionField &input,FermionField &imported)
 | 
			
		||||
      {
 | 
			
		||||
	imported = input;
 | 
			
		||||
      };
 | 
			
		||||
      virtual void ExportPhysicalFermionSolution(const FermionField &solution,FermionField &exported)
 | 
			
		||||
      {
 | 
			
		||||
	exported=solution;
 | 
			
		||||
      };
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
  }
 | 
			
		||||
 
 | 
			
		||||
@@ -396,6 +396,27 @@ namespace Grid {
 | 
			
		||||
      amax=zolo_hi;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    template<class Impl>
 | 
			
		||||
    void PartialFractionFermion5D<Impl>::ExportPhysicalFermionSolution(const FermionField &solution5d,FermionField &exported4d)
 | 
			
		||||
    {
 | 
			
		||||
      int Ls = this->Ls;
 | 
			
		||||
      conformable(solution5d._grid,this->FermionGrid());
 | 
			
		||||
      conformable(exported4d._grid,this->GaugeGrid());
 | 
			
		||||
      ExtractSlice(exported4d, solution5d, Ls-1, Ls-1);
 | 
			
		||||
    }
 | 
			
		||||
    template<class Impl>
 | 
			
		||||
    void PartialFractionFermion5D<Impl>::ImportPhysicalFermionSource(const FermionField &input4d,FermionField &imported5d)
 | 
			
		||||
    {
 | 
			
		||||
      int Ls = this->Ls;
 | 
			
		||||
      conformable(imported5d._grid,this->FermionGrid());
 | 
			
		||||
      conformable(input4d._grid   ,this->GaugeGrid());
 | 
			
		||||
      FermionField tmp(this->FermionGrid());
 | 
			
		||||
      tmp=zero;
 | 
			
		||||
      InsertSlice(input4d, tmp, Ls-1, Ls-1);
 | 
			
		||||
      tmp=Gamma(Gamma::Algebra::Gamma5)*tmp;
 | 
			
		||||
      this->Dminus(tmp,imported5d);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
      // Constructors
 | 
			
		||||
    template<class Impl>
 | 
			
		||||
    PartialFractionFermion5D<Impl>::PartialFractionFermion5D(GaugeField &_Umu,
 | 
			
		||||
 
 | 
			
		||||
@@ -70,6 +70,12 @@ namespace Grid {
 | 
			
		||||
      // Efficient support for multigrid coarsening
 | 
			
		||||
      virtual void  Mdir (const FermionField &in, FermionField &out,int dir,int disp);
 | 
			
		||||
 | 
			
		||||
      ///////////////////////////////////////////////////////////////
 | 
			
		||||
      // Physical surface field utilities
 | 
			
		||||
      ///////////////////////////////////////////////////////////////
 | 
			
		||||
      virtual void ExportPhysicalFermionSolution(const FermionField &solution5d,FermionField &exported4d);
 | 
			
		||||
      virtual void ImportPhysicalFermionSource  (const FermionField &input4d,FermionField &imported5d);
 | 
			
		||||
 | 
			
		||||
      // Constructors
 | 
			
		||||
      PartialFractionFermion5D(GaugeField &_Umu,
 | 
			
		||||
			       GridCartesian         &FiveDimGrid,
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user