mag4.analysis.wien2k
Extract converged magnetic moments from WIEN2k .scf files.
Layer: WIEN2k-specific (backs the mag4-moments CLI).
Functions
|
Textual table of moments for each case + statistics + a target check. |
|
Parse a WIEN2k |
|
Return the last |
|
Auto-detect config subdirectories with results for |
|
Locate a |
|
Read the intended per-site |
- mag4.analysis.wien2k.parse_report_target_moment(report_path)[source]
Read the intended per-site
|MAGMOM| = 2·Sfrom a mag4 report.Returns the target moment (μ_B) or
Noneif the report has noMAGMOM (S = …, |MAGMOM| = 2·S = …)header (older/other reports).
- mag4.analysis.wien2k.find_report(base_dir='.')[source]
Locate a
*_report.datinbase_dir(prefersfour_state_report).
- mag4.analysis.wien2k.find_cases(base_dir='.', scf_basename=None, code='wien2k')[source]
Auto-detect config subdirectories with results for
code(sorted).code='wien2k'→ directories with a.scffile (or exactly<scf_basename>.scfwhen given);code='vasp'→ directories with anOUTCAR.
- mag4.analysis.wien2k.extract_moments_from_scf(scf_path, atom_indices)[source]
Parse a WIEN2k
.scffile and return the converged:MMIxxx:values.Line format:
:MMI009: MAGNETIC MOMENT IN SPHERE 9 = 2.85000
The last occurrence of each tag (i.e. the converged value) is kept.
- mag4.analysis.wien2k.extract_total_moment(scf_path)[source]
Return the last
:MMTOT:total magnetic moment in cell.
- mag4.analysis.wien2k.build_table(cases, atom_indices, scf_basename=None, target=None, tol=0.5, code='wien2k')[source]
Textual table of moments for each case + statistics + a target check.
codeselects the parser:'wien2k'reads per-sphere:MMI:values from<dir>/<scf_basename>.scf;'vasp'reads the per-iontotcolumn of the lastmagnetization (x)block in<dir>/OUTCAR(needsLORBIT=10/11). For VASP the indices are 1-based POSCAR ion numbers (mag4 writes the magnetic atoms first, so they are1 … n_mag).Returns
(lines, summary)wheresummarycarriesn_data(configs with a readable SCF),n_missing(SCF not found),failures(list of(case, reason)where a site did not reach thetargetmoment withintol, or collapsed to ~0), andtarget.targetis the expected per-site|μ|(e.g.2·S= the generated|MAGMOM|). WhenNonethe check only flags collapsed moments (|μ| < 0.1 μ_B), which usually mean the config fell into a non-magnetic solution rather than the intended spin state.