Fix PP upload widget - #1348
Conversation
|
Does the summary display that is a different pseudo ? |
Are you asking if the summary displays an uploaded pseudo? |
Yes, or how this logic will be handle |
2f7dbcb to
2343cae
Compare
See #1353 |
2343cae to
d01fa8c
Compare
9d1cad1 to
ee75789
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #1348 +/- ##
=======================================
Coverage ? 72.28%
=======================================
Files ? 99
Lines ? 7026
Branches ? 0
=======================================
Hits ? 5079
Misses ? 1947
Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Another test to consider , is what happens is the user sets a simulations w/o SOC , and upload a Full Relativistic pseudo , or the opposite , a SOC calculation and a non FR pseudo is uploaded, this should trigger a warning that they should match otherwise the workflow will fail |
Good idea! We can capture this relatively (😉) easily. Regarding your error above, you won't be able to submit with custom pseudos until the plugin PR is merged. |
|
|
@edan-bainglass what would occur if the user for some reason upload LDA pseudos ? is this consider or a warning of LDA not supported ? |
The problem is that we have no consistent way of detecting the functional of a given UPF file. Though the format provides a functional field, some ignore it, leaving the template value behind. So we can't reliably extract the functional. In general, I support adding warnings/blockers, as long as we can build them on reliable information. |
There are currently two bugs in the `PwBaseWorkChain.get_builder_from_protocol()` method when the users overrides the `pw.pseudos` input: 1. For magnetic calculations, the `starting_magnetization` is still constructed based on the number of valence electrons (`z_valence`) from the `pseudo_family`. 2. If the user overrides the `pseudos` input but doesn't override the cutoffs (`SYSTEM.ecutrho`, `SYSTEM.ecutwfc`), these are still (silently) taken from the `pseudo_family`. Here we fix these two issues by 1. Passing the `z_valences` of the provides `pseudos` override to the `get_magnetization` function. 2. Strictly checking the overrides: they should both (i) provide pseudo potentials for _all_ the kinds in the input `structure` and (ii) provide both energy cutoffs (`SYSTEM.ecutrho`, `SYSTEM.ecutwfc`) in case the `pseudos` are overridden. Moreover, if the user completely specifies the pseudos and cutoffs through the overrides, it should be fine in case `pseudo_family` is None or False. This is important in the context of adding custom pseudo potential functionality in the QEapp, see: aiidalab/aiidalab-qe#1348 Co-authored-by: Edan Bainglass <edan.bainglass@gmail.com>
There are currently two bugs in the `PwBaseWorkChain.get_builder_from_protocol()` method when the users overrides the `pw.pseudos` input: 1. For magnetic calculations, the `starting_magnetization` is still constructed based on the number of valence electrons (`z_valence`) from the `pseudo_family`. 2. If the user overrides the `pseudos` input but doesn't override the cutoffs (`SYSTEM.ecutrho`, `SYSTEM.ecutwfc`), these are still (silently) taken from the `pseudo_family`. Here we fix these two issues by 1. Passing the `z_valences` of the provides `pseudos` override to the `get_magnetization` function. 2. Strictly checking the overrides: they should both (i) provide pseudo potentials for _all_ the kinds in the input `structure` and (ii) provide both energy cutoffs (`SYSTEM.ecutrho`, `SYSTEM.ecutwfc`) in case the `pseudos` are overridden. Moreover, if the user completely specifies the pseudos and cutoffs through the overrides, it should be fine in case `pseudo_family` is None or False. This is important in the context of adding custom pseudo potential functionality in the QEapp, see: aiidalab/aiidalab-qe#1348 Co-authored-by: Edan Bainglass <edan.bainglass@gmail.com>
I think for now, we can at least add a comment regarding unsupported functionals, but it would be on the user to verify since we can't auto detect. @AndresOrtegaGuerrero mind drafting a clear warning to the user regarding functional consistency, relativistic treatment, etc.? I'll then split it accordingly, depending on what the user selects in the app (e.g., SOC). |
When uploading a pseudopotential, please ensure that you select the appropriate exchange-correlation functional supported by the application. For spin–orbit coupling (SOC) calculations, make sure to upload a fully relativistic pseudopotential. Additionally, remember to adjust the plane-wave cutoff energy to ensure convergence. |
Hasn't changed. Still the max across all pseudos. Per pseudo, I try to parse the cutoffs. Each gets 0 if I can't parse it. Then the suggested final cutoffs are the max of each "column" |
This is great! I would just maybe not say "select the appropriate exchange-correlation functional", as they may think we mean select PBE or PBEsol in the app. Instead, maybe we can say "upload a pseudopotential with an exchange-correlation functional that is supported by the application (e.g., PBE, PBEsol)" |
|
Thanks a lot @edan-bainglass!! Just one thing. QE is able to check consistency of the functionals, so the information must be there. For the functionals we need for the app, the two to check are: Note that there are many alternatives in the pseudos, both depending on the UPF version, and on how it's written. (5th line, I think, and I think the part from PBEsol onwards is just a comment). In what I think is v2 I find instead Hope this is helpful (for the exact logic, if we don't want to reverse engineer, we would need to check the Fortran logic, but I think this is already good for most pseudos and we can fine-tune later. |
|
Thanks @giovannipizzi. Yeah, this might be enough for now. Let me see what I can do. |
There are currently two bugs in the `PwBaseWorkChain.get_builder_from_protocol()` method when the users overrides the `pw.pseudos` input: 1. For magnetic calculations, the `starting_magnetization` is still constructed based on the number of valence electrons (`z_valence`) from the `pseudo_family`. 2. If the user overrides the `pseudos` input but doesn't override the cutoffs (`SYSTEM.ecutrho`, `SYSTEM.ecutwfc`), these are still (silently) taken from the `pseudo_family`. Here we fix these two issues by 1. Passing the `z_valences` of the provides `pseudos` override to the `get_magnetization` function. 2. Strictly checking the overrides: they should both (i) provide pseudo potentials for _all_ the kinds in the input `structure` and (ii) provide both energy cutoffs (`SYSTEM.ecutrho`, `SYSTEM.ecutwfc`) in case the `pseudos` are overridden. Moreover, if the user completely specifies the pseudos and cutoffs through the overrides, it should be fine in case `pseudo_family` is None or False. This is important in the context of adding custom pseudo potential functionality in the QEapp, see: aiidalab/aiidalab-qe#1348 Co-authored-by: Edan Bainglass <edan.bainglass@gmail.com>


