aiidateam / aiida-quantumespresso

The official AiiDA plugin for Quantum ESPRESSO
https://aiida-quantumespresso.readthedocs.io
Other
55 stars 82 forks source link

Increase `quantumespresso.pw.bands` versatility (skip scf step) #668

Open ramirezfranciscof opened 3 years ago

ramirezfranciscof commented 3 years ago

Or alternatively separate the bands part into a lower level workchain that only seekpaths and performs the band structure.

Currently the bands workflow has three main steps:

  1. Relaxes input structure
  2. Calculate the SCF of the input (or relaxed) structure
  3. Calculate the band structure of the input (or relaxed) structure

The first structural optimization is optional and can be disabled, but the SCF calculation is not. I would like to be able to provide a parent folder and have that be the source of the band structure instead of the workchain doing its own SCF.

mbercx commented 3 years ago

Sure, sounds reasonable! 👍 We also added a similar feature for the PdosWorkChain. Basically, we'd make the scf input optional and add a validator that either the scf input or the parent_folder of the bands calculation needs to be provided.

sphuber commented 3 years ago

The slightly complicated part with this is that if the scf is skipped by providing a parent_folder for the bands step, seekpath will still need to be ran for the structure that is passed in order to get the k-point path. However, this can change the structure if it hasn't already been normalized. In that case, we are still forced to use the output structure of the seekpath manipulation, but that technically then no longer corresponds to the structure that was used for the SCF calculation. It is very likely that restarting from the parent_folder will then fail because it is not congruent with the input structure.

ramirezfranciscof commented 3 years ago

Mmm option: can you check if the output of the seekpath structure coincides with the provided structure and if not then finish with an error code saying this? (the structure provided with the parent_folder was not normalized, please either let us do the SCF or provide restart data for the normalized structure (see output structure of seekpath process))

sphuber commented 3 years ago

Sure that could be done, but that would mean that people would have to manually run the seekpath with the exact same input parameters and manually run the scf, and then run the PwBandsWorkChain to run just the bands step. Is this really a common use case and does this really make things easier? The SCF is not that expensive, so redoing it wouldn't be that big of a problem

ramirezfranciscof commented 3 years ago

I couldn't say if it is common, but what I can say is that this is not necessarily about avoiding doing or not doing the SCF again. The problem is that the way I am getting that density might not be easy to set up in a single wrapped PW calculation.

For example: I may want to check the band structure of the atomic superposition instead of the converged density; the way I currently obtain this is through an SCF with electron_maxstep=0. This will typically get me the density I want in the work dir of QE for further processing but I think the plugin has some problems parsing the output and so it ends with an exit code (and probably abort if attempted inside this workchain).

sphuber commented 3 years ago

This will typically get me the density I want in the work dir of QE for further processing but I think the plugin has some problems parsing the output and so it ends with an exit code (and probably abort if attempted inside this workchain).

Could you post the exception of the parser and what the resulting exit code is. Maybe it makes sense to have a separate exit code for this if this is a more common use case of just initializing the charge density.