1
0
mirror of https://github.com/paboyle/Grid.git synced 2024-11-09 23:45:36 +00:00

fix naik bug

This commit is contained in:
david clarke 2023-11-03 14:11:38 -06:00
parent c8b17c9526
commit 9cd4128833
2 changed files with 21 additions and 12 deletions

View File

@ -291,15 +291,14 @@ public:
for (int mu = 0; mu < Nd; mu++) {
U[mu] = PeekIndex<LorentzIndex>(u_thin, mu);
V[mu] = PeekIndex<LorentzIndex>(u_smr, mu);
Vnaik[mu] = PeekIndex<LorentzIndex>(u_naik, mu);
}
for(int mu=0;mu<Nd;mu++) {
// Naik
Vnaik[mu] = Vnaik[mu] + lt.c_naik*Gimpl::CovShiftForward(U[mu],mu,
Gimpl::CovShiftForward(U[mu],mu,
Gimpl::CovShiftIdentityForward(U[mu],mu)));
Vnaik[mu] = lt.c_naik*Gimpl::CovShiftForward(U[mu],mu,
Gimpl::CovShiftForward(U[mu],mu,
Gimpl::CovShiftIdentityForward(U[mu],mu)));
// LePage
for (int nu_h=1;nu_h<Nd;nu_h++) {
@ -321,7 +320,8 @@ public:
// Put V back into u_smr.
for (int mu = 0; mu < Nd; mu++) {
PokeIndex<LorentzIndex>(u_smr, V[mu], mu);
PokeIndex<LorentzIndex>(u_smr , V[mu] , mu);
PokeIndex<LorentzIndex>(u_naik, Vnaik[mu], mu);
}
};

View File

@ -62,13 +62,20 @@ void testSmear(GridCartesian& GRID, LatticeGaugeFieldD Umu, LatticeGaugeFieldD U
LatticeGaugeFieldD Ucontrol, Real c1, Real cnaik, Real c3, Real c5, Real c7, Real clp) {
Smear_HISQ<PeriodicGimplD> hisq_fat(&GRID,c1,cnaik,c3,c5,c7,clp);
hisq_fat.smear(Usmr, Unaik, Umu);
LatticeGaugeFieldD diff(&GRID);
diff = Ucontrol-Usmr;
auto absDiff = norm2(diff)/norm2(Ucontrol);
if (absDiff < 1e-30) {
Grid_pass(" |Umu-U|/|Umu| = ",absDiff);
LatticeGaugeFieldD diff1(&GRID), diff2(&GRID);
diff1 = Ucontrol-Usmr;
diff2 = Ucontrol-Unaik;
auto absDiff1 = norm2(diff1)/norm2(Ucontrol);
auto absDiff2 = norm2(diff2)/norm2(Ucontrol);
if (absDiff1 < 1e-30) {
Grid_pass(" |Umu-Usmr|/|Umu| = ",absDiff1);
} else {
Grid_error(" |Umu-U|/|Umu| = ",absDiff);
Grid_error(" |Umu-Usmr|/|Umu| = ",absDiff1);
}
if (absDiff2 < 1e-30) {
Grid_pass(" |Umu-Unaik|/|Umu| = ",absDiff2);
} else {
Grid_error(" |Umu-Unaik|/|Umu| = ",absDiff2);
}
}
@ -114,7 +121,9 @@ int main (int argc, char** argv) {
NerscIO::readConfiguration(Ucontrol, header, "nersc.l8t4b3360.35link.control");
testSmear(GRID,Umu,Usmr,Unaik,Ucontrol,1/8.,0.,1/16.,1/64.,0.,0.);
NerscIO::readConfiguration(Ucontrol, header, "nersc.l8t4b3360.3link.control");
testSmear(GRID,Umu,Usmr,Unaik,Ucontrol,1/8.,0.,1/16.,0.,0.,0.);
testSmear(GRID,Umu,Usmr,Unaik,Ucontrol,1/8.,1.,1/16.,0.,0.,0.);
NerscIO::readConfiguration(Ucontrol, header, "nersc.l8t4b3360.3link.control");
testSmear(GRID,Umu,Usmr,Unaik,Ucontrol,1/8.,2.,1/16.,0.,0.,0.);
// Test a C-style instantiation
double path_coeff[6] = {1, 2, 3, 4, 5, 6};