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

Unit of loading Potentialfield #307

Merged
merged 6 commits into from
Dec 22, 2024
Merged

Conversation

TeetotalingTom
Copy link
Contributor

Summary

The datar from a PotentialField was erroneously being rescaled upon loading. the fields provided by abinit are intensive, but unlike the density, they are not defined "per unit volume". Thus, no rescaling from the default length format (Bohr radii) to the default Pymatgen format (Angstrom) is required.

Beforehand, this would be the plane-averaged total potential of an 11-layer aluminium slab cut along (100) and referenced to the Fermi level:

bad

here one would mistakenly infer that the work function of this slab is almost 50 eV.

This is the result with the corrected code:

good

Reaching a work function of approximately 4.2 eV, consistent with the literature for 11-layer slabs with the PBE functional.

As a minor detail, the code now loads the only two type conversions bohr_to_angstrom and Ha_to_eV that are being used.

@TeetotalingTom
Copy link
Contributor Author

After ensuring that the potentials are correctly loaded in core/tests/test_fields.py, the relevant test is passed accordingly. The test flowtk/tests/test_vzsisa.py still fails, but this is due to the QHA code and unrelated to the current MR.

@gmatteo
Copy link
Member

gmatteo commented Dec 22, 2024

Hello Tom, thank you for fixing the bug. Regarding the error in test_vzsisa.py, I’ll take care of it.

@gmatteo gmatteo merged commit 8782929 into abinit:develop Dec 22, 2024
1 of 3 checks passed
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.

2 participants