Skip to content

Commit

Permalink
Follow the change of fc interface in phonopy
Browse files Browse the repository at this point in the history
  • Loading branch information
atztogo committed Dec 10, 2024
1 parent b052a5d commit 8687da4
Show file tree
Hide file tree
Showing 15 changed files with 9 additions and 89 deletions.
1 change: 0 additions & 1 deletion phono3py/api_phono3py.py
Original file line number Diff line number Diff line change
Expand Up @@ -1544,7 +1544,6 @@ def produce_fc2(
fc_calculator_options=fc_calculator_options,
atom_list=p2s_map,
symmetry=self._phonon_supercell_symmetry,
symprec=self._symprec,
log_level=self._log_level,
)

Expand Down
1 change: 0 additions & 1 deletion phono3py/conductivity/__init__.py

This file was deleted.

1 change: 0 additions & 1 deletion phono3py/cui/__init__.py

This file was deleted.

1 change: 0 additions & 1 deletion phono3py/interface/__init__.py

This file was deleted.

59 changes: 0 additions & 59 deletions phono3py/interface/alm.py

This file was deleted.

26 changes: 9 additions & 17 deletions phono3py/interface/fc_calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,7 @@ def get_fc3(
symmetry: Optional[Symmetry] = None,
log_level: int = 0,
):
"""Supercell 2nd order force constants (fc2) are calculated.
The expected shape of supercell fc3 to be returned is
(len(atom_list), num_atoms, num_atom, 3, 3, 3),
where atom_list is either all atoms in primitive cell or supercell,
which is chosen by is_compact_fc=True for primitive cell and False for
supercell.
"""Calculate 2upercell 2nd and 3rd order force constants.
Parameters
----------
Expand All @@ -86,31 +80,28 @@ def get_fc3(
Returns
-------
fc3 : ndarray
3rd order force constants.
shape=(len(atom_list), num_atoms, num_atoms, 3, 3, 3)
dtype='double', order='C'.
Here atom_list is either all atoms in primitive cell or supercell,
which is chosen by is_compact_fc=True for primitive cell and False
for supercell.
(fc2, fc3) : tuple[ndarray]
2nd and 3rd order force constants.
"""
if fc_calculator == "alm":
from phono3py.interface.alm import get_fc3 as get_fc3_alm
from phonopy.interface.alm import run_alm

return get_fc3_alm(
fc = run_alm(
supercell,
primitive,
displacements,
forces,
2,
options=fc_calculator_options,
is_compact_fc=is_compact_fc,
log_level=log_level,
)
return fc[2], fc[3]
elif fc_calculator == "symfc":
from phonopy.interface.symfc import run_symfc

return run_symfc(
fc = run_symfc(
supercell,
primitive,
displacements,
Expand All @@ -121,6 +112,7 @@ def get_fc3(
options=fc_calculator_options,
log_level=log_level,
)
return fc[2], fc[3]
else:
msg = "Force constants calculator of %s was not found ." % fc_calculator
raise RuntimeError(msg)
Expand Down
1 change: 0 additions & 1 deletion phono3py/other/__init__.py

This file was deleted.

1 change: 0 additions & 1 deletion phono3py/phonon/__init__.py

This file was deleted.

1 change: 0 additions & 1 deletion phono3py/phonon3/__init__.py

This file was deleted.

1 change: 0 additions & 1 deletion phono3py/sscha/__init__.py

This file was deleted.

1 change: 0 additions & 1 deletion test/conductivity/__init__.py

This file was deleted.

1 change: 0 additions & 1 deletion test/other/__init__.py

This file was deleted.

1 change: 0 additions & 1 deletion test/phonon/__init__.py

This file was deleted.

1 change: 0 additions & 1 deletion test/phonon3/__init__.py

This file was deleted.

1 change: 0 additions & 1 deletion test/sscha/__init__.py

This file was deleted.

0 comments on commit 8687da4

Please sign in to comment.