Open t-reents opened 11 months ago
Hi @t-reents , this is NOT a bug, but it is the intended way. This is because pw.x
does NOT accept nearest neighbours outisde the 3x3x3 supercell. Thus, the (integer) values for the translations must be accordingly in {-1,0,1}
.
You can in fact inspect that in you hubbard paramters one of the translations is (-2, -1, 0)
. This would make pw.x
to crash. This is due to the fact that some atoms are outside the unitcell (e.g. in crystal coordinates they have some |x_i |> 1
). You should fold in the unitcell such atoms. I recently worked on some utility functions for helping to do this. Please look at this branch: https://github.com/bastonero/aiida-quantumespresso/tree/feat/voronoi.
Probably we should raise a WARNING when this happens, but the HubbardStructureData
was thought not to be bounded to QE. So hopefully the upcoming utilities will solve this issue.
Hi @bastonero thanks a lot for the explanation! This clarifies a lot.
I tried to run a
PwCalculation
calculation using aHubbardStructureData
that was generated based on the followingStructureData
.Generating the
HubbardStructureData
:The calculation fails during the presubmit call, when calling
HubbardUtils(structure).get_hubbard_card()
. Inspecting the output ofhubbard_structure.hubbard.parameters
explains this failure:The translation in the second entry is not part of the
QE_TRANSLATIONS
(https://github.com/aiidateam/aiida-quantumespresso/blob/main/src/aiida_quantumespresso/utils/hubbard.py#L21-L24), wherefore the following function call excepts (https://github.com/aiidateam/aiida-quantumespresso/blob/main/src/aiida_quantumespresso/utils/hubbard.py#L326).If one would use the second O site, everything would work out. However, this method (https://github.com/aiidateam/aiida-quantumespresso/blob/main/src/aiida_quantumespresso/data/hubbard_structure.py#L214) selects the first occurring site that matches the
kind_name
. Apparently, this logic seems to work out in general, but in this case, it somehow breaks.