mirror of https://github.com/phonopy/phonopy.git
Made get_band_qpoints be more readable.
This commit is contained in:
parent
71f83b3475
commit
65826e5c3d
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue