DiagMC
Diagrammatic Monte Carlo simulation of a 2-level spin system in a magnetic field
Loading...
Searching...
No Matches
simulation.h
Go to the documentation of this file.
1
8#pragma once
9
10#include <diagmc/diagram.h>
11#include <ostream>
12#include <chrono>
13
14
22{
23
24 private:
25
26 //parameters of the simulation
27 double beta;
28 double initial_s0;
29 double H;
30 double GAMMA;
31 unsigned long long int N_total_steps;
32 unsigned long long int N_thermalization_steps;
33 unsigned long long int update_choice_seed;
34 unsigned long long int diagram_seed;
35
36
37 public:
38
39 //variables to store the statistics of the simulation
40 unsigned long long int N_measures = 0;
41 unsigned long long int N_attempted_flips = 0;
42 unsigned long long int N_accepted_flips = 0;
43 unsigned long long int N_attempted_addsegment = 0;
44 unsigned long long int N_accepted_addsegment = 0;
45 unsigned long long int N_attempted_removesegment = 0;
46 unsigned long long int N_accepted_removesegment = 0;
47 unsigned long long int max_diagram_order = 0;
48 unsigned long long int avg_diagram_order = 0;
49 unsigned long long int run_time = 0;
50 double measured_sigmax = 0;
51 double measured_sigmaz = 0;
52
53
54
69 double beta,
70 double initial_s0,
71 double H,
72 double GAMMA,
73 unsigned long long int N_total_steps,
74 unsigned long long int N_thermalization_steps,
75 unsigned long long int update_choice_seed,
76 unsigned long long int diagram_seed
77 );
78
79
84 void print_results() const;
85
86
92 static std::string ostream_output_header();
93
94
102 friend std::ostream & operator << (std::ostream & os, const SingleRunResults & results);
103
104};
105
106
122 double beta,
123 double initial_s0,
124 double H,
125 double GAMMA,
126 unsigned long long int N_total_steps,
127 unsigned long long int N_thermalization_steps,
128 unsigned long long int update_choice_seed = std::chrono::system_clock::now().time_since_epoch().count(),
129 unsigned long long int diagram_seed = std::chrono::system_clock::now().time_since_epoch().count()
130 );
Container class to store all the simulation parameters, and the results of a run. It provides methods...
Definition: simulation.h:22
unsigned long long int N_measures
Number of samples (iterations) for which the magnetizations and diagram order statstics were collecte...
Definition: simulation.h:40
unsigned long long int N_attempted_removesegment
Number of times the REMOVE_SEGMENT update was attempted.
Definition: simulation.h:45
unsigned long long int avg_diagram_order
Average diagram order during the whole run.
Definition: simulation.h:48
unsigned long long int max_diagram_order
Maximum diagram order during the whole run.
Definition: simulation.h:47
unsigned long long int run_time
Execution time (in nanoseconds) for the Markov Chain loop (not the program run time)
Definition: simulation.h:49
static std::string ostream_output_header()
Returns a line containing the titles of the columns of the output file.
void print_results() const
Prints a summary of the result of the run on the terminal standard output.
double measured_sigmax
Final value of the magnetization along x calculated through the MCMC algorithm.
Definition: simulation.h:50
unsigned long long int N_attempted_flips
Number of times the SPIN_FLIP update was attempted.
Definition: simulation.h:41
unsigned long long int N_accepted_addsegment
Number of times the ADD_SEGMENT update was accepted.
Definition: simulation.h:44
unsigned long long int N_accepted_removesegment
Number of times the REMOVE_SEGMENT update was accepted.
Definition: simulation.h:46
unsigned long long int N_accepted_flips
Number of times the SPIN_FLIP update was accepted.
Definition: simulation.h:42
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 arg...
friend 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 si...
double measured_sigmaz
Final value of the magnetization along z calculated through the MCMC algorithm.
Definition: simulation.h:51
unsigned long long int N_attempted_addsegment
Number of times the ADD_SEGMENT update was attempted.
Definition: simulation.h:43
Header file for Diagram and Diagram_core classes.
SingleRunResults run_simulation(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=std::chrono::system_clock::now().time_since_epoch().count(), unsigned long long int diagram_seed=std::chrono::system_clock::now().time_since_epoch().count())
Runs the Markov Chain Diagrammatic Monte Carlo algorithm for the 2-level spin sistem,...