"""Constants used through the code."""

from math import pi

# CODATA recommended values of fundamental physical constants: 2018
# Review of Modern Physics, 93, 025010 (2021).
# https://journals.aps.org/rmp/abstract/10.1103/RevModPhys.93.025010

# PI
PI = pi

# twice of PI
TWOPI = 2.0 * PI

# imaginary unit
UIMAG = 1.0j

# Scaling factor from bohr to angstrom
# Table XXXI, pp. 45
BOHR2ANG = 0.529177210903

# Scaling factor from bohr to nm
BOHR2NM = 0.1 * BOHR2ANG

# Scaling factor from angstrom to bohr
ANG2BOHR = 1.0 / BOHR2ANG

# Scaling factor from nm to bohr
NM2BOHR = 1.0 / BOHR2NM

# Scaling factor from angstrom to nm
ANG2NM = 0.1

# Scaling factor from angstrom to nm, reserved for compatibility.
ANG = ANG2NM

# Scaling factor from nm to angstrom
NM2ANG = 1.0 / ANG2NM

# Scaling factor from nm to nm, reserved for compatibility.
NM = 1.0

# Scaling factor from Hartree to eV
# Table XXXI, pp. 45
HAR2EV = 27.211386245988

# Scaling factor from eV to Hartree
EV2HAR = 1.0 / HAR2EV

# Scaling factor from Hartree to Joule
# Table XXXI, pp. 45
HAR2J = 4.3597447222071e-18

# Scaling factor from Joule to Hartree
J2HAR = 1.0 / HAR2J

# Reduced Planck constant in J*s
# Table XXXI, pp. 45
HBAR_JS = 1.054571817e-34

# Reduced Planck constant in eV*s
# Table XXXI, pp. 45
HBAR_EVS = 6.582119569e-16

# Reduced Planck constant in Hartree*s
HBAR_HARS = HBAR_EVS * EV2HAR

# Boltzmann constant in J/K
# Table XXXI, pp. 49
KB_JK = 1.380649e-23

# Boltzmann constant in eV/K
# Table XXXI, pp. 49
KB_EVK = 8.617333262e-5

# Boltzmann const in Hartree/K
KB_HARK = KB_EVK * EV2HAR

# Scaling factor from a.u. time to femto-second
# Table XXXIV, pp.51
AU2FS = HBAR_JS / HAR2J * 1.0e15

# Scaling factor from femto-second to a.u. time
FS2AU = 1.0 / AU2FS

# Criterion to compare to floats
INFINITESIMAL = 1.0e-15

# Elementary charge in SI units
Q_SI = 1.602176634e-19

# Vacuum electric permittivity in SI units
EPSILON0_SI = 8.8541878128e-12

# Dielectric constant of vacuum in eV/nm/q units
# See lindhard.py for the derivation.
EPSILON0 = 4 * PI * EPSILON0_SI / Q_SI * 1e-9

# Field factor in Peierls substitution in nm/kg/s units
# See sample.py for the derivation.
PEIERLS_FACTOR = Q_SI / (2 * HBAR_JS) * 1e-18
