From 3a90780c55242b19ea51e09a6a3d6701fe2c4fe5 Mon Sep 17 00:00:00 2001 From: Anton Domnin Date: Wed, 31 Jul 2024 03:45:26 +0300 Subject: [PATCH 1/3] First iteration of new metallic scheme --- mpds_aiida/calc_templates/ext_metallic.yml | 126 +++++++++++++++++++++ scripts/aiida_submit_ext_scheme.py | 51 +++++++++ 2 files changed, 177 insertions(+) create mode 100644 mpds_aiida/calc_templates/ext_metallic.yml create mode 100644 scripts/aiida_submit_ext_scheme.py diff --git a/mpds_aiida/calc_templates/ext_metallic.yml b/mpds_aiida/calc_templates/ext_metallic.yml new file mode 100644 index 0000000..3d500a0 --- /dev/null +++ b/mpds_aiida/calc_templates/ext_metallic.yml @@ -0,0 +1,126 @@ +codes: + crystal: + Pcrystal@yascheduler + +options: + need_phonons: true + need_elastic_constants: true + need_properties: false + recursive_update: true + try_oxi_if_fails: true + is_magnetic: true + optimize_structure: optimise + +basis_family: MPDSBSL_NEUTRAL_24 + +default: + crystal: + scf: + k_points: [16, 48] + dft: + SPIN: True + xc: PBE0 + grid: XLGRID + numerical: + TOLLDENS: 8 + TOLLGRID: 16 + numerical: + TOLDEE: 9 + BIPOSIZE: 256000000 + EXCHSIZE: 256000000 + TOLINTEG: [20, 20, 20, 20, 40] + FMIXING: 80 + SMEAR: 0.001 + MAXCYCLE: 500 + fock_mixing: ANDERSON + post_scf: ['PPAN'] + +calculations: + optimise: + metadata: + label: 'Geometry optimization' + parameters: + crystal: + geometry: + optimise: + hessian: HESSIDEN + convergence: + TOLDEE: 9 + on_error: + 300: + crystal: + scf: + numerical: + MAXCYCLE: 1000 + 301: + crystal: + scf: + numerical: + TOLINTEG: [8, 8, 8, 8, 40] + 303: + crystal: + scf: + numerical: + TOLINTEG: [8, 8, 8, 8, 40] + 304: + crystal: + scf: + k_points: [32, 64] + numerical: + TOLLDENS: 10 + TOLLGRID: 18 + numerical: + TOLPSEUD: 10 + 305: + crystal: + scf: + k_points: [32, 64] + numerical: + TOLLDENS: 10 + TOLLGRID: 18 + numerical: + TOLPSEUD: 10 + 306: + crystal: + scf: + numerical: + TOLINTEG: [8, 8, 8, 8, 40] + phonons: + metadata: + label: 'Phonon frequencies' + parameters: + crystal: + geometry: + phonons: + TEMPERAT: [35, 5.7125, 1000] + SCELPHONO: [[1, 1, 0], [-1, 1, 0], [0, 0, 2]] + on_error: + 300: + crystal: + scf: + numerical: + TOLINTEG: [8, 8, 8, 8, 40] + 303: + crystal: + scf: + numerical: + TOLINTEG: [8, 8, 8, 8, 40] + elastic_constants: + metadata: + label: 'Elastic constants' + parameters: + crystal: + geometry: + elastic_constants: + type: ELASTCON + on_error: + 300: + crystal: + scf: + numerical: + TOLINTEG: [8, 8, 8, 8, 40] + 303: + crystal: + scf: + numerical: + TOLINTEG: [8, 8, 8, 8, 40] diff --git a/scripts/aiida_submit_ext_scheme.py b/scripts/aiida_submit_ext_scheme.py new file mode 100644 index 0000000..670dd0b --- /dev/null +++ b/scripts/aiida_submit_ext_scheme.py @@ -0,0 +1,51 @@ +import sys +import argparse +import yaml +from aiida import load_profile +from aiida.plugins import DataFactory +from aiida.engine import submit +from mpds_aiida.workflows.mpds import MPDSStructureWorkChain + +def main(): + load_profile() + + parser = argparse.ArgumentParser(description="Submit an MPDSStructureWorkChain job") + parser.add_argument("phase", nargs="?", default="MgO/225", help="Phase information in the format 'formula/sgs/pearson'") + parser.add_argument("--scheme", default=None, help="Full path to the scheme file") + args = parser.parse_args() + + phase = args.phase.split("/") + + if len(phase) == 3: + formula, sgs, pearson = phase + else: + formula, sgs, pearson = phase[0], phase[1], None + + try: + sgs = int(sgs) + except ValueError: + print(f"Error: space group should be an integer, got {sgs}") + sys.exit(1) + + inputs = MPDSStructureWorkChain.get_builder() + + if args.scheme: + try: + with open(args.scheme) as f: + inputs.workchain_options = yaml.safe_load(f) + except FileNotFoundError: + print(f"Error: Scheme file {args.scheme} not found") + sys.exit(1) + except yaml.YAMLError as exc: + print(f"Error parsing YAML file: {exc}") + sys.exit(1) + else: + inputs.workchain_options = {} + + inputs.metadata = dict(label="/".join(phase)) + inputs.mpds_query = DataFactory('dict')(dict={'formulae': formula, 'sgs': sgs}) + calc = submit(MPDSStructureWorkChain, **inputs) + print(f"Submitted WorkChain; calc=WorkCalculation(PK={calc.pk})") + +if __name__ == "__main__": + main() \ No newline at end of file From b3553e161ecc46c4d10053fff6ad69a05a6a5943 Mon Sep 17 00:00:00 2001 From: Anton Domnin Date: Fri, 2 Aug 2024 23:02:15 +0300 Subject: [PATCH 2/3] fix pep8 --- scripts/aiida_submit_ext_scheme.py | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/scripts/aiida_submit_ext_scheme.py b/scripts/aiida_submit_ext_scheme.py index 670dd0b..6cd79f2 100644 --- a/scripts/aiida_submit_ext_scheme.py +++ b/scripts/aiida_submit_ext_scheme.py @@ -1,21 +1,26 @@ -import sys import argparse +import sys + import yaml from aiida import load_profile -from aiida.plugins import DataFactory from aiida.engine import submit +from aiida.plugins import DataFactory from mpds_aiida.workflows.mpds import MPDSStructureWorkChain + def main(): load_profile() parser = argparse.ArgumentParser(description="Submit an MPDSStructureWorkChain job") - parser.add_argument("phase", nargs="?", default="MgO/225", help="Phase information in the format 'formula/sgs/pearson'") + parser.add_argument("phase", + nargs="?", + default="MgO/225", + help="Phase information in the format 'formula/sgs/pearson'") parser.add_argument("--scheme", default=None, help="Full path to the scheme file") args = parser.parse_args() - + phase = args.phase.split("/") - + if len(phase) == 3: formula, sgs, pearson = phase else: @@ -28,7 +33,7 @@ def main(): sys.exit(1) inputs = MPDSStructureWorkChain.get_builder() - + if args.scheme: try: with open(args.scheme) as f: @@ -42,10 +47,11 @@ def main(): else: inputs.workchain_options = {} - inputs.metadata = dict(label="/".join(phase)) + inputs.metadata = {"label": "/".join(phase)} inputs.mpds_query = DataFactory('dict')(dict={'formulae': formula, 'sgs': sgs}) calc = submit(MPDSStructureWorkChain, **inputs) print(f"Submitted WorkChain; calc=WorkCalculation(PK={calc.pk})") + if __name__ == "__main__": - main() \ No newline at end of file + main() From debf679411479dee0a7782c96d56a3f6f4b8e85a Mon Sep 17 00:00:00 2001 From: Anton Domnin Date: Wed, 21 Aug 2024 17:56:18 +0300 Subject: [PATCH 3/3] update ext scheme --- mpds_aiida/calc_templates/ext_metallic.yml | 40 ++++++++++++++++------ 1 file changed, 30 insertions(+), 10 deletions(-) diff --git a/mpds_aiida/calc_templates/ext_metallic.yml b/mpds_aiida/calc_templates/ext_metallic.yml index 3d500a0..fc5d492 100644 --- a/mpds_aiida/calc_templates/ext_metallic.yml +++ b/mpds_aiida/calc_templates/ext_metallic.yml @@ -16,7 +16,7 @@ basis_family: MPDSBSL_NEUTRAL_24 default: crystal: scf: - k_points: [16, 48] + k_points: [18, 54] dft: SPIN: True xc: PBE0 @@ -55,17 +55,25 @@ calculations: 301: crystal: scf: + k_points: [36, 72] numerical: - TOLINTEG: [8, 8, 8, 8, 40] + TOLLDENS: 10 + TOLLGRID: 18 + numerical: + TOLPSEUD: 10 303: crystal: scf: + k_points: [36, 72] numerical: - TOLINTEG: [8, 8, 8, 8, 40] + TOLLDENS: 10 + TOLLGRID: 18 + numerical: + TOLPSEUD: 10 304: crystal: scf: - k_points: [32, 64] + k_points: [36, 72] numerical: TOLLDENS: 10 TOLLGRID: 18 @@ -74,7 +82,7 @@ calculations: 305: crystal: scf: - k_points: [32, 64] + k_points: [36, 72] numerical: TOLLDENS: 10 TOLLGRID: 18 @@ -83,8 +91,12 @@ calculations: 306: crystal: scf: + k_points: [36, 72] numerical: - TOLINTEG: [8, 8, 8, 8, 40] + TOLLDENS: 10 + TOLLGRID: 18 + numerical: + TOLPSEUD: 10 phonons: metadata: label: 'Phonon frequencies' @@ -99,12 +111,16 @@ calculations: crystal: scf: numerical: - TOLINTEG: [8, 8, 8, 8, 40] + MAXCYCLE: 1000 303: crystal: scf: + k_points: [36, 72] numerical: - TOLINTEG: [8, 8, 8, 8, 40] + TOLLDENS: 10 + TOLLGRID: 18 + numerical: + TOLPSEUD: 10 elastic_constants: metadata: label: 'Elastic constants' @@ -118,9 +134,13 @@ calculations: crystal: scf: numerical: - TOLINTEG: [8, 8, 8, 8, 40] + MAXCYCLE: 1000 303: crystal: scf: + k_points: [36, 72] numerical: - TOLINTEG: [8, 8, 8, 8, 40] + TOLLDENS: 10 + TOLLGRID: 18 + numerical: + TOLPSEUD: 10