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

XPS: Fix inputs for molecules #1013

Merged
merged 4 commits into from
Mar 19, 2024
Merged
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
10 changes: 9 additions & 1 deletion src/aiida_quantumespresso/workflows/xps.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ def get_builder_from_protocol(
cls, code, structure, pseudos, core_hole_treatments=None, protocol=None,
overrides=None, elements_list=None, atoms_list=None, options=None,
structure_preparation_settings=None, correction_energies=None, **kwargs
):
): # pylint: disable=too-many-statements
"""Return a builder prepopulated with inputs selected according to the chosen protocol.

:param code: the ``Code`` instance configured for the ``quantumespresso.pw`` plugin.
Expand Down Expand Up @@ -463,6 +463,14 @@ def get_builder_from_protocol(
# for get_xspectra_structures
if structure_preparation_settings:
builder.structure_preparation_settings = structure_preparation_settings
if structure_preparation_settings.get('is_molecule_input').value:
builder.ch_scf.pw.parameters.base.attributes.all['SYSTEM']['assume_isolated']='mt'
builder.ch_scf.pw.settings=orm.Dict(dict={'gamma_only':True})
# To ensure compatibility with the gamma_only setting, the k-points must be configured to [1, 1, 1].
kpoints_mesh = DataFactory('core.array.kpoints')()
kpoints_mesh.set_kpoints_mesh([1, 1, 1])
builder.ch_scf.kpoints = kpoints_mesh
builder.relax.base.pw.settings=orm.Dict(dict={'gamma_only':True})
# pylint: enable=no-member
return builder

Expand Down
Loading