Skip to content

Commit

Permalink
Move spin-orbit to basic settings
Browse files Browse the repository at this point in the history
  • Loading branch information
edan-bainglass committed Dec 18, 2024
1 parent 64f5e6a commit fa65a02
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 32 deletions.
20 changes: 0 additions & 20 deletions src/aiidalab_qe/app/configuration/advanced/advanced.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down Expand Up @@ -335,7 +316,6 @@ def render(self):
]
),
self.hubbard,
self.spin_orbit,
self.pseudos,
]

Expand Down
10 changes: 2 additions & 8 deletions src/aiidalab_qe/app/configuration/advanced/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down
8 changes: 8 additions & 0 deletions src/aiidalab_qe/app/configuration/basic/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
38 changes: 34 additions & 4 deletions src/aiidalab_qe/app/configuration/basic/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -64,10 +75,20 @@ def render(self):
InAppGuide(identifier="basic-settings"),
ipw.HTML("""
<div style="line-height: 140%; padding-top: 10px; padding-bottom: 10px">
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:
<ol>
<li>
If the material should be treated as an insulator or a metal
(if in doubt, choose "Metal")
</li>
<li>
If the material should be studied with magnetization/spin
polarization (at least twice as costly if activated)
</li>
<li>
If the material should be studied with spin-orbit coupling
</li>
</ol>
</div>
"""),
ipw.HBox(
Expand All @@ -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("""
<div style="padding-top: 0px; padding-bottom: 0px">
<h4>Protocol</h4>
Expand Down

0 comments on commit fa65a02

Please sign in to comment.