Bases: object
the main class for implementing nested sampling
Parameters : | replicas : list
mc_walker: callable
nproc : int
verbose : bool
iprint : int
cpfile: str
cpfreq: int
cpstart: bool
dispatcher_URI: str
serializer: str
Attributes ———- nreplicas : integer
stepsize : float
max_energies : list
store_all_energies: bool
|
---|
Methods
add_new_replicas(rlist) | add new replicas the the list and keep the list sorted |
adjust_step_size(results) | Adjust the stepsize to keep the acceptance ratio at a good value .. |
collectresults() | |
do_monte_carlo_chain(configs, Emax) | from an initial configuration do a monte carlo walk |
get_starting_configurations(Emax) | return nproc replicas to be used as starting configurations |
get_starting_configurations_from_replicas() | use existing replicas as starting configurations |
one_iteration() | do one iteration of the nested sampling algorithm |
pop_replicas() | remove the replicas with the largest energies and store them in the max_energies array |
sort_replicas() | sorts the replicas in decreasing order of energy |
Adjust the stepsize to keep the acceptance ratio at a good value
Notes
when ratio naccept/nsteps < target_ratio then decrease step size by a correction factor f (new-step-size = old-step-size*f, where 0<f<1), else if naccept/nsteps > target_ratio, then increases the step size (new-step-size = old-step-size/f, where 0<f<1), although this is increased with an upper bound: max_stepsize.
from an initial configuration do a monte carlo walk
the steps will be accepted subject only to a maximum energy criterion. At the end of the walk, update stepize to meet the target_ratio.
return nproc replicas to be used as starting configurations
use existing replicas as starting configurations
Bases: object
object to represent the state of a system
also attached is some additional information
Parameters : | x : array
energy : float
niter : int
from_random : bool
|
---|
Methods
copy() | return a complete copy of self |