units in a new programmed potential

When programming a new potential how to take care of the units ?

· To program it unitless (i.e. atomic units) and the conversion to whatever units were chosen will be taken care by the program( hopefully). In this case the r provided by the program is in AU aka Bohr ?

· Or, to take care inside the potential routine itself, such that for each of the possible chosen units, the potential will come out right (or rather the force) in eV, Ha, Kcal/mole, etc. ? In this case the r provided by the program is in the units already chosen ?

Sylvian Kahane

19 Hakerem, Omer 84965, Israel

email: [email protected]…2638…


A new potential should work with every unit system that LAMMPS
defines. See the units doc page. Every quantity that your potential
gets from LAMMPS will be in the units described on that page,
e.g. positions in Angstroms. Every quantity your potential
computes needs to be in the units on that page (e.g. eV for energy, eV/A for force).
Typically this is trivial. In some cases, there are conversion factors
that a potential uses to do this. These conversion factors are defined
in LAMMPS and work for every unit system. E.g. see the qqrd2e factor
in pair_lj_cut_coul_cut which converts qq/r to energy.

Basically if you do things like every other potential in LAMMPS does them,
you will be fine.