#include using namespace std; using namespace Grid; using namespace Grid::QCD; #define parallel_for PARALLEL_FOR_LOOP for int main (int argc, char ** argv) { Grid_init(&argc,&argv); std::vector latt_size = GridDefaultLatt(); std::vector simd_layout = GridDefaultSimd(Nd,vComplex::Nsimd()); std::vector mpi_layout = GridDefaultMpi(); GridCartesian Grid(latt_size,simd_layout,mpi_layout); GridRedBlackCartesian RBGrid(latt_size,simd_layout,mpi_layout); int threads = GridThread::GetThreads(); std::cout< seeds({1,2,3,4}); GridParallelRNG pRNG(&Grid); pRNG.SeedRandomDevice(); LatticeGaugeField U(&Grid); SU3::HotConfiguration(pRNG,U); double beta = 1.0; double c1 = 0.331; PlaqPlusRectangleActionR Action(beta,c1); // WilsonGaugeActionR Action(beta); ComplexD S = Action.S(U); // get the deriv of phidag MdagM phi with respect to "U" LatticeGaugeField UdSdU(&Grid); Action.deriv(U,UdSdU); //////////////////////////////////// // Modify the gauge field a little //////////////////////////////////// RealD dt = 0.0001; LatticeColourMatrix mommu(&Grid); LatticeColourMatrix forcemu(&Grid); LatticeGaugeField mom(&Grid); LatticeGaugeField Uprime(&Grid); for(int mu=0;mu(mom,mommu,mu); // fourth order exponential approx parallel_for(auto i=mom.begin();i(UdSdU,mu); mommu = PeekIndex(mom,mu); // Update gauge action density // U = exp(p dt) U // dU/dt = p U // so dSdt = trace( dUdt dSdU) = trace( p UdSdUmu ) dS = dS - trace(mommu*UdSdUmu)*dt*2.0; } Complex dSpred = sum(dS); std::cout << GridLogMessage << " S "<