principia_materia.phonon_id.phonon_tools module
- principia_materia.phonon_id.phonon_tools.adjust_eigenvectors_subspace(mat, frequencies, eigenvectors, tol=0.0001)
Adjust eigenvectors in degerate subspace based on the input matrices.
It picks the eigenvectors in the frequency degenarete subspace so that the sub-matrix of
mat
can be diagonalized by the eigenvectors as well.- Parameters:
mat (array of complex, shape(nq, nband, nband)) – Matrices the adjustments of eigenvectors are based on. Renormalized with mass.
frequencies (array of float, shape(nq, nband)) – Phonon frequencies, the subspace of eigenvectors are based on the degenracy of the phonon frequencies.
eigenvectors (array of complex, shape(nq, nband, nband)) – Phonon eigenvectors.
tol (float, optional, default to 1.0E-4) – Tolerance threshold.
- Returns:
adjusted_eigenvectors – Ajusted eigenvectors.
- Return type:
array of complex, shape(nq, nband, nband)
- principia_materia.phonon_id.phonon_tools.compute_eigenvalues(dq, mass_matrix, UPLO='L', decimal=8)
Just find the eigenvalues and eigenvectors of Dq with mass matrix.
- Parameters:
dq (array of complex, shape (nband, nband) or (nq, nband, nband)) – Dynamic matrix or an array of dynamic matrices.
mass_matrix (array of float, shape (nband, ) or (nband, nband)) – Mass matrix. (either mass_matrix or structure need to be present to compute phonon)
UPLO ('L' or 'U', optional, default to 'L') – Use either lower or upper triangular of the Hermetian matrix.
decimal (int, optional, default to 8) – Decimal points of the precision.
- Returns:
evals (array of float, shape (nband, ) or (nq, nband)) – Eigenvalues of dynamic matrices.
evecs (array of complex, shape (nband, nband) or (nq, nband, nband)) – Phonon eigenvectors.
- principia_materia.phonon_id.phonon_tools.compute_phonon_frequencies_from_eigenvalues(evals, units='cm-1')
Compute phonon frequencies from eigenvalues.
- Parameters:
evals (array of float, shape (nband, ) or (nq, nband)) – Eigenvalues of dynamic matrices.
units (str, optional, default to 'cm-1') – Unit of phonon frequencies
- Returns:
freqs – Phonon frequencies.
- Return type:
array of float, shape (nband, ) or (nq, nband)
- principia_materia.phonon_id.phonon_tools.compute_phonons(dq, mass_matrix=None, structure=None, units='cm-1', UPLO='L', decimal=8)
Compute phonon and eigenvectors for given structure, dynamic matrices and units.
It is using the following formula:
\[\hat{M}^{-\frac{1}{2}} \hat{D_q} \hat{M}^{-\frac{1}{2}} \vec{S} = \omega^2 \vec{S}\]This class also support diagonalization and unit adjustments for an array of dynamic matrices.
- Parameters:
dq (array of complex, shape (nband, nband) or (nq, nband, nband)) – Dynamic matrix or an array of dynamic matrices.
mass_matrix (array of float, shape (nband, ) or (nband, nband)) – Mass matrix. (either mass_matrix or structure need to be present to compute phonon)
structure (str or CrystalFTG instance) – Path to the CrystalFTG structure file or a CrystalFTG instance.
units (str, optional, default to 'cm-1') – Unit of phonon frequencies
UPLO ('L' or 'U', optional, default to 'L') – Use either lower or upper triangular of the Hermetian matrix.
decimal (int, optional, default to 8) – Decimal points of the precision.
- Returns:
freqs (array of float, shape (nband, ) or (nq, nband)) – Phonon frequencies.
evecs (array of complex, shape (nband, nband) or (nq, nband, nband)) – Phonon eigenvectors.
- principia_materia.phonon_id.phonon_tools.find_degenerate_frequencies(frequencies, tol=0.0001)
Find degerate sets of frequencies.
- Parameters:
frequencies (array of float, shape(nq, nband)) – Phonon frequencies.
tol (float, optional, default to 1.0E-4) – Tolerance threshold.
- Returns:
degenerate_indicies – Index of degenerate indices of the frequencies grouped into list of lists.
- Return type:
list of lists of integers
- principia_materia.phonon_id.phonon_tools.get_mass_matrix(structure)
Compute mass matrix from given structure.
- Parameters:
structure (str or CrystalFTG instance) – Path to the CrystalFTG structure file or a CrystalFTG instance.
- Returns:
mass_matrix – Mass matrix.
- Return type:
array of float, shape (nband, nband)
- principia_materia.phonon_id.phonon_tools.multiply_mass_matrix(dq, mass_matrix)
Multiply mass matrix to dynamic matrices.
- Parameters:
dq (array of complex, shape (nband, nband) or (nq, nband, nband)) – Dynamic matrices.
mass_matrix (array of float, shape (nband, ) or (nband, nband)) – Mass matrix. (either mass_matrix or structure need to be present to compute phonon)
- Returns:
dq – Mass renormalized dynamic matrices.
- Return type:
array of complex, shape (nband, nband) or (nq, nband, nband)