|
14 | 14 | PhononDisplacementMaker,
|
15 | 15 | run_phonon_displacements,
|
16 | 16 | )
|
17 |
| -from atomate2.vasp.jobs.core import StaticMaker |
18 |
| -from atomate2.vasp.sets.core import StaticSetGenerator |
| 17 | +from atomate2.vasp.flows.core import DoubleRelaxMaker |
| 18 | +from atomate2.vasp.flows.phonons import PhononMaker |
| 19 | +from atomate2.vasp.jobs.core import StaticMaker, TightRelaxMaker |
| 20 | +from atomate2.vasp.sets.core import StaticSetGenerator, TightRelaxSetGenerator |
19 | 21 | from jobflow import Flow, Maker
|
20 | 22 | from phonopy.structure.cells import get_supercell
|
21 | 23 | from pymatgen.core import Molecule, Site
|
|
24 | 26 | from autoplex.data.jobs import generate_randomized_structures
|
25 | 27 |
|
26 | 28 | __all__ = [
|
| 29 | + "DFTPhononMaker", |
27 | 30 | "IsoAtomMaker",
|
28 | 31 | "IsoAtomStaticMaker",
|
29 | 32 | "RandomStructuresDataGenerator",
|
@@ -83,6 +86,117 @@ class TightDFTStaticMaker(PhononDisplacementMaker):
|
83 | 86 | )
|
84 | 87 |
|
85 | 88 |
|
| 89 | +@dataclass |
| 90 | +class DFTPhononMaker(PhononMaker): |
| 91 | + """ |
| 92 | + Adapted PhononMaker to calculate harmonic phonons with VASP and Phonopy. |
| 93 | +
|
| 94 | + The input set used is same as PhononMaker from atomate2. |
| 95 | + Only difference is Spin polarization is switched off and Gaussian smearing is used |
| 96 | +
|
| 97 | + Parameters |
| 98 | + ---------- |
| 99 | + name : str = "phonon" |
| 100 | + Name of the flows produced by this maker. |
| 101 | + sym_reduce : bool = True |
| 102 | + Whether to reduce the number of deformations using symmetry. |
| 103 | + symprec : float = 1e-4 |
| 104 | + Symmetry precision to use in the |
| 105 | + reduction of symmetry to find the primitive/conventional cell |
| 106 | + (use_primitive_standard_structure, use_conventional_standard_structure) |
| 107 | + and to handle all symmetry-related tasks in phonopy |
| 108 | + displacement: float = 0.01 |
| 109 | + displacement distance for phonons |
| 110 | + min_length: float = 20.0 |
| 111 | + min length of the supercell that will be built |
| 112 | + prefer_90_degrees: bool = True |
| 113 | + if set to True, supercell algorithm will first try to find a supercell |
| 114 | + with 3 90 degree angles |
| 115 | + get_supercell_size_kwargs: dict = {} |
| 116 | + kwargs that will be passed to get_supercell_size to determine supercell size |
| 117 | + use_symmetrized_structure: str or None = None |
| 118 | + allowed strings: "primitive", "conventional", None |
| 119 | +
|
| 120 | + - "primitive" will enforce to start the phonon computation |
| 121 | + from the primitive standard structure |
| 122 | + according to Setyawan, W., & Curtarolo, S. (2010). |
| 123 | + High-throughput electronic band structure calculations: |
| 124 | + Challenges and tools. Computational Materials Science, |
| 125 | + 49(2), 299-312. doi:10.1016/j.commatsci.2010.05.010. |
| 126 | + This makes it possible to use certain k-path definitions |
| 127 | + with this workflow. Otherwise, we must rely on seekpath |
| 128 | + - "conventional" will enforce to start the phonon computation |
| 129 | + from the conventional standard structure |
| 130 | + according to Setyawan, W., & Curtarolo, S. (2010). |
| 131 | + High-throughput electronic band structure calculations: |
| 132 | + Challenges and tools. Computational Materials Science, |
| 133 | + 49(2), 299-312. doi:10.1016/j.commatsci.2010.05.010. |
| 134 | + We will however use seekpath and primitive structures |
| 135 | + as determined by from phonopy to compute the phonon band structure |
| 136 | + bulk_relax_maker : .BaseVaspMaker or None |
| 137 | + A maker to perform a tight relaxation on the bulk. |
| 138 | + Set to ``None`` to skip the |
| 139 | + bulk relaxation |
| 140 | + static_energy_maker : .BaseVaspMaker or None |
| 141 | + A maker to perform the computation of the DFT energy on the bulk. |
| 142 | + Set to ``None`` to skip the |
| 143 | + static energy computation |
| 144 | + born_maker: .BaseVaspMaker or None |
| 145 | + Maker to compute the BORN charges. |
| 146 | + phonon_displacement_maker : .BaseVaspMaker or None |
| 147 | + Maker used to compute the forces for a supercell. |
| 148 | + generate_frequencies_eigenvectors_kwargs : dict |
| 149 | + Keyword arguments passed to :obj:`generate_frequencies_eigenvectors`. |
| 150 | + create_thermal_displacements: bool |
| 151 | + Arg that determines if thermal_displacement_matrices are computed |
| 152 | + kpath_scheme: str = "seekpath" |
| 153 | + scheme to generate kpoints. Please be aware that |
| 154 | + you can only use seekpath with any kind of cell |
| 155 | + Otherwise, please use the standard primitive structure |
| 156 | + Available schemes are: |
| 157 | + "seekpath", "hinuma", "setyawan_curtarolo", "latimer_munro". |
| 158 | + "seekpath" and "hinuma" are the same definition but |
| 159 | + seekpath can be used with any kind of unit cell as |
| 160 | + it relies on phonopy to handle the relationship |
| 161 | + to the primitive cell and not pymatgen |
| 162 | + code: str = "vasp" |
| 163 | + determines the DFT code. currently only vasp is implemented. |
| 164 | + This keyword might enable the implementation of other codes |
| 165 | + in the future |
| 166 | + store_force_constants: bool |
| 167 | + if True, force constants will be stored |
| 168 | + """ |
| 169 | + |
| 170 | + name: str = "phonon" |
| 171 | + sym_reduce: bool = True |
| 172 | + symprec: float = 1e-4 |
| 173 | + displacement: float = 0.01 |
| 174 | + min_length: float | None = 20.0 |
| 175 | + prefer_90_degrees: bool = True |
| 176 | + get_supercell_size_kwargs: dict = field(default_factory=dict) |
| 177 | + use_symmetrized_structure: str | None = None |
| 178 | + bulk_relax_maker: BaseVaspMaker | None = field( |
| 179 | + default_factory=lambda: DoubleRelaxMaker.from_relax_maker( |
| 180 | + TightRelaxMaker( |
| 181 | + input_set_generator=TightRelaxSetGenerator( |
| 182 | + user_incar_settings={"ISPIN": 1, "LAECHG": False, "ISMEAR": 0} |
| 183 | + ) |
| 184 | + ) |
| 185 | + ), |
| 186 | + ) |
| 187 | + static_energy_maker: BaseVaspMaker | None = field( |
| 188 | + default_factory=lambda: StaticMaker( |
| 189 | + input_set_generator=StaticSetGenerator( |
| 190 | + auto_ispin=False, |
| 191 | + user_incar_settings={"ISPIN": 1, "LAECHG": False, "ISMEAR": 0}, |
| 192 | + ) |
| 193 | + ) |
| 194 | + ) |
| 195 | + phonon_displacement_maker: BaseVaspMaker = field( |
| 196 | + default_factory=TightDFTStaticMaker |
| 197 | + ) |
| 198 | + |
| 199 | + |
86 | 200 | @dataclass
|
87 | 201 | class IsoAtomStaticMaker(StaticMaker):
|
88 | 202 | """
|
|
0 commit comments