matcalc._phonon module

Calculator for phonon properties.

class PhononCalc(calculator: Calculator | str, *, atom_disp: float = 0.015, supercell_matrix: ArrayLike = ((2, 0, 0), (0, 2, 0), (0, 0, 2)), t_step: float = 10, t_max: float = 1000, t_min: float = 0, fmax: float = 0.1, optimizer: str = 'FIRE', relax_structure: bool = True, relax_calc_kwargs: dict | None = None, write_force_constants: bool | str | Path = False, write_band_structure: bool | str | Path = False, write_total_dos: bool | str | Path = False, write_phonon: bool | str | Path = True)[source]

Bases: PropCalc

A class for phonon and thermal property calculations using phonopy.

The PhononCalc class extends the PropCalc class to provide functionalities for calculating phonon properties and thermal properties of a given structure using the phonopy library. It includes options for structural relaxation before phonon property determination, as well as methods to export calculated properties to various output files for further analysis or visualization.

Variables:
  • calculator – A calculator object or a string specifying the computational backend to be used.

  • atom_disp – Magnitude of atomic displacements for phonon calculations.

  • supercell_matrix – Array defining the transformation matrix to construct supercells for phonon calculations.

  • t_step – Temperature step for thermal property calculations in Kelvin.

  • t_max – Maximum temperature for thermal property calculations in Kelvin.

  • t_min – Minimum temperature for thermal property calculations in Kelvin.

  • fmax – Maximum force convergence criterion for structural relaxation.

  • optimizer – String specifying the optimizer type to be used for structural relaxation.

  • relax_structure – Boolean flag to determine whether to relax the structure before phonon calculation.

  • relax_calc_kwargs – Optional dictionary containing additional arguments for the structural relaxation calculation.

  • write_force_constants – Path, boolean, or string specifying whether to write the calculated force constants to an output file, and the path or name of the file if applicable.

  • write_band_structure – Path, boolean, or string specifying whether to write the calculated phonon band structure to an output file, and the path or name of the file if applicable.

  • write_total_dos – Path, boolean, or string specifying whether to write the calculated total density of states (DOS) to an output file, and the path or name of the file if applicable.

  • write_phonon – Path, boolean, or string specifying whether to write the calculated phonon properties (e.g., phonon.yaml) to an output file, and the path or name of the file if applicable.

Initializes the class with configuration for the phonon calculations. The initialization parameters control the behavior of structural relaxation, thermal properties, force calculations, and output file generation. The class allows for customization of key parameters to facilitate the study of material behaviors.

Parameters:
  • calculator – The calculator object or string name specifying the calculation backend to use.

  • atom_disp – Atom displacement to be used for finite difference calculation of force constants.

  • supercell_matrix – Transformation matrix to define the supercell for the calculation.

  • t_step – Temperature step for thermal property calculations.

  • t_max – Maximum temperature for thermal property calculations.

  • t_min – Minimum temperature for thermal property calculations.

  • fmax – Maximum force during structure relaxation, used as a convergence criterion.

  • optimizer – Name of the optimization algorithm for structural relaxation.

  • relax_structure – Flag to indicate whether structure relaxation should be performed before calculations.

  • relax_calc_kwargs – Additional keyword arguments for relaxation phase calculations.

  • write_force_constants – File path or boolean flag to write force constants. Defaults to “force_constants”.

  • write_band_structure – File path or boolean flag to write band structure data. Defaults to “band_structure.yaml”.

  • write_total_dos – File path or boolean flag to write total density of states (DOS) data. Defaults to “total_dos.dat”.

  • write_phonon – File path or boolean flag to write phonon data. Defaults to “phonon.yaml”.

_abc_impl = <_abc._abc_data object>[source]
calc(structure: Structure | dict[str, Any]) dict[source]

Calculates thermal properties of Pymatgen structure with phonopy.

Parameters:

structure – Pymatgen structure.

Returns: {

phonon: Phonopy object with force constants produced thermal_properties:

{

temperatures: list of temperatures in Kelvin, free_energy: list of Helmholtz free energies at corresponding temperatures in kJ/mol, entropy: list of entropies at corresponding temperatures in J/K/mol, heat_capacity: list of heat capacities at constant volume at corresponding temperatures in J/K/mol, The units are originally documented in phonopy. See phonopy.Phonopy.run_thermal_properties() (https://github.com/phonopy/phonopy/blob/develop/phonopy/api_phonopy.py#L2591) -> phonopy.phonon.thermal_properties.ThermalProperties.run() (https://github.com/phonopy/phonopy/blob/develop/phonopy/phonon/thermal_properties.py#L498) -> phonopy.phonon.thermal_properties.ThermalPropertiesBase.run_free_energy() (https://github.com/phonopy/phonopy/blob/develop/phonopy/phonon/thermal_properties.py#L217) phonopy.phonon.thermal_properties.ThermalPropertiesBase.run_entropy() (https://github.com/phonopy/phonopy/blob/develop/phonopy/phonon/thermal_properties.py#L233) phonopy.phonon.thermal_properties.ThermalPropertiesBase.run_heat_capacity() (https://github.com/phonopy/phonopy/blob/develop/phonopy/phonon/thermal_properties.py#L225)

}

}

_calc_forces(calculator: Calculator, supercell: PhonopyAtoms) ArrayLike[source]

Helper to compute forces on a structure.

Parameters:
  • calculator – ASE Calculator

  • supercell – Supercell from phonopy.

Returns:

forces