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 C[0][X] = U[d1][X] * U[d2][X + d1] * (U[d2][X] * U[d1][X + d2]).
dagger();
28 C[2][X] = U[d1][X].dagger() * C[0][X] * U[d1][X];
31 C[2].start_gather(-d1,
ALL);
35 Csum[X] = U[d2][X].dagger() * C[0][X] * U[d2][X];
41 C[1][X] = C[2][X - d1];
44 tF[X] = U[d2][X].dagger() * C[1][X] * U[d2][X];
50 C[3][X] = Csum[X - d2];
62 Csum[X] -= Csum[X].
dagger();
64 Csum[X] -= trace(Csum[X]) / group::size();
68template <
typename group,
typename atype = hila::arithmetic_type<group>>
77 get_clover_leaves(U, dir1, dir2, C, Csum);
82 return (atype)stot.
value() / group::size();
85template <
typename group,
typename atype = hila::arithmetic_type<group>>
96 get_clover_leaves(U, dir1, dir2, C, Csum);
99 std::vector<Direction> paths[4] = {{dir1, dir2, -dir1, -dir2},
100 {dir2, -dir1, -dir2, dir1},
101 {-dir1, -dir2, dir1, dir2},
102 {-dir2, dir1, dir2, -dir1}};
111 for (
int k = 0; k < 4; ++k) {
115 tC[X] = C[k][X] * Csum[X];
120 get_wloop_force_from_wl_add(U, paths[k], tC, eps, K);
125template <
typename group,
typename atype = hila::arithmetic_type<group>>
131 get_force_clover_add(U, K, eps);
Array< n, m, hila::arithmetic_type< T > > real(const Array< n, m, T > &arg)
Return real part of Array.
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.
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
auto mul_trace(const Mtype1 &a, const Mtype2 &b)
Returns trace of product of two matrices.