DiagMC
Diagrammatic Monte Carlo simulation of a 2-level spin system in a magnetic field
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | Friends | List of all members
SingleRunResults Class Reference

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...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ SingleRunResults()

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.

Parameters
betaLength of the diagram (here representing 1/T). Must be > 0.
initial_s0Spin of the 0-th segment of the diagram [0—t1]. Must be +1 or -1.
HValue of the longitudinal component of magnetic field
GAMMAValue of the transversal component of magnetic field. Must be != 0.
N_total_stepsTotal number of steps of the MCMC algorithm
N_thermalization_stepsNumber of initial steps for which statistics is not collected
update_choice_seedSeed for the Mersenne-Twister random number generator to choose WHICH update to attempt
diagram_seedSeed for the diagram, used INSIDE the updates

Member Function Documentation

◆ ostream_output_header()

static std::string SingleRunResults::ostream_output_header ( )
static

Returns a line containing the titles of the columns of the output file.

Returns
std::string

◆ print_results()

void SingleRunResults::print_results ( ) const

Prints a summary of the result of the run on the terminal standard output.

Friends And Related Function Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  os,
const SingleRunResults results 
)
friend

Output stream operator to write a single formatted line with all the parameters and results of the simulation.

Parameters
osstd::ostream object, e.g. std::ofstream, or std::cout
resultsSingleRunResults object, containin all the parameters and results of the simulation
Returns
std::ostream&

Member Data Documentation

◆ avg_diagram_order

unsigned long long int SingleRunResults::avg_diagram_order = 0

Average diagram order during the whole run.

Definition at line 48 of file simulation.h.

◆ max_diagram_order

unsigned long long int SingleRunResults::max_diagram_order = 0

Maximum diagram order during the whole run.

Definition at line 47 of file simulation.h.

◆ measured_sigmax

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.

◆ measured_sigmaz

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.

◆ N_accepted_addsegment

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.

◆ N_accepted_flips

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.

◆ N_accepted_removesegment

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.

◆ N_attempted_addsegment

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.

◆ N_attempted_flips

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.

◆ N_attempted_removesegment

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.

◆ N_measures

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.

◆ run_time

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.


The documentation for this class was generated from the following file: