mirror of
https://github.com/paboyle/Grid.git
synced 2025-04-04 19:25:56 +01:00
fix naik bug
This commit is contained in:
parent
c8b17c9526
commit
9cd4128833
@ -291,15 +291,14 @@ public:
|
|||||||
for (int mu = 0; mu < Nd; mu++) {
|
for (int mu = 0; mu < Nd; mu++) {
|
||||||
U[mu] = PeekIndex<LorentzIndex>(u_thin, mu);
|
U[mu] = PeekIndex<LorentzIndex>(u_thin, mu);
|
||||||
V[mu] = PeekIndex<LorentzIndex>(u_smr, mu);
|
V[mu] = PeekIndex<LorentzIndex>(u_smr, mu);
|
||||||
Vnaik[mu] = PeekIndex<LorentzIndex>(u_naik, mu);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for(int mu=0;mu<Nd;mu++) {
|
for(int mu=0;mu<Nd;mu++) {
|
||||||
|
|
||||||
// Naik
|
// Naik
|
||||||
Vnaik[mu] = Vnaik[mu] + lt.c_naik*Gimpl::CovShiftForward(U[mu],mu,
|
Vnaik[mu] = lt.c_naik*Gimpl::CovShiftForward(U[mu],mu,
|
||||||
Gimpl::CovShiftForward(U[mu],mu,
|
Gimpl::CovShiftForward(U[mu],mu,
|
||||||
Gimpl::CovShiftIdentityForward(U[mu],mu)));
|
Gimpl::CovShiftIdentityForward(U[mu],mu)));
|
||||||
|
|
||||||
// LePage
|
// LePage
|
||||||
for (int nu_h=1;nu_h<Nd;nu_h++) {
|
for (int nu_h=1;nu_h<Nd;nu_h++) {
|
||||||
@ -321,7 +320,8 @@ public:
|
|||||||
|
|
||||||
// Put V back into u_smr.
|
// Put V back into u_smr.
|
||||||
for (int mu = 0; mu < Nd; mu++) {
|
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);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -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) {
|
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);
|
Smear_HISQ<PeriodicGimplD> hisq_fat(&GRID,c1,cnaik,c3,c5,c7,clp);
|
||||||
hisq_fat.smear(Usmr, Unaik, Umu);
|
hisq_fat.smear(Usmr, Unaik, Umu);
|
||||||
LatticeGaugeFieldD diff(&GRID);
|
LatticeGaugeFieldD diff1(&GRID), diff2(&GRID);
|
||||||
diff = Ucontrol-Usmr;
|
diff1 = Ucontrol-Usmr;
|
||||||
auto absDiff = norm2(diff)/norm2(Ucontrol);
|
diff2 = Ucontrol-Unaik;
|
||||||
if (absDiff < 1e-30) {
|
auto absDiff1 = norm2(diff1)/norm2(Ucontrol);
|
||||||
Grid_pass(" |Umu-U|/|Umu| = ",absDiff);
|
auto absDiff2 = norm2(diff2)/norm2(Ucontrol);
|
||||||
|
if (absDiff1 < 1e-30) {
|
||||||
|
Grid_pass(" |Umu-Usmr|/|Umu| = ",absDiff1);
|
||||||
} else {
|
} 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");
|
NerscIO::readConfiguration(Ucontrol, header, "nersc.l8t4b3360.35link.control");
|
||||||
testSmear(GRID,Umu,Usmr,Unaik,Ucontrol,1/8.,0.,1/16.,1/64.,0.,0.);
|
testSmear(GRID,Umu,Usmr,Unaik,Ucontrol,1/8.,0.,1/16.,1/64.,0.,0.);
|
||||||
NerscIO::readConfiguration(Ucontrol, header, "nersc.l8t4b3360.3link.control");
|
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
|
// Test a C-style instantiation
|
||||||
double path_coeff[6] = {1, 2, 3, 4, 5, 6};
|
double path_coeff[6] = {1, 2, 3, 4, 5, 6};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user