85 const std::vector<Field_F>& sq2)
92 const double norm = (0.5 / Nvol / NPE) * Lt;
94 std::vector<dcomplex> m_corr(Lt);
104 meson_corr(m_corr, qn_sink, qn_src, sq1, sq1);
106 for (
int t = 0; t < m_corr.size(); ++t) {
108 t, -norm * real(m_corr[t]), -norm * imag(m_corr[t]));
119 meson_corr(m_corr, qn_sink, qn_src, sq1, sq1);
121 for (
int t = 0; t < m_corr.size(); ++t) {
123 t, norm * real(m_corr[t]), norm * imag(m_corr[t]));
132 meson_corr(m_corr, qn_sink, qn_src, sq2, sq2);
134 for (
int t = 0; t < m_corr.size(); ++t) {
136 t, norm * real(m_corr[Lt - 1 - t]), norm * imag(m_corr[Lt - 1 - t]));
147 meson_corr(m_corr, qn_sink, qn_src, sq2, sq2);
149 for (
int t = 0; t < m_corr.size(); ++t) {
151 t, norm * real(m_corr[Lt - 1 - t]), norm * imag(m_corr[Lt - 1 - t]));
157 const double result = real(m_corr[1]);
167 const std::vector<Field_F>& sq1,
168 const std::vector<Field_F>& sq2)
179 assert(meson.size() == Lt);
187 std::valarray<double> corr_r(Nd), corr_i(Nd);
189 Field corrF(2, Nvol, 2);
191 std::valarray<dcomplex> corr_local(Nt);
192 corr_local = cmplx(0.0, 0.0);
194 for (
int c0 = 0; c0 < Nc; ++c0) {
195 for (
int d0 = 0; d0 < Nd; ++d0) {
196 int d1 = gm_src.
index(d0);
199 for (
int t = 0; t < Nt; ++t) {
202 for (
int z = 0; z < Nz; ++z) {
203 for (
int y = 0; y < Ny; ++y) {
204 for (
int x = 0; x < Nx; ++x) {
205 int site = index.
site(x, y, z, t);
207 for (
int s0 = 0; s0 < Nd; ++s0) {
208 int s1 = gm_sink.
index(s0);
211 for (
int c1 = 0; c1 < Nc; ++c1) {
212 corr_r[s0] += sq1[c0 + Nc * d0].cmp_r(c1, s1, site)
213 * sq2[c0 + Nc * d1].cmp_r(c1, s0, site)
214 + sq1[c0 + Nc * d0].cmp_i(c1, s1, site)
215 * sq2[c0 + Nc * d1].cmp_i(c1, s0, site);
217 corr_i[s0] += sq1[c0 + Nc * d0].cmp_r(c1, s1, site)
218 * sq2[c0 + Nc * d1].cmp_i(c1, s0, site)
219 - sq1[c0 + Nc * d0].cmp_i(c1, s1, site)
220 * sq2[c0 + Nc * d1].cmp_r(c1, s0, site);
226 for (
int s0 = 0; s0 < Nd; ++s0) {
227 dcomplex gmf = gm_src.
value(d0) * gm_sink.
value(s0);
229 dcomplex corr = cmplx(corr_r[s0], corr_i[s0]);
230 corr_local[t] += gmf * corr;
241 std::vector<dcomplex> corr_global(Lt);
242 for (
int t_global = 0; t_global < Lt; ++t_global) {
243 corr_global[t_global] = cmplx(0.0, 0.0);
245 for (
int t = 0; t < Nt; ++t) {
246 int t_global = t + ipe_t * Nt;
247 corr_global[t_global] = corr_local[t];
249 for (
int t_global = 0; t_global < Lt; ++t_global) {
250 double cr_r = real(corr_global[t_global]);
251 double cr_i = imag(corr_global[t_global]);
256 meson[t_global] = cmplx(cr_r, cr_i);
263 const double result = real(meson[1]);