mirror of
https://github.com/paboyle/Grid.git
synced 2025-06-13 04:37:05 +01:00
Ward Identity test improvements and conserved current bug fixes
This commit is contained in:
@ -700,8 +700,14 @@ void WilsonFermion5D<Impl>::ContractConservedCurrent(PropagatorField &q_in_1,
|
||||
Kernels::ContractConservedCurrentInternal(q1_s, q2_s, tmp, Umu, curr_type, mu);
|
||||
|
||||
// Axial current sign
|
||||
Real G_s = (curr_type == Current::Axial) ? ((s < Ls/2) ? -1. : 1.) : 1.;
|
||||
q_out += G_s*tmp;
|
||||
if ((curr_type == Current::Axial) && (s < (Ls / 2)))
|
||||
{
|
||||
q_out -= tmp;
|
||||
}
|
||||
else
|
||||
{
|
||||
q_out += tmp;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user