Skip to content

Tutorial T04: Rigid Water Benchmark (SPC/E vs. TIP3P) ​

This tutorial evaluates the ParticleDynamics v1.2.0 biomolecular and aqueous Workflow stack in GROMACS units ( ) in Float32 with deterministic fixed-point force accumulation (force_accumulation=:fixed64) against the rigid-water benchmarks of Berendsen, Grigera & Straatsma (1987), Jorgensen et al. (1983), Reddy & Berkowitz (1989), and Vega & Abascal (2011):

  1. Thermodynamics, Dispersion-Tail Accounting & GPU Barostat Parity: Isobaric–isothermal (NPT,  ,  ,  ) comparison of SPC/E and TIP3P bulk density , configurational energy , and enthalpy of vaporization across both GPU-resident barostats, StochasticCellRescaling (DeviceCRescale, with a Float64 shadow box in v1.2.0) and MonteCarloBarostat (DeviceMonteCarloBarostat, scale=:molecules), showing density parity at the statistical precision level once the Lennard-Jones cutoff is made continuous via vdw_modifier=:potential_shift, together with an explicit accounting of the / dispersion pressure tail omitted at  .

  2. Volume Fluctuations (Isothermal Compressibility): Evaluation of water's isothermal compressibility   from NPT volume fluctuations across both barostats (reported separately without pooling, exposing finite-horizon convergence requirements for MC volume fluctuations), capturing SPC/E's lower compressibility relative to TIP3P.

  3. Static Dielectric Constant & Kirkwood : Total box dipole moment fluctuations under tin-foil Ewald boundaries over 1.28 ns, reproducing the Vega & Abascal (2011) ordering where TIP3P overestimates the dielectric constant (   vs. ) while SPC/E sits below experiment (   vs. Vega & Abascal , Reddy & Berkowitz , and experimental ).

  4. Tetrahedral Structure & Rigid Geometry: Oxygen–oxygen radial distribution function contrasting SPC/E's sharp first hydration shell and distinct tetrahedral second peak at   against TIP3P's nearly flat second shell, alongside GPU SETTLE/RATTLE (settle_mode=:df64) constraint checks (  , zero NaNs across   production steps).

Trajectory Visualization ​

Live Fresnel Studio Dashboard (T04): Rigid SPC/E liquid water (512 H₂O, 298.15 K, 1 bar NPT) rendered with tetrahedral hydrogen-bond cylinders alongside the production density ρ(t) and kinetic temperature T(t) convergence (tutorials/render_movies.py --targets T04).

Studio Fresnel snapshot of the rigid SPC/E water hydrogen-bond network

What You Will Learn ​

Running the Tutorial ​

All scripts live in tutorials/T04_rigid_water_spce_tip3p/:

bash
# Quick GPU smoke check (N_mol = 216, rc = 0.78 nm)
TUTORIAL_FAST=1 julia --project tutorials/T04_rigid_water_spce_tip3p/run.jl
TUTORIAL_FAST=1 julia --project tutorials/T04_rigid_water_spce_tip3p/analyze.jl

# Full production validation (N_mol = 1000, rc = 1.20 nm, 1.28 ns C-rescale & MC + 0.64 ns LJPME)
julia --project tutorials/T04_rigid_water_spce_tip3p/run.jl
julia --project tutorials/T04_rigid_water_spce_tip3p/analyze.jl

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

Physics Background ​

Rigid 3-Site Water Models & GROMACS Units ​

We work in standard GROMACS molecular units: length in , energy in  , mass in atomic mass units (  ), time in (so     identically), and charge in elementary charges . At   and  :

Both SPC/E (Berendsen et al. 1987) and TIP3P (Jorgensen et al. 1983) place a single Lennard-Jones site on oxygen ( ,  ) and fixed point charges on all three atoms:

Model (nm) ( ) () () (nm) () (nm) (D)
SPC/E
TIP3P

Although both models carry nearly identical monomer dipole moments ( ), SPC/E's tetrahedral bond angle () and slightly larger partial charges strengthen directional hydrogen-bond networking compared to TIP3P (), producing higher bulk density, lower compressibility, and a well-defined second tetrahedral hydration shell.

Cutoff Continuity, Dispersion Tails & Virial–MC Parity ​

