Note: This is a forked version of the official Phonopy repository. It contains specific modifications to simplify workflows for studying isotope effects and defects.
The official upstream repository can be found at: https://github.com/phonopy/phonopy
The primary enhancement in this fork is an intelligent mass expansion feature.
- Problem Solved: Standard Phonopy requires providing a mass for every atom in a pre-expanded supercell. This is impractical for large systems with isotopic or elemental substitutions.
- Solution: The code in
phonopy/api_phonopy.py(@masses.setter) has been modified. Now, you only need to provide a short list of masses in theMASStag, corresponding to the unique atom types in yourPOSCAR. The code will automatically expand this to a full mass list for the supercell.
For a 64-atom supercell containing C-14 and N-14 (where C appears first in POSCAR), your phonopy.conf can now be written simply as:
ATOM_NAME = C N
# No need to repeat the mass 64 times.
# Just list the mass for each unique atom type in order of appearance.
MASS = 14.003241989 14.003074004
DIM = 1 1 1
CREATE_DISPLACEMENTS = .TRUE.Phonon code mainly written in python. Phonopy user documentation is found at http://phonopy.github.io/phonopy/
See https://phonopy.github.io/phonopy/install.html.
Usual phonopy questions should be sent to phonopy mailing list (https://sourceforge.net/p/phonopy/mailman/).
The development of phonopy is managed on the develop branch of github phonopy
repository.
- Github issues is the place to discuss about phonopy issues.
- Github pull request is the place to request merging source code.
Formatting rules are found in pyproject.toml.
Pre-commit (https://pre-commit.com/) is mainly used for applying the formatting rules automatically. Therefore, it is strongly encouraged to use it at or before git-commit. Pre-commit is set-up and used in the following way:
- Installed by
pip install pre-commit,conda install pre_commitor see https://pre-commit.com/#install. - pre-commit hook is installed by
pre-commit install. - pre-commit hook is run by
pre-commit run --all-files.
Unless running pre-commit, pre-commit.ci may push the fix at PR by github action. In this case, the fix should be merged by the contributor's repository.
-
Not strictly, but VSCode's
settings.jsonmay be written like below"ruff.lint.args": [ "--config=${workspaceFolder}/pyproject.toml", ], "[python]": { "editor.defaultFormatter": "charliermarsh.ruff", "editor.codeActionsOnSave": { "source.organizeImports": "explicit" } },
Phonopy user documentation is written using python sphinx. The source files are
stored in doc directory. Please see how to write the documentation at
doc/README.md.
Tests are written using pytest. To run tests, pytest has to be installed. The tests can be run by
% pytest