Skip to content

stb-mlneb

ML NEB · menu code 7.5 · guide: 7.5 ML NEB

usage: stb-mlneb [-h] --initial INITIAL --final FINAL [--model {small,medium,large}]
                 [--custom-model PATH] [--custom-model-card JSON]
                 [--skip-foundation-comparison] [--mlff-workflow JSON]
                 [--no-committee] [--committee-models PATH [PATH ...]]
                 [--siesta-check] [--siesta-check-images {ends-saddle,all}]
                 [--calc CALC] [--pseudo-dir PSEUDO_DIR] [--kgrid KA KB KC]
                 [--to-mlff] [--to-mlff-rattle N] [--to-mlff-stdev TO_MLFF_STDEV]
                 [--to-mlff-seed TO_MLFF_SEED] [--n-images N_IMAGES]
                 [--autosort-tol AUTOSORT_TOL] [--no-idpp] [--idpp-fmax IDPP_FMAX]
                 [--idpp-steps IDPP_STEPS] [--no-pre-relax-endpoints]
                 [--freeze-substrate] [--freeze-threshold FREEZE_THRESHOLD] [--k K]
                 [--fmax FMAX] [--max-steps MAX_STEPS] [--device {cpu,cuda}]
                 [-o OUTPUT_DIR] [--show] [--save-gnuplot] [--save-data]
                 [--save-images] [--no-intro] [-v]

Climbing-image NEB (nudged elastic band) driven entirely 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). Relaxes the two endpoint structures (--initial/--final, same composition and cell), interpolates the band (linear + IDPP), relaxes it with a two-stage climbing-image NEB and reports: the atoms that move, the endpoint relaxations, the starting path, the NEB convergence, the band image by image, the barrier forward and backward (spline and highest image), the saddle geometry, the band against the model card's trained range and, with a custom model, the same NEB with the foundation model and the uncertainty of its committee; every warning in one final section. Closing the loop with SIESTA: --siesta-check writes single-point folders for the endpoints and the saddle (then reads them on the next run and compares the model with SIESTA on the same geometries), and --to-mlff adds the images to the training set of the 7.1 workflow (--mlff-workflow) for the next round. For the full DFT barrier use stb-neb (5.9).

