Phase 2: H5MD#
Done on 2026-10-15, following the design (“The data contract” and “Non-periodic systems” in the plan).
The library gained
h5md(H5MDWriter),io(open_md(),MDData,TimeSeries) andunits(H5MD unit strings and pint), and streaming readers for LAMMPS dumps and vector trajectories. The layout is specified in The H5MD file.The LAMMPS step writes
md.h5mdat the end of each NVE, NVT, NPT and Heat Flux sub-step (lammps_step/md_h5md.py) and appends the run to_md_runs. The native files are kept.Diffusivity and Thermal Conductivity read
md.h5mdand fall back to the text files of older runs. Both stop before the MD for a non-periodic system.
Decisions taken while implementing:
A fixed box is written as time-dependent edges, repeated for each frame of the positions. MDAnalysis reads
box/edges/value[frame]and fails on the fixed form that H5MD also allows.When both atomic positions and a trajectory are sampled, the atomic positions (and velocities) go into
particles/all, and the trajectory into its own group,particles/trajectory. MDAnalysis reads the first group alphabetically, “all”.The off-diagonal pressure sampled for viscosity (
Pxy Pxz Pyz) is written aspressure_offdiagonal(attributecomponents= “xy xz yz”) until phase 4 replaces it by the fullpressure_tensor.Thermal Conductivity averages the temperature over the same samples as the heat flux: the whole run. Before, the temperature came from
state.json, which drops the equilibration period detected by pymbar and keeps only uncorrelated samples (494 of 5,001 in an argon test), while the heat flux was used whole. The two were thus taken over different parts of the run. For that argon NVE run the temperature changed by 0.03 K, or 0.05% in the thermal conductivity. Dropping an equilibration period, if wanted later, must cut the heat flux and the temperature at the same step.
Defects found on the way:
LAMMPS, non-periodic systems: sampling the trajectory of a molecule failed (“Variable name sxx … does not exist”), since the stress columns were added regardless of periodicity. The pressure was reported though meaningless.
Diffusivity: without centre-of-mass data it used the atomic positions or velocities with the molecules’ indices, which is wrong unless every molecule is one atom. It now checks the number of particles.
Thermal Conductivity: a missing
state.jsongave aNameError; the sampling interval was taken as fs even when the file gave ps.
Phase 3: requirements and analysing earlier MD#
Done on 2026-10-15.
The library gained
requirements(Need,Requirements,Provides,check),select_md_runs, andstep_support, the code the analysis steps share. The protocol is described in MD steps and analysis steps.seamm:
builder.validatecalls each step’scheck_flowchart(preceding); the editor validates before submitting. seamm_exec:run_flowchartvalidates before running any step, except in an iteration of a parallel loop, which its parent job checked. A failing check is logged, never reported, so a bug in a step cannot stop every job.LAMMPS:
md_providesandrequest_samplingon NVE, NVT, NPT and Heat Flux (md_provides.py); before running, the LAMMPS step callscheck_configurationon the steps after it up to the next LAMMPS step, following the flowchart’s edges without callingnext(), which a Loop may override.Diffusivity and Thermal Conductivity: the
md source,md filesandnumber of blocksparameters, both modes, automatic sampling in mode A, and the dialogs hide what does not apply, including the sub-flowchart tab in mode B.
Decisions taken while implementing:
Mode B reads the last run that samples the first need, not simply the last run, both when checking the flowchart and when running. A LAMMPS step with an NVT run sampling centres of mass followed by a Heat Flux run then feeds both Diffusivity (the NVT run) and Thermal Conductivity (the Heat Flux run).
A single run is divided into blocks (5 by default) analyzed as independent runs for the errors. Thermal Conductivity requires at least 2000 heat-flux samples per block; Diffusivity at least 10 frames.
Sources: “the last MD run”, “the last MD run of each loop iteration” (runs by the same step, i.e. the iterations of a Loop), and files. “All runs of the last MD step”, for production split over several sub-steps, waits for the segments of phase 8.
Diffusivity’s requirements: positions of the molecules (or atoms, for monatomic systems) at least every 1 ps, turned on at 100 fs; velocities at least every 20 fs, turned on at 10 fs. Thermal Conductivity: the heat flux every two steps. Mode A turns on what is missing in the last MD sub-step of the sub-flowchart and says so.
Thermal Conductivity in mode B uses the Green–Kubo approach only (the only one implemented) at the temperature of the MD; the approach and temperature parameters apply only when it runs its own MD.
Found on the way: when the correlation window is shorter than the start of the Helfand-moment fit (at least 1 ps), Thermal Conductivity silently dropped the Helfand Moments rows; it now says why.
Phase 4: the viscosity#
Done on 2026-10-15.
The library gained
shear_stress_components,autocorrelation_functions,component_helfand_moments,publish_viscosity/preceding_viscosity(the workspace variable_viscosity) andplots.plot_components.LAMMPS: the NVE, NVT and NPT sub-steps sample the full pressure tensor (“Sample the pressure tensor”) instead of its three off-diagonal components. The parameters
shear stress*were renamedpressure tensor*;NVE_Parameterstranslates the old names when a flowchart is read (format 2.0 and 3.0), as NPT already did for “keep orthorhombic”. The sampled tensor is written tomd.h5mdaspressure_tensor, replacing the coarser one from the thermodynamic state, sopressure_offdiagonalis no longer written.Viscosity (new,
viscosity_step): Green-Kubo and Helfand moments of the five shear components and their average, in both modes; needspressure_tensorat least every 5 fs and a periodic system. It publishes the Green-Kubo average for later steps and stores it asviscosity#Green-Kubo#<model>.Diffusivity: “Viscosity from” chooses the preceding Viscosity step (the default) or a given value for the Yeh-Hummer correction, which is now on by default and skipped with a note when there is no viscosity. Older flowcharts, which always give the viscosity, keep it.
Decisions taken while implementing:
The mean of the shear stress is not subtracted. For a fluid it is zero, and subtracting the sample mean of a block of length T lowers the correlation function by about 2 sigma^2 tau / T at every lag. With synthetic stresses of known viscosity (0.9 mPa s, 200 ps blocks) the Green-Kubo fit averaged 0.837 with the mean subtracted and 0.878 without, over eight seeds.
The average is fitted, not averaged. The Green-Kubo and Helfand values of the average are fits to the curve averaged over the five components, which is less noisy than any one of them; its error comes from the spread of the fits to each run or block.
The Viscosity step resets its data at the start of each run, so it gives the right answer inside a loop. Thermal Conductivity does not, which is worth fixing.