//-------------------------------------------------------------------- /*! @file HMC.h * @brief Classes for Hybrid Monte Carlo update * * @author Guido Cossu * Time-stamp: <2015-07-30 16:58:26 neo> */ //-------------------------------------------------------------------- #ifndef HMC_INCLUDED #define HMC_INCLUDED #include namespace Grid{ namespace QCD{ struct HMCparameters{ Integer Nsweeps; /* @brief Number of sweeps in this run */ Integer TotalSweeps; /* @brief If provided, the total number of sweeps */ Integer ThermalizationSteps; Integer StartingConfig; Integer SaveInterval; //Setting to 0 does not save configurations std::string Filename_prefix; // To save configurations and rng seed HMCparameters(); }; // template template class HybridMonteCarlo { private: const HMCparameters Params; GridSerialRNG &sRNG; // Fixme: need a RNG management strategy. GridParallelRNG &pRNG; // Fixme: need a RNG management strategy. typedef Integrator IntegratorType; IntegratorType &TheIntegrator; ///////////////////////////////////////////////////////// // Metropolis step ///////////////////////////////////////////////////////// bool metropolis_test(const RealD DeltaH){ RealD rn_test; RealD prob = std::exp(-DeltaH); random(sRNG,rn_test); std::cout<1.0) || (rn_test <= prob)){ // accepted std::cout<