1
0
mirror of https://github.com/paboyle/Grid.git synced 2025-06-12 20:27:06 +01:00

Added HMC utitities for the higher representations

TODO: Inherit types for the pseudofermions, Debugging, testing
This commit is contained in:
Guido Cossu
2016-07-15 13:39:47 +01:00
parent 9dc345e8e8
commit 7edf4c6c04
10 changed files with 201 additions and 80 deletions

View File

@ -71,7 +71,7 @@ class Integrator {
IntegratorParameters Params;
const ActionSet<GaugeField> as;
const ActionSetHirep<GaugeField, RepresentationPolicy> as;
int levels; //
double t_U; // Track time passing on each level and for U and for P
@ -113,7 +113,7 @@ class Integrator {
// to be used by the actionlevel class to iterate
// over the representations
template <class Level>
void update_P_core(Level repr_level, GaugeField& Mom, GaugeField& U,
void update_P_hireps(Level repr_level, GaugeField& Mom, GaugeField& U,
double ep) {
typedef typename Level::LatticeField FieldType;
FieldType Ur = repr_level->getRepresentation();// update U is better
@ -128,10 +128,10 @@ class Integrator {
Mom -= force * ep;
}
}
// Add the specialized class for the fundamental case
void update_P(GaugeField& Mom, GaugeField& U, int level, double ep) {
// input U actually not used in the fundamental case
// Fundamental updates, include smearing
for (int a = 0; a < as[level].actions.size(); ++a) {
GaugeField force(U._grid);
GaugeField& Us = Smearer.get_U(as[level].actions.at(a)->is_smeared);
@ -148,7 +148,7 @@ class Integrator {
Mom -= force * ep;
}
// Add here the other representations
// as[level].apply(update_P_hireps, Args...)
//apply(update_P_hireps, as[level], Args...)
}
void update_U(GaugeField& U, double ep) {
@ -179,7 +179,7 @@ class Integrator {
public:
Integrator(GridBase* grid, IntegratorParameters Par,
ActionSet<GaugeField>& Aset, SmearingPolicy& Sm)
ActionSetHirep<GaugeField, RepresentationPolicy>& Aset, SmearingPolicy& Sm)
: Params(Par), as(Aset), P(grid), levels(Aset.size()), Smearer(Sm), Representations(grid) {
t_P.resize(levels, 0.0);
t_U = 0.0;

View File

@ -151,7 +151,7 @@ namespace Grid{
MinimumNorm2(GridBase* grid,
IntegratorParameters Par,
ActionSet<GaugeField> & Aset,
ActionSetHirep<GaugeField, RepresentationPolicy> & Aset,
SmearingPolicy& Sm):
Integrator<GaugeField, SmearingPolicy, RepresentationPolicy>(grid,Par,Aset,Sm) {};