BasicMD.BasicMDModule

BasicMD.jl

A collection of basic routines for Molecular Dynamics simulations written in Julia. These include:

• Euler–Maruyama (EM)
• Random Walk Metropolis (RWM)
• Brünger, Brooks and Karplus (BBK)
• ABOBA, BAOAB
• Verlet
• Hamiltonian/Hybrid Monte Carlo (HMC)

REPL help

? followed by an sampler name (?RWM)to obtain infromation about individual samplers. Use ? on sample_trajectory! and sample_trajectory to obtain information about running the samplers. Finally, ? on MDOptions will provide information about how to set additional options, such as the number of information.

Performing Sampling

Having constructed a sampler structure, samplers are executed with the the commands

sample_trajectory!(X, sampler, options=opts);

for an in place transformation of X or

Xvals = sample_trajectory(X₀, sampler);

to obtain a full trajectory. Metropolis methods will also return the running acceptance rate.

BasicMD.ABOBAMethod
ABOBA(∇V!, β, γ, M, Δt)

Set up the ABOBA integrator for inertial Langevin.

Fields

• ∇V! - In place gradient of the potential
• β - Inverse temperature
• γ - Damping Coefficient
• M - Mass (either scalar or vector)
• Δt - Time step
BasicMD.BAOABMethod
BAOAB(∇V!, β, γ, M, Δt)

Set up the BAOAB integrator for inertial Langevin.

Fields

• ∇V! - In place gradient of the potential
• β - Inverse temperature
• γ - Damping Coefficient
• M - Mass (either scalar or vector)
• Δt - Time step
BasicMD.BBKMethod
BBK(∇V!, β, γ, M, Δt)

Set up the BBK integrator for inertial Langevin.

Fields

• ∇V! - In place gradient of the potential
• β - Inverse temperature
• γ - Damping Coefficient
• M - Mass (either scalar or vector)
• Δt - Time step
BasicMD.EMMethod
EM(∇V!, β, γ, M, Δt)

Set up the EM integrator for overdamped Langevin.

Fields

• ∇V! - In place gradient of the potential
• β - Inverse temperature
• Δt - Time step
BasicMD.GJFMethod
GJF(∇V!, β, γ, M, Δt)

Set up the G-JF integrator for inertial Langevin.

Fields

• ∇V! - In place gradient of the potential
• β - Inverse temperature
• γ - Damping Coefficient
• M - Mass (either scalar or vector)
• Δt - Time step
BasicMD.HMCMethod
HMC(V, ∇V!, β, M, Δt, nΔt)

Set up the HMC sampler for Boltzmann.

Fields

• V - Potential
• ∇V! - In place gradient of the potential
• β - Inverse temperature
• Δt - Time step
• nΔt - Number of time steps to use in each Verlet run
BasicMD.MALAMethod
MALA(V, ∇V!, β, Δt)

Set up the MALA sampler for overdamped Langevin.

Fields

• V - Potential
• ∇V! - In place gradient of the potential
• β - Inverse temperature
• Δt - Time step
BasicMD.MDOptionsMethod
MDOptions(;n_iters = 10^4, n_save_iters=1)

Set options for samplers.

Fields

• n_iters - Set the number of iterations of the sampler
• nsaveiters - Set the frequency at which iterations are saved. If nsaveiters=1, every iteration is saved. If nsaveiters=n_iters, only the final iteration is saved.
BasicMD.RWMMethod
RWM(V, β, Δt)

Set up the RWM sampler for Boltzmann.

Fields

• V - Potential
• β - Inverse temperature
• Δt - Time step
BasicMD.VerletType
Verlet(∇V!, M, Δt)

Set up the Verlet integrator.

Fields

• ∇V! - In place gradient of the potential
• M - Mass (either scalar or vector)
• Δt - Time step
BasicMD.Boltzmann_likelihoodMethod
Boltzmann_likelihood(x, V, β)

Compute the unnormalized Boltzmann density, exp(-β V(x)) for potential V at inverse temperature β

Fields

• x - Value at which to evalute the density
• V - Potential
• β - Inverse temperature
BasicMD.MALA_likelihoodMethod
MALA_likelihood(X₀, X₁, gradV0, β, Δt)

Compute the likelihood of the MALA proposal X₀→X₁ for potential with gradient gradV0 at inverse temperature β and time step Δt

BasicMD.sample_observablesMethod
sample_observables(x₀, sampler, observables; options=MDOptions())

Run the sampler starting at x₀, evaluating the trajectory on a tuple of observables scalar functions. Number of iterations and interval between saves are set using the options argument. Only the computed observables are returned.

Fields

• x - Starting position for sampler, modified in place
• sampler - Desired sampler
• constraints - Constraints on the trajectory
• observables - Observables on which to evaluate the trajectory

Optional Fields

• TO- Observable data type, if needed, should be entered as the first argument
• options - Sampling options, including number of iteration
BasicMD.sample_observablesMethod
sample_observables(x₀, sampler, observables; options=MDOptions())

Run the sampler starting at x₀, evaluating the trajectory on a tuple of observables scalar functions. Number of iterations and interval between saves are set using the options argument. Only the computed observables are returned.

Fields

• x - Starting position for sampler, modified in place
• sampler - Desired sampler
• observables - Observables on which to evaluate the trajectory

Optional Fields

• TO- Observable data type, if needed, should be entered as the first argument
• options - Sampling options, including number of iteration
BasicMD.sample_trajectory!Method
sample_trajectory!(x, sampler; options=MDOptions())

In place applciation of the sampler to x. Number of iterations are set using the options argument.

Fields

• x - Starting position for sampler, modified in place
• sampler - Desired sampler
• constraints - Constraints on the trajectory

Optional Fields

• options - Sampling options, including number of iteration
BasicMD.sample_trajectory!Method
sample_trajectory!(x, sampler; options=MDOptions())

In place applciation of the sampler to x. Number of iterations are set using the options argument.

Fields

• x - Starting position for sampler, modified in place
• sampler - Desired sampler

Optional Fields

• options - Sampling options, including number of iteration
BasicMD.sample_trajectoryMethod
sample_trajectory(x₀, sampler; options=MDOptions())

Run the sampler starting at x₀. Number of iterations and interval between saves are set using the options argument. For Metropolis samplers, the running acceptance rates are also resturned.

Fields

• x - Starting position for sampler, modified in place
• sampler - Desired sampler
• constraints - Constraints on the trajectory

Optional Fields

• options - Sampling options, including number of iteration
BasicMD.sample_trajectoryMethod
sample_trajectory(x₀, sampler; options=MDOptions())

Run the sampler starting at x₀. Number of iterations and interval between saves are set using the options argument. For Metropolis samplers, the running acceptance rates are also resturned.

Fields

• x - Starting position for sampler, modified in place
• sampler - Desired sampler

Optional Fields

• options - Sampling options, including number of iteration
• constraints - Constraints on the trajectory
BasicMD.trivial_constraint!Method

trivial_constraint! - Trivial constraint function

Fields

• state - Current state of the sampler
• i - Index of current iterate