61 const valarray<Field_F>& sq2)
65 valarray<dcomplex> mcorr(Lt);
72 for (
int t = 0; t < mcorr.size(); ++t) {
74 t, real(mcorr[t]), imag(mcorr[t]));
76 double result = real(mcorr[0]);
82 for (
int t = 0; t < mcorr.size(); ++t) {
84 t, real(mcorr[t]), imag(mcorr[t]));
91 for (
int t = 0; t < mcorr.size(); ++t) {
93 t, real(mcorr[t]), imag(mcorr[t]));
100 for (
int t = 0; t < mcorr.size(); ++t) {
102 t, real(mcorr[t]), imag(mcorr[t]));
113 const valarray<Field_F>& sq1,
114 const valarray<Field_F>& sq2)
121 assert(meson.size() == Lt);
125 gm_src = qn_src.
mult(gm5);
126 gm_sink = gm5.
mult(qn_sink);
129 valarray<dcomplex> corr_local(Nt);
130 valarray<double> corr_r(Nd), corr_i(Nd);
131 valarray<int> s2(Nd);
133 for (
int c0 = 0; c0 < Nc; ++c0) {
134 for (
int d0 = 0; d0 < Nd; ++d0) {
135 int d1 = gm_src.index(d0);
138 for (
int t = 0; t < Nt; ++t) {
140 sq1[c0 + Nc * d0], sq2[c0 + Nc * d1], t);
142 dcomplex corr = cmplx(real(corr_t), imag(corr_t));
143 corr_local[t] += gm_src.value(d0) * corr;
154 const valarray<Field_F>& sqd)
158 valarray<dcomplex> p_corr_unity(Lt), p_corr_gamm0(Lt), p_corr_upper(Lt);
173 for (
int it = 0; it < p_corr_unity.size(); it++) {
175 it, real(p_corr_unity[it]), imag(p_corr_unity[it]));
182 for (
int it = 0; it < p_corr_upper.size(); it++) {
183 p_corr_upper[it] = (p_corr_unity[it] + p_corr_gamm0[it]) * 0.5;
185 it, real(p_corr_upper[it]), imag(p_corr_upper[it]));
191 for (
int it = 0; it < p_corr_gamm0.size(); it++) {
193 it, real(p_corr_gamm0[it]), imag(p_corr_gamm0[it]));
197 double result = real(p_corr_gamm0[0]);
206 const valarray<Field_F>& squ,
207 const valarray<Field_F>& sqd)
215 assert(proton.size() == Lt);
224 for (
int i = 0; i < Nd; i++) {
225 vout.
general(
m_vl,
"%d:\t %d %e %e \t %d %e %e \t %d %e %e \t %d %e %e \n",
227 gm5.index(i), real(gm5.value(i)), imag(gm5.value(i)),
228 c.index(i), real(c.value(i)), imag(c.value(i)),
229 cg5.index(i), real(cg5.value(i)), imag(cg5.value(i)),
238 valarray<dcomplex> corr_local(Nt);
239 corr_local = cmplx(0.0, 0.0);
241 for (
int it = 0; it < Nt; it++) {
242 #if ((DEBUG & 65535) & 0)
249 for (
int ialph = 0; ialph < Nd; ialph++) {
250 int ialphP = gm.
index(ialph);
252 int ialph3P = ialphP;
254 for (
int ialph1P = 0; ialph1P < Nd; ialph1P++) {
255 int ialph2P = cg5.index(ialph1P);
257 for (
int ic123P = 0; ic123P < FactNc; ic123P++) {
261 dcomplex factor = gm.
value(ialph)
265 squ[ic1P + Nc * ialph1P],
266 sqd[ic2P + Nc * ialph2P],
267 squ[ic3P + Nc * ialph3P], it);
269 squ[ic3P + Nc * ialph3P],
270 sqd[ic2P + Nc * ialph2P],
271 squ[ic1P + Nc * ialph1P], it);
272 sum += factor * (sum1 - sum2);
277 corr_local[it] = sum;
286 valarray<dcomplex>& corr_local)
291 assert(corr_global.size() == Lt);
292 assert(corr_local.size() == Nt);
294 valarray<dcomplex> corr_tmp(Lt);
298 for (
int t = 0; t < Lt; ++t) {
299 corr_tmp[t] = cmplx(0.0, 0.0);
302 for (
int t = 0; t < Nt; ++t) {
303 int t2 = t + ipet * Nt;
304 corr_tmp[t2] = corr_local[t];
307 for (
int t = 0; t < Lt; ++t) {
308 double crr = real(corr_tmp[t]);
309 double cri = imag(corr_tmp[t]);
312 corr_global[t] = cmplx(crr, cri);
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
std::valarray< int > m_epsilon_index
index of totally antisymmetric tensor
static int ipe(const int dir)
logical coordinate of current proc.
void meson_corr(std::valarray< dcomplex > &meson, const GammaMatrix &gm_sink, const GammaMatrix &gm_src, const std::valarray< Field_F > &sq1, const std::valarray< Field_F > &sq2)
static const std::string class_name
double proton_test(const std::valarray< Field_F > &squ, const std::valarray< Field_F > &sqd)
GammaMatrix mult(GammaMatrix) const
void global_corr_t(std::valarray< dcomplex > &corr_global, std::valarray< dcomplex > &corr_local)
transform node-local correlator in t to global.
double epsilon_value(int n)
totally antisymmetric tensor: value.
double meson_all(const std::valarray< Field_F > &sq1, const std::valarray< Field_F > &sq2)
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
void proton_corr(std::valarray< dcomplex > &proton, const GammaMatrix &gm, const std::valarray< Field_F > &squ, const std::valarray< Field_F > &sqd)