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

Add support for electron-phonon calculations #828

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

mbercx
Copy link
Member

@mbercx mbercx commented Jul 20, 2022

Fixes #825

Make several changes in the plugins for ph.x, q2r.x and matdyn.x to provide
support for electron-phonon calculations:

  • Adapt the prepare_for_submission scripts to allow remote copying of
    the elph_dir for both plugins in case la2F is set to true.
  • Add support to the MatDynCalculation plugin for setting dos to
    true, and in this case converting the kpoints input to the nkX
    tags instead of providing them as a list.
  • For matdyn.x calculations where dos is true, parse the phonon DOS
    instead of the phonon bands, and provide this as an output.
  • For the MatdynCalculation plugin, providing the parent_folder input
    currently only makes sense for electron-phonon calculations, so a
    validator is added to check this. The remote copy/symlink list is also
    overriden by the elph_dir to avoid adding it to the default out
    directory of the NamelistsCalculation, which is typically no longer
    required for the matdyn.x step.

@mbercx mbercx added the pr/blocked PR is blocked by another PR that should be merged first label Jul 20, 2022
@mbercx mbercx requested a review from sphuber July 20, 2022 15:13
@mbercx
Copy link
Member Author

mbercx commented Jul 20, 2022

Blocked by #824 for now (that needed to be fixed in order to test these new features). Once that is merged I'll add some tests if we agree on the implementation.

@mbercx mbercx removed the pr/blocked PR is blocked by another PR that should be merged first label Apr 15, 2023
@mbercx mbercx force-pushed the new/825/elph-support branch 5 times, most recently from 19434b3 to c490196 Compare April 15, 2023 13:20
Make several changes in the plugins for `ph.x`, `q2r.x` and `matdyn.x` to provide
support for electron-phonon calculations:

* Adapt the `prepare_for_submission` scripts to allow remote copying of
the `elph_dir` for both plugins in case `la2F` is set to true.
* Add support to the `MatDynCalculation` plugin for setting `dos` to
true, and in this case converting the `kpoints` input to the `nkX`
tags instead of providing them as a list.
* For `matdyn.x` calculations where `dos` is true, parse the phonon DOS
instead of the phonon bands, and provide this as an output.
* For the `MatdynCalculation` plugin, providing the `parent_folder` input
currently only makes sense for electron-phonon calculations, so a
validator is added to check this. The remote copy/symlink list is also
overriden by the `elph_dir` to avoid adding it to the default `out`
directory of the `NamelistsCalculation`, which is typically no longer
required for the `matdyn.x` step.
@@ -55,11 +62,20 @@ def _validate_inputs(value, _):
if 'parameters' in value:
parameters = value['parameters'].get_dict()
else:
parameters = {}
parameters = {'INPUT': {}}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that if the parameters contains an empty dict, this will now fail. Rather initialize empty dict and ensure the INPUT sub dict is there in both bases

Suggested change
parameters = {'INPUT': {}}
parameters = {}
parameters.setdefault('INPUT', {})

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That said, if the user provides an empty Dict node for parameters, they might as well have not provided the input (cleaner provenance). So perhaps we should validate that the INPUT key is in the parameters input instead?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See f659d2c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide support for electron-phonon calculations
2 participants