My general Python and Shell scripts for Density Functional Theory calculations in the area of atomic scale materials modeling
This repository contains scripts for pre-processing and post-processing of data for Density Functional Theory calculations using VASP, with ASE, and VTST.
I do not intend to give a detailed explanation of how to run Density Functional Theory (DFT) calculations with VASP but rather to show an outline of the workflow I created using some of the scripts in this repo.
If you are a self-starter in computational chemistry and will be using DFT as a tool to learn about the amazing world between chemistry and material science! you might find some scripts useful.🤩
The majority of the scripts were made to solve problems at hand (hard-coded), but some scripts were made reusable to create useful workflows.
I also glued code from scripts I found on GitHub or from other open source codes. Appropriate authorship is kept inside the code.
I used the atomistic simulation environment (ASE) library and VTST tools, to create the majority of the scripts. Unfortunately, I found out about vaspkit at the end of my Ph.D., but I highly recommend it, it may save you a lot of time. From vaspkit I gathered and post-processed the density of states (DOS) of some systems.
For additional details see the ASE, VTST, or VASP documentation.
- Python 2.7
- ASE 3.15
- VTST tools (vtst-929)
- This step helps design the system of the calculations. What is it that you are looking for? What property are you interested in studying? What is the influence of A on B? Why is Z behaving like that?
- Prepare a plan of the various calculations you will need to run to obtain the data to answer your questions. Prepare the input files. These are the files that contain the information about the system you will model. For example, the xyz coordinates of the atoms. In VASP this is the POSCAR file.
- The first may take time due to failed convergence, wrong input files, or just a big model with many atoms. But, once your system is finished reaching its most energetically favorable state, then proceed to post-processing. Again by knowing what you are looking for you can move toward the next question. For example, for the thermochemical energy corrections of an adsorbed molecule, we correct the energy with ZPE and S, which are obtained from a frequency calculation. For that, the output of the relaxed system is used as input for the next calculation.
- Plot different variables, find trends, and re-plot. I mostly used Excell, Jupyter Notebook, and matplotlib. The python scripts used for plotting will be on separate repositories as per the project.
😊
To create input files, my preferred ways were sketching in the ASE GUI to generate the POSCAR, or coding using the ase.build method to build the POSCAR and all the inputs to run a VASP calculation. See Slabs-preparation-templates/
At this point, you also want to determine the initial parameters of the calculations, optimize lattice constants, and other parameters that will allow your calculation to be reproducible. See OptimizeLatticeConstant/Lattice_constant.py
Set up your environment in the supercomputer ( ask for help ) and run your simulations. After the relaxation is finished (checked if the system has converged, by checking the forces on the atoms. See postprocess-lpg/getforces.sh, this uses vef.pl from vtst.
I used IBRION = 5 parameter inside the INCAR file. Run a script to generate the INCAR, POTCAR, KPOINT, and new POSCAR files with the fixed atoms. See postprocess-lpg/VibFreqs-analysis-postporcessing/vibrations_inputs_creator.py.
Extract all the data you want. Create more scripts if you need them. Note that the postprocessing analysis will be different depending on your system, for example, whether it is a gas-phase molecule or and adsorbed molecule. For scripts, see postprocess-lpg/getEnergies.sh, and postprocess-lpg/VibFreqs-analysis-postporcessing/
Analyze and ask if you need more information such as the density of states or partial charges. Depending on the data you need, you may run additional calculations with specific parameters, for example for the DOS analysis set LORBIT = 10 or 11. See postprocess-lpg/DOS/d_band_moments.ipynb, and postprocess-lpg/baderCharges