1
0
mirror of https://github.com/paboyle/Grid.git synced 2025-04-10 06:00:45 +01:00

some work on baryons

This commit is contained in:
Felix Erben 2019-05-16 15:11:50 +01:00
parent ec7d96ce3b
commit acd5a01b65
4 changed files with 22 additions and 9 deletions

View File

@ -186,7 +186,7 @@ void A2Autils<FImpl>::NucleonFieldMom(Eigen::Tensor<ComplexD,6> &mat,
auto v2 = conjugate(two[j]._odata[ss]); auto v2 = conjugate(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;
for(int k=0;k<threeBlock;k++){ for(int k=0;k<threeBlock;k++){
@ -295,7 +295,7 @@ void A2Autils<FImpl>::NucleonFieldMom(Eigen::Tensor<ComplexD,6> &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);
} }

View File

@ -250,7 +250,7 @@ const int Nt_inv{ full_tdil ? 1 : TI }
class BFieldIO: Serializable{ class BFieldIO: Serializable{
public: public:
using BaryonTensorSet = Eigen::Tensor<Complex, 7>; using BaryonTensorSet = Eigen::Tensor<ComplexD, 6>;
GRID_SERIALIZABLE_CLASS_MEMBERS(BFieldIO, BaryonTensorSet, BField ); GRID_SERIALIZABLE_CLASS_MEMBERS(BFieldIO, BaryonTensorSet, BField );
}; };

View File

@ -158,6 +158,7 @@ void TBC2<FImpl>::execute(void)
auto &one = envGet(std::vector<FermionField>, par().one); auto &one = envGet(std::vector<FermionField>, par().one);
auto &two = envGet(std::vector<FermionField>, par().two); auto &two = envGet(std::vector<FermionField>, par().two);
auto &three = envGet(std::vector<FermionField>, par().three); auto &three = envGet(std::vector<FermionField>, par().three);
const std::string &output{par().output};
int N_1 = one.size(); int N_1 = one.size();
int N_2 = two.size(); int N_2 = two.size();
@ -172,8 +173,8 @@ void TBC2<FImpl>::execute(void)
} }
int Nmom=1; int Nmom = mom_.size();
int Nt=8; const int Nt{env().getDim(Tdir)};
int parity = 1; int parity = 1;
int orthogDim=3; int orthogDim=3;
@ -199,17 +200,29 @@ void TBC2<FImpl>::execute(void)
} }
hasPhase_ = true; hasPhase_ = true;
stopTimer("Momentum phases"); stopTimer("Momentum phases");
} }
envCache(std::vector<ComplexField>, momphName_, 1, mom_.size(), envGetGrid(ComplexField)); envCache(std::vector<ComplexField>, momphName_, 1, mom_.size(), envGetGrid(ComplexField));
Eigen::Tensor<ComplexD, 6> m(Nmom,Nt,N_1,N_2,N_3,4); Eigen::Tensor<ComplexD, 6> m(Nmom,Nt,N_1,N_2,N_3,4);
A2Autils<FImpl>::NucleonFieldMom(m, &one[0], &two[0], &three[0], ph, parity, orthogDim); A2Autils<FImpl>::NucleonFieldMom(m, &one[0], &two[0], &three[0], ph, parity, orthogDim);
//A2Autils<FImpl>::NucleonFieldMom(m, one, two, three, ph, parity, orthogDim);
for (int is=0 ; is < 4 ; is++){ for (int is=0 ; is < 4 ; is++){
for (int t=0 ; t < Nt ; t++){ 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 END_MODULE_NAMESPACE

View File

@ -144,7 +144,7 @@ void TBaryon2pt<FImpl>::execute(void)
// using BaryonTensorSet = Eigen::Tensor<Complex, 7>; // using BaryonTensorSet = Eigen::Tensor<Complex, 7>;
BFieldIO BFieldL; 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::string filenameL ="./" + inputL + ".h5";
std::cout << "Reading from file " << filenameL << std::endl; std::cout << "Reading from file " << filenameL << std::endl;
@ -152,7 +152,7 @@ void TBaryon2pt<FImpl>::execute(void)
read(readerL,"BaryonField",BFieldL.BField); read(readerL,"BaryonField",BFieldL.BField);
BFieldIO BFieldR; 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::string filenameR ="./" + inputR + ".h5";
std::cout << "Reading from file " << filenameR << std::endl; std::cout << "Reading from file " << filenameR << std::endl;