diff --git a/README.md b/README.md index d93ca594..d7cfe58b 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,12 @@ This what we call it residual volume is therefore a stiffness-agnostic value tha In convergence delta factor calculation, the GS configurations from Cottiner's paper are used. To have a uniform sence of precision through looking at delta factor, the value is defined as delta factor per atom. However, since it is hard to define delta per/atom for oxides, ACWF does not use per/atom value to represent results. -To compatible with it, the precision verification also use the structure delta. +It uses the nu factor which was defined in the ACWF paper. + +For the oxides, it needs oxygen pseudopotential first, same as nitrides. +The verification needs to run for all know oxygen/nitrigen pseudopotentials filst. However, the cutoffs of them are not known and the cutoffs are input for the precision measure. +So the very first run is the convergence test on all oxygen/nitrigen pseudopotentials. +Once the recommended cutoffs are known, the precision measure can be run for all oxygen/nitrigen elements. ## Phonon frequencies specification @@ -187,4 +192,4 @@ MIT ## Contact -📧 email: jusong.yu@epfl.ch +📧 email: jusong.yu@psi.ch diff --git a/aiida_sssp_workflow/protocol/control.yml b/aiida_sssp_workflow/protocol/control.yml index 79d5795a..a43545bd 100644 --- a/aiida_sssp_workflow/protocol/control.yml +++ b/aiida_sssp_workflow/protocol/control.yml @@ -2,7 +2,6 @@ precheck: description: run on 150 v.s 200 v.s 300 Ry wavefunction cutoff with fix dual to give sense whether 200 Ry enough - # max_wfc: 0 # Not used if run precision measurement veri with this protocol, just raise exception. wfc_scan: [150, 200, 300] # at fix rho nc_dual_scan: [] # set empty so rho test not run nonnc_dual_scan: [] @@ -11,7 +10,6 @@ precheck: standard: description: high wavefunction cutoff set and cutoffs dense interval therefore time consuming - max_wfc: 200 # The max wfc cut for precision measurement wfc_scan: [30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 90, 100, 120, 150, 200] # at fix rho nc_dual_scan: [2.0, 2.5, 3.0, 3.5, 4.0] # at fix wfc nonnc_dual_scan: [6.0, 6.5, 7.0, 7.5, 8.0] @@ -20,7 +18,6 @@ standard: quick: description: low wavefunction cutoff set and cutoffs sparse interval therefore can run on local - max_wfc: 200 # The max wfc cut for precision measurement wfc_scan: [30, 40, 50, 60, 75, 100, 150, 200] # at fix rho nc_dual_scan: [3.0, 3.5, 4.0] # at fix wfc nonnc_dual_scan: [6.0, 7.0, 8.0] @@ -29,7 +26,6 @@ quick: test: description: test only - max_wfc: 35 # The max wfc cut for precision measurement wfc_scan: [30, 35] # at fix rho nc_dual_scan: [] # at fix wfc nonnc_dual_scan: [6.0, 8.0] @@ -38,7 +34,6 @@ test: opsp: description: To running opsp verification, make the calculations finished fast. - max_wfc: 40 # The max wfc cut for precision measurement wfc_scan: [30, 35] # at fix rho nc_dual_scan: [2.0, 4.0] # at fix wfc nonnc_dual_scan: [6.0, 8.0] diff --git a/aiida_sssp_workflow/workflows/measure/__init__.py b/aiida_sssp_workflow/workflows/measure/__init__.py index f992e677..4aa164e5 100644 --- a/aiida_sssp_workflow/workflows/measure/__init__.py +++ b/aiida_sssp_workflow/workflows/measure/__init__.py @@ -22,8 +22,8 @@ def define(cls, spec): help='Pseudopotential to be verified') spec.input('protocol', valid_type=orm.Str, required=True, help='The protocol which define input calculation parameters.') - spec.input('cutoff_control', valid_type=orm.Str, default=lambda: orm.Str('standard'), - help='The control protocol where define max_wfc.') + spec.input('wavefunction_cutoff', valid_type=orm.Float, required=True, help='The wavefunction cutoff.') + spec.input('charge_density_cutoff', valid_type=orm.Float, required=True, help='The charge density cutoff.') spec.input('options', valid_type=orm.Dict, required=True, help='Optional `options` to use for the `PwCalculations`.') spec.input('parallelization', valid_type=orm.Dict, required=True, diff --git a/aiida_sssp_workflow/workflows/measure/precision.py b/aiida_sssp_workflow/workflows/measure/precision.py index 6e0614da..8dca710b 100644 --- a/aiida_sssp_workflow/workflows/measure/precision.py +++ b/aiida_sssp_workflow/workflows/measure/precision.py @@ -42,6 +42,14 @@ class PrecisionMeasureWorkChain(_BaseMeasureWorkChain): _NBANDS_FACTOR_FOR_LAN = 1.5 + # ECUT for oxygen, remember to update this if the oxygen pseudo is changed + _O_ECUTWFC = 75.0 + _O_ECUTRHO = 600.0 + + # ECUT for nitrogen, remember to update this if the nitrogen pseudo is changed + _N_ECUTWFC = 80.0 + _N_ECUTRHO = 320.0 + @classmethod def define(cls, spec): """Define the process specification.""" @@ -135,6 +143,10 @@ def setup(self): self._setup_pseudo_and_configuration() + # set up the ecutwfc and ecutrho + self.ctx.ecutwfc = self.inputs.wavefunction_cutoff.value + self.ctx.ecutrho = self.inputs.charge_density_cutoff.value + def setup_pw_parameters_from_protocol(self): """Input validation""" # pylint: disable=invalid-name, attribute-defined-outside-init @@ -157,11 +169,6 @@ def setup_pw_parameters_from_protocol(self): if key not in clist: self.ctx.structures.pop(key) - cutoff_control = get_protocol( - category="control", name=self.inputs.cutoff_control.value - ) - self._ECUTWFC = cutoff_control["max_wfc"] - parameters = { "CONTROL": { "calculation": "scf", @@ -178,8 +185,6 @@ def setup_pw_parameters_from_protocol(self): }, } - self.ctx.ecutwfc = self._ECUTWFC - self.ctx.pw_parameters = update_dict(self.ctx.pw_parameters, parameters) self.logger.info(f"The pw parameters for EOS step is: {self.ctx.pw_parameters}") @@ -223,7 +228,8 @@ def _get_inputs(self, structure, configuration): kpoints_distance = self.ctx.kpoints_distance # Since non-NC oxygen pseudo is used - ecutrho = self.ctx.ecutwfc * 8 + ecutwfc = max(self.ctx.ecutwfc, self._O_ECUTWFC) + ecutrho = max(self.ctx.ecutrho, self._O_ECUTRHO) # need also increase nbands for Rare-earth oxides. # See https://github.com/aiidateam/aiida-sssp-workflow/issues/161 @@ -249,10 +255,9 @@ def _get_inputs(self, structure, configuration): pseudos = self.ctx.pseudos_unary pw_parameters = self.ctx.pw_parameters kpoints_distance = self.ctx.kpoints_distance - if pseudo_type in ["nc", "sl"]: - ecutrho = self.ctx.ecutwfc * 4 - else: - ecutrho = self.ctx.ecutwfc * 8 + + ecutwfc = self.ctx.ecutwfc + ecutrho = self.ctx.ecutrho if configuration == "GS" and self.ctx.element in MAGNETIC_ELEMENTS: # specific setting for magnetic elements gs since mag on @@ -272,10 +277,8 @@ def _get_inputs(self, structure, configuration): pseudos = self.ctx.pseudos_magnetic pw_parameters = update_dict(self.ctx.pw_parameters, pw_magnetic_parameters) - if pseudo_type in ["nc", "sl"]: - ecutrho = self.ctx.ecutwfc * 4 - else: - ecutrho = self.ctx.ecutwfc * 8 + ecutwfc = self.ctx.ecutwfc + ecutrho = self.ctx.ecutrho if configuration == "RE": # pseudos for nitrides