options:
  -h, --help            show this help message and exit
  --initial INITIAL     Initial (relaxed) endpoint structure (.fdf).
  --final FINAL         Final (relaxed) endpoint structure (.fdf).
  --model {small,medium,large}
                        MACE-MP-0 model size (default: medium). With --custom-model, the foundation model of the comparison.
  --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.
  --skip-foundation-comparison
                        With --custom-model, do not repeat the NEB with the foundation model (--model). The comparison is on by default: it shows what the fine-tuning changed in the barrier.
  --mlff-workflow JSON  The mlff_workflow.json of the 7.1 run that trained --custom-model: locates its committee (for the uncertainty), and gives --siesta-check/--to-mlff the training level of theory (calc.fdf, pseudopotentials, dispersion, k x a).
  --no-committee        Do not evaluate the committee of the custom model on the band. On by default when the card records a committee whose model files are found (next to the card's run folder, or in --mlff-workflow's): the force spread per image and each member's barrier.
  --committee-models PATH [PATH ...]
                        The committee's model files explicitly (each with its mlff_model_card.json next to it), instead of the card's own list.
  --siesta-check        Write single-point SIESTA folders for images of the relaxed band into <output-dir>/siesta_check/image_NN/ (--siesta-check-images). Run SIESTA there and run stb-mlneb again with the same options: finished folders whose geometry matches the band are read and the model's profile is compared with SIESTA's on the same geometries. Needs --calc or --mlff-workflow.
  --siesta-check-images {ends-saddle,all}
                        Which images --siesta-check writes: the two endpoints and the climbing image (default), or every image.
  --calc CALC           calc.fdf template for --siesta-check/--to-mlff (no geometry; it must %include the structure file, which each folder gets). Default with --mlff-workflow: its reference calc.fdf. With --mlff-workflow, --calc applies to --siesta-check alone: --to-mlff always uses the workflow's reference (training labels must share its level of theory), and any setting in which --calc differs from it is reported. The calc file is written as calc.fdf (or the reference's own name).
  --pseudo-dir PSEUDO_DIR
                        Pseudopotentials for --siesta-check with --calc: a folder or a bank name (default: .).
  --kgrid KA KB KC      k-grid of the check/export folders. Default: with --mlff-workflow the reference's grid scaled to this cell (same k x a as the training set); with --calc its own grid.
  --to-mlff             Add the band's images to the training set of the --mlff-workflow run, as configs of its next round (<run>/configs_round_NN/neb_<output-dir>/), with the workflow's level of theory. Images already labelled by --siesta-check are copied with their output. Then stb-mlffAnalysis trains the next round on them.
  --to-mlff-rattle N    With --to-mlff, also N rattled copies of every image (default: 0): the neighbourhood of the path, not only the path itself.
  --to-mlff-stdev TO_MLFF_STDEV
                        Gaussian displacement of --to-mlff-rattle copies, Ang (default: 0.05).
  --to-mlff-seed TO_MLFF_SEED
                        Random seed of --to-mlff-rattle (default: 7).
  --n-images N_IMAGES   Total images including both endpoints (default: 7, at least 3).
  --autosort-tol AUTOSORT_TOL
                        Atom-correspondence tolerance between --initial/--final, Ang. Default: 0 (the files' own atom order, no matching) when both list the same species in the same order -- as two minima written by one tool do (stb-mladsorb, stb-adsorb): a hop longer than 0.5 Ang cannot be matched by distance --, else 0.5 (pymatgen's own documented value).
  --no-idpp             Skip the IDPP (Image Dependent Pair Potential) refinement of the interior images before the NEB. On by default: a geometric smoothing that usually gives a much better start than linear interpolation.
  --idpp-fmax IDPP_FMAX
                        IDPP force convergence (default: 0.1, ASE's own). Loose for a molecular adsorbate: on H2O/Ag(111) it stopped after 7 steps with H-O-H at 169 deg in the middle image (DFT: +1.3 eV, 1.37 eV/Ang there); --idpp-fmax 0.01 --idpp-steps 2000 gave 112.7 deg. The report warns when an bond or angle inside a molecule leaves the endpoints' range.
  --idpp-steps IDPP_STEPS
                        Max steps for IDPP (default: 100). See --idpp-fmax.
  --no-pre-relax-endpoints
                        Skip the relaxation (positions only) of both endpoints with the model. On by default, so the barrier is measured from the model's own minima.
  --freeze-substrate    Freeze the atoms that move less than --freeze-threshold between --initial and --final during the NEB: fewer degrees of freedom, no spectator atom wandering. Off by default.
  --freeze-threshold FREEZE_THRESHOLD
                        Displacement threshold for --freeze-substrate, Ang (default: 0.3).
  --k K                 NEB spring constant, eV/Ang^2 (default: 0.1).
  --fmax FMAX           Force convergence of the endpoint relaxations and of the NEB, eV/Ang (default: 0.05). The shaping stage stops at max(2 x fmax, 0.1); the climbing stage at fmax.
  --max-steps MAX_STEPS
                        Optimizer steps of each endpoint relaxation, and of the NEB in total: the shaping stage gets half, the climbing stage the rest (default: 200).
  --device {cpu,cuda}   Device to run the model on (default: cpu).
  -o OUTPUT_DIR, --output-dir OUTPUT_DIR
                        Output directory (default: mlneb_out).
  --show                Open the figure on screen at the end (needs a display; without one it is a warning). neb_profile.png is written either way.
  --save-gnuplot        Write .dat + .gplot into <output-dir>/plot/ and run gnuplot there (neb_profile.pdf) when it is installed. Off by default.
  --save-data           Write the band as a table: neb_band.dat (and neb_band_foundation.dat with the comparison): image, reaction coordinate, energy, max force, shortest distance, shift. Off by default.
  --save-images         Also write each relaxed image as image_NN.fdf (bare structure, no calc or pseudopotentials) -- e.g. to start a SIESTA NEB (stb-neb) from this band. Off by default.
  --no-intro            Do not show the introduction
  -v, --version         show program's version number and exit

Example usage:
  stb-mlneb --initial initial.fdf --final final.fdf
  stb-mlneb --initial initial.fdf --final final.fdf --custom-model mlff_model.model --custom-model-card mlff_model_card.json --device cuda --n-images 9 --show --save-gnuplot
  stb-mlneb --initial initial.fdf --final final.fdf --freeze-substrate --save-images
  stb-mlneb --initial i.fdf --final f.fdf --custom-model best_model/mlff_model_compiled.model --custom-model-card best_model/mlff_model_card.json --mlff-workflow mlff_runs/mlff_workflow.json --siesta-check            # then run SIESTA, run it again, and add --to-mlff