From 05c1c88440a9b00c4a35e8487ab92a27afb48aea Mon Sep 17 00:00:00 2001 From: Antonin Portelli Date: Tue, 3 Oct 2017 14:26:20 +0100 Subject: [PATCH] Scalar: more action generalisation --- lib/qcd/action/scalar/ScalarInteractionAction.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/qcd/action/scalar/ScalarInteractionAction.h b/lib/qcd/action/scalar/ScalarInteractionAction.h index 9d855137..3848751d 100644 --- a/lib/qcd/action/scalar/ScalarInteractionAction.h +++ b/lib/qcd/action/scalar/ScalarInteractionAction.h @@ -46,6 +46,7 @@ public: private: RealD mass_square; RealD lambda; + RealD g; const unsigned int N = Impl::Group::Dimension; typedef typename Field::vector_object vobj; @@ -57,7 +58,7 @@ private: std::vector displacements; // = {1,1,1,1, -1,-1,-1,-1}; public: - ScalarInteractionAction(RealD ms, RealD l) : mass_square(ms), lambda(l), displacements(2 * Ndim, 0), directions(2 * Ndim, 0) + ScalarInteractionAction(RealD ms, RealD l, RealD gval) : mass_square(ms), lambda(l), g(gval), displacements(2 * Ndim, 0), directions(2 * Ndim, 0) { for (int mu = 0; mu < Ndim; mu++) { @@ -73,6 +74,7 @@ public: std::stringstream sstream; sstream << GridLogMessage << "[ScalarAction] lambda : " << lambda << std::endl; sstream << GridLogMessage << "[ScalarAction] mass_square : " << mass_square << std::endl; + sstream << GridLogMessage << "[ScalarAction] g : " << g << std::endl; return sstream.str(); } @@ -86,8 +88,8 @@ public: static Stencil phiStencil(p._grid, npoint, 0, directions, displacements); phiStencil.HaloExchange(p, compressor); Field action(p._grid), pshift(p._grid), phisquared(p._grid); - phisquared = p*p; - action = (2.*Ndim + mass_square) * phisquared - phisquared * phisquared; + phisquared = p * p; + action = (2.0 * Ndim + mass_square) * phisquared - lambda * phisquared * phisquared; for (int mu = 0; mu < Ndim; mu++) { // pshift = Cshift(p, mu, +1); // not efficient, implement with stencils @@ -122,13 +124,13 @@ public: } // NB the trace in the algebra is normalised to 1/2 // minus sign coming from the antihermitian fields - return -(TensorRemove(sum(trace(action)))).real()*N/lambda; + return -(TensorRemove(sum(trace(action)))).real()*N/g; }; virtual void deriv(const Field &p, Field &force) { assert(p._grid->Nd() == Ndim); - force = (2.0 * Ndim + mass_square) * p - 2. * p * p * p; + force = (2. * Ndim + mass_square) * p - 2. * lambda * p * p * p; // move this outside static Stencil phiStencil(p._grid, npoint, 0, directions, displacements); phiStencil.HaloExchange(p, compressor); @@ -163,7 +165,7 @@ public: } } } - force *= N/lambda; + force *= N/g; } };