A subtle statistical-mechanics requirement governs parity between a virial barostat (StochasticCellRescaling) and an energy-difference barostat (MonteCarloBarostat):

  • Unshifted cutoff discontinuity (vdw_modifier=:none): Truncating abruptly at leaves a step jump from   up to , corresponding to an attractive impulsive force      . Because the smooth molecular virial    omits this delta-function impulse whereas Monte Carlo volume moves evaluate    across the discontinuity, an unshifted cutoff creates an impulsive pressure contribution

    so    . At  , an MC barostat therefore compresses the box relative to a smooth-virial barostat by     .

  • Continuous potential shift (vdw_modifier=:potential_shift): Shifting the short-range Lennard-Jones potential by (the GROMACS default) leaves all pair forces identical while eliminating the energy jump at  . Combined with C²-ESP electrostatics (whose real-space pair potential, force, and second derivative vanish smoothly at ), the thermodynamic pressure identity   holds without impulsive corrections, bringing StochasticCellRescaling and MonteCarloBarostat into statistical agreement.

  • Long-range dispersion tail accounting: Truncating Lennard-Jones interactions at   with vdw_modifier=:potential_shift omits an attractive long-range dispersion pressure tail of    for SPC/E and for TIP3P. Via  , omitting this tail lowers the simulated bulk density by   () for SPC/E and   () for TIP3P. Consequently:

    • Extrapolating T04's truncated SPC/E density (  ) to full dispersion gives  , consistent with Berendsen et al. (1987) ( ), the NIST Standard Reference Simulation Website (SRSW) (  at ), Tutorial T06's dual-mesh DispersionESP (LJPME) SPC/E bulk liquid core (   at , where thermal expansion across    accounts for   ), and Tutorial T07's truncated   pure SPC/E density (  , shifted down by    from its larger omitted   tail).

    • The numerical closeness of T04's uncorrected truncated SPC/E density () to Vega & Abascal's (2011) tail-corrected table entry () is an apples-to-oranges coincidence rather than a justification for neglecting of dispersion pressure. For fresh runs, run.jl includes a dedicated spce_ljpme_crescale run with DispersionESP (vdw_modifier=:none) to measure full-dispersion SPC/E density directly alongside the truncated parity matrix.

    • For enthalpy of vaporization, the analytical energy shift + tail correction (    for SPC/E,   for TIP3P) is applied to report      , where Vega & Abascal (2011) list raw      for SPC/E, giving   after subtracting Berendsen's    polarization self-energy.

Fluctuation Observables & Half-Step Configurational Accuracy ​

  • Isothermal compressibility (): From NPT volume fluctuations at bath temperature  ,
  • Static dielectric constant (): Under conducting tin-foil Ewald boundary conditions (boundary=:tin_foil, Neumann 1983), the total box dipole moment   determines the static permittivity and Kirkwood correlation factor :

Because both and are variance estimators, analyze.jl uses 8-block leave-one-block-out jackknife estimation (eliminating short-block mean-subtraction bias while capturing temporal correlations across Debye relaxation times  ). Note that with   blocks, the jackknife SEM itself carries a relative standard error of   .

  • Half-step vs. full-step temperature at  : For rigid water, each molecule has 6 degrees of freedom: 3 low-frequency translational modes and 3 hindered rotational librational modes at  . Both half-step CSVR (matching GROMACS leap-frog v-rescale) and BAOABFast control the half-step/midpoint momentum distribution so the configurational ensemble samples  . Because only 3 of the 6 rigid-water degrees of freedom are librational, the full-step velocity-Verlet kinetic temperature exhibits half the 1D harmonic shadow shift:


Workflow API Walkthrough ​

1. Water System, ClusterPairList(:fixed64), and tune_electrostatics for C²-ESP ​

tutorials/T04_rigid_water_spce_tip3p/run.jl constructs an   (  atoms) cubic water box with rigid (O, H1, H2) geometry and intramolecular Coulomb exclusions, pairs PairTable with ClusterPairList(force_accumulation=:fixed64), and calls tune_electrostatics once on the thermalized liquid to select the fastest C²-ESP + CompactFFT configuration meeting relative RMS force error  :

julia
using ParticleDynamics

tbl = PairTable(
    sigma=[0.316557, 0.0],
    epsilon=[0.650194, 0.0],
    cutoff=[1.20, 0.0],
    type_names=[:O, :H],
)
lj = LennardJones(
    pair_table=tbl,
    pairs=:neighborlist,
    vdw_modifier=:potential_shift,
    neighborlist=ClusterPairList(buffer=0.12, force_accumulation=:fixed64),
)

esp_init = ESP(
    coulomb_prefactor=138.93545764498226,
    real_cutoff=1.20,
    tolerance=5e-4,
    continuity=:c2,
    net_charge=:error,
    boundary=:tin_foil,
)

