Skip to content

stb-optical

Stage 1 - Direction Folders of the 5.14 Optical Properties workflow · menu code 5.14.1

usage: stb-optical [-h] -f FILE [-c CALC] [-p PSEUDO_DIR]
                   [--directions {xx,yy,zz,xy,xz,yz} [{xx,yy,zz,xy,xz,yz} ...]]
                   [--optical-mesh NX NY NZ] [--optical-broaden EV]
                   [--optical-nbands N] [--kgrid NX NY NZ] [--kgrid-density D]
                   [--vacuum-gap VACUUM_GAP] [-O OUTPUT_DIR] [-v] [--no-intro]

Stage 1 of 2: writes one SIESTA folder per requested Cartesian/biaxial polarization direction, ready for a linear-response Optical.Calculate run.
Takes an ALREADY-RELAXED structure (--file) and a calc.fdf template (--calc, default: calc.fdf in the
current directory), and for each requested direction (--directions, default xx yy zz) writes
'<output-dir>/dir_<axis>/' with the SAME structure (no new geometry -- unlike this suite's other
WORKFLOW_TOOLS prep stages, there's nothing to deform/search/enumerate here). Every forced directive
-- MD.TypeOfRun CG / MD.Steps 0 / MD.NumCGsteps 0 / MD.VariableCell false (single-point, no
relaxation), that folder's own Optical.Mesh/Optical.Vector/Optical.Broaden/Optical.NumberOfBands block
(SIESTA's own linear-response/RPA dielectric-function machinery -- see the SIESTA manual's Optical.*
directives) and, when it is REQUIRED, the ground-state SCF k-grid -- is written into a config_extra.fdf
sidecar, %include'd at the very top of calc.fdf, never edited into your own --calc template text
directly (this suite's standard config_extra.fdf convention -- see the manual). The SCF k-grid is
forced when your template defines none (SIESTA would sample Gamma only; a grid is suggested at
density 0.2 1/Ang, vacuum axes getting 1 division) or when you ask for one (--kgrid X Y Z, or
--kgrid-density D); a template that already has a grid keeps it. Doesn't run SIESTA -- run each folder yourself, then use stb-opticalAnalysis (which
aggregates every direction folder present into one combined report/spectrum, so run it once against
the whole --output-dir root, not once per folder).

[DIAGONAL vs. BIAXIAL DIRECTIONS] 'xx'/'yy'/'zz' set Optical.Vector to the pure Cartesian unit axis
(e_x/e_y/e_z) -- the diagonal dielectric-tensor component eps_ii comes directly from that one folder.
'xy'/'xz'/'yz' set Optical.Vector to the NORMALIZED BISECTOR of the two axes involved (e.g. xy ->
(e_x+e_y)/sqrt(2)) -- SIESTA's Optical.Vector always computes a single-direction response n^T.eps.n,
never a genuine off-diagonal component directly, so the bisector is the standard trick to reach one:
for a symmetric dielectric tensor, response along that bisector expands to
(eps_ii + eps_jj)/2 + eps_ij, so once eps_ii, eps_jj AND the bisector's own response are all known,
  eps_ij = eps_(bisector ij) - (eps_ii + eps_jj) / 2
recovers the true off-diagonal component. Requesting 'xy' without also requesting 'xx'/'yy' in the
same (or an earlier) run still writes a valid folder -- it's simply not reconstructible into eps_xy
until the 2 diagonal folders it needs also exist; the Stage 1 report flags this per direction.

Stage 2 (stb-opticalAnalysis) auto-detects each folder's direction from its own Optical.Vector value
(not the folder name) and, whenever a biaxial direction's 2 matching diagonal folders are ALSO
present in the same run, applies the reconstruction formula above automatically -- eps_ij(E) is
written to its own dedicated output alongside the raw per-direction eps_ii(E)/eps_jj(E) results, no
extra flag needed. A biaxial folder without its matching diagonal pair is still read normally by
Stage 2 (its raw eps_(bisector)(E) response is real data), just not reconstructible into eps_ij yet.

[KNOWN LIMITATION, 2D/slab inputs] No direction is skipped or specially treated for a vacuum-padded
input -- every requested direction (including out-of-plane and any biaxial one involving it) is still
written and computed. For a slab, the periodic-supercell dielectric response along ANY direction is
diluted by the vacuum region (a well-known methodological caveat for slab dielectric/polarizability
DFT calculations) -- no vacuum-thickness rescaling is applied here. Interpret out-of-plane 2D results
with this in mind.

options:
  -h, --help            show this help message and exit
  -f FILE, --file FILE  Already-relaxed input structure.fdf.
  -c CALC, --calc CALC  calc.fdf template for the Optical calculations (default: calc.fdf).
  -p PSEUDO_DIR, --pseudo-dir PSEUDO_DIR
                        Pseudopotentials source: a bundled bank or a folder path.
  --directions {xx,yy,zz,xy,xz,yz} [{xx,yy,zz,xy,xz,yz} ...]
                        Direction(s) to compute (default: xx yy zz). 'xx'/'yy'/'zz' are the diagonal Cartesian components (Optical.Vector = a unit axis, eps_ii read directly). 'xy'/'xz'/'yz' are BIAXIAL directions (Optical.Vector = the normalized bisector of the 2 axes, e.g. (1,1,0)/sqrt(2) for xy) -- the off-diagonal eps_ij component is only reconstructible from these once the matching xx/yy/zz pair also exists; see the description above for the exact formula.
  --optical-mesh NX NY NZ
                        Optical.Mesh k-point sampling for the optical-transition integral (default: 10 10 10).
  --optical-broaden EV  Optical.Broaden Gaussian broadening in eV (default: 0.2).
  --optical-nbands N    Optical.NumberOfBands (default: SIESTA's own default -- all bands).
  --kgrid NX NY NZ      Ground-state SCF k-grid forced into every folder's config_extra.fdf (e.g. --kgrid 8 8 8). Overrides the template's own grid. Without --kgrid or --kgrid-density the template's grid is kept; if the template has none, a grid is suggested automatically (density 0.2 1/Ang).
  --kgrid-density D     Suggest the SCF k-grid from a target density in 1/Ang (same convention as stb-kgrid; vacuum axes get 1 division) and force it into config_extra.fdf, overriding the template's grid. Ignored when --kgrid is given.
  --vacuum-gap VACUUM_GAP
                        Vacuum-axis detection threshold in Ang (vacuum axes get a single SCF k-point division and drive the dimensionality notes; default: 10.0).
  -O OUTPUT_DIR, --output-dir OUTPUT_DIR
                        Root directory for the whole optical-properties workflow (default: optical_study).
  -v, --version         show program's version number and exit
  --no-intro            Do not show the introduction

Usage examples:
  stb-optical -f relaxed.fdf -p dojo
  stb-optical -f relaxed.fdf -p dojo --directions xx yy zz xy xz yz