diff --git a/Grid/qcd/utils/A2Autils.h b/Grid/qcd/utils/A2Autils.h index bfe03bc0..9e2bd7e2 100644 --- a/Grid/qcd/utils/A2Autils.h +++ b/Grid/qcd/utils/A2Autils.h @@ -186,7 +186,7 @@ void A2Autils::NucleonFieldMom(Eigen::Tensor &mat, auto v2 = conjugate(two[j]._odata[ss]); // C = i gamma_2 gamma_4 => C gamma_5 = - i gamma_1 gamma_3 //auto v2g = v2*Gamma(Gamma::Algebra::SigmaXZ); - auto v2g=v2; + //auto v2g=v2; for(int k=0;k::NucleonFieldMom(Eigen::Tensor &mat, } } - grid->GlobalSumVector(&mat(0,0,0,0,0,0),Nmom*Nt*oneBlock*twoBlock*threeBlock); + grid->GlobalSumVector(&mat(0,0,0,0,0,0),Nmom*Nt*oneBlock*twoBlock*threeBlock*4); } diff --git a/Hadrons/Distil.hpp b/Hadrons/Distil.hpp index b420c725..5a5a4a23 100644 --- a/Hadrons/Distil.hpp +++ b/Hadrons/Distil.hpp @@ -250,7 +250,7 @@ const int Nt_inv{ full_tdil ? 1 : TI } class BFieldIO: Serializable{ public: - using BaryonTensorSet = Eigen::Tensor; + using BaryonTensorSet = Eigen::Tensor; GRID_SERIALIZABLE_CLASS_MEMBERS(BFieldIO, BaryonTensorSet, BField ); }; diff --git a/Hadrons/Modules/MDistil/BC2.hpp b/Hadrons/Modules/MDistil/BC2.hpp index 14ade917..5c3433cc 100644 --- a/Hadrons/Modules/MDistil/BC2.hpp +++ b/Hadrons/Modules/MDistil/BC2.hpp @@ -158,6 +158,7 @@ void TBC2::execute(void) auto &one = envGet(std::vector, par().one); auto &two = envGet(std::vector, par().two); auto &three = envGet(std::vector, par().three); + const std::string &output{par().output}; int N_1 = one.size(); int N_2 = two.size(); @@ -172,8 +173,8 @@ void TBC2::execute(void) } - int Nmom=1; - int Nt=8; + int Nmom = mom_.size(); + const int Nt{env().getDim(Tdir)}; int parity = 1; int orthogDim=3; @@ -199,17 +200,29 @@ void TBC2::execute(void) } hasPhase_ = true; stopTimer("Momentum phases"); -} + } envCache(std::vector, momphName_, 1, mom_.size(), envGetGrid(ComplexField)); Eigen::Tensor m(Nmom,Nt,N_1,N_2,N_3,4); A2Autils::NucleonFieldMom(m, &one[0], &two[0], &three[0], ph, parity, orthogDim); + //A2Autils::NucleonFieldMom(m, one, two, three, ph, parity, orthogDim); for (int is=0 ; is < 4 ; is++){ for (int t=0 ; t < Nt ; t++){ - std::cout << "BaryonField(is=" << is << ",t=" << t << ") = " << m(0,t,is,0,0,0) << std::endl; + std::cout << "BaryonField(is=" << is << ",t=" << t << ") = " << m(0,t,0,0,0,is) << std::endl; } } + BFieldIO BField_save; + BField_save.BField = m; + + + GridCartesian * grid = env().getGrid(); + if(grid->IsBoss()) { + std::string filename ="./" + output + ".h5"; + std::cout << "Writing to file " << filename << std::endl; + Grid::Hdf5Writer writer(filename); + write(writer,"BaryonField",BField_save.BField); + } } END_MODULE_NAMESPACE diff --git a/Hadrons/Modules/MDistil/Baryon2pt.hpp b/Hadrons/Modules/MDistil/Baryon2pt.hpp index 4964c6db..02ac892a 100644 --- a/Hadrons/Modules/MDistil/Baryon2pt.hpp +++ b/Hadrons/Modules/MDistil/Baryon2pt.hpp @@ -144,7 +144,7 @@ void TBaryon2pt::execute(void) // using BaryonTensorSet = Eigen::Tensor; BFieldIO BFieldL; - BFieldL.BField.resize(Nmom,Ngamma,Nt,4,N_1,N_2,N_3); + BFieldL.BField.resize(Nmom,Nt,N_1,N_2,N_3,4); std::string filenameL ="./" + inputL + ".h5"; std::cout << "Reading from file " << filenameL << std::endl; @@ -152,7 +152,7 @@ void TBaryon2pt::execute(void) read(readerL,"BaryonField",BFieldL.BField); BFieldIO BFieldR; - BFieldR.BField.resize(Nmom,Ngamma,Nt,4,N_1,N_2,N_3); + BFieldR.BField.resize(Nmom,Nt,N_1,N_2,N_3,4); std::string filenameR ="./" + inputR + ".h5"; std::cout << "Reading from file " << filenameR << std::endl;