# Automatically benchmark C²-ESP orders and CompactFFT meshes on the GPU state
tuned = tune_electrostatics(state(sim), esp_init; target=5e-4, objective=:time, orders=(4, 5))
# On N_mol = 1000, rc = 1.20 nm: mesh = (14, 14, 14), order = 4, rel_err = 1.99e-4, CompactFFT = true
esp_pinned = ESP(
    coulomb_prefactor=138.93545764498226,
    real_cutoff=1.20,
    tolerance=tuned.force.tolerance,
    order=tuned.force.order,
    continuity=:c2,
    mesh=tuned.mesh,
    net_charge=:error,
    boundary=:tin_foil,
)

Pinning mesh=(14, 14, 14) preserves the 2-3-5-7 smooth shared-memory CompactFFT kernel plan throughout NPT volume fluctuations while keeping relative electrostatic force error at   ( per full force call). For the full-dispersion LJPME check (spce_ljpme_crescale), run.jl sets vdw_modifier=:none on LennardJones and appends DispersionESP(real_cutoff=1.20, tolerance=5e-4).

2. GPU-Resident NPT with StochasticCellRescaling and MonteCarloBarostat ​

Both GPU-resident barostats are executed inside CUDA-graph super-batches (step_many!) together with warp-cooperative :df64 SETTLE/RATTLE constraints (RigidWaterConstraint). Reusing the same rw_constr object across equilibration and production prepare!(sim) calls keeps the attached GPU constraint workspace alive in place:

julia
all_grp   = Group(:all, AllSelection())
rw_constr = RigidWaterConstraint(triples; oh=0.1000, hh=0.163298, settle_mode=:df64)

# Barostat 1: GPU-resident Stochastic Cell Rescaling (DeviceCRescale)
baro_cr = StochasticCellRescaling(
    pressure=0.0602214076,             # 1 bar in kJ/(mol·nm³)
    kT=2.4789570296,                   # 298.15 K
    compressibility=4.5e-5 / 0.0602214076,
    tau=1.0,                           # ps
    interval=10,
    seed=UInt64(1401),
)

# Barostat 2: GPU-resident Molecular Monte Carlo Barostat (DeviceMonteCarloBarostat)
# Equilibrate with adaptive tuning (`tune=true`), then freeze `log_volume_step` (`tune=false`)
# during production to satisfy detailed balance:
baro_mc_eq = MonteCarloBarostat(
    pressure=0.0602214076,
    kT=2.4789570296,
    interval=25,
    log_volume_step=0.004,
    scale=:molecules,
    tune=true,
    seed=UInt64(2402),
)
# ... run NPT equilibration via `step_many!` ...
tuned_frac = barostat_diagnostics(sim).log_volume_step
baro_mc_prod = MonteCarloBarostat(
    pressure=0.0602214076,
    kT=2.4789570296,
    interval=25,
    log_volume_step=tuned_frac,
    scale=:molecules,
    tune=false,
    seed=UInt64(3402),
)

3. Production Logging (TableWriter, InMemoryWriter, and BoxObservable) ​

In the recorded production dataset below (1.28 ns for C-rescale, 0.48 ns for MC parity, partitioned into 8 contiguous blocks), TableWriter streams ThermodynamicObservable, PressureObservable, and BoxObservable every 200 steps (0.4 ps), while InMemoryWriter buffers coordinates block-by-block for PBC-whole box dipole , 8-block , and rigid geometry checks. Between samples, run! dispatches 199-step GPU super-batches (step_many!), sustaining 4,410–6,406 steps/s on an RTX 3090 for   rigid waters. To eliminate short-horizon MC compressibility undersampling on fresh runs, run.jl now sets prod_parity = 640_000 (1.28 ns, matching C-rescale).


Results & Literature Comparison ​

Part A: Bulk Thermodynamics, Barostat Parity & Isothermal Compressibility ​

Rigid Water NPT Thermodynamics & GPU Barostat Parity

Recorded production runs ( ,  ,  , truncated   :potential_shift, C²-ESP (14, 14, 14) CompactFFT, Float32 :fixed64,  ):

Run (Model | Barostat | Thermostat)Horizon (ns)Throughput (steps/s) ( )Extrap. Full ( ) ( ) ()Vega & Abascal / (nm)
SPC/E | C-rescale | CSVR     /  
SPC/E | MC (:molecules) | CSVR     /  
TIP3P | C-rescale | BAOABFast     /  
TIP3P | MC (:molecules) | BAOABFast     /  
Experiment (298.15 K, 1 bar)——————

