mirror of
https://github.com/paboyle/Grid.git
synced 2025-06-18 07:47:06 +01:00
Hadrons: Scalar SU(N) utility functions
This commit is contained in:
@ -31,6 +31,7 @@ See the full license in the file "LICENSE" in the top level distribution directo
|
||||
#include <Grid/Hadrons/Global.hpp>
|
||||
#include <Grid/Hadrons/Module.hpp>
|
||||
#include <Grid/Hadrons/ModuleFactory.hpp>
|
||||
#include <Grid/Hadrons/Modules/MScalarSUN/Utils.hpp>
|
||||
|
||||
BEGIN_HADRONS_NAMESPACE
|
||||
|
||||
@ -73,9 +74,6 @@ public:
|
||||
virtual void setup(void);
|
||||
// execution
|
||||
virtual void execute(void);
|
||||
private:
|
||||
// output name generator
|
||||
std::string outName(const unsigned int n);
|
||||
};
|
||||
|
||||
MODULE_REGISTER_NS(TrPhiSU2, TTrPhi<ScalarNxNAdjImplR<2>>, MScalarSUN);
|
||||
@ -109,7 +107,7 @@ std::vector<std::string> TTrPhi<SImpl>::getOutput(void)
|
||||
|
||||
for (unsigned int n = 2; n <= par().maxPow; n += 2)
|
||||
{
|
||||
out.push_back(outName(n));
|
||||
out.push_back(varName(getName(), n));
|
||||
}
|
||||
|
||||
return out;
|
||||
@ -127,7 +125,7 @@ void TTrPhi<SImpl>::setup(void)
|
||||
envTmpLat(Field, "buf");
|
||||
for (unsigned int n = 2; n <= par().maxPow; n += 2)
|
||||
{
|
||||
envCreateLat(ComplexField, outName(n));
|
||||
envCreateLat(ComplexField, varName(getName(), n));
|
||||
}
|
||||
}
|
||||
|
||||
@ -147,7 +145,7 @@ void TTrPhi<SImpl>::execute(void)
|
||||
phi2 = -phi*phi;
|
||||
for (unsigned int n = 2; n <= par().maxPow; n += 2)
|
||||
{
|
||||
auto &phin = envGet(ComplexField, outName(n));
|
||||
auto &phin = envGet(ComplexField, varName(getName(), n));
|
||||
|
||||
buf = buf*phi2;
|
||||
phin = trace(buf);
|
||||
@ -166,13 +164,6 @@ void TTrPhi<SImpl>::execute(void)
|
||||
}
|
||||
}
|
||||
|
||||
// output name generator ///////////////////////////////////////////////////////
|
||||
template <typename SImpl>
|
||||
std::string TTrPhi<SImpl>::outName(const unsigned int n)
|
||||
{
|
||||
return getName() + "_" + std::to_string(n);
|
||||
}
|
||||
|
||||
END_MODULE_NAMESPACE
|
||||
|
||||
END_HADRONS_NAMESPACE
|
||||
|
Reference in New Issue
Block a user