mirror of
https://github.com/paboyle/Grid.git
synced 2024-11-10 07:55:35 +00:00
76d752585b
to a little figure out what Guido had done & why -- but there is a neat saving of force evaluations across the nesting time boundary making use of linearity of the leapP in dt. I cleaned up the printing, reduced the volume of code, in the process sharing printing between all integrators. Placed an assert that the total integration time for all integrators must match at end of trajectory. Have now verified e-dH = 1 for nested integrators in Wilson/Wilson runs with both Omelyan and with Leapfrog so substantial confidence gained.
59 lines
1.7 KiB
C++
59 lines
1.7 KiB
C++
#include "Grid.h"
|
|
|
|
|
|
using namespace std;
|
|
using namespace Grid;
|
|
using namespace Grid::QCD;
|
|
|
|
int main (int argc, char ** argv)
|
|
{
|
|
Grid_init(&argc,&argv);
|
|
|
|
std::vector<int> latt_size = GridDefaultLatt();
|
|
std::vector<int> simd_layout = GridDefaultSimd(4,vComplex::Nsimd());
|
|
std::vector<int> mpi_layout = GridDefaultMpi();
|
|
|
|
GridCartesian Fine(latt_size,simd_layout,mpi_layout);
|
|
GridRedBlackCartesian RBFine(latt_size,simd_layout,mpi_layout);
|
|
GridParallelRNG pRNG(&Fine);
|
|
std::vector<int> seeds({6,7,8,80});
|
|
pRNG.SeedFixedIntegers(seeds);
|
|
LatticeLorentzColourMatrix U(&Fine);
|
|
|
|
SU3::HotConfiguration(pRNG, U);
|
|
|
|
// simplify template declaration? Strip the lorentz from the second template
|
|
WilsonGaugeAction<LatticeLorentzColourMatrix, LatticeColourMatrix> Waction(5.6);
|
|
|
|
Real mass=-0.77;
|
|
WilsonFermionR FermOp(U,Fine,RBFine,mass);
|
|
|
|
ConjugateGradient<LatticeFermion> CG(1.0e-8,10000);
|
|
|
|
TwoFlavourEvenOddPseudoFermionAction<WilsonImplR> WilsonNf2(FermOp,CG,CG);
|
|
|
|
//Collect actions
|
|
ActionLevel Level1(1);
|
|
ActionLevel Level2(4);
|
|
Level1.push_back(&WilsonNf2);
|
|
Level2.push_back(&Waction);
|
|
|
|
ActionSet FullSet;
|
|
FullSet.push_back(Level1);
|
|
FullSet.push_back(Level2);
|
|
|
|
// Create integrator
|
|
// typedef LeapFrog IntegratorAlgorithm;// change here to change the algorithm
|
|
// IntegratorParameters MDpar(12,40,1.0);
|
|
typedef MinimumNorm2 IntegratorAlgorithm;// change here to change the algorithm
|
|
IntegratorParameters MDpar(12,10,1.0);
|
|
Integrator<IntegratorAlgorithm> MDynamics(&Fine,MDpar, FullSet);
|
|
|
|
// Create HMC
|
|
HMCparameters HMCpar;
|
|
HybridMonteCarlo<IntegratorAlgorithm> HMC(HMCpar, MDynamics);
|
|
|
|
HMC.evolve(U);
|
|
|
|
}
|