stfc / janus

collection of scripts to train and generate data for machine learnt interatomic potentials
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Convert dataset units #29

Closed ElliottKasoar closed 1 year ago

ElliottKasoar commented 1 year ago

Extends #15 (commit included as very closely related) to allow conversion of n2p2 units.

The addition of specifying n2p2 input units has little effect on the current most common use of datasets - writing LAMMPS data files, as we want these files to have units of eV/Ang, so if an input n2p2 file is already in these units, the units in dataset.write can be left unspecified, and the units will remain correct, while if the n2p2 file has units of Ha/Bohr, these will already be assumed and converted if units are specified for dataset.write.

If does, however, avoid ambiguity/incorrect behaviour in the former case, as if units are passed to dataset.write, the input units will then be mislabelled and a conversion will erroneously be applied.

The other benefit is to enable conversion of n2p2 files with "incorrect" units. It is currently always assumed that these units should be in Ha/Bohr for training, so this provides a mechanism to produce a data file with these units if they initially differ.

Potential further additions:

ElliottKasoar commented 1 year ago

(Rebased following merging of #20)