Skip to content

Commit

Permalink
WIP refactoring phonon convergence test
Browse files Browse the repository at this point in the history
  • Loading branch information
unkcpz committed Jun 10, 2024
1 parent 66da802 commit fad95fc
Show file tree
Hide file tree
Showing 12 changed files with 284 additions and 308 deletions.
20 changes: 8 additions & 12 deletions src/aiida_sssp_workflow/protocol/convergence.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ balanced:
qpoints_list:
- [0.5, 0.5, 0.5]
epsilon: false
tr2_ph: 1.0e-16
tr2_ph: 1.0e-12
diagonalization: cg

pressure:
scale_count: 7
Expand All @@ -28,8 +29,6 @@ balanced:
bands:
init_nbands_factor: 3.0
fermi_shift: 10.0
kpoints_distance_scf: 0.15
kpoints_distance_bands: 0.15

eos:
scale_count: 7
Expand All @@ -55,7 +54,8 @@ fine:
qpoints_list:
- [0.5, 0.5, 0.5]
epsilon: false
tr2_ph: 1.0e-16
tr2_ph: 1.0e-12
diagonalization: cg

pressure:
scale_count: 7
Expand All @@ -64,8 +64,6 @@ fine:
bands:
init_nbands_factor: 3.0
fermi_shift: 10.0
kpoints_distance_scf: 0.15
kpoints_distance_bands: 0.15

eos:
scale_count: 7
Expand All @@ -91,7 +89,8 @@ acwf:
qpoints_list:
- [0.5, 0.5, 0.5]
epsilon: false
tr2_ph: 1.0e-16
tr2_ph: 1.0e-14
diagonalization: cg

pressure:
scale_count: 7
Expand All @@ -100,8 +99,6 @@ acwf:
bands:
init_nbands_factor: 3.0
fermi_shift: 10.0
kpoints_distance_scf: 0.15
kpoints_distance_bands: 0.15

eos:
scale_count: 7
Expand All @@ -127,7 +124,8 @@ test:
qpoints_list:
- [0.5, 0.5, 0.5]
epsilon: false
tr2_ph: 1.0e-5
tr2_ph: 1.0e-6
diagonalization: cg

pressure:
scale_count: 5
Expand All @@ -136,8 +134,6 @@ test:
bands:
init_nbands_factor: 3.0
fermi_shift: 10.0
kpoints_distance_scf: 0.5
kpoints_distance_bands: 0.25

eos:
scale_count: 5
Expand Down
10 changes: 10 additions & 0 deletions src/aiida_sssp_workflow/workflows/convergence/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,16 @@ def get_builder(
builder = super().get_builder()
builder.protocol = orm.Str(protocol)

# Set the default label and description
# The default label is set to be the base file name of PP
# The description include which configuration and which protocol is using.
builder.metadata.label = (
pseudo.filename if isinstance(pseudo, UpfData) else pseudo.name
)
builder.metadata.description = (
f"Run on protocol '{protocol}' and configuration '{configuration}'"
)

if isinstance(pseudo, Path):
builder.pseudo = UpfData.get_or_create(pseudo)
else:
Expand Down
4 changes: 2 additions & 2 deletions src/aiida_sssp_workflow/workflows/convergence/bands.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def prepare_evaluate_builder(self, ecutwfc, ecutrho):
builder.scf.pw["parameters"] = orm.Dict(scf_pw_parameters)
builder.scf.pw["parallelization"] = self.inputs.parallelization
builder.scf.pw["metadata"]["options"] = self.inputs.mpi_options.get_dict()
builder.scf.kpoints_distance = orm.Float(protocol["kpoints_distance_scf"])
builder.scf.kpoints_distance = orm.Float(protocol["kpoints_distance"])

# For band pw calculation
bands_pw_parameters = {
Expand All @@ -141,7 +141,7 @@ def prepare_evaluate_builder(self, ecutwfc, ecutrho):
builder.bands.pw["metadata"]["options"] = self.inputs.mpi_options.get_dict()

# Generic
builder.kpoints_distance_bands = orm.Float(protocol["kpoints_distance_bands"])
builder.kpoints_distance_bands = orm.Float(protocol["kpoints_distance"])
builder.init_nbands_factor = orm.Float(protocol["init_nbands_factor"])
builder.fermi_shift = orm.Float(protocol["fermi_shift"])
builder.run_band_structure = orm.Bool(False)
Expand Down
Loading

0 comments on commit fad95fc

Please sign in to comment.