HILA
Loading...
Searching...
No Matches
polyakov.h
Go to the documentation of this file.
1/** @file polyakov.h */
2
3#ifndef POLYAKOV_H_
4#define POLYAKOV_H_
5
6#include "hila.h"
7
8/**
9 * @brief Measure Polyakov lines to direction dir
10 * @details Naive implementation, includes extra communication
11 * @tparam T GaugeField Group
12 * @param U GaugeField to measure
13 * @param dir Direction
14 * @return Complex<double>
15 */
16template <typename T>
18
19 Field<T> polyakov = U[dir];
20
21 // mult links so that polyakov[X.dir == 0] contains the polyakov loop
22 for (int plane = lattice.size(dir) - 2; plane >= 0; plane--) {
23
24 // safe_access(polyakov) pragma allows the expression below, otherwise
25 // hilapp would reject it because X and X+dir can refer to the same
26 // site on different "iterations" of the loop. However, here this
27 // is restricted on single dir-plane so it works but we must tell it to hilapp.
28
29#pragma hila safe_access(polyakov)
30 onsites(ALL) {
31 if (X.coordinate(dir) == plane) {
32 polyakov[X] = U[dir][X] * polyakov[X + dir];
33 }
34 }
35 }
36
37 Complex<double> ploop = 0;
38
39 onsites(ALL) if (X.coordinate(dir) == 0) {
40 ploop += trace(polyakov[X]);
41 }
42
43 // return average polyakov
44 return ploop / (lattice.volume() / lattice.size(dir));
45}
46
47// template <typename T>
48// Complex<double> measure_polyakov_twist(const GaugeField<T> &U, Direction dir = Direction(NDIM - 1)) {
49
50// Field<T> polyakov = U[dir];
51
52// // mult links so that polyakov[X.dir == 0] contains the polyakov loop
53// for (int plane = lattice.size(dir) - 2; plane >= 0; plane--) {
54
55// // safe_access(polyakov) pragma allows the expression below, otherwise
56// // hilapp would reject it because X and X+dir can refer to the same
57// // site on different "iterations" of the loop. However, here this
58// // is restricted on single dir-plane so it works but we must tell it to hilapp.
59
60// #pragma hila safe_access(polyakov)
61// onsites(ALL) {
62// if (X.coordinate(dir) == plane) {
63// polyakov[X] = U[dir][X] * polyakov[X + dir];
64// }
65// }
66// }
67
68// Complex<double> ploop = 0;
69// ReductionVector<Complex<double>> ploop_z(lattice.size(e_z) + 1);
70// ploop_z = 0;
71// onsites(ALL) if (X.coordinate(dir) == 0) {
72// Complex<double> p = trace(polyakov[X]);
73// ploop += p;
74// //ploop_z[X.z()] += p;
75// }
76// ploop_z[lattice.size(e_z)] = ploop / (lattice.volume() / lattice.size(dir));
77// for (int i = 0; i < ploop_z.size() - 1; i++) {
78// ploop_z[i] /= (lattice.volume() / lattice.size(dir));
79// }
80// return ploop_z.vector();
81// // return ploop;
82// }
83
84#endif
Complex definition.
Definition cmplx.h:50
The field class implements the standard methods for accessing Fields. Hilapp replaces the parity acce...
Definition field.h:61
Gauge field class.
Definition gaugefield.h:22
Direction
Enumerator for direction that assigns integer to direction to be interpreted as unit vector.
Definition coordinates.h:34
constexpr Parity ALL
bit pattern: 011
Complex< double > measure_polyakov(const GaugeField< T > &U, Direction dir=Direction(NDIM - 1))
Measure Polyakov lines to direction dir.
Definition polyakov.h:17