Made get_band_qpoints be more readable.

This commit is contained in:
Atsushi Togo 2018-07-23 16:22:36 +09:00
parent 71f83b3475
commit 65826e5c3d
1 changed files with 3 additions and 7 deletions

View File

@ -79,13 +79,9 @@ def get_band_qpoints(band_paths, npoints):
for band_path in band_paths:
nd = len(band_path)
for i in range(nd - 1):
diff = np.subtract(band_path[i + 1], band_path[i]) / (npoints - 1)
qpoints = [np.array(band_path[i]), ]
q = np.zeros(3)
for j in range(npoints - 1):
q += diff
qpoints.append(band_path[i] + q)
qpoints_of_paths.append(np.array(qpoints))
delta = np.subtract(band_path[i + 1], band_path[i]) / (npoints - 1)
qpoints = [delta * j for j in range(npoints)]
qpoints_of_paths.append(np.array(qpoints) + band_path[i])
return qpoints_of_paths