Skip to content

Commit

Permalink
Add attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
atztogo committed Feb 25, 2022
1 parent 9497df8 commit 435669e
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions phono3py/api_isotope.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,28 @@ def grid(self):
"""Return BZGrid class instance."""
return self._iso.bz_grid

@property
def gamma(self):
"""Return calculated isotope scattering."""
return self._gamma

@property
def frequencies(self):
"""Return phonon frequencies at grid points."""
return self._iso.get_phonons()[0][self._grid_points]

@property
def grid_points(self):
"""Return grid points in BZ-grid."""
return self._grid_points

def run(self, grid_points):
"""Calculate isotope scattering."""
gamma = np.zeros(
(len(self._sigmas), len(grid_points), len(self._iso.band_indices)),
dtype="double",
)
self._grid_points = np.array(grid_points, dtype="int_")

for j, gp in enumerate(grid_points):
self._iso.set_grid_point(gp)
Expand Down Expand Up @@ -146,8 +162,3 @@ def init_dynamical_matrix(
def set_sigma(self, sigma):
"""Set sigma. None means tetrahedron method."""
self._iso.set_sigma(sigma)

@property
def gamma(self):
"""Return calculated isotope scattering."""
return self._gamma

0 comments on commit 435669e

Please sign in to comment.