This repository provides a set of Python and shell scripts for performing phonon calculations using Phonopy and VASP. The workflow consists of the following steps:
- Prepare the necessary input files for VASP.
- Run VASP calculations on displaced structures.
- Collect forces and generate the FORCE_SETS file.
- Calculate the force constants and the phonon band structure.
- Plot the phonon band structure.
- VASP (properly installed and configured on your system)
- Phonopy
- NumPy
- Matplotlib
Install the required Python packages using pip:
pip install phonopy numpy matplotlib
-
Place your VASP POSCAR file in the working directory.
-
Modify the
prepare_phonon_calculation.py
script to set the supercell size for the phonon calculation. Then, run the script to generate displaced structures and thedisp.yaml
file:
-
Prepare the necessary VASP input files (INCAR, KPOINTS, POTCAR) for running the calculations on the displaced structures.
-
Update the
num_displacements
variable in therun_vasp_phonon.py
script according to the number of displacement configurations. Adjust the VASP command and the number of processors as needed. Run the script to perform VASP calculations on the displaced structures:
- Run the
collect_forces.py
script to collect forces from the VASP calculations and generate the FORCE_SETS file:
-
Create a Phonopy configuration file (
phonopy.conf
) to define the settings for the band structure calculation. Adjust the supercell size (DIM), mesh size (MP), and band paths (BAND) as needed: -
Run Phonopy to calculate the force constants and the phonon band structure:
phonopy -c POSCAR --fc FORCE_SETS --dim="2 2 2" --band="0 0 0 0.5 0.5 0 0.5 0.5 0.5 0 0 0"
- Run the
plot_band_structure.py
script to visualize the phonon band structure: