mirror of
https://github.com/paboyle/Grid.git
synced 2024-11-14 01:35:36 +00:00
Merge pull request #216 from nils-asmussen/feature/GaussianSmearing
feature/gaussian smearing
This commit is contained in:
commit
c2c4252a07
@ -1,69 +1,71 @@
|
|||||||
#include <Hadrons/Modules/MContraction/WeakEye3pt.hpp>
|
#include <Hadrons/Modules/MSource/Gauss.hpp>
|
||||||
#include <Hadrons/Modules/MContraction/Baryon.hpp>
|
|
||||||
#include <Hadrons/Modules/MContraction/A2AAslashField.hpp>
|
|
||||||
#include <Hadrons/Modules/MContraction/A2ALoop.hpp>
|
|
||||||
#include <Hadrons/Modules/MContraction/A2AMesonField.hpp>
|
|
||||||
#include <Hadrons/Modules/MContraction/Meson.hpp>
|
|
||||||
#include <Hadrons/Modules/MContraction/DiscLoop.hpp>
|
|
||||||
#include <Hadrons/Modules/MContraction/Gamma3pt.hpp>
|
|
||||||
#include <Hadrons/Modules/MContraction/WeakMesonDecayKl2.hpp>
|
|
||||||
#include <Hadrons/Modules/MContraction/WeakNonEye3pt.hpp>
|
|
||||||
#include <Hadrons/Modules/MFermion/FreeProp.hpp>
|
|
||||||
#include <Hadrons/Modules/MFermion/GaugeProp.hpp>
|
|
||||||
#include <Hadrons/Modules/MFermion/EMLepton.hpp>
|
|
||||||
#include <Hadrons/Modules/MSource/SeqGamma.hpp>
|
|
||||||
#include <Hadrons/Modules/MSource/SeqAslash.hpp>
|
|
||||||
#include <Hadrons/Modules/MSource/Point.hpp>
|
|
||||||
#include <Hadrons/Modules/MSource/Wall.hpp>
|
|
||||||
#include <Hadrons/Modules/MSource/Z2.hpp>
|
|
||||||
#include <Hadrons/Modules/MSource/SeqConserved.hpp>
|
|
||||||
#include <Hadrons/Modules/MSource/Momentum.hpp>
|
#include <Hadrons/Modules/MSource/Momentum.hpp>
|
||||||
#include <Hadrons/Modules/MSink/Smear.hpp>
|
#include <Hadrons/Modules/MSource/SeqAslash.hpp>
|
||||||
#include <Hadrons/Modules/MSink/Point.hpp>
|
#include <Hadrons/Modules/MSource/Z2.hpp>
|
||||||
#include <Hadrons/Modules/MSolver/MixedPrecisionRBPrecCG.hpp>
|
#include <Hadrons/Modules/MSource/Point.hpp>
|
||||||
#include <Hadrons/Modules/MSolver/LocalCoherenceLanczos.hpp>
|
#include <Hadrons/Modules/MSource/SeqGamma.hpp>
|
||||||
#include <Hadrons/Modules/MSolver/A2AAslashVectors.hpp>
|
#include <Hadrons/Modules/MSource/Convolution.hpp>
|
||||||
#include <Hadrons/Modules/MSolver/Guesser.hpp>
|
#include <Hadrons/Modules/MSource/Wall.hpp>
|
||||||
#include <Hadrons/Modules/MSolver/RBPrecCG.hpp>
|
#include <Hadrons/Modules/MSource/SeqConserved.hpp>
|
||||||
#include <Hadrons/Modules/MSolver/A2AVectors.hpp>
|
#include <Hadrons/Modules/MScalarSUN/Div.hpp>
|
||||||
#include <Hadrons/Modules/MGauge/UnitEm.hpp>
|
#include <Hadrons/Modules/MScalarSUN/TrKinetic.hpp>
|
||||||
#include <Hadrons/Modules/MGauge/StoutSmearing.hpp>
|
#include <Hadrons/Modules/MScalarSUN/TrPhi.hpp>
|
||||||
#include <Hadrons/Modules/MGauge/Unit.hpp>
|
#include <Hadrons/Modules/MScalarSUN/TwoPoint.hpp>
|
||||||
#include <Hadrons/Modules/MGauge/Random.hpp>
|
#include <Hadrons/Modules/MScalarSUN/Grad.hpp>
|
||||||
#include <Hadrons/Modules/MGauge/GaugeFix.hpp>
|
#include <Hadrons/Modules/MScalarSUN/Utils.hpp>
|
||||||
#include <Hadrons/Modules/MGauge/FundtoHirep.hpp>
|
#include <Hadrons/Modules/MScalarSUN/StochFreeField.hpp>
|
||||||
#include <Hadrons/Modules/MGauge/StochEm.hpp>
|
#include <Hadrons/Modules/MScalarSUN/EMT.hpp>
|
||||||
#include <Hadrons/Modules/MGauge/Electrify.hpp>
|
#include <Hadrons/Modules/MScalarSUN/TrMag.hpp>
|
||||||
|
#include <Hadrons/Modules/MScalarSUN/TwoPointNPR.hpp>
|
||||||
|
#include <Hadrons/Modules/MScalarSUN/TransProj.hpp>
|
||||||
#include <Hadrons/Modules/MNoise/TimeDilutedSpinColorDiagonal.hpp>
|
#include <Hadrons/Modules/MNoise/TimeDilutedSpinColorDiagonal.hpp>
|
||||||
#include <Hadrons/Modules/MNoise/FullVolumeSpinColorDiagonal.hpp>
|
#include <Hadrons/Modules/MNoise/FullVolumeSpinColorDiagonal.hpp>
|
||||||
#include <Hadrons/Modules/MUtilities/PrecisionCast.hpp>
|
|
||||||
#include <Hadrons/Modules/MUtilities/RandomVectors.hpp>
|
|
||||||
#include <Hadrons/Modules/MScalar/FreeProp.hpp>
|
#include <Hadrons/Modules/MScalar/FreeProp.hpp>
|
||||||
#include <Hadrons/Modules/MScalar/Scalar.hpp>
|
#include <Hadrons/Modules/MScalar/Scalar.hpp>
|
||||||
#include <Hadrons/Modules/MScalar/ChargedProp.hpp>
|
#include <Hadrons/Modules/MScalar/ChargedProp.hpp>
|
||||||
#include <Hadrons/Modules/MNPR/Bilinear.hpp>
|
|
||||||
#include <Hadrons/Modules/MNPR/Amputate.hpp>
|
|
||||||
#include <Hadrons/Modules/MNPR/FourQuark.hpp>
|
|
||||||
#include <Hadrons/Modules/MAction/DWF.hpp>
|
|
||||||
#include <Hadrons/Modules/MAction/MobiusDWF.hpp>
|
|
||||||
#include <Hadrons/Modules/MAction/Wilson.hpp>
|
#include <Hadrons/Modules/MAction/Wilson.hpp>
|
||||||
|
#include <Hadrons/Modules/MAction/ScaledDWF.hpp>
|
||||||
|
#include <Hadrons/Modules/MAction/MobiusDWF.hpp>
|
||||||
#include <Hadrons/Modules/MAction/WilsonClover.hpp>
|
#include <Hadrons/Modules/MAction/WilsonClover.hpp>
|
||||||
#include <Hadrons/Modules/MAction/ZMobiusDWF.hpp>
|
#include <Hadrons/Modules/MAction/ZMobiusDWF.hpp>
|
||||||
#include <Hadrons/Modules/MAction/ScaledDWF.hpp>
|
#include <Hadrons/Modules/MAction/DWF.hpp>
|
||||||
#include <Hadrons/Modules/MScalarSUN/StochFreeField.hpp>
|
#include <Hadrons/Modules/MGauge/UnitEm.hpp>
|
||||||
#include <Hadrons/Modules/MScalarSUN/TwoPointNPR.hpp>
|
#include <Hadrons/Modules/MGauge/Electrify.hpp>
|
||||||
#include <Hadrons/Modules/MScalarSUN/Div.hpp>
|
#include <Hadrons/Modules/MGauge/StoutSmearing.hpp>
|
||||||
#include <Hadrons/Modules/MScalarSUN/TrMag.hpp>
|
#include <Hadrons/Modules/MGauge/Random.hpp>
|
||||||
#include <Hadrons/Modules/MScalarSUN/EMT.hpp>
|
#include <Hadrons/Modules/MGauge/FundtoHirep.hpp>
|
||||||
#include <Hadrons/Modules/MScalarSUN/TwoPoint.hpp>
|
#include <Hadrons/Modules/MGauge/GaugeFix.hpp>
|
||||||
#include <Hadrons/Modules/MScalarSUN/TrPhi.hpp>
|
#include <Hadrons/Modules/MGauge/Unit.hpp>
|
||||||
#include <Hadrons/Modules/MScalarSUN/Utils.hpp>
|
#include <Hadrons/Modules/MGauge/StochEm.hpp>
|
||||||
#include <Hadrons/Modules/MScalarSUN/TransProj.hpp>
|
#include <Hadrons/Modules/MUtilities/RandomVectors.hpp>
|
||||||
#include <Hadrons/Modules/MScalarSUN/Grad.hpp>
|
#include <Hadrons/Modules/MUtilities/PrecisionCast.hpp>
|
||||||
#include <Hadrons/Modules/MScalarSUN/TrKinetic.hpp>
|
#include <Hadrons/Modules/MIO/LoadCosmHol.hpp>
|
||||||
|
#include <Hadrons/Modules/MIO/LoadA2AVectors.hpp>
|
||||||
#include <Hadrons/Modules/MIO/LoadEigenPack.hpp>
|
#include <Hadrons/Modules/MIO/LoadEigenPack.hpp>
|
||||||
#include <Hadrons/Modules/MIO/LoadNersc.hpp>
|
#include <Hadrons/Modules/MIO/LoadNersc.hpp>
|
||||||
#include <Hadrons/Modules/MIO/LoadA2AVectors.hpp>
|
|
||||||
#include <Hadrons/Modules/MIO/LoadCosmHol.hpp>
|
|
||||||
#include <Hadrons/Modules/MIO/LoadCoarseEigenPack.hpp>
|
|
||||||
#include <Hadrons/Modules/MIO/LoadBinary.hpp>
|
#include <Hadrons/Modules/MIO/LoadBinary.hpp>
|
||||||
|
#include <Hadrons/Modules/MIO/LoadCoarseEigenPack.hpp>
|
||||||
|
#include <Hadrons/Modules/MContraction/WeakEye3pt.hpp>
|
||||||
|
#include <Hadrons/Modules/MContraction/WeakMesonDecayKl2.hpp>
|
||||||
|
#include <Hadrons/Modules/MContraction/Gamma3pt.hpp>
|
||||||
|
#include <Hadrons/Modules/MContraction/A2AMesonField.hpp>
|
||||||
|
#include <Hadrons/Modules/MContraction/A2ALoop.hpp>
|
||||||
|
#include <Hadrons/Modules/MContraction/WeakNonEye3pt.hpp>
|
||||||
|
#include <Hadrons/Modules/MContraction/DiscLoop.hpp>
|
||||||
|
#include <Hadrons/Modules/MContraction/A2AAslashField.hpp>
|
||||||
|
#include <Hadrons/Modules/MContraction/Baryon.hpp>
|
||||||
|
#include <Hadrons/Modules/MContraction/Meson.hpp>
|
||||||
|
#include <Hadrons/Modules/MNPR/FourQuark.hpp>
|
||||||
|
#include <Hadrons/Modules/MNPR/Bilinear.hpp>
|
||||||
|
#include <Hadrons/Modules/MNPR/Amputate.hpp>
|
||||||
|
#include <Hadrons/Modules/MSolver/A2AAslashVectors.hpp>
|
||||||
|
#include <Hadrons/Modules/MSolver/RBPrecCG.hpp>
|
||||||
|
#include <Hadrons/Modules/MSolver/Guesser.hpp>
|
||||||
|
#include <Hadrons/Modules/MSolver/LocalCoherenceLanczos.hpp>
|
||||||
|
#include <Hadrons/Modules/MSolver/A2AVectors.hpp>
|
||||||
|
#include <Hadrons/Modules/MSolver/MixedPrecisionRBPrecCG.hpp>
|
||||||
|
#include <Hadrons/Modules/MFermion/FreeProp.hpp>
|
||||||
|
#include <Hadrons/Modules/MFermion/GaugeProp.hpp>
|
||||||
|
#include <Hadrons/Modules/MFermion/EMLepton.hpp>
|
||||||
|
#include <Hadrons/Modules/MSink/Smear.hpp>
|
||||||
|
#include <Hadrons/Modules/MSink/Point.hpp>
|
||||||
|
7
Hadrons/Modules/MSource/Convolution.cc
Normal file
7
Hadrons/Modules/MSource/Convolution.cc
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
#include <Hadrons/Modules/MSource/Convolution.hpp>
|
||||||
|
|
||||||
|
using namespace Grid;
|
||||||
|
using namespace Hadrons;
|
||||||
|
using namespace MSource;
|
||||||
|
|
||||||
|
template class Grid::Hadrons::MSource::TConvolution<FIMPL>;
|
130
Hadrons/Modules/MSource/Convolution.hpp
Normal file
130
Hadrons/Modules/MSource/Convolution.hpp
Normal file
@ -0,0 +1,130 @@
|
|||||||
|
#ifndef Hadrons_MSource_Convolution_hpp_
|
||||||
|
#define Hadrons_MSource_Convolution_hpp_
|
||||||
|
|
||||||
|
#include <Hadrons/Global.hpp>
|
||||||
|
#include <Hadrons/Module.hpp>
|
||||||
|
#include <Hadrons/ModuleFactory.hpp>
|
||||||
|
|
||||||
|
BEGIN_HADRONS_NAMESPACE
|
||||||
|
|
||||||
|
/******************************************************************************
|
||||||
|
* Convolution *
|
||||||
|
******************************************************************************/
|
||||||
|
BEGIN_MODULE_NAMESPACE(MSource)
|
||||||
|
|
||||||
|
class ConvolutionPar: Serializable
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
GRID_SERIALIZABLE_CLASS_MEMBERS(ConvolutionPar,
|
||||||
|
std::string, field,
|
||||||
|
std::string, filter,
|
||||||
|
std::string, mom);
|
||||||
|
};
|
||||||
|
|
||||||
|
template <typename FImpl>
|
||||||
|
class TConvolution: public Module<ConvolutionPar>
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
FERM_TYPE_ALIASES(FImpl,);
|
||||||
|
public:
|
||||||
|
// constructor
|
||||||
|
TConvolution(const std::string name);
|
||||||
|
// destructor
|
||||||
|
virtual ~TConvolution(void) {};
|
||||||
|
// dependency relation
|
||||||
|
virtual std::vector<std::string> getInput(void);
|
||||||
|
virtual std::vector<std::string> getOutput(void);
|
||||||
|
// setup
|
||||||
|
virtual void setup(void);
|
||||||
|
// execution
|
||||||
|
virtual void execute(void);
|
||||||
|
private:
|
||||||
|
std::vector<int> mom_;
|
||||||
|
};
|
||||||
|
|
||||||
|
MODULE_REGISTER_TMP(Convolution, TConvolution<FIMPL>, MSource);
|
||||||
|
|
||||||
|
/******************************************************************************
|
||||||
|
* TConvolution implementation *
|
||||||
|
******************************************************************************/
|
||||||
|
// constructor /////////////////////////////////////////////////////////////////
|
||||||
|
template <typename FImpl>
|
||||||
|
TConvolution<FImpl>::TConvolution(const std::string name)
|
||||||
|
: Module<ConvolutionPar>(name)
|
||||||
|
{}
|
||||||
|
|
||||||
|
// dependencies/products ///////////////////////////////////////////////////////
|
||||||
|
template <typename FImpl>
|
||||||
|
std::vector<std::string> TConvolution<FImpl>::getInput(void)
|
||||||
|
{
|
||||||
|
std::vector<std::string> in = {par().field, par().filter};
|
||||||
|
|
||||||
|
return in;
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename FImpl>
|
||||||
|
std::vector<std::string> TConvolution<FImpl>::getOutput(void)
|
||||||
|
{
|
||||||
|
std::vector<std::string> out = {getName()};
|
||||||
|
|
||||||
|
return out;
|
||||||
|
}
|
||||||
|
|
||||||
|
// setup ///////////////////////////////////////////////////////////////////////
|
||||||
|
template <typename FImpl>
|
||||||
|
void TConvolution<FImpl>::setup(void)
|
||||||
|
{
|
||||||
|
mom_ = strToVec<int>(par().mom);
|
||||||
|
if(mom_.size() != env().getNd()) {
|
||||||
|
HADRONS_ERROR(Size, std::string("momentum has ")
|
||||||
|
+ std::to_string(mom_.size()) + " instead of "
|
||||||
|
+ std::to_string(env().getNd()) + " components");
|
||||||
|
}
|
||||||
|
|
||||||
|
envCreateLat(PropagatorField, getName());
|
||||||
|
envTmpLat(ComplexField, "momfield");
|
||||||
|
envTmp(FFT, "fft", 1, env().getGrid());
|
||||||
|
}
|
||||||
|
|
||||||
|
// execution ///////////////////////////////////////////////////////////////////
|
||||||
|
template <typename FImpl>
|
||||||
|
void TConvolution<FImpl>::execute(void)
|
||||||
|
{
|
||||||
|
auto &filter = envGet(ComplexField, par().filter);
|
||||||
|
auto &field = envGet(PropagatorField, par().field);
|
||||||
|
auto &out = envGet(PropagatorField, getName());
|
||||||
|
envGetTmp(ComplexField, momfield);
|
||||||
|
envGetTmp(FFT, fft);
|
||||||
|
|
||||||
|
std::vector<int> mask(env().getNd(), 1);
|
||||||
|
mask.back()=0; //transform only the spatial dimensions
|
||||||
|
|
||||||
|
startTimer("Fourier transform");
|
||||||
|
fft.FFT_dim_mask(momfield, filter, mask, FFT::forward);
|
||||||
|
fft.FFT_dim_mask(out, field, mask, FFT::forward);
|
||||||
|
stopTimer("Fourier transform");
|
||||||
|
|
||||||
|
startTimer("momentum-space multiplication");
|
||||||
|
out=momfield*out;
|
||||||
|
stopTimer("momentum-space multiplication");
|
||||||
|
|
||||||
|
startTimer("inserting momentum");
|
||||||
|
for(int mu=0; mu<env().getNd(); mu++)
|
||||||
|
{
|
||||||
|
if(mom_[mu]!=0)
|
||||||
|
{
|
||||||
|
out=Cshift(out, mu, -mom_[mu]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stopTimer("inserting momentum");
|
||||||
|
|
||||||
|
startTimer("Fourier transform");
|
||||||
|
fft.FFT_dim_mask(out, out, mask, FFT::backward);
|
||||||
|
stopTimer("Fourier transform");
|
||||||
|
}
|
||||||
|
|
||||||
|
END_MODULE_NAMESPACE
|
||||||
|
|
||||||
|
END_HADRONS_NAMESPACE
|
||||||
|
|
||||||
|
#endif // Hadrons_MSource_Convolution_hpp_
|
8
Hadrons/Modules/MSource/Gauss.cc
Normal file
8
Hadrons/Modules/MSource/Gauss.cc
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
#include <Hadrons/Modules/MSource/Gauss.hpp>
|
||||||
|
|
||||||
|
using namespace Grid;
|
||||||
|
using namespace Hadrons;
|
||||||
|
using namespace MSource;
|
||||||
|
|
||||||
|
template class Grid::Hadrons::MSource::TGauss<FIMPL>;
|
||||||
|
template class Grid::Hadrons::MSource::TGauss<ScalarImplCR>;
|
172
Hadrons/Modules/MSource/Gauss.hpp
Normal file
172
Hadrons/Modules/MSource/Gauss.hpp
Normal file
@ -0,0 +1,172 @@
|
|||||||
|
#ifndef Hadrons_MSource_Gauss_hpp_
|
||||||
|
#define Hadrons_MSource_Gauss_hpp_
|
||||||
|
|
||||||
|
#include <Hadrons/Global.hpp>
|
||||||
|
#include <Hadrons/Module.hpp>
|
||||||
|
#include <Hadrons/ModuleFactory.hpp>
|
||||||
|
|
||||||
|
BEGIN_HADRONS_NAMESPACE
|
||||||
|
|
||||||
|
/******************************************************************************
|
||||||
|
* Gauss *
|
||||||
|
* result[n] = 1/(sqrt(2*pi)*width)^dim *
|
||||||
|
* * exp(-|n-position|^2/(2*width^2)) *
|
||||||
|
* * exp(i*2*pi/L*mom*n) *
|
||||||
|
* where: *
|
||||||
|
* n=(n[0],n[1],...,n[dim-1]) (lattice coordinate) *
|
||||||
|
* dim=Nd-1 *
|
||||||
|
******************************************************************************/
|
||||||
|
BEGIN_MODULE_NAMESPACE(MSource)
|
||||||
|
|
||||||
|
class GaussPar: Serializable
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
GRID_SERIALIZABLE_CLASS_MEMBERS(GaussPar,
|
||||||
|
std::string, position,
|
||||||
|
std::string, mom,
|
||||||
|
Integer, tA,
|
||||||
|
Integer, tB,
|
||||||
|
double, width);
|
||||||
|
};
|
||||||
|
|
||||||
|
template <typename FImpl>
|
||||||
|
class TGauss: public Module<GaussPar>
|
||||||
|
{
|
||||||
|
BASIC_TYPE_ALIASES(FImpl,);
|
||||||
|
public:
|
||||||
|
// constructor
|
||||||
|
TGauss(const std::string name);
|
||||||
|
// destructor
|
||||||
|
virtual ~TGauss(void) {};
|
||||||
|
// dependency relation
|
||||||
|
virtual std::vector<std::string> getInput(void);
|
||||||
|
virtual std::vector<std::string> getOutput(void);
|
||||||
|
// setup
|
||||||
|
virtual void setup(void);
|
||||||
|
// execution
|
||||||
|
virtual void execute(void);
|
||||||
|
private:
|
||||||
|
std::vector<int> position_;
|
||||||
|
std::vector<int> mom_;
|
||||||
|
};
|
||||||
|
|
||||||
|
MODULE_REGISTER_TMP(Gauss, TGauss<FIMPL>, MSource);
|
||||||
|
MODULE_REGISTER_TMP(ScalarGauss, TGauss<ScalarImplCR>, MSource);
|
||||||
|
|
||||||
|
/******************************************************************************
|
||||||
|
* TGauss implementation *
|
||||||
|
******************************************************************************/
|
||||||
|
// constructor /////////////////////////////////////////////////////////////////
|
||||||
|
template <typename FImpl>
|
||||||
|
TGauss<FImpl>::TGauss(const std::string name)
|
||||||
|
: Module<GaussPar>(name)
|
||||||
|
{}
|
||||||
|
|
||||||
|
// dependencies/products ///////////////////////////////////////////////////////
|
||||||
|
template <typename FImpl>
|
||||||
|
std::vector<std::string> TGauss<FImpl>::getInput(void)
|
||||||
|
{
|
||||||
|
std::vector<std::string> in;
|
||||||
|
|
||||||
|
return in;
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename FImpl>
|
||||||
|
std::vector<std::string> TGauss<FImpl>::getOutput(void)
|
||||||
|
{
|
||||||
|
std::vector<std::string> out = {getName()};
|
||||||
|
|
||||||
|
return out;
|
||||||
|
}
|
||||||
|
|
||||||
|
// setup ///////////////////////////////////////////////////////////////////////
|
||||||
|
template <typename FImpl>
|
||||||
|
void TGauss<FImpl>::setup(void)
|
||||||
|
{
|
||||||
|
auto parse_vector = [](const std::string &vec, int dim,
|
||||||
|
const std::string &desc)
|
||||||
|
{
|
||||||
|
std::vector<int> res = strToVec<int>(vec);
|
||||||
|
if(res.size() != dim) {
|
||||||
|
HADRONS_ERROR(Size, desc + " has "
|
||||||
|
+ std::to_string(res.size()) + " instead of "
|
||||||
|
+ std::to_string(dim) + " components");
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
};
|
||||||
|
position_ = parse_vector(par().position, env().getNd()-1, "position");
|
||||||
|
mom_ = parse_vector(par().mom, env().getNd(), "momentum");
|
||||||
|
|
||||||
|
envCreateLat(PropagatorField, getName());
|
||||||
|
envTmpLat(ComplexField, "component");
|
||||||
|
envTmpLat(ComplexField, "ScalarRho");
|
||||||
|
envTmp(LatticeInteger, "compHelper", 1, envGetGrid(ComplexField));
|
||||||
|
}
|
||||||
|
|
||||||
|
// execution ///////////////////////////////////////////////////////////////////
|
||||||
|
template <typename FImpl>
|
||||||
|
void TGauss<FImpl>::execute(void)
|
||||||
|
{
|
||||||
|
auto &rho = envGet(PropagatorField, getName());
|
||||||
|
envGetTmp(ComplexField, component);
|
||||||
|
envGetTmp(ComplexField, ScalarRho);
|
||||||
|
envGetTmp(LatticeInteger, compHelper);
|
||||||
|
const int dim=env().getNd()-1;
|
||||||
|
const Real fact=-0.5/std::pow(par().width,2);
|
||||||
|
const Complex i(0.0, 1.0);
|
||||||
|
const SitePropagator idMat=[](){ SitePropagator s; s=1.; return s; }();
|
||||||
|
|
||||||
|
ScalarRho=zero;
|
||||||
|
for(int mu=0; mu<dim; mu++) {
|
||||||
|
assert(env().getDim(mu)%2==0);
|
||||||
|
assert(position_[mu]>=0 && position_[mu]<env().getDim(mu));
|
||||||
|
|
||||||
|
const int Lmu=env().getDim(mu);
|
||||||
|
const int LmuHalf=Lmu/2;
|
||||||
|
const int posMu=position_[mu];
|
||||||
|
|
||||||
|
LatticeCoordinate(component, mu);
|
||||||
|
LatticeCoordinate(compHelper, mu);
|
||||||
|
|
||||||
|
//spatial dimensions of momentum phase
|
||||||
|
ScalarRho+=(i*(mom_[mu]*2*M_PI/Lmu))*component;
|
||||||
|
|
||||||
|
//Gauss distribution
|
||||||
|
component-=Complex(posMu);
|
||||||
|
if(posMu<LmuHalf)
|
||||||
|
{
|
||||||
|
component=where((compHelper>Integer(posMu+LmuHalf)),
|
||||||
|
component-Complex(Lmu),
|
||||||
|
component);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
component=where((compHelper<=Integer(posMu-LmuHalf)),
|
||||||
|
component+Complex(Lmu),
|
||||||
|
component);
|
||||||
|
}
|
||||||
|
ScalarRho+=component*component*fact;
|
||||||
|
}
|
||||||
|
|
||||||
|
//time component of momentum phase
|
||||||
|
LatticeCoordinate(component, dim);
|
||||||
|
ScalarRho+=(i*(mom_.at(dim)*2*M_PI/env().getDim(dim)))*component;
|
||||||
|
|
||||||
|
//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>=par().tA && compHelper<=par().tB),
|
||||||
|
ScalarRho,
|
||||||
|
0.*ScalarRho);
|
||||||
|
|
||||||
|
//compute output field rho
|
||||||
|
rho=ScalarRho*idMat;
|
||||||
|
}
|
||||||
|
|
||||||
|
END_MODULE_NAMESPACE
|
||||||
|
|
||||||
|
END_HADRONS_NAMESPACE
|
||||||
|
|
||||||
|
#endif // Hadrons_MSource_Gauss_hpp_
|
@ -1,139 +1,143 @@
|
|||||||
modules_cc =\
|
modules_cc =\
|
||||||
Modules/MContraction/Baryon.cc \
|
Modules/MSource/SeqConserved.cc \
|
||||||
Modules/MContraction/Meson.cc \
|
Modules/MSource/Convolution.cc \
|
||||||
Modules/MContraction/WeakMesonDecayKl2.cc \
|
Modules/MSource/SeqAslash.cc \
|
||||||
Modules/MContraction/WeakEye3pt.cc \
|
Modules/MSource/Wall.cc \
|
||||||
|
Modules/MSource/Point.cc \
|
||||||
|
Modules/MSource/Z2.cc \
|
||||||
|
Modules/MSource/Gauss.cc \
|
||||||
|
Modules/MSource/SeqGamma.cc \
|
||||||
|
Modules/MSource/Momentum.cc \
|
||||||
|
Modules/MScalarSUN/TwoPoint.cc \
|
||||||
|
Modules/MScalarSUN/TransProj.cc \
|
||||||
|
Modules/MScalarSUN/TwoPointNPR.cc \
|
||||||
|
Modules/MScalarSUN/EMT.cc \
|
||||||
|
Modules/MScalarSUN/TrKinetic.cc \
|
||||||
|
Modules/MScalarSUN/TrPhi.cc \
|
||||||
|
Modules/MScalarSUN/Div.cc \
|
||||||
|
Modules/MScalarSUN/Grad.cc \
|
||||||
|
Modules/MScalarSUN/StochFreeField.cc \
|
||||||
|
Modules/MScalarSUN/TrMag.cc \
|
||||||
|
Modules/MNoise/FullVolumeSpinColorDiagonal.cc \
|
||||||
|
Modules/MNoise/TimeDilutedSpinColorDiagonal.cc \
|
||||||
|
Modules/MScalar/FreeProp.cc \
|
||||||
|
Modules/MScalar/ChargedProp.cc \
|
||||||
|
Modules/MAction/Wilson.cc \
|
||||||
|
Modules/MAction/DWF.cc \
|
||||||
|
Modules/MAction/MobiusDWF.cc \
|
||||||
|
Modules/MAction/ScaledDWF.cc \
|
||||||
|
Modules/MAction/WilsonClover.cc \
|
||||||
|
Modules/MAction/ZMobiusDWF.cc \
|
||||||
|
Modules/MGauge/FundtoHirep.cc \
|
||||||
|
Modules/MGauge/StochEm.cc \
|
||||||
|
Modules/MGauge/Unit.cc \
|
||||||
|
Modules/MGauge/StoutSmearing.cc \
|
||||||
|
Modules/MGauge/Electrify.cc \
|
||||||
|
Modules/MGauge/Random.cc \
|
||||||
|
Modules/MGauge/UnitEm.cc \
|
||||||
|
Modules/MGauge/GaugeFix.cc \
|
||||||
|
Modules/MUtilities/PrecisionCast.cc \
|
||||||
|
Modules/MUtilities/RandomVectors.cc \
|
||||||
|
Modules/MIO/LoadA2AVectors.cc \
|
||||||
|
Modules/MIO/LoadNersc.cc \
|
||||||
|
Modules/MIO/LoadBinary.cc \
|
||||||
|
Modules/MIO/LoadCoarseEigenPack.cc \
|
||||||
|
Modules/MIO/LoadEigenPack.cc \
|
||||||
|
Modules/MIO/LoadCosmHol.cc \
|
||||||
Modules/MContraction/A2ALoop.cc \
|
Modules/MContraction/A2ALoop.cc \
|
||||||
Modules/MContraction/WeakNonEye3pt.cc \
|
Modules/MContraction/WeakNonEye3pt.cc \
|
||||||
Modules/MContraction/A2AAslashField.cc \
|
Modules/MContraction/WeakMesonDecayKl2.cc \
|
||||||
Modules/MContraction/A2AMesonField.cc \
|
Modules/MContraction/A2AMesonField.cc \
|
||||||
Modules/MContraction/DiscLoop.cc \
|
|
||||||
Modules/MContraction/Gamma3pt.cc \
|
Modules/MContraction/Gamma3pt.cc \
|
||||||
|
Modules/MContraction/Baryon.cc \
|
||||||
|
Modules/MContraction/A2AAslashField.cc \
|
||||||
|
Modules/MContraction/DiscLoop.cc \
|
||||||
|
Modules/MContraction/Meson.cc \
|
||||||
|
Modules/MContraction/WeakEye3pt.cc \
|
||||||
|
Modules/MNPR/Bilinear.cc \
|
||||||
|
Modules/MNPR/FourQuark.cc \
|
||||||
|
Modules/MNPR/Amputate.cc \
|
||||||
|
Modules/MSolver/A2AAslashVectors.cc \
|
||||||
|
Modules/MSolver/MixedPrecisionRBPrecCG.cc \
|
||||||
|
Modules/MSolver/RBPrecCG.cc \
|
||||||
|
Modules/MSolver/LocalCoherenceLanczos.cc \
|
||||||
|
Modules/MSolver/A2AVectors.cc \
|
||||||
Modules/MFermion/FreeProp.cc \
|
Modules/MFermion/FreeProp.cc \
|
||||||
Modules/MFermion/GaugeProp.cc \
|
Modules/MFermion/GaugeProp.cc \
|
||||||
Modules/MFermion/EMLepton.cc \
|
Modules/MFermion/EMLepton.cc \
|
||||||
Modules/MSource/Momentum.cc \
|
|
||||||
Modules/MSource/Point.cc \
|
|
||||||
Modules/MSource/Wall.cc \
|
|
||||||
Modules/MSource/SeqConserved.cc \
|
|
||||||
Modules/MSource/SeqGamma.cc \
|
|
||||||
Modules/MSource/SeqAslash.cc \
|
|
||||||
Modules/MSource/Z2.cc \
|
|
||||||
Modules/MSink/Point.cc \
|
|
||||||
Modules/MSink/Smear.cc \
|
Modules/MSink/Smear.cc \
|
||||||
Modules/MSolver/A2AVectors.cc \
|
Modules/MSink/Point.cc
|
||||||
Modules/MSolver/A2AAslashVectors.cc \
|
|
||||||
Modules/MSolver/RBPrecCG.cc \
|
|
||||||
Modules/MSolver/MixedPrecisionRBPrecCG.cc \
|
|
||||||
Modules/MSolver/LocalCoherenceLanczos.cc \
|
|
||||||
Modules/MGauge/StoutSmearing.cc \
|
|
||||||
Modules/MGauge/Unit.cc \
|
|
||||||
Modules/MGauge/UnitEm.cc \
|
|
||||||
Modules/MGauge/StochEm.cc \
|
|
||||||
Modules/MGauge/Random.cc \
|
|
||||||
Modules/MGauge/Electrify.cc \
|
|
||||||
Modules/MGauge/FundtoHirep.cc \
|
|
||||||
Modules/MGauge/GaugeFix.cc \
|
|
||||||
Modules/MNoise/FullVolumeSpinColorDiagonal.cc \
|
|
||||||
Modules/MNoise/TimeDilutedSpinColorDiagonal.cc \
|
|
||||||
Modules/MUtilities/RandomVectors.cc \
|
|
||||||
Modules/MUtilities/PrecisionCast.cc \
|
|
||||||
Modules/MScalar/FreeProp.cc \
|
|
||||||
Modules/MScalar/ChargedProp.cc \
|
|
||||||
Modules/MNPR/Amputate.cc \
|
|
||||||
Modules/MNPR/Bilinear.cc \
|
|
||||||
Modules/MNPR/FourQuark.cc \
|
|
||||||
Modules/MAction/Wilson.cc \
|
|
||||||
Modules/MAction/MobiusDWF.cc \
|
|
||||||
Modules/MAction/ZMobiusDWF.cc \
|
|
||||||
Modules/MAction/WilsonClover.cc \
|
|
||||||
Modules/MAction/DWF.cc \
|
|
||||||
Modules/MAction/ScaledDWF.cc \
|
|
||||||
Modules/MScalarSUN/TrPhi.cc \
|
|
||||||
Modules/MScalarSUN/Grad.cc \
|
|
||||||
Modules/MScalarSUN/TrMag.cc \
|
|
||||||
Modules/MScalarSUN/TrKinetic.cc \
|
|
||||||
Modules/MScalarSUN/EMT.cc \
|
|
||||||
Modules/MScalarSUN/TransProj.cc \
|
|
||||||
Modules/MScalarSUN/StochFreeField.cc \
|
|
||||||
Modules/MScalarSUN/TwoPoint.cc \
|
|
||||||
Modules/MScalarSUN/TwoPointNPR.cc \
|
|
||||||
Modules/MScalarSUN/Div.cc \
|
|
||||||
Modules/MIO/LoadEigenPack.cc \
|
|
||||||
Modules/MIO/LoadBinary.cc \
|
|
||||||
Modules/MIO/LoadNersc.cc \
|
|
||||||
Modules/MIO/LoadCoarseEigenPack.cc \
|
|
||||||
Modules/MIO/LoadCosmHol.cc \
|
|
||||||
Modules/MIO/LoadA2AVectors.cc
|
|
||||||
|
|
||||||
modules_hpp =\
|
modules_hpp =\
|
||||||
Modules/MContraction/WeakEye3pt.hpp \
|
Modules/MSource/Gauss.hpp \
|
||||||
Modules/MContraction/Baryon.hpp \
|
|
||||||
Modules/MContraction/A2AAslashField.hpp \
|
|
||||||
Modules/MContraction/A2ALoop.hpp \
|
|
||||||
Modules/MContraction/A2AMesonField.hpp \
|
|
||||||
Modules/MContraction/Meson.hpp \
|
|
||||||
Modules/MContraction/DiscLoop.hpp \
|
|
||||||
Modules/MContraction/Gamma3pt.hpp \
|
|
||||||
Modules/MContraction/WeakMesonDecayKl2.hpp \
|
|
||||||
Modules/MContraction/WeakNonEye3pt.hpp \
|
|
||||||
Modules/MFermion/FreeProp.hpp \
|
|
||||||
Modules/MFermion/GaugeProp.hpp \
|
|
||||||
Modules/MFermion/EMLepton.hpp \
|
|
||||||
Modules/MSource/SeqGamma.hpp \
|
|
||||||
Modules/MSource/SeqAslash.hpp \
|
|
||||||
Modules/MSource/Point.hpp \
|
|
||||||
Modules/MSource/Wall.hpp \
|
|
||||||
Modules/MSource/Z2.hpp \
|
|
||||||
Modules/MSource/SeqConserved.hpp \
|
|
||||||
Modules/MSource/Momentum.hpp \
|
Modules/MSource/Momentum.hpp \
|
||||||
Modules/MSink/Smear.hpp \
|
Modules/MSource/SeqAslash.hpp \
|
||||||
Modules/MSink/Point.hpp \
|
Modules/MSource/Z2.hpp \
|
||||||
Modules/MSolver/MixedPrecisionRBPrecCG.hpp \
|
Modules/MSource/Point.hpp \
|
||||||
Modules/MSolver/LocalCoherenceLanczos.hpp \
|
Modules/MSource/SeqGamma.hpp \
|
||||||
Modules/MSolver/A2AAslashVectors.hpp \
|
Modules/MSource/Convolution.hpp \
|
||||||
Modules/MSolver/Guesser.hpp \
|
Modules/MSource/Wall.hpp \
|
||||||
Modules/MSolver/RBPrecCG.hpp \
|
Modules/MSource/SeqConserved.hpp \
|
||||||
Modules/MSolver/A2AVectors.hpp \
|
Modules/MScalarSUN/Div.hpp \
|
||||||
Modules/MGauge/UnitEm.hpp \
|
Modules/MScalarSUN/TrKinetic.hpp \
|
||||||
Modules/MGauge/StoutSmearing.hpp \
|
Modules/MScalarSUN/TrPhi.hpp \
|
||||||
Modules/MGauge/Unit.hpp \
|
Modules/MScalarSUN/TwoPoint.hpp \
|
||||||
Modules/MGauge/Random.hpp \
|
Modules/MScalarSUN/Grad.hpp \
|
||||||
Modules/MGauge/GaugeFix.hpp \
|
Modules/MScalarSUN/Utils.hpp \
|
||||||
Modules/MGauge/FundtoHirep.hpp \
|
Modules/MScalarSUN/StochFreeField.hpp \
|
||||||
Modules/MGauge/StochEm.hpp \
|
Modules/MScalarSUN/EMT.hpp \
|
||||||
Modules/MGauge/Electrify.hpp \
|
Modules/MScalarSUN/TrMag.hpp \
|
||||||
|
Modules/MScalarSUN/TwoPointNPR.hpp \
|
||||||
|
Modules/MScalarSUN/TransProj.hpp \
|
||||||
Modules/MNoise/TimeDilutedSpinColorDiagonal.hpp \
|
Modules/MNoise/TimeDilutedSpinColorDiagonal.hpp \
|
||||||
Modules/MNoise/FullVolumeSpinColorDiagonal.hpp \
|
Modules/MNoise/FullVolumeSpinColorDiagonal.hpp \
|
||||||
Modules/MUtilities/PrecisionCast.hpp \
|
|
||||||
Modules/MUtilities/RandomVectors.hpp \
|
|
||||||
Modules/MScalar/FreeProp.hpp \
|
Modules/MScalar/FreeProp.hpp \
|
||||||
Modules/MScalar/Scalar.hpp \
|
Modules/MScalar/Scalar.hpp \
|
||||||
Modules/MScalar/ChargedProp.hpp \
|
Modules/MScalar/ChargedProp.hpp \
|
||||||
Modules/MNPR/Bilinear.hpp \
|
|
||||||
Modules/MNPR/Amputate.hpp \
|
|
||||||
Modules/MNPR/FourQuark.hpp \
|
|
||||||
Modules/MAction/DWF.hpp \
|
|
||||||
Modules/MAction/MobiusDWF.hpp \
|
|
||||||
Modules/MAction/Wilson.hpp \
|
Modules/MAction/Wilson.hpp \
|
||||||
|
Modules/MAction/ScaledDWF.hpp \
|
||||||
|
Modules/MAction/MobiusDWF.hpp \
|
||||||
Modules/MAction/WilsonClover.hpp \
|
Modules/MAction/WilsonClover.hpp \
|
||||||
Modules/MAction/ZMobiusDWF.hpp \
|
Modules/MAction/ZMobiusDWF.hpp \
|
||||||
Modules/MAction/ScaledDWF.hpp \
|
Modules/MAction/DWF.hpp \
|
||||||
Modules/MScalarSUN/StochFreeField.hpp \
|
Modules/MGauge/UnitEm.hpp \
|
||||||
Modules/MScalarSUN/TwoPointNPR.hpp \
|
Modules/MGauge/Electrify.hpp \
|
||||||
Modules/MScalarSUN/Div.hpp \
|
Modules/MGauge/StoutSmearing.hpp \
|
||||||
Modules/MScalarSUN/TrMag.hpp \
|
Modules/MGauge/Random.hpp \
|
||||||
Modules/MScalarSUN/EMT.hpp \
|
Modules/MGauge/FundtoHirep.hpp \
|
||||||
Modules/MScalarSUN/TwoPoint.hpp \
|
Modules/MGauge/GaugeFix.hpp \
|
||||||
Modules/MScalarSUN/TrPhi.hpp \
|
Modules/MGauge/Unit.hpp \
|
||||||
Modules/MScalarSUN/Utils.hpp \
|
Modules/MGauge/StochEm.hpp \
|
||||||
Modules/MScalarSUN/TransProj.hpp \
|
Modules/MUtilities/RandomVectors.hpp \
|
||||||
Modules/MScalarSUN/Grad.hpp \
|
Modules/MUtilities/PrecisionCast.hpp \
|
||||||
Modules/MScalarSUN/TrKinetic.hpp \
|
Modules/MIO/LoadCosmHol.hpp \
|
||||||
|
Modules/MIO/LoadA2AVectors.hpp \
|
||||||
Modules/MIO/LoadEigenPack.hpp \
|
Modules/MIO/LoadEigenPack.hpp \
|
||||||
Modules/MIO/LoadNersc.hpp \
|
Modules/MIO/LoadNersc.hpp \
|
||||||
Modules/MIO/LoadA2AVectors.hpp \
|
Modules/MIO/LoadBinary.hpp \
|
||||||
Modules/MIO/LoadCosmHol.hpp \
|
|
||||||
Modules/MIO/LoadCoarseEigenPack.hpp \
|
Modules/MIO/LoadCoarseEigenPack.hpp \
|
||||||
Modules/MIO/LoadBinary.hpp
|
Modules/MContraction/WeakEye3pt.hpp \
|
||||||
|
Modules/MContraction/WeakMesonDecayKl2.hpp \
|
||||||
|
Modules/MContraction/Gamma3pt.hpp \
|
||||||
|
Modules/MContraction/A2AMesonField.hpp \
|
||||||
|
Modules/MContraction/A2ALoop.hpp \
|
||||||
|
Modules/MContraction/WeakNonEye3pt.hpp \
|
||||||
|
Modules/MContraction/DiscLoop.hpp \
|
||||||
|
Modules/MContraction/A2AAslashField.hpp \
|
||||||
|
Modules/MContraction/Baryon.hpp \
|
||||||
|
Modules/MContraction/Meson.hpp \
|
||||||
|
Modules/MNPR/FourQuark.hpp \
|
||||||
|
Modules/MNPR/Bilinear.hpp \
|
||||||
|
Modules/MNPR/Amputate.hpp \
|
||||||
|
Modules/MSolver/A2AAslashVectors.hpp \
|
||||||
|
Modules/MSolver/RBPrecCG.hpp \
|
||||||
|
Modules/MSolver/Guesser.hpp \
|
||||||
|
Modules/MSolver/LocalCoherenceLanczos.hpp \
|
||||||
|
Modules/MSolver/A2AVectors.hpp \
|
||||||
|
Modules/MSolver/MixedPrecisionRBPrecCG.hpp \
|
||||||
|
Modules/MFermion/FreeProp.hpp \
|
||||||
|
Modules/MFermion/GaugeProp.hpp \
|
||||||
|
Modules/MFermion/EMLepton.hpp \
|
||||||
|
Modules/MSink/Smear.hpp \
|
||||||
|
Modules/MSink/Point.hpp
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user