2 Dimensional Ising Model
Simulate the change in energy and magnetization in a ferro magnet
Loading...
Searching...
No Matches
monte_carlo.hpp
Go to the documentation of this file.
1
12#ifndef __MONTE_CARLO__
13#define __MONTE_CARLO__
14
15#include "IsingModel.hpp"
16#include "data_type.hpp"
17#include "utils.hpp"
18
19#include <functional>
20#include <omp.h>
21#include <string>
22
23// #define BURN_IN_TIME 12500
24#define BURN_IN_TIME 5000
25
26namespace montecarlo {
35void progression(double T, int L, int cycles, const std::string filename,
36 int burn_in_time = BURN_IN_TIME);
37
47void progression(double T, int L, int cycles, int value,
48 const std::string filename, int burn_in_time = BURN_IN_TIME);
49
58void pd_estimate(double T, int L, int cycles, const std::string filename,
59 int burn_in_time = BURN_IN_TIME);
60
71data_t mcmc_serial(int L, double T, int cycles,
72 int burn_in_time = BURN_IN_TIME);
73
84data_t mcmc_parallel(int L, double T, int cycles,
85 int burn_in_time = BURN_IN_TIME);
86
97void phase_transition(int L, double start_T, double end_T, int points_T,
98 int cycles,
99 std::function<data_t(int, double, int, int)> monte_carlo,
100 std::string outfile, int burn_in_time = BURN_IN_TIME);
101}; // namespace montecarlo
102
103#endif
The definition of the Ising model.
Type to use with the IsingModel class and montecarlo module.
Definition: data_type.hpp:19
Header for the data_t type.
void phase_transition(int L, double start_T, double end_T, int points_T, int cycles, std::function< data_t(int, double, int, int)> monte_carlo, std::string outfile, int burn_in_time=BURN_IN_TIME)
Perform the MCMC algorithm using a range of temperatures.
void progression(double T, int L, int cycles, const std::string filename, int burn_in_time=BURN_IN_TIME)
Write the expected values for each Monte Carlo cycles to file.
Definition: monte_carlo.cpp:15
data_t mcmc_parallel(int L, double T, int cycles, int burn_in_time=BURN_IN_TIME)
Execute the Metropolis algorithm for a certain amount of Monte Carlo cycles in parallel.
data_t mcmc_serial(int L, double T, int cycles, int burn_in_time=BURN_IN_TIME)
Execute the Metropolis algorithm for a certain amount of Monte Carlo cycles.
void pd_estimate(double T, int L, int cycles, const std::string filename, int burn_in_time=BURN_IN_TIME)
Estimate the probability distribution for the energy.
Definition: monte_carlo.cpp:77
Function prototypes and macros that are useful.