1
0
mirror of https://github.com/paboyle/Grid.git synced 2025-04-09 05:30:46 +01:00

Hadrons: scalar SU(N) various fixes

This commit is contained in:
Antonin Portelli 2018-05-14 18:58:39 +01:00
parent 48de706dd5
commit 5e3be47117
2 changed files with 6 additions and 6 deletions

View File

@ -40,7 +40,7 @@ BEGIN_HADRONS_NAMESPACE
******************************************************************************/ ******************************************************************************/
BEGIN_MODULE_NAMESPACE(MScalarSUN) BEGIN_MODULE_NAMESPACE(MScalarSUN)
typedef std::pair<unsigned int, unsigned int> ShiftPair; typedef std::pair<int, int> ShiftPair;
class ShiftProbePar: Serializable class ShiftProbePar: Serializable
{ {
@ -127,7 +127,7 @@ void TShiftProbe<SImpl>::execute(void)
<< std::endl; << std::endl;
std::vector<ShiftPair> shift; std::vector<ShiftPair> shift;
unsigned int sign; double sign;
auto &phi = envGet(Field, par().field); auto &phi = envGet(Field, par().field);
auto &probe = envGet(ComplexField, getName()); auto &probe = envGet(ComplexField, getName());
@ -136,7 +136,7 @@ void TShiftProbe<SImpl>::execute(void)
{ {
HADRONS_ERROR(Size, "the number of shifts is odd"); HADRONS_ERROR(Size, "the number of shifts is odd");
} }
sign = (shift.size() % 4 == 0) ? 1 : -1; sign = (shift.size() % 4 == 0) ? 1. : -1.;
for (auto &s: shift) for (auto &s: shift)
{ {
if (s.first >= env().getNd()) if (s.first >= env().getNd())
@ -147,7 +147,7 @@ void TShiftProbe<SImpl>::execute(void)
} }
} }
envGetTmp(Field, acc); envGetTmp(Field, acc);
acc = 1.; acc = 1.;
for (unsigned int i = 0; i < shift.size(); ++i) for (unsigned int i = 0; i < shift.size(); ++i)
{ {
if (shift[i].second == 0) if (shift[i].second == 0)
@ -159,7 +159,7 @@ void TShiftProbe<SImpl>::execute(void)
acc *= Cshift(phi, shift[i].first, shift[i].second); acc *= Cshift(phi, shift[i].first, shift[i].second);
} }
} }
probe = real(sign*trace(acc)); probe = sign*trace(acc);
if (!par().output.empty()) if (!par().output.empty())
{ {
ShiftProbeResult r; ShiftProbeResult r;

View File

@ -116,7 +116,7 @@ void TStochFreeField<SImpl>::execute(void)
SImpl::MomentumSpacePropagator(w, sqrt(par().m2)); SImpl::MomentumSpacePropagator(w, sqrt(par().m2));
w *= par().g/N; w *= par().g/N;
w = sqrt(vol*real(w)); w = sqrt(vol)*sqrt(w);
} }
LOG(Message) << "Generating random momentum-space field" << std::endl; LOG(Message) << "Generating random momentum-space field" << std::endl;
envGetTmp(Field, phift); envGetTmp(Field, phift);