(Analytical extrapolation accounting for the omitted   dispersion tail    (SPC/E,    ) and (TIP3P,    ); compare Berendsen et al. 1987   and Tutorial T06 LJPME    at . includes the analytical LJ shift+tail correction   for SPC/E and   for TIP3P, plus Berendsen's   self-polarization term for SPC/E; Vega & Abascal 2011 report raw     for SPC/E, i.e.   with , and   for TIP3P. Software checks: MC acceptance converged to (SPC/E) and (TIP3P), rigid constraints remained  , and zero NaNs occurred across all runs.)

GPU Barostat Parity (StochasticCellRescaling vs MonteCarloBarostat) & Compressibility Convergence:

  • SPC/E (CSVR) density & energy parity:     , or     ();     , or     ();     vs  . Thus density parity is confirmed at the statistical precision level.

  • TIP3P (BAOABFast) density & energy parity:     , or     ();     , or     ();     vs  .

  • SPC/E compressibility tension between C-rescale and short MC (3.23σ): While TIP3P C-rescale ( ) and MC ( ) agree within (    ), SPC/E C-rescale ( ) and the short 0.48 ns MC run ( ) disagree by    (,  ). We report both separately rather than pooling incompatible estimates. Because second-moment volume fluctuations equilibrate more slowly than the mean density, and 0.48 ns of MC comprises only 8 blocks of ( trial moves per block, with relative uncertainty on the 8-block SEM itself), 0.48 ns is too short for converged MC compressibility. run.jl runs MC for the full 1.28 ns horizon on fresh runs.

  • Model contrast: On the matched 1.28 ns C-rescale trajectories, SPC/E is denser than TIP3P by      (Vega & Abascal:  ) and less compressible by      (; TIP3P   vs SPC/E   ).


Part B: Oxygen–Oxygen Structure g_OO(r) & Static Dielectric Constant ε₀ ​

Liquid Water Structure & Dielectric Response: SPC/E vs TIP3P

Panel (a) reproduces the structural contrast highlighted by Vega & Abascal (2011): SPC/E forms a sharp first hydration shell at   ( , coordination number   out to  ) followed by a distinct tetrahedral second hydration peak at   ( ), whereas TIP3P produces a broader, lower first peak ( ,  ,  ) and a nearly flat second shell ( ), reflecting its under-structured hydrogen-bond network.

Panel (b) tracks the cumulative dielectric constant across the 1.28 ns C-rescale trajectories (3,200 PBC-whole total dipole samples):

Model (GPU, 8-block jackknife)Vega & Abascal (2011) Kirkwood (nm) (nm) ( shell)
SPC/E  (Reddy & Berkowitz 1989: )
TIP3P 
Experiment—

(With   blocks over , each jackknife SEM itself carries relative uncertainty, .)

Comparing directly against the literature values: SPC/E ( ) sits   () below Vega & Abascal's (2011) and   () below Reddy & Berkowitz's (1989) ; TIP3P ( ) sits   () from Vega & Abascal's . Together they reproduce TIP3P's large dielectric excess over SPC/E (   , ;   vs ).


References ​

  1. H. J. C. Berendsen, J. R. Grigera, and T. P. Straatsma, "The missing term in effective pair potentials," J. Phys. Chem. 91(24), 6269–6271 (1987). DOI: 10.1021/j100308a038

  2. 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

  3. M. R. Reddy and M. Berkowitz, "The dielectric constant of SPC/E water," Chem. Phys. Lett. 155(2), 173–176 (1989). DOI: 10.1016/0009-2614(89)85344-8

  4. C. Vega and J. L. F. Abascal, "Simulating water with rigid non-polarizable models: a general perspective," Phys. Chem. Chem. Phys. 13(44), 19663–19688 (2011). DOI: 10.1039/C1CP22168J

  5. M. Neumann, "Dipole moment fluctuation formulas in computer simulations of polar systems," Molecular Physics 50(4), 841–858 (1983). DOI: 10.1080/00268978300102721

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

  7. S. Miyamoto and P. A. Kollman, "SETTLE: An analytical version of the SHAKE and RATTLE algorithm for rigid water models," J. Comput. Chem. 13(8), 952–962 (1992). DOI: 10.1002/jcc.540130805

  8. G. Bussi, D. Donadio, and M. Parrinello, "Canonical sampling through velocity rescaling," J. Chem. Phys. 126(1), 014101 (2007). DOI: 10.1063/1.2408420

  9. 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

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