defectpl.phonon¶
GammaPhononData
¶
Bases: MSONable
An MSONable data container storing processed Gamma-point phonon properties.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
frequencies
|
list of float
|
Vibrational mode frequencies at the Gamma point, rescaled to eV. |
required |
eigenvectors
|
list of list of list of float
|
Real-component displacement eigenvectors of shape (nmodes, natoms, 3). |
required |
masses
|
list of float
|
Atomic masses per active crystal species site coordinate. |
required |
natoms
|
int
|
Total number of internal core atoms embedded in the structural cell. |
required |
nmodes
|
int
|
Total count of normal vibrational mode pathways (3 x N). |
required |
meta_info
|
dict
|
Metadata tracking runtime settings, dimensions, or target accuracy. |
None
|
Source code in defectpl\phonon.py
as_dict
¶
Serialize the instance properties to a JSON-compatible dictionary.
Source code in defectpl\phonon.py
from_dict
classmethod
¶
Reconstruct a class instance from an unpacked serialization dictionary.
Source code in defectpl\phonon.py
read_band_yaml
¶
Parses a Phonopy band.yaml summary output file to extract Gamma-point phonon frequencies, displacement eigenvectors, and atomic masses.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
band_yaml_path
|
str or Path
|
The filename tracking location of the processed Phonopy yaml payload. |
required |
q_idx
|
int
|
The absolute entry loop lookup selection index focusing on a specific q-point. |
0
|
Returns:
| Name | Type | Description |
|---|---|---|
frequencies |
ndarray
|
A flat array of all parsed vibrational mode frequencies, rescaled to eV. |
eigenvectors |
ndarray
|
Real displacement eigenvectors of shape (nmodes, natoms, 3). |
masses |
ndarray
|
Array containing mass metrics for each ion matching index layout configurations. |
Source code in defectpl\phonon.py
extract_gamma_phonon_data
¶
High-level factory function to extract and instantiate a GammaPhononData container from a band.yaml file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
band_yaml_path
|
str or Path
|
The destination track file path addressing parsed band structure information. |
required |
Returns:
| Type | Description |
|---|---|
GammaPhononData
|
An operational, JSON-serializable structured database holding phononic properties. |
Source code in defectpl\phonon.py
create_force_constants_from_vasprun
¶
Parse a vasprun.xml file and write extracted force constants to disk.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
vasprun_filename
|
str or Path
|
Path to the target input vasprun.xml file. |
required |
is_hdf5
|
bool
|
If True, writes to force_constants.hdf5; otherwise writes to FORCE_CONSTANTS. |
False
|
log_level
|
int
|
Phonopy verbosity output log level. |
1
|
Returns:
| Type | Description |
|---|---|
int
|
0 on execution success, 1 on execution failure. |
Source code in defectpl\phonon.py
calculate_phonon_symmetries
¶
calculate_phonon_symmetries(
unitcell_path,
force_constants_path=None,
force_sets_path=None,
dimension="1 1 1",
symprec=1e-05,
degeneracy_tolerance=None,
nac_q_direction=None,
is_little_cogroup=False,
)
Calculate irreducible representations (irreps) of phonon modes at the Gamma point and export the computed symmetry details to a Phonopy YAML format.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
unitcell_path
|
str or Path
|
Path to a structural VASP input unitcell geometry file (POSCAR). |
required |
force_constants_path
|
str or Path
|
Path pointing to an active FORCE_CONSTANTS file layout. |
None
|
force_sets_path
|
str or Path
|
Path pointing to an active FORCE_SETS file layout. |
None
|
dimension
|
str, list of int, or numpy.ndarray
|
The expansion dimensions matrix configuring supercell construction loops. |
"1 1 1"
|
symprec
|
float
|
Distance tolerance metric required to map equivalent atomic positions. |
1e-5
|
degeneracy_tolerance
|
float
|
Energy cutoff width identifying degenerate frequency bands. |
None
|
nac_q_direction
|
list of float
|
The q-vector direction for non-analytical term corrections (NAC). |
None
|
is_little_cogroup
|
bool
|
Determines group representation parsing parameters. |
False
|
Source code in defectpl\phonon.py
calculate_gamma_phonon_to_band_yaml
¶
calculate_gamma_phonon_to_band_yaml(
unitcell_filename="POSCAR",
force_constants_filename="FORCE_CONSTANTS",
dimension="1 1 1",
symprec=1e-05,
output_filename="band.yaml",
)
Evaluate phonon modes at the Gamma point using force constants and write to a band.yaml file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
unitcell_filename
|
str or Path
|
Path to the primary reference cell geometry description file. |
"POSCAR"
|
force_constants_filename
|
str or Path
|
Path addressing source file storing parsed 2nd-order derivatives. |
"FORCE_CONSTANTS"
|
dimension
|
str, list of int, or numpy.ndarray
|
The structural supercell replication shape vector configuration array. |
"1 1 1"
|
symprec
|
float
|
Structural crystal space group symmetry parsing threshold tolerance. |
1e-5
|
output_filename
|
str or Path
|
Destination filename target for generating the Phonopy track output data file. |
"band.yaml"
|