Consistency of charge unit in LAMMPS real units?

Hi LAMMPS users,

according to the documentation the charge of a proton is +1 in LAMMPS real units and I found that this is not consistent with the unit of mass, distance and time in that unit system. Therefore, I would like to double check whether I made a mistake or whether the charge unit was defined this way for convenience. I was a bit suspicious, because I was previously using a unit system derived by {energy = kJ/mole, distance = nm, time = ps} and the charge of a proton is about 11.76 in that unit system. So I tried to derive what the charge of an electron should be if you use {energy = kcal/mole, distance = Angstrom, time = fs}. I found that the charge of a proton corresponds to 0.37 in this unit system, rather than +1, when calculated consistently (unless I made a mistake).

I am quite sure that the procedure is correct, but a mistake can easily happen. Therefore I would like to know: is the charge of a proton defined to be unity in real units - without necessarily being consistent with the other units, as is the case for mass/density - or did I make a mistake in the conversion and should rather get 1 e = - 1 instead of 1 e = -0.37?.

Any advice would be much appreciated.

Best wishes
Peter

Hi LAMMPS users,

according to the documentation the charge of a proton is +1 in LAMMPS real

yes.

units and I found that this is not consistent with the unit of mass,
distance and time in that unit system. Therefore, I would like to double

so what? the units command sets units for properties to the ones
listed in the documentation.

the don't *have* to be consistent. that is why there are conversion
factors defined in the force class and initialized to suitable values
when the units command is used. by your standard practically all unit
systems are inconsistent, even SI (why is it kg and not g?) and cgs.

axel.

Thanks for the reply, Axel. I know that they don’t have to be consistent, if you use additional internal conversion factors. However, as I ran into some difficulties related to the magnitude of the charge density, I was interested in knowing whether LAMMPS uses an additional internal conversion factor for the charge and if yes, what its value was. Will try to figure it out by myself then.

Peter

Hi LAMMPS users,

according to the documentation the charge of a proton is +1 in LAMMPS real

yes.

units and I found that this is not consistent with the unit of mass,
distance and time in that unit system. Therefore, I would like to double

so what? the units command sets units for properties to the ones
listed in the documentation.

the don’t have to be consistent. that is why there are conversion
factors defined in the force class and initialized to suitable values
when the units command is used. by your standard practically all unit
systems are inconsistent, even SI (why is it kg and not g?) and cgs.

axel.

Thanks for the reply, Axel. I know that they don't have to be consistent,
if you use additional internal conversion factors. However, as I ran into
some difficulties related to the magnitude of the charge density, I was
interested in knowing whether LAMMPS uses an additional internal conversion
factor for the charge and if yes, what its value was. Will try to figure it
out by myself then.

if the unit of charge is the elementary charge, then the unit of the
charge density has to be elementary charges per volume (i.e. length
unit to the power of three). if there are difficulties beyond that
(what would they be? you don't say, so nobody can comment on that),
then my guess is that there may be a problem that what you assume to
be computed is not exactly what you ask for. it almost always is in
these kind of cases.

there *is* no internal charge unit and data is not going to be
converted. all that there is are a bunch of constants that help to
compute properties. you can find their declaration and meaning in
src/force.h and their assignment based on the unit keyword in
src/update.cpp in the function Update::set_units(). it is all far less
complex and convoluted than what you were showing in your original
post.

axel.

Thanks, that was very helpful. I will have a look at the files.

Peter