From 07339ed0b961b0a1861aae48120f27233b9f3947 Mon Sep 17 00:00:00 2001 From: AntimoMarrazzo Date: Tue, 5 Feb 2019 10:38:53 +0100 Subject: [PATCH] added manual input option for random proj --- .../workflows/W90.py | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/aiida_wannier90_theosworkflows/workflows/W90.py b/aiida_wannier90_theosworkflows/workflows/W90.py index 6f5fcee..4c169e8 100644 --- a/aiida_wannier90_theosworkflows/workflows/W90.py +++ b/aiida_wannier90_theosworkflows/workflows/W90.py @@ -255,7 +255,12 @@ def setup(self):# pylint: disable=too-many-statements; # noqa: MC0001 ) self.report("SCDM mu is auto-set using projectability.") - + try: + self.ctx.random_projections = control_dict['random_projections'] + if self.ctx.random_projections: + self.report("projections override: set to random from input.") + except KeyError: + self.ctx.random_projections = False # We expect either a KpointsData with given mesh or a desired distance between k-points # if all([key not in self.inputs for key in ['kpoints_mesh', 'kpoints_distance']]): @@ -461,7 +466,7 @@ def run_wannier90_pp(self): # pylint: disable=inconsistent-return-statements,too inputs['kpoints'] = self.ctx.workchain_nscf.inp.kpoints structure = self.inputs.structure inputs['structure'] = structure - inputs['settings'] = ParameterData(dict={'postproc_setup': True}) + wannier_pp_options = inputs.pop('pp_options', None) inputs.pop('options', None) #Need to pop it ! @@ -504,6 +509,13 @@ def run_wannier90_pp(self): # pylint: disable=inconsistent-return-statements,too self.abort_nowait( 'WARNING: set_mu_and_sigma_from_projection failed!') inputs['parameters'] = results['output_parameters'] + + settings_dict_pp = {'postproc_setup': True} + + if self.ctx.random_projections: + settings_dict_pp['random_projections'] = True + + inputs['settings'] = ParameterData(dict=settings_dict_pp) self.ctx.bands_plot = bands_plot if bands_plot: @@ -620,6 +632,12 @@ def run_wannier90(self): # pylint:disable=inconsistent-return-statements,too-man settings = inputs['settings'] except KeyError: settings = None + + if self.ctx.random_projections: + if settings is not None: + settings['random_projections'] = True + else: + settings = {'random_projections':True} #Check if the hamiltonian needs to be retrieved or not if self.ctx.retrieve_ham: if settings is None: