HILA
Loading...
Searching...
No Matches
stout_smear.h
1#ifndef STOUT_SMEAR_H_
2#define STOUT_SMEAR_H_
3
4#include "hila.h"
5
6#include "gauge/staples.h"
7
8/////////////////////////////////////////////////////////////////////////////
9/// Do stout smearing for the gauge fields
10/// res = U * exp( Algebra (U * Staples) )
11
12template <typename T>
13void stout_smear1(const GaugeField<T> &U, Field<T> &s, float coeff, Direction d) {
14 staplesum(U, s, d, ALL);
15 onsites(ALL) {
16 s[X] = exp(coeff * (s[X] * U[d][X].dagger()).project_to_algebra()) * U[d][X];
17 }
18}
19
20template <typename T>
21void stout_smear1(const GaugeField<T> &U, GaugeField<T> &stout, float coeff) {
22 foralldir(d) stout_smear1(U,stout[d],coeff,d);
23 // stout_smear1(U,stout[e_t],coeff,e_t);
24}
25
26
27
28template <typename T>
29void stout_smear(const GaugeField<T> &U, GaugeField<T> &stout, float coeff, int iter) {
30 stout = U;
31 if (iter > 0) {
32 stout_smear1(U,stout,coeff);
33
34 GaugeField<T> tmp;
35 for (int i=1; i<iter; i++) {
36 stout_smear1(stout,tmp,coeff);
37 stout = tmp;
38// std::swap(stout,tmp);
39 }
40 }
41}
42
43
44
45#endif
The field class implements the standard methods for accessing Fields. Hilapp replaces the parity acce...
Definition field.h:61
Gauge field class.
Definition gaugefield.h:22
Complex< T > dagger(const Complex< T > &val)
Return dagger of Complex number.
Definition cmplx.h:1358
#define foralldir(d)
Macro to loop over (all) Direction(s)
Definition coordinates.h:78
Direction
Enumerator for direction that assigns integer to direction to be interpreted as unit vector.
Definition coordinates.h:34
constexpr Parity ALL
bit pattern: 011
void staplesum(const GaugeField< T > &U, Field< T > &staples, Direction d1, Parity par=ALL)
Sum the staples of link matrices to direction dir.
Definition staples.h:28