3#ifndef ENERGY_AND_TOPO_CHARGE_CLOVER_H_
4#define ENERGY_AND_TOPO_CHARGE_CLOVER_H_
9template <
typename group,
typename atype = hila::arithmetic_type<group>>
10void measure_topo_charge_and_energy_clover(
const GaugeField<group> &U, atype &qtopo_out,
47 U[dir2].start_gather(dir1,
ALL);
48 U[dir1].start_gather(dir2,
ALL);
53 tF0[X] = U[dir1][X] * U[dir2][X + dir1] * (U[dir2][X] * U[dir1][X + dir2]).
dagger();
57 tF0[X] -= trace(tF0[X]) / group::size();
59 tF1[X] = U[dir1][X].dagger() * tF0[X] * U[dir1][X];
64 tF0[X] += tF1[X - dir1];
67 U[dir2].start_gather(-dir2,
ALL);
73 (tF0[X] + U[dir2][X - dir2].dagger() * tF0[X - dir2] * U[dir2][X - dir2]) * 0.25;
91 qtopo_out = (atype)qtopo.
value() / (4.0 * M_PI * M_PI);
92 energy_out = (atype)energy.
value();
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.
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)
constexpr Parity ALL
bit pattern: 011
auto mul_trace(const Mtype1 &a, const Mtype2 &b)
Returns trace of product of two matrices.