Exchange

ParallelTemperingMonteCarlo.ExchangeModule
module Exchange

Here we include methods for calculating the metropolis condition and other exchange criteria required for Monte Carlo steps. This further declutters the MCRun module and allows us to split the cycle. Includes update_max_stepsize! which controls the frequency of

source
ParallelTemperingMonteCarlo.Exchange.metropolis_conditionMethod
metropolis_condition(delta_energy::Number, beta::Number)
metropolis_condition(ensemble::Etype, delta_energy::Float64, volume_changed::Float64, volume_unchanged::Float64, beta::Float64) where Etype <: NPT
metropolis_condition(movetype::String, mc_state::MCState, ensemble::Etype) where Etype <: AbstractEnsemble

Function returning the probability value associated with a trial move. Four methods included. The last two methods are separatig functions taking a movetype, mc_state and ensemble and separating them into volume and atom moves defined in the first two functions, namely:

  • accepts delta_energy and beta and determines the thermodynamic probability of the single-atom move
  • accepts pressure by way of ensemble, delta_energy, delta_volume by way of volume_changed and volume_unchanged and beta and calculates the thermodynamic probability of the volume move.
source
ParallelTemperingMonteCarlo.Exchange.parallel_tempering_exchange!Method
parallel_tempering_exchange!(mc_states::Vector{T},mc_params::MCParams,ensemble::NVT) where T <: MCState
parallel_tempering_exchange!(mc_states::Vector{T},mc_params::MCParams,ensemble::NPT) where T <: MCState

These functions take a vector mc_states as well as the parameters of the simulation and attempts to swap two trajectories according to the parallel tempering method. The second method uses enthalpy instead of energy to determine acceptance.

source
ParallelTemperingMonteCarlo.Exchange.update_max_stepsize!Method
update_max_stepsize!(mc_state::MCState, n_update::Int, ensemble::NPT, min_acc::Number, max_acc::Number)
update_max_stepsize!(mc_state::MCState, n_update::Int, ensemble::Etype, min_acc::Number, max_acc::Number) where Etype <: AbstractEnsemble

Increases/decreases the max. displacement of atom, volume, and rotation moves to 110%/90% of old values if acceptance rate is >60%/<40%. Acceptance rate is calculated after n_update MC cycles; each cycle consists of a atom, v volume moves. Information on actual max. displacement and accepted moves between updates is contained in mc_state, see MCState.

Methods split for NVT/NPT ensemble to ensure we don't consider volume moves when dealing with the NVT ensemble.

source