Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion phono3py/api_phono3py.py
Original file line number Diff line number Diff line change
Expand Up @@ -822,7 +822,7 @@ def _set_band_indices(self, band_indices=None):
self._band_indices = [np.arange(num_band, dtype="int64")]
else:
self._band_indices = [np.array(bi, dtype="int64") for bi in band_indices]
self._band_indices_flatten = np.hstack(self._band_indices).astype("int64")
self._band_indices_flatten = np.hstack(self._band_indices, dtype="int64")

@property
def masses(self) -> NDArray:
Expand Down
2 changes: 1 addition & 1 deletion phono3py/cui/phono3py_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -929,7 +929,7 @@ def _run_isotope_then_exit(
"""Run isotope scattering calculation."""
mass_variances = settings.mass_variances
if settings.band_indices is not None:
band_indices = np.hstack(settings.band_indices).astype("int64")
band_indices = np.hstack(settings.band_indices, dtype="int64")
else:
band_indices = None
iso = Phono3pyIsotope(
Expand Down
4 changes: 2 additions & 2 deletions phono3py/file_IO.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ def write_fc3_to_hdf5(
Filename to be used.
p2s_map : ndarray, optional
Primitive atom indices in supercell index system shape=(n_patom,),
dtype=intc
dtype=int64
fc3_cutoff : float, optional
Cutoff distance for fc3.
compression : str or int, optional
Expand Down Expand Up @@ -770,7 +770,7 @@ def write_spectral_function_to_hdf5(
if all_band_exist:
_band_indices = None
else:
_band_indices = np.hstack(band_indices).astype("int64")
_band_indices = np.hstack(band_indices, dtype="int64")
suffix = _get_filename_suffix(
mesh, grid_point=grid_point, band_indices=_band_indices, sigma=sigma
)
Expand Down
2 changes: 1 addition & 1 deletion phono3py/phonon/solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,4 +270,4 @@ def _get_fc_elements_mapping(dm: DynamicalMatrix, fc: NDArray[np.double]):
fc_p2s = np.arange(len(p2s_map), dtype="int64")
fc_s2p = s2pp_map

return np.array(fc_p2s, dtype="int64"), np.array(fc_s2p, dtype="int64")
return fc_p2s, fc_s2p
17 changes: 4 additions & 13 deletions phono3py/phonon3/fc3.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,10 +280,10 @@ def set_permutation_symmetry_compact_fc3(fc3, primitive):
s2pp_map, nsym_list = get_nsym_list_and_s2pp(s2p_map, p2p_map, permutations)
phono3c.permutation_symmetry_compact_fc3(
fc3,
np.array(permutations, dtype="int64", order="C"),
np.array(s2pp_map, dtype="int64"),
np.array(p2s_map, dtype="int64"),
np.array(nsym_list, dtype="int64"),
permutations,
s2pp_map,
p2s_map,
nsym_list,
)
except ImportError as exc:
text = (
Expand Down Expand Up @@ -333,11 +333,6 @@ def set_translational_invariance_compact_fc3(fc3, primitive: Primitive):
p2p_map = primitive.p2p_map
permutations = primitive.atomic_permutations
s2pp_map, nsym_list = get_nsym_list_and_s2pp(s2p_map, p2p_map, permutations)

permutations = np.array(permutations, dtype="int64", order="C")
s2pp_map = np.array(s2pp_map, dtype="int64")
p2s_map = np.array(p2s_map, dtype="int64")
nsym_list = np.array(nsym_list, dtype="int64")
phono3c.transpose_compact_fc3(
fc3, permutations, s2pp_map, p2s_map, nsym_list, 0
) # dim[0] <--> dim[1]
Expand Down Expand Up @@ -628,10 +623,6 @@ def get_drift_fc3(
p2p_map = primitive.p2p_map
permutations = primitive.atomic_permutations
s2pp_map, nsym_list = get_nsym_list_and_s2pp(s2p_map, p2p_map, permutations)
permutations = np.array(permutations, dtype="int64", order="C")
s2pp_map = np.array(s2pp_map, dtype="int64")
p2s_map = np.array(p2s_map, dtype="int64")
nsym_list = np.array(nsym_list, dtype="int64")
num_patom = fc3.shape[0]
num_satom = fc3.shape[1]
maxval1 = 0
Expand Down
6 changes: 3 additions & 3 deletions phono3py/phonon3/interaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,8 @@ def __init__(

self._svecs, self._multi = self._primitive.get_smallest_vectors()
self._masses = np.array(self._primitive.masses, dtype="double")
self._p2s = np.array(self._primitive.p2s_map, dtype="int64")
self._s2p = np.array(self._primitive.s2p_map, dtype="int64")
self._p2s = self._primitive.p2s_map
self._s2p = self._primitive.s2p_map
n_satom, n_patom, _ = self._multi.shape
self._all_shortest = np.zeros(
(n_patom, n_satom, n_satom), dtype="byte", order="C"
Expand Down Expand Up @@ -680,7 +680,7 @@ def run_phonon_solver_with_eigvec_rotation(self):

d2r_map = self._get_reciprocal_rotations_in_space_group_operations()

# perms.shape = (len(spg_ops), len(primitive)), dtype='intc'
# perms.shape = (len(spg_ops), len(primitive)), dtype='int64'
perms = compute_all_sg_permutations(
self._primitive.scaled_positions,
self._bz_grid.symmetry_dataset.rotations, # type: ignore
Expand Down
Loading