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

LDOS default units inconsitency #576

Closed
timcallow opened this issue Sep 3, 2024 · 1 comment · Fixed by #591
Closed

LDOS default units inconsitency #576

timcallow opened this issue Sep 3, 2024 · 1 comment · Fixed by #591
Assignees

Comments

@timcallow
Copy link
Contributor

In mala's DataConverter class, in which the LDOS is processed from QE outputs, the default target_units=None in the add_snapshot function. This means that MALA performs no unit conversion by default on the QE outputs, which are in atomic units.

On the other hand, the default units in MALA are eV and Angstrom. For example, in the read_from_numpy_file function of of the LDOS class, the default units units="1/(eV*A^3)".

So if a user runs a QE calculation, processes the output from that using the DataConverter class, and then performs calculations on the LDOS using the LDOS class, there will be a units inconsistency and energies will be wrong.

Although it's possible to override the default units in either the DataConverter or LDOS classes, I strongly think that, if a user 'does nothing', i.e. uses everywhere defaults, then these should align to produce a consistent result. I would propose to account for this in the DataConverter class by making the default target_units="1/(Ry*Bohr^3)".

What do you think @RandomDefaultUser? If you agree I'll make a PR to address this issue.

@RandomDefaultUser
Copy link
Member

Thanks for pointing this out @timcallow, you are absolutely right, the default settings should agree.
I am wondering though if instead of changing the default unit, we should implement an internal check mapping the unit to the specified target file. I.e., if it is from a cube file, we can (at least at the moment) safely assume it originated from QE. And therefore automatically assign the correct units. At any rate, feel free to create a PR to address the issue, that would be greatly appreciated!

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 a pull request may close this issue.

2 participants