Skip to content

stb-mlphonons

ML Phonons · menu code 7.3 · guide: 7.3 ML Phonons

usage: stb-mlphonons [-h] --file FILE [--model {small,medium,large}]
                     [--custom-model PATH] [--custom-model-card JSON]
                     [--skip-foundation-comparison] [--dim NA NB NC]
                     [--distance DISTANCE] [--no-relax] [--fmax FMAX]
                     [--vacuum-gap VACUUM_GAP] [--band-points BAND_POINTS]
                     [--mesh NA NB NC] [--tmin TMIN] [--tmax TMAX] [--tstep TSTEP]
                     [--qha] [--n-volumes N_VOLUMES] [--strain-range STRAIN_RANGE]
                     [--eos {vinet,murnaghan,birch_murnaghan}] [--check-convergence]
                     [--convergence-dims N [N ...]]
                     [--convergence-tol CONVERGENCE_TOL] [--freeze-unstable-mode]
                     [--freeze-amplitude FREEZE_AMPLITUDE]
                     [--animate-mode [BAND_INDEX]] [--animate-qpoint QA QB QC]
                     [--animate-dim NA NB NC] [--animate-amplitude ANIMATE_AMPLITUDE]
                     [--animate-frames ANIMATE_FRAMES]
                     [--animate-format {pdb,xsf,xyz}] [--device {cpu,cuda}]
                     [-o OUTPUT_DIR] [--show] [--save-gnuplot] [--save-data]
                     [--no-intro] [-v]

Standalone phonon calculation 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). One shot: displacements, force constants, band structure, DOS (total + per-species), and thermal properties -- or, with --qha, a quasi-harmonic volume scan (thermal expansion, bulk modulus vs. T). No SIESTA and no separate analysis tool needed. A fast heuristic preview, not a substitute for the real SIESTA-based stb-phononsCreate/stb-phononsPos workflow -- ML potentials are markedly less reliable for phonons (imaginary modes especially) than DFT.

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.
  --skip-foundation-comparison
                        If --custom-model is given, also evaluate the same phonon pipeline with the raw (non-fine-tuned) foundation model (--model) and overlay both on the bands/DOS/thermal plots, to show whether fine-tuning actually changed the phonon prediction. On by default; pass this to skip it (--qha never does this comparison, regardless of this flag).
  --dim NA NB NC        Supercell dimensions for the finite-displacement method (default: 2 2 2).
  --distance DISTANCE   Displacement distance, Angstrom (default: 0.01).
  --no-relax            Skip the MACE pre-relax (positions only) before generating displacements. On by default -- a phonon calculation assumes ~zero net force at the reference geometry; skipping this on an unrelaxed structure is a common cause of spurious imaginary modes.
  --fmax FMAX           Force convergence threshold for the pre-relax, eV/Ang (default: 0.05).
  --vacuum-gap VACUUM_GAP
                        Gap (Ang) used to detect vacuum-padded axes (default: 10.0).
  --band-points BAND_POINTS
                        q-points per band-structure segment (default: 101).
  --mesh NA NB NC       q-point mesh for DOS/thermal properties (default: 20 20 20).
  --tmin TMIN           Min temperature, K (default: 0).
  --tmax TMAX           Max temperature, K (default: 1000).
  --tstep TSTEP         Temperature step, K (default: 10).
  --qha                 Quasi-harmonic approximation instead of a single-volume calculation: scans --n-volumes isotropically-scaled volumes and fits an equation of state (thermal expansion, bulk modulus, Cp and Grueneisen parameters vs. T, mode Grueneisen parameters). No foundation-model comparison in this mode. Off by default.
  --n-volumes N_VOLUMES
                        Number of volume points for --qha, >= 5 (default: 5).
  --strain-range STRAIN_RANGE
                        Volume range around equilibrium for --qha, +/- % (default: 3.0).
  --eos {vinet,murnaghan,birch_murnaghan}
                        Equation of state for --qha (default: vinet).
  --check-convergence   Instead of a single-volume calculation, run the same pipeline at multiple supercell sizes (--convergence-dims) and compare them with the largest one along the band path and at the special points (RMSE, largest difference), plus heat capacity, entropy and ZPE -- MACE is cheap enough to check --dim convergence directly, unlike DFT. Not supported together with --qha. Off by default.
  --convergence-dims N [N ...]
                        Flat list of supercell sizes for --check-convergence, given as consecutive NA NB NC triples (e.g. 1 1 1 2 2 2 3 3 3 tests 1x1x1, 2x2x2, and 3x3x3) -- must be a multiple of 3 values. Default: --dim itself and --dim+1 on every non-vacuum axis (two points).
  --convergence-tol CONVERGENCE_TOL
                        Band-path RMSE (THz) against the largest supercell under which a smaller one counts as converged (default: 0.1).
  --freeze-unstable-mode
                        If the phonon mesh has a genuine imaginary (unstable) mode, write a new structure displaced along that mode's eigenvector -- a common trick to escape a saddle point and find the true minimum. Same feature stb-phononsPos already has for the SIESTA path. Not supported together with --qha/--check-convergence. Off by default.
  --freeze-amplitude FREEZE_AMPLITUDE
                        Max atomic displacement (Angstrom) for --freeze-unstable-mode (default: 0.05).
  --animate-mode [BAND_INDEX]
                        Animate a normal mode's vibration and write it as a multi-frame trajectory (xsf/pdb/xyz, same convention as stb-ani2traj/stb-mlmd) for viewing in OVITO/VMD -- BAND_INDEX selects which mode (0 = lowest frequency) at --animate-qpoint; with no value, or 'optical', the first optical mode (band 3: bands 0-2 are acoustic, at Gamma a rigid translation). Not supported together with --qha/--check-convergence. Off by default.
  --animate-qpoint QA QB QC
                        Fractional q-point to animate a mode at (default: 0 0 0, Gamma).
  --animate-dim NA NB NC
                        Supercell size used to build the animated modulation -- must make --animate-qpoint commensurate (q x dim ~ integer vector); the default 1 1 1 only works exactly at Gamma (default: 1 1 1).
  --animate-amplitude ANIMATE_AMPLITUDE
                        Max atomic displacement for the animation, Angstrom -- deliberately larger than --freeze-amplitude since this is for visualization, not a physical perturbation (default: 0.5).
  --animate-frames ANIMATE_FRAMES
                        Number of frames in one full vibration cycle (default: 30).
  --animate-format {pdb,xsf,xyz}
                        Output trajectory format for --animate-mode, same convention as stb-ani2traj/stb-mlmd (default: xsf).
  --device {cpu,cuda}   Device to run the model on (default: cpu).
  -o OUTPUT_DIR, --output-dir OUTPUT_DIR
                        Output directory for all plots/data (default: mlphonons_out).
  --show                Open the figures on screen at the end (needs a display; without one it is a warning, not an error). The PNGs are written either way.
  --save-gnuplot        Write every figure as .dat + .gplot into <output-dir>/plot/ and run gnuplot there (one PDF per figure) when it is installed. Off by default.
  --save-data           Also write the raw numeric data (.dat) behind each plot. Off by default.
  --no-intro            Do not show the introduction
  -v, --version         show program's version number and exit

Example usage:
  stb-mlphonons --file structure.fdf --dim 2 2 2
  stb-mlphonons --file structure.fdf --custom-model mlff_model.model --custom-model-card mlff_model_card.json --dim 3 3 3
  stb-mlphonons --file structure.fdf --qha --n-volumes 7 --strain-range 5 --save-gnuplot
  stb-mlphonons --file structure.fdf --check-convergence --convergence-dims 1 1 1 2 2 2 3 3 3 --show