Skip to content

Tutorial T13: Biomolecular Force Fields and 4 fs HMR: Alanine Dipeptide Ramachandran Free Energy Landscape ​

This tutorial validates the all-atom biomolecular Workflow stack of ParticleDynamics v1.2.0 on solvated L-Alanine Dipeptide (Ace–Ala–Nme, 22 atoms, AMBER ff99SB-ILDN) in explicit TIP3P water (559 water molecules, 1,699 total atoms,  ), constructed programmatically without external file downloads, against Hopkins, Le Grand, Walker & Roitberg (2015), Hornak et al. (2006), Prada-Gracia et al. (2009), and Vymětal & Vondrášek (2010):

  1. 2 fs Standard vs. 4 fs Hydrogen Mass Repartitioning (HMR) stability, constraints, and GPU speedup: Explicit-solvent MD at   compares standard hydrogen masses ( ,  , auto-detected HBondConstraints) against HMR (  via ConstraintClusters.apply_hmr,  , ConstraintClusterSpec). Both runs use warp-cooperative :df64 RigidWaterConstraint (SETTLE/RATTLE), cotangent-projected constrained BAOABFast with uniform collision rate friction_rate = 1.0 ps⁻¹, and StochasticCellRescaling NPT equilibration. On an RTX 3090, 4 fs HMR sustains 12,355 steps/s peak (11,704 steps/s effective) versus 15,231 steps/s (14,086 steps/s effective) at 2 fs (1.62× peak / 1.66× effective simulated-time speedup under displacement-triggered neighbor lists), with max|Δr_OH| ≤ 1.7×10⁻⁷ nm, max|Δr_XH| ≤ 1.3×10⁻⁷ nm, zero NaNs across 7.5 × 10⁶ production steps, and 100 ps microcanonical NVE drift |dE/dt| = 0.017–0.028 kJ·mol⁻¹·ns⁻¹·DOF⁻¹.

  2. Solvated Ramachandran free-energy landscape   : 10.0 ns of explicit-solvent sampling each (20.0 ns total, 72 and 46 spontaneous   transitions) reproduces the solvated AMBER ff99SB/TIP3P conformational hierarchy (  ), trans-amide planarity (  ), and thermodynamic consistency between 4 fs HMR and 2 fs Standard within statistical error:       (  , 0.15σ),       (  , 0.54σ),       (0.11σ), and NPT density      (1.13σ).

  3. Unit-system invariance software audit (GROMACS vs. AMBER/AKMA): The identical solvated Ace–Ala–Nme + TIP3P snapshot is built in GROMACS/OpenMM units ( ) and AMBER/CHARMM AKMA units ( ,  ). Single-point agreement across all bonded, 1–4 scaled, Lennard-Jones, C²-ESP electrostatic, virial, and atomic-force terms reaches ≤ 2.61 × 10⁻¹⁵ in Float64 (≤ 3.99 × 10⁻⁶ in Float32 :fixed64), and matched 500-step (1.0 ps) constrained NVE trajectories agree to max|ΔU/U| = 1.17 × 10⁻¹⁰, max|ΔT| = 1.80 × 10⁻⁷ K, and max|Δφ|, max|Δψ| ≤ 3.02 × 10⁻⁸ deg.

Trajectory Visualization ​

Live Fresnel Studio Dashboard (T13): Solvated AMBER ff99SB-ILDN L-Alanine Dipeptide at 4 fs HMR (12,355 steps/s peak) with explicit TIP3P hydration shell, tracking live β/PII ↔ αR conformational transitions directly on the 2D Ramachandran free-energy surface F(φ, ψ) and backbone torsion ψ(t) (tutorials/render_movies.py --targets T13).

Studio Fresnel snapshot of solvated Alanine Dipeptide in extended beta/PII and alpha-R basins