Motivated by #1299
This PR aims to make the pseudopotential uploaders compatible with the various changes that came after its initial implementation.
Logic
NoneComments
Included changes to magnetization settings
The magnetization panel was dependent on the pseudo family to extract Z values for magnetization-to-moment conversion. To support custom pseudos (family set to
None), the dependency was replaced by one on the pseudos dictionary. In the conversion process, Z values are now extracted from theUpfDatanode associated with the UUID in the dictionary, which supports successfully uploaded custom pseudos. Pinging @t-reents due to #1252 to particularly have a look at this part 🙏Regarding functional consistency
Ideally, we would do better than just inform the user of this need. Unfortunately, functional information is not consistently provided. For example, the functional entry in the built-in `` pseudo is
Functional: SLA PW PSX PSC, which is the template, i.e., the pseudopotential author did not bother to change it. For this reason, there is no consistent information we can rely on to determine a given pseudo's functional. Suggestions welcomed 🙏 Pinging @giovannipizziNote that we would ideally want this to prevent calculations from crashing due to the inconsistency. This is also true across plugins, e.g., core-hole potentials for XPS/XAS. We have a system of blockers in place, just no reliable information to act on 🥲 Pinging @superstar54
Dependencies
aiida-quantumespressoplugin - to support custom pseudos (no family), the plugin can no longer rely on the presence of a pseudo family. This is done in this PR. Once merged and a new release is made, this PR will be updated with the dependency version bump.