pengwann.descriptors.DescriptorCalculator.assign_descriptors#
- descriptors.DescriptorCalculator.assign_descriptors(interactions, calc_wohp=True, calc_wobi=True, resolve_k=False, num_proc=4, show_progress=True)#
Compute DOS matrices, WOHPs and WOBIs for a set of AtomicInteraction objects.
If both calc_wohp and calc_wobi are both False, the DOS matrix will still be calculated for each interaction.
- Parameters:
- interactions
AtomicInteractionContainer The interactions for which to calculate DOS matrices and optionally, WOHPs and WOBIs.
- calc_wohpbool, optional
Whether or not to calculate WOHPs for the input interactions. Defaults to True.
- calc_wobibool, optional
Whether or not to calculate WOBIs for the input interactions. Defaults to True.
- resolve_kbool, optional
Whether or not to resolve the output DOS matrices, WOHPs and WOBIs with respect to k-points. Defaults to False.
- num_proc
int, optional The number of processes used to compute descriptors in parallel. Note that if num_proc is less than the value reported by
multiprocessing.cpu_count(), then the latter will be used instead. Defaults to 4.- show_progressbool, optional
If True, display a
tqdmprogress bar. Defaults to True.
- interactions
- Returns:
- interactions_with_descriptors
AtomicInteractionContainer An updated instance of the input interactions, with each of the AtomicInteraction objects now being associated with the descriptors calculated for the overall interaction as well as its constituent WannierInteraction objects.
- interactions_with_descriptors
See also
Notes
The DOS matrices, WOHPs and WOBIs for the input interactions are computed using shared memory parallelism to avoid copying potentially very large arrays (such as the density of states at each energy, k-point and band) between concurrent processes. Even with shared memory, very small (low volume -> many k-points) and very large (many electrons -> many bands/Wannier functions) systems can be problematic in terms of memory usage, particularly if the energy resolution is too high. If you find that you are running out of memory, you can either a) reduce num_proc or b) reduce the energy resolution of the DOS by passing a smaller resolution to
from_eigenvalues().For resolve_k = True and calc_wohp = True, the k-resolved WOHP for a given pair of Wannier functions is computed as [1][2]
\[\mathrm{WOHP}_{\alpha\beta}(E, k) = -H_{\alpha\beta}D_{\alpha\beta}(E, k),\]where \(H\) is the Wannier Hamiltonian and \(D_{\alpha\beta}\) is the DOS matrix for Wannier functions \(\ket{w_{\alpha}}\) and \(\ket{w_{\beta}}\). For resolve_k = False, summing over \(k\) gives the total WOHP between \(\ket{w_{\alpha}}\) and \(\ket{w_{\beta}}\)
\[\mathrm{WOHP}_{\alpha\beta}(E) = -H_{\alpha\beta}\sum_{k} D_{\alpha\beta} (E, k).\]Summing over all WOHPs associated with a given pair of atoms yields
\[\mathrm{WOHP}_{AB}(E) = \sum_{\alpha\beta \in AB} \mathrm{WOHP}_{\alpha\beta}(E),\]which is the total WOHP for the interatomic interaction between atoms \(A\) and \(B\).
For calc_wobi = True, the WOBI for a pair of Wannier functions or a pair of atoms is computed in an identical manner, except that the DOS matrix is weighted by the Wannier density matrix rather than the Wannier Hamiltonian [3]:
\[\mathrm{WOBI}_{\alpha\beta}(E) = P_{\alpha\beta}D_{\alpha\beta}(E).\]References