aiida_phonopy.data.preprocess
#
Module defining the class for managing the frozen phonon structure.
Module Contents#
Classes#
Class for pre-processing of frozen-phonon calculations. |
Functions#
|
Serialize the data for displacement dataset, in case it contains numpy.ndarray. |
- class aiida_phonopy.data.preprocess.PreProcessData(structure: aiida.orm.StructureData | None = None, phonopy_atoms: phonopy.structure.cells.PhonopyAtoms | None = None, supercell_matrix: list | None = None, primitive_matrix: list | None = None, symprec: float = 1e-05, is_symmetry: bool = True, distinguish_kinds: bool = True, **kwargs)[source]#
Bases:
aiida_phonopy.data.raw.RawData
Class for pre-processing of frozen-phonon calculations.
This class is designed for handling the pre-process information regarding a frozen phonon calculation using
Phonopy
. These regard the unitcell structure, the supercell and primitive matrix, as well as other symmetry information.- property displacement_dataset: dict | list | None[source]#
Get the dispacement dataset in a readible format for phonopy.
If not set, None is returned.
- property displacements: list | dict[source]#
Get the displacements to apply to the supercell.
- Returns:
array with displacements; can be type-I or type-II (see
phonopy.Phonopy.displacements()
)
- set_displacements(distance: float = 0.01, is_plusminus: str = 'auto', is_diagonal: bool = True, is_trigonal: bool = False, number_of_snapshots: int | None = None, random_seed: int | None = None, temperature: float | None = None, cutoff_frequency: float | None = None)[source]#
Set displacements for frozen phonon calculation.
Refer to
phonopy.Phonopy.generate_displacements()
for a complete description of the inputs.Thus, in the PreProcessData value different from zero will raise an error.
- Raises:
ValueError – if the inputs are not compatible with phonopy standards
- _set_displacements(value: list | dict)[source]#
Put in the repository the displacement dataset in json format.
- set_displacements_from_dataset(dataset: dict | list)[source]#
Set displacements for frozen phonon calculation from a dataset.
Useful if you want to set displacements from a previously random generated displacement dataset, or for setting dataset for self-consistent harmonic approximation.
- Parameters:
dataset – dictionary or array like (numpy or list), compatible with phonopy
- Raises:
ValueError – if the inputs are not compatible with phonopy standards
- get_phonopy_instance(symmetrize_nac: bool = None, factor_nac: float | None = None, **kwargs)[source]#
Return a
Phonopy
object with the current values.
- get_supercells_with_displacements() dict[aiida.orm.StructureData] [source]#
Get the supercells with displacements for frozen phonon calculation.
- Returns:
dictionary with StructureData nodes, None if the displacement dataset has not been set
- generate_displacement_dataset(distance: float = 0.01, is_plusminus: str = 'auto', is_diagonal: bool = True, is_trigonal: bool = False, number_of_snapshots: int | None = None, random_seed: int | None = None, temperature: float | None = None, cutoff_frequency: float | None = None)[source]#
Return the displacement dataset for frozen phonon calculation.
Refer to
phonopy.Phonopy.generate_displacements()
for a complete description of the inputs.- Raises:
ValueError – if the inputs are not compatible with phonopy standards
- static generate_preprocess_data(structure: aiida.orm.StructureData, displacement_generator: dict | None = None, supercell_matrix: list | None = None, primitive_matrix: list | None = None, symprec: float | None = None, is_symmetry: bool | None = None, distinguish_kinds: bool | None = None)[source]#
Return a complete stored PreProcessData node.
- Parameters:
structure (
StructureData
) – structure data node representing the unitcelldisplacement_generator (orm.Dict) – dictionary containing the info for generating the displacements, defaults to phonopy default (see phonopy doc)
supercell_matrix (
List
, Optional) – supercell matrix, defaults to diag(1,1,1)primitive_matrix (
List
, Optional) – primitive matrix, defaults to “auto”symprec (
Float
, Optional) – symmetry precision on atoms, defaults to 1e-5is_symmetry (
Bool
, Optional) – if using space group symmetry, defaults to Truedistinguish_kinds (
Bool
, Optional) – if distinguish names of same specie by symmetry, defaults to True
- Returns:
PreProcessData node