Skip to content

Commit cbee896

Browse files
committed
Update tutorial
1 parent bdd7ce3 commit cbee896

File tree

13 files changed

+255
-215
lines changed

13 files changed

+255
-215
lines changed

aiida_wannier90_workflows/utils/workflows/plot.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ def plot_scdm_fit(workchain: int, save: bool = False):
8383

8484
formula = workchain.inputs.structure.get_formula()
8585

86-
w90calc = workchain.get_outgoing(link_label_filter="wannier90").one().node
86+
# w90calc = workchain.get_outgoing(link_label_filter="wannier90").one().node
87+
w90calc = workchain.outputs.wannier90.remote_folder.creator
8788
p2w_workchain = workchain.get_outgoing(link_label_filter="pw2wannier90").one().node
8889
p2wcalc = get_last_calcjob(p2w_workchain)
8990
projcalc = workchain.get_outgoing(link_label_filter="projwfc").one().node
@@ -104,7 +105,8 @@ def plot_scdm_fit(workchain: int, save: bool = False):
104105
# check the fitting are consistent
105106
eps = 1e-6
106107
assert abs(sigma - sigma_fit) < eps
107-
sigma_factor = workchain.inputs.scdm_sigma_factor.value
108+
# sigma_factor = workchain.inputs.scdm_sigma_factor.value
109+
sigma_factor = 3
108110
assert abs(mu - (mu_fit - sigma_fit * sigma_factor)) < eps
109111
sorted_bands = data[0, :]
110112
sorted_projwfc = data[1, :]
-1.13 MB
Binary file not shown.
Binary file not shown.
1.14 MB
Loading
83 KB
Loading
75.7 KB
Loading
4.4 KB
Loading
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#!/usr/bin/env runaiida
2+
import os
3+
import sys
4+
5+
from ase.io import read as aseread
6+
7+
from aiida import orm
8+
from aiida.engine import submit
9+
10+
from aiida_quantumespresso.workflows.pw.bands import PwBandsWorkChain
11+
12+
# Code labels for `pw.x`
13+
# Change these according to your aiida setup.
14+
code = "qe-pw-6.8@localhost"
15+
16+
# Filename of a structure.
17+
# filename = "GaAs.xsf"
18+
if len(sys.argv) != 2:
19+
print(f"Please pass a filename for a structure as the argument.")
20+
sys.exit(1)
21+
filename = sys.argv[1]
22+
if not os.path.exists(filename):
23+
print(f"{filename} not existed!")
24+
sys.exit(1)
25+
26+
# Read a structure file and store as an `orm.StructureData`.
27+
structure = orm.StructureData(ase=aseread(filename))
28+
structure.store()
29+
print(f"Read and stored structure {structure.get_formula()}<{structure.pk}>")
30+
31+
# Prepare the builder to launch the workchain.
32+
# We use fast protocol to converge faster.
33+
builder = PwBandsWorkChain.get_builder_from_protocol(
34+
code,
35+
structure,
36+
protocol="fast",
37+
)
38+
builder.pop("relax", None)
39+
40+
# Submit the workchain.
41+
workchain = submit(builder)
42+
print(f"Submitted {workchain.process_label}<{workchain.pk}>")
43+
44+
print(
45+
"Run any of these commands to check the progress:\n"
46+
f"verdi process report {workchain.pk}\n"
47+
f"verdi process show {workchain.pk}\n"
48+
"verdi process list\n"
49+
)

docs/source/user_guide/get_started/scdm/include/snippets/launch_workflow.py renamed to docs/source/user_guide/get_started/scdm/include/snippets/launch_wannier.py

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
#!/usr/bin/env runaiida
2+
import os
3+
import sys
4+
25
from ase.io import read as aseread
36

47
from aiida import orm
@@ -9,14 +12,21 @@
912
# Code labels for `pw.x`, `pw2wannier90.x`, `projwfc.x`, and `wannier90.x`.
1013
# Change these according to your aiida setup.
1114
codes = {
12-
"pw": "qe-7.0-pw@localhost",
13-
"projwfc": "qe-7.0-projwfc@localhost",
14-
"pw2wannier90": "qe-7.0-pw2wannier90@localhost",
15-
"wannier90": "wannier90-3.1-wannier90@localhost",
15+
"pw": "qe-pw-6.8@localhost",
16+
"projwfc": "qe-projwfc-6.8@localhost",
17+
"pw2wannier90": "qe-pw2wannier90-6.8@localhost",
18+
"wannier90": "wannier90-3.1@localhost",
1619
}
1720

1821
# Filename of a structure.
19-
filename = "GaAs.xsf"
22+
# filename = "GaAs.xsf"
23+
if len(sys.argv) != 2:
24+
print(f"Please pass a filename for a structure as the argument.")
25+
sys.exit(1)
26+
filename = sys.argv[1]
27+
if not os.path.exists(filename):
28+
print(f"{filename} not existed!")
29+
sys.exit(1)
2030

2131
# Read a structure file and store as an `orm.StructureData`.
2232
structure = orm.StructureData(ase=aseread(filename))
@@ -36,8 +46,8 @@
3646
print(f"Submitted {workchain.process_label}<{workchain.pk}>")
3747

3848
print(
39-
"Run any of these commands to check the progress:"
40-
"verdi process report {workchain.pk}"
41-
"verdi process show {workchain.pk}"
42-
"verdi process list"
49+
"Run any of these commands to check the progress:\n"
50+
f"verdi process report {workchain.pk}\n"
51+
f"verdi process show {workchain.pk}\n"
52+
"verdi process list\n"
4353
)

docs/source/user_guide/get_started/scdm/include/snippets/plot_projectabilities.py

Lines changed: 0 additions & 108 deletions
This file was deleted.

0 commit comments

Comments
 (0)