Skip to content

Commit

Permalink
Merge pull request #226 from nils-asmussen/fix/Gauss
Browse files Browse the repository at this point in the history
Fix compiling of MSource::Gauss for single precision
  • Loading branch information
aportelli committed Aug 14, 2019
2 parents c2c4252 + e3966aa commit 55c095f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Hadrons/Modules/MSource/Gauss.hpp
Expand Up @@ -114,6 +114,7 @@ void TGauss<FImpl>::execute(void)
const int dim=env().getNd()-1;
const Real fact=-0.5/std::pow(par().width,2);
const Complex i(0.0, 1.0);
const Real Pi(M_PI);
const SitePropagator idMat=[](){ SitePropagator s; s=1.; return s; }();

ScalarRho=zero;
Expand All @@ -129,7 +130,7 @@ void TGauss<FImpl>::execute(void)
LatticeCoordinate(compHelper, mu);

//spatial dimensions of momentum phase
ScalarRho+=(i*(mom_[mu]*2*M_PI/Lmu))*component;
ScalarRho+=(i*(mom_[mu]*2*Pi/Lmu))*component;

//Gauss distribution
component-=Complex(posMu);
Expand All @@ -150,10 +151,10 @@ void TGauss<FImpl>::execute(void)

//time component of momentum phase
LatticeCoordinate(component, dim);
ScalarRho+=(i*(mom_.at(dim)*2*M_PI/env().getDim(dim)))*component;
ScalarRho+=(i*(mom_.at(dim)*2*Pi/env().getDim(dim)))*component;

//compute scalar result
ScalarRho=exp(ScalarRho)*Complex(std::pow(sqrt(2*M_PI)*par().width,-dim));
ScalarRho=exp(ScalarRho)*Complex(std::pow(sqrt(2*Pi)*par().width,-dim));

//select time slices
LatticeCoordinate(compHelper, dim);
Expand Down

0 comments on commit 55c095f

Please sign in to comment.