Phonons#
Phonon calculations are very important for inorganic materials science to
Calculate thermal conductivity
Understand the vibrational modes, and thus entropy and free energy, of a material
Predict the stability of a material at finite temperature (e.g. 300 K) among many others! We can run a similarly straightforward calculation that
Runs a relaxation on the unit cell and atoms
Repeats the unit cell a number of times to make it sufficiently large to capture many interesting vibrational models
Generatives a number of finite displacement structures by moving each atom of the unit cell a little bit in each direction
Running single point calculations on each of (3)
Gathering all of the calculations and calculating second derivatives (the hessian matrix!)
Calculating the eigenvalues/eigenvectors of the hessian matrix to find the vibrational modes of the material
Analyzing the thermodynamic properties of the vibrational modes.
Note that this analysis assumes that all vibrational modes are harmonic, which is a pretty reasonable approximately for low/moderate temperature materials, but becomes less realistic at high temperatures.
from __future__ import annotations
from ase.build import bulk
from quacc.recipes.mlp.phonons import phonon_flow
# Make an Atoms object of a bulk Cu structure
atoms = bulk("Cu")
# Run a phonon (hessian) calculation with our favorite MLP potential
result = phonon_flow(
atoms,
method="fairchem",
job_params={
"all": dict(
name_or_path="uma-s-1",
task_name="omat",
),
},
min_lengths=10.0, # set the minimum unit cell size smaller to be compatible with limited github runner ram
)
/home/runner/work/_tool/Python/3.12.11/x64/lib/python3.12/site-packages/torchtnt/utils/version.py:12: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.
import pkg_resources
WARNING:root:device was not explicitly set, using device='cuda'.
INFO:root:Setting random seed to 41
INFO:root:Setting random seed to 41
INFO:quacc.runners.prep:Calculation will run at /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/tmp-quacc-2025-06-05-20-44-26-612083-59941
INFO:quacc.runners.prep:Calculation results stored at /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/quacc-2025-06-05-20-44-26-612083-59941
INFO:quacc.runners.prep:Calculation will run at /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/tmp-quacc-2025-06-05-20-44-27-398303-53545
/home/runner/work/_tool/Python/3.12.11/x64/lib/python3.12/site-packages/seekpath/hpkot/__init__.py:172: DeprecationWarning: dict interface is deprecated. Use attribute interface instead
conv_lattice = dataset["std_lattice"]
INFO:quacc.runners.prep:Calculation results stored at /home/runner/work/fairchem/fairchem/docs/inorganic_materials/examples_tutorials/quacc-2025-06-05-20-44-27-398303-53545
print(
f'The entropy at { result["results"]["thermal_properties"]["temperatures"][-1]:.0f} K is { result["results"]["thermal_properties"]["entropy"][-1]:.2f} kJ/mol'
)
The entropy at 1000 K is 62.38 kJ/mol
Congratulations, you ran your first phonon calculation!