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

Problematic translation in HubbardStructureData #991

Open
t-reents opened this issue Dec 6, 2023 · 3 comments
Open

Problematic translation in HubbardStructureData #991

t-reents opened this issue Dec 6, 2023 · 3 comments

Comments

@t-reents
Copy link

t-reents commented Dec 6, 2023

I tried to run a PwCalculation calculation using a HubbardStructureData that was generated based on the following StructureData.

(output as pymatgen structure)
Structure Summary
Lattice
    abc : 5.1676899920824315 5.1676899920824315 5.167689992113305
 angles : 31.204203015989076 31.204203015989076 31.204203015105193
 volume : 32.87123329572289
      A : 1.3898768242032 0.80244575859357 4.9121627693234
      B : -1.3898768242032 0.80244575859357 4.9121627693234
      C : -8.7346701145945e-17 -1.6048915172871 4.9121627693235
    pbc : True True True
PeriodicSite: Co (0.0, 0.0, 0.0) [0.0, 0.0, 0.0]
PeriodicSite: O (1.39, 0.8024, 13.81) [1.604, 0.6041, 0.6041]
PeriodicSite: O (1.39, 0.8024, 10.75) [1.396, 0.3959, 0.3959]

Generating the HubbardStructureData:

hubbard_structure = HubbardStructureData.from_structure(structure)
hubbard_structure.initialize_onsites_hubbard("Co", "3d")
hubbard_structure.initialize_intersites_hubbard("Co", "3d", "O", "2p")

The calculation fails during the presubmit call, when calling HubbardUtils(structure).get_hubbard_card(). Inspecting the output of hubbard_structure.hubbard.parameters explains this failure:

[HubbardParameters(atom_index=0, atom_manifold='3d', neighbour_index=0, neighbour_manifold='3d', translation=(0, 0, 0), value=1e-08, hubbard_type='Ueff'),
 HubbardParameters(atom_index=0, atom_manifold='3d', neighbour_index=1, neighbour_manifold='2p', translation=(-2, -1, 0), value=1e-08, hubbard_type='V')]

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.

@bastonero
Copy link
Collaborator

bastonero commented Dec 9, 2023

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.

@bastonero
Copy link
Collaborator

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.

@t-reents
Copy link
Author

t-reents commented Dec 9, 2023

Hi @bastonero thanks a lot for the explanation! This clarifies a lot.

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

No branches or pull requests

2 participants