Skip to content

Commit

Permalink
Update following the change of phonopy's get_fc2
Browse files Browse the repository at this point in the history
  • Loading branch information
atztogo committed Nov 10, 2024
1 parent 8617a40 commit 8973ca2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 28 deletions.
39 changes: 13 additions & 26 deletions phono3py/api_phono3py.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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

Expand Down Expand Up @@ -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(
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ dynamic = ["version"]
readme = { file = "README.md", content-type = "text/markdown" }
description = "This is the phono3py module."
authors = [{ name = "Atsushi Togo", email = "[email protected]" }]
requires-python = ">=3.8"
requires-python = ">=3.9"
dependencies = [
"numpy>=1.17.0",
"scipy",
"PyYAML>=5.3",
"matplotlib>=2.2.2",
"h5py>=3.0",
"spglib>=2.3",
"phonopy>=2.29,<2.30",
"phonopy>=2.30,<2.31",
]
license = { file = "LICENSE" }

Expand Down

0 comments on commit 8973ca2

Please sign in to comment.