VASP Tools is a set of modules and scripts that automate routine tasks involving VASP files using a very intuitive CLI. The /scripts
directory contains the scripts that implement the /vasp
module to perform said tasks on VASP files. This project is still a WIP and new scripts/modules will be added regularly over the next few weeks.
Update: Most development on this project has been closed as I've moved on to other things. However, feel free to contact me if you want something new out of this module or want to contribute to expand it even further!
As of now, this package is only supported on Python>=3.5
. Since support for Python 2.7
is set to be pulled by 2020, updates in the near future extending support to Python<=3.0
seem unlikely.
The following libraries are required to run all the scripts and modules.
For a full list of requirements, read requirements.txt. If not already present within the environment, they'll be installed as dependencies during setup automatically.
The installation process is quite simple, just ensure you have a working version of Python>=3.5
installed.
Note: Since the package installs all its dependencies accurate to their exact versions, it's highly recommended that you install it in a separate environment.
conda create -n vasp_env python=3.x
conda activate vasp_env
In case you haven't already installed it, run pip install virtualenv
in the terminal.
Type the following into your terminal:
virtualenv vasp_env
source vasp_env/bin/activate
To install vasp_tools
, run this command in your terminal:
pip install vasp-tools
This is the preferred method to install vasp_tools
, as it will always install the most recent stable release.
If you don't have pip installed, this Python installation guide can guide you through the process.
The sources for vasp_tools
can be downloaded from the Github repo.
You can either clone the public repository:
git clone git://github.com/RexGalilae/vasp_tools
Or download the tarball:
curl -OL https://github.com/RexGalilae/vasp_tools/tarball/master
Once you have a copy of the source, you can install it with:
python setup.py install
Any required libraries that aren't installed in the current environment will be installed automatically.
This will also install the scripts and add them to $PATH
for easy access.
If nothing works, navigate to the package directory and activate the pre-packaged environment python_env
by running,
source python_env/bin/activate
The package, so far, was only tested within a Linux environment (Ubuntu and RedHat OS) and isn't officially compatible with Windows yet. The scripts can be compiled into executables using PyInstaller+Python3.x to work independently of python on any other system running an identical OS. Hence, using VMs/Containers is suggested, though not tested as of yet.
The code present in /vasp
can be imported in the form of standard modules for development. However, the primary purpose of this project was the creation of scripts (present in /scripts
) to automate daily tasks faced by the Computational Chemist/Material Scientist. With this in mind, the scripts were designed to be extremely modular and user-friendly by implementing a dplyr
-esque piping paradigm. For example, the process of:
- Importing a molecule from a
POSCAR
file. - Rotating it into a certain configuration (90 degrees wrt the x-axis)
- Positioning it at a specified point above a crystal taken from another
POSCAR
file - Setting atoms within the crystal below a certain cutoff height to be fixed during simulation
- Converting the coordinate system to
Direct
fromCartesian
or vice versa - Saving the result to a new
POSCAR
file.
can be implemented in a single line like so.
cat POSCAR1 | rotate.py -x 90 -y 10 | place-at.py "POSCAR2" 0.5 0.5 2.0 | fix-upto.py 10.0 | cart-direct.py > POSCARnew
Alternatively, you can also call each script individually or pass "POSCAR1" as one of the positional arguments. For example,
place-at.py "POSCAR2" "POSCAR1" 0.5 0.5 2.0
is perfectly equivalent to
cat POSCAR1 | place-at.py "POSCAR2" 0.5 0.5 2.0
Detailed instructions on how to use the scripts are available in docs (WIP).
Written with StackEdit