Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1# The following definitions are all given in SI and are excerpted from the
2# kim_units.cpp file created by Prof. Ellad B. Tadmor (UMinn) distributed with
3# LAMMPS. Note that these values do not correspond to any official CODATA set
4# already released, but rather to the values used internally by LAMMPS.
5#
6# Source: https://physics.nist.gov/cuu/Constants/Table/allascii.txt
8from numpy import sqrt
10# Constants
11boltz_si = 1.38064852e-23 # [J K^-1] Boltzmann's factor (NIST value)
12Nav = mole_si = 6.022140857e23 # [unitless] Avogadro's number
13me_si = 9.10938356e-31 # [kg] electron rest mass
14e_si = 1.6021766208e-19 # [C] elementary charge
16# Distance units
17meter_si = 1.0
18bohr_si = (
19 5.2917721067e-11
20) # [m] Bohr unit (distance between nucleus and electron in H)
21angstrom_si = 1e-10 # [m] Angstrom
22centimeter_si = 1e-2 # [m] centimeter
23micrometer_si = 1e-6 # [m] micrometer (micron)
24nanometer_si = 1e-9 # [m] nanometer
26# Mass units
27kilogram_si = 1.0
28amu_si = gram_per_mole_si = 1e-3 / Nav # [kg] gram per mole i.e. amu
29gram_si = 1e-3 # [kg] gram
30picogram_si = 1e-15 # [kg] picogram
31attogram_si = 1e-21 # [kg[ attogram
33# Time units
34second_si = 1.0
35atu_si = 2.418884326509e-17 # [s] atomic time unit
36# ( = hbar/E_h where E_h is the Hartree energy) (NIST value)
37atu_electron_si = atu_si * sqrt(
38 amu_si / me_si
39) # [s] atomic time unit used in electron system
40microsecond_si = 1e-6 # [s] microsecond
41nanosecond_si = 1e-9 # [s] nanosecond
42picosecond_si = 1e-12 # [s] picosecond
43femtosecond_si = 1e-15 # [s] femtosecond
45# Density units
46gram_per_centimetercu_si = (
47 gram_si / centimeter_si ** 3
48) # [kg/m^3] gram/centimeter^3
49amu_per_bohrcu_si = amu_si / bohr_si ** 3 # [kg/m^3] amu/bohr^3
50picogram_per_micrometercu_si = (
51 picogram_si / micrometer_si ** 3
52) # [kg/m^3] picogram/micrometer^3
53attogram_per_nanometercu_si = (
54 attogram_si / nanometer_si ** 3
55) # [kg/m^3] attogram/nanometer^3
57# Energy/torque units
58joule_si = 1.0
59kcal_si = (
60 4184.0
61) # [J] kilocalorie (heat energy involved in warming up one kilogram of
62# water by one degree Kelvin)
63ev_si = (
64 1.6021766208e-19
65) # [J] electron volt (amount of energy gained or lost by the
66# charge of a single electron moving across an electric
67# potential difference of one volt.) (NIST value)
68hartree_si = (
69 4.359744650e-18
70) # [J] Hartree (approximately the electric potential energy
71# of the hydrogen atom in its ground state) (NIST value)
72kcal_per_mole_si = kcal_si / Nav # [J] kcal/mole
73erg_si = 1e-7 # [J] erg
74dyne_centimeter_si = 1e-7 # [J[ dyne*centimeter
75picogram_micrometersq_per_microsecondsq_si = (
76 picogram_si * micrometer_si ** 2 / microsecond_si ** 2
77) # [J] picogram*micrometer^2/microsecond^2
78attogram_nanometersq_per_nanosecondsq_si = (
79 attogram_si * nanometer_si ** 2 / nanosecond_si ** 2
80) # [J] attogram*nanometer^2/nanosecond^2
82# Velocity units
83meter_per_second_si = 1.0
84angstrom_per_femtosecond_si = (
85 angstrom_si / femtosecond_si
86) # [m/s] Angstrom/femtosecond
87angstrom_per_picosecond_si = (
88 angstrom_si / picosecond_si
89) # [m/s] Angstrom/picosecond
90micrometer_per_microsecond_si = (
91 micrometer_si / microsecond_si
92) # [m/s] micrometer/microsecond
93nanometer_per_nanosecond_si = (
94 nanometer_si / nanosecond_si
95) # [m/s] nanometer/nanosecond
96centimeter_per_second_si = centimeter_si # [m/s] centimeter/second
97bohr_per_atu_si = bohr_si / atu_electron_si # [m/s] bohr/atu
99# Force units
100newton_si = 1.0
101kcal_per_mole_angstrom_si = (
102 kcal_per_mole_si / angstrom_si
103) # [N] kcal/(mole*Angstrom)
104ev_per_angstrom_si = ev_si / angstrom_si # [N] eV/Angstrom
105dyne_si = dyne_centimeter_si / centimeter_si # [N] dyne
106hartree_per_bohr_si = hartree_si / bohr_si # [N] hartree/bohr
107picogram_micrometer_per_microsecondsq_si = (
108 picogram_si * micrometer_si / microsecond_si ** 2
109) # [N] picogram*micrometer/microsecond^2
110attogram_nanometer_per_nanosecondsq_si = (
111 attogram_si * nanometer_si / nanosecond_si ** 2
112) # [N] attogram*nanometer/nanosecond^2
114# Temperature units
115kelvin_si = 1.0
117# Pressure units
118pascal_si = 1.0
119atmosphere_si = 101325.0 # [Pa] standard atmosphere (NIST value)
120bar_si = 1e5 # [Pa] bar
121dyne_per_centimetersq_si = (
122 dyne_centimeter_si / centimeter_si ** 3
123) # [Pa] dyne/centimeter^2
124picogram_per_micrometer_microsecondsq_si = picogram_si / (
125 micrometer_si * microsecond_si ** 2
126) # [Pa] picogram/(micrometer*microsecond^2)
127attogram_per_nanometer_nanosecondsq_si = attogram_si / (
128 nanometer_si * nanosecond_si ** 2
129) # [Pa] attogram/(nanometer*nanosecond^2)
131# Viscosity units
132poise_si = 0.1 # [Pa*s] Poise
133amu_per_bohr_femtosecond_si = amu_si / (
134 bohr_si * femtosecond_si
135) # [Pa*s] amu/(bohr*femtosecond)
136picogram_per_micrometer_microsecond_si = picogram_si / (
137 micrometer_si * microsecond_si
138) # [Pa*s] picogram/(micrometer*microsecond)
139attogram_per_nanometer_nanosecond_si = attogram_si / (
140 nanometer_si * nanosecond_si
141) # [Pa*s] attogram/(nanometer*nanosecond)
143# Charge units
144coulomb_si = 1.0
145echarge_si = e_si # [C] electron charge unit
146statcoulomb_si = (
147 e_si / 4.8032044e-10
148) # [C] Statcoulomb or esu (value from LAMMPS units documentation)
149picocoulomb_si = 1e-12 # [C] picocoulomb
151# Dipole units
152coulomb_meter_si = 1
153electron_angstrom_si = echarge_si * angstrom_si # [C*m] electron*angstrom
154statcoulomb_centimeter_si = (
155 statcoulomb_si * centimeter_si
156) # [C*m] statcoulomb*centimeter
157debye_si = 1e-18 * statcoulomb_centimeter_si # [C*m] Debye
158picocoulomb_micrometer_si = (
159 picocoulomb_si * micrometer_si
160) # [C*m] picocoulomb*micrometer
161electron_nanometer_si = echarge_si * nanometer_si # [C*m] electron*nanometer
163# Electric field units
164volt_si = 1.0
165volt_per_meter_si = 1
166volt_per_angstrom_si = 1.0 / angstrom_si # [V/m] volt/angstrom
167statvolt_per_centimeter_si = erg_si / (
168 statcoulomb_si * centimeter_si
169) # [V/m] statvolt/centimeter
170volt_per_centimeter_si = 1.0 / centimeter_si # [V/m] volt/centimeter
171volt_per_micrometer_si = 1.0 / micrometer_si # [V/m] volt/micrometer
172volt_per_nanometer_si = 1.0 / nanometer_si # [V/m] volt/nanometer