Capability package for crystal magnetism workflows:
vasp— VASP run + Wannier90 (write helpers inside run nodes)tbj2— TB2J exchange parametersmaster— end-to-end VASP → Wannier90 → TB2J orchestration
Upstream examples (not vendored): TB2J_examples.
xtalgen/
pyproject.toml
vasp/ # import vasp
tbj2/ # import tbj2
master/ # import master
uv sync # from this directory# or: uv pip install -e ".[dev]"Pulls simstackv2.0.1 and TB2J
from GitHub. Upstream hard-deps sisl / pypao are excluded for the Wannier path
(tool.uv.exclude-dependencies); add --extra siesta when you need Siesta.
VASP and wannier90.x are external binaries — put them on PATH / configure
[*.program.vasp] in config.toml.
Examples live upstream (not vendored): https://github.com/mailhexu/TB2J_examples
Inside the simstack-model monorepo:
uv pip install -e "./xtalgen[dev]"If resolver hits pypao/sisl (those settings apply to uv sync, not always to
uv pip), install TB2J separately:
uv pip install -e "./xtalgen[dev]" --no-deps
uv pip install "TB2J @ git+https://github.com/mailhexu/TB2J.git" --no-depsOnly run callables are @nodes. Input writing lives in vasp.lib and is
invoked inside the run nodes.
| Node | Role |
|---|---|
vasp_run | Write INCAR/KPOINTS + stage POSCAR/POTCAR, then context.resource_config.run("vasp") |
wannier90_run | Write {seed}.win (optional), then run wannier90.x → *_hr.dat, *_centres.xyz |
vasp_stage_wannier_for_tb2j | Verify TB2J inputs; parse E-fermi from OUTCAR |
Helpers (not nodes): vasp.lib.write_vasp_inputs, vasp.lib.write_wannier90_wins.
Binary / launcher: [<resource>.program.vasp] run_command in config.toml
(e.g. vasp_std, srun vasp_ncl). MPI ranks come from
parent_parameters.slurm_parameters on the job allocation — not from the input model.
Workdir is always cwd.
Typical collinear flow (SrMnO3-style) — use master node vasp_wannier_tb2j
(VaspWannierTB2JInput) or the steps individually:
vasp_run(VaspJobInputwithLWANNIER90; stage.winviaextra_filesor write later)wannier90_run(channels="wannier90.up wannier90.dn",write_win=True)vasp_stage_wannier_for_tb2jtbj2_wannier_collinear(fromtbj2)
SOC / spinor: set collinear=False on the master input (and LSORBIT /
vasp_ncl in config), or run seed wannier90 then tbj2_wannier_spinor.
License note: VASP and PAW POTCAR files are proprietary and are not shipped.
| Node | CLI |
|---|---|
tb2j_wannier_collinear | wann2J.py |
tb2j_wannier_spinor | wann2J.py --spinor |
tb2j_siesta | siesta2J.py |
tb2j_rotate | TB2J_rotate.py |
tb2j_merge | TB2J_merge.py |
uv run create_model_table --dir vasp --dir tbj2 --dir master
uv run create_node_table --dir vasp --dir tbj2 --dir masterDocs: https://tb2j.readthedocs.io/en/latest/ · https://www.vasp.at/