Miscellaneous functions: cij.misc
- cij.misc.evec_disp2eig(a, mass)
Convert phonon displacement vector to eigenvector.
The displacement vectors (
) are not orthogonal, whereas eigenvectors ( ) are orthogonal. The difference is the mass matrix ( ). and are related byThis function returns normalized
.- Parameters
a (
ndarray
) – M x 3N displacement vector matrixmass (
list
) – N x 1 atom mass vector, of any unit
- Return type
ndarray
- Returns
Eigenvector matrix, shape is same as
a
(M x 3N):
- cij.misc.evec_load(fname, nq, np)
Load
eig
file frommatdyn.x
output.- Parameters
fname (
str
) – The name of theeig
filenq (
int
) – The number of q pointsnp (
int
) – The number of modes
- Return type
list
- cij.misc.evec_sort(target_arr, target_evecs, base_evecs, filter=None, threshold=None)
Sort elements of an array based on the eigenvector similarities with respect to another set of eigenvectors.
- Parameters
target_arr (
list
) – The array of element to be sortedtarget_evecs – The array of eigenvectors with one-on-one corresponds to
target_arr
base_evecs – The array of eigenvectors as alignment.
filter (
Optional
[callable
]) – the filter to apply on the dot product before the sorting actually happens.threshold (
Optional
[float
]) – below which threshold the error should be raised.
- Return type
list
- Returns
The sorted array of elements
- Raises
RuntimeError