What You Will Learn ​

  • Building a complete all-atom biomolecular ParticleSystem and Topology (bonds, angles, dihedrals, impropers, exclusions, molecules) with typed force-field families: HarmonicBondForce, HarmonicAngleForce, PeriodicDihedralForce (multi-term Fourier series), and HarmonicImproperForce.

  • Configuring AMBER 1–2 / 1–3 exclusions (exclusions=:topology) and AMBER 1–4 nonbonded scaling (coul_scale = 1/1.2, lj_scale = 0.5) via 4-tuple scaled_pairs = (i, j, coul_scale, lj_scale) on C²-continuous ESP + ClusterPairList (force_accumulation=:fixed64) + CompactFFT tuned via tune_electrostatics.

  • Relaxing initial solvation clashes with GPU FIRE energy minimization (minimize!) prior to attaching holonomic constraints.

  • Partitioning covalent bonds into heavy–heavy harmonic bonds and terminal X–H star clusters via ConstraintClusters.extract_hbond_constraints, repartitioning hydrogen masses via ConstraintClusters.apply_hmr (m_H = 3.024 u, conserving each donor cluster's mass), and combining HBondConstraints / ConstraintClusterSpec (defaulting to compensated DF64, constraint_mode = :df64, in v1.2.0) with RigidWaterConstraint (SETTLE, settle_mode = :df64).

  • Running GPU-resident StochasticCellRescaling (DeviceCRescale, backed by a Float64 shadow box in v1.2.0) NPT density equilibration followed by BAOABFast NVT production with uniform per-atom collision rate friction_rate (ξ = γ_i / m_i), and switching between self-consistent unit systems (nm / kJ·mol⁻¹ / ps vs. Å / kcal·mol⁻¹ / AKMA).

Running the Tutorial ​

All scripts live in tutorials/T13_alanine_dipeptide_hmr/:

bash
# Quick GPU smoke verification (~273 TIP3P waters, 0.12 ns each, < 10 s warm NVT compute)
TUTORIAL_FAST=1 julia --project tutorials/T13_alanine_dipeptide_hmr/run.jl
TUTORIAL_FAST=1 julia --project tutorials/T13_alanine_dipeptide_hmr/analyze.jl

# Full production validation (559 TIP3P waters, 10.0 ns each for 2 fs & 4 fs HMR, 100 ps NVE, unit audit)
julia --project tutorials/T13_alanine_dipeptide_hmr/run.jl
julia --project tutorials/T13_alanine_dipeptide_hmr/analyze.jl

# Regenerate documentation figures (300 DPI)
python3 tutorials/T13_alanine_dipeptide_hmr/plot.py

Physics Background ​

AMBER ff99SB-ILDN Force Field & Solvated Alanine Dipeptide ​

Blocked L-alanine dipeptide (Ace–Ala–Nme, , 22 atoms) is a standard minimal test system for protein backbone thermodynamics because it possesses both protein backbone torsions (  and  ) flanked by two planar trans-peptide bonds (  ) and solvated by competing backbone–water hydrogen bonds. Because the ILDN side-chain refitting (Lindorff-Larsen et al. 2010) modifies only Ile, Leu, Asp, and Asn, ff99SB (Hornak et al. 2006) and ff99SB-ILDN are identical for alanine.

The total potential energy combines all four bonded families, Lorentz–Berthelot Lennard-Jones dispersion/repulsion, and C²-ESP long-range electrostatics with AMBER 1–4 nonbonded scaling (  ,  ):

The 22-atom covalent tree contains 21 bonds (9 heavy–heavy harmonic bonds + 12 constrained X–H bonds forming three methyl   stars and three single   stars), 36 valence angles, 29 non-zero proper dihedrals (including the Hornak et al. 2006 ff99SB , , , multi-term Fourier series and H–N–C–O trans-amide bias), 4 planar amide impropers (C=O    , N–H    ,  ), 57 1–2/1–3 exclusions, and 41 scaled 1–4 pairs.

In explicit TIP3P water at , solvent–backbone hydrogen bonding stabilizes the extended upper-left Ramachandran basins, polyproline II () near    and extended () near   , alongside the right-handed -helix () basin near   . The left-handed basin near    is separated by a higher barrier (Prada-Gracia et al. 2009; Vymětal & Vondrášek 2010). Across published ff99SB/TIP3P studies (which vary slightly in basin boundary definitions), the extended    state accounts for roughly of equilibrium population (with  ), for , and for on converged microsecond trajectories, while individual 10 ns unbiased runs experience substantial statistical variance from rare visits.

Hydrogen Mass Repartitioning (HMR), Constrained BAOAB & Full-Step Shadow Temperature ​

Constraining all covalent X–H stretches (SETTLE on rigid water + ConstraintClusters on solute X–H) removes the stretching modes, leaving light-hydrogen angle bending (H–C–H, C–N–H at , period  ) as the fastest remaining unconstrained degrees of freedom. Following Hopkins, Le Grand, Walker & Roitberg (2015), repartitioning   from each heavy donor atom to each covalently bonded solute hydrogen (  , keeping rigid TIP3P water masses unchanged) lowers the H-bending angular frequencies by    ( ) while conserving the total mass of every heavy-atom cluster (CH₃:     , Cα: , N: ).

Because the canonical configurational Boltzmann distribution    depends only on the potential energy and is independent of atomic masses, HMR leaves equilibrium configurational properties (density , Ramachandran populations, and free-energy differences ) unchanged in theory while doubling the integration timestep from to .

Uniform friction_rate and full-step T_full under constrained BAOAB

In ParticleDynamics, Langevin(group; friction_rate=1.0, kT=kT) applies a mass-uniform collision frequency    (equivalently   ) to every atom, avoiding the   H-to-O collision asymmetry of scalar Stokes drag. Both the B1 kick and the O Ornstein–Uhlenbeck step are projected onto the holonomic cotangent manifold (RATTLE at ) across all rigid-water and solute constraint clusters, preventing rotational overheating at . Because unprojected forces cannot be used to form a half-step kinetic estimator on constrained velocities, ThermoObservable reports the full-step projected kinetic temperature  . Under constrained BAOAB (Leimkuhler & Matthews 2013; Fass et al. 2018), configurational observables (, , ) and molecular center-of-mass translation remain centered at  , whereas full-step rigid-water librational kinetic energy exhibits the analytical shadow shift   , producing   at and at (independent of ).

Unit-System Invariance (nm / kJ·mol⁻¹ / ps vs. Å / kcal·mol⁻¹ / AKMA) ​

ParticleDynamics integrates Newton's equations   directly in whatever self-consistent unit system the user supplies, with no hidden unit conversion constants. Given a scaling from GROMACS units ( ) to AMBER/CHARMM AKMA units ( ):

so  ,      ,     , bond force constants scale by  , forces scale by  , and velocities scale by  . Under consistent scaling, dimensionless energies and trajectories match to floating-point precision.


Workflow API Walkthrough ​

1. Typed Bonded Stack, 1–4 Nonbonded Scaling & C²-ESP Electrostatics ​

tutorials/T13_alanine_dipeptide_hmr/run.jl constructs Ace–Ala–Nme via a NeRF internal-coordinate builder (asserting L-alanine stereochemistry, equilibrium bond lengths, and planar trans amides), solvates it in 559 TIP3P waters, and wires all four typed bonded families alongside 4-tuple scaled_pairs on ESP(continuity=:c2):

julia
using ParticleDynamics
using ParticleDynamics: ConstraintClusters

# AMBER 1–2 / 1–3 exclusions (coul=0, lj=0) + 1–4 scaling (coul=1/1.2, lj=0.5)
scaled_pairs = vcat(
    [(i, j, 0.0, 0.0) for (i, j) in pairs_12],
    [(i, j, 0.0, 0.0) for (i, j) in pairs_13],
    [(i, j, 1.0 / 1.2, 0.5) for (i, j) in pairs_14],
)

lj = LennardJones(
    pair_table=PairTable(sigma=sig_u, epsilon=eps_u, cutoff=rc_vec_u, type_names=ALL_TYPE_NAMES),
    pairs=:neighborlist,
    vdw_modifier=:potential_shift,
    neighborlist=ClusterPairList(buffer=0.20, force_accumulation=:fixed64),
)
esp = ESP(
    coulomb_prefactor=138.93545764498226,
    real_cutoff=0.90,
    tolerance=5e-4,
    continuity=:c2,
    mesh=(15, 15, 15),       # selected by tune_electrostatics (CompactFFT=true, rel_err=3.28e-4)
    order=4,
    net_charge=:error,
    boundary=:tin_foil,
    exclusions=:topology,
    scaled_pairs=scaled_pairs,
)

# Typed bonded families (examples from the full ff99SB-ILDN set)
forces = Force[
    lj, esp,
    HarmonicBondForce(k=410032.0, r0=0.1335, type=:C_N),
    HarmonicAngleForce(k=527.184, theta0=deg2rad(110.10), type=:N_CT_C),
    PeriodicDihedralForce(k=[1.75728, 1.12968], n=[3, 2], phase=[0.0, 0.0], type=:phi),
    PeriodicDihedralForce(k=[2.30120, 6.61072, 1.88280], n=[3, 2, 1], phase=[pi, pi, pi], type=:psi),
    HarmonicImproperForce(k=175.728, chi0=pi, type=:imp_C),
    HarmonicImproperForce(k=18.4096, chi0=pi, type=:imp_N),
    # ... remaining heavy bond, angle, and dihedral types ...
]

2. FIRE Energy Minimization, extract_hbond_constraints & apply_hmr ​

Initial solvation clashes are relaxed with GPU FIRE minimization (minimize!, reducing from to   in 66 iterations to    ). Next, extract_hbond_constraints and apply_hmr split the peptide covalent bonds and repartition mass onto the 12 peptide hydrogens while excluding rigid water atoms. In ParticleDynamics v1.2.0, ConstraintClusters (ConstraintClusterSpec and HBondConstraints) defaults to compensated double-float arithmetic (constraint_mode = :df64) alongside RigidWaterConstraint(settle_mode = :df64) on Float32 biomolecular runs, preserving sub- solute X–H and water constraint accuracy without extra register spill:

julia
# Phase 0: Unconstrained FIRE clash relaxation before attaching holonomic constraints
res_min = minimize!(
    sim_min;
    method=FIRE(dt_initial=0.001, dt_max=0.005, fictitious_mass=1.0),
    force_tolerance=250.0,
    max_displacement=0.01,
    max_iterations=400,
)

# Phase 1–3: Split 21 peptide bonds -> 12 X–H constraints + 9 heavy harmonic bonds, apply HMR
h_constraints, heavy_bonds = ConstraintClusters.extract_hbond_constraints(
    all_pep_bonds, masses_std; h_mass_cutoff=2.0, exclude_atoms=water_atom_ids
)
masses_hmr = ConstraintClusters.apply_hmr(
    masses_std, h_constraints; hydrogen_mass=3.024, h_mass_cutoff=2.0, exclude_atoms=water_atom_ids
)

# Standard 2 fs: HBondConstraints auto-detects the identical 12 X–H pairs & strips them from bonded forces
rw = RigidWaterConstraint(water_triples; oh=0.09572, hh=0.15139006545247014, settle_mode=:df64)
constr_2fs = [rw, HBondConstraints(project_initial=true)]

# 4 fs HMR: pass explicit ConstraintClusterSpec (since repartitioned m_H = 3.024 u > 1.5 u cutoff)
constr_4fs = [rw, ConstraintClusterSpec(h_constraints; project_initial=true)]

3. StochasticCellRescaling NPT Equilibration & BAOABFast NVT Production ​

Each protocol equilibrates density for 50 ps under GPU-resident StochasticCellRescaling (DeviceCRescale, , ,  , Langevin(all_grp; friction_rate=1.0, kT=kT)), benchmarks GPU throughput via step_many!, and runs 10.0 ns of cotangent-projected BAOABFast (friction_rate = 1.0 ps⁻¹) NVT production partitioned into 8 contiguous blocks (20,000 Ramachandran frames per run, sampled every 0.50 ps via InMemoryWriter + TableWriter). In v1.2.0, StochasticCellRescaling maintains an internal Float64 shadow box alongside the Float32 simulation cell, eliminating cumulative single-precision box-length quantization drift during extended NPT runs.


Results & Literature Validation ​

Part A: Ramachandran Free-Energy Landscape & 2 fs vs. 4 fs HMR Consistency ​

Solvated Alanine Dipeptide Ramachandran Free Energy Surface: 2 fs Standard vs 4 fs HMR

Across 20.0 ns of combined explicit-solvent GPU production on an NVIDIA RTX 3090 (559 TIP3P waters + Ace–Ala–Nme, 1,699 atoms, C²-ESP (15, 15, 15) CompactFFT, Float32 :fixed64), all 19/19 physics validation checks pass alongside 15/15 software/API regression checks (CHECK_OK). Both 2 fs Standard (72   transitions) and 4 fs HMR (46 transitions) populate the solvated AMBER ff99SB/TIP3P Ramachandran basins with statistically consistent relative free energies and NPT density:

Observable2 fs Standard (10.0 ns)4 fs HMR (10.0 ns)   (z)Literature / Context (ff99SB/TIP3P, 300 K)
population    (-1.32σ)Dominant extended basin (Prada-Gracia 2009; Vymětal & Vondrášek 2010)
population    (-1.02σ)Secondary extended -strand basin
total ( )    (-1.26σ) (Prada-Gracia 2009; Vymětal & Vondrášek 2010)
population    (-0.48σ) (right-handed helical basin)
population    (+1.36σ)Rare high-barrier basin (single excursion in 4 fs run; see note below)
    ( )   ( )   ( , 0.15σ)Statistically consistent (≤ 3σ, Hopkins et al. 2015)
    ( )   ( )   ( , 0.54σ)Statistically consistent (≤ 3σ)
    ( )   ( )   ( , 0.11σ)Statistically consistent (≤ 3σ)
2D FES RMSE ( )––  (0.27 kcal/mol, diagnostic)Across 832 populated   bins
Basin minima  ,  ,    ,  ,    (≤ 3 bins)Solvated , , minima
Trans-amide ,  ,   ,  , (SD )Planar trans (zero cis isomerization)
NPT Density        (1.13σ)Consistent across 2 fs and 4 fs (r_c = 0.90 nm TIP3P)
Configurational        (+0.31%, diagnostic)Small water configurational shift
Full-step     (zero overheating)Analytical Leimkuhler–Matthews shadow shift

Sampling note on the excursion: In unbiased 10 ns trajectories, crossing the   barrier into the left-handed basin ( ) is a rare event whose occupancy fluctuates strongly from run to run (0.0% in 2fs_std vs. a single prolonged visit giving 15.0 ± 11.0%, 1.36σ from zero, in 4fs_hmr). Because the overall fraction spent in scales down the absolute occupancies of , , and by the same normalization factor  , it cancels identically in their pairwise free-energy differences  ,  , and  , all three of which agree between 2 fs and 4 fs HMR within .


Part B: NVE Conservation, RTX 3090 Speedup & Unit-System Invariance Audit ​

4 fs HMR NVE Stability, RTX 3090 Speedup & Unit-System Invariance Audit

1. 4 fs HMR GPU Speedup, Amdahl Neighbor-List Scaling & Constraint Precision (Software/API Checks) ​

ProtocolPeak GPU (step_many!)Effective Prod. (incl. I/O)max|Δr_OH| (SETTLE)max|Δr_HH| (SETTLE)max|Δr_XH| (ConstraintClusters)100 ps NVE Drift (   )NaNs
2 fs Standard (m_H = 1.008 u)15,231 steps/s14,086 steps/s    (max|ΔE|/N = 0.0062)0
4 fs HMR (m_H = 3.024 u)12,355 steps/s11,704 steps/s    (max|ΔE|/N = 0.0062)0
4 fs No-HMR (m_H = 1.008 u, NVE control)–– –  (max|ΔE|/N = 0.0061)0
Time-Advance Ratio (4 fs HMR / 2 fs)1.62×1.66× Low secular drift0

The simulated-time wall-clock gain is 1.62× peak / 1.66× effective (12,355 steps/s at 4 fs vs. 15,231 steps/s at 2 fs) rather than the nominal 2.00× timestep ratio because ClusterPairList uses displacement-triggered neighbor-list rebuilds (skin = 0.20 nm). While force, CompactFFT, bonded, and constraint evaluations scale per step and halve per unit simulated time at 4 fs, physical-time pair-list rebuilds remain invariant per unit time, placing the net gain in the 1.5×–2.0× range typical of GPU HMR simulations (Hopkins et al. 2015).

2. Unit-System Invariance Software Audit (GROMACS vs. AMBER/AKMA) ​

Evaluated as a software regression audit (CHECK_OK, counted separately from physics validation) on the identical equilibrated 1,699-atom solvated Ace–Ala–Nme snapshot with all bonded terms, 1–4 scaled pairs, vdw_modifier=:potential_shift LJ, and C²-ESP (15, 15, 15) electrostatics:

Interaction / Trajectory ObservableGROMACS ( )AMBER/AKMA ( )Rel. Error (Float64)Rel. Error (Float32 :fixed64)
Harmonic bonds (9 heavy bonds)    
Harmonic angles (36 angles)    
Fourier dihedrals (29 ff99SB terms)    
Harmonic impropers (4 amide planes)    
C²-ESP Coulomb (incl. 1–2/1–3 & 1/1.2 1–4)    
Lennard-Jones (incl. 1–2/1–3 & 0.5 1–4)    
Total potential energy     
Virial trace     
All atomic forces (RMS / Max)      /    /  
500-step NVE traj. (1.0 ps, Float64)SETTLE + ConstraintClustersMatched dt = 0.040910 AKMA  ,     ,   

All force-field components and constrained dynamical observables agree to machine precision in Float64 (≤ 2.61×10⁻¹⁵ single-point, ≤ 1.17×10⁻¹⁰ over 500 NVE steps) and to < 4.0×10⁻⁶ in Float32 :fixed64, verifying unit-system independence across the ParticleDynamics GPU biomolecular engine (19/19 Physics PASS, 15/15 Software/API CHECK_OK).


References ​

  1. C. W. Hopkins, S. Le Grand, R. C. Walker, and A. E. Roitberg, "Long-Time-Step Molecular Dynamics through Hydrogen Mass Repartitioning," J. Chem. Theory Comput. 11(4), 1864–1874 (2015). DOI: 10.1021/ct5010406

  2. V. Hornak, R. Abel, A. Okur, B. Strockbine, A. Roitberg, and C. Simmerling, "Comparison of multiple Amber force fields and development of improved protein backbone parameters," Proteins 65(3), 712–725 (2006). DOI: 10.1002/prot.21123

  3. K. Lindorff-Larsen, S. Piana, K. Palmo, P. Maragakis, J. L. Klepeis, R. O. Dror, and D. E. Shaw, "Improved side-chain torsion potentials for the Amber ff99SB protein force field," Proteins 78(8), 1950–1958 (2010). DOI: 10.1002/prot.22711

  4. D. Prada-Gracia, J. Gómez-Gardeñes, P. Echenique, and F. Falo, "Exploring the Free Energy Landscape: From Dynamics to Networks and Back," PLoS Comput. Biol. 5(6), e1000415 (2009). DOI: 10.1371/journal.pcbi.1000415

  5. J. Vymětal and J. Vondrášek, "Metadynamics As a Tool for Mapping the Conformational and Free-Energy Space of Peptides: The Alanine Dipeptide Case Study," J. Phys. Chem. B 114(16), 5632–5642 (2010). DOI: 10.1021/jp100950w

  6. F. Nüske, H. Wu, J.-H. Prinz, C. Wehmeyer, C. Clementi, and F. Noé, "Markov state models from short non-equilibrium simulations—Analysis and correction of estimation bias," J. Chem. Phys. 146(9), 094104 (2017). DOI: 10.1063/1.4976518

  7. W. L. Jorgensen, J. Chandrasekhar, J. D. Madura, R. W. Impey, and M. L. Klein, "Comparison of simple potential functions for simulating liquid water," J. Chem. Phys. 79(2), 926–935 (1983). DOI: 10.1063/1.445869

  8. E. Bitzek, P. Koskinen, F. Gähler, M. Moseler, and P. Gumbsch, "Structural Relaxation Made Simple," Phys. Rev. Lett. 97(17), 170201 (2006). DOI: 10.1103/PhysRevLett.97.170201

  9. M. Bernetti and G. Bussi, "Pressure control using stochastic cell rescaling," J. Chem. Phys. 153(11), 114107 (2020). DOI: 10.1063/5.0020514

  10. B. Leimkuhler and C. Matthews, "Rational construction of stochastic numerical methods for molecular sampling," Appl. Math. Res. eXpress 2013(1), 34–56 (2013). DOI: 10.1093/amrx/abs010

  11. J. Fass, D. A. Sivak, G. E. Crooks, K. A. Beauchamp, B. Leimkuhler, and J. D. Chodera, "Quantifying Configuration-Sampling Error in Langevin Simulations of Complex Molecular Systems," Entropy 20(5), 318 (2018). DOI: 10.3390/e20050318

ParticleDynamics v1.2.0 · GPU-native molecular dynamics in pure Julia · MIT License