MCSampling
ParallelTemperingMonteCarlo.MCSampling.finalise_results — Method
finalise_results(mc_states::MCStateVector, mc_params::MCParams, results::Output)Function designed to take a complete MC simulation and calculate the averages.
ParallelTemperingMonteCarlo.MCSampling.find_hist_index — Method
find_hist_index(hist_index::Number, n_bin::Int)
find_hist_index(mc_state::MCState, results::Output, delta_en_hist::Number)
find_hist_index(mc_state::MCState, results::Output, delta_en_hist::Number, delta_v_hist::Number)Returns the histogram index of a single mc_state energy and returns this value.
ParallelTemperingMonteCarlo.MCSampling.initialise_histograms! — Method
initialise_histograms!(mc_params::MCParams, results::Output, e_bounds::AbstractArray{N, 1}, bc::SphericalBC) where N <: Number
initialise_histograms!(mc_params::MCParams, results::Output, e_bounds::AbstractArray{N, 1}, bc::CubicBC; debug = false) where N <: Number
initialise_histograms!(mc_params::MCParams, results::Output, e_bounds::AbstractArray{N, 1}, bc::RhombicBC) where N <: NumberFunction to create the energy and radial histograms at the end of equilibration. The min/max energy values are extracted from e_bounds and (with 2% either side additionally) used to determine the energy grating for the histogram (delta_en_hist). For spherical boundary conditions the radius squared is used to define a diameter squared since the greatest possible atomic distance is 2*r2 and distance**2 is used throughout the simulation. Histogram contains overflow bins, rdf has 5 times the number of bins as en_histogram.
Returns delta_en_hist, delta_r2
ParallelTemperingMonteCarlo.MCSampling.sampling_step! — Method
sampling_step!(mc_params::MCParams, mc_states::MCStateVector, ensemble::AbstractEnsemble, save_index::Int, results::Output, rdfsave::Bool)
sampling_step!(mc_params::MCParams, mc_states::MCStateVector, ensemble::NPT, save_index::Int, results::Output, rdfsave::Bool)Function performed at the end of an mc_cycle! after equilibration. Updates the E,E**2 totals for each mc_state, updates the energy and radial histograms and then returns the modified mc_states and results.
N.B. we have now included the delta_en, delta_v and delta_r2 values in the results struct to allow for more general methods such as this.
Second method does not perform the rdf calculation. This is designed to improve the speed of sampling where the rdf is not required.
TO IMPLEMENT: This function benchmarked at 7.84μs, the update RDF step takes 7.545μs of this. Removing the rdf information should become a toggle-able option in case faster results with less information are wanted.
ParallelTemperingMonteCarlo.MCSampling.update_energy_tot — Method
update_energy_tot(mc_states::MCStateVector, ensemble::Etype) where Etype <: AbstractEnsemble
update_energy_tot(mc_states::MCStateVector, ensemble::NPT)Function to update the current energy and energy squared values for coarse analysis of averages at the end. These are weighted according to the ensemble, and as such a method for each ensemble is required. Two methods avoids needless for-loops, where the JIT can save us computation time.
ParallelTemperingMonteCarlo.MCSampling.update_histograms! — Method
update_histograms!(mc_states::MCStateVector, results::Output, delta_en_hist::Number)
update_histograms!(mc_states::MCStateVector, results::Output, delta_en_hist::Number, delta_v_hist::Number)Self explanatory name, updates the energy histograms in results using the current mc_states.en_tot
ParallelTemperingMonteCarlo.MCSampling.update_rdf! — Method
update_rdf!(mc_states::MCStateVector, results::Output, delta_r2::Number)Self explanatory name, iterates over mc_states and adds to the appropriate results.rdf histogram. Type stable by the initialise function specifying a vector of integers.