Skip to content

Commit

Permalink
better var names
Browse files Browse the repository at this point in the history
  • Loading branch information
janosh committed Dec 15, 2023
1 parent d5a7c92 commit f91c019
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pymatgen/phonon/bandstructure.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,17 +140,17 @@ def __init__(
self.nac_frequencies = []
self.nac_eigendisplacements = []
if nac_frequencies is not None:
for t in nac_frequencies:
self.nac_frequencies.append(([i / np.linalg.norm(t[0]) for i in t[0]], t[1]))
for freq in nac_frequencies:
self.nac_frequencies.append(([idx / np.linalg.norm(freq[0]) for idx in freq[0]], freq[1]))
if nac_eigendisplacements is not None:
for t in nac_eigendisplacements:
self.nac_eigendisplacements.append(([i / np.linalg.norm(t[0]) for i in t[0]], t[1]))
for freq in nac_eigendisplacements:
self.nac_eigendisplacements.append(([idx / np.linalg.norm(freq[0]) for idx in freq[0]], freq[1]))

def min_freq(self) -> tuple[Kpoint, float]:
"""Returns the point where the minimum frequency is reached and its value."""
i = np.unravel_index(np.argmin(self.bands), self.bands.shape)
idx = np.unravel_index(np.argmin(self.bands), self.bands.shape)

return self.qpoints[i[1]], self.bands[i]
return self.qpoints[idx[1]], self.bands[idx]

def has_imaginary_freq(self, tol: float = 1e-5) -> bool:
"""True if imaginary frequencies are present in the BS."""
Expand Down

0 comments on commit f91c019

Please sign in to comment.