1
0
mirror of https://github.com/paboyle/Grid.git synced 2025-06-17 23:37:06 +01:00

Ward Identity test improvements and conserved current bug fixes

This commit is contained in:
Lanny91
2017-06-05 11:55:41 +01:00
parent 23135aa58a
commit eec79e0a1e
3 changed files with 42 additions and 24 deletions

View File

@ -286,8 +286,9 @@ void WilsonKernels<Impl>::DhopDir( StencilImpl &st, DoubledGaugeField &U,SiteHal
* to make a conserved current sink or inserting the conserved current
* sequentially. Common to both 4D and 5D.
******************************************************************************/
#define WilsonCurrentFwd(expr, mu) (0.5*(Gamma::gmu[mu]*expr - expr))
#define WilsonCurrentBwd(expr, mu) (0.5*(Gamma::gmu[mu]*expr + expr))
// N.B. Functions below assume a -1/2 factor within U.
#define WilsonCurrentFwd(expr, mu) ((expr - Gamma::gmu[mu]*expr))
#define WilsonCurrentBwd(expr, mu) ((expr + Gamma::gmu[mu]*expr))
template<class Impl>
void WilsonKernels<Impl>::ContractConservedCurrentInternal(const PropagatorField &q_in_1,
@ -300,13 +301,13 @@ void WilsonKernels<Impl>::ContractConservedCurrentInternal(const PropagatorField
Gamma g5(Gamma::Algebra::Gamma5);
PropagatorField tmp(q_out._grid);
GaugeLinkField Umu(U._grid);
Umu = PeekIndex<LorentzIndex>(U, mu);
Umu = PeekIndex<LorentzIndex>(U, mu);
tmp = this->CovShiftForward(Umu, mu, q_in_1);
q_out = (g5*adj(q_in_2)*g5)*WilsonCurrentFwd(tmp, mu);
tmp = adj(Umu)*q_in_1;
q_out += (g5*adj(this->CovShiftForward(Umu, mu, q_in_2))*g5)*WilsonCurrentBwd(q_in_1, mu);
tmp = this->CovShiftForward(Umu, mu, q_in_2);
q_out -= (g5*adj(tmp)*g5)*WilsonCurrentBwd(q_in_1, mu);
}
@ -320,21 +321,21 @@ void WilsonKernels<Impl>::SeqConservedCurrentInternal(const PropagatorField &q_i
unsigned int tmin,
unsigned int tmax)
{
int tshift = (mu == Nd - 1) ? 1 : 0;
int tshift = (mu == Tp) ? 1 : 0;
Real G_T = (curr_type == Current::Tadpole) ? -1. : 1.;
PropagatorField tmp(q_in._grid);
GaugeLinkField Umu(U._grid);
Umu = PeekIndex<LorentzIndex>(U, mu);
Umu = PeekIndex<LorentzIndex>(U, mu);
Lattice<iScalar<vInteger>> t(q_in._grid);
tmp = this->CovShiftForward(Umu, mu, q_in)*ph;
where((t >= tmin) and (t <= tmax), tmp, 0.*tmp);
tmp = where((t >= tmin) and (t <= tmax), tmp, 0.*tmp);
q_out = G_T*WilsonCurrentFwd(tmp, mu);
tmp = q_in*ph;
tmp = this->CovShiftBackward(Umu, mu, tmp);
where((t >= tmin + tshift) and (t <= tmax + tshift), tmp, 0.*tmp);
q_out += WilsonCurrentBwd(tmp, mu);
tmp = where((t >= tmin + tshift) and (t <= tmax + tshift), tmp, 0.*tmp);
q_out -= WilsonCurrentBwd(tmp, mu);
}