From c399c2b44dea7e6cc4ca6ee34adcd1a86b07c338 Mon Sep 17 00:00:00 2001 From: paboyle Date: Mon, 5 Mar 2018 12:55:41 +0000 Subject: [PATCH] Guido broke the charge conjugate plaquette action with premature optimisation. This sector of the code does not matter for anything other than Guido's quenched HMC studies, and any plaq specific optimisations should be retained in a private branch instead of destroying the code simplicity. --- lib/qcd/action/gauge/WilsonGaugeAction.h | 12 ++++-------- lib/qcd/utils/WilsonLoops.h | 5 +++-- tests/forces/Test_gp_rect_force.cc | 4 ++-- tests/forces/Test_gpwilson_force.cc | 2 +- 4 files changed, 10 insertions(+), 13 deletions(-) diff --git a/lib/qcd/action/gauge/WilsonGaugeAction.h b/lib/qcd/action/gauge/WilsonGaugeAction.h index 1ea780b7..77c2424c 100644 --- a/lib/qcd/action/gauge/WilsonGaugeAction.h +++ b/lib/qcd/action/gauge/WilsonGaugeAction.h @@ -71,18 +71,14 @@ class WilsonGaugeAction : public Action { RealD factor = 0.5 * beta / RealD(Nc); - //GaugeLinkField Umu(U._grid); + GaugeLinkField Umu(U._grid); GaugeLinkField dSdU_mu(U._grid); for (int mu = 0; mu < Nd; mu++) { - //Umu = PeekIndex(U, mu); + Umu = PeekIndex(U, mu); // Staple in direction mu - //WilsonLoops::Staple(dSdU_mu, U, mu); - //dSdU_mu = Ta(Umu * dSdU_mu) * factor; - - - WilsonLoops::StapleMult(dSdU_mu, U, mu); - dSdU_mu = Ta(dSdU_mu) * factor; + WilsonLoops::Staple(dSdU_mu, U, mu); + dSdU_mu = Ta(Umu * dSdU_mu) * factor; PokeIndex(dSdU, dSdU_mu, mu); } diff --git a/lib/qcd/utils/WilsonLoops.h b/lib/qcd/utils/WilsonLoops.h index cdd76ecc..6cf34e0c 100644 --- a/lib/qcd/utils/WilsonLoops.h +++ b/lib/qcd/utils/WilsonLoops.h @@ -212,6 +212,7 @@ public: // For the force term +/* static void StapleMult(GaugeMat &staple, const GaugeLorentz &Umu, int mu) { GridBase *grid = Umu._grid; std::vector U(Nd, grid); @@ -225,7 +226,7 @@ static void StapleMult(GaugeMat &staple, const GaugeLorentz &Umu, int mu) { for (int nu = 0; nu < Nd; nu++) { if (nu != mu) { - // this is ~10% faster than the Staple + // this is ~10% faster than the Staple -- PAB: so what it gives the WRONG answers for other BC's! tmp1 = Cshift(U[nu], mu, 1); tmp2 = Cshift(U[mu], nu, 1); staple += tmp1* adj(U[nu]*tmp2); @@ -235,7 +236,7 @@ static void StapleMult(GaugeMat &staple, const GaugeLorentz &Umu, int mu) { } staple = U[mu]*staple; } - +*/ ////////////////////////////////////////////////// // the sum over all staples on each site ////////////////////////////////////////////////// diff --git a/tests/forces/Test_gp_rect_force.cc b/tests/forces/Test_gp_rect_force.cc index bb35c77a..6b3349e0 100644 --- a/tests/forces/Test_gp_rect_force.cc +++ b/tests/forces/Test_gp_rect_force.cc @@ -59,8 +59,8 @@ int main (int argc, char ** argv) double beta = 1.0; double c1 = 0.331; - //GparityPlaqPlusRectangleActionR Action(beta,c1); - ConjugateWilsonGaugeActionR Action(beta); + ConjugatePlaqPlusRectangleActionR Action(beta,c1); + // ConjugateWilsonGaugeActionR Action(beta); //WilsonGaugeActionR Action(beta); ComplexD S = Action.S(U); diff --git a/tests/forces/Test_gpwilson_force.cc b/tests/forces/Test_gpwilson_force.cc index ebde61a5..e52ed7ee 100644 --- a/tests/forces/Test_gpwilson_force.cc +++ b/tests/forces/Test_gpwilson_force.cc @@ -91,7 +91,7 @@ int main (int argc, char ** argv) //////////////////////////////////// // Modify the gauge field a little //////////////////////////////////// - RealD dt = 0.0001; + RealD dt = 0.01; LatticeColourMatrix mommu(UGrid); LatticeColourMatrix forcemu(UGrid);