mirror of
https://github.com/paboyle/Grid.git
synced 2025-04-09 21:50:45 +01:00
fixed contraction issue
This commit is contained in:
parent
acd5a01b65
commit
435653490e
@ -183,7 +183,8 @@ void A2Autils<FImpl>::NucleonFieldMom(Eigen::Tensor<ComplexD,6> &mat,
|
|||||||
|
|
||||||
for(int j=0;j<twoBlock;j++){
|
for(int j=0;j<twoBlock;j++){
|
||||||
|
|
||||||
auto v2 = conjugate(two[j]._odata[ss]);
|
//auto v2 = conjugate(two[j]._odata[ss]);
|
||||||
|
auto v2 = two[j]._odata[ss];
|
||||||
// C = i gamma_2 gamma_4 => C gamma_5 = - i gamma_1 gamma_3
|
// C = i gamma_2 gamma_4 => C gamma_5 = - i gamma_1 gamma_3
|
||||||
//auto v2g = v2*Gamma(Gamma::Algebra::SigmaXZ);
|
//auto v2g = v2*Gamma(Gamma::Algebra::SigmaXZ);
|
||||||
//auto v2g=v2;
|
//auto v2g=v2;
|
||||||
@ -209,6 +210,13 @@ void A2Autils<FImpl>::NucleonFieldMom(Eigen::Tensor<ComplexD,6> &mat,
|
|||||||
+ pv1()(s1)(2) * v2()(s2)(0) * gv3()(s2)(1)
|
+ pv1()(s1)(2) * v2()(s2)(0) * gv3()(s2)(1)
|
||||||
- pv1()(s1)(2) * v2()(s2)(1) * gv3()(s2)(0);
|
- pv1()(s1)(2) * v2()(s2)(1) * gv3()(s2)(0);
|
||||||
}}
|
}}
|
||||||
|
|
||||||
|
/*if (i+j+k == 0) {
|
||||||
|
Serializable::WriteMember(std::cout, pv1);
|
||||||
|
Serializable::WriteMember(std::cout, v2);
|
||||||
|
Serializable::WriteMember(std::cout, gv3);
|
||||||
|
Serializable::WriteMember(std::cout, vv);
|
||||||
|
}*/
|
||||||
|
|
||||||
// After getting the sitewise product do the mom phase loop
|
// After getting the sitewise product do the mom phase loop
|
||||||
int base = Nmom*i+Nmom*oneBlock*j+Nmom*oneBlock*twoBlock*k+Nmom*oneBlock*twoBlock*threeBlock*r;
|
int base = Nmom*i+Nmom*oneBlock*j+Nmom*oneBlock*twoBlock*k+Nmom*oneBlock*twoBlock*threeBlock*r;
|
||||||
|
@ -186,20 +186,16 @@ void TBaryon2pt<FImpl>::execute(void)
|
|||||||
Eigen::array<Eigen::IndexPair<int>, 3> product_dims = { Eigen::IndexPair<int>(0,epsilon[pairs[ipair]][0]),Eigen::IndexPair<int>(1,epsilon[pairs[ipair]][1]) ,Eigen::IndexPair<int>(2,epsilon[pairs[ipair]][2]) };
|
Eigen::array<Eigen::IndexPair<int>, 3> product_dims = { Eigen::IndexPair<int>(0,epsilon[pairs[ipair]][0]),Eigen::IndexPair<int>(1,epsilon[pairs[ipair]][1]) ,Eigen::IndexPair<int>(2,epsilon[pairs[ipair]][2]) };
|
||||||
for (int imom=0 ; imom < Nmom ; imom++){
|
for (int imom=0 ; imom < Nmom ; imom++){
|
||||||
std::cout << imom << std::endl;
|
std::cout << imom << std::endl;
|
||||||
Eigen::Tensor<Complex,6> B6L = BFieldL.BField.chip(imom,0);
|
Eigen::Tensor<Complex,5> B5L = BFieldL.BField.chip(imom,0);
|
||||||
Eigen::Tensor<Complex,6> B6R = BFieldR.BField.chip(imom,0);
|
Eigen::Tensor<Complex,5> B5R = BFieldR.BField.chip(imom,0);
|
||||||
for (int ig=0 ; ig < Ngamma ; ig++){
|
for (int t=0 ; t < Nt ; t++){
|
||||||
Eigen::Tensor<Complex,5> B5L = B6L.chip(ig,0);
|
Eigen::Tensor<Complex,4> B4L = B5L.chip(t,0);
|
||||||
Eigen::Tensor<Complex,5> B5R = B6R.chip(ig,0);
|
Eigen::Tensor<Complex,4> B4R = B5R.chip(tsrc,0);
|
||||||
for (int t=0 ; t < Nt ; t++){
|
for (int is=0 ; is < 4 ; is++){
|
||||||
Eigen::Tensor<Complex,4> B4L = B5L.chip(t,0);
|
Eigen::Tensor<Complex,3> B3L = B4L.chip(is,0);
|
||||||
Eigen::Tensor<Complex,4> B4R = B5R.chip(tsrc,0);
|
Eigen::Tensor<Complex,3> B3R = B4R.chip(is,0);
|
||||||
for (int is=0 ; is < 4 ; is++){
|
Eigen::Tensor<Complex,0> C2 = B3L.contract(B3R,product_dims);
|
||||||
Eigen::Tensor<Complex,3> B3L = B4L.chip(is,0);
|
corr(imom,t) += static_cast<Real>(epsilon_sgn[pairs[ipair]])*C2(0);
|
||||||
Eigen::Tensor<Complex,3> B3R = B4R.chip(is,0);
|
|
||||||
Eigen::Tensor<Complex,0> C2 = B3L.contract(B3R,product_dims);
|
|
||||||
corr(imom,t) += static_cast<Real>(epsilon_sgn[pairs[ipair]])*C2(0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user