Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move spin orbit to basic settings #984

Merged
merged 2 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
58 changes: 47 additions & 11 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,24 @@ 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>
<li>
The protocol to use for the calculation, which sets default
values balancing the accuracy and speed of the calculation
</li>
</ol>
</div>
"""),
ipw.HBox(
Expand All @@ -88,13 +113,24 @@ def render(self):
self.spin_type,
]
),
ipw.HTML("""
<div style="padding-top: 0px; padding-bottom: 0px">
<h4>Protocol</h4>
</div>
"""),
ipw.HTML("Select the protocol:", layout=ipw.Layout(flex="1 1 auto")),
self.protocol,
ipw.HBox(
children=[
ipw.Label(
"Spin-orbit coupling:",
layout=ipw.Layout(justify_content="flex-start", width="120px"),
),
self.spin_orbit,
]
),
ipw.HBox(
children=[
ipw.Label(
"Protocol:",
layout=ipw.Layout(justify_content="flex-start", width="120px"),
),
self.protocol,
]
),
ipw.HTML("""
<div style="line-height: 140%; padding-top: 6px; padding-bottom: 0px">
The "moderate" protocol represents a trade-off between accuracy and
Expand Down
1 change: 0 additions & 1 deletion src/aiidalab_qe/app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ def __init__(self, qe_auto_setup=True):
self._process_loading_message,
self._wizard_app_widget,
InAppGuide(identifier="post-guide", classes=["post-guide"]),
InAppGuide(children=[ipw.HTML("hello")], guide_id="general/basic"),
]
)

Expand Down
Loading