3
0
mirror of https://github.com/triqs/dft_tools synced 2024-11-18 12:03:50 +01:00

refactor: simplify code in computing velocities

This commit is contained in:
phibeck 2023-03-20 11:10:40 -04:00 committed by Alexander Hampel
parent d4ef98edfd
commit 468cf6efc7

View File

@ -319,10 +319,10 @@ def recompute_w90_input_on_different_mesh(sum_k, seedname, nk_optics, pathname='
elif oc_basis == 'w': elif oc_basis == 'w':
# first term # first term
Hw_alpha_R = dataK.Ham_R.copy() Hw_alpha_R = dataK.Ham_R.copy()
for i in range(1): # following three lines copied from wannierberri/data_K.py
shape_cR = numpy.shape(dataK.cRvec_wcc) shape_cR = numpy.shape(dataK.cRvec_wcc)
Hw_alpha_R = 1j * Hw_alpha_R.reshape((Hw_alpha_R.shape) + (1, )) * dataK.cRvec_wcc.reshape( Hw_alpha_R = 1j * Hw_alpha_R.reshape((Hw_alpha_R.shape) + (1, )) * dataK.cRvec_wcc.reshape(
(shape_cR[0], shape_cR[1], dataK.system.nRvec) + (1, ) * len(Hw_alpha_R.shape[3:]) + (3, )) (shape_cR[0], shape_cR[1], dataK.system.nRvec) + (1, ) * len(Hw_alpha_R.shape[3:]) + (3, ))
Hw_alpha = dataK.fft_R_to_k(Hw_alpha_R, hermitean=False)[dataK.select_K] Hw_alpha = dataK.fft_R_to_k(Hw_alpha_R, hermitean=False)[dataK.select_K]
# second term # second term
Aw_alpha = dataK.fft_R_to_k(dataK.AA_R, hermitean=True) Aw_alpha = dataK.fft_R_to_k(dataK.AA_R, hermitean=True)