57 const std::vector<Field_F>& sq2)
61 std::vector<dcomplex> mcorr(Lt);
68 for (
int t = 0; t < mcorr.size(); ++t) {
70 t, real(mcorr[t]), imag(mcorr[t]));
72 double result = real(mcorr[0]);
78 for (
int t = 0; t < mcorr.size(); ++t) {
80 t, real(mcorr[t]), imag(mcorr[t]));
87 for (
int t = 0; t < mcorr.size(); ++t) {
89 t, real(mcorr[t]), imag(mcorr[t]));
96 for (
int t = 0; t < mcorr.size(); ++t) {
98 t, real(mcorr[t]), imag(mcorr[t]));
109 const std::vector<Field_F>& sq1,
110 const std::vector<Field_F>& sq2)
117 assert(meson.size() == Lt);
121 gm_src = qn_src.
mult(gm5);
122 gm_sink = gm5.
mult(qn_sink);
125 std::vector<dcomplex> corr_local(Nt);
126 std::vector<double> corr_r(Nd), corr_i(Nd);
127 std::vector<int> s2(Nd);
129 for (
int c0 = 0; c0 < Nc; ++c0) {
130 for (
int d0 = 0; d0 < Nd; ++d0) {
131 int d1 = gm_src.index(d0);
134 for (
int t = 0; t < Nt; ++t) {
136 sq1[c0 + Nc * d0], sq2[c0 + Nc * d1], t);
138 dcomplex corr = cmplx(real(corr_t), imag(corr_t));
139 corr_local[t] += gm_src.value(d0) * corr;
150 const std::vector<Field_F>& sqd)
154 std::vector<dcomplex> p_corr_unity(Lt), p_corr_gamm0(Lt), p_corr_upper(Lt);
169 for (
int it = 0; it < p_corr_unity.size(); it++) {
171 it, real(p_corr_unity[it]), imag(p_corr_unity[it]));
178 for (
int it = 0; it < p_corr_upper.size(); it++) {
179 p_corr_upper[it] = (p_corr_unity[it] + p_corr_gamm0[it]) * 0.5;
181 it, real(p_corr_upper[it]), imag(p_corr_upper[it]));
187 for (
int it = 0; it < p_corr_gamm0.size(); it++) {
189 it, real(p_corr_gamm0[it]), imag(p_corr_gamm0[it]));
193 double result = real(p_corr_gamm0[0]);
202 const std::vector<Field_F>& squ,
203 const std::vector<Field_F>& sqd)
211 assert(proton.size() == Lt);
220 for (
int i = 0; i < Nd; i++) {
221 vout.
general(
m_vl,
"%d:\t %d %e %e \t %d %e %e \t %d %e %e \t %d %e %e \n",
223 gm5.index(i), real(gm5.value(i)), imag(gm5.value(i)),
224 c.index(i), real(c.value(i)), imag(c.value(i)),
225 cg5.index(i), real(cg5.value(i)), imag(cg5.value(i)),
234 std::vector<dcomplex> corr_local(Nt);
237 for (
int it = 0; it < Nt; it++) {
238 #if ((DEBUG & 65535) & 0)
245 for (
int ialph = 0; ialph < Nd; ialph++) {
246 int ialphP = gm.
index(ialph);
248 int ialph3P = ialphP;
250 for (
int ialph1P = 0; ialph1P < Nd; ialph1P++) {
251 int ialph2P = cg5.index(ialph1P);
253 for (
int ic123P = 0; ic123P < FactNc; ic123P++) {
257 dcomplex factor = gm.
value(ialph)
261 squ[ic1P + Nc * ialph1P],
262 sqd[ic2P + Nc * ialph2P],
263 squ[ic3P + Nc * ialph3P], it);
265 squ[ic3P + Nc * ialph3P],
266 sqd[ic2P + Nc * ialph2P],
267 squ[ic1P + Nc * ialph1P], it);
268 sum += factor * (sum1 - sum2);
273 corr_local[it] = sum;
282 std::vector<dcomplex>& corr_local)
287 assert(corr_global.size() == Lt);
288 assert(corr_local.size() == Nt);
290 std::vector<dcomplex> corr_tmp(Lt);
294 for (
int t = 0; t < Lt; ++t) {
295 corr_tmp[t] = cmplx(0.0, 0.0);
298 for (
int t = 0; t < Nt; ++t) {
299 int t2 = t + ipet * Nt;
300 corr_tmp[t2] = corr_local[t];
303 for (
int t = 0; t < Lt; ++t) {
304 double crr = real(corr_tmp[t]);
305 double cri = imag(corr_tmp[t]);
308 corr_global[t] = cmplx(crr, cri);
double meson_all(const std::vector< Field_F > &sq1, const std::vector< Field_F > &sq2)
void 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)
void contract_at_t(dcomplex &corr, const GammaMatrix &gm, const Field_F &f1, const Field_F &f2, int time)
contraction for meson at a given time t.
Bridge::VerboseLevel m_vl
static int ipe(const int dir)
logical coordinate of current proc.
void global_corr_t(std::vector< dcomplex > &corr_global, std::vector< dcomplex > &corr_local)
transform node-local correlator in t to global.
static const std::string class_name
GammaMatrix mult(GammaMatrix) const
double epsilon_value(int n)
totally antisymmetric tensor: value.
double proton_test(const std::vector< Field_F > &squ, const std::vector< Field_F > &sqd)
void proton_corr(std::vector< dcomplex > &proton, const GammaMatrix &gm, const std::vector< Field_F > &squ, const std::vector< Field_F > &sqd)
int epsilon_index(int i, int n)
totally antisymmetric tensor: index.
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
std::vector< int > m_epsilon_index
index of totally antisymmetric tensor