Skip to content

Commit

Permalink
PwBandsWorkChain: Move inputs to protocol
Browse files Browse the repository at this point in the history
Several "default" inputs of the `PwBandsWorkChain` are set inside one of
the steps of the work chain, which:

1. Can be confusing for the user, since the expected inputs are not
there in the input files.
2. Can be frustrating for the user when a different value is desirable,
for a use case that may not immediately be obvious.
3. Means default values are specified _both_ in the work chain logic and
protocol, making it more difficult to get a clear overview of the input
parameters.

Here we move the specification of the default inputs to the protocol
file of the `PwBandsWorkChain` (`bands.yaml`).

Since the default protocol now correctly sets the calculation type to
`bands`, the `validate_inputs` validator of the `PwCalculation` will
raise a warning because a `parent_folder` has not been initially
provided. Hence, we set the `validate_inputs_base` validator for the
`pw` port of the `bands` namespace, as is also done for e.g. the
`nscf` of the `PdosWorkchain`.

Finally, we switch to using 2 spaces for the indentation of the protocol
YAML files to make them easier to read.
  • Loading branch information
mbercx committed Apr 6, 2023
1 parent 2875116 commit 8ebeb75
Show file tree
Hide file tree
Showing 9 changed files with 235 additions and 227 deletions.
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
default_inputs:
SYSTEM:
tot_charge: 1
SYSTEM:
tot_charge: 1
default_treatment: full
treatments:
full:
description: 'Core-hole treatment using a formal countercharge of +1, equivalent to removing one electron from the system.'
half:
description: 'Core-hole treatment using a formal countercharge of +0.5, equivalent to removing half an electron from the system.'
SYSTEM:
tot_charge: 0.5
xch_fixed:
description: 'Core-hole treatment which places the excited electron into the conduction band (fixed occupations).'
SYSTEM:
occupations: fixed
tot_charge: 0
nspin: 2
tot_magnetization: 1
xch_smear:
description: 'Core-hole treatment which places the excited electron into the conduction band (smeared occupations).'
SYSTEM:
occupations: smearing
tot_charge: 0
nspin: 2
starting_magnetization(1): 0
none:
description: 'Applies no core-hole treatment (overrides the default tot_charge and changes it to 0).'
SYSTEM:
tot_charge: 0
full:
description: 'Core-hole treatment using a formal countercharge of +1, equivalent to removing one electron from the system.'
half:
description: 'Core-hole treatment using a formal countercharge of +0.5, equivalent to removing half an electron from the system.'
SYSTEM:
tot_charge: 0.5
xch_fixed:
description: 'Core-hole treatment which places the excited electron into the conduction band (fixed occupations).'
SYSTEM:
occupations: fixed
tot_charge: 0
nspin: 2
tot_magnetization: 1
xch_smear:
description: 'Core-hole treatment which places the excited electron into the conduction band (smeared occupations).'
SYSTEM:
occupations: smearing
tot_charge: 0
nspin: 2
starting_magnetization(1): 0
none:
description: 'Applies no core-hole treatment (overrides the default tot_charge and changes it to 0).'
SYSTEM:
tot_charge: 0
122 changes: 61 additions & 61 deletions src/aiida_quantumespresso/workflows/protocols/pdos.yaml
Original file line number Diff line number Diff line change
@@ -1,65 +1,65 @@
default_inputs:
clean_workdir: True
scf:
pw:
parameters:
CONTROL:
restart_mode: from_scratch
clean_workdir: True
scf:
pw:
parameters:
CONTROL:
restart_mode: from_scratch
nscf:
kpoints_distance: 0.10
pw:
parameters:
CONTROL:
calculation: nscf
restart_mode: from_scratch
SYSTEM:
occupations: tetrahedra
nosym: True
dos:
parameters:
DOS:
DeltaE: 0.02
metadata:
options:
resources:
num_machines: 1
max_wallclock_seconds: 43200 # Twelve hours
withmpi: True
projwfc:
parameters:
PROJWFC:
DeltaE: 0.02
metadata:
options:
resources:
num_machines: 1
max_wallclock_seconds: 43200 # Twelve hours
withmpi: True
default_protocol: moderate
protocols:
moderate:
description: 'Protocol to perform a projected density of states calculation at normal precision at moderate computational cost.'
precise:
description: 'Protocol to perform a projected density of states structure calculation at high precision at higher computational cost.'
dos:
parameters:
DOS:
DeltaE: 0.01
projwfc:
parameters:
PROJWFC:
DeltaE: 0.01
nscf:
kpoints_distance: 0.10
pw:
parameters:
CONTROL:
calculation: nscf
restart_mode: from_scratch
SYSTEM:
occupations: tetrahedra
nosym: True
kpoints_distance: 0.05
fast:
description: 'Protocol to perform a projected density of states structure calculation at low precision at minimal computational cost for testing purposes.'
dos:
parameters:
DOS:
DeltaE: 0.02
metadata:
options:
resources:
num_machines: 1
max_wallclock_seconds: 43200 # Twelve hours
withmpi: True
parameters:
DOS:
DeltaE: 0.1
projwfc:
parameters:
PROJWFC:
DeltaE: 0.02
metadata:
options:
resources:
num_machines: 1
max_wallclock_seconds: 43200 # Twelve hours
withmpi: True
default_protocol: moderate
protocols:
moderate:
description: 'Protocol to perform a projected density of states calculation at normal precision at moderate computational cost.'
precise:
description: 'Protocol to perform a projected density of states structure calculation at high precision at higher computational cost.'
dos:
parameters:
DOS:
DeltaE: 0.01
projwfc:
parameters:
PROJWFC:
DeltaE: 0.01
nscf:
kpoints_distance: 0.05
fast:
description: 'Protocol to perform a projected density of states structure calculation at low precision at minimal computational cost for testing purposes.'
dos:
parameters:
DOS:
DeltaE: 0.1
projwfc:
parameters:
PROJWFC:
DeltaE: 0.1
nscf:
kpoints_distance: 0.5
parameters:
PROJWFC:
DeltaE: 0.1
nscf:
kpoints_distance: 0.5
66 changes: 33 additions & 33 deletions src/aiida_quantumespresso/workflows/protocols/ph/base.yaml
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
default_inputs:
clean_workdir: True
ph:
metadata:
options:
resources:
num_machines: 1
max_wallclock_seconds: 43200 # Twelve hours
withmpi: True
parameters:
INPUTPH:
tr2_ph: 1.0e-18
qpoints:
- 3
- 3
- 3
clean_workdir: True
ph:
metadata:
options:
resources:
num_machines: 1
max_wallclock_seconds: 43200 # Twelve hours
withmpi: True
parameters:
INPUTPH:
tr2_ph: 1.0e-18
qpoints:
- 3
- 3
- 3
default_protocol: moderate
protocols:
moderate:
description: 'Protocol to perform the computation at normal precision at moderate computational cost.'
precise:
description: 'Protocol to perform the computation at high precision at higher computational cost.'
ph:
parameters:
INPUTPH:
tr2_ph: 1.0e-20
fast:
description: 'Protocol to perform the computation at low precision at minimal computational cost for testing purposes.'
ph:
parameters:
INPUTPH:
tr2_ph: 1.0e-16
qpoints:
- 2
- 2
- 2
moderate:
description: 'Protocol to perform the computation at normal precision at moderate computational cost.'
precise:
description: 'Protocol to perform the computation at high precision at higher computational cost.'
ph:
parameters:
INPUTPH:
tr2_ph: 1.0e-20
fast:
description: 'Protocol to perform the computation at low precision at minimal computational cost for testing purposes.'
ph:
parameters:
INPUTPH:
tr2_ph: 1.0e-16
qpoints:
- 2
- 2
- 2
36 changes: 25 additions & 11 deletions src/aiida_quantumespresso/workflows/protocols/pw/bands.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,28 @@
default_inputs:
bands_kpoints_distance: 0.025
clean_workdir: True
nbands_factor: 3.0
bands_kpoints_distance: 0.025
clean_workdir: True
nbands_factor: 3.0
scf:
pw:
parameters:
CONTROL:
calculation: scf
bands:
pw:
parameters:
CONTROL:
calculation: bands
ELECTRONS:
diagonalization: paro
diago_full_acc: True

