core.components.calculate.recipes.phonons#

Copyright (c) Meta Platforms, Inc. and affiliates.

This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree.

Helper scripts to run phonon calculations

  • Compute phonon frequencies at commensurate points

  • Compute thermal properties with Fourier interpolation

  • Optionally compute and plot band-structures and DOS

Needs phonopy installed

Attributes#

Functions#

run_mdr_phonon_benchmark(→ dict)

Run a phonon calculation for a single datapoint of the MDR PBE dataset

get_phonopy_object(, , ), primitive_matrix, symprec, ...)

Create a Phonopy api object from ase Atoms.

produce_force_constants(→ None)

Run force calculations and produce force constants with Phonopy

calculate_phonon_frequencies(→ numpy.typing.NDArray)

Calculate phonon frequencies at a given set of qpoints.

calculate_thermal_properties() → dict[str, float])

Calculate thermal properties from initialized phonopy object

Module Contents#

core.components.calculate.recipes.phonons.THz_to_K#
core.components.calculate.recipes.phonons.run_mdr_phonon_benchmark(mdr_phonon: phonopy.Phonopy, calculator: ase.calculators.calculator.Calculator, displacement: float = 0.01, run_relax: bool = True, fix_symm_relax: bool = False, symprec: int = 0.0001, symmetrize_fc: bool = False) dict#

Run a phonon calculation for a single datapoint of the MDR PBE dataset

Properties computed for benchmark:
  • maximum frequency from phonon frequencies computed at supercell commensurate points

  • vibrational free energy, entropy and heat capacity computed with a [20, 20, 20] mesh

Parameters:
  • mdr_phonon – the baseline MDR Phonopy object

  • calculator – an Ase Calculator

  • displacement – displacement step to compute forces (A)

  • run_relax – run a structural relaxation

  • fix_symm_relax – wether to fix symmetry in relaxation

  • symprec – symmetry precision used by phonopy

  • symmetrize_fc – symmetrize force constants

Returns:

dictionary of computed properties

Return type:

dict

core.components.calculate.recipes.phonons.get_phonopy_object(atoms: phonopy.structure.atoms.PhonopyAtoms | ase.Atoms | pymatgen.core.Structure, displacement: float = 0.01, supercell_matrix: numpy.typing.ArrayLike = ((2, 0, 0), (0, 2, 0), (0, 0, 2)), primitive_matrix: numpy.typing.ArrayLike | None = None, symprec: int = 1e-05, **phonopy_kwargs) phonopy.Phonopy#

Create a Phonopy api object from ase Atoms.

Parameters:
  • atoms – Phonopy atoms, ASE atoms object or a pmg Structure

  • displacement – displacement step to compute forces (A)

  • supercell_matrix – transformation matrix to super cell from unit cell.

  • primitive_matrix – transformation matrix to primitive cell from unit cell.

  • symprec – symmetry precision

  • phonopy_kwargs – additional keyword arguments to initialize Phonopy API object

Returns:

api object

Return type:

Phonopy

core.components.calculate.recipes.phonons.produce_force_constants(phonon: phonopy.Phonopy, calculator: ase.calculators.calculator.Calculator, symmetrize: bool = False) None#

Run force calculations and produce force constants with Phonopy

Parameters:
  • phonon – a Phonopy API object

  • calculator – an ASE Calculator

  • symmetrize – symmetrize force constants

core.components.calculate.recipes.phonons.calculate_phonon_frequencies(phonon: phonopy.Phonopy, qpoints: numpy.typing.ArrayLike | None = None) numpy.typing.NDArray#

Calculate phonon frequencies at a given set of qpoints.

Parameters:
  • phonon – a Phonopy api object with displacements generated

  • qpoints – ndarray of qpoints to calculate phonon frequencies at. If none are given, the supercell commensurate points will be used

Returns:

ndarray of phonon frequencies in THz, (qpoints, frequencies)

Return type:

NDArray

core.components.calculate.recipes.phonons.calculate_thermal_properties(phonon: phonopy.Phonopy, t_min, t_max, t_step, mesh: numpy.typing.ArrayLike = (20, 20, 20)) dict[str, float]#

Calculate thermal properties from initialized phonopy object

Thermal properties include: vibrational free energy, entropy and heat capacity

Parameters:
  • phonon – a Phonopy api object with displacements generated

  • t_min – minimum temperature

  • t_max – max temperature

  • t_step – temperature step between min and max

  • mesh – qpoint mesh to compute properties using Fourier interpolation

Returns:

dictionary of computed properties

Return type:

dict