-
Notifications
You must be signed in to change notification settings - Fork 1
Tutorial YY
Lee Burton edited this page Aug 5, 2025
·
1 revision
This guide walks you through creating a working Jupyter notebook environment for generating and visualizing VASP workflows using Atomate2 and Jobflow.
micromamba create -n atomate2_local -c conda-forge python=3.11
micromamba activate atomate2_localpip install 'git+ssh://git@github.com/materialsproject/atomate2.git#egg=atomate2[jobs]'
pip install pymatgen monty custodian jobflow ase notebook ipywidgets nglview tqdmRestructure your POTCARs to this format:
VASP_PSP_DIR/
โโโ POT_GGA_PAW_PBE_54/
โโโ Si/POTCAR
โโโ O/POTCAR
โโโ ...
You can do this with:
import os, shutil
src_dir = "/path/to/flat_potcars"
for f in os.listdir(src_dir):
if f.startswith("POTCAR_"):
el = f.replace("POTCAR_", "")
os.makedirs(os.path.join(src_dir, el), exist_ok=True)
shutil.copy(os.path.join(src_dir, f), os.path.join(src_dir, el, "POTCAR"))Then rename the folder to match expected functional:
mv POT_GGA_PAW_PBE POT_GGA_PAW_PBE_54import os
from pymatgen.core import SETTINGS
potcar_path = "/Users/yourname/path/to/VASP_PSP_DIR"
os.environ["PMG_VASP_PSP_DIR"] = potcar_path
os.environ["VASP_PSP_DIR"] = potcar_path
SETTINGS["PMG_VASP_PSP_DIR"] = potcar_pathfrom pymatgen.core import Structure, Lattice
from atomate2.vasp.jobs.core import RelaxMaker
from atomate2.vasp.sets.base import VaspInputGenerator
from jobflow import run_locally
structure = Structure.from_spacegroup("Fd-3m", Lattice.cubic(5.4307), ["Si"], [[0, 0, 0]])
input_set_generator = VaspInputGenerator(
user_incar_settings={"ISIF": 3, "IBRION": 2, "NSW": 99, "ENCUT": 520}
)
job = RelaxMaker(input_set_generator=input_set_generator).make(structure)
responses = run_locally([job], create_folders=True, ensure_success=False)๐ก This creates input files in
job-0/, but does not run VASP (since itโs not installed).
pip install aseimport nglview as nv
nv.show_pymatgen(structure)You now have:
- Atomate2 + Jobflow working locally
- VASP input generation
- Structure visualization
- Reproducible environment for students