/************************************************************************************* Grid physics library, www.github.com/paboyle/Grid Source file: ./tests/Test_hmc_WilsonFermionGauge.cc Copyright (C) 2015 Author: Peter Boyle Author: neo Author: Guido Cossu This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. See the full license in the file "LICENSE" in the top level distribution directory *************************************************************************************/ /* END LEGAL */ #include #define USE_OBC #define DO_IMPLICIT int main(int argc, char **argv) { using namespace Grid; Grid_init(&argc, &argv); GridLogLayout(); std::string arg; HMCparameters HMCparams; #if 1 { XmlReader HMCrd("HMCparameters.xml"); read(HMCrd,"HMCparameters",HMCparams); } #else //IntegratorParameters MD; std::vector steps(0); if( GridCmdOptionExists(argv,argv+argc,"--MDsteps") ){ arg= GridCmdOptionPayload(argv,argv+argc,"--MDsteps"); GridCmdOptionIntVector(arg,steps); assert(steps.size()==1); } MD.trajL = 0.001*std::sqrt(2.); MD.MDsteps = 1; if (steps.size()>0) MD.MDsteps = steps[0]; if( GridCmdOptionExists(argv,argv+argc,"--trajL") ){ arg= GridCmdOptionPayload(argv,argv+argc,"--trajL"); std::vector traj(0); GridCmdOptionIntVector(arg,traj); assert(traj.size()==1); MD.trajL *= double(traj[0]); } MD.RMHMCTol=1e-8; MD.RMHMCCGTol=1e-8; std::cout << "RMHMCTol= "<< MD.RMHMCTol<<" RMHMCCGTol= "< HMCWrapper; // Uses the default minimum norm // typedef GenericHMCRunner HMCWrapper; // 4th order HMCparams.MD.name = std::string("ImplicitMinimumNorm2"); #else typedef GenericHMCRunner HMCWrapper; // Uses the default minimum norm HMCparams.MD.name = std::string("MinimumNorm2"); #endif // Possibile to create the module by hand // hardcoding parameters or using a Reader // Checkpointer definition CheckpointerParameters CPparams; CPparams.config_prefix = "ckpoint_lat"; CPparams.rng_prefix = "ckpoint_rng"; CPparams.saveInterval = 1; CPparams.format = "IEEE64BIG"; HMCWrapper TheHMC(HMCparams); // Grid from the command line TheHMC.Resources.AddFourDimGrid("gauge"); TheHMC.Resources.LoadNerscCheckpointer(CPparams); RNGModuleParameters RNGpar; RNGpar.serial_seeds = "1 2 3 4 5"; RNGpar.parallel_seeds = "6 7 8 9 10"; TheHMC.Resources.SetRNGSeeds(RNGpar); // Construct observables // here there is too much indirection typedef PlaquetteMod PlaqObs; typedef TopologicalChargeMod QObs; TheHMC.Resources.AddObservable(); TopologyObsParameters TopParams; TopParams.interval = 1; TopParams.do_smearing = true; // TopParams.Smearing.steps = 1600; // TopParams.Smearing.step_size = 0.01; TopParams.Smearing.init_step_size = 0.01; TopParams.Smearing.meas_interval = 10; TopParams.Smearing.maxTau = 16.0; // TheHMC.Resources.AddObservable(TopParams); ////////////////////////////////////////////// ///////////////////////////////////////////////////////////// // Collect actions, here use more encapsulation // need wrappers of the fermionic classes // that have a complex construction // standard RealD beta = 6.4; std::cout << "Wilson Gauge beta= " < boundaryG = {1,1,1,0}; WilsonGaugeActionR::ImplParams ParamsG(boundaryG); WilsonGaugeActionR Waction(beta,ParamsG); std::cout << "boundaryG = " < Level1(1); Level1.push_back(&Waction); TheHMC.TheAction.push_back(Level1); TheHMC.ReadCommandLine(argc, argv); // these can be parameters from file std::cout << "trajL= " <