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

Manual supercells #176

Merged
merged 17 commits into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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
7 changes: 6 additions & 1 deletion autoplex/auto/phonons/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,9 @@ def dft_phonopy_gen_data(
jobs = []
dft_phonons_output = {}
dft_phonons_dir_output = []
supercell_matrix = reduce_supercell_size(structure, **supercell_settings)
supercell_matrix = supercell_settings.get(structure, {}).get("supercell_matrix")
QuantumChemist marked this conversation as resolved.
Show resolved Hide resolved
if not supercell_matrix:
supercell_matrix = reduce_supercell_size(structure, **supercell_settings)

if phonon_displacement_maker is None:
phonon_displacement_maker = TightDFTStaticMaker(name="dft phonon static")
Expand All @@ -337,6 +339,7 @@ def dft_phonopy_gen_data(
run_vasp_kwargs={"handlers": {}},
input_set_generator=TightRelaxSetGenerator(
user_incar_settings={
"ALGO": "Normal",
"ISPIN": 1,
"LAECHG": False,
"ISMEAR": 0,
Expand All @@ -360,6 +363,7 @@ def dft_phonopy_gen_data(
input_set_generator=StaticSetGenerator(
auto_ispin=False,
user_incar_settings={
"ALGO": "Normal",
"ISPIN": 1,
"LAECHG": False,
"ISMEAR": 0,
Expand Down Expand Up @@ -488,6 +492,7 @@ def dft_random_gen_data(
run_vasp_kwargs={"handlers": {}},
input_set_generator=TightRelaxSetGenerator(
user_incar_settings={
"ALGO": "Normal",
"ISPIN": 1,
"LAECHG": False,
"ISYM": 0, # to be changed
Expand Down
34 changes: 22 additions & 12 deletions autoplex/data/phonons/flows.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ class TightDFTStaticMaker(PhononDisplacementMaker):
input_set_generator: VaspInputGenerator = field(
default_factory=lambda: StaticSetGenerator(
user_incar_settings={
"ALGO": "Normal", # not switching to Fast because it's not precise enough for the fit
"IBRION": -1,
"ISPIN": 1,
"ISMEAR": 0,
Expand All @@ -93,7 +94,6 @@ class TightDFTStaticMaker(PhononDisplacementMaker):
"EDIFF": 1e-7,
"LAECHG": False,
"LREAL": False,
"ALGO": "Normal", # not switching to Fast because it's not precise enough for the fit
"NSW": 0,
"LCHARG": False, # Do not write the CHGCAR file
"LWAVE": False, # Do not write the WAVECAR file
Expand Down Expand Up @@ -216,6 +216,7 @@ class DFTPhononMaker(PhononMaker):
run_vasp_kwargs={"handlers": {}},
input_set_generator=TightRelaxSetGenerator(
user_incar_settings={
"ALGO": "Normal",
"ISPIN": 1,
"LAECHG": False,
"ISMEAR": 0,
Expand All @@ -239,6 +240,7 @@ class DFTPhononMaker(PhononMaker):
input_set_generator=StaticSetGenerator(
auto_ispin=False,
user_incar_settings={
"ALGO": "Normal",
"ISPIN": 1,
"LAECHG": False,
"ISMEAR": 0,
Expand Down Expand Up @@ -329,6 +331,7 @@ class RandomStructuresDataGenerator(Maker):
run_vasp_kwargs={"handlers": {}},
input_set_generator=TightRelaxSetGenerator(
user_incar_settings={
"ALGO": "Normal",
"ISPIN": 1,
"LAECHG": False,
"ISYM": 0, # to be changed
Expand Down Expand Up @@ -391,18 +394,23 @@ def make(
jobs.append(relaxed)
structure = relaxed.output.structure

supercell_matrix_job = reduce_supercell_size_job(
structure=structure,
min_length=self.supercell_settings.get("min_length", 12),
max_length=self.supercell_settings.get("max_length", 25),
fallback_min_length=self.supercell_settings.get("fallback_min_length", 10),
max_atoms=self.supercell_settings.get("max_atoms", 500),
min_atoms=self.supercell_settings.get("min_atoms", 50),
step_size=self.supercell_settings.get("step_size", 1.0),
supercell_matrix = self.supercell_settings.get(structure, {}).get(
"supercell_matrix"
)
jobs.append(supercell_matrix_job)

supercell_matrix = supercell_matrix_job.output
if not supercell_matrix:
supercell_matrix_job = reduce_supercell_size_job(
structure=structure,
min_length=self.supercell_settings.get("min_length", 12),
max_length=self.supercell_settings.get("max_length", 25),
fallback_min_length=self.supercell_settings.get(
"fallback_min_length", 10
),
max_atoms=self.supercell_settings.get("max_atoms", 500),
min_atoms=self.supercell_settings.get("min_atoms", 50),
step_size=self.supercell_settings.get("step_size", 1.0),
)
jobs.append(supercell_matrix_job)
supercell_matrix = supercell_matrix_job.output

random_rattle_sc = generate_randomized_structures(
structure=structure,
Expand Down Expand Up @@ -754,6 +762,7 @@ class IsoAtomStaticMaker(StaticMaker):
default_factory=lambda: StaticSetGenerator(
user_kpoints_settings={"reciprocal_density": 1},
user_incar_settings={
"ALGO": "Normal",
"ISPIN": 1,
"LAECHG": False,
"ISMEAR": 0,
Expand Down Expand Up @@ -804,6 +813,7 @@ def make(
isolated_atom_static_input_set = StaticSetGenerator(
user_kpoints_settings={"grid_density": 1},
user_incar_settings={
"ALGO": "Normal",
"ISPIN": 1,
"LAECHG": False,
"ISMEAR": 0,
Expand Down
Loading