diff --git a/phono3py/api_phono3py.py b/phono3py/api_phono3py.py index c1d8da07..c8cf0600 100644 --- a/phono3py/api_phono3py.py +++ b/phono3py/api_phono3py.py @@ -47,7 +47,6 @@ get_random_displacements_dataset, ) from phonopy.harmonic.dynamical_matrix import DynamicalMatrix -from phonopy.harmonic.force_constants import get_fc2 as get_phonopy_fc2 from phonopy.harmonic.force_constants import ( set_permutation_symmetry, set_translational_invariance, @@ -74,7 +73,6 @@ guess_primitive_matrix, shape_supercell_matrix, ) -from phonopy.structure.dataset import get_displacements_and_forces from phonopy.structure.symmetry import Symmetry from phonopy.units import VaspToTHz @@ -1540,30 +1538,19 @@ def produce_fc2( else: p2s_map = None - if fc_calculator is not None: - disps, forces = get_displacements_and_forces(disp_dataset) - self._fc2 = get_fc2( - self._phonon_supercell, - self._phonon_primitive, - disps, - forces, - fc_calculator=fc_calculator, - fc_calculator_options=fc_calculator_options, - atom_list=p2s_map, - symmetry=self._phonon_supercell_symmetry, - symprec=self._symprec, - log_level=self._log_level, - ) - else: - if "displacements" in disp_dataset: - msg = "fc_calculator to solve fc2 has to be set." - raise RuntimeError(msg) - self._fc2 = get_phonopy_fc2( - self._phonon_supercell, - self._phonon_supercell_symmetry, - disp_dataset, - atom_list=p2s_map, - ) + self._fc2 = get_fc2( + self._phonon_supercell, + self._phonon_primitive, + disp_dataset, + fc_calculator=fc_calculator, + fc_calculator_options=fc_calculator_options, + atom_list=p2s_map, + symmetry=self._phonon_supercell_symmetry, + symprec=self._symprec, + log_level=self._log_level, + ) + + if fc_calculator is None or fc_calculator == "traditional": if symmetrize_fc2: if is_compact_fc: symmetrize_compact_force_constants( diff --git a/pyproject.toml b/pyproject.toml index 787f70be..094ad8eb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,7 +8,7 @@ dynamic = ["version"] readme = { file = "README.md", content-type = "text/markdown" } description = "This is the phono3py module." authors = [{ name = "Atsushi Togo", email = "atztogo@gmail.com" }] -requires-python = ">=3.8" +requires-python = ">=3.9" dependencies = [ "numpy>=1.17.0", "scipy", @@ -16,7 +16,7 @@ dependencies = [ "matplotlib>=2.2.2", "h5py>=3.0", "spglib>=2.3", - "phonopy>=2.29,<2.30", + "phonopy>=2.30,<2.31", ] license = { file = "LICENSE" }