Cleaning up and aligning variable naming between action deriv versions

This commit is contained in:
Mashy Green
2024-12-03 15:23:00 +00:00
parent 47429218bb
commit 3ba019c747
5 changed files with 169 additions and 43 deletions
+15 -15
View File
@@ -71,30 +71,30 @@ public:
return action;
};
virtual void deriv(const GaugeField &Umu,GaugeField & dSdU) {
//extend Ta to include Lorentz indexes
RealD factor_p = c_plaq/RealD(Nc)*0.5;
RealD factor_r = c_rect/RealD(Nc)*0.5;
virtual void deriv(const GaugeField &U, GaugeField &dSdU) {
// extend Ta to include Lorentz indexes
RealD factor_p = c_plaq / RealD(Nc) * 0.5;
RealD factor_r = c_rect / RealD(Nc) * 0.5;
GridBase *grid = Umu.Grid();
GridBase *grid = U.Grid();
std::vector<GaugeLinkField> U (Nd,grid);
for(int mu=0;mu<Nd;mu++){
U[mu] = PeekIndex<LorentzIndex>(Umu,mu);
std::vector<GaugeLinkField> Umu(Nd, grid);
for (int mu = 0; mu < Nd; mu++) {
Umu[mu] = PeekIndex<LorentzIndex>(U, mu);
}
std::vector<GaugeLinkField> RectStaple(Nd,grid), Staple(Nd,grid);
WilsonLoops<Gimpl>::StapleAndRectStapleAll(Staple, RectStaple, U, workspace);
std::vector<GaugeLinkField> RectStaple(Nd, grid), Staple(Nd, grid);
WilsonLoops<Gimpl>::StapleAndRectStapleAll(Staple, RectStaple, Umu,
workspace);
GaugeLinkField dSdU_mu(grid);
GaugeLinkField staple(grid);
for (int mu=0; mu < Nd; mu++){
dSdU_mu = Ta(U[mu]*Staple[mu])*factor_p;
dSdU_mu = dSdU_mu + Ta(U[mu]*RectStaple[mu])*factor_r;
for (int mu = 0; mu < Nd; mu++) {
dSdU_mu = Ta(Umu[mu] * Staple[mu]) * factor_p;
dSdU_mu = dSdU_mu + Ta(Umu[mu] * RectStaple[mu]) * factor_r;
PokeIndex<LorentzIndex>(dSdU, dSdU_mu, mu);
}
};
};
+9 -13
View File
@@ -68,27 +68,23 @@ public:
// extend Ta to include Lorentz indexes
RealD factor = 0.5 * beta / RealD(Nc);
GridBase *grid = U.Grid();
// GaugeLinkField Umu(U.Grid());
std::vector<GaugeLinkField> Uvec(Nd, U.Grid());
for (int d = 0; d < Nd; d++) {
Uvec[d] = PeekIndex<LorentzIndex>(U, d);
GaugeLinkField dSdU_mu(grid);
std::vector<GaugeLinkField> Umu(Nd, grid);
for (int mu = 0; mu < Nd; mu++) {
Umu[mu] = PeekIndex<LorentzIndex>(U, mu);
}
GaugeLinkField dSdU_mu(U.Grid());
for (int mu = 0; mu < Nd; mu++) {
// Umu = PeekIndex<LorentzIndex>(U, mu);
// Staple in direction mu
// WilsonLoops<Gimpl>::Staple(dSdU_mu, U, mu);
// dSdU_mu = Ta(Umu * dSdU_mu) * factor;
WilsonLoops<Gimpl>::Staple(dSdU_mu, Uvec, mu);
dSdU_mu = Ta(Uvec[mu] * dSdU_mu) * factor;
WilsonLoops<Gimpl>::Staple(dSdU_mu, Umu, mu);
dSdU_mu = Ta(Umu[mu] * dSdU_mu) * factor;
PokeIndex<LorentzIndex>(dSdU, dSdU_mu, mu);
}
}
private:
RealD beta;
};