1
0
mirror of https://github.com/paboyle/Grid.git synced 2025-07-13 03:27:07 +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

@ -79,12 +79,6 @@ public:
virtual void setup(void);
// execution
virtual void execute(void);
private:
// make 2-pt function
template <class SinkSite, class SourceSite>
std::vector<Complex> makeTwoPoint(const std::vector<SinkSite> &sink,
const std::vector<SourceSite> &source,
const double factor = 1.);
private:
std::vector<std::vector<int>> mom_;
};
@ -221,31 +215,6 @@ void TTwoPoint<SImpl>::execute(void)
saveResult(par().output, "twopt", result);
}
// make 2-pt function //////////////////////////////////////////////////////////
template <class SImpl>
template <class SinkSite, class SourceSite>
std::vector<Complex> TTwoPoint<SImpl>::makeTwoPoint(
const std::vector<SinkSite> &sink,
const std::vector<SourceSite> &source,
const double factor)
{
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] += sink[(t+dt)%nt]*adj(source[t]);
}
res[dt] *= factor/static_cast<double>(nt);
}
return res;
}
END_MODULE_NAMESPACE
END_HADRONS_NAMESPACE