Skip to content

Commit

Permalink
Apply mass-weighting to modes for web JSON
Browse files Browse the repository at this point in the history
  • Loading branch information
ajjackson committed Oct 11, 2024
1 parent 80cea6c commit 7dd02f2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion euphonic/qpoint_phonon_modes.py
Original file line number Diff line number Diff line change
Expand Up @@ -898,14 +898,17 @@ def _to_phonon_website_dict(self,
x_tick_labels = [(int(key) + 1, str(value)) for key, value in x_tick_labels]
x_tick_labels = self._combine_neighbouring_labels(x_tick_labels)

vectors = eigenvectors / np.sqrt(self.crystal.atom_mass)[None, None, :, None]
vectors = vectors.view(float).reshape(*eigenvectors.shape[:-1], 3, 2)

dat = PhononWebsiteData(
name=name,
**self._crystal_website_data(self.crystal),
highsym_qpts=x_tick_labels,
distances=abscissa.magnitude.tolist(),
qpoints=self.qpts.tolist(),
eigenvalues=self.frequencies.to("1/cm").magnitude.tolist(),
vectors=eigenvectors.view(float).reshape(*eigenvectors.shape[:-1], 3, 2).tolist(),
vectors=vectors.tolist(),
repetitions=repetitions,
line_breaks=line_breaks
)
Expand Down

0 comments on commit 7dd02f2

Please sign in to comment.