2016-07-18 16:36:28 +01:00
|
|
|
/*************************************************************************************
|
2016-01-02 14:51:32 +00:00
|
|
|
|
2016-07-18 16:36:28 +01:00
|
|
|
Grid physics library, www.github.com/paboyle/Grid
|
2016-01-02 14:51:32 +00:00
|
|
|
|
2016-07-18 16:36:28 +01:00
|
|
|
Source file: ./lib/qcd/action/fermion/WilsonKernels.cc
|
2016-01-02 14:51:32 +00:00
|
|
|
|
2016-07-18 16:36:28 +01:00
|
|
|
Copyright (C) 2015
|
2016-01-02 14:51:32 +00:00
|
|
|
|
|
|
|
Author: Peter Boyle <paboyle@ph.ed.ac.uk>
|
|
|
|
Author: Peter Boyle <peterboyle@Peters-MacBook-Pro-2.local>
|
|
|
|
Author: paboyle <paboyle@ph.ed.ac.uk>
|
|
|
|
|
2016-07-18 16:36:28 +01:00
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
2016-01-02 14:51:32 +00:00
|
|
|
|
2016-07-18 16:36:28 +01:00
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
2016-01-02 14:51:32 +00:00
|
|
|
|
2016-07-18 16:36:28 +01:00
|
|
|
You should have received a copy of the GNU General Public License along
|
|
|
|
with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
2016-01-02 14:51:32 +00:00
|
|
|
|
2016-07-18 16:36:28 +01:00
|
|
|
See the full license in the file "LICENSE" in the top level distribution
|
|
|
|
directory
|
|
|
|
*************************************************************************************/
|
|
|
|
/* END LEGAL */
|
2017-02-22 18:09:33 +00:00
|
|
|
#include <Grid/qcd/action/fermion/FermionCore.h>
|
2017-02-23 00:25:29 +00:00
|
|
|
|
2018-01-14 23:01:07 +00:00
|
|
|
NAMESPACE_BEGIN(Grid);
|
2015-05-26 19:55:18 +01:00
|
|
|
|
2017-04-24 00:29:27 +01:00
|
|
|
int WilsonKernelsStatic::Opt = WilsonKernelsStatic::OptGeneric;
|
|
|
|
int WilsonKernelsStatic::Comms = WilsonKernelsStatic::CommsAndCompute;
|
2016-12-22 17:52:21 +00:00
|
|
|
|
2016-07-18 16:36:28 +01:00
|
|
|
template <class Impl>
|
|
|
|
WilsonKernels<Impl>::WilsonKernels(const ImplParams &p) : Base(p){};
|
2015-12-10 22:55:00 +00:00
|
|
|
|
2016-07-18 16:36:28 +01:00
|
|
|
////////////////////////////////////////////
|
|
|
|
// Generic implementation; move to different file?
|
|
|
|
////////////////////////////////////////////
|
2017-04-22 11:33:50 +01:00
|
|
|
|
|
|
|
#define GENERIC_STENCIL_LEG(Dir,spProj,Recon) \
|
|
|
|
SE = st.GetEntry(ptype, Dir, sF); \
|
|
|
|
if (SE->_is_local) { \
|
|
|
|
chi_p = χ \
|
|
|
|
if (SE->_permute) { \
|
|
|
|
spProj(tmp, in._odata[SE->_offset]); \
|
|
|
|
permute(chi, tmp, ptype); \
|
|
|
|
} else { \
|
|
|
|
spProj(chi, in._odata[SE->_offset]); \
|
|
|
|
} \
|
|
|
|
} else { \
|
|
|
|
chi_p = &buf[SE->_offset]; \
|
|
|
|
} \
|
|
|
|
Impl::multLink(Uchi, U._odata[sU], *chi_p, Dir, SE, st); \
|
|
|
|
Recon(result, Uchi);
|
|
|
|
|
|
|
|
#define GENERIC_STENCIL_LEG_INT(Dir,spProj,Recon) \
|
|
|
|
SE = st.GetEntry(ptype, Dir, sF); \
|
|
|
|
if (SE->_is_local) { \
|
|
|
|
chi_p = χ \
|
|
|
|
if (SE->_permute) { \
|
|
|
|
spProj(tmp, in._odata[SE->_offset]); \
|
|
|
|
permute(chi, tmp, ptype); \
|
|
|
|
} else { \
|
|
|
|
spProj(chi, in._odata[SE->_offset]); \
|
|
|
|
} \
|
|
|
|
} else if ( st.same_node[Dir] ) { \
|
|
|
|
chi_p = &buf[SE->_offset]; \
|
|
|
|
} \
|
|
|
|
if (SE->_is_local || st.same_node[Dir] ) { \
|
|
|
|
Impl::multLink(Uchi, U._odata[sU], *chi_p, Dir, SE, st); \
|
|
|
|
Recon(result, Uchi); \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define GENERIC_STENCIL_LEG_EXT(Dir,spProj,Recon) \
|
|
|
|
SE = st.GetEntry(ptype, Dir, sF); \
|
|
|
|
if ((!SE->_is_local) && (!st.same_node[Dir]) ) { \
|
|
|
|
chi_p = &buf[SE->_offset]; \
|
|
|
|
Impl::multLink(Uchi, U._odata[sU], *chi_p, Dir, SE, st); \
|
|
|
|
Recon(result, Uchi); \
|
|
|
|
nmu++; \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define GENERIC_DHOPDIR_LEG(Dir,spProj,Recon) \
|
|
|
|
if (gamma == Dir) { \
|
|
|
|
if (SE->_is_local && SE->_permute) { \
|
|
|
|
spProj(tmp, in._odata[SE->_offset]); \
|
|
|
|
permute(chi, tmp, ptype); \
|
|
|
|
} else if (SE->_is_local) { \
|
|
|
|
spProj(chi, in._odata[SE->_offset]); \
|
|
|
|
} else { \
|
|
|
|
chi = buf[SE->_offset]; \
|
|
|
|
} \
|
|
|
|
Impl::multLink(Uchi, U._odata[sU], chi, dir, SE, st); \
|
|
|
|
Recon(result, Uchi); \
|
|
|
|
}
|
2016-07-18 16:36:28 +01:00
|
|
|
|
2017-04-22 11:33:50 +01:00
|
|
|
////////////////////////////////////////////////////////////////////
|
|
|
|
// All legs kernels ; comms then compute
|
|
|
|
////////////////////////////////////////////////////////////////////
|
2016-07-18 16:36:28 +01:00
|
|
|
template <class Impl>
|
2017-02-07 06:37:10 +00:00
|
|
|
void WilsonKernels<Impl>::GenericDhopSiteDag(StencilImpl &st, LebesgueOrder &lo, DoubledGaugeField &U,
|
2017-04-22 11:33:50 +01:00
|
|
|
SiteHalfSpinor *buf, int sF,
|
|
|
|
int sU, const FermionField &in, FermionField &out)
|
|
|
|
{
|
2016-07-18 16:36:28 +01:00
|
|
|
SiteHalfSpinor tmp;
|
|
|
|
SiteHalfSpinor chi;
|
2016-03-27 05:24:07 +01:00
|
|
|
SiteHalfSpinor *chi_p;
|
2015-08-10 20:47:44 +01:00
|
|
|
SiteHalfSpinor Uchi;
|
2015-08-14 00:01:04 +01:00
|
|
|
SiteSpinor result;
|
|
|
|
StencilEntry *SE;
|
|
|
|
int ptype;
|
2015-08-10 20:47:44 +01:00
|
|
|
|
2017-04-22 11:33:50 +01:00
|
|
|
GENERIC_STENCIL_LEG(Xp,spProjXp,spReconXp);
|
|
|
|
GENERIC_STENCIL_LEG(Yp,spProjYp,accumReconYp);
|
|
|
|
GENERIC_STENCIL_LEG(Zp,spProjZp,accumReconZp);
|
|
|
|
GENERIC_STENCIL_LEG(Tp,spProjTp,accumReconTp);
|
|
|
|
GENERIC_STENCIL_LEG(Xm,spProjXm,accumReconXm);
|
|
|
|
GENERIC_STENCIL_LEG(Ym,spProjYm,accumReconYm);
|
|
|
|
GENERIC_STENCIL_LEG(Zm,spProjZm,accumReconZm);
|
|
|
|
GENERIC_STENCIL_LEG(Tm,spProjTm,accumReconTm);
|
2016-07-18 16:36:28 +01:00
|
|
|
vstream(out._odata[sF], result);
|
2015-08-10 20:47:44 +01:00
|
|
|
};
|
|
|
|
|
2016-07-18 16:36:28 +01:00
|
|
|
template <class Impl>
|
2017-02-07 06:37:10 +00:00
|
|
|
void WilsonKernels<Impl>::GenericDhopSite(StencilImpl &st, LebesgueOrder &lo, DoubledGaugeField &U,
|
2017-04-22 11:33:50 +01:00
|
|
|
SiteHalfSpinor *buf, int sF,
|
|
|
|
int sU, const FermionField &in, FermionField &out)
|
|
|
|
{
|
2016-07-18 16:36:28 +01:00
|
|
|
SiteHalfSpinor tmp;
|
|
|
|
SiteHalfSpinor chi;
|
|
|
|
SiteHalfSpinor *chi_p;
|
2015-08-10 20:47:44 +01:00
|
|
|
SiteHalfSpinor Uchi;
|
2016-01-03 01:38:11 +00:00
|
|
|
SiteSpinor result;
|
2015-08-14 00:01:04 +01:00
|
|
|
StencilEntry *SE;
|
|
|
|
int ptype;
|
2015-08-10 20:47:44 +01:00
|
|
|
|
2017-04-22 11:33:50 +01:00
|
|
|
GENERIC_STENCIL_LEG(Xm,spProjXp,spReconXp);
|
|
|
|
GENERIC_STENCIL_LEG(Ym,spProjYp,accumReconYp);
|
|
|
|
GENERIC_STENCIL_LEG(Zm,spProjZp,accumReconZp);
|
|
|
|
GENERIC_STENCIL_LEG(Tm,spProjTp,accumReconTp);
|
|
|
|
GENERIC_STENCIL_LEG(Xp,spProjXm,accumReconXm);
|
|
|
|
GENERIC_STENCIL_LEG(Yp,spProjYm,accumReconYm);
|
|
|
|
GENERIC_STENCIL_LEG(Zp,spProjZm,accumReconZm);
|
|
|
|
GENERIC_STENCIL_LEG(Tp,spProjTm,accumReconTm);
|
|
|
|
vstream(out._odata[sF], result);
|
|
|
|
};
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
|
|
// Interior kernels
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
|
|
template <class Impl>
|
|
|
|
void WilsonKernels<Impl>::GenericDhopSiteDagInt(StencilImpl &st, LebesgueOrder &lo, DoubledGaugeField &U,
|
|
|
|
SiteHalfSpinor *buf, int sF,
|
|
|
|
int sU, const FermionField &in, FermionField &out)
|
|
|
|
{
|
|
|
|
SiteHalfSpinor tmp;
|
|
|
|
SiteHalfSpinor chi;
|
|
|
|
SiteHalfSpinor *chi_p;
|
|
|
|
SiteHalfSpinor Uchi;
|
|
|
|
SiteSpinor result;
|
|
|
|
StencilEntry *SE;
|
|
|
|
int ptype;
|
2016-07-18 16:36:28 +01:00
|
|
|
|
2017-04-22 11:33:50 +01:00
|
|
|
result=zero;
|
|
|
|
GENERIC_STENCIL_LEG_INT(Xp,spProjXp,accumReconXp);
|
|
|
|
GENERIC_STENCIL_LEG_INT(Yp,spProjYp,accumReconYp);
|
|
|
|
GENERIC_STENCIL_LEG_INT(Zp,spProjZp,accumReconZp);
|
|
|
|
GENERIC_STENCIL_LEG_INT(Tp,spProjTp,accumReconTp);
|
|
|
|
GENERIC_STENCIL_LEG_INT(Xm,spProjXm,accumReconXm);
|
|
|
|
GENERIC_STENCIL_LEG_INT(Ym,spProjYm,accumReconYm);
|
|
|
|
GENERIC_STENCIL_LEG_INT(Zm,spProjZm,accumReconZm);
|
|
|
|
GENERIC_STENCIL_LEG_INT(Tm,spProjTm,accumReconTm);
|
|
|
|
vstream(out._odata[sF], result);
|
|
|
|
};
|
2016-01-03 01:38:11 +00:00
|
|
|
|
2017-04-22 11:33:50 +01:00
|
|
|
template <class Impl>
|
|
|
|
void WilsonKernels<Impl>::GenericDhopSiteInt(StencilImpl &st, LebesgueOrder &lo, DoubledGaugeField &U,
|
|
|
|
SiteHalfSpinor *buf, int sF,
|
|
|
|
int sU, const FermionField &in, FermionField &out)
|
|
|
|
{
|
|
|
|
SiteHalfSpinor tmp;
|
|
|
|
SiteHalfSpinor chi;
|
|
|
|
SiteHalfSpinor *chi_p;
|
|
|
|
SiteHalfSpinor Uchi;
|
|
|
|
SiteSpinor result;
|
|
|
|
StencilEntry *SE;
|
|
|
|
int ptype;
|
|
|
|
result=zero;
|
|
|
|
GENERIC_STENCIL_LEG_INT(Xm,spProjXp,accumReconXp);
|
|
|
|
GENERIC_STENCIL_LEG_INT(Ym,spProjYp,accumReconYp);
|
|
|
|
GENERIC_STENCIL_LEG_INT(Zm,spProjZp,accumReconZp);
|
|
|
|
GENERIC_STENCIL_LEG_INT(Tm,spProjTp,accumReconTp);
|
|
|
|
GENERIC_STENCIL_LEG_INT(Xp,spProjXm,accumReconXm);
|
|
|
|
GENERIC_STENCIL_LEG_INT(Yp,spProjYm,accumReconYm);
|
|
|
|
GENERIC_STENCIL_LEG_INT(Zp,spProjZm,accumReconZm);
|
|
|
|
GENERIC_STENCIL_LEG_INT(Tp,spProjTm,accumReconTm);
|
|
|
|
vstream(out._odata[sF], result);
|
|
|
|
};
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
|
|
// Exterior kernels
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
|
|
template <class Impl>
|
|
|
|
void WilsonKernels<Impl>::GenericDhopSiteDagExt(StencilImpl &st, LebesgueOrder &lo, DoubledGaugeField &U,
|
|
|
|
SiteHalfSpinor *buf, int sF,
|
|
|
|
int sU, const FermionField &in, FermionField &out)
|
|
|
|
{
|
|
|
|
SiteHalfSpinor tmp;
|
|
|
|
SiteHalfSpinor chi;
|
|
|
|
SiteHalfSpinor *chi_p;
|
|
|
|
SiteHalfSpinor Uchi;
|
|
|
|
SiteSpinor result;
|
|
|
|
StencilEntry *SE;
|
|
|
|
int ptype;
|
|
|
|
int nmu=0;
|
|
|
|
result=zero;
|
|
|
|
GENERIC_STENCIL_LEG_EXT(Xp,spProjXp,accumReconXp);
|
|
|
|
GENERIC_STENCIL_LEG_EXT(Yp,spProjYp,accumReconYp);
|
|
|
|
GENERIC_STENCIL_LEG_EXT(Zp,spProjZp,accumReconZp);
|
|
|
|
GENERIC_STENCIL_LEG_EXT(Tp,spProjTp,accumReconTp);
|
|
|
|
GENERIC_STENCIL_LEG_EXT(Xm,spProjXm,accumReconXm);
|
|
|
|
GENERIC_STENCIL_LEG_EXT(Ym,spProjYm,accumReconYm);
|
|
|
|
GENERIC_STENCIL_LEG_EXT(Zm,spProjZm,accumReconZm);
|
|
|
|
GENERIC_STENCIL_LEG_EXT(Tm,spProjTm,accumReconTm);
|
|
|
|
if ( nmu ) {
|
|
|
|
out._odata[sF] = out._odata[sF] + result;
|
2016-01-03 01:38:11 +00:00
|
|
|
}
|
2017-04-22 11:33:50 +01:00
|
|
|
};
|
2016-01-03 01:38:11 +00:00
|
|
|
|
2017-04-22 11:33:50 +01:00
|
|
|
template <class Impl>
|
|
|
|
void WilsonKernels<Impl>::GenericDhopSiteExt(StencilImpl &st, LebesgueOrder &lo, DoubledGaugeField &U,
|
|
|
|
SiteHalfSpinor *buf, int sF,
|
|
|
|
int sU, const FermionField &in, FermionField &out)
|
|
|
|
{
|
|
|
|
SiteHalfSpinor tmp;
|
|
|
|
SiteHalfSpinor chi;
|
|
|
|
SiteHalfSpinor *chi_p;
|
|
|
|
SiteHalfSpinor Uchi;
|
|
|
|
SiteSpinor result;
|
|
|
|
StencilEntry *SE;
|
|
|
|
int ptype;
|
|
|
|
int nmu=0;
|
|
|
|
result=zero;
|
|
|
|
GENERIC_STENCIL_LEG_EXT(Xm,spProjXp,accumReconXp);
|
|
|
|
GENERIC_STENCIL_LEG_EXT(Ym,spProjYp,accumReconYp);
|
|
|
|
GENERIC_STENCIL_LEG_EXT(Zm,spProjZp,accumReconZp);
|
|
|
|
GENERIC_STENCIL_LEG_EXT(Tm,spProjTp,accumReconTp);
|
|
|
|
GENERIC_STENCIL_LEG_EXT(Xp,spProjXm,accumReconXm);
|
|
|
|
GENERIC_STENCIL_LEG_EXT(Yp,spProjYm,accumReconYm);
|
|
|
|
GENERIC_STENCIL_LEG_EXT(Zp,spProjZm,accumReconZm);
|
|
|
|
GENERIC_STENCIL_LEG_EXT(Tp,spProjTm,accumReconTm);
|
|
|
|
if ( nmu ) {
|
|
|
|
out._odata[sF] = out._odata[sF] + result;
|
2016-01-03 01:38:11 +00:00
|
|
|
}
|
|
|
|
};
|
2015-05-26 19:55:18 +01:00
|
|
|
|
2016-07-18 16:36:28 +01:00
|
|
|
template <class Impl>
|
2017-02-07 06:37:10 +00:00
|
|
|
void WilsonKernels<Impl>::DhopDir( StencilImpl &st, DoubledGaugeField &U,SiteHalfSpinor *buf, int sF,
|
2016-10-22 18:14:27 +01:00
|
|
|
int sU, const FermionField &in, FermionField &out, int dir, int gamma) {
|
|
|
|
|
2016-07-18 16:36:28 +01:00
|
|
|
SiteHalfSpinor tmp;
|
|
|
|
SiteHalfSpinor chi;
|
|
|
|
SiteSpinor result;
|
2015-08-10 20:47:44 +01:00
|
|
|
SiteHalfSpinor Uchi;
|
2015-08-14 00:01:04 +01:00
|
|
|
StencilEntry *SE;
|
|
|
|
int ptype;
|
2015-08-10 20:47:44 +01:00
|
|
|
|
2016-07-18 16:36:28 +01:00
|
|
|
SE = st.GetEntry(ptype, dir, sF);
|
2017-04-22 11:33:50 +01:00
|
|
|
GENERIC_DHOPDIR_LEG(Xp,spProjXp,spReconXp);
|
|
|
|
GENERIC_DHOPDIR_LEG(Yp,spProjYp,spReconYp);
|
|
|
|
GENERIC_DHOPDIR_LEG(Zp,spProjZp,spReconZp);
|
|
|
|
GENERIC_DHOPDIR_LEG(Tp,spProjTp,spReconTp);
|
|
|
|
GENERIC_DHOPDIR_LEG(Xm,spProjXm,spReconXm);
|
|
|
|
GENERIC_DHOPDIR_LEG(Ym,spProjYm,spReconYm);
|
|
|
|
GENERIC_DHOPDIR_LEG(Zm,spProjZm,spReconZm);
|
|
|
|
GENERIC_DHOPDIR_LEG(Tm,spProjTm,spReconTm);
|
2016-07-18 16:36:28 +01:00
|
|
|
vstream(out._odata[sF], result);
|
2015-05-26 19:55:18 +01:00
|
|
|
}
|
2015-06-08 12:04:59 +01:00
|
|
|
|
2017-04-25 18:00:24 +01:00
|
|
|
/*******************************************************************************
|
|
|
|
* Conserved current utilities for Wilson fermions, for contracting propagators
|
|
|
|
* to make a conserved current sink or inserting the conserved current
|
|
|
|
* sequentially. Common to both 4D and 5D.
|
|
|
|
******************************************************************************/
|
2017-06-05 11:55:41 +01:00
|
|
|
// 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))
|
2017-04-25 18:00:24 +01:00
|
|
|
|
2017-06-12 10:41:02 +01:00
|
|
|
/*******************************************************************************
|
|
|
|
* Name: ContractConservedCurrentSiteFwd
|
|
|
|
* Operation: (1/2) * q2[x] * U(x) * (g[mu] - 1) * q1[x + mu]
|
|
|
|
* Notes: - DoubledGaugeField U assumed to contain -1/2 factor.
|
|
|
|
* - Pass in q_in_1 shifted in +ve mu direction.
|
|
|
|
******************************************************************************/
|
2017-04-25 18:00:24 +01:00
|
|
|
template<class Impl>
|
2017-06-12 10:41:02 +01:00
|
|
|
void WilsonKernels<Impl>::ContractConservedCurrentSiteFwd(
|
2017-06-16 16:38:59 +01:00
|
|
|
const SitePropagator &q_in_1,
|
|
|
|
const SitePropagator &q_in_2,
|
|
|
|
SitePropagator &q_out,
|
2017-06-12 10:41:02 +01:00
|
|
|
DoubledGaugeField &U,
|
|
|
|
unsigned int sU,
|
2017-06-16 16:38:59 +01:00
|
|
|
unsigned int mu,
|
2017-06-12 10:41:02 +01:00
|
|
|
bool switch_sign)
|
2017-04-25 18:00:24 +01:00
|
|
|
{
|
2017-06-12 10:41:02 +01:00
|
|
|
SitePropagator result, tmp;
|
2017-04-25 18:00:24 +01:00
|
|
|
Gamma g5(Gamma::Algebra::Gamma5);
|
2017-06-16 16:38:59 +01:00
|
|
|
Impl::multLinkProp(tmp, U._odata[sU], q_in_1, mu);
|
|
|
|
result = g5 * adj(q_in_2) * g5 * WilsonCurrentFwd(tmp, mu);
|
2017-06-12 10:41:02 +01:00
|
|
|
if (switch_sign)
|
|
|
|
{
|
2017-06-16 16:38:59 +01:00
|
|
|
q_out -= result;
|
2017-06-12 10:41:02 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2017-06-16 16:38:59 +01:00
|
|
|
q_out += result;
|
2017-06-12 10:41:02 +01:00
|
|
|
}
|
|
|
|
}
|
2017-04-25 18:00:24 +01:00
|
|
|
|
2017-06-12 10:41:02 +01:00
|
|
|
/*******************************************************************************
|
|
|
|
* Name: ContractConservedCurrentSiteBwd
|
|
|
|
* Operation: (1/2) * q2[x + mu] * U^dag(x) * (g[mu] + 1) * q1[x]
|
|
|
|
* Notes: - DoubledGaugeField U assumed to contain -1/2 factor.
|
|
|
|
* - Pass in q_in_2 shifted in +ve mu direction.
|
|
|
|
******************************************************************************/
|
|
|
|
template<class Impl>
|
|
|
|
void WilsonKernels<Impl>::ContractConservedCurrentSiteBwd(
|
2017-06-16 16:38:59 +01:00
|
|
|
const SitePropagator &q_in_1,
|
|
|
|
const SitePropagator &q_in_2,
|
|
|
|
SitePropagator &q_out,
|
2017-06-12 10:41:02 +01:00
|
|
|
DoubledGaugeField &U,
|
|
|
|
unsigned int sU,
|
2017-06-16 16:38:59 +01:00
|
|
|
unsigned int mu,
|
2017-06-12 10:41:02 +01:00
|
|
|
bool switch_sign)
|
|
|
|
{
|
|
|
|
SitePropagator result, tmp;
|
|
|
|
Gamma g5(Gamma::Algebra::Gamma5);
|
2017-06-16 16:38:59 +01:00
|
|
|
Impl::multLinkProp(tmp, U._odata[sU], q_in_1, mu + Nd);
|
|
|
|
result = g5 * adj(q_in_2) * g5 * WilsonCurrentBwd(tmp, mu);
|
2017-06-12 10:41:02 +01:00
|
|
|
if (switch_sign)
|
|
|
|
{
|
2017-06-16 16:38:59 +01:00
|
|
|
q_out += result;
|
2017-06-12 10:41:02 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2017-06-16 16:38:59 +01:00
|
|
|
q_out -= result;
|
2017-06-12 10:41:02 +01:00
|
|
|
}
|
|
|
|
}
|
2017-04-25 18:00:24 +01:00
|
|
|
|
2017-06-12 10:41:02 +01:00
|
|
|
// G-parity requires more specialised implementation.
|
|
|
|
#define NO_CURR_SITE(Impl) \
|
|
|
|
template <> \
|
|
|
|
void WilsonKernels<Impl>::ContractConservedCurrentSiteFwd( \
|
2017-06-16 16:38:59 +01:00
|
|
|
const SitePropagator &q_in_1, \
|
|
|
|
const SitePropagator &q_in_2, \
|
|
|
|
SitePropagator &q_out, \
|
|
|
|
DoubledGaugeField &U, \
|
|
|
|
unsigned int sU, \
|
|
|
|
unsigned int mu, \
|
|
|
|
bool switch_sign) \
|
2017-06-12 10:41:02 +01:00
|
|
|
{ \
|
|
|
|
assert(0); \
|
|
|
|
} \
|
|
|
|
template <> \
|
|
|
|
void WilsonKernels<Impl>::ContractConservedCurrentSiteBwd( \
|
2017-06-16 16:38:59 +01:00
|
|
|
const SitePropagator &q_in_1, \
|
|
|
|
const SitePropagator &q_in_2, \
|
|
|
|
SitePropagator &q_out, \
|
|
|
|
DoubledGaugeField &U, \
|
|
|
|
unsigned int mu, \
|
|
|
|
unsigned int sU, \
|
|
|
|
bool switch_sign) \
|
2017-06-12 10:41:02 +01:00
|
|
|
{ \
|
|
|
|
assert(0); \
|
2017-04-25 18:00:24 +01:00
|
|
|
}
|
|
|
|
|
2017-06-12 10:41:02 +01:00
|
|
|
NO_CURR_SITE(GparityWilsonImplF);
|
|
|
|
NO_CURR_SITE(GparityWilsonImplD);
|
|
|
|
NO_CURR_SITE(GparityWilsonImplFH);
|
|
|
|
NO_CURR_SITE(GparityWilsonImplDF);
|
|
|
|
|
2017-04-25 18:00:24 +01:00
|
|
|
|
2017-06-16 16:43:15 +01:00
|
|
|
/*******************************************************************************
|
|
|
|
* Name: SeqConservedCurrentSiteFwd
|
|
|
|
* Operation: (1/2) * U(x) * (g[mu] - 1) * q[x + mu]
|
|
|
|
* Notes: - DoubledGaugeField U assumed to contain -1/2 factor.
|
|
|
|
* - Pass in q_in shifted in +ve mu direction.
|
|
|
|
******************************************************************************/
|
|
|
|
template<class Impl>
|
|
|
|
void WilsonKernels<Impl>::SeqConservedCurrentSiteFwd(const SitePropagator &q_in,
|
|
|
|
SitePropagator &q_out,
|
|
|
|
DoubledGaugeField &U,
|
|
|
|
unsigned int sU,
|
|
|
|
unsigned int mu,
|
|
|
|
vInteger t_mask,
|
|
|
|
bool switch_sign)
|
2017-04-25 18:00:24 +01:00
|
|
|
{
|
2017-06-16 16:43:15 +01:00
|
|
|
SitePropagator result;
|
|
|
|
Impl::multLinkProp(result, U._odata[sU], q_in, mu);
|
|
|
|
result = WilsonCurrentFwd(result, mu);
|
2017-04-25 18:00:24 +01:00
|
|
|
|
2017-06-16 16:43:15 +01:00
|
|
|
// Zero any unwanted timeslice entries.
|
|
|
|
result = predicatedWhere(t_mask, result, 0.*result);
|
2017-04-25 18:00:24 +01:00
|
|
|
|
2017-06-16 16:43:15 +01:00
|
|
|
if (switch_sign)
|
|
|
|
{
|
|
|
|
q_out -= result;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
q_out += result;
|
|
|
|
}
|
2017-04-25 18:00:24 +01:00
|
|
|
}
|
|
|
|
|
2017-06-16 16:43:15 +01:00
|
|
|
/*******************************************************************************
|
|
|
|
* Name: SeqConservedCurrentSiteFwd
|
|
|
|
* Operation: (1/2) * U^dag(x) * (g[mu] + 1) * q[x - mu]
|
|
|
|
* Notes: - DoubledGaugeField U assumed to contain -1/2 factor.
|
|
|
|
* - Pass in q_in shifted in -ve mu direction.
|
|
|
|
******************************************************************************/
|
|
|
|
template<class Impl>
|
|
|
|
void WilsonKernels<Impl>::SeqConservedCurrentSiteBwd(const SitePropagator &q_in,
|
|
|
|
SitePropagator &q_out,
|
|
|
|
DoubledGaugeField &U,
|
|
|
|
unsigned int sU,
|
|
|
|
unsigned int mu,
|
|
|
|
vInteger t_mask,
|
|
|
|
bool switch_sign)
|
|
|
|
{
|
|
|
|
SitePropagator result;
|
|
|
|
Impl::multLinkProp(result, U._odata[sU], q_in, mu + Nd);
|
|
|
|
result = WilsonCurrentBwd(result, mu);
|
|
|
|
|
|
|
|
// Zero any unwanted timeslice entries.
|
|
|
|
result = predicatedWhere(t_mask, result, 0.*result);
|
|
|
|
|
|
|
|
if (switch_sign)
|
|
|
|
{
|
|
|
|
q_out += result;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
q_out -= result;
|
|
|
|
}
|
|
|
|
}
|
2017-04-25 18:00:24 +01:00
|
|
|
|
2016-07-18 16:36:28 +01:00
|
|
|
FermOpTemplateInstantiate(WilsonKernels);
|
|
|
|
AdjointFermOpTemplateInstantiate(WilsonKernels);
|
2016-09-22 14:17:37 +01:00
|
|
|
TwoIndexFermOpTemplateInstantiate(WilsonKernels);
|
2015-12-10 22:55:00 +00:00
|
|
|
|
2018-01-14 23:01:07 +00:00
|
|
|
NAMESPACE_END(Grid);
|
2016-08-30 18:21:36 +01:00
|
|
|
|