From 1c5b3653dfea6c3f7090d91309ed18cf78684cdf Mon Sep 17 00:00:00 2001 From: Michail Minotakis Date: Fri, 31 Jan 2025 12:22:19 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=8C=20`PdosWorkChain`:=20Update=20prot?= =?UTF-8?q?ocols=20for=20improved=20accuracy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update the Briollouin zone sampling algorithm and adjust the `deltaE` parameter for DOS and pDOS to 0.01. The optimized tetrahedron method is now selected as recommended by the Quantum ESPRESSO documentation for improved efficiency and accuracy. Additionally, tightening the energy grid helps mitigate the issue of skipping semicore states in certain cases. Co-authored-by: Andres Ortega-Guerrero <34098967+AndresOrtegaGuerrero@users.noreply.github.com> Co-authored-by: Michail Minotakis --- src/aiida_quantumespresso/workflows/pdos.py | 4 ++-- src/aiida_quantumespresso/workflows/protocols/pdos.yaml | 6 +++--- tests/workflows/protocols/test_pdos.py | 2 +- tests/workflows/protocols/test_pdos/test_default.yml | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/aiida_quantumespresso/workflows/pdos.py b/src/aiida_quantumespresso/workflows/pdos.py index 09ec45012..fe39e874c 100644 --- a/src/aiida_quantumespresso/workflows/pdos.py +++ b/src/aiida_quantumespresso/workflows/pdos.py @@ -134,8 +134,8 @@ def validate_nscf(value, _): parameters = value['pw']['parameters'].get_dict() if parameters.get('CONTROL', {}).get('calculation', 'scf') != 'nscf': return '`CONTOL.calculation` in `nscf.pw.parameters` is not set to `nscf`.' - if parameters.get('SYSTEM', {}).get('occupations', None) != 'tetrahedra': - return '`SYSTEM.occupations` in `nscf.pw.parameters` is not set to `tetrahedra`.' + if not parameters.get('SYSTEM', {}).get('occupations', '').startswith('tetrahedra'): + return '`SYSTEM.occupations` in `nscf.pw.parameters` is not set to one of the `tetrahedra` options.' def validate_dos(value, _): diff --git a/src/aiida_quantumespresso/workflows/protocols/pdos.yaml b/src/aiida_quantumespresso/workflows/protocols/pdos.yaml index ace259194..f8e5ceaff 100644 --- a/src/aiida_quantumespresso/workflows/protocols/pdos.yaml +++ b/src/aiida_quantumespresso/workflows/protocols/pdos.yaml @@ -13,12 +13,12 @@ default_inputs: calculation: nscf restart_mode: from_scratch SYSTEM: - occupations: tetrahedra + occupations: tetrahedra_opt nosym: True dos: parameters: DOS: - DeltaE: 0.02 + DeltaE: 0.01 metadata: options: resources: @@ -28,7 +28,7 @@ default_inputs: projwfc: parameters: PROJWFC: - DeltaE: 0.02 + DeltaE: 0.01 metadata: options: resources: diff --git a/tests/workflows/protocols/test_pdos.py b/tests/workflows/protocols/test_pdos.py index a41f5376d..48bb1cba4 100644 --- a/tests/workflows/protocols/test_pdos.py +++ b/tests/workflows/protocols/test_pdos.py @@ -51,7 +51,7 @@ def test_electronic_type(get_pdos_generator_inputs): builder = PdosWorkChain.get_builder_from_protocol( **get_pdos_generator_inputs, electronic_type=ElectronicType.INSULATOR ) - for namespace, occupations in zip((builder.scf, builder.nscf), ('fixed', 'tetrahedra')): + for namespace, occupations in zip((builder.scf, builder.nscf), ('fixed', 'tetrahedra_opt')): parameters = namespace['pw']['parameters'].get_dict() assert parameters['SYSTEM']['occupations'] == occupations assert 'degauss' not in parameters['SYSTEM'] diff --git a/tests/workflows/protocols/test_pdos/test_default.yml b/tests/workflows/protocols/test_pdos/test_default.yml index 991b87fec..beaebb1ad 100644 --- a/tests/workflows/protocols/test_pdos/test_default.yml +++ b/tests/workflows/protocols/test_pdos/test_default.yml @@ -9,7 +9,7 @@ dos: withmpi: true parameters: DOS: - DeltaE: 0.02 + DeltaE: 0.01 nscf: kpoints_distance: 0.1 kpoints_force_parity: false @@ -39,7 +39,7 @@ nscf: ecutrho: 240.0 ecutwfc: 30.0 nosym: true - occupations: tetrahedra + occupations: tetrahedra_opt pseudos: Si: Si projwfc: @@ -52,7 +52,7 @@ projwfc: withmpi: true parameters: PROJWFC: - DeltaE: 0.02 + DeltaE: 0.01 scf: kpoints_distance: 0.15 kpoints_force_parity: false