From fa65a02251ed855bbc01d40cedb9d93d15a9e5d4 Mon Sep 17 00:00:00 2001 From: Edan Bainglass Date: Tue, 17 Dec 2024 05:58:02 +0000 Subject: [PATCH] Move spin-orbit to basic settings --- .../app/configuration/advanced/advanced.py | 20 ---------- .../app/configuration/advanced/model.py | 10 +---- .../app/configuration/basic/model.py | 8 ++++ .../app/configuration/basic/workflow.py | 38 +++++++++++++++++-- 4 files changed, 44 insertions(+), 32 deletions(-) diff --git a/src/aiidalab_qe/app/configuration/advanced/advanced.py b/src/aiidalab_qe/app/configuration/advanced/advanced.py index c675b4d83..bbae0f96a 100644 --- a/src/aiidalab_qe/app/configuration/advanced/advanced.py +++ b/src/aiidalab_qe/app/configuration/advanced/advanced.py @@ -253,25 +253,6 @@ def render(self): lambda override: not override, ) - # Spin-Orbit calculation - self.spin_orbit = ipw.ToggleButtons( - description="Spin-Orbit:", - style={"description_width": "initial"}, - ) - ipw.dlink( - (self._model, "spin_orbit_options"), - (self.spin_orbit, "options"), - ) - ipw.link( - (self._model, "spin_orbit"), - (self.spin_orbit, "value"), - ) - ipw.dlink( - (self._model, "override"), - (self.spin_orbit, "disabled"), - lambda override: not override, - ) - self.pseudos.render() self.children = [ @@ -335,7 +316,6 @@ def render(self): ] ), self.hubbard, - self.spin_orbit, self.pseudos, ] diff --git a/src/aiidalab_qe/app/configuration/advanced/model.py b/src/aiidalab_qe/app/configuration/advanced/model.py index 745165887..e955a04fd 100644 --- a/src/aiidalab_qe/app/configuration/advanced/model.py +++ b/src/aiidalab_qe/app/configuration/advanced/model.py @@ -37,11 +37,13 @@ class AdvancedConfigurationSettingsModel( "workchain.protocol", "workchain.spin_type", "workchain.electronic_type", + "workchain.spin_orbit", ] protocol = tl.Unicode() spin_type = tl.Unicode() electronic_type = tl.Unicode() + spin_orbit = tl.Unicode() clean_workdir = tl.Bool(False) override = tl.Bool(False) @@ -58,14 +60,6 @@ class AdvancedConfigurationSettingsModel( ], ) van_der_waals = tl.Unicode(DEFAULT["advanced"]["vdw_corr"]) - spin_orbit_options = tl.List( - trait=tl.List(tl.Unicode()), - default_value=[ - ["Off", "wo_soc"], - ["On", "soc"], - ], - ) - spin_orbit = tl.Unicode("wo_soc") forc_conv_thr = tl.Float(0.0) forc_conv_thr_step = tl.Float(1e-4) etot_conv_thr = tl.Float(0.0) diff --git a/src/aiidalab_qe/app/configuration/basic/model.py b/src/aiidalab_qe/app/configuration/basic/model.py index ffc7690f4..06771bf06 100644 --- a/src/aiidalab_qe/app/configuration/basic/model.py +++ b/src/aiidalab_qe/app/configuration/basic/model.py @@ -39,6 +39,14 @@ class BasicConfigurationSettingsModel(ConfigurationSettingsModel): ], ) electronic_type = tl.Unicode(DEFAULT["workchain"]["electronic_type"]) + spin_orbit_options = tl.List( + trait=tl.List(tl.Unicode()), + default_value=[ + ["Off", "wo_soc"], + ["On", "soc"], + ], + ) + spin_orbit = tl.Unicode("wo_soc") include = True diff --git a/src/aiidalab_qe/app/configuration/basic/workflow.py b/src/aiidalab_qe/app/configuration/basic/workflow.py index c58084957..f518784bd 100644 --- a/src/aiidalab_qe/app/configuration/basic/workflow.py +++ b/src/aiidalab_qe/app/configuration/basic/workflow.py @@ -49,6 +49,17 @@ def render(self): (self.electronic_type, "value"), ) + # Spin-Orbit calculation + self.spin_orbit = ipw.ToggleButtons(style={"description_width": "initial"}) + ipw.dlink( + (self._model, "spin_orbit_options"), + (self.spin_orbit, "options"), + ) + ipw.link( + (self._model, "spin_orbit"), + (self.spin_orbit, "value"), + ) + # Work chain protocol self.protocol = ipw.ToggleButtons() ipw.dlink( @@ -64,10 +75,20 @@ def render(self): InAppGuide(identifier="basic-settings"), ipw.HTML("""
- Below you can indicate both if the material should be treated as an - insulator or a metal (if in doubt, choose "Metal"), and if it - should be studied with magnetization/spin polarization, switch - magnetism On or Off (On is at least twice more costly). + Below you can indicate the following: +
    +
  1. + If the material should be treated as an insulator or a metal + (if in doubt, choose "Metal") +
  2. +
  3. + If the material should be studied with magnetization/spin + polarization (at least twice as costly if activated) +
  4. +
  5. + If the material should be studied with spin-orbit coupling +
  6. +
"""), ipw.HBox( @@ -88,6 +109,15 @@ def render(self): self.spin_type, ] ), + ipw.HBox( + children=[ + ipw.Label( + "Spin-orbit coupling:", + layout=ipw.Layout(justify_content="flex-start", width="120px"), + ), + self.spin_orbit, + ] + ), ipw.HTML("""

Protocol