68 const std::vector<Field_F>& sq2)
75 const double norm = (0.5 / Nvol / NPE) * Lt;
77 std::vector<dcomplex> m_corr(Lt);
89 for (
int t = 0; t < m_corr.size(); ++t) {
91 t, -norm * real(m_corr[t]), -norm * imag(m_corr[t]));
102 meson_corr(m_corr, qn_sink, qn_src, sq1, sq1);
104 for (
int t = 0; t < m_corr.size(); ++t) {
106 t, norm * real(m_corr[t]), norm * imag(m_corr[t]));
115 meson_corr(m_corr, qn_sink, qn_src, sq2, sq2);
117 for (
int t = 0; t < m_corr.size(); ++t) {
119 t, norm * real(m_corr[Lt - 1 - t]), norm * imag(m_corr[Lt - 1 - t]));
130 meson_corr(m_corr, qn_sink, qn_src, sq2, sq2);
132 for (
int t = 0; t < m_corr.size(); ++t) {
134 t, norm * real(m_corr[Lt - 1 - t]), norm * imag(m_corr[Lt - 1 - t]));
140 const double result = real(m_corr[1]);
150 const std::vector<Field_F>& sq1,
151 const std::vector<Field_F>& sq2)
162 assert(meson.size() == Lt);
170 std::valarray<double> corr_r(Nd), corr_i(Nd);
172 Field corrF(2, Nvol, 2);
174 std::valarray<dcomplex> corr_local(Nt);
175 corr_local = cmplx(0.0, 0.0);
177 for (
int c0 = 0; c0 < Nc; ++c0) {
178 for (
int d0 = 0; d0 < Nd; ++d0) {
179 int d1 = gm_src.
index(d0);
182 for (
int t = 0; t < Nt; ++t) {
185 for (
int z = 0; z < Nz; ++z) {
186 for (
int y = 0; y < Ny; ++y) {
187 for (
int x = 0; x < Nx; ++x) {
188 int site = index.
site(x, y, z, t);
190 for (
int s0 = 0; s0 < Nd; ++s0) {
191 int s1 = gm_sink.
index(s0);
194 for (
int c1 = 0; c1 < Nc; ++c1) {
195 corr_r[s0] += sq1[c0 + Nc * d0].cmp_r(c1, s1, site)
196 * sq2[c0 + Nc * d1].cmp_r(c1, s0, site)
197 + sq1[c0 + Nc * d0].cmp_i(c1, s1, site)
198 * sq2[c0 + Nc * d1].cmp_i(c1, s0, site);
200 corr_i[s0] += sq1[c0 + Nc * d0].cmp_r(c1, s1, site)
201 * sq2[c0 + Nc * d1].cmp_i(c1, s0, site)
202 - sq1[c0 + Nc * d0].cmp_i(c1, s1, site)
203 * sq2[c0 + Nc * d1].cmp_r(c1, s0, site);
209 for (
int s0 = 0; s0 < Nd; ++s0) {
210 dcomplex gmf = gm_src.
value(d0) * gm_sink.
value(s0);
212 dcomplex corr = cmplx(corr_r[s0], corr_i[s0]);
213 corr_local[t] += gmf * corr;
224 std::vector<dcomplex> corr_global(Lt);
225 for (
int t_global = 0; t_global < Lt; ++t_global) {
226 corr_global[t_global] = cmplx(0.0, 0.0);
228 for (
int t = 0; t < Nt; ++t) {
229 int t_global = t + ipe_t * Nt;
230 corr_global[t_global] = corr_local[t];
232 for (
int t_global = 0; t_global < Lt; ++t_global) {
233 double cr_r = real(corr_global[t_global]);
234 double cr_i = imag(corr_global[t_global]);
239 meson[t_global] = cmplx(cr_r, cr_i);
246 const double result = real(meson[1]);
Bridge::VerboseLevel m_vl
int site(const int &x, const int &y, const int &z, const int &t) const
double meson_corr(std::vector< dcomplex > &meson, const GammaMatrix &gm_sink, const GammaMatrix &gm_src, const std::vector< Field_F > &sq1, const std::vector< Field_F > &sq2)
void general(const char *format,...)
GammaMatrix get_GM(GMspecies spec)
Container of Field-type object.
static int ipe(const int dir)
logical coordinate of current proc.
double fAfP(const std::vector< Field_F > &sq1, const std::vector< Field_F > &sq2)
GammaMatrix mult(GammaMatrix) const
static int reduce_sum(int count, double *recv_buf, double *send_buf, int pattern=0)
make a global sum of an array of double over the communicator. pattern specifies the dimensions to be...
dcomplex value(int row) const
static const std::string class_name