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:
@ -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;
|
||||
|
Reference in New Issue
Block a user