mirror of
				https://github.com/paboyle/Grid.git
				synced 2025-11-04 05:54:32 +00:00 
			
		
		
		
	Adding smearing routines (development)
This commit is contained in:
		@@ -75,7 +75,7 @@ namespace Grid {
 | 
			
		||||
    //
 | 
			
		||||
    //
 | 
			
		||||
    // template<class Impl>
 | 
			
		||||
    // class MyOp : pubic<Impl> { 
 | 
			
		||||
    // class MyOp : public<Impl> { 
 | 
			
		||||
    // public:
 | 
			
		||||
    //
 | 
			
		||||
    //    INHERIT_ALL_IMPL_TYPES(Impl);
 | 
			
		||||
@@ -110,7 +110,7 @@ namespace Grid {
 | 
			
		||||
    // Single flavour four spinors with colour index
 | 
			
		||||
    ///////
 | 
			
		||||
    template<class S,int Nrepresentation=Nc>
 | 
			
		||||
    class WilsonImpl :  public PeriodicGaugeImpl< GaugeImplTypes< S,Nrepresentation> > { 
 | 
			
		||||
    class WilsonImpl :  public PeriodicGaugeImpl< GaugeImplTypes< S, Nrepresentation> > { 
 | 
			
		||||
    public:
 | 
			
		||||
 | 
			
		||||
      typedef PeriodicGaugeImpl< GaugeImplTypes< S,Nrepresentation> > Gimpl;
 | 
			
		||||
 
 | 
			
		||||
@@ -44,7 +44,6 @@ template<class Gimpl> class WilsonLoops;
 | 
			
		||||
    typedef typename GImpl::GaugeLinkField       GaugeLinkField;\
 | 
			
		||||
    typedef typename GImpl::GaugeField               GaugeField;	
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    // 
 | 
			
		||||
    template<class S,int Nrepresentation=Nc>
 | 
			
		||||
    class GaugeImplTypes { 
 | 
			
		||||
 
 | 
			
		||||
@@ -44,7 +44,7 @@ Author: paboyle <paboyle@ph.ed.ac.uk>
 | 
			
		||||
 | 
			
		||||
namespace Grid{
 | 
			
		||||
  namespace QCD{
 | 
			
		||||
    
 | 
			
		||||
     
 | 
			
		||||
 | 
			
		||||
    struct HMCparameters{
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -47,7 +47,7 @@ public:
 | 
			
		||||
  GridRedBlackCartesian * UrbGrid ;
 | 
			
		||||
  GridRedBlackCartesian * FrbGrid ;
 | 
			
		||||
 | 
			
		||||
  virtual void BuildTheAction (int argc, char **argv) = 0;
 | 
			
		||||
  virtual void BuildTheAction (int argc, char **argv) = 0; // necessary?
 | 
			
		||||
 | 
			
		||||
  
 | 
			
		||||
  void Run (int argc, char  **argv){
 | 
			
		||||
@@ -96,7 +96,7 @@ public:
 | 
			
		||||
    
 | 
			
		||||
    GridSerialRNG    sRNG;
 | 
			
		||||
    GridParallelRNG  pRNG(UGrid);
 | 
			
		||||
    LatticeGaugeField  U(UGrid);
 | 
			
		||||
    LatticeGaugeField  U(UGrid); // change this to an extended field (smearing class)
 | 
			
		||||
 | 
			
		||||
    std::vector<int> SerSeed({1,2,3,4,5});
 | 
			
		||||
    std::vector<int> ParSeed({6,7,8,9,10});
 | 
			
		||||
@@ -129,7 +129,7 @@ public:
 | 
			
		||||
      Checkpoint.CheckpointRestore(StartTraj, U, sRNG, pRNG);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    HybridMonteCarlo<GaugeField,IntegratorType>  HMC(HMCpar, MDynamics,sRNG,pRNG,U);
 | 
			
		||||
    HybridMonteCarlo<GaugeField,IntegratorType>  HMC(HMCpar, MDynamics,sRNG,pRNG,U); // pass the extended field
 | 
			
		||||
    HMC.AddObservable(&Checkpoint);
 | 
			
		||||
    HMC.AddObservable(&PlaqLog);
 | 
			
		||||
    
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										96
									
								
								lib/qcd/smearing/GaugeConfiguration.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										96
									
								
								lib/qcd/smearing/GaugeConfiguration.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,96 @@
 | 
			
		||||
/*!
 | 
			
		||||
  @file GaugeConfiguration.h
 | 
			
		||||
 | 
			
		||||
  @brief Declares the GaugeConfiguration class
 | 
			
		||||
*/
 | 
			
		||||
#ifndef GAUGE_CONFIG_
 | 
			
		||||
#define GAUGE_CONFIG_
 | 
			
		||||
 | 
			
		||||
namespace Grid {
 | 
			
		||||
  
 | 
			
		||||
  namespace QCD {
 | 
			
		||||
    
 | 
			
		||||
    /*!
 | 
			
		||||
      @brief Smeared configuration container
 | 
			
		||||
      
 | 
			
		||||
      It will behave like a configuration from the point of view of
 | 
			
		||||
      the HMC update and integrators.
 | 
			
		||||
      An "advanced configuration" object that can provide not only the 
 | 
			
		||||
      data to store the gauge configuration but also operations to manipulate
 | 
			
		||||
      it like smearing.
 | 
			
		||||
      
 | 
			
		||||
      It stores a list of smeared configurations.
 | 
			
		||||
    */
 | 
			
		||||
    template <class Gimpl>
 | 
			
		||||
    class GaugeConfiguration {
 | 
			
		||||
    public:
 | 
			
		||||
      INHERIT_GIMPL_TYPES(Gimpl)
 | 
			
		||||
      private:
 | 
			
		||||
      const unsigned int smearingLevels;
 | 
			
		||||
      Smear_Stout StoutSmearing;
 | 
			
		||||
      std::vector<GaugeField> SmearedSet;
 | 
			
		||||
      
 | 
			
		||||
      // Member functions
 | 
			
		||||
      void fill_smearedSet();
 | 
			
		||||
      GaugeField AnalyticSmearedForce(const GaugeField&, 
 | 
			
		||||
				      const GaugeField&) const;
 | 
			
		||||
      const GaugeField& get_smeared_conf(int) const;
 | 
			
		||||
      
 | 
			
		||||
      void set_iLambda(GaugeField& iLambda, 
 | 
			
		||||
		       GaugeField& e_iQ,
 | 
			
		||||
		       const GaugeField& iQ, 
 | 
			
		||||
		       const GaugeField& Sigmap,
 | 
			
		||||
		       const GaugeField& U)const;
 | 
			
		||||
      
 | 
			
		||||
      /* Check these types (do I need to pass iQ1,2 ? )
 | 
			
		||||
      void set_uw(RealD& u, RealD& w,
 | 
			
		||||
		  const SUNmat& iQ1, const SUNmat& iQ2)const ;
 | 
			
		||||
      void set_fj(ComplexD& f0, ComplexD& f1,
 | 
			
		||||
		  CompledD& f2, const RealD& u,
 | 
			
		||||
		  const RealD& w)const;
 | 
			
		||||
      */
 | 
			
		||||
      
 | 
			
		||||
      RealD func_xi0(RealD w)const;
 | 
			
		||||
      RealD func_xi1(RealD w)const; 
 | 
			
		||||
      
 | 
			
		||||
    public:
 | 
			
		||||
      GaugeField* ThinLinks;      /*!< @brief Pointer to the thin 
 | 
			
		||||
				    links configuration */
 | 
			
		||||
      
 | 
			
		||||
      /*! @brief Standard constructor */
 | 
			
		||||
      GaugeConfiguration(GridCartesian * UGrid,
 | 
			
		||||
			 unsigned int Nsmear, 
 | 
			
		||||
			 Smear_Stout& Stout):
 | 
			
		||||
	smearingLevels(Nsmear),
 | 
			
		||||
	StoutSmearing(Stout),
 | 
			
		||||
	ThinLinks(new GaugeField){
 | 
			
		||||
	for (unsigned int i=0; i< smearingLevels; ++i)
 | 
			
		||||
	  SmearedSet.push_back(*(new GaugeField(UGrid)));
 | 
			
		||||
      }
 | 
			
		||||
      
 | 
			
		||||
      /*! For just thin links */
 | 
			
		||||
      GaugeConfiguration(GridCartesian * UGrid):
 | 
			
		||||
	smearingLevels(0),
 | 
			
		||||
	StoutSmearing(),
 | 
			
		||||
	SmearedSet(0),
 | 
			
		||||
	ThinLinks(new GaugeField(UGrid)){}
 | 
			
		||||
      
 | 
			
		||||
      void set_GaugeField(){ fill_smearedSet(); }
 | 
			
		||||
      void smeared_force(GaugeField&) const;
 | 
			
		||||
      GaugeField& get_current_conf() const;
 | 
			
		||||
      GaugeField& select_conf(bool smeared) const {
 | 
			
		||||
	if (smeared){
 | 
			
		||||
	  if (smearingLevels) return get_current_conf();
 | 
			
		||||
	  else           	  return ThinLinks;
 | 
			
		||||
	}
 | 
			
		||||
	else return ThinLinks;
 | 
			
		||||
      }
 | 
			
		||||
      
 | 
			
		||||
    };
 | 
			
		||||
    
 | 
			
		||||
    
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
		Reference in New Issue
	
	Block a user