/************************************************************************************* Grid physics library, www.github.com/paboyle/Grid Source file: ./tests/Test_padded_cell.cc Copyright (C) 2015 Author: Peter Boyle 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 #include #include using namespace std; using namespace Grid; template void gpermute(vobj & inout,int perm){ vobj tmp=inout; if (perm & 0x1 ) { permute(inout,tmp,0); tmp=inout;} if (perm & 0x2 ) { permute(inout,tmp,1); tmp=inout;} if (perm & 0x4 ) { permute(inout,tmp,2); tmp=inout;} if (perm & 0x8 ) { permute(inout,tmp,3); tmp=inout;} } int main (int argc, char ** argv) { Grid_init(&argc,&argv); Coordinate latt_size = GridDefaultLatt(); Coordinate simd_layout= GridDefaultSimd(Nd,vComplexD::Nsimd()); Coordinate mpi_layout = GridDefaultMpi(); std::cout << " mpi "<({45,12,81,9})); LatticeGaugeField Umu(&GRID); SU::HotConfiguration(pRNG,Umu); Real plaq=WilsonLoops::avgPlaquette(Umu); LatticeComplex trplaq(&GRID); std::vector U(Nd, Umu.Grid()); for (int mu = 0; mu < Nd; mu++) { U[mu] = PeekIndex(Umu, mu); } std::cout << GridLogMessage << " Average plaquette "< shifts; for(int mu=0;mu_offset; int o1 = SE1->_offset; int o2 = SE2->_offset; int o3 = SE3->_offset; auto U0 = U_v[o0](mu); auto U1 = U_v[o1](nu); auto U2 = adj(U_v[o2](mu)); auto U3 = adj(U_v[o3](nu)); gpermute(U0,SE0->_permute); gpermute(U1,SE1->_permute); gpermute(U2,SE2->_permute); gpermute(U3,SE3->_permute); gp_v[ss]() =gp_v[ss]() + trace( U0*U1*U2*U3 ); s=s+4; } } } } cplaq = Ghost.Extract(gplaq); RealD vol = cplaq.Grid()->gSites(); RealD faces = (Nd * (Nd-1))/2; auto p = TensorRemove(sum(cplaq)); auto result = p.real()/vol/faces/Nc; std::cout << GridLogMessage << " Average plaquette via padded cell "<