1
0
mirror of https://github.com/paboyle/Grid.git synced 2024-09-20 17:25:37 +01:00

One more function to generalise the HMC integrator

This commit is contained in:
Guido Cossu 2016-10-03 15:50:04 +01:00
parent e415260961
commit 257f69f931
2 changed files with 12 additions and 11 deletions

View File

@ -96,6 +96,17 @@ public:
} }
static inline RealD FieldSquareNorm(Field& U){
LatticeComplex Hloc(U._grid);
Hloc = zero;
for (int mu = 0; mu < Nd; mu++) {
auto Umu = PeekIndex<LorentzIndex>(U, mu);
Hloc += trace(Umu * Umu);
}
Complex Hsum = sum(Hloc);
return Hsum.real();
}
}; };
// Composition with smeared link, bc's etc.. probably need multiple inheritance // Composition with smeared link, bc's etc.. probably need multiple inheritance

View File

@ -253,17 +253,7 @@ class Integrator {
// Calculate action // Calculate action
RealD S(Field& U) { // here also U not used RealD S(Field& U) { // here also U not used
LatticeComplex Hloc(U._grid); RealD H = - FieldImplementation::FieldSquareNorm(P); // - trace (P*P)
Hloc = zero;
// Momenta --- modify this (take the trace of field)
// momenta_action()
for (int mu = 0; mu < Nd; mu++) {
auto Pmu = PeekIndex<LorentzIndex>(P, mu);
Hloc -= trace(Pmu * Pmu);
}
Complex Hsum = sum(Hloc);
RealD H = Hsum.real();
RealD Hterm; RealD Hterm;
std::cout << GridLogMessage << "Momentum action H_p = " << H << "\n"; std::cout << GridLogMessage << "Momentum action H_p = " << H << "\n";