From 2adf0335291b452d41ee9282ef13ed21f47cebc8 Mon Sep 17 00:00:00 2001 From: AndresOrtegaGuerrero <34098967+AndresOrtegaGuerrero@users.noreply.github.com> Date: Thu, 19 Oct 2023 11:08:20 +0200 Subject: [PATCH] `PwBaseWorkChain`: Pop `starting_magnetization if `tot_magnetization` is defined (#972) As stated in the documentation of Quantum ESPRESSO: https://www.quantum-espresso.org/Doc/INPUT_PW.html#idm299 --- src/aiida_quantumespresso/workflows/pw/base.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/aiida_quantumespresso/workflows/pw/base.py b/src/aiida_quantumespresso/workflows/pw/base.py index 4c31dc292..cfea4d4a9 100644 --- a/src/aiida_quantumespresso/workflows/pw/base.py +++ b/src/aiida_quantumespresso/workflows/pw/base.py @@ -198,6 +198,10 @@ def get_builder_from_protocol( parameter_overrides = overrides.get('pw', {}).get('parameters', {}) parameters = recursive_merge(parameters, parameter_overrides) + # if tot_magnetization in overrides , remove starting_magnetization from parameters + if parameters.get('SYSTEM', {}).get('tot_magnetization') is not None: + parameters.setdefault('SYSTEM', {}).pop('starting_magnetization', None) + pseudos_overrides = overrides.get('pw', {}).get('pseudos', {}) pseudos = recursive_merge(pseudos, pseudos_overrides)