Skip to content

Commit

Permalink
Phonopy cleanup (#2106)
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew-S-Rosen committed May 9, 2024
1 parent a851e2b commit 1a93ce8
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/quacc/atoms/phonons.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,19 +62,17 @@ def get_phonopy(
"""
phonopy_kwargs = phonopy_kwargs or {}

structure = AseAtomsAdaptor().get_structure(atoms)
structure = SpacegroupAnalyzer(
structure, symprec=symprec
symmetrized_structure = SpacegroupAnalyzer(
AseAtomsAdaptor().get_structure(atoms), symprec=symprec
).get_symmetrized_structure()

if supercell_matrix is None and min_lengths is not None:
supercell_matrix = np.diag(
np.round(np.ceil(min_lengths / atoms.cell.lengths()))
np.round(np.ceil(min_lengths / np.array(symmetrized_structure.lattice.abc)))
)

phonopy_atoms = get_phonopy_structure(structure)
phonon = phonopy.Phonopy(
phonopy_atoms,
get_phonopy_structure(symmetrized_structure),
symprec=symprec,
supercell_matrix=supercell_matrix,
**phonopy_kwargs,
Expand Down

0 comments on commit 1a93ce8

Please sign in to comment.