1#ifndef TWIST_SPECIFIC_METHODS_H_
2#define TWIST_SPECIFIC_METHODS_H_
37 U[d2].start_gather(d1,
ALL);
38 U[d1].start_gather(d2, par);
41 if (d1 == e_z && d2 == e_t)
43 else if (d1 == e_t && d2 == e_z)
52 onsites(opp_parity(par)) {
53 lower[X] = U[d2][X].dagger() * U[d1][X] * U[d2][X + d1];
54 if (X.z() == 0 && X.t() == 0)
55 lower[X] *=
expi(-2 * M_PI * twist);
61 auto upper = U[d2][X] * U[d1][X + d2] * U[d2][X + d1].dagger();
62 if (X.z() == 0 && X.t() == 0)
63 upper *=
expi(2 * M_PI * twist);
65 staples[X] += upper + lower[X - d2];
79std::vector<double> measure_plaq_with_z(
GaugeField<T> U,
int twist_coeff) {
87 if (X.z() == 0 && X.t() == 0) {
88 twist[e_z][X] = -twist_coeff;
95 p = 1.0 -
real(
expi(2 * M_PI * (twist[dir1][X] / NCOLOR)) *
96 trace(U[dir1][X] * U[dir2][X + dir1] *
100 plaq_vec[X.z()] += p;
103 plaq_vec[lattice.size(e_z)] =
104 plaq.
value() / (lattice.volume() * NDIM * (NDIM - 1) / 2);
105 for (
int i = 0; i < plaq_vec.size() - 1; i++) {
106 plaq_vec[i] /= (lattice.volume() * NDIM * (NDIM - 1)) / 2;
109 return plaq_vec.vector();
121std::vector<Complex<double>>
128 for (
int plane = lattice.size(dir) - 2; plane >= 0; plane--) {
136#pragma hila safe_access(polyakov)
138 if (X.coordinate(dir) == plane) {
139 polyakov[X] = U[dir][X] * polyakov[X + dir];
147 onsites(
ALL)
if (X.coordinate(dir) == 0) {
152 ploop_z[lattice.size(e_z)] = ploop / (lattice.volume() / lattice.size(dir));
153 for (
int i = 0; i < ploop_z.size() - 1; i++) {
154 ploop_z[i] /= (lattice.volume() / lattice.size(dir));
157 return ploop_z.vector();
177 for (
int plane = lattice.size(dir) - 2; plane >= 0; plane--) {
185#pragma hila safe_access(polyakov)
187 if (X.coordinate(dir) == plane) {
188 polyakov[X] = U[dir][X] * polyakov[X + dir];
196 onsites(
ALL)
if (X.coordinate(dir) == 0) {
197 double p =
abs(trace(polyakov[X]));
201 ploop_z[lattice.size(e_z)] = ploop / (lattice.volume() / lattice.size(dir));
202 for (
int i = 0; i < ploop_z.size() - 1; i++) {
203 ploop_z[i] /= (lattice.size(e_x) * lattice.size(e_y));
206 return ploop_z.vector();
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...
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.
Complex< T > dagger(const Complex< T > &val)
Return dagger of Complex number.
T abs(const Complex< T > &a)
Return absolute value of Complex number.
Parity
Parity enum with values EVEN, ODD, ALL; refers to parity of the site. Parity of site (x,...
#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