00001
00002
00003
00004
00005
00006
00007 #include "meas/hadron/barhqlq_w.h"
00008 #include "meas/hadron/barspinmat_w.h"
00009
00010 namespace Chroma
00011 {
00012
00013
00014
00015 namespace Baryon2PtContractions
00016 {
00017
00018
00019 LatticeComplex sigma2pt(const LatticePropagator& quark_propagator_1,
00020 const LatticePropagator& quark_propagator_2,
00021 const SpinMatrix& T, const SpinMatrix& sp)
00022 {
00023 #if QDP_NC == 3
00024
00025 LatticePropagator di_quark = quarkContract13(quark_propagator_1 * sp,
00026 sp * quark_propagator_2);
00027 return LatticeComplex(trace(T * traceColor(quark_propagator_2 * traceSpin(di_quark)))
00028 + trace(T * traceColor(quark_propagator_2 * di_quark)));
00029 #endif
00030 }
00031
00032
00033
00034
00035 LatticeComplex xi2pt(const LatticePropagator& quark_propagator_1,
00036 const LatticePropagator& quark_propagator_2,
00037 const SpinMatrix& T, const SpinMatrix& sp)
00038 {
00039 #if QDP_NC == 3
00040
00041 LatticePropagator di_quark = quarkContract13(quark_propagator_1 * sp,
00042 sp * quark_propagator_2);
00043 return LatticeComplex(trace(T * traceColor(quark_propagator_1 * traceSpin(di_quark)))
00044 + trace(T * traceColor(quark_propagator_1 * di_quark)));
00045 #endif
00046 }
00047
00048
00049
00050
00051 LatticeComplex lambda2pt(const LatticePropagator& quark_propagator_1,
00052 const LatticePropagator& quark_propagator_2,
00053 const SpinMatrix& T, const SpinMatrix& sp)
00054 {
00055 #if QDP_NC == 3
00056
00057
00058 LatticePropagator di_quark = quarkContract13(quark_propagator_2 * sp,
00059 sp * quark_propagator_2);
00060
00061 LatticeComplex b_prop = trace(T * traceColor(quark_propagator_1 * traceSpin(di_quark)))
00062 + trace(T * traceColor(quark_propagator_1 * di_quark));
00063
00064 di_quark = quarkContract13(quark_propagator_2 * sp,
00065 sp * quark_propagator_1);
00066 b_prop += trace(T * traceColor(quark_propagator_2 * di_quark));
00067
00068 return b_prop;
00069 #endif
00070 }
00071
00072
00073
00074
00075 LatticeComplex lambdaNaive2pt(const LatticePropagator& quark_propagator_1,
00076 const LatticePropagator& quark_propagator_2,
00077 const SpinMatrix& T, const SpinMatrix& sp)
00078 {
00079 #if QDP_NC == 3
00080
00081 LatticePropagator di_quark = quarkContract13(quark_propagator_2 * sp,
00082 sp * quark_propagator_2);
00083 return LatticeComplex(trace(T * traceColor(quark_propagator_1 * traceSpin(di_quark))));
00084 #endif
00085 }
00086
00087
00088
00089
00090 LatticeComplex sigmast2pt(const LatticePropagator& quark_propagator_1,
00091 const LatticePropagator& quark_propagator_2,
00092 const SpinMatrix& T, const SpinMatrix& sp)
00093 {
00094 #if QDP_NC == 3
00095
00096 LatticePropagator di_quark = quarkContract13(quark_propagator_1 * sp,
00097 sp * quark_propagator_2);
00098 LatticeComplex b_prop = trace(T * traceColor(quark_propagator_2 * traceSpin(di_quark)))
00099 + trace(T * traceColor(quark_propagator_2 * di_quark));
00100
00101 di_quark = quarkContract13(quark_propagator_2 * sp,
00102 sp * quark_propagator_1);
00103 b_prop += trace(T * traceColor(quark_propagator_2 * di_quark));
00104
00105 di_quark = quarkContract13(quark_propagator_2 * sp,
00106 sp * quark_propagator_2);
00107 b_prop += trace(T * traceColor(quark_propagator_1 * di_quark));
00108 b_prop *= 2;
00109 b_prop += trace(T * traceColor(quark_propagator_1 * traceSpin(di_quark)));
00110
00111 return b_prop;
00112 #endif
00113 }
00114
00115
00116
00117 LatticeComplex sigmast2pt(const LatticePropagator& quark_propagator_1,
00118 const LatticePropagator& quark_propagator_2,
00119 const SpinMatrix& T, const SpinMatrix& spSRC,
00120 const SpinMatrix& spSNK)
00121 {
00122 #if QDP_NC == 3
00123
00124 LatticePropagator di_quark = quarkContract13(quark_propagator_1 * spSRC,
00125 spSNK * quark_propagator_2);
00126 LatticeComplex b_prop = trace(T * traceColor(quark_propagator_2 * traceSpin(di_quark)))
00127 + trace(T * traceColor(quark_propagator_2 * di_quark));
00128
00129 di_quark = quarkContract13(quark_propagator_2 * spSRC,
00130 spSNK * quark_propagator_1);
00131 b_prop += trace(T * traceColor(quark_propagator_2 * di_quark));
00132
00133 di_quark = quarkContract13(quark_propagator_2 * spSRC,
00134 spSNK * quark_propagator_2);
00135 b_prop += trace(T * traceColor(quark_propagator_1 * di_quark));
00136 b_prop *= 2;
00137 b_prop += trace(T * traceColor(quark_propagator_1 * traceSpin(di_quark)));
00138 return b_prop;
00139 #endif
00140 }
00141
00142 }
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171 void barhqlq(const LatticePropagator& propagator_1,
00172 const LatticePropagator& propagator_2,
00173 const SftMom& phases,
00174 int t0, int bc_spec, bool time_rev,
00175 XMLWriter& xml,
00176 const string& xml_group)
00177 {
00178 START_CODE();
00179
00180 if ( Ns != 4 || Nc != 3 )
00181 return;
00182
00183 multi3d<DComplex> bardisp1;
00184 multi3d<DComplex> bardisp2;
00185
00186
00187 barhqlq(propagator_1, propagator_2, phases, bardisp1);
00188
00189
00190 bool time_revP = (bc_spec*bc_spec == 1) ? time_rev : false;
00191
00192 if (time_revP)
00193 {
00194
00195
00196 LatticePropagator q1_tmp = - (Gamma(7) * propagator_1 * Gamma(7));
00197 LatticePropagator q2_tmp = - (Gamma(7) * propagator_2 * Gamma(7));
00198
00199 barhqlq(q1_tmp, q2_tmp, phases, bardisp2);
00200 }
00201
00202
00203 int num_baryons = bardisp1.size3();
00204 int num_mom = bardisp1.size2();
00205 int length = bardisp1.size1();
00206
00207
00208 XMLArrayWriter xml_bar(xml,num_baryons);
00209 push(xml_bar, xml_group);
00210
00211 for(int baryons = 0; baryons < num_baryons; ++baryons)
00212 {
00213 push(xml_bar);
00214 write(xml_bar, "baryon_num", baryons);
00215
00216
00217 XMLArrayWriter xml_sink_mom(xml_bar,num_mom);
00218 push(xml_sink_mom, "momenta");
00219
00220 for(int sink_mom_num = 0; sink_mom_num < num_mom; ++sink_mom_num)
00221 {
00222 push(xml_sink_mom);
00223 write(xml_sink_mom, "sink_mom_num", sink_mom_num) ;
00224 write(xml_sink_mom, "sink_mom", phases.numToMom(sink_mom_num)) ;
00225
00226 multi1d<Complex> barprop(length);
00227
00228
00229 for(int t = 0; t < length; ++t)
00230 {
00231 int t_eff = (t - t0 + length) % length;
00232
00233 if ( bc_spec < 0 && (t_eff+t0) >= length)
00234 barprop[t_eff] = -bardisp1[baryons][sink_mom_num][t];
00235 else
00236 barprop[t_eff] = bardisp1[baryons][sink_mom_num][t];
00237 }
00238
00239 if (time_revP)
00240 {
00241
00242 for(int t = 0; t < length; ++t)
00243 {
00244 int t_eff = (length - t + t0) % length;
00245
00246 if ( bc_spec < 0 && (t_eff-t0) > 0)
00247 {
00248 barprop[t_eff] -= bardisp2[baryons][sink_mom_num][t];
00249 barprop[t_eff] *= 0.5;
00250 }
00251 else
00252 {
00253 barprop[t_eff] += bardisp2[baryons][sink_mom_num][t];
00254 barprop[t_eff] *= 0.5;
00255 }
00256 }
00257 }
00258
00259 write(xml_sink_mom, "barprop", barprop);
00260 pop(xml_sink_mom);
00261 }
00262
00263 pop(xml_sink_mom);
00264 pop(xml_bar);
00265 }
00266
00267 pop(xml_bar);
00268
00269 END_CODE();
00270 }
00271
00272
00273
00274
00275
00276
00277
00278
00279
00280
00281
00282
00283
00284
00285
00286
00287
00288
00289
00290
00291
00292
00293
00294
00295
00296
00297
00298
00299
00300
00301
00302
00303
00304
00305
00306
00307
00308
00309
00310
00311
00312
00313
00314
00315
00316
00317
00318
00319
00320
00321
00322
00323
00324
00325
00326
00327
00328
00329
00330
00331
00332
00333
00334
00335
00336
00337
00338
00339
00340
00341
00342 void barhqlq(const LatticePropagator& quark_propagator_1,
00343 const LatticePropagator& quark_propagator_2,
00344 const SftMom& phases,
00345 multi3d<DComplex>& barprop)
00346 {
00347 START_CODE();
00348
00349
00350 int length = phases.numSubsets() ;
00351
00352 if ( Ns != 4 || Nc != 3 )
00353 return;
00354
00355
00356 const int num_baryons = 17;
00357 int num_mom = phases.numMom();
00358 barprop.resize(num_baryons,num_mom,length);
00359
00360
00361
00362
00363 SpinMatrix T_mixed = BaryonSpinMats::Tmixed();
00364
00365
00366 SpinMatrix T_unpol = BaryonSpinMats::Tunpol();
00367
00368
00369 SpinMatrix Cg5 = BaryonSpinMats::Cg5();
00370
00371
00372 SpinMatrix Cg5g4 = BaryonSpinMats::Cg5g4();
00373
00374
00375 SpinMatrix Cg5NR = BaryonSpinMats::Cg5NR();
00376
00377 LatticeComplex b_prop;
00378
00379
00380 for(int baryons = 0; baryons < num_baryons; ++baryons)
00381 {
00382 LatticePropagator di_quark;
00383
00384 switch (baryons)
00385 {
00386 case 0:
00387
00388
00389
00390
00391
00392
00393 b_prop = Baryon2PtContractions::sigma2pt(quark_propagator_1, quark_propagator_2,
00394 T_mixed, Cg5);
00395 break;
00396
00397 case 1:
00398
00399
00400
00401
00402
00403
00404
00405 b_prop = Baryon2PtContractions::lambda2pt(quark_propagator_1, quark_propagator_2,
00406 T_mixed, Cg5);
00407 break;
00408
00409 case 2:
00410
00411
00412
00413
00414
00415 b_prop = Baryon2PtContractions::sigmast2pt(quark_propagator_1, quark_propagator_2,
00416 T_mixed, BaryonSpinMats::Cgm());
00417 break;
00418
00419 case 3:
00420
00421
00422
00423
00424
00425
00426 b_prop = Baryon2PtContractions::sigma2pt(quark_propagator_1, quark_propagator_2,
00427 T_mixed, Cg5g4);
00428 break;
00429
00430 case 4:
00431
00432
00433
00434
00435
00436
00437
00438 b_prop = Baryon2PtContractions::lambda2pt(quark_propagator_1, quark_propagator_2,
00439 T_mixed, Cg5g4);
00440 break;
00441
00442 case 5:
00443
00444
00445
00446
00447
00448 b_prop = Baryon2PtContractions::sigmast2pt(quark_propagator_1, quark_propagator_2,
00449 T_mixed, BaryonSpinMats::Cg4m());
00450 break;
00451
00452 case 6:
00453
00454
00455
00456
00457
00458
00459 b_prop = Baryon2PtContractions::sigma2pt(quark_propagator_1, quark_propagator_2,
00460 T_mixed, Cg5NR);
00461 break;
00462
00463 case 7:
00464
00465
00466
00467
00468
00469
00470
00471 b_prop = Baryon2PtContractions::lambda2pt(quark_propagator_1, quark_propagator_2,
00472 T_mixed, Cg5NR);
00473 break;
00474
00475 case 8:
00476
00477
00478
00479
00480
00481
00482
00483 b_prop = Baryon2PtContractions::sigmast2pt(quark_propagator_1, quark_propagator_2,
00484 T_mixed, BaryonSpinMats::CgmNR());
00485
00486
00487
00488
00489
00490
00491 b_prop *= 4.0;
00492 break;
00493
00494
00495 case 9:
00496
00497
00498
00499
00500
00501 b_prop = Baryon2PtContractions::sigma2pt(quark_propagator_1, quark_propagator_2,
00502 T_unpol, Cg5);
00503 break;
00504
00505 case 10:
00506
00507
00508
00509
00510
00511 b_prop = Baryon2PtContractions::sigma2pt(quark_propagator_1, quark_propagator_2,
00512 T_unpol, Cg5g4);
00513 break;
00514
00515 case 11:
00516
00517
00518
00519
00520
00521 b_prop = Baryon2PtContractions::sigma2pt(quark_propagator_1, quark_propagator_2,
00522 T_unpol, Cg5NR);
00523 break;
00524
00525 case 12:
00526
00527
00528
00529
00530
00531 b_prop = Baryon2PtContractions::lambdaNaive2pt(quark_propagator_1, quark_propagator_2,
00532 T_unpol, Cg5);
00533 break;
00534
00535 case 13:
00536
00537
00538
00539
00540
00541 b_prop = Baryon2PtContractions::xi2pt(quark_propagator_1, quark_propagator_2,
00542 T_unpol, Cg5);
00543 break;
00544
00545 case 14:
00546
00547
00548
00549
00550
00551
00552 b_prop = Baryon2PtContractions::lambdaNaive2pt(quark_propagator_1, quark_propagator_2,
00553 T_unpol, Cg5);
00554 break;
00555
00556 case 15:
00557
00558
00559
00560
00561
00562
00563 b_prop = Baryon2PtContractions::xi2pt(quark_propagator_1, quark_propagator_2,
00564 T_mixed, Cg5);
00565 break;
00566
00567 case 16:
00568
00569
00570
00571
00572
00573 b_prop = Baryon2PtContractions::sigma2pt(quark_propagator_1, quark_propagator_2,
00574 BaryonSpinMats::TmixedNegPar(),
00575 BaryonSpinMats::Cg5NRnegPar());
00576 break;
00577
00578 default:
00579 QDP_error_exit("Unknown baryon", baryons);
00580 }
00581
00582
00583 multi2d<DComplex> hsum;
00584 hsum = phases.sft(b_prop);
00585
00586 for(int sink_mom_num=0; sink_mom_num < num_mom; ++sink_mom_num)
00587 for(int t = 0; t < length; ++t)
00588 {
00589
00590 barprop[baryons][sink_mom_num][t] = hsum[sink_mom_num][t];
00591 }
00592
00593 }
00594
00595 END_CODE();
00596 }
00597
00598 }
00599
00600