68 const std::vector<Field_F>& sq2)
72 std::vector<dcomplex> mcorr(Lt);
77 double norm = 0.5 / Lvol * Lt;
89 for (
int t = 0; t < mcorr.size(); ++t) {
91 t, -norm * real(mcorr[t]), -norm * imag(mcorr[t]));
104 for (
int t = 0; t < mcorr.size(); ++t) {
106 t, norm * real(mcorr[t]), norm * imag(mcorr[t]));
117 for (
int t = 0; t < mcorr.size(); ++t) {
119 t, norm * real(mcorr[Lt - 1 - t]), norm * imag(mcorr[Lt - 1 - t]));
132 for (
int t = 0; t < mcorr.size(); ++t) {
134 t, norm * real(mcorr[Lt - 1 - t]), norm * imag(mcorr[Lt - 1 - t]));
140 double result = real(mcorr[1]);
150 const std::vector<Field_F>& sq1,
151 const std::vector<Field_F>& sq2)
162 assert(meson.size() == Lt);
166 gm_src = qn_src.
mult(gm5);
167 gm_sink = gm5.
mult(qn_sink);
170 valarray<dcomplex> corr_local(Nt);
171 valarray<double> corr_r(Nd), corr_i(Nd);
174 Field corrF(2, Nvol, 2);
176 corr_local = dcomplex(0.0);
178 for (
int c0 = 0; c0 < Nc; ++c0) {
179 for (
int d0 = 0; d0 < Nd; ++d0) {
180 int d1 = gm_src.index(d0);
183 for (
int t = 0; t < Nt; ++t) {
186 for (
int z = 0; z < Nz; ++z) {
187 for (
int y = 0; y < Ny; ++y) {
188 for (
int x = 0; x < Nx; ++x) {
189 int site = index.
site(x, y, z, t);
191 for (
int s0 = 0; s0 < Nd; ++s0) {
192 int s1 = gm_sink.index(s0);
195 for (
int c1 = 0; c1 < Nc; ++c1) {
196 corr_r[s0] += sq1[c0 + Nc * d0].cmp_r(c1, s1, site)
197 * sq2[c0 + Nc * d1].cmp_r(c1, s0, site)
198 + sq1[c0 + Nc * d0].cmp_i(c1, s1, site)
199 * sq2[c0 + Nc * d1].cmp_i(c1, s0, site);
201 corr_i[s0] += sq1[c0 + Nc * d0].cmp_r(c1, s1, site)
202 * sq2[c0 + Nc * d1].cmp_i(c1, s0, site)
203 - sq1[c0 + Nc * d0].cmp_i(c1, s1, site)
204 * sq2[c0 + Nc * d1].cmp_r(c1, s0, site);
210 for (
int s0 = 0; s0 < Nd; ++s0) {
211 dcomplex gmf = gm_src.value(d0) * gm_sink.value(s0);
213 dcomplex corr = cmplx(corr_r[s0], corr_i[s0]);
214 corr_local[t] += gmf * corr;
222 std::vector<dcomplex> corr_tmp(Lt);
225 for (
int t = 0; t < Lt; ++t) {
226 corr_tmp[t] = cmplx(0.0, 0.0);
228 for (
int t = 0; t < Nt; ++t) {
229 int t2 = t + ipet * Nt;
231 corr_tmp[t2] = corr_local[t];
233 for (
int t = 0; t < Lt; ++t) {
234 double crr = real(corr_tmp[t]);
235 double cri = imag(corr_tmp[t]);
238 meson[t] = cmplx(crr, cri);
245 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...
static const std::string class_name