1
0
mirror of https://github.com/paboyle/Grid.git synced 2024-11-15 02:05:37 +00:00
Grid/tests/sp2n/Test_hmc_Sp_WilsonFundFermionGauge.cc

75 lines
2.1 KiB
C++
Raw Normal View History

2021-10-12 12:16:47 +01:00
#include <Grid/Grid.h>
int main(int argc, char **argv) {
using namespace Grid;
typedef Representations< SpFundamentalRepresentation > TheRepresentations;
Grid_init(&argc, &argv);
2023-06-23 10:49:41 +01:00
typedef GenericSpHMCRunnerHirep<TheRepresentations, MinimumNorm2> HMCWrapper; // ok
2023-06-13 17:21:01 +01:00
typedef SpWilsonImplR FermionImplPolicy; // ok
typedef SpWilsonFermionD FermionAction; // ok
2021-10-12 12:16:47 +01:00
typedef typename FermionAction::FermionField FermionField; // ok?
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
HMCWrapper TheHMC;
TheHMC.Resources.AddFourDimGrid("gauge");
// Checkpointer definition
CheckpointerParameters CPparams;
CPparams.config_prefix = "ckpoint_lat";
CPparams.rng_prefix = "ckpoint_rng";
2022-11-25 13:10:29 +00:00
CPparams.saveInterval = 100;
2021-10-12 12:16:47 +01:00
CPparams.format = "IEEE64BIG";
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
typedef PlaquetteMod<HMCWrapper::ImplPolicy> PlaqObs;
TheHMC.Resources.AddObservable<PlaqObs>();
2022-11-25 13:10:29 +00:00
RealD beta = 7.2 ;
2021-10-12 12:16:47 +01:00
2023-04-18 11:50:20 +01:00
SpWilsonGaugeActionR Waction(beta);
2021-10-12 12:16:47 +01:00
auto GridPtr = TheHMC.Resources.GetCartesian();
auto GridRBPtr = TheHMC.Resources.GetRBCartesian();
2023-06-23 16:04:18 +01:00
SpFundamentalRepresentation::LatticeField U(GridPtr);
2021-10-12 12:16:47 +01:00
2022-11-25 13:10:29 +00:00
RealD mass = -0.76;
2021-10-12 12:16:47 +01:00
FermionAction FermOp(U, *GridPtr, *GridRBPtr, mass);
2023-06-23 16:04:18 +01:00
2021-10-12 12:16:47 +01:00
ConjugateGradient<FermionField> CG(1.0e-8, 2000, false);
TwoFlavourPseudoFermionAction<FermionImplPolicy> Nf2(FermOp, CG, CG);
Nf2.is_smeared = false;
2023-06-23 16:04:18 +01:00
ActionLevel<HMCWrapper::Field, TheRepresentations > Level1(1);
Level1.push_back(&Nf2);
2021-10-12 12:16:47 +01:00
2023-06-23 16:04:18 +01:00
ActionLevel<HMCWrapper::Field, TheRepresentations > Level2(4);
Level2.push_back(&Waction);
2021-10-12 12:16:47 +01:00
2023-06-23 16:04:18 +01:00
TheHMC.TheAction.push_back(Level1);
TheHMC.TheAction.push_back(Level2);
2021-10-12 12:16:47 +01:00
2023-06-23 16:04:18 +01:00
TheHMC.Parameters.MD.MDsteps = 36;
TheHMC.Parameters.MD.trajL = 1.0;
2021-10-12 12:16:47 +01:00
2023-06-23 16:04:18 +01:00
TheHMC.ReadCommandLine(argc, argv);
TheHMC.Run();
2021-10-12 12:16:47 +01:00
Grid_finalize();
}