mirror of
https://github.com/paboyle/Grid.git
synced 2025-04-09 21:50:45 +01:00
Hadrons: stochastic scalar SU(N) free field fix
This commit is contained in:
parent
a0d399e5ce
commit
255d4992e1
@ -24,10 +24,10 @@ template <typename SImpl>
|
|||||||
class TStochFreeField: public Module<StochFreeFieldPar>
|
class TStochFreeField: public Module<StochFreeFieldPar>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef typename SImpl::Field Field;
|
typedef typename SImpl::Field Field;
|
||||||
typedef typename SImpl::ComplexField ComplexField;
|
typedef typename SImpl::ComplexField ComplexField;
|
||||||
typedef typename SImpl::Group Group;
|
typedef typename SImpl::Group Group;
|
||||||
typedef typename Group::LatticeAlgebraVector AlgebraField;
|
typedef typename SImpl::SiteField::scalar_object Site;
|
||||||
public:
|
public:
|
||||||
// constructor
|
// constructor
|
||||||
TStochFreeField(const std::string name);
|
TStochFreeField(const std::string name);
|
||||||
@ -87,6 +87,7 @@ void TStochFreeField<SImpl>::setup(void)
|
|||||||
create_weight = true;
|
create_weight = true;
|
||||||
}
|
}
|
||||||
envTmpLat(Field, "phift");
|
envTmpLat(Field, "phift");
|
||||||
|
envTmpLat(ComplexField, "ca");
|
||||||
envCreateLat(Field, getName());
|
envCreateLat(Field, getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -120,13 +121,27 @@ void TStochFreeField<SImpl>::execute(void)
|
|||||||
}
|
}
|
||||||
LOG(Message) << "Generating random momentum-space field" << std::endl;
|
LOG(Message) << "Generating random momentum-space field" << std::endl;
|
||||||
envGetTmp(Field, phift);
|
envGetTmp(Field, phift);
|
||||||
Group::GaussianFundamentalLieAlgebraMatrix(rng, phift);
|
envGetTmp(ComplexField, ca);
|
||||||
|
phift = zero;
|
||||||
|
for (int a = 0; a < Nadj; ++a)
|
||||||
|
{
|
||||||
|
Site ta;
|
||||||
|
|
||||||
|
gaussian(rng, ca);
|
||||||
|
Group::generator(a, ta);
|
||||||
|
phift += ca*ta;
|
||||||
|
}
|
||||||
phift *= w;
|
phift *= w;
|
||||||
LOG(Message) << "Field Fourier transform" << std::endl;
|
LOG(Message) << "Field Fourier transform" << std::endl;
|
||||||
fft.FFT_all_dim(phi, phift, FFT::backward);
|
fft.FFT_all_dim(phi, phift, FFT::backward);
|
||||||
phi = (1./sqrt(2.))*(phi - adj(phi));
|
phi = 0.5*(phi - adj(phi));
|
||||||
trphi2 = -TensorRemove(sum(trace(phi*phi))).real()/vol;
|
trphi2 = -TensorRemove(sum(trace(phi*phi))).real()/vol;
|
||||||
LOG(Message) << "tr(phi^2)= " << trphi2 << std::endl;
|
LOG(Message) << "tr(phi^2)= " << trphi2 << std::endl;
|
||||||
|
|
||||||
|
// ComplexField phi2(env().getGrid());
|
||||||
|
|
||||||
|
// phi2=trace(phi*phi);
|
||||||
|
// std::cout << phi2 << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
END_MODULE_NAMESPACE
|
END_MODULE_NAMESPACE
|
||||||
|
Loading…
x
Reference in New Issue
Block a user