Phono3py is a Python package for calculating anharmonic lattice dynamics properties, such as lattice thermal conductivity and phonon lifetimes, using a supercell approach and third-order force constants. It is commonly used in conjunction with first-principles calculation codes (e.g., VASP, Quantum ESPRESSO) that provide the necessary force information. The current version is 3.30.1. It maintains an active development and release cadence, often in sync with its harmonic counterpart, Phonopy.
pip install phono3pyVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to initialize the core `Phono3py` object. It sets up a dummy silicon unit cell and supercell, then creates a `Phonopy` object, which is passed to `Phono3py`. This is the fundamental first step before loading force constants and running calculations.
Update Phonopy to `>=2.20.0`. Migrate all cell definitions to `phonopy.atoms.PhonopyAtoms`. Review the official documentation for updated API calls, especially for force constant loading and calculation setup functions.
Always refer to the official documentation for the expected force constant data structure and file formats. Ensure the force constant matrices have the correct dimensions and units, and that the order of atoms matches the Phono3py object's internal representation.
Start with smaller supercells to test your setup and parameters. Monitor memory and CPU usage closely. For production runs, consider using optimized hardware and, if available, leverage parallel computation features (e.g., via MPI if Phono3py was compiled with MPI support).
Ensure your environment has necessary compilers (GCC, Fortran) and development headers. For persistent issues, consider using Conda to manage scientific packages, or manually install `spglib` and `numpy`/`scipy` with specific `BLAS`/`LAPACK` implementations (e.g., MKL, OpenBLAS) available on your system.
Ensure that development packages for LAPACKE (e.g., `liblapacke-dev`) and optimized BLAS (e.g., `libopenblas-dev` or Intel MKL) are installed on your system. Reinstalling phono3py, preferably within a conda environment using `conda install phono3py`, often resolves this by managing dependencies correctly.
Provide the correct path to your unit cell file using the `-c` option (e.g., `phono3py -c POSCAR`) or ensure that a default input file like `POSCAR` or `unitcell.in` is present in your working directory.
Verify that all force calculations corresponding to the displacements in `phono3py_disp.yaml` have completed successfully and that their output files are present and correctly named in their respective directories. You may need to identify and re-run failed DFT calculations.
Inspect the `vasprun.xml` files for the calculation runs indicated by the line number in the error message. Identify any corrupted or incomplete XML files, and then fix or re-run the corresponding VASP calculations to ensure complete and valid output.
Increase the available RAM for the calculation. Consider using the `--cfc` (compact force constants) option to reduce memory usage by storing force constants more efficiently, or employ a real-space cutoff with `--cutoff-pair` to limit the interaction range if physically justifiable for your system.