32 std::string config_file;
49template <
typename group>
51 for (
int i = 0; i < 2 * NDIM; ++i) {
54 int tpar = 1 + (tdp % 2);
73template <
typename group>
83 staples_timer.start();
93#ifdef SUN_OVERRELAX_dFJ
94 suN_overrelax_dFJ(U[d][X], staples[X], p.beta);
120template <
typename group>
123 for (
int n = 0; n < p.n_update; n++) {
124 for (
int i = 0; i <= p.n_overrelax; i++) {
137template <
typename group>
141 static bool first =
true;
147 auto plaq = measure_s_wplaq(U) / (lattice.volume() * NDIM * (NDIM - 1) / 2);
149 hila::out0 << string_format(
"MEAS % 0.6e % 0.6e % 0.6e", plaq, poly.real(), poly.imag())
157template <
typename group>
158void checkpoint(
const GaugeField<group> &U,
int trajectory,
const parameters &p) {
161 std::string config_file =
162 p.config_file +
"_" + std::to_string(
abs((trajectory + 1) / p.n_save) % 2);
168 outf.open(
"run_status", std::ios::out | std::ios::trunc);
169 outf <<
"trajectory " << trajectory + 1 <<
'\n';
170 outf <<
"seed " <<
static_cast<uint64_t
>(
hila::random() * (1UL << 61)) <<
'\n';
173 outf <<
"config name " << config_file <<
'\n';
176 std::stringstream msg;
178 hila::timestamp(msg.str().c_str());
181template <
typename group>
187 if (status.
open(
"run_status",
false,
false)) {
189 trajectory = status.
get(
"trajectory");
190 seed = status.
get(
"seed");
191 p.time_offset = status.
get(
"time");
193 std::string config_file = status.
get(
"config name");
196 U.config_read(config_file);
200 in.open(p.config_file, std::ios::in | std::ios::binary);
204 U.config_read(p.config_file);
217int main(
int argc,
char **argv) {
235 hila::out0 <<
"Using floating point epsilon: " << fp<ftype>::epsilon <<
"\n";
243 lsize = par.get(
"lattice size");
245 p.beta = par.get(
"beta");
247 p.n_traj = par.get(
"number of trajectories");
249 p.n_update = par.get(
"updates in trajectory");
251 p.n_overrelax = par.get(
"overrelax steps");
253 p.n_therm = par.get(
"thermalization trajs");
255 p.gflow_freq = par.get(
"gflow freq");
257 p.gflow_max_l = par.get(
"gflow max lambda");
259 p.gflow_l_step = par.get(
"gflow lambda step");
261 p.gflow_a_accu = par.get(
"gflow abs. accuracy");
263 p.gflow_r_accu = par.get(
"gflow rel. accuracy");
265 long seed = par.get(
"random seed");
267 p.n_save = par.get(
"trajs/saved");
269 p.config_file = par.get(
"config name");
274 lattice.
setup(lsize);
284 int start_traj = -p.n_therm;
286 if (!restore_checkpoint(U, start_traj, p)) {
296 for (
int trajectory = start_traj; trajectory < p.n_traj; ++trajectory) {
300 update_timer.start();
305 hila::synchronize_threads();
308 measure_timer.start();
310 hila::out0 <<
"Measure_start " << trajectory <<
'\n';
314 hila::out0 <<
"Measure_end " << trajectory <<
'\n';
316 measure_timer.stop();
318 if (trajectory >= 0) {
320 if (p.gflow_freq > 0 && trajectory % p.gflow_freq == 0) {
323 int gtrajectory = trajectory / p.gflow_freq;
324 if (p.gflow_l_step > 0) {
328 int nflow_steps = (int)(p.gflow_max_l / p.gflow_l_step);
330 hila::out0 <<
"Gflow_start " << gtrajectory <<
'\n';
334 ftype t_step = t_step0;
335 measure_gradient_flow_stuff(V, (ftype)0.0, t_step);
336 t_step = do_gradient_flow_adapt(V, (ftype)0.0, p.gflow_l_step, p.gflow_a_accu,
337 p.gflow_r_accu, t_step);
338 measure_gradient_flow_stuff(V, p.gflow_l_step, t_step);
341 for (
int i = 1; i < nflow_steps; ++i) {
344 do_gradient_flow_adapt(V, i * p.gflow_l_step, (i + 1) * p.gflow_l_step,
345 p.gflow_a_accu, p.gflow_r_accu, t_step);
347 measure_gradient_flow_stuff(V, (i + 1) * p.gflow_l_step, t_step);
350 hila::out0 <<
"Gflow_end " << gtrajectory <<
" time " << std::setprecision(3)
358 if (p.n_save > 0 && (trajectory + 1) % p.n_save == 0) {
359 checkpoint(U, trajectory, p);
The field class implements the standard methods for accessing Fields. Hilapp replaces the parity acce...
void reunitarize_gauge()
Reunitarize Gauge Field consisting of matrices.
void config_write(const std::string &filename) const
config_write writes the gauge field to file, with additional "verifying" header
static constexpr int size()
Returns size of Vector or square Matrix.
void setup(const CoordinateVector &siz)
General lattice setup.
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,...
Direction
Enumerator for direction that assigns integer to direction to be interpreted as unit vector.
double random()
Real valued uniform random number generator.
int myrank()
rank of this node
std::ostream out0
This writes output only from main process (node 0)
void initialize(int argc, char **argv)
Read in command line arguments. Initialise default stream and MPI communication.
void seed_random(uint64_t seed, bool device_rng=true)
Seed random generators with 64-bit unsigned value. On MPI shuffles the seed so that different MPI ran...
T broadcast(T &var, int rank=0)
Broadcast the value of var to all MPI ranks from rank (default=0).
void finishrun()
Normal, controlled exit - all nodes must call this. Prints timing information and information about c...
Complex< double > measure_polyakov(const GaugeField< T > &U, Direction dir=Direction(NDIM - 1))
Measure Polyakov lines to direction dir.
void staplesum(const GaugeField< T > &U, Field< T > &staples, Direction d1, Parity par=ALL)
Sum the staples of link matrices to direction dir.
void update(GaugeField< group > &U, const parameters &p, bool relax)
Wrapper update function.
void update_parity_dir(GaugeField< group > &U, const parameters &p, Parity par, Direction d, bool relax)
Wrapper function to updated GaugeField per direction.
void do_trajectory(GaugeField< group > &U, const parameters &p)
Evolve gauge field.
void measure_stuff(const GaugeField< group > &U, const parameters &p)
Measures Polyakov lines and Wilson action.
double suN_heatbath(SU< N, T > &U, const SU< N, T > &staple, double beta)
heatbath
void suN_overrelax(SU< N, T > &U, const SU< N, T > &staple)
Overrelaxation using SU(2) subgroups