From 0b383f3d5e0ebbbf36bd4eca69feafbbd43a3515 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20R=C3=BC=C3=9Fmann?= Date: Mon, 30 Oct 2023 14:33:33 +0000 Subject: [PATCH] Expose initial_nonco_angles to kkrimp workchains --- aiida_kkr/workflows/imp_BdG.py | 22 +++++++++++++++++++--- aiida_kkr/workflows/kkr_imp.py | 5 ++++- aiida_kkr/workflows/kkr_imp_dos.py | 10 +++++++++- aiida_kkr/workflows/kkr_imp_sub.py | 6 ++++++ 4 files changed, 38 insertions(+), 5 deletions(-) diff --git a/aiida_kkr/workflows/imp_BdG.py b/aiida_kkr/workflows/imp_BdG.py index 872a0be6..f50bdc47 100644 --- a/aiida_kkr/workflows/imp_BdG.py +++ b/aiida_kkr/workflows/imp_BdG.py @@ -144,7 +144,7 @@ def define(cls, spec): spec.expose_inputs( kkr_imp_wc, namespace='imp_scf', - include=('startpot', 'wf_parameters', 'gf_writeout', 'scf.params_overwrite') + include=('startpot', 'wf_parameters', 'gf_writeout', 'scf.params_overwrite', 'scf.initial_noco_angles') ) spec.inputs['imp_scf']['gf_writeout']['kkr'].required = False spec.input('imp_scf.options', required=False, help='computer options for impurity scf step') @@ -157,7 +157,11 @@ def define(cls, spec): ) # inputs for impurity BdG scf - spec.expose_inputs(kkr_imp_wc, namespace='BdG_scf', include=('startpot', 'remote_data_gf', 'gf_writeout')) + spec.expose_inputs( + kkr_imp_wc, + namespace='BdG_scf', + include=('startpot', 'remote_data_gf', 'gf_writeout', 'scf.initial_noco_angles') + ) spec.inputs['BdG_scf']['gf_writeout']['kkr'].required = False spec.input('BdG_scf.options', required=False, help='computer options for BdG impurity scf step') @@ -166,7 +170,11 @@ def define(cls, spec): ) # inputs for impurity dos - spec.expose_inputs(kkr_imp_dos_wc, namespace='dos', include=('wf_parameters', 'gf_dos_remote', 'gf_writeout')) + spec.expose_inputs( + kkr_imp_dos_wc, + namespace='dos', + include=('wf_parameters', 'gf_dos_remote', 'gf_writeout', 'initial_noco_angles') + ) spec.input( 'dos.gf_writeout.host_remote', @@ -275,6 +283,8 @@ def imp_pot_calc(self): builder.options = self.inputs.imp_scf.options else: builder.options = self.inputs.options + if 'initial_noco_angles' in self.inputs.imp_scf: + builder.scf.initial_noco_angles = self.inputs.imp_scf.initial_noco_angles if 'gf_writeout' in self.inputs.imp_scf: if 'options' in self.inputs.imp_scf.gf_writeout: @@ -319,6 +329,8 @@ def imp_BdG_calc(self): builder.params_kkr_overwrite = self.inputs.BdG_scf.gf_writeout.params_kkr_overwrite if 'kkr' in self.inputs: builder.gf_writeout.kkr = builder.kkr # pylint: disable=no-member + if 'initial_noco_angles' in self.inputs.BdG_scf: + builder.scf.initial_noco_angles = self.inputs.BdG_scf.initial_noco_angles builder.remote_data_host = self.inputs.BdG_scf.remote_data_host @@ -384,6 +396,10 @@ def DOS_calc(self): else: builder.options = self.inputs.options + # set nonco angles + if 'initial_noco_angles' in self.inputs.dos: + builder.initial_noco_angles = self.inputs.dos.initial_noco_angles + # skip BdG step and just use the starting potential instead? # faster and same accuracy?! if 'startpot' in self.inputs.BdG_scf: diff --git a/aiida_kkr/workflows/kkr_imp.py b/aiida_kkr/workflows/kkr_imp.py index 6ae94ed0..5be8edcf 100644 --- a/aiida_kkr/workflows/kkr_imp.py +++ b/aiida_kkr/workflows/kkr_imp.py @@ -101,7 +101,8 @@ def define(cls, spec): # 'kkrimp', 'options', # 'wf_parameters', - 'params_overwrite' + 'params_overwrite', + 'initial_noco_angles' ) ) @@ -793,6 +794,8 @@ def run_kkrimp_scf(self): builder.params_overwrite = self.inputs.scf.params_overwrite if 'options' in self.inputs.scf: builder.options = self.inputs.scf.options + if 'initial_noco_angles' in self.inputs.scf: + builder.initial_noco_angles = self.inputs.scf.initial_noco_angles builder.wf_parameters = kkrimp_params future = self.submit(builder) diff --git a/aiida_kkr/workflows/kkr_imp_dos.py b/aiida_kkr/workflows/kkr_imp_dos.py index 2600ae0e..6a129d10 100644 --- a/aiida_kkr/workflows/kkr_imp_dos.py +++ b/aiida_kkr/workflows/kkr_imp_dos.py @@ -21,9 +21,12 @@ __copyright__ = (u'Copyright (c), 2019, Forschungszentrum Jülich GmbH, ' 'IAS-1/PGI-1, Germany. All rights reserved.') __license__ = 'MIT license, see LICENSE.txt file' -__version__ = '0.6.13' +__version__ = '0.6.14' __contributors__ = (u'Fabian Bertoldo', u'Philipp Rüßmann') +# activate verbose output, for debugging only +_VERBOSE_ = True + #TODO: improve workflow output node structure #TODO: generalise search for imp_info and conv_host from startpot @@ -148,6 +151,7 @@ def define(cls, spec): ) spec.expose_inputs(kkr_imp_sub_wc, namespace='BdG', include=('params_overwrite')) + spec.expose_inputs(kkr_imp_sub_wc, include=('initial_noco_angles')) spec.expose_inputs(kkr_flex_wc, namespace='gf_writeout', include=('params_kkr_overwrite', 'options')) # specify the outputs @@ -206,6 +210,8 @@ def start(self): """ self.report(f'INFO: started KKR impurity DOS workflow version {self._workflowversion}') + if _VERBOSE_: + self.report(f'inputs: {self.inputs}') # input both wf and options parameters if 'wf_parameters' in self.inputs: @@ -523,6 +529,8 @@ def run_imp_dos(self): if 'params_overwrite' in self.inputs.BdG: builder.params_overwrite = self.inputs.BdG.params_overwrite + if 'initial_noco_angles' in self.inputs: + builder.initial_noco_angles = self.inputs.initial_noco_angles future = self.submit(builder) diff --git a/aiida_kkr/workflows/kkr_imp_sub.py b/aiida_kkr/workflows/kkr_imp_sub.py index ba80eb8a..02864c80 100644 --- a/aiida_kkr/workflows/kkr_imp_sub.py +++ b/aiida_kkr/workflows/kkr_imp_sub.py @@ -132,6 +132,8 @@ def define(cls, spec): help='Dict of parameters that are given to the KKRimpCalculation. Overwrites automatically set values!' ) + spec.expose_inputs(KkrimpCalculation, include=('initial_noco_angles')) + # Here the structure of the workflow is defined spec.outline( cls.start, @@ -862,6 +864,10 @@ def run_kkrimp(self): if int(aiida_core_version.split('.')[0]) < 2 and self.ctx.do_final_cleanup: inputs['cleanup_outfiles'] = Bool(self.ctx.do_final_cleanup) + # set nonco angles if given + if 'initial_noco_angles' in self.inputs: + inputs['initial_noco_angles'] = self.inputs.initial_noco_angles + # run the KKR calculation message = 'INFO: doing calculation' self.report(message)