mirror of
				https://github.com/paboyle/Grid.git
				synced 2025-11-04 14:04:32 +00:00 
			
		
		
		
	second update to pull request
This commit is contained in:
		@@ -50,29 +50,35 @@ public:
 | 
				
			|||||||
  static void baryon_site(const mobj &D1,
 | 
					  static void baryon_site(const mobj &D1,
 | 
				
			||||||
				 const mobj &D2,
 | 
									 const mobj &D2,
 | 
				
			||||||
				 const mobj &D3,
 | 
									 const mobj &D3,
 | 
				
			||||||
				 const Gamma GammaA,
 | 
									 const Gamma GammaA_left,
 | 
				
			||||||
				 const Gamma GammaB,
 | 
									 const Gamma GammaB_left,
 | 
				
			||||||
 | 
									 const Gamma GammaA_right,
 | 
				
			||||||
 | 
									 const Gamma GammaB_right,
 | 
				
			||||||
				 const int parity,
 | 
									 const int parity,
 | 
				
			||||||
				 const int * wick_contractions,
 | 
									 const int * wick_contractions,
 | 
				
			||||||
  				 robj &result);
 | 
					  				 robj &result);
 | 
				
			||||||
  public:
 | 
					  public:
 | 
				
			||||||
  static void ContractBaryons(const PropagatorField &q1_src,
 | 
					  static void ContractBaryons(const PropagatorField &q1_left,
 | 
				
			||||||
				 const PropagatorField &q2_src,
 | 
									 const PropagatorField &q2_left,
 | 
				
			||||||
				 const PropagatorField &q3_src,
 | 
									 const PropagatorField &q3_left,
 | 
				
			||||||
				 const Gamma GammaA,
 | 
									 const Gamma GammaA_left,
 | 
				
			||||||
				 const Gamma GammaB,
 | 
									 const Gamma GammaB_left,
 | 
				
			||||||
				 const char * quarks_snk,
 | 
									 const Gamma GammaA_right,
 | 
				
			||||||
				 const char * quarks_src,
 | 
									 const Gamma GammaB_right,
 | 
				
			||||||
 | 
									 const char * quarks_left,
 | 
				
			||||||
 | 
									 const char * quarks_right,
 | 
				
			||||||
				 const int parity,
 | 
									 const int parity,
 | 
				
			||||||
				 ComplexField &baryon_corr);
 | 
									 ComplexField &baryon_corr);
 | 
				
			||||||
  template <class mobj, class robj>
 | 
					  template <class mobj, class robj>
 | 
				
			||||||
  static void ContractBaryons_Sliced(const mobj &D1,
 | 
					  static void ContractBaryons_Sliced(const mobj &D1,
 | 
				
			||||||
				 const mobj &D2,
 | 
									 const mobj &D2,
 | 
				
			||||||
				 const mobj &D3,
 | 
									 const mobj &D3,
 | 
				
			||||||
				 const Gamma GammaA,
 | 
									 const Gamma GammaA_left,
 | 
				
			||||||
				 const Gamma GammaB,
 | 
									 const Gamma GammaB_left,
 | 
				
			||||||
				 const char * quarks_snk,
 | 
									 const Gamma GammaA_right,
 | 
				
			||||||
				 const char * quarks_src,
 | 
									 const Gamma GammaB_right,
 | 
				
			||||||
 | 
									 const char * quarks_left,
 | 
				
			||||||
 | 
									 const char * quarks_right,
 | 
				
			||||||
				 const int parity,
 | 
									 const int parity,
 | 
				
			||||||
				 robj &result);
 | 
									 robj &result);
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
@@ -87,8 +93,10 @@ template <class mobj, class robj>
 | 
				
			|||||||
void BaryonUtils<FImpl>::baryon_site(const mobj &D1,
 | 
					void BaryonUtils<FImpl>::baryon_site(const mobj &D1,
 | 
				
			||||||
						 const mobj &D2,
 | 
											 const mobj &D2,
 | 
				
			||||||
						 const mobj &D3,
 | 
											 const mobj &D3,
 | 
				
			||||||
						 const Gamma GammaA,
 | 
									                 const Gamma GammaA_left,
 | 
				
			||||||
						 const Gamma GammaB,
 | 
									                 const Gamma GammaB_left,
 | 
				
			||||||
 | 
									                 const Gamma GammaA_right,
 | 
				
			||||||
 | 
							                 		 const Gamma GammaB_right,
 | 
				
			||||||
						 const int parity,
 | 
											 const int parity,
 | 
				
			||||||
						 const int * wick_contraction,
 | 
											 const int * wick_contraction,
 | 
				
			||||||
						 robj &result)
 | 
											 robj &result)
 | 
				
			||||||
