//-------------------------------------------------------------------- /*! @file HMC.h * @brief Declaration of classes for Hybrid Monte Carlo update * * @author Guido Cossu */ //-------------------------------------------------------------------- #ifndef HMC_INCLUDED #define HMC_INCLUDED #include #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 HMCparameters(); }; template class HybridMonteCarlo{ const HMCparameters Params; GridSerialRNG sRNG; Integrator& MD; 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<& MolDyn): Params(Pms),MD(MolDyn){ //FIXME // initialize RNGs also with seed sRNG.SeedRandomDevice(); } ~HybridMonteCarlo(){}; void evolve(LatticeLorentzColourMatrix& Uin){ Real DeltaH; // Thermalizations for(int iter=1; iter <= Params.ThermalizationSteps; ++iter){ std::cout<