Skip to content

stb-mlmd

ML Molecular Dynamics · menu code 7.2 · guide: 7.2 ML Molecular Dynamics

usage: stb-mlmd [-h] --file FILE [--model {small,medium,large}] [--custom-model PATH]
                [--custom-model-card JSON] [--ensemble {nve,nvt,npt}]
                [--temperature TEMPERATURE] [--pressure PRESSURE]
                [--timestep TIMESTEP] [--n-steps N_STEPS]
                [--equilibration-steps EQUILIBRATION_STEPS] [--friction FRICTION]
                [--taut TAUT] [--taup TAUP] [--compressibility COMPRESSIBILITY]
                [--stride STRIDE] [--supercell NA NB NC] [--vacuum-gap VACUUM_GAP]
                [-of {pdb,xsf,xyz}] [-o OUTPUT] [--output-structure OUTPUT_STRUCTURE]
                [--device {cpu,cuda}] [--seed SEED] [--png [FILE]] [--show]
                [--save-gnuplot] [--save-data] [--no-intro] [-v]

Molecular dynamics driven by a MACE potential -- the MACE-MP-0 foundation model, or a custom model fine-tuned on your own SIESTA data via stb-mlffAnalysis (--custom-model, always with its model card). NVE (microcanonical), NVT (Langevin thermostat), or NPT (Berendsen thermostat+barostat, bulk-only) ensembles. The report covers the model and its card, thermodynamic averages with error bars, ensemble checks (NVE drift in meV/atom/ps, temperature fluctuations, pressure), the structure along the run (shortest distance, g(r), MSD and diffusion, Lindemann ratio) and whether the run stayed inside the model's trained range; every warning goes to one final section. A fast heuristic exploration tool, not a substitute for a real ab initio MD run.

options:
  -h, --help            show this help message and exit
  --file FILE           Input structure (.fdf).
  --model {small,medium,large}
                        MACE-MP-0 model size (default: medium). Ignored if --custom-model is given.
  --custom-model PATH   Use a custom MACE model file instead of the MACE-MP-0 foundation potential -- e.g. one fine-tuned via stb-mlffAnalysis. Overrides --model.
  --custom-model-card JSON
                        Model card of the --custom-model file: the mlff_model_card.json that stb-mlffAnalysis wrote next to it (training data, level of theory, accuracy, energy scale). Required with --custom-model -- the card is checked against the model file and used to warn when a structure is outside what the model was trained on.
  --ensemble {nve,nvt,npt}
                        MD ensemble (default: nvt). npt requires a bulk (no vacuum-padded axis) structure -- cell dynamics on a slab/wire/molecule would be physically meaningless.
  --temperature TEMPERATURE
                        Target temperature, K (default: 300). In NVE only the initial velocities.
  --pressure PRESSURE   Target pressure, GPa (npt only, default: 0.0 -- ambient).
  --timestep TIMESTEP   MD timestep, fs (default: 1.0).
  --n-steps N_STEPS     Number of PRODUCTION MD steps, after --equilibration-steps (default: 1000).
  --equilibration-steps EQUILIBRATION_STEPS
                        Steps to run and discard BEFORE production (default: 0). Verified live that a freshly Maxwell-Boltzmann-seeded structure relaxes for ~100-200 steps before settling -- letting that transient into the saved trajectory/statistics biases them towards the initial condition.
  --friction FRICTION   Langevin friction coefficient, fs^-1 (nvt only, default: 0.01).
  --taut TAUT           Thermostat coupling time, fs (npt only -- Berendsen, default: 100).
  --taup TAUP           Barostat coupling time, fs (npt only, default: 500).
  --compressibility COMPRESSIBILITY
                        Compressibility, 1/bar (npt only, default: 4.57e-5 -- water's value, a generic placeholder; override with something closer to 1/bulk-modulus for the actual material, 1/(B[GPa] x 1e4) -- e.g. Si, B ~ 98 GPa: 1e-6 -- for a better-calibrated barostat response).
  --stride STRIDE       Save one trajectory frame (and one sample of every quantity) every Nth MD step (default: 10).
  --supercell NA NB NC  Repeat the input cell NA x NB x NC times along a, b, c before the run (default: 1 1 1). A small cell constrains the dynamics to its own periodicity (no long-wavelength modes) and gives poor statistics; use ~64-500 atoms for thermodynamics, g(r) and diffusion.
  --vacuum-gap VACUUM_GAP
                        Gap (Ang) used to detect vacuum-padded axes (default: 10.0, matches stb-kgrid/stb-mlrelax).
  -of {pdb,xsf,xyz}, --out-format {pdb,xsf,xyz}
                        Trajectory format (default: xsf). Same 3 choices as stb-ani2traj.
  -o OUTPUT, --output OUTPUT
                        Trajectory filename. Default: <input stem>_md_traj.<ext>
  --output-structure OUTPUT_STRUCTURE
                        Final-frame structure output (default: md_final.fdf).
  --device {cpu,cuda}   Device to run the model on (default: cpu).
  --seed SEED           Random seed for initial velocities.
  --png [FILE]          Save the run's dashboard (temperature, energies, pressure, volume or shortest distance, g(r), MSD) as a PNG (default name: <input stem>_md_dashboard.png). Off by default.
  --show                Display the dashboard on screen (needs a display). Off by default.
  --save-gnuplot        Write the data files (as --save-data) plus <input stem>_md.gplot, the same six panels for gnuplot ('gnuplot <stem>_md.gplot' -> <stem>_md.pdf). Off by default.
  --save-data           Write the data behind the report: <stem>_md_thermo.dat (time series: T, energies per atom, P, volume, cell, shortest distance, max force), <stem>_md_rdf.dat and <stem>_md_msd.dat. Off by default.
  --no-intro            Do not show the introduction
  -v, --version         show program's version number and exit

Example usage:
  stb-mlmd --file structure.fdf --ensemble nvt --temperature 300 --n-steps 5000
  stb-mlmd --file structure.fdf --ensemble nvt --equilibration-steps 200 --n-steps 5000 --png --save-gnuplot
  stb-mlmd --file structure.fdf --custom-model mlff_model.model --custom-model-card mlff_model_card.json --ensemble npt \
                           --temperature 500 --pressure 0.0 --compressibility 1e-6 --n-steps 10000 --device cuda