@@ -96,71 +104,71 @@ void BaryonUtils<FImpl>::baryon_site(const mobj &D1,
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  Gamma g4(Gamma::Algebra::GammaT); //needed for parity P_\pm = 0.5*(1 \pm \gamma_4)
 | 
					  Gamma g4(Gamma::Algebra::GammaT); //needed for parity P_\pm = 0.5*(1 \pm \gamma_4)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    auto gD1a = GammaA * GammaA * D1;
 | 
					    auto gD1a = GammaA_left * GammaA_right * D1;
 | 
				
			||||||
    auto gD1b = GammaA * g4 * GammaA * D1;
 | 
					    auto gD1b = GammaA_left * g4 * GammaA_right * D1;
 | 
				
			||||||
    auto pD1 = 0.5* (gD1a + (double)parity * gD1b);
 | 
					    auto pD1 = 0.5* (gD1a + (double)parity * gD1b);
 | 
				
			||||||
    auto gD3 = GammaB * D3;
 | 
					    auto gD3 = GammaB_right * D3;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    for (int ie_src=0; ie_src < 6 ; ie_src++){
 | 
					    for (int ie_left=0; ie_left < 6 ; ie_left++){
 | 
				
			||||||
      int a_src = epsilon[ie_src][0]; //a
 | 
					      int a_left = epsilon[ie_left][0]; //a
 | 
				
			||||||
      int b_src = epsilon[ie_src][1]; //b
 | 
					      int b_left = epsilon[ie_left][1]; //b
 | 
				
			||||||
      int c_src = epsilon[ie_src][2]; //c
 | 
					      int c_left = epsilon[ie_left][2]; //c
 | 
				
			||||||
      for (int ie_snk=0; ie_snk < 6 ; ie_snk++){
 | 
					      for (int ie_right=0; ie_right < 6 ; ie_right++){
 | 
				
			||||||
        int a_snk = epsilon[ie_snk][0]; //a'
 | 
					        int a_right = epsilon[ie_right][0]; //a'
 | 
				
			||||||
        int b_snk = epsilon[ie_snk][1]; //b'
 | 
					        int b_right = epsilon[ie_right][1]; //b'
 | 
				
			||||||
        int c_snk = epsilon[ie_snk][2]; //c'
 | 
					        int c_right = epsilon[ie_right][2]; //c'
 | 
				
			||||||
        //This is the \delta_{456}^{123} part
 | 
					        //This is the \delta_{456}^{123} part
 | 
				
			||||||
	if (wick_contraction[0]){
 | 
						if (wick_contraction[0]){
 | 
				
			||||||
          auto D2g = D2 * GammaB;
 | 
					          auto D2g = D2 * GammaB_left;
 | 
				
			||||||
	  for (int alpha_snk=0; alpha_snk<Ns; alpha_snk++){
 | 
						  for (int alpha_right=0; alpha_right<Ns; alpha_right++){
 | 
				
			||||||
	  for (int beta_src=0; beta_src<Ns; beta_src++){
 | 
						  for (int beta_left=0; beta_left<Ns; beta_left++){
 | 
				
			||||||
	  for (int gamma_src=0; gamma_src<Ns; gamma_src++){
 | 
						  for (int gamma_left=0; gamma_left<Ns; gamma_left++){
 | 
				
			||||||
	    result()()() += epsilon_sgn[ie_src] * epsilon_sgn[ie_snk] * pD1()(gamma_src,gamma_src)(c_snk,c_src)*D2g()(alpha_snk,beta_src)(a_snk,a_src)*gD3()(alpha_snk,beta_src)(b_snk,b_src);
 | 
						    result()()() += epsilon_sgn[ie_left] * epsilon_sgn[ie_right] * pD1()(gamma_left,gamma_left)(c_right,c_left)*D2g()(alpha_right,beta_left)(a_right,a_left)*gD3()(alpha_right,beta_left)(b_right,b_left);
 | 
				
			||||||
          }}}
 | 
					          }}}
 | 
				
			||||||
  	}	  
 | 
					  	}	  
 | 
				
			||||||
        //This is the \delta_{456}^{231} part
 | 
					        //This is the \delta_{456}^{231} part
 | 
				
			||||||
	if (wick_contraction[1]){
 | 
						if (wick_contraction[1]){
 | 
				
			||||||
          auto pD1g = pD1 * GammaB;
 | 
					          auto pD1g = pD1 * GammaB_left;
 | 
				
			||||||
	  for (int alpha_snk=0; alpha_snk<Ns; alpha_snk++){
 | 
						  for (int alpha_right=0; alpha_right<Ns; alpha_right++){
 | 
				
			||||||
	  for (int beta_src=0; beta_src<Ns; beta_src++){
 | 
						  for (int beta_left=0; beta_left<Ns; beta_left++){
 | 
				
			||||||
	  for (int gamma_src=0; gamma_src<Ns; gamma_src++){
 | 
						  for (int gamma_left=0; gamma_left<Ns; gamma_left++){
 | 
				
			||||||
	    result()()() += epsilon_sgn[ie_src] * epsilon_sgn[ie_snk] * pD1g()(gamma_src,beta_src)(c_snk,a_src)*D2()(alpha_snk,beta_src)(a_snk,b_src)*gD3()(alpha_snk,gamma_src)(b_snk,c_src);
 | 
						    result()()() += epsilon_sgn[ie_left] * epsilon_sgn[ie_right] * pD1g()(gamma_left,beta_left)(c_right,a_left)*D2()(alpha_right,beta_left)(a_right,b_left)*gD3()(alpha_right,gamma_left)(b_right,c_left);
 | 
				
			||||||
          }}}
 | 
					          }}}
 | 
				
			||||||
        }	  
 | 
					        }	  
 | 
				
			||||||
        //This is the \delta_{456}^{312} part
 | 
					        //This is the \delta_{456}^{312} part
 | 
				
			||||||
	if (wick_contraction[2]){
 | 
						if (wick_contraction[2]){
 | 
				
			||||||
          auto gD3g = gD3 * GammaB;
 | 
					          auto gD3g = gD3 * GammaB_left;
 | 
				
			||||||
	  for (int alpha_snk=0; alpha_snk<Ns; alpha_snk++){
 | 
						  for (int alpha_right=0; alpha_right<Ns; alpha_right++){
 | 
				
			||||||
	  for (int beta_src=0; beta_src<Ns; beta_src++){
 | 
						  for (int beta_left=0; beta_left<Ns; beta_left++){
 | 
				
			||||||
	  for (int gamma_src=0; gamma_src<Ns; gamma_src++){
 | 
						  for (int gamma_left=0; gamma_left<Ns; gamma_left++){
 | 
				
			||||||
	    result()()() += epsilon_sgn[ie_src] * epsilon_sgn[ie_snk] * pD1()(gamma_src,beta_src)(c_snk,b_src)*D2()(alpha_snk,gamma_src)(a_snk,c_src)*gD3g()(alpha_snk,beta_src)(b_snk,a_src);
 | 
						    result()()() += epsilon_sgn[ie_left] * epsilon_sgn[ie_right] * pD1()(gamma_left,beta_left)(c_right,b_left)*D2()(alpha_right,gamma_left)(a_right,c_left)*gD3g()(alpha_right,beta_left)(b_right,a_left);
 | 
				
			||||||
          }}}
 | 
					          }}}
 | 
				
			||||||
        }	  
 | 
					        }	  
 | 
				
			||||||
        //This is the \delta_{456}^{132} part
 | 
					        //This is the \delta_{456}^{132} part
 | 
				
			||||||
	if (wick_contraction[3]){
 | 
						if (wick_contraction[3]){
 | 
				
			||||||
          auto gD3g = gD3 * GammaB;
 | 
					          auto gD3g = gD3 * GammaB_left;
 | 
				
			||||||
	  for (int alpha_snk=0; alpha_snk<Ns; alpha_snk++){
 | 
						  for (int alpha_right=0; alpha_right<Ns; alpha_right++){
 | 
				
			||||||
	  for (int beta_src=0; beta_src<Ns; beta_src++){
 | 
						  for (int beta_left=0; beta_left<Ns; beta_left++){
 | 
				
			||||||
	  for (int gamma_src=0; gamma_src<Ns; gamma_src++){
 | 
						  for (int gamma_left=0; gamma_left<Ns; gamma_left++){
 | 
				
			||||||
	    result()()() -= epsilon_sgn[ie_src] * epsilon_sgn[ie_snk] * pD1()(gamma_src,gamma_src)(c_snk,c_src)*D2()(alpha_snk,beta_src)(a_snk,b_src)*gD3g()(alpha_snk,beta_src)(b_snk,a_src);
 | 
						    result()()() -= epsilon_sgn[ie_left] * epsilon_sgn[ie_right] * pD1()(gamma_left,gamma_left)(c_right,c_left)*D2()(alpha_right,beta_left)(a_right,b_left)*gD3g()(alpha_right,beta_left)(b_right,a_left);
 | 
				
			||||||
          }}}
 | 
					          }}}
 | 
				
			||||||
        }	  
 | 
					        }	  
 | 
				
			||||||
        //This is the \delta_{456}^{321} part
 | 
					        //This is the \delta_{456}^{321} part
 | 
				
			||||||
	if (wick_contraction[4]){
 | 
						if (wick_contraction[4]){
 | 
				
			||||||
          auto D2g = D2 * GammaB;
 | 
					          auto D2g = D2 * GammaB_left;
 | 
				
			||||||
	  for (int alpha_snk=0; alpha_snk<Ns; alpha_snk++){
 | 
						  for (int alpha_right=0; alpha_right<Ns; alpha_right++){
 | 
				
			||||||
	  for (int beta_src=0; beta_src<Ns; beta_src++){
 | 
						  for (int beta_left=0; beta_left<Ns; beta_left++){
 | 
				
			||||||
	  for (int gamma_src=0; gamma_src<Ns; gamma_src++){
 | 
						  for (int gamma_left=0; gamma_left<Ns; gamma_left++){
 | 
				
			||||||
	    result()()() -= epsilon_sgn[ie_src] * epsilon_sgn[ie_snk] * pD1()(gamma_src,beta_src)(c_snk,b_src)*D2g()(alpha_snk,beta_src)(a_snk,a_src)*gD3()(alpha_snk,gamma_src)(b_snk,c_src);
 | 
						    result()()() -= epsilon_sgn[ie_left] * epsilon_sgn[ie_right] * pD1()(gamma_left,beta_left)(c_right,b_left)*D2g()(alpha_right,beta_left)(a_right,a_left)*gD3()(alpha_right,gamma_left)(b_right,c_left);
 | 
				
			||||||
          }}}
 | 
					          }}}
 | 
				
			||||||
        }	  
 | 
					        }	  
 | 
				
			||||||
        //This is the \delta_{456}^{213} part
 | 
					        //This is the \delta_{456}^{213} part
 | 
				
			||||||
	if (wick_contraction[5]){
 | 
						if (wick_contraction[5]){
 | 
				
			||||||
          auto pD1g = pD1 * GammaB;
 | 
					          auto pD1g = pD1 * GammaB_left;
 | 
				
			||||||
	  for (int alpha_snk=0; alpha_snk<Ns; alpha_snk++){
 | 
						  for (int alpha_right=0; alpha_right<Ns; alpha_right++){
 | 
				
			||||||
	  for (int beta_src=0; beta_src<Ns; beta_src++){
 | 
						  for (int beta_left=0; beta_left<Ns; beta_left++){
 | 
				
			||||||
	  for (int gamma_src=0; gamma_src<Ns; gamma_src++){
 | 
						  for (int gamma_left=0; gamma_left<Ns; gamma_left++){
 | 
				
			||||||
	    result()()() -= epsilon_sgn[ie_src] * epsilon_sgn[ie_snk] * pD1g()(gamma_src,beta_src)(c_snk,a_src)*D2()(alpha_snk,gamma_src)(a_snk,c_src)*gD3()(alpha_snk,beta_src)(b_snk,b_src);
 | 
						    result()()() -= epsilon_sgn[ie_left] * epsilon_sgn[ie_right] * pD1g()(gamma_left,beta_left)(c_right,a_left)*D2()(alpha_right,gamma_left)(a_right,c_left)*gD3()(alpha_right,beta_left)(b_right,b_left);
 | 
				
			||||||
          }}}
 | 
					          }}}
 | 
				
			||||||
        }	  
 | 
					        }	  
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
@@ -168,32 +176,36 @@ void BaryonUtils<FImpl>::baryon_site(const mobj &D1,
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
template<class FImpl>
 | 
					template<class FImpl>
 | 
				
			||||||
void BaryonUtils<FImpl>::ContractBaryons(const PropagatorField &q1_src,
 | 
					void BaryonUtils<FImpl>::ContractBaryons(const PropagatorField &q1_left,
 | 
				
			||||||
						 const PropagatorField &q2_src,
 | 
											 const PropagatorField &q2_left,
 | 
				
			||||||
						 const PropagatorField &q3_src,
 | 
											 const PropagatorField &q3_left,
 | 
				
			||||||
						 const Gamma GammaA,
 | 
									                 const Gamma GammaA_left,
 | 
				
			||||||
						 const Gamma GammaB,
 | 
									                 const Gamma GammaB_left,
 | 
				
			||||||
						 const char * quarks_snk,
 | 
									                 const Gamma GammaA_right,
 | 
				
			||||||
						 const char * quarks_src,
 | 
							                 		 const Gamma GammaB_right,
 | 
				
			||||||
 | 
											 const char * quarks_left,
 | 
				
			||||||
 | 
											 const char * quarks_right,
 | 
				
			||||||
						 const int parity,
 | 
											 const int parity,
 | 
				
			||||||
						 ComplexField &baryon_corr)
 | 
											 ComplexField &baryon_corr)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  std::cout << "Contraction <" << quarks_snk[0] << quarks_snk[1] << quarks_snk[2] << "|" << quarks_src[0] << quarks_src[1] << quarks_src[2] << ">" << std::endl;
 | 
					  std::cout << "Contraction <" << quarks_right[0] << quarks_right[1] << quarks_right[2] << "|" << quarks_left[0] << quarks_left[1] << quarks_left[2] << ">" << std::endl;
 | 
				
			||||||
    std::cout << "GammaA " << (GammaA.g) <<  std::endl;
 | 
					    std::cout << "GammaA (left) " << (GammaA_left.g) <<  std::endl;
 | 
				
			||||||
    std::cout << "GammaB " << (GammaB.g) <<  std::endl;
 | 
					    std::cout << "GammaB (left) " << (GammaB_left.g) <<  std::endl;
 | 
				
			||||||
 | 
					    std::cout << "GammaA (right) " << (GammaA_right.g) <<  std::endl;
 | 
				
			||||||
 | 
					    std::cout << "GammaB (right) " << (GammaB_right.g) <<  std::endl;
 | 
				
			||||||
 
 | 
					 
 | 
				
			||||||
  assert(parity==1 || parity == -1 && "Parity must be +1 or -1");
 | 
					  assert(parity==1 || parity == -1 && "Parity must be +1 or -1");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  GridBase *grid = q1_src.Grid();
 | 
					  GridBase *grid = q1_left.Grid();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  int wick_contraction[6];
 | 
					  int wick_contraction[6];
 | 
				
			||||||
  for (int ie=0; ie < 6 ; ie++)
 | 
					  for (int ie=0; ie < 6 ; ie++)
 | 
				
			||||||
    wick_contraction[ie] = (quarks_src[0] == quarks_snk[epsilon[ie][0]] && quarks_src[1] == quarks_snk[epsilon[ie][1]] && quarks_src[2] == quarks_snk[epsilon[ie][2]]) ? 1 : 0;
 | 
					    wick_contraction[ie] = (quarks_left[0] == quarks_right[epsilon[ie][0]] && quarks_left[1] == quarks_right[epsilon[ie][1]] && quarks_left[2] == quarks_right[epsilon[ie][2]]) ? 1 : 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  auto vbaryon_corr= baryon_corr.View();
 | 
					  auto vbaryon_corr= baryon_corr.View();
 | 
				
			||||||
  auto v1 = q1_src.View();
 | 
					  auto v1 = q1_left.View();
 | 
				
			||||||
  auto v2 = q2_src.View();
 | 
					  auto v2 = q2_left.View();
 | 
				
			||||||
  auto v3 = q3_src.View();
 | 
					  auto v3 = q3_left.View();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 // accelerator_for(ss, grid->oSites(), grid->Nsimd(), {
 | 
					 // accelerator_for(ss, grid->oSites(), grid->Nsimd(), {
 | 
				
			||||||
  thread_for(ss,grid->oSites(),{
 | 
					  thread_for(ss,grid->oSites(),{
 | 
				
			||||||
@@ -204,7 +216,7 @@ void BaryonUtils<FImpl>::ContractBaryons(const PropagatorField &q1_src,
 | 
				
			|||||||
    auto D3 = v3[ss];
 | 
					    auto D3 = v3[ss];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    vobj result=Zero();
 | 
					    vobj result=Zero();
 | 
				
			||||||
    baryon_site(D1,D2,D3,GammaA,GammaB,parity,wick_contraction,result);
 | 
					    baryon_site(D1,D2,D3,GammaA_left,GammaB_left,GammaA_right,GammaB_right,parity,wick_contraction,result);
 | 
				
			||||||
    vbaryon_corr[ss] = result; 
 | 
					    vbaryon_corr[ss] = result; 
 | 
				
			||||||
  }  );//end loop over lattice sites
 | 
					  }  );//end loop over lattice sites
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -213,24 +225,28 @@ template <class mobj, class robj>
 | 
				
			|||||||
void BaryonUtils<FImpl>::ContractBaryons_Sliced(const mobj &D1,
 | 
					void BaryonUtils<FImpl>::ContractBaryons_Sliced(const mobj &D1,
 | 
				
			||||||
						 const mobj &D2,
 | 
											 const mobj &D2,
 | 
				
			||||||
						 const mobj &D3,
 | 
											 const mobj &D3,
 | 
				
			||||||
						 const Gamma GammaA,
 | 
									                 const Gamma GammaA_left,
 | 
				
			||||||
						 const Gamma GammaB,
 | 
									                 const Gamma GammaB_left,
 | 
				
			||||||
						 const char * quarks_snk,
 | 
									                 const Gamma GammaA_right,
 | 
				
			||||||
						 const char * quarks_src,
 | 
							                 		 const Gamma GammaB_right,
 | 
				
			||||||
 | 
											 const char * quarks_left,
 | 
				
			||||||
 | 
											 const char * quarks_right,
 | 
				
			||||||
						 const int parity,
 | 
											 const int parity,
 | 
				
			||||||
						 robj &result)
 | 
											 robj &result)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  std::cout << "Contraction <" << quarks_snk[0] << quarks_snk[1] << quarks_snk[2] << "|" << quarks_src[0] << quarks_src[1] << quarks_src[2] << ">" << std::endl;
 | 
					  std::cout << "Contraction <" << quarks_right[0] << quarks_right[1] << quarks_right[2] << "|" << quarks_left[0] << quarks_left[1] << quarks_left[2] << ">" << std::endl;
 | 
				
			||||||
    std::cout << "GammaA " << (GammaA.g) <<  std::endl;
 | 
					    std::cout << "GammaA (left) " << (GammaA_left.g) <<  std::endl;
 | 
				
			||||||
    std::cout << "GammaB " << (GammaB.g) <<  std::endl;
 | 
					    std::cout << "GammaB (left) " << (GammaB_left.g) <<  std::endl;
 | 
				
			||||||
 | 
					    std::cout << "GammaA (right) " << (GammaA_right.g) <<  std::endl;
 | 
				
			||||||
 | 
					    std::cout << "GammaB (right) " << (GammaB_right.g) <<  std::endl;
 | 
				
			||||||
 
 | 
					 
 | 
				
			||||||
  assert(parity==1 || parity == -1 && "Parity must be +1 or -1");
 | 
					  assert(parity==1 || parity == -1 && "Parity must be +1 or -1");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  int wick_contraction[6];
 | 
					  int wick_contraction[6];
 | 
				
			||||||
  for (int ie=0; ie < 6 ; ie++)
 | 
					  for (int ie=0; ie < 6 ; ie++)
 | 
				
			||||||
    wick_contraction[ie] = (quarks_src[0] == quarks_snk[epsilon[ie][0]] && quarks_src[1] == quarks_snk[epsilon[ie][1]] && quarks_src[2] == quarks_snk[epsilon[ie][2]]) ? 1 : 0;
 | 
					    wick_contraction[ie] = (quarks_left[0] == quarks_right[epsilon[ie][0]] && quarks_left[1] == quarks_right[epsilon[ie][1]] && quarks_left[2] == quarks_right[epsilon[ie][2]]) ? 1 : 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
     result=Zero();
 | 
					     result=Zero();
 | 
				
			||||||
     baryon_site(D1,D2,D3,GammaA,GammaB,parity,wick_contraction,result);
 | 
					     baryon_site(D1,D2,D3,GammaA_left,GammaB_left,GammaA_right,GammaB_right,parity,wick_contraction,result);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
NAMESPACE_END(Grid);
 | 
					NAMESPACE_END(Grid);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -42,6 +42,9 @@ BEGIN_HADRONS_NAMESPACE
 | 
				
			|||||||
 ******************************************************************************/
 | 
					 ******************************************************************************/
 | 
				
			||||||
BEGIN_MODULE_NAMESPACE(MContraction)
 | 
					BEGIN_MODULE_NAMESPACE(MContraction)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					typedef std::pair<Gamma::Algebra, Gamma::Algebra> GammaAB;
 | 
				
			||||||
 | 
					typedef std::pair<GammaAB, GammaAB> GammaABPair;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class BaryonPar: Serializable
 | 
					class BaryonPar: Serializable
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
public:
 | 
					public:
 | 
				
			||||||
@@ -49,8 +52,7 @@ public:
 | 
				
			|||||||
                                    std::string, q1,
 | 
					                                    std::string, q1,
 | 
				
			||||||
                                    std::string, q2,
 | 
					                                    std::string, q2,
 | 
				
			||||||
                                    std::string, q3,
 | 
					                                    std::string, q3,
 | 
				
			||||||
                                    std::string, GammaA,
 | 
					                                    std::string, gammas,
 | 
				
			||||||
                                    std::string, GammaB,
 | 
					 | 
				
			||||||
                                    std::string, quarks,
 | 
					                                    std::string, quarks,
 | 
				
			||||||
                                    std::string, prefactors,
 | 
					                                    std::string, prefactors,
 | 
				
			||||||
                                    std::string, parity,
 | 
					                                    std::string, parity,
 | 
				
			||||||
@@ -71,8 +73,10 @@ public:
 | 
				
			|||||||
    {
 | 
					    {
 | 
				
			||||||
    public:
 | 
					    public:
 | 
				
			||||||
        GRID_SERIALIZABLE_CLASS_MEMBERS(Result,
 | 
					        GRID_SERIALIZABLE_CLASS_MEMBERS(Result,
 | 
				
			||||||
                                        Gamma::Algebra, gammaA,
 | 
					                                        Gamma::Algebra, gammaA_left,
 | 
				
			||||||
                                        Gamma::Algebra, gammaB,
 | 
					                                        Gamma::Algebra, gammaB_left,
 | 
				
			||||||
 | 
					                                        Gamma::Algebra, gammaA_right,
 | 
				
			||||||
 | 
					                                        Gamma::Algebra, gammaB_right,
 | 
				
			||||||
                                        std::string, quarks,
 | 
					                                        std::string, quarks,
 | 
				
			||||||
                                        std::string, prefactors,
 | 
					                                        std::string, prefactors,
 | 
				
			||||||
                                        int, parity,
 | 
					                                        int, parity,
 | 
				
			||||||
@@ -86,6 +90,7 @@ public:
 | 
				
			|||||||
    // dependency relation
 | 
					    // dependency relation
 | 
				
			||||||
    virtual std::vector<std::string> getInput(void);
 | 
					    virtual std::vector<std::string> getInput(void);
 | 
				
			||||||
    virtual std::vector<std::string> getOutput(void);
 | 
					    virtual std::vector<std::string> getOutput(void);
 | 
				
			||||||
 | 
					    virtual void parseGammaString(std::vector<GammaABPair> &gammaList);
 | 
				
			||||||
protected:
 | 
					protected:
 | 
				
			||||||
    // setup
 | 
					    // setup
 | 
				
			||||||
    virtual void setup(void);
 | 
					    virtual void setup(void);
 | 
				
			||||||
@@ -123,6 +128,33 @@ std::vector<std::string> TBaryon<FImpl1, FImpl2, FImpl3>::getOutput(void)
 | 
				
			|||||||
    return out;
 | 
					    return out;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					template <typename FImpl1, typename FImpl2, typename FImpl3>
 | 
				
			||||||
 | 
					void TBaryon<FImpl1, FImpl2,FImpl3>::parseGammaString(std::vector<GammaABPair> &gammaList)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    gammaList.clear();
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    std::string gammaString = par().gammas;
 | 
				
			||||||
 | 
					    //Shorthands for standard baryon operators
 | 
				
			||||||
 | 
					    gammaString = regex_replace(gammaString, std::regex("j12"),"Identity SigmaXZ");
 | 
				
			||||||
 | 
					    gammaString = regex_replace(gammaString, std::regex("j32X"),"Identity GammaZGamma5");
 | 
				
			||||||
 | 
					    gammaString = regex_replace(gammaString, std::regex("j32Y"),"Identity GammaT");
 | 
				
			||||||
 | 
					    gammaString = regex_replace(gammaString, std::regex("j32Z"),"Identity GammaXGamma5");
 | 
				
			||||||
 | 
					    //Shorthands for less common baryon operators
 | 
				
			||||||
 | 
					    gammaString = regex_replace(gammaString, std::regex("j12_alt1"),"Gamma5 SigmaYT");
 | 
				
			||||||
 | 
					    gammaString = regex_replace(gammaString, std::regex("j12_alt2"),"Identity GammaYGamma5");
 | 
				
			||||||
 | 
					  
 | 
				
			||||||
 | 
					    std::vector<GammaAB> gamma_help;
 | 
				
			||||||
 | 
					    gamma_help = strToVec<GammaAB>(gammaString);
 | 
				
			||||||
 | 
					    LOG(Message) << gamma_help.size() << " " << gamma_help.size()%2 << std::endl;
 | 
				
			||||||
 | 
					    assert(gamma_help.size()%2==0 && "need even number of gamma-pairs.");
 | 
				
			||||||
 | 
					    gammaList.resize(gamma_help.size()/2);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    for (int i = 0; i < gamma_help.size()/2; i++){
 | 
				
			||||||
 | 
					        gammaList[i].first=gamma_help[2*i];
 | 
				
			||||||
 | 
					        gammaList[i].second=gamma_help[2*i+1];
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// setup ///////////////////////////////////////////////////////////////////////
 | 
					// setup ///////////////////////////////////////////////////////////////////////
 | 
				
			||||||
template <typename FImpl1, typename FImpl2, typename FImpl3>
 | 
					template <typename FImpl1, typename FImpl2, typename FImpl3>
 | 
				
			||||||
void TBaryon<FImpl1, FImpl2, FImpl3>::setup(void)
 | 
					void TBaryon<FImpl1, FImpl2, FImpl3>::setup(void)
 | 
				
			||||||
@@ -141,6 +173,9 @@ void TBaryon<FImpl1, FImpl2, FImpl3>::execute(void)
 | 
				
			|||||||
    int nQ=quarks.size();
 | 
					    int nQ=quarks.size();
 | 
				
			||||||
    const int  parity {par().parity.size()>0 ? std::stoi(par().parity) : 1};
 | 
					    const int  parity {par().parity.size()>0 ? std::stoi(par().parity) : 1};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    std::vector<GammaABPair> gammaList;
 | 
				
			||||||
 | 
					    parseGammaString(gammaList);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    assert(prefactors.size()==nQ && "number of prefactors needs to match number of quark-structures.");
 | 
					    assert(prefactors.size()==nQ && "number of prefactors needs to match number of quark-structures.");
 | 
				
			||||||
    for (int iQ = 0; iQ < nQ; iQ++)
 | 
					    for (int iQ = 0; iQ < nQ; iQ++)
 | 
				
			||||||
        assert(quarks[iQ].size()==3 && "quark-structures must consist of 3 quarks each.");
 | 
					        assert(quarks[iQ].size()==3 && "quark-structures must consist of 3 quarks each.");
 | 
				
			||||||
@@ -149,29 +184,31 @@ void TBaryon<FImpl1, FImpl2, FImpl3>::execute(void)
 | 
				
			|||||||
    for (int iQ1 = 0; iQ1 < nQ; iQ1++)
 | 
					    for (int iQ1 = 0; iQ1 < nQ; iQ1++)
 | 
				
			||||||
        for (int iQ2 = 0; iQ2 < nQ; iQ2++)
 | 
					        for (int iQ2 = 0; iQ2 < nQ; iQ2++)
 | 
				
			||||||
            LOG(Message) << prefactors[iQ1]*prefactors[iQ2] << "*<" << quarks[iQ1] << "|" << quarks[iQ2] << ">" << std::endl;
 | 
					            LOG(Message) << prefactors[iQ1]*prefactors[iQ2] << "*<" << quarks[iQ1] << "|" << quarks[iQ2] << ">" << std::endl;
 | 
				
			||||||
    LOG(Message) << " using quarks " << par().q1 << "', " << par().q2 << "', and '"
 | 
					    LOG(Message) << " using quarks " << par().q1 << "', " << par().q2 << "', and '" << par().q3 << std::endl;
 | 
				
			||||||
                 << par().q3 << "' and (Gamma^A,Gamma^B) = ( " << par().GammaA << " , " << par().GammaB 
 | 
					     for (int iG = 0; iG < gammaList.size(); iG++)
 | 
				
			||||||
                 << " ) and parity " << parity << " using sink " << par().sink << "." << std::endl;
 | 
					         LOG(Message) << "' with (Gamma^A,Gamma^B)_left = ( " << gammaList[iG].first.first << " , " << gammaList[iG].first.second << "') and (Gamma^A,Gamma^B)_right = ( " << gammaList[iG].second.first << " , " << gammaList[iG].second.second << ")" << std::endl; 
 | 
				
			||||||
 | 
					      LOG(Message) << "and parity " << parity << " using sink " << par().sink << "." << std::endl;
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
    
 | 
					 | 
				
			||||||
    envGetTmp(LatticeComplex, c);
 | 
					    envGetTmp(LatticeComplex, c);
 | 
				
			||||||
    envGetTmp(LatticeComplex, c2);
 | 
					    envGetTmp(LatticeComplex, c2);
 | 
				
			||||||
    int nt = env().getDim(Tp);
 | 
					    int nt = env().getDim(Tp);
 | 
				
			||||||
    std::vector<Gamma::Algebra> ggA = strToVec<Gamma::Algebra>(par().GammaA);
 | 
					 | 
				
			||||||
    Gamma GammaA(ggA[0]);
 | 
					 | 
				
			||||||
    std::vector<Gamma::Algebra> ggB = strToVec<Gamma::Algebra>(par().GammaB);
 | 
					 | 
				
			||||||
    Gamma GammaB(ggB[0]);
 | 
					 | 
				
			||||||
    std::vector<TComplex> buf;
 | 
					    std::vector<TComplex> buf;
 | 
				
			||||||
    TComplex cs;
 | 
					    TComplex cs;
 | 
				
			||||||
    TComplex ch;
 | 
					    TComplex ch;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Result     result;
 | 
					    std::vector<Result>    result;
 | 
				
			||||||
    result.corr.resize(nt);
 | 
					    result.resize(gammaList.size());
 | 
				
			||||||
    result.gammaA = ggA[0];
 | 
					    for (unsigned int i = 0; i < result.size(); ++i)
 | 
				
			||||||
    result.gammaB = ggB[0];
 | 
					    {
 | 
				
			||||||
    result.parity = parity;
 | 
					        result[i].gammaA_left = gammaList[i].first.first;
 | 
				
			||||||
    result.quarks = par().quarks;
 | 
					        result[i].gammaA_left = gammaList[i].first.first;
 | 
				
			||||||
    result.prefactors = par().prefactors;
 | 
					        result[i].gammaB_right = gammaList[i].second.second;
 | 
				
			||||||
 | 
					        result[i].gammaB_right = gammaList[i].second.second;
 | 
				
			||||||
 | 
					        result[i].corr.resize(nt);
 | 
				
			||||||
 | 
					        result[i].parity = parity;
 | 
				
			||||||
 | 
					        result[i].quarks = par().quarks;
 | 
				
			||||||
 | 
					        result[i].prefactors = par().prefactors;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (envHasType(SlicedPropagator1, par().q1) and
 | 
					    if (envHasType(SlicedPropagator1, par().q1) and
 | 
				
			||||||
        envHasType(SlicedPropagator2, par().q2) and
 | 
					        envHasType(SlicedPropagator2, par().q2) and
 | 
				
			||||||
@@ -180,56 +217,71 @@ void TBaryon<FImpl1, FImpl2, FImpl3>::execute(void)
 | 
				
			|||||||
        auto &q1 = envGet(SlicedPropagator1, par().q1);
 | 
					        auto &q1 = envGet(SlicedPropagator1, par().q1);
 | 
				
			||||||
        auto &q2 = envGet(SlicedPropagator2, par().q2);
 | 
					        auto &q2 = envGet(SlicedPropagator2, par().q2);
 | 
				
			||||||
        auto &q3 = envGet(SlicedPropagator3, par().q3);
 | 
					        auto &q3 = envGet(SlicedPropagator3, par().q3);
 | 
				
			||||||
        
 | 
					        for (unsigned int i = 0; i < result.size(); ++i)
 | 
				
			||||||
        LOG(Message) << "(propagator already sinked)" << std::endl;
 | 
					 | 
				
			||||||
        for (unsigned int t = 0; t < buf.size(); ++t)
 | 
					 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            cs = Zero();
 | 
					            Gamma gAl(gammaList[i].first.first);
 | 
				
			||||||
            for (int iQ1 = 0; iQ1 < nQ; iQ1++){
 | 
					            Gamma gBl(gammaList[i].first.second);
 | 
				
			||||||
                for (int iQ2 = 0; iQ2 < nQ; iQ2++){
 | 
					            Gamma gAr(gammaList[i].second.first);
 | 
				
			||||||
                    BaryonUtils<FIMPL>::ContractBaryons_Sliced(q1[t],q2[t],q3[t],GammaA,GammaB,quarks[iQ1].c_str(),quarks[iQ2].c_str(),parity,ch);
 | 
					            Gamma gBr(gammaList[i].second.second);
 | 
				
			||||||
                    cs += prefactors[iQ1]*prefactors[iQ2]*ch;
 | 
					        
 | 
				
			||||||
 | 
					            LOG(Message) << "(propagator already sinked)" << std::endl;
 | 
				
			||||||
 | 
					            for (unsigned int t = 0; t < buf.size(); ++t)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                cs = Zero();
 | 
				
			||||||
 | 
					                for (int iQ1 = 0; iQ1 < nQ; iQ1++){
 | 
				
			||||||
 | 
					                    for (int iQ2 = 0; iQ2 < nQ; iQ2++){
 | 
				
			||||||
 | 
					                        BaryonUtils<FIMPL>::ContractBaryons_Sliced(q1[t],q2[t],q3[t],gAl,gBl,gAr,gBr,quarks[iQ1].c_str(),quarks[iQ2].c_str(),parity,ch);
 | 
				
			||||||
 | 
					                        cs += prefactors[iQ1]*prefactors[iQ2]*ch;
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
 | 
					                result[i].corr[t] = TensorRemove(cs);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            result.corr[t] = TensorRemove(cs);
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    else
 | 
					    else
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
       auto       &q1 = envGet(PropagatorField1, par().q1);
 | 
					        auto       &q1 = envGet(PropagatorField1, par().q1);
 | 
				
			||||||
       auto       &q2 = envGet(PropagatorField2, par().q2);
 | 
					        auto       &q2 = envGet(PropagatorField2, par().q2);
 | 
				
			||||||
       auto       &q3 = envGet(PropagatorField3, par().q3);
 | 
					        auto       &q3 = envGet(PropagatorField3, par().q3);
 | 
				
			||||||
        std::string ns;
 | 
					        for (unsigned int i = 0; i < result.size(); ++i)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            Gamma gAl(gammaList[i].first.first);
 | 
				
			||||||
 | 
					            Gamma gBl(gammaList[i].first.second);
 | 
				
			||||||
 | 
					            Gamma gAr(gammaList[i].second.first);
 | 
				
			||||||
 | 
					            Gamma gBr(gammaList[i].second.second);
 | 
				
			||||||
 | 
					        
 | 
				
			||||||
 | 
					            std::string ns;
 | 
				
			||||||
                
 | 
					                
 | 
				
			||||||
        ns = vm().getModuleNamespace(env().getObjectModule(par().sink));
 | 
					            ns = vm().getModuleNamespace(env().getObjectModule(par().sink));
 | 
				
			||||||
        if (ns == "MSource")
 | 
					            if (ns == "MSource")
 | 
				
			||||||
        {
 | 
					            {
 | 
				
			||||||
            c=Zero();
 | 
					                c=Zero();
 | 
				
			||||||
            for (int iQ1 = 0; iQ1 < nQ; iQ1++){
 | 
					                for (int iQ1 = 0; iQ1 < nQ; iQ1++){
 | 
				
			||||||
                for (int iQ2 = 0; iQ2 < nQ; iQ2++){
 | 
					                    for (int iQ2 = 0; iQ2 < nQ; iQ2++){
 | 
				
			||||||
                    BaryonUtils<FIMPL>::ContractBaryons(q1,q2,q3,GammaA,GammaB,quarks[iQ1].c_str(),quarks[iQ2].c_str(),parity,c2);
 | 
					                        BaryonUtils<FIMPL>::ContractBaryons(q1,q2,q3,gAl,gBl,gAr,gBr,quarks[iQ1].c_str(),quarks[iQ2].c_str(),parity,c2);
 | 
				
			||||||
                    c+=prefactors[iQ1]*prefactors[iQ2]*c2;
 | 
					                        c+=prefactors[iQ1]*prefactors[iQ2]*c2;
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
 | 
					                PropagatorField1 &sink = envGet(PropagatorField1, par().sink);
 | 
				
			||||||
 | 
					                auto test = closure(trace(sink*c));     
 | 
				
			||||||
 | 
					                sliceSum(test, buf, Tp); 
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            PropagatorField1 &sink = envGet(PropagatorField1, par().sink);
 | 
					            else if (ns == "MSink")
 | 
				
			||||||
            auto test = closure(trace(sink*c));     
 | 
					            {
 | 
				
			||||||
            sliceSum(test, buf, Tp); 
 | 
					                c=Zero();
 | 
				
			||||||
        }
 | 
					                for (int iQ1 = 0; iQ1 < nQ; iQ1++){
 | 
				
			||||||
        else if (ns == "MSink")
 | 
					                    for (int iQ2 = 0; iQ2 < nQ; iQ2++){
 | 
				
			||||||
        {
 | 
					                        BaryonUtils<FIMPL>::ContractBaryons(q1,q2,q3,gAl,gBl,gAr,gBr,quarks[iQ1].c_str(),quarks[iQ2].c_str(),parity,c2);
 | 
				
			||||||
            c=Zero();
 | 
					                        c+=prefactors[iQ1]*prefactors[iQ2]*c2;
 | 
				
			||||||
            for (int iQ1 = 0; iQ1 < nQ; iQ1++){
 | 
					                    }
 | 
				
			||||||
                for (int iQ2 = 0; iQ2 < nQ; iQ2++){
 | 
					 | 
				
			||||||
                    BaryonUtils<FIMPL>::ContractBaryons(q1,q2,q3,GammaA,GammaB,quarks[iQ1].c_str(),quarks[iQ2].c_str(),parity,c2);
 | 
					 | 
				
			||||||
                    c+=prefactors[iQ1]*prefactors[iQ2]*c2;
 | 
					 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
 | 
					                SinkFnScalar &sink = envGet(SinkFnScalar, par().sink);
 | 
				
			||||||
 | 
					                buf = sink(c);
 | 
				
			||||||
 | 
					            } 
 | 
				
			||||||
 | 
					            for (unsigned int t = 0; t < buf.size(); ++t)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                result[i].corr[t] = TensorRemove(buf[t]);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            SinkFnScalar &sink = envGet(SinkFnScalar, par().sink);
 | 
					 | 
				
			||||||
            buf = sink(c);
 | 
					 | 
				
			||||||
        } 
 | 
					 | 
				
			||||||
        for (unsigned int t = 0; t < buf.size(); ++t)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            result.corr[t] = TensorRemove(buf[t]);
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -135,8 +135,7 @@ int main(int argc, char *argv[])
 | 
				
			|||||||
        barPar.q1     = "Qpt_" + flavour[i];
 | 
					        barPar.q1     = "Qpt_" + flavour[i];
 | 
				
			||||||
        barPar.q2     = "Qpt_" + flavour[j];
 | 
					        barPar.q2     = "Qpt_" + flavour[j];
 | 
				
			||||||
        barPar.q3     = "Qpt_" + flavour[k];
 | 
					        barPar.q3     = "Qpt_" + flavour[k];
 | 
				
			||||||
        barPar.GammaA     = "Identity";
 | 
					        barPar.gammas     = "(j12) (j12) (j32X) (j32Y)";
 | 
				
			||||||
        barPar.GammaB     = "GammaZGamma5"; //C*GammaX
 | 
					 | 
				
			||||||
        barPar.quarks     = flavour_baryon[i] + flavour_baryon[j] + flavour_baryon[k];
 | 
					        barPar.quarks     = flavour_baryon[i] + flavour_baryon[j] + flavour_baryon[k];
 | 
				
			||||||
        barPar.prefactors     = "1.0";
 | 
					        barPar.prefactors     = "1.0";
 | 
				
			||||||
        barPar.sink    = "sink";
 | 
					        barPar.sink    = "sink";
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -479,51 +479,49 @@ void calc_grid(Grid::LatticeGaugeField &Umu, Grid::LatticePropagator &qU, Grid::
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  Grid::GridCartesian *UGrid = (Grid::GridCartesian *)Umu.Grid();
 | 
					  Grid::GridCartesian *UGrid = (Grid::GridCartesian *)Umu.Grid();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  
 | 
					 | 
				
			||||||
  Grid::Gamma G_A = Grid::Gamma(Grid::Gamma::Algebra::Identity);
 | 
					  Grid::Gamma G_A = Grid::Gamma(Grid::Gamma::Algebra::Identity);
 | 
				
			||||||
  Grid::Gamma G_B = Grid::Gamma(Grid::Gamma::Algebra::GammaZGamma5); // OmegaX: C*GammaX = i* GammaZ*Gamma5
 | 
					  Grid::Gamma G_B = Grid::Gamma(Grid::Gamma::Algebra::GammaZGamma5); // OmegaX: C*GammaX = i* GammaZ*Gamma5
 | 
				
			||||||
  char quarks[] = "sss";
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
  Grid::LatticeComplex c(UGrid);
 | 
					  Grid::LatticeComplex c(UGrid);
 | 
				
			||||||
  Grid::LatticeComplex c1(UGrid);
 | 
					  Grid::LatticeComplex c1(UGrid);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if(! baryon.compare("OmegaX")){
 | 
					  if(! baryon.compare("OmegaX")){
 | 
				
			||||||
    BaryonUtils<Grid::WilsonImplR>::ContractBaryons(qS,qS,qS,G_A,G_B,quarks,quarks,1,c);  
 | 
					    BaryonUtils<Grid::WilsonImplR>::ContractBaryons(qS,qS,qS,G_A,G_B,G_A,G_B,"sss","sss",1,c);  
 | 
				
			||||||
    c*=0.5;
 | 
					    c*=0.5;
 | 
				
			||||||
    std::cout << "Grid-Omega factor 2 larger than Chroma-Omega!!!" << std::endl; 
 | 
					    std::cout << "Grid-Omega factor 2 larger than Chroma-Omega!!!" << std::endl; 
 | 
				
			||||||
  } else if (! baryon.compare("OmegaY")){
 | 
					  } else if (! baryon.compare("OmegaY")){
 | 
				
			||||||
    G_B = Grid::Gamma(Grid::Gamma::Algebra::GammaT);
 | 
					    G_B = Grid::Gamma(Grid::Gamma::Algebra::GammaT);
 | 
				
			||||||
    BaryonUtils<Grid::WilsonImplR>::ContractBaryons(qS,qS,qS,G_A,G_B,quarks,quarks,1,c);  
 | 
					    BaryonUtils<Grid::WilsonImplR>::ContractBaryons(qS,qS,qS,G_A,G_B,G_A,G_B,"sss","sss",1,c);  
 | 
				
			||||||
    c*=0.5;
 | 
					    c*=0.5;
 | 
				
			||||||
    std::cout << "Grid-Omega factor 2 larger than Chroma-Omega!!!" << std::endl; 
 | 
					    std::cout << "Grid-Omega factor 2 larger than Chroma-Omega!!!" << std::endl; 
 | 
				
			||||||
  } else if (! baryon.compare("OmegaZ")){
 | 
					  } else if (! baryon.compare("OmegaZ")){
 | 
				
			||||||
    G_B = Grid::Gamma(Grid::Gamma::Algebra::GammaXGamma5);
 | 
					    G_B = Grid::Gamma(Grid::Gamma::Algebra::GammaXGamma5);
 | 
				
			||||||
    BaryonUtils<Grid::WilsonImplR>::ContractBaryons(qS,qS,qS,G_A,G_B,quarks,quarks,1,c);  
 | 
					    BaryonUtils<Grid::WilsonImplR>::ContractBaryons(qS,qS,qS,G_A,G_B,G_A,G_B,"sss","sss",1,c);  
 | 
				
			||||||
    c*=0.5;
 | 
					    c*=0.5;
 | 
				
			||||||
    std::cout << "Grid-Omega factor 2 larger than Chroma-Omega!!!" << std::endl; 
 | 
					    std::cout << "Grid-Omega factor 2 larger than Chroma-Omega!!!" << std::endl; 
 | 
				
			||||||
  } else if (! baryon.compare("Proton")){
 | 
					  } else if (! baryon.compare("Proton")){
 | 
				
			||||||
    G_B = Grid::Gamma(Grid::Gamma::Algebra::SigmaXZ);
 | 
					    G_B = Grid::Gamma(Grid::Gamma::Algebra::SigmaXZ);
 | 
				
			||||||
    BaryonUtils<Grid::WilsonImplR>::ContractBaryons(qU,qD,qU,G_A,G_B,"udu","udu",1,c); 
 | 
					    BaryonUtils<Grid::WilsonImplR>::ContractBaryons(qU,qD,qU,G_A,G_B,G_A,G_B,"udu","udu",1,c); 
 | 
				
			||||||
    std::cout << "UKHadron-Proton has flipped diquarks in original code." << std::endl; 
 | 
					    std::cout << "UKHadron-Proton has flipped diquarks in original code." << std::endl; 
 | 
				
			||||||
  } else if (! baryon.compare("Lambda")){
 | 
					  } else if (! baryon.compare("Lambda")){
 | 
				
			||||||
    G_B = Grid::Gamma(Grid::Gamma::Algebra::SigmaXZ);
 | 
					    G_B = Grid::Gamma(Grid::Gamma::Algebra::SigmaXZ);
 | 
				
			||||||
    BaryonUtils<Grid::WilsonImplR>::ContractBaryons(qS,qU,qD,G_A,G_B,"sud","sud",1,c1); //<ud>s 
 | 
					    BaryonUtils<Grid::WilsonImplR>::ContractBaryons(qS,qU,qD,G_A,G_B,G_A,G_B,"sud","sud",1,c1); //<ud>s 
 | 
				
			||||||
    c = 4.*c1; 
 | 
					    c = 4.*c1; 
 | 
				
			||||||
    BaryonUtils<Grid::WilsonImplR>::ContractBaryons(qD,qU,qS,G_A,G_B,"dus","dus",1,c1); //<us>d 
 | 
					    BaryonUtils<Grid::WilsonImplR>::ContractBaryons(qD,qU,qS,G_A,G_B,G_A,G_B,"dus","dus",1,c1); //<us>d 
 | 
				
			||||||
    c += c1; 
 | 
					    c += c1; 
 | 
				
			||||||
    BaryonUtils<Grid::WilsonImplR>::ContractBaryons(qU,qD,qS,G_A,G_B,"uds","uds",1,c1); //<ds>u  
 | 
					    BaryonUtils<Grid::WilsonImplR>::ContractBaryons(qU,qD,qS,G_A,G_B,G_A,G_B,"uds","uds",1,c1); //<ds>u  
 | 
				
			||||||
    c += c1; 
 | 
					    c += c1; 
 | 
				
			||||||
    BaryonUtils<Grid::WilsonImplR>::ContractBaryons(qD,qU,qS,G_A,G_B,"sud","dus",1,c1); //(sud) 
 | 
					    BaryonUtils<Grid::WilsonImplR>::ContractBaryons(qD,qU,qS,G_A,G_B,G_A,G_B,"dus","sud",1,c1); //(sud) 
 | 
				
			||||||
    c += 2.*c1; 
 | 
					    c += 2.*c1; 
 | 
				
			||||||
    BaryonUtils<Grid::WilsonImplR>::ContractBaryons(qU,qD,qS,G_A,G_B,"sud","uds",1,c1); //(sdu) 
 | 
					    BaryonUtils<Grid::WilsonImplR>::ContractBaryons(qU,qD,qS,G_A,G_B,G_A,G_B,"uds","sud",1,c1); //(sdu) 
 | 
				
			||||||
    c -= 2.*c1; 
 | 
					    c -= 2.*c1; 
 | 
				
			||||||
    BaryonUtils<Grid::WilsonImplR>::ContractBaryons(qS,qU,qD,G_A,G_B,"dus","sud",1,c1); //(dus) 
 | 
					    BaryonUtils<Grid::WilsonImplR>::ContractBaryons(qS,qU,qD,G_A,G_B,G_A,G_B,"sud","dus",1,c1); //(dus) 
 | 
				
			||||||
    c += 2.*c1; 
 | 
					    c += 2.*c1; 
 | 
				
			||||||
    BaryonUtils<Grid::WilsonImplR>::ContractBaryons(qU,qD,qS,G_A,G_B,"dus","uds",1,c1); //-(dsu) 
 | 
					    BaryonUtils<Grid::WilsonImplR>::ContractBaryons(qU,qD,qS,G_A,G_B,G_A,G_B,"uds","dus",1,c1); //-(dsu) 
 | 
				
			||||||
    c -= c1; 
 | 
					    c -= c1; 
 | 
				
			||||||
    BaryonUtils<Grid::WilsonImplR>::ContractBaryons(qS,qU,qD,G_A,G_B,"uds","sud",1,c1); //(uds) 
 | 
					    BaryonUtils<Grid::WilsonImplR>::ContractBaryons(qS,qU,qD,G_A,G_B,G_A,G_B,"sud","uds",1,c1); //(uds) 
 | 
				
			||||||
    c -= 2.*c1; 
 | 
					    c -= 2.*c1; 
 | 
				
			||||||
    BaryonUtils<Grid::WilsonImplR>::ContractBaryons(qD,qU,qS,G_A,G_B,"uds","dus",1,c1); //-(usd) 
 | 
					    BaryonUtils<Grid::WilsonImplR>::ContractBaryons(qD,qU,qS,G_A,G_B,G_A,G_B,"dus","uds",1,c1); //-(usd) 
 | 
				
			||||||
    c -= c1; 
 | 
					    c -= c1; 
 | 
				
			||||||
    std::cout << "UKHadron-Lambda has flipped diquarks in original code." << std::endl; 
 | 
					    std::cout << "UKHadron-Lambda has flipped diquarks in original code." << std::endl; 
 | 
				
			||||||
  } else {
 | 
					  } else {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user