pipeline status coverage report PyPI version

hiPhive — High-order force constants for the masses

hiPhive is a tool for efficiently extracting high-order force constants from atomistic simulations, most commonly density functional theory calculations. It has been implemented in the form of a Python library, which allows it to be readily integrated with many first-principles codes and analysis tools accessible in Python.

The following snippet illustrates the construction of a force constant potential object (fcp), which can be subsequently used to run molecular dynamics (MD) simulations or analyzed using e.g., phonopy, phono3py, or shengBTE:

from hiphive import ClusterSpace, StructureContainer, ForceConstantPotential
from hiphive.fitting import Optimizer

cs = ClusterSpace(ideal_cell, cutoffs=[6.0, 4.5])
sc = StructureContainer(cs)
for atoms in list_of_training_structures:
opt = Optimizer(sc.get_fit_data())
fcp = ForceConstantPotential(cs, opt.parameters)

The list of training structures employed in the code above can be prepared for example as follows:

from ase.build import bulk
from ase.calculators.emt import EMT

ideal_cell = bulk('Al', cubic=True)
ideal_supercell = ideal_cell.repeat(3)
list_of_training_structures = []
for k in range(5):
    atoms = ideal_supercell.copy()
    atoms.rattle(0.02, seed=k)
    atoms.new_array('displacements', atoms.positions - ideal_supercell.positions)
    atoms.new_array('forces', atoms.get_forces())
    atoms.positions = ideal_supercell.get_positions()

hiphive has been developed by Fredrik Eriksson, Erik Fransson, and Paul Erhart at the Department of Physics of Chalmers University of Technology in Gothenburg, Sweden. Please consult the credits page for information on how to cite hiphive.

hiPhive and its development are hosted on gitlab. Bugs and feature requests are ideally submitted via the gitlab issue tracker. The development team can also be reached by email via hiphive@materialsmodeling.org.