Installation

Requirements

Phonopy v4 changes the default primitive matrix

Since phonopy v4, phonopy.load defaults to primitive_matrix="auto" instead of the previous "P" (the identity). Be careful when preparing supercell data and loading it for unfolding: always use primitive_matrix="P" to keep the input cell unchanged. See the Si tutorial for details.

Install with pip

To install from GitHub:

pip install git+https://github.com/sabia-group/unPHold.git

To install from source:

git clone https://github.com/sabia-group/unPHold
cd unPHold
pip install -e .

To install from source with extras:

pip install -e ".[dev]"   # testing: pytest, pytest-cov, ruff
pip install -e ".[docs]"  # documentation: mkdocs, mkdocstrings
pip install -e ".[all]"   # both

Conda environment setup

env_name="unphold"
conda create -n ${env_name} python=3.12 -y
conda install -n ${env_name} -c conda-forge "numpy>=1.24" "ase>=3.23" "phonopy>=3.0" "tqdm>=4.0" pip -y
# then follow above pip install instructions, e.g.
conda run -n ${env_name} pip install git+https://github.com/sabia-group/unPHold.git