pengwann.descriptors.DescriptorCalculator.parallelise#
- descriptors.DescriptorCalculator.parallelise(wannier_interactions, calc_p_ij, resolve_k, num_proc=4, show_progress=True)#
Compute DOS matrices and elements of the Wannier density matrix in parallel.
This method is called by
assign_descriptors(), but it can also be utilised on its own for additional flexibility. To be more specific, the assign_descriptors method takes AtomicInteraction objects as input, whereas this method can be used to parallelise the computation of DOS matrices and elements of the Wannier density matrix over any arbitrary set of WannierInteraction objects.- Parameters:
- wannier_interactionssequence of
WannierInteraction The WannierInteraction objects for which to compute the DOS matrix and (optionally) the relevant elements of the Wannier density matrix.
- calc_p_ijbool
Whether or not to calculate the relevant elements of the Wannier density matrix.
- resolve_kbool
Whether or not to resolve the DOS matrix with respect to k-points.
- num_proc
int, optional The number of processes to spawn when computing the DOS matrix and density matrix elements 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.
- wannier_interactionssequence of
- Returns:
- processed_wannier_interaction
tupleofWannierInteraction A sequence of WannierInteraction objects, each of which is associated with the DOS matrix and (if calc_p_ij = True) the relevant element of the Wannier density matrix.
- processed_wannier_interaction
See also
Notes
This method is vulnerable to the same memory bottleneck as the assign_descriptors method - the same advice follows if memory usage becomes problematic.