1
0
mirror of https://github.com/paboyle/Grid.git synced 2025-06-18 07:47:06 +01:00

Hadrons: yet other attempts at EMT NPR

This commit is contained in:
2018-05-18 20:49:26 +01:00
parent fd3b2e945a
commit a0d399e5ce
8 changed files with 473 additions and 31 deletions

View File

@ -89,6 +89,28 @@ inline void dmuAcc(Field &out, const Field &in, const unsigned int mu, const Dif
}
}
template <class SinkSite, class SourceSite>
std::vector<Complex> makeTwoPoint(const std::vector<SinkSite> &sink,
const std::vector<SourceSite> &source,
const double factor = 1.)
{
assert(sink.size() == source.size());
unsigned int nt = sink.size();
std::vector<Complex> res(nt, 0.);
for (unsigned int dt = 0; dt < nt; ++dt)
{
for (unsigned int t = 0; t < nt; ++t)
{
res[dt] += trace(sink[(t+dt)%nt]*source[t]);
}
res[dt] *= factor/static_cast<double>(nt);
}
return res;
}
inline std::string varName(const std::string name, const std::string suf)
{
return name + "_" + suf;