00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef INCLUDED_ALG_NUC3PT_H
00015 #define INCLUDED_ALG_NUC3PT_H
00016
00017 #include <util/lattice.h>
00018 #include <alg/alg_base.h>
00019
00020 #include <alg/qpropw.h>
00021
00022 #include <alg/corrfunc.h>
00023 #include <util/momentum.h>
00024 #include <alg/nuc3pt_arg.h>
00025 #include <alg/nuc2pt.h>
00026 #include <alg/nuc3pt.h>
00027 #include <alg/nuc3pt_gammar.h>
00028
00029 #if TARGET == QCDOC
00030 #include <comms/sysfunc_cps.h>
00031 #endif
00032
00033
00034 CPS_START_NAMESPACE
00035
00036
00037 enum DIR {
00038 X = 0,
00039 Y = 1,
00040 Z = 2,
00041 T = 3,
00042 G5 = -5
00043 } ;
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057 class AlgNuc3pt : public Alg
00058 {
00059 private:
00060 char* cname;
00061
00062 Nuc3ptArg* Nuc3pt_arg ;
00063
00064
00065
00066 QPropW* q_prop ;
00067 QPropWSeqBar* u_s_prop ;
00068 QPropWSeqBar* d_s_prop ;
00069
00070 FILE *fp ;
00071
00072 void GetThePropagator(int,Float) ;
00073 void GetTheSeqPropagator(int, Float, SourceType, int*, ProjectType) ;
00074
00075
00076
00077
00078 void OpenFile();
00079 void CloseFile()
00080 {
00081 if(fp != NULL)
00082 Fclose(fp);
00083 }
00084
00085
00092 void calc_Scalar()
00093 {
00094 Gamma S;
00095 Nuc3ptGamma Scal(S) ;
00096 Scal.Calc3pt(*u_s_prop,*q_prop);
00097 Scal.Calc3pt(*d_s_prop,*q_prop);
00098 OpenFile();
00099 Scal.Print(fp) ;
00100 CloseFile();
00101 }
00102
00103
00104
00105 #ifdef _NEDM
00106
00108 void calc_NEDM(){
00109 Gamma Gt(T);
00110 Nuc3ptGammaR NEDM(Gt,Z) ;
00111 NEDM.Calc3pt(*u_s_prop,*q_prop);
00112 NEDM.Calc3pt(*d_s_prop,*q_prop);
00113 OpenFile();
00114 NEDM.Print(fp) ;
00115 CloseFile();
00116 }
00117
00119 void calc_NMM(){
00120 Gamma Gx(X);
00121 Nuc3ptGammaR NMM(Gx,Y) ;
00122 NMM.Calc3pt(*u_s_prop,*q_prop);
00123 NMM.Calc3pt(*d_s_prop,*q_prop);
00124 OpenFile();
00125 NMM.Print(fp) ;
00126 CloseFile();
00127 }
00128
00129 #endif
00130
00139 void calc_Vector(const ThreeMom& q) ;
00140
00149 void calc_Axial(const ThreeMom& q) ;
00150
00151
00160 void calc_PScalar(const ThreeMom& q) ;
00161
00175 void calc_EnergyMomentum(const ThreeMom& mom) ;
00176
00177
00184 void calc_Vector()
00185 {
00186 Gamma Gt(T);
00187 Nuc3ptGamma VectCurr(Gt) ;
00188 VectCurr.Calc3pt(*u_s_prop,*q_prop);
00189 VectCurr.Calc3pt(*d_s_prop,*q_prop);
00190 OpenFile();
00191 VectCurr.Print(fp) ;
00192 CloseFile();
00193 }
00194
00211 void calc_X_q_a()
00212 {
00213 Gamma Gx(X);
00214 Gamma Gt(T);
00215 Derivative Der_t(T);
00216 Derivative Der_x(T);
00217
00218 Nuc3ptStru Xq_xt(Gx, Der_t);
00219 Xq_xt.Calc3pt(*u_s_prop, *q_prop);
00220 Xq_xt.Calc3pt(*d_s_prop, *q_prop);
00221
00222 Nuc3ptStru Xq_tx(Gt,Der_x);
00223 Xq_tx.Calc3pt(*u_s_prop, *q_prop);
00224 Xq_tx.Calc3pt(*d_s_prop, *q_prop);
00225
00226 Xq_xt += Xq_tx ;
00227
00228 OpenFile();
00229 Fprintf(fp,"The next is: 14 + 41\n");
00230 Xq_xt.Print(fp) ;
00231 CloseFile();
00232 }
00233
00251 void calc_X_q_b()
00252 {
00253 Gamma Gt(T) ;
00254 Derivative Der_t(T) ;
00255 Nuc3ptStru Xq_tt(Gt,Der_t) ;
00256 Xq_tt.Calc3pt(*u_s_prop,*q_prop);
00257 Xq_tt.Calc3pt(*d_s_prop,*q_prop);
00258
00259 for(int k(X);k<T;k++)
00260 {
00261 Gamma Gk(k) ;
00262 Derivative Der_k(k) ;
00263 Nuc3ptStru tmp(Complex(-1.0/3.0,0.0), Gk, Der_k) ;
00264 tmp.Calc3pt(*u_s_prop,*q_prop);
00265 tmp.Calc3pt(*d_s_prop,*q_prop);
00266 Xq_tt+=tmp ;
00267 }
00268 OpenFile();
00269 Fprintf(fp,"The next is: 44 - 1/3 (11 + 22 + 33)\n");
00270 Xq_tt.Print(fp) ;
00271 CloseFile();
00272 }
00273
00293 void calc_X2_q()
00294 {
00295 Gamma Gt(T);
00296 Derivative D_xx(X,X);
00297 Nuc3ptStru X2q_txx(Gt,D_xx) ;
00298 X2q_txx.Calc3pt(*u_s_prop,*q_prop);
00299 X2q_txx.Calc3pt(*d_s_prop,*q_prop);
00300
00301 for(int k(Y);k<T;k++)
00302 {
00303 Derivative D_kk(k,k);
00304 Nuc3ptStru tmp(Complex(-0.5,0.0),Gt,D_kk) ;
00305 tmp.Calc3pt(*u_s_prop,*q_prop);
00306 tmp.Calc3pt(*d_s_prop,*q_prop);
00307 X2q_txx+=tmp ;
00308 }
00309 OpenFile();
00310 Fprintf(fp,"The next is: 411 - 1/2(422+433)\n");
00311 X2q_txx.Print(fp) ;
00312 CloseFile();
00313 }
00314
00343 void calc_X3_q()
00344 {
00345 Gamma Gx(X);
00346 Gamma Gy(Y);
00347
00348 Derivative D_xtt(X,T,T);
00349 Nuc3ptStru X3q_xxtt(Gx,D_xtt) ;
00350 X3q_xxtt.Calc3pt(*u_s_prop,*q_prop);
00351 X3q_xxtt.Calc3pt(*d_s_prop,*q_prop);
00352
00353 {
00354 Derivative D_yzz(Y,Z,Z) ;
00355 Nuc3ptStru tmp(Gy,D_yzz) ;
00356 tmp.Calc3pt(*u_s_prop,*q_prop);
00357 tmp.Calc3pt(*d_s_prop,*q_prop);
00358 X3q_xxtt += tmp ;
00359 }
00360
00361 {
00362 Derivative D_xzz(X,Z,Z) ;
00363 Nuc3ptStru tmp(Complex(-1.0,0.0),Gx,D_xzz) ;
00364 tmp.Calc3pt(*u_s_prop,*q_prop);
00365 tmp.Calc3pt(*d_s_prop,*q_prop);
00366 X3q_xxtt += tmp ;
00367 }
00368
00369 {
00370 Derivative D_ytt(Y,T,T) ;
00371 Nuc3ptStru tmp(Complex(-1.0,0.0),Gy, D_ytt) ;
00372 tmp.Calc3pt(*u_s_prop,*q_prop);
00373 tmp.Calc3pt(*d_s_prop,*q_prop);
00374 X3q_xxtt += tmp ;
00375 }
00376
00377
00378 OpenFile();
00379 Fprintf(fp,"The next is: 1144 + 2233 - 1133 - 2244\n");
00380 X3q_xxtt.Print(fp) ;
00381 CloseFile();
00382 }
00383
00384
00385
00393 void calc_Axial()
00394 {
00395 Gamma G5z(G5,Z);
00396 Nuc3ptGamma AxialCurr(Complex(0.0,1.0),G5z) ;
00397 AxialCurr.Calc3pt(*u_s_prop,*q_prop);
00398 AxialCurr.Calc3pt(*d_s_prop,*q_prop);
00399
00400 OpenFile();
00401 AxialCurr.Print(fp) ;
00402 CloseFile();
00403 }
00404
00405
00424 void calc_X_Dq_a()
00425 {
00426 Nuc3ptStru XDq_xz(Complex(0.0,1.0),Gamma(G5,X),Derivative(Z)) ;
00427 XDq_xz.Calc3pt(*u_s_prop,*q_prop);
00428 XDq_xz.Calc3pt(*d_s_prop,*q_prop);
00429
00430 Nuc3ptStru XDq_zx(Complex(0.0,1.0),Gamma(G5,Z),Derivative(X)) ;
00431 XDq_zx.Calc3pt(*u_s_prop,*q_prop);
00432 XDq_zx.Calc3pt(*d_s_prop,*q_prop);
00433
00434 XDq_xz+=XDq_xz ;
00435
00436 OpenFile();
00437 Fprintf(fp,"The next is: 13 + 31\n");
00438 XDq_zx.Print(fp);
00439 CloseFile();
00440 }
00441
00460 void calc_X_Dq_b()
00461 {
00462 Nuc3ptStru XDq_zt(Complex(0.0,1.0),Gamma(G5,Z),Derivative(T)) ;
00463 XDq_zt.Calc3pt(*u_s_prop,*q_prop);
00464 XDq_zt.Calc3pt(*d_s_prop,*q_prop);
00465
00466 Nuc3ptStru XDq_tz(Complex(0.0,1.0),Gamma(G5,T),Derivative(Z)) ;
00467 XDq_tz.Calc3pt(*u_s_prop,*q_prop);
00468 XDq_tz.Calc3pt(*d_s_prop,*q_prop);
00469
00470 XDq_zt+=XDq_tz ;
00471
00472 XDq_zt.setTag("p") ;
00473 OpenFile();
00474 Fprintf(fp,"The next is: 34 + 43\n");
00475 XDq_zt.Print(fp);
00476 CloseFile();
00477
00478 }
00479
00480
00481 void calc_X2_Dq()
00482 {
00483 }
00484
00500 void calc_d1()
00501 {
00502 Nuc3ptStru d1_zt(Complex(0.0,1.0),Gamma(G5,Z),Derivative(T)) ;
00503 d1_zt.Calc3pt(*u_s_prop,*q_prop);
00504 d1_zt.Calc3pt(*d_s_prop,*q_prop);
00505
00506 Nuc3ptStru XDq_tz(Complex(0.0,-1.0),Gamma(G5,T),Derivative(Z)) ;
00507 XDq_tz.Calc3pt(*u_s_prop,*q_prop);
00508 XDq_tz.Calc3pt(*d_s_prop,*q_prop);
00509
00510 d1_zt+=XDq_tz ;
00511 d1_zt.setTag("m") ;
00512
00513 OpenFile();
00514 Fprintf(fp,"The next is: 34 - 43\n");
00515 d1_zt.Print(fp);
00516 CloseFile();
00517 }
00518 void calc_d2()
00519 {
00520 }
00521
00522
00523
00524
00532 void calc_Tensor()
00533 {
00534 Nuc3ptGamma Tensor(Complex(0.0,1.0),Gamma(G5,Z,T)) ;
00535 Tensor.Calc3pt(*u_s_prop,*q_prop);
00536 Tensor.Calc3pt(*d_s_prop,*q_prop);
00537
00538 OpenFile();
00539 Tensor.Print(fp) ;
00540 CloseFile();
00541 }
00542
00565 void calc_X_dq()
00566 {
00567 Nuc3ptStru Xdq_ztx(Complex(0.0,1.0),Gamma(G5,Z,T),Derivative(X)) ;
00568 Xdq_ztx.Calc3pt(*u_s_prop, *q_prop);
00569 Xdq_ztx.Calc3pt(*d_s_prop, *q_prop);
00570
00571 Nuc3ptStru Xdq_zxt(Complex(0.0,1.0),Gamma(G5,Z,X),Derivative(T)) ;
00572 Xdq_zxt.Calc3pt(*u_s_prop, *q_prop);
00573 Xdq_zxt.Calc3pt(*d_s_prop, *q_prop);
00574
00575 Xdq_ztx += Xdq_zxt ;
00576
00577 OpenFile();
00578 Fprintf(fp,"The next is: 341 + 314\n");
00579 Xdq_ztx.Print(fp) ;
00580 CloseFile();
00581 }
00582
00591 void calc_Cons_Vector(int i, ThreeMom*) ;
00592
00601 void calc_Cons_Axial_Vector(int i, ThreeMom*) ;
00602
00603
00604 public:
00605 AlgNuc3pt(Lattice & latt, CommonArg* c_arg, Nuc3ptArg* arg);
00606
00607 virtual ~AlgNuc3pt();
00608
00609 void run();
00610
00611 void test_run();
00612
00613 void run_hbd();
00614
00615 void run_2pt();
00616 };
00617
00618 CPS_END_NAMESPACE
00619
00620 #endif