Skip to content

stb-hubbarduAnalysis

Stage 3 - Analysis of the 5.7 Hubbard U (Linear Response) workflow · menu code 5.7.3

usage: stb-hubbarduAnalysis [-h] [--dir DIR] [--file FILE]
                            [--r2-tolerance R2_TOLERANCE] [-o OUTPUT] [--save-gnuplot]
                            [--view] [-v] [--no-intro]

Stage 3 of 3: analyzes a stb-hubbardu linear-response sweep and computes the Hubbard U.
Fits the self-consistent (screened) and frozen-density (bare) occupation
responses to the perturbation strength, then applies the standard
Cococcioni & de Gironcoli formula: U = 1/chi0 - 1/chi (Phys. Rev. B 71,
035105, 2005). Reports a convergence summary, both fits' R^2 and intercepts
(flagging a fit whose zero point drifted from what was actually measured
there), and warns if chi/chi0 have opposite signs or U comes out negative --
all signs of a bad fit rather than a real result. Writes a ready-to-use
%%block LDAU.proj snippet with the computed U, plus (opt-in) a gnuplot
data+script pair and/or a live matplotlib preview to inspect the fit
visually instead of trusting R^2 alone.

options:
  -h, --help            show this help message and exit
  --dir DIR             Directory containing the run folders and run_manifest.json written by stb-hubbardu/stb-hubbarduAlphas (stages 1/2) -- defaults to 'hubbardu_runs', their own default --output-dir/--dir, so stage 3 runs against their output with no extra flag in the common case.
  --file FILE           SIESTA output filename inside each run folder (default: calc.out).
  --r2-tolerance R2_TOLERANCE
                        Warn if either fit's R^2 falls below this (default: 0.98) -- a poor linear fit means the perturbation range is probably too wide.
  -o OUTPUT, --output OUTPUT
                        Output .fdf snippet filename (default: <species>_LDAU.fdf).
  --save-gnuplot        Also write the response curve as a gnuplot data+script pair (<species>_hubbardu_response.dat/.gplot), under a 'plot/' subfolder inside --dir. Off by default.
  --view                Show an interactive matplotlib preview of the response curve (both branches + fitted lines) before finishing. Off by default.
  -v, --version         show program's version number and exit
  --no-intro            Do not show the introduction

Usage example:
  stb-hubbarduAnalysis --dir hubbardu_runs --file calc.out
  stb-hubbarduAnalysis --dir hubbardu_runs --save-gnuplot --view