-- Tunneling probability C = (beta + i k) F exp(i k L - beta L) / (2 beta) D = (beta - i k) F exp(i k L + beta L) / (2 beta) "Verify equation (3)" check(C exp(beta L) + D exp(-beta L) == F exp(i k L)) "ok" "Verify equation (4)" check(beta C exp(beta L) - beta D exp(-beta L) == i k F exp(i k L)) "ok" "Verify equation (7)" A = beta (C - D) / (2 i k) + (C + D) / 2 gamma = (beta / k - k / beta) / 2 check(A == F exp(i k L) (expcosh(beta L) + i gamma expsinh(beta L))) "ok" "Verify equation (8)" M = 1 / (exp(i k L) (expcosh(beta L) + i gamma expsinh(beta L))) T = 1 / (cosh(beta L)^2 + gamma^2 sinh(beta L)^2) check(conj(M) M == T) "ok" "Verify equation (9)" k = sqrt(2 m E / hbar^2) beta = sqrt(2 m (V0 - E) / hbar^2) check(T == (1 + V0^2 sinh(beta L)^2 / (4 E (V0 - E)))^(-1)) "ok" -- physical constants (c, e, h, and k are exact values) c = 299792458.0 meter / second -- speed of light in vacuum e = 1.602176634 10^(-19) coulomb -- elementary charge epsilon0 = 8.8541878128 10^(-12) farad / meter -- vacuum electric permittivity h = 6.62607015 10^(-34) joule second -- Planck constant hbar = h / float(2 pi) -- reduced Planck constant k = 1.380649 10^(-23) joule / kelvin -- Boltzmann constant me = 9.1093837015 10^(-31) kilogram -- electron mass mp = 1.67262192369 10^(-27) kilogram -- proton mass mu = me mp / (me + mp) -- reduced electron mass -- derived units coulomb = ampere second farad = coulomb / volt joule = kilogram meter^2 / second^2 volt = joule / coulomb -- base units (for printing) ampere = "ampere" kelvin = "kelvin" kilogram = "kilogram" meter = "meter" second = "second" eV = e joule / coulomb -- convert eV to joules -- Example m = me E = 1 eV V0 = 1.1 eV L = 10^(-9) meter beta = sqrt(2 m (V0 - E) / hbar^2) "Tunneling probability" T = 1 / (1 + V0^2 sinh(beta L)^2 / (4 E (V0 - E))) T "Approximation" T = 16 E (V0 - E) / V0^2 exp(-2 beta L) T
Run