Exchange
ParallelTemperingMonteCarlo.Exchange — Module
module ExchangeHere 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
ParallelTemperingMonteCarlo.Exchange.exc_acceptance — Method
exc_acceptance(beta_1::Number, beta_2::Number, en_1::Number, en_2::Number)Returns probability to exchange configurations of two trajectories with energies en_1 and en_2 at inverse temperatures beta_1 and beta_2.
ParallelTemperingMonteCarlo.Exchange.exc_trajectories! — Method
exc_trajectories!(state_1::MCState, state_2::MCState)Exchanges configurations and distance and energy information between two trajectories; information contained in state_1 and state_2, see MCState
ParallelTemperingMonteCarlo.Exchange.metropolis_condition — Method
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 <: AbstractEnsembleFunction 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_energyandbetaand determines the thermodynamic probability of the single-atom move - accepts pressure by way of
ensemble,delta_energy,delta_volumeby way ofvolume_changedandvolume_unchangedandbetaand calculates the thermodynamic probability of the volume move.
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 <: MCStateThese 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.
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 <: AbstractEnsembleIncreases/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.