28 const string str_vlevel = params.
get_string(
"verbose_level");
44 const std::vector<Field_F>& sq2)
49 std::ofstream log_file;
56 std::vector<dcomplex> corr(Lt);
62 for (
int t = 0; t < corr.size(); ++t) {
64 t, real(corr[t]), imag(corr[t]));
66 const double result = real(corr[0]);
72 for (
int t = 0; t < corr.size(); ++t) {
74 t, real(corr[t]), imag(corr[t]));
81 for (
int t = 0; t < corr.size(); ++t) {
83 t, real(corr[t]), imag(corr[t]));
90 for (
int t = 0; t < corr.size(); ++t) {
92 t, real(corr[t]), imag(corr[t]));
99 for (
int t = 0; t < corr.size(); ++t) {
101 t, real(corr[t]), imag(corr[t]));
108 for (
int t = 0; t < corr.size(); ++t) {
110 t, real(corr[t]), imag(corr[t]));
117 for (
int t = 0; t < corr.size(); ++t) {
119 t, real(corr[t]), imag(corr[t]));
126 for (
int t = 0; t < corr.size(); ++t) {
128 t, real(corr[t]), imag(corr[t]));
135 for (
int t = 0; t < corr.size(); ++t) {
137 t, real(corr[t]), imag(corr[t]));
144 for (
int t = 0; t < corr.size(); ++t) {
146 t, real(corr[t]), imag(corr[t]));
153 for (
int t = 0; t < corr.size(); ++t) {
155 t, real(corr[t]), imag(corr[t]));
162 for (
int t = 0; t < corr.size(); ++t) {
164 t, real(corr[t]), imag(corr[t]));
171 for (
int t = 0; t < corr.size(); ++t) {
173 t, real(corr[t]), imag(corr[t]));
190 const std::vector<Field_F>& sq1,
191 const std::vector<Field_F>& sq2)
198 assert(corr_global.size() == Lt);
204 std::vector<dcomplex> corr_local(Nt, cmplx(0.0, 0.0));
205 for (
int c0 = 0; c0 < Nc; ++c0) {
206 for (
int d0 = 0; d0 < Nd; ++d0) {
207 int d1 = gm_gm5_src.
index(d0);
209 for (
int t = 0; t < Nt; ++t) {
213 sq1[c0 + Nc * d0], sq2[c0 + Nc * d1], t);
215 corr_local[t] += gm_gm5_src.
value(d0) * corr_t;
225 const std::vector<Field_F>& sq2,
226 const std::vector<int>& source_position)
231 const int N_momentum = 10;
233 typedef std::vector<int> MomentumSet;
234 std::vector<MomentumSet> momentum_sink(N_momentum);
235 for (
int i_momentum = 0; i_momentum < N_momentum; i_momentum++) {
236 momentum_sink[i_momentum].resize(Ndim - 1);
241 momentum_sink[i_momentum][0] = 1;
242 momentum_sink[i_momentum][1] = 0;
243 momentum_sink[i_momentum][2] = 0;
247 momentum_sink[i_momentum][0] = 0;
248 momentum_sink[i_momentum][1] = 1;
249 momentum_sink[i_momentum][2] = 0;
253 momentum_sink[i_momentum][0] = 0;
254 momentum_sink[i_momentum][1] = 0;
255 momentum_sink[i_momentum][2] = 1;
259 momentum_sink[i_momentum][0] = 1;
260 momentum_sink[i_momentum][1] = 1;
261 momentum_sink[i_momentum][2] = 0;
265 momentum_sink[i_momentum][0] = 0;
266 momentum_sink[i_momentum][1] = 1;
267 momentum_sink[i_momentum][2] = 1;
271 momentum_sink[i_momentum][0] = 1;
272 momentum_sink[i_momentum][1] = 0;
273 momentum_sink[i_momentum][2] = 1;
277 momentum_sink[i_momentum][0] = 1;
278 momentum_sink[i_momentum][1] = 1;
279 momentum_sink[i_momentum][2] = 1;
283 momentum_sink[i_momentum][0] = 2;
284 momentum_sink[i_momentum][1] = 0;
285 momentum_sink[i_momentum][2] = 0;
289 momentum_sink[i_momentum][0] = 0;
290 momentum_sink[i_momentum][1] = 2;
291 momentum_sink[i_momentum][2] = 0;
295 momentum_sink[i_momentum][0] = 0;
296 momentum_sink[i_momentum][1] = 0;
297 momentum_sink[i_momentum][2] = 2;
301 std::ofstream log_file;
308 std::vector<dcomplex> corr(Lt);
312 for (
int i_momentum = 0; i_momentum < N_momentum; i_momentum++) {
314 momentum_sink[i_momentum][0],
315 momentum_sink[i_momentum][1],
316 momentum_sink[i_momentum][2]);
318 sq1, sq2, source_position);
319 for (
int t = 0; t < corr.size(); ++t) {
321 t, real(corr[t]), imag(corr[t]));
327 for (
int i_momentum = 0; i_momentum < N_momentum; i_momentum++) {
329 momentum_sink[i_momentum][0],
330 momentum_sink[i_momentum][1],
331 momentum_sink[i_momentum][2]);
333 sq1, sq2, source_position);
334 for (
int t = 0; t < corr.size(); ++t) {
336 t, real(corr[t]), imag(corr[t]));
342 for (
int i_momentum = 0; i_momentum < N_momentum; i_momentum++) {
344 momentum_sink[i_momentum][0],
345 momentum_sink[i_momentum][1],
346 momentum_sink[i_momentum][2]);
348 sq1, sq2, source_position);
349 for (
int t = 0; t < corr.size(); ++t) {
351 t, real(corr[t]), imag(corr[t]));
357 for (
int i_momentum = 0; i_momentum < N_momentum; i_momentum++) {
359 momentum_sink[i_momentum][0],
360 momentum_sink[i_momentum][1],
361 momentum_sink[i_momentum][2]);
363 sq1, sq2, source_position);
364 for (
int t = 0; t < corr.size(); ++t) {
366 t, real(corr[t]), imag(corr[t]));
382 const std::vector<int>& momentum_sink,
385 const std::vector<Field_F>& sq1,
386 const std::vector<Field_F>& sq2,
387 const std::vector<int>& source_position)
394 assert(corr_global.size() == Lt);
400 std::vector<dcomplex> corr_local(Nt, cmplx(0.0, 0.0));
401 for (
int c0 = 0; c0 < Nc; ++c0) {
402 for (
int d0 = 0; d0 < Nd; ++d0) {
403 int d1 = gm_gm5_src.
index(d0);
405 for (
int t = 0; t < Nt; ++t) {
408 contract_at_t(corr_t, momentum_sink, gm5_gm_sink, source_position,
409 sq1[c0 + Nc * d0], sq2[c0 + Nc * d1], t);
411 corr_local[t] += gm_gm5_src.
value(d0) * corr_t;
421 const std::vector<Field_F>& sq_d)
426 std::ofstream log_file;
439 std::vector<dcomplex> p_corr_unity(Lt);
442 for (
int t = 0; t < p_corr_unity.size(); t++) {
444 t, real(p_corr_unity[t]), imag(p_corr_unity[t]));
449 std::vector<dcomplex> p_corr_gamma0(Lt);
452 std::vector<dcomplex> p_corr_upper(Lt);
453 for (
int t = 0; t < p_corr_upper.size(); t++) {
454 p_corr_upper[t] = (p_corr_unity[t] + p_corr_gamma0[t]) * 0.5;
456 t, real(p_corr_upper[t]), imag(p_corr_upper[t]));
461 for (
int t = 0; t < p_corr_gamma0.size(); t++) {
463 t, real(p_corr_gamma0[t]), imag(p_corr_gamma0[t]));
472 const double result = real(p_corr_gamma0[0]);
481 const std::vector<Field_F>& sq_u,
482 const std::vector<Field_F>& sq_d)
490 assert(corr_global.size() == Lt);
498 for (
int i = 0; i < Nd; i++) {
499 vout.
general(
m_vl,
"%d:\t %d %e %e \t %d %e %e \t %d %e %e \t %d %e %e \n",
501 gm5.index(i), real(gm5.value(i)), imag(gm5.value(i)),
509 const int FactNc = 6;
512 std::vector<dcomplex> corr_local(Nt);
514 for (
int t = 0; t < Nt; t++) {
517 dcomplex sum = cmplx(0.0, 0.0);
518 for (
int i_alpha = 0; i_alpha < Nd; i_alpha++) {
519 int i_alphaP = gm.
index(i_alpha);
520 int i_alpha3 = i_alpha;
521 int i_alpha3P = i_alphaP;
523 for (
int i_alpha1P = 0; i_alpha1P < Nd; i_alpha1P++) {
524 int i_alpha2P = cg5.
index(i_alpha1P);
526 for (
int ic123P = 0; ic123P < FactNc; ic123P++) {
532 dcomplex factor = gm.
value(i_alpha)
533 * cg5.
value(i_alpha1P)
538 sq_u[ic1P + Nc * i_alpha1P],
539 sq_d[ic2P + Nc * i_alpha2P],
540 sq_u[ic3P + Nc * i_alpha3P], t);
544 sq_u[ic3P + Nc * i_alpha3P],
545 sq_d[ic2P + Nc * i_alpha2P],
546 sq_u[ic1P + Nc * i_alpha1P], t);
548 sum += factor * (sum1 - sum2);
565 const std::vector<Field_F>& sq1,
566 const std::vector<Field_F>& sq2)
573 assert(meson.size() == Lx);
577 gm_src = qn_src.
mult(gm5);
578 gm_sink = gm5.
mult(qn_sink);
580 std::vector<dcomplex> corr_local(Nx);
581 for (
int i = 0; i < Nx; ++i) {
585 for (
int c0 = 0; c0 < Nc; ++c0) {
586 for (
int d0 = 0; d0 < Nd; ++d0) {
587 int d1 = gm_src.index(d0);
589 for (
int x = 0; x < Nx; ++x) {
592 sq1[c0 + Nc * d0], sq2[c0 + Nc * d1], x);
594 corr_local[x] += gm_src.value(d0) * corr_x;
605 const std::vector<int>& momentum_sink,
608 const std::vector<Field_F>& sq1,
609 const std::vector<Field_F>& sq2,
610 const std::vector<int>& source_position)
617 assert(corr_global.size() == Lx);
621 gm_gm5_src = gm_src.
mult(gm5);
622 gm5_gm_sink = gm5.
mult(gm_sink);
624 std::vector<dcomplex> corr_local(Nx);
626 for (
int c0 = 0; c0 < Nc; ++c0) {
627 for (
int d0 = 0; d0 < Nd; ++d0) {
628 int d1 = gm_gm5_src.index(d0);
630 for (
int x = 0; x < Nx; ++x) {
633 contract_at_x(corr_x, momentum_sink, gm5_gm_sink, source_position,
634 sq1[c0 + Nc * d0], sq2[c0 + Nc * d1], x);
636 corr_local[x] += gm_gm5_src.value(d0) * corr_x;
648 const std::vector<Field_F>& squ,
649 const std::vector<Field_F>& sqd)
657 assert(proton.size() == Lx);
669 std::vector<dcomplex> corr_local(Nx);
671 for (
int ix = 0; ix < Nx; ix++) {
675 for (
int ialph = 0; ialph < Nd; ialph++) {
676 int ialphP = gm.
index(ialph);
678 int ialph3P = ialphP;
680 for (
int ialph1P = 0; ialph1P < Nd; ialph1P++) {
681 int ialph2P = cg5.
index(ialph1P);
683 for (
int ic123P = 0; ic123P < FactNc; ic123P++) {
684 int ic1P = epsilon_tensor.epsilon_3_index(ic123P, 0);
685 int ic2P = epsilon_tensor.epsilon_3_index(ic123P, 1);
686 int ic3P = epsilon_tensor.epsilon_3_index(ic123P, 2);
687 dcomplex factor = gm.
value(ialph)
689 *
static_cast<double>(epsilon_tensor.epsilon_3_value(ic123P));
692 squ[ic1P + Nc * ialph1P],
693 sqd[ic2P + Nc * ialph2P],
694 squ[ic3P + Nc * ialph3P], ix);
696 squ[ic3P + Nc * ialph3P],
697 sqd[ic2P + Nc * ialph2P],
698 squ[ic1P + Nc * ialph1P], ix);
699 sum += factor * (sum1 - sum2);
704 corr_local[ix] = sum;
double meson_all(const std::vector< Field_F > &sq1, const std::vector< Field_F > &sq2)
void contract_at_t(dcomplex &corr, const GammaMatrix &gm_sink, const Field_F &v1, const Field_F &v2, const int time)
Contraction of hadron for 4-spinor fermion.
void general(const char *format,...)
GammaMatrix get_GM(GMspecies spec)
Bridge::VerboseLevel m_vl
void proton_correlator(std::vector< dcomplex > &corr_global, const GammaMatrix &gm, const std::vector< Field_F > &sq_u, const std::vector< Field_F > &sq_d)
void global_corr_x(std::vector< dcomplex > &corr_global, std::vector< dcomplex > &corr_local)
transform node-local correlator in x to global.
void init(const std::string &filename)
double proton_test(const std::vector< Field_F > &sq_u, const std::vector< Field_F > &sq_d)
void proton_correlator_x(std::vector< dcomplex > &proton, const GammaMatrix &gm, const std::vector< Field_F > &squ, const std::vector< Field_F > &sqd)
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
void meson_correlator(std::vector< dcomplex > &corr_global, const GammaMatrix &gm_sink, const GammaMatrix &gm_src, const std::vector< Field_F > &sq1, const std::vector< Field_F > &sq2)
corr_global=(sq2)_{ab}(0,x) (gm_sink)_{bc} (sq1)_{cd}(x,0) (gm_src)_{da}=(sq2^*)_{ba}(x,0) (gamma_5 gm_sink)_{bc} (sq1)_{cd}(x,0) (gm_src gamma_5)_{da} , where sq1 and sq2 are quark propagators.
void meson_momentum_correlator_x(std::vector< dcomplex > &corr_global, const std::vector< int > &momentum_sink, const GammaMatrix &gm_sink, const GammaMatrix &gm_src, const std::vector< Field_F > &sq1, const std::vector< Field_F > &sq2, const std::vector< int > &source_position)
void paranoiac(const char *format,...)
void meson_correlator_x(std::vector< dcomplex > &meson, const GammaMatrix &gm_sink, const GammaMatrix &gm_src, const std::vector< Field_F > &sq1, const std::vector< Field_F > &sq2)
GammaMatrix mult(GammaMatrix) const
void contract_at_x(dcomplex &corr, const GammaMatrix &gm_sink, const Field_F &v1, const Field_F &v2, int x)
double meson_momentum_all(const std::vector< Field_F > &sq1, const std::vector< Field_F > &sq2, const std::vector< int > &source_position)
std::ostream & getStream()
std::string m_filename_output
dcomplex value(int row) const
virtual void set_parameters(const Parameters ¶ms)
string get_string(const string &key) const
int epsilon_3_index(const int n, const int i) const
int epsilon_3_value(const int n) const
void meson_momentum_correlator(std::vector< dcomplex > &corr_global, const std::vector< int > &momentum_sink, const GammaMatrix &gm_sink, const GammaMatrix &gm_src, const std::vector< Field_F > &sq1, const std::vector< Field_F > &sq2, const std::vector< int > &source_position)
static VerboseLevel set_verbose_level(const std::string &str)