Take Step

class mcpele.monte_carlo.RandomCoordsDisplacement

Bases: mcpele.monte_carlo._takestep_cpp._Cdef_RandomCoordsDisplacement

Take a uniform random step in a bdim dimensional hypercube

this class is the Python interface for the c++ RandomCoordsDisplacement implementation. Takes a step by sampling uniformly a bdim dimensional box

Parameters:

rseed : pos int

seed for the random number generator (std:library 64 bits Merseene Twister)

stepsize : double

size of step in each dimension

report_interval : int

number of report steps for which the step size should be adapted

factor : double

factor by which the step size is adapted at each iteration durint the report interval

min_acc_ratio : double

minimum of target acceptance range

max_acc_ratio: double

maximum of target acceptance range

single : bool

True for single particle moves, False for global moves

nparticles : int

number of particles, typically len(coords)/bdim

bdim : int

dimensionality of the space (box dimensionality)

get_count()

get the total count of the number of steps taken

Returns:

int

total count of steps taken

get_seed()

return random number generator seed

Returns:

int

random number generator seed

get_stepsize()

get the step size

Returns:

double

stepsize

set_generator_seed()

sets the random number generator seed

Parameters:

input : pos int

random number generator seed

class mcpele.monte_carlo.GaussianCoordsDisplacement

Bases: mcpele.monte_carlo._takestep_cpp._Cdef_GaussianCoordsDisplacement

Take a uniform random step in a bdim dimensional hypersphere

this class is the Python interface for the c++ GaussianCoordsDisplacement implementation. Takes a step by sampling uniformly a bdim dimensional hypersphere

Parameters:

rseed : pos int

seed for the random number generator (std:library 64 bits Merseene Twister)

stepsize : double

size of step in each dimension

get_count()

get the total count of the number of steps taken

Returns:

int

total count of steps taken

get_seed()

return random number generator seed

Returns:

int

random number generator seed

get_stepsize()

get the step size

Returns:

double

stepsize

set_generator_seed()

sets the random number generator seed

Parameters:

input : pos int

random number generator seed

class mcpele.monte_carlo.ParticlePairSwap

Bases: mcpele.monte_carlo._takestep_cpp._Cdef_ParticlePairSwap

Swap a pair of particles

Python interface for c++ ParticlePairSwap

Parameters:

seed : pos integer

Seed for random number generator.

nr_particles : pos integer

Number of particles.

swap_every : pos integer

Spacing for swapping attempts: particle pair swap is attempted every swap_every move.

get_seed()

return random number generator seed

Returns:

int

random number generator seed

set_generator_seed()

sets the random number generator seed

Parameters:

input : pos int

random number generator seed

class mcpele.monte_carlo.TakeStepPattern

Bases: mcpele.monte_carlo._takestep_cpp._Cdef_TakeStepPattern

Takes multiple steps in a repeated pattern

Python interface for c++ TakeStepPattern. This move takes multiple steps in a repeated deterministic pattern.

Warning

breaks detailed balance locally

add_step()

add a step to a pattern

Parameters:

step : TakeStep

object of class TakeStep constructed beforehand

nr_repetitions: int

number of Monte Carlo iterations in a row for which this move is performed

class mcpele.monte_carlo.TakeStepProbabilities

Bases: mcpele.monte_carlo._takestep_cpp._Cdef_TakeStepProbabilities

Takes multiple steps in a repeated pattern

Python interface for c++ TakeStepProbabilities. This move takes multiple steps, each with some probability thus not affecting the detailed balance condition.

Note

it does NOT break detailed balance hence it is the recommended choice

add_step()

add a step to a pattern

all the weights are combined in a normalised discrete distribution

Parameters:

step : TakeStep

object of class TakeStep constructed beforehand

weight: double or int

weight to assign to each move