Skip to content

Commit

Permalink
Merge pull request #751 from naik-aakash/fix_phonon_flow
Browse files Browse the repository at this point in the history
[WIP] Fix phonon + Lobster flow
  • Loading branch information
utf authored Feb 28, 2024
2 parents e9fe5c2 + 031521d commit 5055030
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 5 deletions.
6 changes: 6 additions & 0 deletions docs/user/codes/vasp.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,12 @@ converted into a dynamical matrix. To correct for polarization effects, a correc
dynamical matrix based on BORN charges can be performed. Finally, phonon densities of states,
phonon band structures and thermodynamic properties are computed.

```{warning}
The current implementation of the workflow does not consider the initial magnetic moments
for the determination of the symmetry of the structure; therefore, they are removed from the structure.
```


```{note}
It is heavily recommended to symmetrize the structure before passing it to
this flow. Otherwise, a different space group might be detected and too
Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -78,17 +78,17 @@ strict = [
"emmet-core==0.78.0rc4",
"ijson==3.2.3",
"jobflow==0.1.17",
"lobsterpy==0.3.6",
"lobsterpy==0.3.8",
"mace-torch>=0.3.3",
"matgl==1.0.0",
"monty==2024.2.2",
"mp-api==0.40.1",
"mp-api==0.40.2",
"numpy",
"phonopy==2.21.2",
"pydantic-settings==2.2.1",
"pydantic==2.6.2",
"pymatgen-analysis-defects==2024.2.24",
"pymatgen==2023.12.18",
"pymatgen==2024.2.23",
"quippy-ase==0.9.14",
"seekpath==2.1.0",
"typing-extensions==4.10.0",
Expand Down
16 changes: 14 additions & 2 deletions src/atomate2/common/jobs/phonons.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import contextlib
import logging
import warnings
from dataclasses import dataclass, field
from typing import TYPE_CHECKING

Expand Down Expand Up @@ -150,7 +151,16 @@ def generate_phonon_displacements(
code:
code to perform the computations
"""
cell = get_phonopy_structure(structure)
warnings.warn(
"Initial magnetic moments will not be considered for the determination "
"of the symmetry of the structure and thus will be removed now.",
stacklevel=1,
)
cell = get_phonopy_structure(
structure.remove_site_property(property_name="magmom")
if "magmom" in structure.site_properties
else structure
)
if code == "vasp":
factor = VaspToTHz
# a bit of code repetition here as I currently
Expand Down Expand Up @@ -226,7 +236,9 @@ def generate_frequencies_eigenvectors(
Additional parameters that are passed to PhononBSDOSDoc.from_forces_born
"""
return PhononBSDOSDoc.from_forces_born(
structure=structure,
structure=structure.remove_site_property(property_name="magmom")
if "magmom" in structure.site_properties
else structure,
supercell_matrix=supercell_matrix,
displacement=displacement,
sym_reduce=sym_reduce,
Expand Down

0 comments on commit 5055030

Please sign in to comment.