mala-project / mala

Materials Learning Algorithms. A framework for machine learning materials properties from first-principles data.
https://mala-project.github.io/mala/
BSD 3-Clause "New" or "Revised" License
81 stars 25 forks source link

LDOS default units inconsitency #576

Open timcallow opened 1 month ago

timcallow commented 1 month ago

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.