Skip to content

Commit

Permalink
Expose initial_nonco_angles to kkrimp workchains
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippRue committed Oct 30, 2023
1 parent 9c92f68 commit 0b383f3
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 5 deletions.
22 changes: 19 additions & 3 deletions aiida_kkr/workflows/imp_BdG.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -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')

Expand All @@ -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',
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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:
Expand Down
5 changes: 4 additions & 1 deletion aiida_kkr/workflows/kkr_imp.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ def define(cls, spec):
# 'kkrimp',
'options',
# 'wf_parameters',
'params_overwrite'
'params_overwrite',
'initial_noco_angles'
)
)

Expand Down Expand Up @@ -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)

Expand Down
10 changes: 9 additions & 1 deletion aiida_kkr/workflows/kkr_imp_dos.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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)

Expand Down
6 changes: 6 additions & 0 deletions aiida_kkr/workflows/kkr_imp_sub.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 0b383f3

Please sign in to comment.