DiagMC
Diagrammatic Monte Carlo simulation of a 2-level spin system in a magnetic field
Loading...
Searching...
No Matches
setup.h
Go to the documentation of this file.
1
8#pragma once
9
10#include <nlohmann/json.hpp>
11using json = nlohmann::json;
12
13
21void check_required_keys_presence(const json & settings, std::vector<std::string> list_of_keys);
22
23
35std::vector<double> range_generator(const json & settings, std::string which);
36
37
49std::vector<double> log_range_generator(const json & settings, std::string which);
50
51
57void print_progress_bar(double progress);
58
59
68json read_settings(std::string filename = "settings.json");
69
70
77void single_run(const json & settings);
78
79
89void sweep(const json & settings);
90
91
101void convergence_test(const json & settings);
102
103
109void launch_calculations(std::string settings_filename);
void convergence_test(const json &settings)
Perform a convergence test on the number of steps for the MCMC algorithm, by performing multiple runs...
std::vector< double > range_generator(const json &settings, std::string which)
If "which"_min, "which"_max and "which"_step parameter are present in settings, returns a vector of l...
void sweep(const json &settings)
Perform multiple runs for different values of the beta, H and GAMMA parameters, sweeping the range be...
void print_progress_bar(double progress)
Prints a progress bar on standard output.
json read_settings(std::string filename="settings.json")
Read settings for the simulation from json file, and returns them as a json dictionary-like object If...
void single_run(const json &settings)
Perform a single run for the given parameters in setting, printing a summary of the results on standa...
void launch_calculations(std::string settings_filename)
Call the read_settings function to read settings from file, and select which calculation to run.
std::vector< double > log_range_generator(const json &settings, std::string which)
If "which"_min, "which"_max and "which"_points_per_decade parameter are present in settings,...
void check_required_keys_presence(const json &settings, std::vector< std::string > list_of_keys)
Check that all keys in list_of_keys are present in settings, otherwise terminate the program with EXI...