1
0
mirror of https://github.com/paboyle/Grid.git synced 2024-11-10 07:55:35 +00:00

Merge branch 'feature/distil' of github.com:mmphys/Grid into feature/distil

This commit is contained in:
Michael Marshall 2019-03-02 00:24:47 +00:00
commit 00c3c6fc54

View File

@ -134,9 +134,7 @@ void A2Autils<FImpl>::NucleonFieldMom(Eigen::Tensor<ComplexD,6> &mat,
int twoBlock = mat.dimension(3);
int threeBlock = mat.dimension(4);
assert(0 && "Apologies, Felix, next line was causing compile failure");
//GridBase *grid = wi[0]._grid;
GridBase *grid = nullptr;
GridBase *grid = one[0]._grid;
const int nd = grid->_ndimension;
const int Nsimd = grid->Nsimd();
@ -180,7 +178,7 @@ void A2Autils<FImpl>::NucleonFieldMom(Eigen::Tensor<ComplexD,6> &mat,
for(int i=0;i<oneBlock;i++){
auto v1 = one[i]._odata[ss];
auto pv1 = 0.5*(double)parity*(v1 + Gamma(Gamma::Algebra::GammaT)*v1);
auto pv1 = 0.5*(v1 + (double)parity*Gamma(Gamma::Algebra::GammaT)*v1);
for(int j=0;j<twoBlock;j++){
@ -192,19 +190,19 @@ void A2Autils<FImpl>::NucleonFieldMom(Eigen::Tensor<ComplexD,6> &mat,
// C = i gamma_2 gamma_4 => C gamma_5 = - i gamma_1 gamma_3
auto gv3 = Gamma(Gamma::Algebra::SigmaXZ) * v3;
SpinVector_v vv;
vv()()() = pv1()()(0) * v2()()(1) * gv3()()(2) //Cross product
- pv1()()(0) * v2()()(2) * gv3()()(1)
+ pv1()()(1) * v2()()(2) * gv3()()(0)
- pv1()()(1) * v2()()(0) * gv3()()(2)
+ pv1()()(2) * v2()()(0) * gv3()()(1)
- pv1()()(2) * v2()()(1) * gv3()()(0);
for(int s1=0;s1<Ns;s1++){
for(int s2=0;s2<Ns;s2++){
vv()(s1)() = pv1()(s1)(0) * v2()(s2)(1) * gv3()(s2)(2) //Cross product
- pv1()(s1)(0) * v2()(s2)(2) * gv3()(s2)(1)
+ pv1()(s1)(1) * v2()(s2)(2) * gv3()(s2)(0)
- pv1()(s1)(1) * v2()(s2)(0) * gv3()(s2)(2)
+ pv1()(s1)(2) * v2()(s2)(0) * gv3()(s2)(1)
- pv1()(s1)(2) * v2()(s2)(1) * gv3()(s2)(0);
}}
// After getting the sitewise product do the mom phase loop
assert(0 && "Apologies, Felix, next line was causing compile failure");
//int base = Nmom*i+Nmom*Lblock*j+Nmom*Lblock*Rblock*r;
int base = 0;
int base = Nmom*i+Nmom*oneBlock*j+Nmom*oneBlock*twoBlock*k+Nmom*oneBlock*twoBlock*threeBlock*r;
for ( int m=0;m<Nmom;m++){
int idx = m+base;
auto phase = mom[m]._odata[ss];