Uh oh!
There was an error while loading. Please reload this page.
- 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:
importos, shutilsrc_dir="/path/to/flat_potcars"forfinos.listdir(src_dir):
iff.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_54importosfrompymatgen.coreimportSETTINGSpotcar_path="/Users/yourname/path/to/VASP_PSP_DIR"os.environ["PMG_VASP_PSP_DIR"] =potcar_pathos.environ["VASP_PSP_DIR"] =potcar_pathSETTINGS["PMG_VASP_PSP_DIR"] =potcar_pathfrompymatgen.coreimportStructure, Latticefromatomate2.vasp.jobs.coreimportRelaxMakerfromatomate2.vasp.sets.baseimportVaspInputGeneratorfromjobflowimportrun_locallystructure=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 aseimportnglviewasnvnv.show_pymatgen(structure)You now have:
- Atomate2 + Jobflow working locally
- VASP input generation
- Structure visualization
- Reproducible environment for students