53 inline static std::vector<double>
rho3D(
double rho,
int orthogdim){
54 std::vector<double> rho3d(
Nd*
Nd);
55 for (
int mu=0; mu<
Nd; mu++)
56 for (
int nu=0; nu<
Nd; nu++)
57 rho3d[mu +
Nd * nu] = (mu == nu || mu == orthogdim || nu == orthogdim) ? 0.0 : rho;
66 assert(
Nc == 3 &&
"Stout smearing currently implemented only for Nc==3");
72 std::cout <<
GridLogDebug <<
"Stout smearing constructor : Smear_Stout(const std::vector<double>& " << rho_ <<
" )" << std::endl;
73 assert(
Nc == 3 &&
"Stout smearing currently implemented only for Nc==3");
79 assert(
Nc == 3 &&
"Stout smearing currently implemented only for Nc==3");
84 void smear(GaugeField& u_smr,
const GaugeField&
U)
const {
85 GaugeField C(
U.Grid());
86 GaugeLinkField tmp(
U.Grid()), iq_mu(
U.Grid()), Umu(
U.Grid());
94 for (
int mu = 0; mu <
Nd; mu++) {
99 iq_mu =
Ta( tmp *
adj(Umu));
103 std::cout <<
GridLogDebug <<
"Stout smearing completed\n";
106 void derivative(GaugeField& SigmaTerm,
const GaugeField& iLambda,
107 const GaugeField& Gauge)
const {
108 SmearBase->derivative(SigmaTerm, iLambda, Gauge);
129 GaugeLinkField unity(grid);
132 GaugeLinkField iQ2(grid), iQ3(grid);
143 e_iQ = f0 * unity +
timesMinusI(f1) * iQ - f2 * iQ2;
147 GaugeLinkField& iQ3)
const {
148 Complex one_over_three = 1.0 / 3.0;
149 Complex one_over_two = 1.0 / 2.0;
152 LatticeComplex c0(grid), c1(grid), tmp(grid), c0max(grid), theta(grid);
159 tmp = c1 * one_over_three;
160 c0max = 2.0 *
pow(tmp, 1.5);
162 theta =
acos(c0 / c0max) *
187 h0 = e2iu * (u2 - w2) +
188 emiu * ((8.0 * u2 * cosw) + (2.0 * u * (3.0 * u2 + w2) * ixi0));
189 h1 = e2iu * (2.0 * u) - emiu * ((2.0 * u * cosw) - (3.0 * u2 - w2) * ixi0);
190 h2 = e2iu - emiu * (cosw + (3.0 * u) * ixi0);
192 fden = unity / (9.0 * u2 - w2);
208 return cos(w) / (w * w) -
sin(w) / (w * w * w);
#define INHERIT_GIMPL_TYPES(GImpl)
accelerator_inline void timesMinusI(Grid_simd2< S, V > &ret, const Grid_simd2< S, V > &in)
accelerator_inline void timesI(Grid_simd2< S, V > &ret, const Grid_simd2< S, V > &in)
accelerator_inline Grid_simd2< S, V > trace(const Grid_simd2< S, V > &arg)
accelerator_inline Grid_simd< S, V > cos(const Grid_simd< S, V > &r)
accelerator_inline Grid_simd< S, V > sin(const Grid_simd< S, V > &r)
accelerator_inline Grid_simd< S, V > acos(const Grid_simd< S, V > &r)
accelerator_inline Grid_simd< S, V > sqrt(const Grid_simd< S, V > &r)
Lattice< vobj > real(const Lattice< vobj > &lhs)
Lattice< vobj > imag(const Lattice< vobj > &lhs)
Lattice< vobj > adj(const Lattice< vobj > &lhs)
Lattice< obj > pow(const Lattice< obj > &rhs_i, RealD y)
GridLogger GridLogDebug(1, "Debug", GridLogColours, "PURPLE")
#define NAMESPACE_BEGIN(A)
void pokeLorentz(Lattice< vobj > &lhs, const Lattice< decltype(peekIndex< LorentzIndex >(vobj(), 0))> &rhs, int i)
Lattice< vTComplex > LatticeComplex
auto peekLorentz(const vobj &rhs, int i) -> decltype(PeekIndex< LorentzIndex >(rhs, 0))
std::complex< Real > Complex
accelerator_inline iScalar< vtype > Ta(const iScalar< vtype > &r)
static INTERNAL_PRECISION U
GridBase * Grid(void) const
APE type smearing of link variables.
void set_uw(LatticeComplex &u, LatticeComplex &w, GaugeLinkField &iQ2, GaugeLinkField &iQ3) const
const Smear< Gimpl > * SmearBase
static std::vector< double > rho3D(double rho, int orthogdim)
void set_fj(LatticeComplex &f0, LatticeComplex &f1, LatticeComplex &f2, const LatticeComplex &u, const LatticeComplex &w) const
const std::vector< double > SmearRho
Smear_Stout(const std::vector< double > &rho_)
LatticeComplex func_xi1(const LatticeComplex &w) const
void BaseSmear(GaugeField &C, const GaugeField &U) const
void smear(GaugeField &u_smr, const GaugeField &U) const
const std::unique_ptr< Smear< Gimpl > > OwnedBase
void derivative(GaugeField &SigmaTerm, const GaugeField &iLambda, const GaugeField &Gauge) const
LatticeComplex func_xi0(const LatticeComplex &w) const
void exponentiate_iQ(GaugeLinkField &e_iQ, const GaugeLinkField &iQ) const
Smear_Stout(double rho=1.0, int orthogdim=-1)
Smear_Stout(Smear< Gimpl > *base)