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

Hadrons: Z2 source expression fix

This commit is contained in:
Antonin Portelli 2016-05-01 12:49:26 -07:00
parent 468d8dc682
commit 5e4b58ac40

View File

@ -119,14 +119,17 @@ void MSource::execute(Environment &env)
int tb = std::stoi(par_.arguments[1]); int tb = std::stoi(par_.arguments[1]);
Lattice<iScalar<vInteger>> t(env.getGrid()); Lattice<iScalar<vInteger>> t(env.getGrid());
LatticeComplex eta(env.getGrid()); LatticeComplex eta(env.getGrid());
LatticeComplex z(env.getGrid()), shift(env.getGrid());
LatticeFermion phi(env.getGrid()); LatticeFermion phi(env.getGrid());
ComplexD shift(1., 1.);
LatticeCoordinate(t, Tp); LatticeCoordinate(t, Tp);
bernoulli(*env.get4dRng(), eta); bernoulli(*env.get4dRng(), eta);
shift = ComplexD(1., 1.);
z = zero;
eta = (2.*eta - shift)*(1./::sqrt(2.)); eta = (2.*eta - shift)*(1./::sqrt(2.));
eta = where((t >= ta) and (t <= tb), eta, z);
*src_ = 1.; *src_ = 1.;
*src_ = where((t >= ta) and (t <= tb), (*src_)*eta, (*src_)*0.); *src_ *= eta;
break; break;
} }