atomistics.workflows.phonons.workflow.PhonopyWorkflow#

class atomistics.workflows.phonons.workflow.PhonopyWorkflow(structure: Atoms, interaction_range: float = 10.0, displacement: float = 0.01, dos_mesh: int = 20, primitive_matrix: ndarray | None = None, number_of_snapshots: int | None = None)[source]#

Bases: Workflow

Phonopy wrapper for the calculation of free energy in the framework of quasi harmonic approximation.

Get output via get_thermal_properties().

Note:

  • This class does not consider the thermal expansion. For this, use QuasiHarmonicJob (find more in its

    docstring)

  • Depending on the value given in job.input[‘interaction_range’], this class automatically changes the number of

    atoms. The input parameters of the reference job might have to be set appropriately (e.g. use k_mesh_density for DFT instead of setting k-points directly).

  • The structure used in the reference job should be a relaxed structure.

  • Theory behind it: https://en.wikipedia.org/wiki/Quasi-harmonic_approximation

__init__(structure: Atoms, interaction_range: float = 10.0, displacement: float = 0.01, dos_mesh: int = 20, primitive_matrix: ndarray | None = None, number_of_snapshots: int | None = None)[source]#

Initialize the PhonopyWorkflow.

Parameters:
  • structure (Atoms) – The structure used in the reference job.

  • interaction_range (float, optional) – The interaction range. Defaults to 10.0.

  • displacement (float, optional) – The displacement. Defaults to 0.01.

  • dos_mesh (int, optional) – The DOS mesh. Defaults to 20.

  • primitive_matrix (np.ndarray, optional) – The primitive matrix. Defaults to None.

  • number_of_snapshots (int, optional) – The number of snapshots. Defaults to None.

Methods

__init__(structure[, interaction_range, ...])

Initialize the PhonopyWorkflow.

analyse_structures(output_dict[, output_keys])

Analyse structures.

dynamical_matrix_at_q(q)

Get the dynamical matrix at a given q.

generate_structures()

Generate structures.

get_band_structure([npoints, ...])

Get the band structure.

get_dynamical_matrix([npoints])

Get the dynamical matrix.

get_hesse_matrix()

Get the Hesse matrix.

get_thermal_properties([t_min, t_max, ...])

Get thermal properties.

plot_band_structure([axis, label])

Plot the band structure.

plot_dos(*args[, axis])

Plot the DOS.

write_phonopy_force_constants([file_name, cwd])

Write the Phonopy force constants.

analyse_structures(output_dict: dict, output_keys: tuple[str] = ('mesh_dict', 'band_structure_dict', 'total_dos_dict', 'dynamical_matrix', 'force_constants')) dict[source]#

Analyse structures.

Parameters:
  • output_dict (dict) – The output dictionary.

  • output_keys (tuple[str], optional) – The output keys. Defaults to OutputPhonons.keys().

Returns:

The analysed structures.

Return type:

dict

dynamical_matrix_at_q(q: ndarray) ndarray[source]#

Get the dynamical matrix at a given q.

Parameters:

q (np.ndarray) – The q value.

Returns:

The dynamical matrix.

Return type:

np.ndarray

generate_structures() dict[source]#

Generate structures.

Returns:

The generated structures.

Return type:

dict

get_band_structure(npoints: int = 101, with_eigenvectors: bool = False, with_group_velocities: bool = False)[source]#

Get the band structure.

Parameters:
  • npoints (int, optional) – The number of points. Defaults to 101.

  • with_eigenvectors (bool, optional) – Whether to include eigenvectors. Defaults to False.

  • with_group_velocities (bool, optional) – Whether to include group velocities. Defaults to False.

Returns:

[description]

Return type:

[type]

get_dynamical_matrix(npoints: int = 101) ndarray[source]#

Get the dynamical matrix.

Parameters:

npoints (int, optional) – The number of points. Defaults to 101.

Returns:

The dynamical matrix.

Return type:

np.ndarray

get_hesse_matrix() ndarray[source]#

Get the Hesse matrix.

Returns:

The Hesse matrix.

Return type:

np.ndarray

get_thermal_properties(t_min: float = 1.0, t_max: float = 1500.0, t_step: float = 50.0, temperatures: ndarray | None = None, cutoff_frequency: float | None = None, pretend_real: bool = False, band_indices: ndarray | None = None, is_projection: bool = False, output_keys: tuple[str] = ('temperatures', 'volumes', 'free_energy', 'entropy', 'heat_capacity')) dict[source]#

Get thermal properties.

Parameters:
  • t_min (float, optional) – The minimum sample temperature. Defaults to 1.0.

  • t_max (float, optional) – The maximum sample temperature. Defaults to 1500.0.

  • t_step (float, optional) – The temperature sample interval. Defaults to 50.0.

  • temperatures (np.ndarray, optional) – Custom array of temperature samples. Defaults to None.

  • cutoff_frequency (float, optional) – The cutoff frequency. Defaults to None.

  • pretend_real (bool, optional) – Whether to pretend real. Defaults to False.

  • band_indices (np.ndarray, optional) – The band indices. Defaults to None.

  • is_projection (bool, optional) – Whether it is a projection. Defaults to False.

  • output_keys (tuple[str], optional) – The output keys. Defaults to OutputThermodynamic.keys().

Returns:

The thermal properties.

Return type:

dict

plot_band_structure(axis=None, *args, label: str | None = None, **kwargs)[source]#

Plot the band structure.

Parameters:
  • axis ([type], optional) – The axis. Defaults to None.

  • label (str, optional) – The label. Defaults to None.

Returns:

[description]

Return type:

[type]

plot_dos(*args, axis=None, **kwargs)[source]#

Plot the DOS.

Parameters:

axis ([type], optional) – The axis. Defaults to None.

Returns:

[description]

Return type:

[type]

write_phonopy_force_constants(file_name: str = 'FORCE_CONSTANTS', cwd: str | None = None)[source]#

Write the Phonopy force constants.

Parameters:
  • file_name (str, optional) – The file name. Defaults to “FORCE_CONSTANTS”.

  • cwd (str, optional) – The current working directory. Defaults to None.