Skip to content

stb-mlelastic

ML Elastic Constants · menu code 7.4 · guide: 7.4 ML Elastic Constants

usage: stb-mlelastic [-h] --file FILE [--model {small,medium,large}]
                     [--custom-model PATH] [--custom-model-card JSON]
                     [--skip-foundation-comparison] [--no-pre-relax] [--no-relax]
                     [--no-clamped] [--fmax FMAX] [--max-steps MAX_STEPS] [--max MAX]
                     [--steps STEPS] [--check-convergence]
                     [--convergence-strains PCT [PCT ...]]
                     [--dimensionality {auto,3d,2d,1d}] [--vacuum-gap VACUUM_GAP]
                     [--fit-quality-tolerance FIT_QUALITY_TOLERANCE]
                     [--skip-anisotropy-surface] [--device {cpu,cuda}] [-o OUTPUT_DIR]
                     [--show] [--save-gnuplot] [--save-data] [--no-intro] [-v]

Elastic constants by the stress-strain method, 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). Strains the relaxed cell along every canonical Voigt direction not blocked by a vacuum axis, relaxes the atoms at each strained cell, fits the stiffness tensor and reports: each model's reference state, fit quality per direction, the strained cells against the card's trained range, the tensor projected on the crystal's point group, Born stability, Voigt/Reuss/Hill moduli, clamped- vs relaxed-ion constants, Christoffel sound velocities and the Debye temperature, directional Young's modulus and compressibility, and fine-tuned vs foundation; every warning in one final section. Or, with --check-convergence, the fit at several strain amplitudes. A fast preview, not a substitute for the SIESTA-based stb-elasticInputs/stb-elasticAnalysis workflow.

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
                        With --custom-model the same calculation is repeated with the raw foundation model (--model) and compared constant by constant; this flag skips it. --check-convergence never compares.
  --no-pre-relax        Skip the pre-relax of the reference structure (cell + atoms). On by default: the constants are second derivatives about a stress-free minimum; a residual stress shows up as the fits' intercepts.
  --no-relax            Do not relax the atoms at each strained cell (clamped-ion constants only). On by default: the measured constants are relaxed-ion ones (diamond's C44 depends on it).
  --no-clamped          Skip the clamped-ion scan that is compared with the relaxed-ion constants (it doubles the number of stress evaluations; run only when the cell has 2+ atoms).
  --fmax FMAX           Force threshold of both relaxations, eV/Ang (default: 0.001). Tight on purpose: under shear the atoms of a diamond-type cell relax by only ~0.008 Ang per % strain, and a residual force f leaves them ~f/k off (k ~ 13 eV/Ang^2): 0.02 made silicon's C44 3 % low and noisy, 0.001 is converged to 0.3 %. With MACE the extra steps cost milliseconds.
  --max-steps MAX_STEPS
                        Max optimizer steps of both relaxations (default: 200).
  --max MAX             Max strain magnitude, % (default: 1.0).
  --steps STEPS         Strain points per direction, spanning [-max, +max] (default: 5, which includes the unstrained cell).
  --check-convergence   Instead of one fit, repeat it at several --max strain magnitudes (--convergence-strains) and compare every independent constant: does the linear regime hold? No foundation comparison in this mode.
  --convergence-strains PCT [PCT ...]
                        Max strain magnitudes (%) for --check-convergence (default: half, the given --max, and double it).
  --dimensionality {auto,3d,2d,1d}
                        Physical dimensionality, controlling report units and which constants are physically meaningful (default: auto-detected from vacuum padding). Manual override assumes the same axis convention as stb-elasticAnalysis: in-plane xy for 2D, wire-along-c for 1D.
  --vacuum-gap VACUUM_GAP
                        Gap (Ang) used to detect vacuum-padded axes (default: 10.0).
  --fit-quality-tolerance FIT_QUALITY_TOLERANCE
                        Minimum R^2 of a direction's stress-strain fit before it is flagged (default: 0.995).
  --skip-anisotropy-surface
                        Do not draw the 3D Young's-modulus surface (anisotropy_surface.png). The directional numbers and the polar plots are kept.
  --device {cpu,cuda}   Device to run the model on (default: cpu).
  -o OUTPUT_DIR, --output-dir OUTPUT_DIR
                        Output directory (default: mlelastic_out).
  --show                Open the figures on screen at the end (needs a display; without one it is a warning). The PNGs are written either way.
  --save-gnuplot        Write .dat + .gplot into <output-dir>/plot/ and run gnuplot there (one PDF per figure) when it is installed. Off by default.
  --save-data           Write the data behind the report: stress_strain.dat (every strained cell's stress), elastic_tensor.dat (C, its projection, S), directional.dat. Off by default.
  --no-intro            Do not show the introduction
  -v, --version         show program's version number and exit

Example usage:
  stb-mlelastic --file structure.fdf
  stb-mlelastic --file structure.fdf --custom-model mlff_model.model --custom-model-card mlff_model_card.json --device cuda --steps 7
  stb-mlelastic --file structure.fdf --check-convergence --convergence-strains 0.25 0.5 1 2 3