default_protocol: moderate
protocols:
moderate:
description: 'Protocol to perform a band structure calculation at normal precision at moderate computational cost.'
precise:
description: 'Protocol to perform a band structure calculation at high precision at higher computational cost.'
bands_kpoints_distance: 0.015
fast:
description: 'Protocol to perform a band structure calculation at low precision at minimal computational cost for testing purposes.'
bands_kpoints_distance: 0.1
moderate:
description: 'Protocol to perform a band structure calculation at normal precision at moderate computational cost.'
precise:
description: 'Protocol to perform a band structure calculation at high precision at higher computational cost.'
bands_kpoints_distance: 0.015
fast:
description: 'Protocol to perform a band structure calculation at low precision at minimal computational cost for testing purposes.'
bands_kpoints_distance: 0.1
102 changes: 51 additions & 51 deletions src/aiida_quantumespresso/workflows/protocols/pw/base.yaml
Original file line number Diff line number Diff line change
@@ -1,54 +1,54 @@
default_inputs:
clean_workdir: True
kpoints_distance: 0.15
kpoints_force_parity: False
meta_parameters:
conv_thr_per_atom: 0.2e-9
etot_conv_thr_per_atom: 1.e-5
pseudo_family: 'SSSP/1.2/PBEsol/efficiency'
pw:
metadata:
options:
resources:
num_machines: 1
max_wallclock_seconds: 43200 # Twelve hours
withmpi: True
parameters:
CONTROL:
calculation: scf
forc_conv_thr: 1.e-4
tprnfor: True
tstress: True
SYSTEM:
nosym: False
occupations: smearing
smearing: cold
degauss: 0.01
ELECTRONS:
electron_maxstep: 80
mixing_beta: 0.4
clean_workdir: True
kpoints_distance: 0.15
kpoints_force_parity: False
meta_parameters:
conv_thr_per_atom: 0.2e-9
etot_conv_thr_per_atom: 1.e-5
pseudo_family: 'SSSP/1.2/PBEsol/efficiency'
pw:
metadata:
options:
resources:
num_machines: 1
max_wallclock_seconds: 43200 # Twelve hours
withmpi: True
parameters:
CONTROL:
calculation: scf
forc_conv_thr: 1.e-4
tprnfor: True
tstress: True
SYSTEM:
nosym: False
occupations: smearing
smearing: cold
degauss: 0.01
ELECTRONS:
electron_maxstep: 80
mixing_beta: 0.4
default_protocol: moderate
protocols:
moderate:
description: 'Protocol to perform the computation at normal precision at moderate computational cost.'
precise:
description: 'Protocol to perform the computation at high precision at higher computational cost.'
kpoints_distance: 0.10
meta_parameters:
conv_thr_per_atom: 0.1e-9
etot_conv_thr_per_atom: 0.5e-5
pseudo_family: 'SSSP/1.2/PBEsol/precision'
pw:
parameters:
CONTROL:
forc_conv_thr: 0.5e-4
fast:
description: 'Protocol to perform the computation at low precision at minimal computational cost for testing purposes.'
kpoints_distance: 0.50
meta_parameters:
conv_thr_per_atom: 0.4e-9
etot_conv_thr_per_atom: 1.e-4
pw:
parameters:
CONTROL:
forc_conv_thr: 1.e-3
moderate:
description: 'Protocol to perform the computation at normal precision at moderate computational cost.'
precise:
description: 'Protocol to perform the computation at high precision at higher computational cost.'
kpoints_distance: 0.10
meta_parameters:
conv_thr_per_atom: 0.1e-9
etot_conv_thr_per_atom: 0.5e-5
pseudo_family: 'SSSP/1.2/PBEsol/precision'
pw:
parameters:
CONTROL:
forc_conv_thr: 0.5e-4
fast:
description: 'Protocol to perform the computation at low precision at minimal computational cost for testing purposes.'
kpoints_distance: 0.50
meta_parameters:
conv_thr_per_atom: 0.4e-9
etot_conv_thr_per_atom: 1.e-4
pw:
parameters:
CONTROL:
forc_conv_thr: 1.e-3
Loading

0 comments on commit 8ebeb75

Please sign in to comment.