3#ifndef IMPROVED_ACTION_H_
4#define IMPROVED_ACTION_H_
54template <
typename group,
typename atype = hila::arithmetic_type<group>>
61 U[dir2].start_gather(dir1,
ALL);
62 U[dir1].start_gather(dir2,
ALL);
65 tP[X] = U[dir1][X] * U[dir2][X + dir1] * (U[dir2][X] * U[dir1][X + dir2]).
dagger();
68 stot += c11 * (1.0 -
real(trace(tP[X])) / group::size());
77 c12 * (1.0 -
real(trace(U[dir1][X] * tP[X + dir1] * U[dir1][X].
dagger() * tP[X])) /
81 c12 * (1.0 -
real(trace(tP[X] * U[dir2][X] * tP[X + dir2] * U[dir2][X].
dagger())) /
85 return (atype)stot.
value();
88template <
typename group,
typename atype = hila::arithmetic_type<group>>
100 U[dir2].start_gather(dir1,
ALL);
101 U[dir1].start_gather(dir2,
ALL);
105 lstap[X] = (U[dir1][X] * U[dir2][X + dir1]).
dagger() * U[dir2][X];
106 ustap[X] = U[dir2][X + dir1] * (U[dir2][X] * U[dir1][X + dir2]).
dagger();
115 tstap[X] += lstap[X - dir2];
120 tstap[X] += ustap[X];
121 tstap[X] += lstap[X - dir2];
128 onsites(
ALL) ustap[X] = lstap[X - dir2].
dagger() * ustap[X];
131 std::vector<Direction> path = {-dir2, dir1, dir2, dir2, -dir1, -dir2};
134 get_wloop_force_from_wl_add(U, path, ustap, c12, K);
139 K[dir1][X] -= (U[dir1][X] * tstap[X]).project_to_algebra_scaled(c11);
144template <
typename group,
typename atype = hila::arithmetic_type<group>>
152 get_force_impr_add(U, K, c11, c12);
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)
constexpr Parity ALL
bit pattern: 011