DiagMC
Diagrammatic Monte Carlo simulation of a 2-level spin system in a magnetic field
|
Container class to store all the simulation parameters, and the results of a run. It provides methods to print the results on standard output, and also to produce a formatted single-line output, e.g. for writing to file. More...
#include <simulation.h>
Public Member Functions | |
SingleRunResults (double beta, double initial_s0, double H, double GAMMA, unsigned long long int N_total_steps, unsigned long long int N_thermalization_steps, unsigned long long int update_choice_seed, unsigned long long int diagram_seed) | |
Construct a new Single_Run_Results object, initializing the parameters of the simulation with the arguments, and the statistics variables to 0. More... | |
void | print_results () const |
Prints a summary of the result of the run on the terminal standard output. More... | |
Static Public Member Functions | |
static std::string | ostream_output_header () |
Returns a line containing the titles of the columns of the output file. More... | |
Public Attributes | |
unsigned long long int | N_measures = 0 |
Number of samples (iterations) for which the magnetizations and diagram order statstics were collected. More... | |
unsigned long long int | N_attempted_flips = 0 |
Number of times the SPIN_FLIP update was attempted. More... | |
unsigned long long int | N_accepted_flips = 0 |
Number of times the SPIN_FLIP update was accepted. More... | |
unsigned long long int | N_attempted_addsegment = 0 |
Number of times the ADD_SEGMENT update was attempted. More... | |
unsigned long long int | N_accepted_addsegment = 0 |
Number of times the ADD_SEGMENT update was accepted. More... | |
unsigned long long int | N_attempted_removesegment = 0 |
Number of times the REMOVE_SEGMENT update was attempted. More... | |
unsigned long long int | N_accepted_removesegment = 0 |
Number of times the REMOVE_SEGMENT update was accepted. More... | |
unsigned long long int | max_diagram_order = 0 |
Maximum diagram order during the whole run. More... | |
unsigned long long int | avg_diagram_order = 0 |
Average diagram order during the whole run. More... | |
unsigned long long int | run_time = 0 |
Execution time (in nanoseconds) for the Markov Chain loop (not the program run time) More... | |
double | measured_sigmax = 0 |
Final value of the magnetization along x calculated through the MCMC algorithm. More... | |
double | measured_sigmaz = 0 |
Final value of the magnetization along z calculated through the MCMC algorithm. More... | |
Friends | |
std::ostream & | operator<< (std::ostream &os, const SingleRunResults &results) |
Output stream operator to write a single formatted line with all the parameters and results of the simulation. More... | |
Container class to store all the simulation parameters, and the results of a run. It provides methods to print the results on standard output, and also to produce a formatted single-line output, e.g. for writing to file.
Definition at line 21 of file simulation.h.
SingleRunResults::SingleRunResults | ( | double | beta, |
double | initial_s0, | ||
double | H, | ||
double | GAMMA, | ||
unsigned long long int | N_total_steps, | ||
unsigned long long int | N_thermalization_steps, | ||
unsigned long long int | update_choice_seed, | ||
unsigned long long int | diagram_seed | ||
) |
Construct a new Single_Run_Results object, initializing the parameters of the simulation with the arguments, and the statistics variables to 0.
beta | Length of the diagram (here representing 1/T). Must be > 0. |
initial_s0 | Spin of the 0-th segment of the diagram [0—t1]. Must be +1 or -1. |
H | Value of the longitudinal component of magnetic field |
GAMMA | Value of the transversal component of magnetic field. Must be != 0. |
N_total_steps | Total number of steps of the MCMC algorithm |
N_thermalization_steps | Number of initial steps for which statistics is not collected |
update_choice_seed | Seed for the Mersenne-Twister random number generator to choose WHICH update to attempt |
diagram_seed | Seed for the diagram, used INSIDE the updates |
|
static |
Returns a line containing the titles of the columns of the output file.
void SingleRunResults::print_results | ( | ) | const |
Prints a summary of the result of the run on the terminal standard output.
|
friend |
Output stream operator to write a single formatted line with all the parameters and results of the simulation.
os | std::ostream object, e.g. std::ofstream, or std::cout |
results | SingleRunResults object, containin all the parameters and results of the simulation |
unsigned long long int SingleRunResults::avg_diagram_order = 0 |
Average diagram order during the whole run.
Definition at line 48 of file simulation.h.
unsigned long long int SingleRunResults::max_diagram_order = 0 |
Maximum diagram order during the whole run.
Definition at line 47 of file simulation.h.
double SingleRunResults::measured_sigmax = 0 |
Final value of the magnetization along x calculated through the MCMC algorithm.
Definition at line 50 of file simulation.h.
double SingleRunResults::measured_sigmaz = 0 |
Final value of the magnetization along z calculated through the MCMC algorithm.
Definition at line 51 of file simulation.h.
unsigned long long int SingleRunResults::N_accepted_addsegment = 0 |
Number of times the ADD_SEGMENT update was accepted.
Definition at line 44 of file simulation.h.
unsigned long long int SingleRunResults::N_accepted_flips = 0 |
Number of times the SPIN_FLIP update was accepted.
Definition at line 42 of file simulation.h.
unsigned long long int SingleRunResults::N_accepted_removesegment = 0 |
Number of times the REMOVE_SEGMENT update was accepted.
Definition at line 46 of file simulation.h.
unsigned long long int SingleRunResults::N_attempted_addsegment = 0 |
Number of times the ADD_SEGMENT update was attempted.
Definition at line 43 of file simulation.h.
unsigned long long int SingleRunResults::N_attempted_flips = 0 |
Number of times the SPIN_FLIP update was attempted.
Definition at line 41 of file simulation.h.
unsigned long long int SingleRunResults::N_attempted_removesegment = 0 |
Number of times the REMOVE_SEGMENT update was attempted.
Definition at line 45 of file simulation.h.
unsigned long long int SingleRunResults::N_measures = 0 |
Number of samples (iterations) for which the magnetizations and diagram order statstics were collected.
Definition at line 40 of file simulation.h.
unsigned long long int SingleRunResults::run_time = 0 |
Execution time (in nanoseconds) for the Markov Chain loop (not the program run time)
Definition at line 49 of file simulation.h.