Units and constants

molmod.units – Conversion from and to atomic units

Internally the MolMod package works always in atomic units. This unit system is consistent, like the SI unit system one does not need conversion factors in the middle of a computation once all values are converted to atomic units. This facilitates the programming and reduces accidental bugs due to forgetting these conversion factor in the body of the code.

References for the conversion values:

  • B. J. Mohr and B. N. Taylor, CODATA recommended values of the fundamental physical constants: 1998, Rev. Mod. Phys. 72(2), 351 (2000)
  • The NIST Reference on Constants, Units, and Uncertainty (http://physics.nist.gov/cuu/Constants/index.html)
  • 1 calorie = 4.184 Joules

Naming conventions in this module: unit is the value of one external unit in internal - i.e. atomic - units. e.g. If you want to have a distance of five angstrom in internal units: 5*angstrom. If you want to convert a length of 5 internal units to angstrom: 5/angstrom. It is recommended to perform this kind of conversions, only when data is read from the input and data is written to the output.

An often recurring question is how to convert a frequency in internal units to a spectroscopic wavenumber in inverse centimeters. This is how it can be done:

>>> from molmod import centimeter, lightspeed
>>> invcm = lightspeed/centimeter
>>> freq = 0.00320232
>>> print freq/invcm

These are the conversion constants defined in this module:

Name Value
ampere 1.5097490095e+02
amu 1.8228886274e+03
angstrom 1.8897261339e+00
atm 3.4439674262e-09
au 1.0000000000e+00
avogadro 6.0221415000e+23
bar 3.3989315828e-09
calorie 9.5968941808e+17
centimeter 1.8897261339e+08
coulomb 6.2415097445e+18
debye 3.9343031369e-01
decimeter 1.8897261339e+09
deg 1.7453292520e-02
electronvolt 3.6749325920e-02
femtosecond 4.1341373337e+01
gram 1.0977693253e+27
hertz 2.4188843265e-17
joule 2.2937127583e+17
kcalmol 1.5936015753e-03
kelvin 1.0000000000e+00
kilogram 1.0977693253e+30
kjmol 3.8087991760e-04
liter 6.7483345942e+27
meter 1.8897261339e+10
micrometer 1.8897261339e+04
miligram 1.0977693253e+24
milimeter 1.8897261339e+07
mol 6.0221415000e+23
nanometer 1.8897261339e+01
nanosecond 4.1341373337e+07
newton 1.2137805141e+07
pascal 3.3989315828e-14
picometer 1.8897261339e-02
picosecond 4.1341373337e+04
rad 1.0000000000e+00
rydberg 5.0000000000e-01
second 4.1341373337e+16
unified 1.8228886274e+03

Evaluate a python expression string containing constants

expression – A string containing a numerical expressions including unit conversions.

In addition to the variables in this module, also the following shorthands are supported:

Short name Value
A 1.8897261339e+00
C 6.2415097445e+18
Hz 2.4188843265e-17
J 2.2937127583e+17
K 1.0000000000e+00
N 1.2137805141e+07
Pa 3.3989315828e-14
cal 9.5968941808e+17
cm 1.8897261339e+08
e 1.0000000000e+00
eV 3.6749325920e-02
fs 4.1341373337e+01
g 1.0977693253e+27
kg 1.0977693253e+30
l 6.7483345942e+27
m 1.8897261339e+10
mg 1.0977693253e+24
mm 1.8897261339e+07
nm 1.8897261339e+01
ns 4.1341373337e+07
pm 1.8897261339e-02
ps 4.1341373337e+04
s 4.1341373337e+16
u 1.8228886274e+03
um 1.8897261339e+04

molmod.constants – Physical Constants

These are the physical constants defined in this module (in atomic units):

Name Value
avogadro 6.0221415000e+23
boltzmann 3.1668154051e-06
lightspeed 1.3703599975e+02
planck 6.2831853072e+00