Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Follow the change of fc interface in phonopy #309

Merged
merged 2 commits into from
Dec 10, 2024
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
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.

Loading