A VASP workflow integration package for pyiron
Project description
pyiron_workflow_vasp
A VASP workflow integration package for pyiron, providing tools and utilities for running and managing VASP calculations within the pyiron workflow framework.
Installation
The package can be installed using pip:
# Basic installation
pip install pyiron_workflow_vasp
# Installation with development tools
pip install "pyiron_workflow_vasp[dev]"
# Installation with notebook support
pip install "pyiron_workflow_vasp[notebook]"
# Installation with all optional dependencies
pip install "pyiron_workflow_vasp[dev,notebook]"
Dependencies
The package requires the following core dependencies:
- Python >= 3.8
- numpy >= 1.20.0
- pandas >= 1.3.0
- pymatgen >= 2023.0.0
- pyiron_workflow >= 0.1.0
- ase >= 3.22.0
Project Information
- License: BSD-3-Clause
- Development Status: Alpha
- Documentation: GitHub Repository
- Bug Tracker: GitHub Issues
Usage
The package provides a set of tools for running VASP calculations within pyiron workflows. A minimal end-to-end example:
from ase.build import bulk
from pymatgen.io.vasp.inputs import Incar
from pyiron_workflow_vasp.vasp import VaspInput, vasp_job
structure = bulk("Fe", cubic=True, a=2.83)
incar = Incar.from_dict({
"ENCUT": 400,
"ISMEAR": 1,
"SIGMA": 0.1,
"ISPIN": 2,
"MAGMOM": "2*3.0",
})
# VaspInput bundles structure + INCAR (+ optional KPOINTS / explicit POTCARs).
# Without an explicit potcar_paths kwarg, POTCAR generation uses the
# pseudopotential library configured in ~/.pyiron_vasp_config.
vasp_input = VaspInput(structure=structure, incar=incar)
job = vasp_job(workdir="./bulk_fe_run", vasp_input=vasp_input)
job.run()
print("converged:", job.outputs.convergence_status.value)
print("E_pot: ", job.outputs.to_value_dict()["vasp_output"]["generic"]["energy_pot"])
For more examples — including an equation-of-state scan and a queued cluster run — see:
examples/run_bulk_fe.py— a runnable script with no hardcoded cluster paths.example_notebooks/QuickStart.ipynb— the original walkthrough (uses MPIE cluster paths)..pyiron_vasp_config.example— annotated template for the config file.
VASP Configuration
The .pyiron_vasp_config file is essential for configuring the paths to the VASP pseudopotential files (POTCAR files) used in pyiron_workflow's VASP nodes. The file specifies the locations of different VASP potential sets and the default potential set to be used.
For detailed configuration instructions, see generate_vasp_pyiron_config.md, which includes:
- Basic configuration setup
- Configuring custom pseudopotential sets
- Adding new pseudopotential variants to CSV files
1. Determine the Locations of Your VASP POTCAR Files
Before creating the .pyiron_vasp_config file, ensure that you know the locations of the different POTCAR sets on your system. The common VASP potential directories are potpaw_64, potpaw_54, and potpaw_52, but your setup may vary. The directory structure should look something like this:
/home/pyiron_resources_cmmc/vasp/potpaw_64/LDA
/home/pyiron_resources_cmmc/vasp/potpaw_64/GGA
/home/pyiron_resources_cmmc/vasp/potpaw_54/LDA
/home/pyiron_resources_cmmc/vasp/potpaw_54/GGA
/home/pyiron_resources_cmmc/vasp/potpaw_52/LDA
/home/pyiron_resources_cmmc/vasp/potpaw_52/GGA
- LDA and GGA refer to the functional types for the VASP potentials.
2. Create the .pyiron_vasp_config File
-
Open a terminal and navigate to your home directory:
cd ~
-
Use a text editor (such as
nanoorvim) to create and open the.pyiron_vasp_configfile. For example:nano .pyiron_vasp_config -
Add the following lines to the file. Make sure to modify the paths according to your setup.
# Set the default POTCAR set # Make sure that the default_POTCAR_set matches one of the suffixes in the vasp_POTCAR_path_* default_POTCAR_set = potpaw64 # Path to the root directory containing the VASP pseudopotential files pyiron_vasp_resources = /home/pyiron_resources_cmmc/vasp # Path for different POTPAW versions (adjust these paths according to your setup) vasp_POTCAR_path_potpaw64 = {pyiron_vasp_resources}/potpaw_64 vasp_POTCAR_path_potpaw54 = {pyiron_vasp_resources}/potpaw_54 vasp_POTCAR_path_potpaw52 = {pyiron_vasp_resources}/potpaw_52 # Note that pyiron vasp nodes can detect variants of vasp_POTCAR_path_{randomsuffix} # So if you want to do something with custom pseudopotentials, you can... # Each of these dirs must have a "GGA" and "LDA" subdirectory structure # i.e. # The structure should look like # .../vasp/potpaw_64/LDA # .../vasp/potpaw_64/GGA # .../vasp/potpaw_54/LDA etc.
-
After you have added the configuration details, save the file:
- If you're using
nano, pressCtrl + O, thenEnterto save. PressCtrl + Xto exit. - If you're using
vim, pressEsc, type:wq, and pressEnterto save and exit.
- If you're using
3. Verify File Permissions
Ensure that your .pyiron_vasp_config file and the POTCAR directories are readable by your user. Run the following command to check the file permissions of the .pyiron_vasp_config:
ls -l ~/.pyiron_vasp_config
If necessary, you can modify the permissions to ensure read access:
chmod 644 ~/.pyiron_vasp_config
Also, verify that you have read/copy access to the files inside the VASP resource directories (potpaw_64, potpaw_54, etc.):
ls -l /home/pyiron_resources_cmmc/vasp/potpaw_64
4. Testing Your Configuration
To verify that pyiron is correctly reading the .pyiron_vasp_config file, you can either check within your pyiron scripts or write a simple Python script to test the configuration:
import os
from pathlib import Path
# Read the config file
config_file = Path.home().joinpath(".pyiron_vasp_config")
with open(config_file, "r") as f:
print(f.read())
This should print out the contents of your .pyiron_vasp_config, and you can check if the paths are correctly generated.
Additional Notes:
- Ensure Correct Paths: Double-check that the paths to your POTCAR directories are correct. Incorrect paths will lead to pyiron not being able to find the necessary POTCAR files for your VASP calculations.
By following these instructions, you'll have a correctly configured .pyiron_vasp_config file that points to the appropriate VASP pseudopotential directories.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyiron_workflow_vasp-0.1.0.tar.gz.
File metadata
- Download URL: pyiron_workflow_vasp-0.1.0.tar.gz
- Upload date:
- Size: 34.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
19bab4e1691137324222e6574e0df6437d55a308c7ed8a2e67e0c0c28174a81b
|
|
| MD5 |
fdaa2933df9e393ed489043bf0fa50e2
|
|
| BLAKE2b-256 |
42507c64c4593a0bc263f08690d17b3556b0382aa0882388222b8f99943e6174
|
File details
Details for the file pyiron_workflow_vasp-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pyiron_workflow_vasp-0.1.0-py3-none-any.whl
- Upload date:
- Size: 38.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4e1a883083f0d42d6b8d503e972441e06435acb7803e5405cf23689601ef8275
|
|
| MD5 |
3b28f8ccab849eac2b3d9e53803614f0
|
|
| BLAKE2b-256 |
40266fb4193a9dcd0a33726d06de5f6cc960903338d629e924cd82f329ad0a09
|