[ase-users] Units in ASE

Gaël Donval gael.donval at cnrs-imn.fr
Tue Apr 2 18:33:19 CEST 2013


Dear all,

I'm working on integrating VASP velocities in ASE.

VASP always outputs velocities in A/fs (one can give velocities as
base_vector/time_step but this is not the point here).

I had problems recalculating the kinetic energy and the temperature from
ASE using the appropriate functions: atoms.get_kinetic_energy() and
atoms.get_temperature(). Here is what I did:

1) Convert units to SI (I'm more comfortable with them):
        mass_si = mass * ase.units._amu # Da to kg
        v_si = v_vasp * 1e5 # A/fs to m/s

2) Calculate the kinetic energy in eV:
        ((mass_si*(v_si**2).sum(axis=1)/2.)*units.J).sum() # in eV

3) Calculate the temperature in Kelvins:
        (2*ekin/(3*len(atoms)))/units.kB
        
I could compare 2) and 3) with the results given in VASP. Basically, I
get almost the same values, but not exactly (VASP: 5.326 eV,
Calculations: 5.313 eV). I'm curious to get your opinion about this
difference. I know the mass and the velocity with at least 6
significative figures ... I acknowledge that these results are close
from each other but I expect at the very least 4 identical figures here.
Maybe the masses...


This is not all. When I use ase and put the velocities in as m/s, just
like above, the calculated energies and temperatures are completely off
(by a factor of 100, Ek=0.05434 u. --this is not even 0.05313...).

I guessed this was because of units. I can't change masses, but only
velocities. Since I have a factor of around 100, I just had to multiply
my velocities by 10. The problem is that I don't see how that would make
sensible units. Would anyone more familiar with atomic sets of units be
willing to shed light on this?

Thanks in advance,
Gael





More information about the ase-users mailing list