.. _units:

.. index:: units

Units
*****

Internally  :program:`dynasor` uses units of Ångström (Å) for length, femtosecond (fs) for time, and electronvolt (eV) for energy.
This means that all calculated correlation functions will be in terms of these units.

Why we spell out radians
------------------------

Note that :math:`\boldsymbol{q}`-points are defined to include the factor :math:`2\pi` as is commonly done in physics (`wavenumber wikipedia <https://en.wikipedia.org/wiki/Wavenumber#Definition>`_).
This means that :math:`\boldsymbol{q}`-points technically have units of rad/Å, but note that this in the literature is usually simply written as 1/Å. 
This is how the units of :program:`dynasor` are reported in the first :program:`dynasor` paper (see :ref:`credits page <credits>`), but as leaving out the explicit mention of rad leads to ambiguity, we have since then begun to explicitly include rad when reporting :math:`\boldsymbol{q}`-point units.
Therefore, you will throughout the examples in the documentation encounter rad/Å.

To further clarify the inclusion of the factor :math:`2\pi` in :math:`\boldsymbol{q}`, note that :math:`\boldsymbol{q}` arises in a spatial Fourier transform, which means that it can be compared to a temporal Fourier transform.
A temporal Fourier transform can be written in terms of the frequency :math:`f` (with units 1/s), in which case the exponential explicitly contains a factor of :math:`2\pi`, or in terms of angular frequency :math:`\omega=2\pi f` (with units rad/s).
When performing the spatial Fourier transform here, the exponential does not contain an explicit factor of :math:`2\pi`, meaning that :math:`\boldsymbol{q}` must be interpreted as the spatial analogue of the angular frequency :math:`\omega,` thus containing a factor of :math:`2\pi` and having the unit rad/Å.

Units used in mode projection
-----------------------------

**Mass:**
The internal unit choice (eV, Å, fs) means that the mass unit is not Dalton but rather 0.009648533290731906 Da.
We refer to this unit as the "dynasor mass unit" (dmu), i.e., 1 Da = 103.64269572045423 dmu.
As a user you will only see this unit in connection with :ref:`mode projection <mode_projection_background>`.
Masses provided via, e.g., ASE Atoms objects are converted internally.

**Mode amplitudes:**
Mode amplitudes are reported in Å√dmu = fs√eV.

**Velocities:**
For modes the momenta are reported in Å√dmu/fs or just √eV while atomic velocities are reported in Å/fs.

**Mode forces:**
The force is defined as the derivative of the momenta with respect to time so the unit used when reporting mode forces is Å√dmu/fs² (or √eV/fs).
