diff --git a/2022_05_Trieste/DAY3_PM_2_AiiDA/CsH.xsf b/2022_05_Trieste/DAY3_PM_2_AiiDA/CsH.xsf new file mode 100644 index 0000000..e4b6d41 --- /dev/null +++ b/2022_05_Trieste/DAY3_PM_2_AiiDA/CsH.xsf @@ -0,0 +1,10 @@ +CRYSTAL +PRIMVEC 1 + 0.0000000000 3.2005628444 3.2005628444 + 3.2005628444 0.0000000000 3.2005628444 + 3.2005628444 3.2005628444 0.0000000000 +PRIMCOORD 1 +2 1 +55 3.2005628444 0.0000000000 0.0000000000 +1 0.0000000000 0.0000000000 0.0000000000 + diff --git a/2022_05_Trieste/DAY3_PM_2_AiiDA/README b/2022_05_Trieste/DAY3_PM_2_AiiDA/README new file mode 100644 index 0000000..99cbaa4 --- /dev/null +++ b/2022_05_Trieste/DAY3_PM_2_AiiDA/README @@ -0,0 +1,2 @@ +See the tutorial text here +https://aiida-wannier90-workflows.readthedocs.io/en/latest/user_guide/get_started/scdm/scdm.html diff --git a/2022_05_Trieste/DAY3_PM_2_AiiDA/launch_pwbands.py b/2022_05_Trieste/DAY3_PM_2_AiiDA/launch_pwbands.py new file mode 100755 index 0000000..5ef3b2c --- /dev/null +++ b/2022_05_Trieste/DAY3_PM_2_AiiDA/launch_pwbands.py @@ -0,0 +1,49 @@ +#!/usr/bin/env runaiida +import os +import sys + +from ase.io import read as aseread + +from aiida import orm +from aiida.engine import submit + +from aiida_quantumespresso.workflows.pw.bands import PwBandsWorkChain + +# Code labels for `pw.x` +# Change these according to your aiida setup. +code = "qe-pw-6.8@localhost" + +# Filename of a structure. +# filename = "GaAs.xsf" +if len(sys.argv) != 2: + print(f"Please pass a filename for a structure as the argument.") + sys.exit(1) +filename = sys.argv[1] +if not os.path.exists(filename): + print(f"{filename} not existed!") + sys.exit(1) + +# Read a structure file and store as an `orm.StructureData`. +structure = orm.StructureData(ase=aseread(filename)) +structure.store() +print(f"Read and stored structure {structure.get_formula()}<{structure.pk}>") + +# Prepare the builder to launch the workchain. +# We use fast protocol to converge faster. +builder = PwBandsWorkChain.get_builder_from_protocol( + code, + structure, + protocol="fast", +) +builder.pop("relax", None) + +# Submit the workchain. +workchain = submit(builder) +print(f"Submitted {workchain.process_label}<{workchain.pk}>") + +print( + "Run any of these commands to check the progress:\n" + f"verdi process report {workchain.pk}\n" + f"verdi process show {workchain.pk}\n" + "verdi process list\n" +) diff --git a/2022_05_Trieste/DAY3_PM_2_AiiDA/launch_wannier.py b/2022_05_Trieste/DAY3_PM_2_AiiDA/launch_wannier.py new file mode 100755 index 0000000..a4a3bf8 --- /dev/null +++ b/2022_05_Trieste/DAY3_PM_2_AiiDA/launch_wannier.py @@ -0,0 +1,53 @@ +#!/usr/bin/env runaiida +import os +import sys + +from ase.io import read as aseread + +from aiida import orm +from aiida.engine import submit + +from aiida_wannier90_workflows.workflows import Wannier90BandsWorkChain + +# Code labels for `pw.x`, `pw2wannier90.x`, `projwfc.x`, and `wannier90.x`. +# Change these according to your aiida setup. +codes = { + "pw": "qe-pw-6.8@localhost", + "projwfc": "qe-projwfc-6.8@localhost", + "pw2wannier90": "qe-pw2wannier90-6.8@localhost", + "wannier90": "wannier90-3.1@localhost", +} + +# Filename of a structure. +# filename = "GaAs.xsf" +if len(sys.argv) != 2: + print(f"Please pass a filename for a structure as the argument.") + sys.exit(1) +filename = sys.argv[1] +if not os.path.exists(filename): + print(f"{filename} not existed!") + sys.exit(1) + +# Read a structure file and store as an `orm.StructureData`. +structure = orm.StructureData(ase=aseread(filename)) +structure.store() +print(f"Read and stored structure {structure.get_formula()}<{structure.pk}>") + +# Prepare the builder to launch the workchain. +# We use fast protocol to converge faster. +builder = Wannier90BandsWorkChain.get_builder_from_protocol( + codes, + structure, + protocol="fast", +) + +# Submit the workchain. +workchain = submit(builder) +print(f"Submitted {workchain.process_label}<{workchain.pk}>") + +print( + "Run any of these commands to check the progress:\n" + f"verdi process report {workchain.pk}\n" + f"verdi process show {workchain.pk}\n" + "verdi process list\n" +)