mcpele
1.0.0
The Monte Carlo Python Energy Landscape Explorer
|
Metropolis acceptance test. More...
#include <metropolis_test.h>
Public Member Functions | |
MetropolisTest (const size_t rseed) | |
virtual | ~MetropolisTest () |
virtual bool | test (pele::Array< double > &trial_coords, double trial_energy, pele::Array< double > &old_coords, double old_energy, double temperature, MC *mc) |
size_t | get_seed () const |
void | set_generator_seed (const size_t inp) |
Protected Attributes | |
size_t | m_seed |
std::mt19937_64 | m_generator |
std::uniform_real_distribution < double > | m_distribution |
Metropolis acceptance test.
The Metropolis acceptance criterion accepts each move with probability
\[ P( x_{old} \Rightarrow x_{new}) = min \{ 1, \exp [- \beta (E_{new} - E_{old})] \} \]
where \(\beta\) is the reciprocal of the temperature
Definition at line 21 of file metropolis_test.h.
mcpele::MetropolisTest::MetropolisTest | ( | const size_t | rseed | ) |
Constructor.
rseed | a random positive integer |
Definition at line 10 of file metropolis_test.cpp.
virtual mcpele::MetropolisTest::~MetropolisTest | ( | ) | [inline, virtual] |
Destructor.
Definition at line 33 of file metropolis_test.h.
size_t mcpele::MetropolisTest::get_seed | ( | ) | const [inline] |
Definition at line 49 of file metropolis_test.h.
void mcpele::MetropolisTest::set_generator_seed | ( | const size_t | inp | ) | [inline] |
Definition at line 50 of file metropolis_test.h.
bool mcpele::MetropolisTest::test | ( | pele::Array< double > & | trial_coords, |
double | trial_energy, | ||
pele::Array< double > & | old_coords, | ||
double | old_energy, | ||
double | temperature, | ||
MC * | mc | ||
) | [virtual] |
trial_coords | array of trial coordinates |
trial_energy | energy associated with trial_coords |
old_coords | array of coordinates before TakeStep |
old_energy | energy associeted with old_coords |
temperature | system temperature |
mc | pointer to the MC runner |
Implements mcpele::AcceptTest.
Definition at line 21 of file metropolis_test.cpp.
std::uniform_real_distribution<double> mcpele::MetropolisTest::m_distribution [protected] |
Distribution for random number generator
Definition at line 25 of file metropolis_test.h.
std::mt19937_64 mcpele::MetropolisTest::m_generator [protected] |
Mersenne twister random number generator
Definition at line 24 of file metropolis_test.h.
size_t mcpele::MetropolisTest::m_seed [protected] |
Seed for random number generator
Definition at line 23 of file metropolis_test.h.