mirror of
https://github.com/paboyle/Grid.git
synced 2025-04-09 05:30:46 +01:00
MSource::Gauss fix sign in exponent of normalization + use correct types
This commit is contained in:
parent
7c3f400fc5
commit
fc6e584f2c
@ -115,6 +115,8 @@ void TGauss<FImpl>::execute(void)
|
|||||||
const Real fact=-0.5/std::pow(par().width,2);
|
const Real fact=-0.5/std::pow(par().width,2);
|
||||||
const Complex i(0.0, 1.0);
|
const Complex i(0.0, 1.0);
|
||||||
const SitePropagator idMat=[](){ SitePropagator s; s=1.; return s; }();
|
const SitePropagator idMat=[](){ SitePropagator s; s=1.; return s; }();
|
||||||
|
const vTInteger vTtA=par().tA;
|
||||||
|
const vTInteger vTtB=par().tB;
|
||||||
|
|
||||||
ScalarRho=zero;
|
ScalarRho=zero;
|
||||||
for(int mu=0; mu<dim; mu++) {
|
for(int mu=0; mu<dim; mu++) {
|
||||||
@ -154,11 +156,18 @@ void TGauss<FImpl>::execute(void)
|
|||||||
//time component of momentum phase
|
//time component of momentum phase
|
||||||
LatticeCoordinate(component, dim);
|
LatticeCoordinate(component, dim);
|
||||||
ScalarRho+=(i*(mom_.at(dim)*2*M_PI/env().getDim(dim)))*component;
|
ScalarRho+=(i*(mom_.at(dim)*2*M_PI/env().getDim(dim)))*component;
|
||||||
ScalarRho=where((component>=par().tA && component<=tB),
|
|
||||||
|
//compute scalar result
|
||||||
|
ScalarRho=exp(ScalarRho)*Complex(std::pow(sqrt(2*M_PI)*par().width,-dim));
|
||||||
|
|
||||||
|
//select time slices
|
||||||
|
LatticeCoordinate(compHelper, dim);
|
||||||
|
ScalarRho=where((compHelper>=vTtA && compHelper<=vTtB),
|
||||||
ScalarRho,
|
ScalarRho,
|
||||||
0.*ScalarRho);
|
0.*ScalarRho);
|
||||||
|
|
||||||
rho=(exp(ScalarRho)*Complex(std::pow(sqrt(2*M_PI)*par().width,dim)))*idMat;
|
//compute output field rho
|
||||||
|
rho=ScalarRho*idMat;
|
||||||
}
|
}
|
||||||
|
|
||||||
END_MODULE_NAMESPACE
|
END_MODULE_NAMESPACE
|
||||||
|
Loading…
x
Reference in New Issue
Block a user