Loading...
Searching...
No Matches
monte_carlo.hpp
Go to the documentation of this file.
#ifndef __MONTE_CARLO__
#define __MONTE_CARLO__
#include "IsingModel.hpp"
#include "data_type.hpp"
#include "utils.hpp"
#include <functional>
#include <string>
#include <omp.h>
//#define BURN_IN_TIME 12500
#define BURN_IN_TIME 5000
#pragma omp declare reduction(+: data_t: omp_out += omp_in)
int test_2x2_lattice(double tol, int max_cycles);
void monte_carlo_progression(double T, int L, int cycles,
const std::string filename);
void monte_carlo_progression(double T, int L, int cycles, int value,
const std::string filename);
void pd_estimate(double T, int L, int cycles, const std::string filename);
data_t monte_carlo_serial(int L, double T, int cycles);
data_t monte_carlo_parallel(int L, double T, int cycles);
void phase_transition(
int L, double start_T, double end_T, int points_T,
std::function<data_t(int, double, int)> monte_carlo,
std::string outfile);
#endif
IsingModel.hpp
The definition of the Ising model.
data_t
Definition: data_type.hpp:18
data_type.hpp
Header for the data_t type.
phase_transition
void phase_transition(int L, double start_T, double end_T, int points_T, std::function< data_t(int, double, int)> monte_carlo, std::string outfile)
Perform the MCMC algorithm using a range of temperatures.
Definition: monte_carlo.cpp:156
monte_carlo_serial
data_t monte_carlo_serial(int L, double T, int cycles)
Execute the Metropolis algorithm for a certain amount of Monte Carlo cycles.
Definition: monte_carlo.cpp:111
pd_estimate
void pd_estimate(double T, int L, int cycles, const std::string filename)
Estimate the probability distribution for the energy.
Definition: monte_carlo.cpp:85
test_2x2_lattice
int test_2x2_lattice(double tol, int max_cycles)
Test numerical data with analytical data.
monte_carlo_progression
void monte_carlo_progression(double T, int L, int cycles, const std::string filename)
Write the expected values for each Monte Carlo cycles to file.
Definition: monte_carlo.cpp:17
monte_carlo_parallel
data_t monte_carlo_parallel(int L, double T, int cycles)
Execute the Metropolis algorithm for a certain amount of Monte Carlo cycles in parallel.
Definition: monte_carlo.cpp:128
utils.hpp
Function prototypes and macros that are useful.