mirror of
https://github.com/paboyle/Grid.git
synced 2025-04-11 22:50:45 +01:00
Update to baryon and added comments/fix whitespace
This commit is contained in:
parent
77af9a3ddc
commit
eb470aa6dc
@ -62,6 +62,9 @@ public:
|
||||
const bool * wick_contractions,
|
||||
robj &result);
|
||||
public:
|
||||
static void Wick_Contractions(std::string qi,
|
||||
std::string qf,
|
||||
bool* wick_contractions);
|
||||
static void ContractBaryons(const PropagatorField &q1_left,
|
||||
const PropagatorField &q2_left,
|
||||
const PropagatorField &q3_left,
|
||||
@ -80,7 +83,7 @@ public:
|
||||
const Gamma GammaB_left,
|
||||
const Gamma GammaA_right,
|
||||
const Gamma GammaB_right,
|
||||
const int wick_contraction,
|
||||
const bool* wick_contractions,
|
||||
const int parity,
|
||||
const int nt,
|
||||
robj &result);
|
||||
@ -326,6 +329,26 @@ void BaryonUtils<FImpl>::baryon_site(const mobj &D1,
|
||||
}}
|
||||
}
|
||||
|
||||
/* Computes which wick contractions should be performed for a *
|
||||
* baryon 2pt function given the initial and finals state quark *
|
||||
* flavours. *
|
||||
* The array wick_contractions must be of length 6 */
|
||||
template<class FImpl>
|
||||
void BaryonUtils<FImpl>::Wick_Contractions(std::string qi, std::string qf, bool* wick_contractions) {
|
||||
const int epsilon[6][3] = {{0,1,2},{1,2,0},{2,0,1},{0,2,1},{2,1,0},{1,0,2}};
|
||||
for (int ie=0; ie < 6 ; ie++) {
|
||||
wick_contractions[ie] = (qi.size() == 3 && qf.size() == 3
|
||||
&& qi[0] == qf[epsilon[ie][0]]
|
||||
&& qi[1] == qf[epsilon[ie][1]]
|
||||
&& qi[2] == qf[epsilon[ie][2]]);
|
||||
}
|
||||
}
|
||||
|
||||
/* The array wick_contractions must be of length 6. The order *
|
||||
* corresponds to the to that shown in the Hadrons documentation *
|
||||
* at https://aportelli.github.io/Hadrons-doc/#/mcontraction *
|
||||
* This can be computed from the quark flavours using the *
|
||||
* Wick_Contractions function above */
|
||||
template<class FImpl>
|
||||
void BaryonUtils<FImpl>::ContractBaryons(const PropagatorField &q1_left,
|
||||
const PropagatorField &q2_left,
|
||||
@ -383,6 +406,12 @@ void BaryonUtils<FImpl>::ContractBaryons(const PropagatorField &q1_left,
|
||||
std::cout << std::setw(10) << bytes/t*1.0e6/1024/1024/1024 << " GB/s " << std::endl;
|
||||
|
||||
}
|
||||
|
||||
/* The array wick_contractions must be of length 6. The order *
|
||||
* corresponds to the to that shown in the Hadrons documentation *
|
||||
* at https://aportelli.github.io/Hadrons-doc/#/mcontraction *
|
||||
* This can also be computed from the quark flavours using the *
|
||||
* Wick_Contractions function above */
|
||||
template <class FImpl>
|
||||
template <class mobj, class robj>
|
||||
void BaryonUtils<FImpl>::ContractBaryons_Sliced(const mobj &D1,
|
||||
@ -392,7 +421,7 @@ void BaryonUtils<FImpl>::ContractBaryons_Sliced(const mobj &D1,
|
||||
const Gamma GammaB_left,
|
||||
const Gamma GammaA_right,
|
||||
const Gamma GammaB_right,
|
||||
const int wick_contraction,
|
||||
const bool* wick_contractions,
|
||||
const int parity,
|
||||
const int nt,
|
||||
robj &result)
|
||||
@ -408,10 +437,6 @@ void BaryonUtils<FImpl>::ContractBaryons_Sliced(const mobj &D1,
|
||||
|
||||
assert(parity==1 || parity == -1 && "Parity must be +1 or -1");
|
||||
|
||||
bool wick_contractions[6];
|
||||
for (int ie=0; ie < 6 ; ie++)
|
||||
wick_contractions[ie] = (ie == wick_contraction);
|
||||
|
||||
for (int t=0; t<nt; t++) {
|
||||
baryon_site(D1[t],D2[t],D3[t],GammaA_left,GammaB_left,GammaA_right,GammaB_right,parity,wick_contractions,result[t]);
|
||||
}
|
||||
@ -480,32 +505,32 @@ void BaryonUtils<FImpl>::Baryon_Gamma_3pt_Group1_Site(
|
||||
auto D2_Gi_gb_ca = D2_Gi ()(gamma_f,beta_i)(c_f,a_i);
|
||||
|
||||
|
||||
if(wick_contraction == 0) { // Do contraction I1
|
||||
if(wick_contraction == 1) { // Do contraction I1
|
||||
result()(gamma_f,gamma_i)() -= ee_adjD4_g_D1_gg_cc
|
||||
* D2_Gi_ab_aa
|
||||
* Gf_D3_ab_bb;
|
||||
}
|
||||
if(wick_contraction == 1) { // Do contraction I2
|
||||
if(wick_contraction == 2) { // Do contraction I2
|
||||
result()(gamma_f,gamma_i)() -= ee_adjD4_g_D1_ag_ac
|
||||
* Gf_D2_Gi_ab_ba
|
||||
* Dq3_spec_gb_cb;
|
||||
}
|
||||
if(wick_contraction == 2) { // Do contraction I3
|
||||
if(wick_contraction == 3) { // Do contraction I3
|
||||
result()(gamma_f,gamma_i)() -= ee_Gf_adjD4_g_D1_ag_bc
|
||||
* D2_Gi_gb_ca
|
||||
* Dq3_spec_ab_ab;
|
||||
}
|
||||
if(wick_contraction == 3) { // Do contraction I4
|
||||
if(wick_contraction == 4) { // Do contraction I4
|
||||
result()(gamma_f,gamma_i)() += ee_adjD4_g_D1_gg_cc
|
||||
* Gf_D2_Gi_ab_ba
|
||||
* Dq3_spec_ab_ab;
|
||||
}
|
||||
if(wick_contraction == 4) { // Do contraction I5
|
||||
if(wick_contraction == 5) { // Do contraction I5
|
||||
result()(gamma_f,gamma_i)() += ee_Gf_adjD4_g_D1_ag_bc
|
||||
* D2_Gi_ab_aa
|
||||
* Dq3_spec_gb_cb;
|
||||
}
|
||||
if(wick_contraction == 5) { // Do contraction I6
|
||||
if(wick_contraction == 6) { // Do contraction I6
|
||||
result()(gamma_f,gamma_i)() += ee_adjD4_g_D1_ag_ac
|
||||
* D2_Gi_gb_ca
|
||||
* Gf_D3_ab_bb;
|
||||
@ -570,32 +595,32 @@ void BaryonUtils<FImpl>::Baryon_Gamma_3pt_Group2_Site(
|
||||
auto Dq3_spec_gb_cb = Dq3_spec ()(gamma_f,beta_i)(c_f,b_i);
|
||||
auto adjD4_g_D2_Gi_gb_ca = adjD4_g_D2_Gi ()(gamma_f,beta_i)(c_f,a_i);
|
||||
|
||||
if(wick_contraction == 0) { // Do contraction II1
|
||||
if(wick_contraction == 1) { // Do contraction II1
|
||||
result()(gamma_f,gamma_i)() -= ee_Dq1_spec_gg_cc
|
||||
* adjD4_g_D2_Gi_ab_aa
|
||||
* Gf_D3_ab_bb;
|
||||
}
|
||||
if(wick_contraction == 1) { // Do contraction II2
|
||||
if(wick_contraction == 2) { // Do contraction II2
|
||||
result()(gamma_f,gamma_i)() -= ee_Dq1_spec_ag_ac
|
||||
* Gf_adjD4_g_D2_Gi_ab_ba
|
||||
* Dq3_spec_gb_cb;
|
||||
}
|
||||
if(wick_contraction == 2) { // Do contraction II3
|
||||
if(wick_contraction == 3) { // Do contraction II3
|
||||
result()(gamma_f,gamma_i)() -= ee_Gf_D1_ag_bc
|
||||
* adjD4_g_D2_Gi_gb_ca
|
||||
* Dq3_spec_ab_ab;
|
||||
}
|
||||
if(wick_contraction == 3) { // Do contraction II4
|
||||
if(wick_contraction == 4) { // Do contraction II4
|
||||
result()(gamma_f,gamma_i)() += ee_Dq1_spec_gg_cc
|
||||
* Gf_adjD4_g_D2_Gi_ab_ba
|
||||
* Dq3_spec_ab_ab;
|
||||
}
|
||||
if(wick_contraction == 4) { // Do contraction II5
|
||||
if(wick_contraction == 5) { // Do contraction II5
|
||||
result()(gamma_f,gamma_i)() += ee_Gf_D1_ag_bc
|
||||
* adjD4_g_D2_Gi_ab_aa
|
||||
* Dq3_spec_gb_cb;
|
||||
}
|
||||
if(wick_contraction == 5) { // Do contraction II6
|
||||
if(wick_contraction == 6) { // Do contraction II6
|
||||
result()(gamma_f,gamma_i)() += ee_Dq1_spec_ag_ac
|
||||
* adjD4_g_D2_Gi_gb_ca
|
||||
* Gf_D3_ab_bb;
|
||||
@ -661,32 +686,32 @@ void BaryonUtils<FImpl>::Baryon_Gamma_3pt_Group3_Site(
|
||||
auto adjD4_g_D3_gb_cb = adjD4_g_D3 ()(gamma_f,beta_i)(c_f,b_i);
|
||||
auto D2_Gi_gb_ca = D2_Gi ()(gamma_f,beta_i)(c_f,a_i);
|
||||
|
||||
if(wick_contraction == 0) { // Do contraction III1
|
||||
if(wick_contraction == 1) { // Do contraction III1
|
||||
result()(gamma_f,gamma_i)() -= ee_Dq1_spec_gg_cc
|
||||
* D2_Gi_ab_aa
|
||||
* Gf_adjD4_g_D3_ab_bb;
|
||||
}
|
||||
if(wick_contraction == 1) { // Do contraction III2
|
||||
if(wick_contraction == 2) { // Do contraction III2
|
||||
result()(gamma_f,gamma_i)() -= ee_Dq1_spec_ag_ac
|
||||
* Gf_D2_Gi_ab_ba
|
||||
* adjD4_g_D3_gb_cb;
|
||||
}
|
||||
if(wick_contraction == 2) { // Do contraction III3
|
||||
if(wick_contraction == 3) { // Do contraction III3
|
||||
result()(gamma_f,gamma_i)() -= ee_Gf_D1_ag_bc
|
||||
* D2_Gi_gb_ca
|
||||
* adjD4_g_D3_ab_ab;
|
||||
}
|
||||
if(wick_contraction == 3) { // Do contraction III4
|
||||
if(wick_contraction == 4) { // Do contraction III4
|
||||
result()(gamma_f,gamma_i)() += ee_Dq1_spec_gg_cc
|
||||
* Gf_D2_Gi_ab_ba
|
||||
* adjD4_g_D3_ab_ab;
|
||||
}
|
||||
if(wick_contraction == 4) { // Do contraction III5
|
||||
if(wick_contraction == 5) { // Do contraction III5
|
||||
result()(gamma_f,gamma_i)() += ee_Gf_D1_ag_bc
|
||||
* D2_Gi_ab_aa
|
||||
* adjD4_g_D3_gb_cb;
|
||||
}
|
||||
if(wick_contraction == 5) { // Do contraction III6
|
||||
if(wick_contraction == 6) { // Do contraction III6
|
||||
result()(gamma_f,gamma_i)() += ee_Dq1_spec_ag_ac
|
||||
* D2_Gi_gb_ca
|
||||
* Gf_adjD4_g_D3_ab_bb;
|
||||
@ -696,6 +721,11 @@ void BaryonUtils<FImpl>::Baryon_Gamma_3pt_Group3_Site(
|
||||
}}
|
||||
}
|
||||
|
||||
/* The group indicates which inital state quarks the current is *
|
||||
* connected to. It must be in the range 1-3. *
|
||||
* The wick_contraction must be in the range 1-6 correspond to *
|
||||
* the contractions given in the Hadrons documentation at *
|
||||
* https://aportelli.github.io/Hadrons-doc/#/mcontraction */
|
||||
template<class FImpl>
|
||||
template <class mobj>
|
||||
void BaryonUtils<FImpl>::Baryon_Gamma_3pt(
|
||||
@ -742,7 +772,6 @@ void BaryonUtils<FImpl>::Baryon_Gamma_3pt(
|
||||
vcorr[ss] += result;
|
||||
});//end loop over lattice sites
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user