3#ifndef CLOVER_ACTION_H_
4#define CLOVER_ACTION_H_
11template <
typename group,
typename atype = hila::arithmetic_type<group>>
18 U[d2].start_gather(d1,
ALL);
19 U[d1].start_gather(d2,
ALL);
24 tF[X] = U[d2][X + d1] * (U[d2][X] * U[d1][X + d2]).
dagger();
26 C[0][X] = U[d1][X] * tF[X];
29 C[2][X] = tF[X] * U[d1][X];
32 C[2].start_gather(-d1,
ALL);
36 Csum[X] = U[d2][X].dagger() * C[0][X] * U[d2][X];
39 Csum.start_gather(-d2,
ALL);
42 C[1][X] = C[2][X - d1];
45 tF[X] = U[d2][X].dagger() * C[1][X] * U[d2][X];
51 C[3][X] = Csum[X - d2];
63 Csum[X] -= Csum[X].
dagger();
65 Csum[X] -= trace(Csum[X]) / group::size();
69template <
typename group>
78 get_clover_leaves(U, dir1, dir2, C, Csum);
83 return stot.
value() / group::size();
86template <
typename group,
typename atype = hila::arithmetic_type<group>>
97 get_clover_leaves(U, dir1, dir2, C, Csum);
100 std::vector<Direction> paths[4] = {{dir1, dir2, -dir1, -dir2},
101 {dir2, -dir1, -dir2, dir1},
102 {-dir1, -dir2, dir1, dir2},
103 {-dir2, dir1, dir2, -dir1}};
112 for (
int k = 0; k < 4; ++k) {
116 tC[X] = C[k][X] * Csum[X];
121 get_wloop_force_from_wl_add(U, paths[k], tC, eps, K);
126template <
typename group,
typename atype = hila::arithmetic_type<group>>
133 get_force_clover_add(U, K, eps);
The field class implements the standard methods for accessing Fields. Hilapp replaces the parity acce...
Field< A > dagger() const
Returns dagger or Hermitian conjugate of Field depending on how it is defined for Field type T.
double squarenorm() const
Squarenorm.
dir_mask_t start_gather(Direction d, Parity p=ALL) const
Special reduction class: enables delayed and non-blocking reductions, which are not possible with the...
const T value()
Return value of the reduction variable. Wait for the comms if needed.
Reduction & allreduce(bool b=true)
allreduce(bool) turns allreduce on or off. By default on.
Reduction & delayed(bool b=true)
deferred(bool) turns deferred on or off. By default turns on.
Complex< T > dagger(const Complex< T > &val)
Return dagger of Complex number.
#define foralldir(d)
Macro to loop over (all) Direction(s)
Direction
Enumerator for direction that assigns integer to direction to be interpreted as unit vector.
constexpr Parity ALL
bit pattern: 011