SPARC-X / SPARC-X-API

GNU General Public License v3.0
11 stars 10 forks source link

Velocity conversion from SPARC to ASE units #67

Open ltimmerman3 opened 1 week ago

ltimmerman3 commented 1 week ago

Describe the bug I believe the velocity conversion from SPARC raw units to ASE units is incorrect in the aimd parser.

To Reproduce Review the code or any sparc bundle from aimd that is parsed with velocities.

Expected behavior Correct unit conversion

Actual output or error trace The conversion is done as follows:

raw_values * Bohr / AUT / (Angstrom / fs)

I believe this effectively converts from s to ASE time units twice. The definition of AUT includes the raw value for aut (atomic unit of time in s) to ASE time. It is u['second'] * u['_aut']. This should give the atomic unit of time in ASE time units (AUT). Thus, adding the fs conversion multiplies by an extraneous factor of ~ 0.098. Also, the Angstrom multiplication is superfluous since it is defined to be 1. I think a correct conversion would be:

raw_values * Bohr / AUT

I'm horrific at units math, so do let me know if I missed something.