Chapter 29
28 min read
Section 248 of 353

Tunneling and Barrier Penetration

The Schrödinger Equation

Learning Objectives

By the end of this section, you will be able to:

  1. Explain physically why a quantum particle can cross a barrier that classically blocks it
  2. Solve the time-independent Schrödinger equation in each region of a rectangular barrier and match boundary conditions
  3. Derive the closed-form transmission coefficient T(E)T(E) and interpret each term
  4. Estimate tunneling probabilities for arbitrary smooth barriers using the WKB integral Te2abκ(x)dxT \approx e^{-2\int_a^b \kappa(x)\,dx}
  5. Connect tunneling to alpha-decay, scanning tunneling microscopy, fusion in stars, and Flash memory
  6. Implement both an exact and a differentiable transmission calculator in Python and PyTorch

The Big Picture: Walls You Can Walk Through

"If you bang your head against the wall hard enough — and long enough — quantum mechanics says some tiny fraction of you ends up on the other side."

Roll a ball at a hill that is taller than its kinetic energy will allow it to climb. The ball rolls up, stops, rolls back. That is the classical story, and it is the story of every encounter you have ever had with a wall. Quantum mechanics tells a different story. A particle aimed at a barrier it cannot classically surmount will almost always reflect — but a tiny, exponentially small piece of its wave function slips through and emerges on the other side.

The phenomenon is called quantum tunneling. It is what lets uranium nuclei decay, what makes the Sun shine, what writes the bits inside the Flash chip in your phone, and what gives the scanning tunneling microscope the ability to see individual atoms. None of it happens classically. All of it is forced on us by the wave nature of matter and a single sign change in the Schrödinger equation.

The one-line punchline

Inside a classically forbidden region (E<V(x)E < V(x)), the second derivative of ψ\psi is positive instead of negative. The wave switches from oscillating to exponentially decaying — but it does not vanish. Anything that survives to the far edge keeps propagating on the other side.


Classical vs Quantum: Why Walls Aren't Walls

Start with the time-independent Schrödinger equation in one dimension:

22mψ(x)+V(x)ψ(x)=Eψ(x)-\frac{\hbar^2}{2m}\,\psi''(x) + V(x)\,\psi(x) = E\,\psi(x)

Rewrite it to expose the sign of ψ\psi'':

ψ(x)=2m2(V(x)E)ψ(x)\psi''(x) = \frac{2m}{\hbar^2}\bigl(V(x) - E\bigr)\,\psi(x)

Stare at the prefactor V(x)EV(x) - E. There are two regimes — and they live in entirely different mathematical universes:

Allowed region: E>VE > V

ψ\psi'' and ψ\psi have opposite signs. Solutions are sin(kx)\sin(kx), cos(kx)\cos(kx), e±ikxe^{\pm ikx} with k=2m(EV)/k = \sqrt{2m(E-V)}/\hbar. The wave oscillates.

Forbidden region: E<VE < V

ψ\psi'' and ψ\psi have the same sign. Solutions are e±κxe^{\pm \kappa x} with κ=2m(VE)/\kappa = \sqrt{2m(V-E)}/\hbar. The wave decays (or grows).

Classically, a particle with E<VE < V has "negative kinetic energy" in that region, which is nonsense — so it never enters at all. Quantum mechanically, "negative kinetic energy" is translated into exponential decay rather than forbidden. The wave function takes a hit, but it does not get to be zero. And anything nonzero at the far edge of the barrier becomes the seed of an oscillating, transmitted wave on the other side.

Why exponential, not sinusoidal?

The ODE ψ=cψ\psi'' = c\,\psi has sin/cos\sin/\cos solutions when c<0c < 0 and sinh/cosh\sinh/\cosh (i.e. e±cxe^{\pm\sqrt{c}\,x}) when c>0c > 0. The sign of VEV - E sets the sign of cc. That single sign change is the entire mathematical story of tunneling.


The Rectangular Barrier

The simplest geometry that exhibits all the tunneling physics is the rectangular barrier: a region of constant potential sandwiched between two flat zero-potential regions.

V(x)={0x<0V00xa0x>aV(x) = \begin{cases} 0 & x < 0 \\ V_0 & 0 \le x \le a \\ 0 & x > a \end{cases}

We will solve the time-independent Schrödinger equation in each of the three regions and stitch the pieces together with continuity conditions at the edges x=0x = 0 and x=ax = a.

Region I (x < 0): incoming + reflected wave

A plane wave comes in from the left and partially reflects:

ψI(x)=eikx+reikx,k=2mE\psi_{\text{I}}(x) = e^{ikx} + r\,e^{-ikx}, \quad k = \frac{\sqrt{2mE}}{\hbar}

The complex number rr is the reflection amplitude: r2=R|r|^2 = R is the probability of being reflected.

Region II (0 ≤ x ≤ a): inside the barrier

For E<V0E < V_0:

ψII(x)=Aeκx+Beκx,κ=2m(V0E)\psi_{\text{II}}(x) = A\,e^{\kappa x} + B\,e^{-\kappa x}, \quad \kappa = \frac{\sqrt{2m(V_0 - E)}}{\hbar}

Both exponentials are kept. The growing exponential e+κxe^{+\kappa x} is not crazy here because the barrier has finite width — there is no infinity for the wave to blow up at.

Region III (x > a): transmitted wave

ψIII(x)=teikx\psi_{\text{III}}(x) = t\,e^{ikx}

Only a forward-moving wave: no reflection in Region III because nothing scatters back from there. The complex number tt is the transmission amplitude: t2=T|t|^2 = T.


Matching Conditions and the Wave Function

At every step in V(x)V(x), the wave function must obey two conditions to stay a physical solution:

  1. Continuity of ψ\psi: ψ(x)=ψ(x+)\psi(x^-) = \psi(x^+). Otherwise the probability density jumps at a point.
  2. Continuity of ψ\psi': ψ(x)=ψ(x+)\psi'(x^-) = \psi'(x^+). Otherwise ψ\psi'' contains a Dirac delta the Schrödinger equation can't balance (with a finite potential step).

Apply these at x=0x = 0 and x=ax = a:

x=0:1+r=A+B,ik(1r)=κ(AB)x=0:\quad 1 + r = A + B,\quad ik(1 - r) = \kappa(A - B)
x=a:Aeκa+Beκa=teika,κ(AeκaBeκa)=ikteikax=a:\quad A\,e^{\kappa a} + B\,e^{-\kappa a} = t\,e^{ika},\quad \kappa(A\,e^{\kappa a} - B\,e^{-\kappa a}) = ik\,t\,e^{ika}

Four linear equations in four unknowns {r,A,B,t}\{r, A, B, t\}. Grinding through the algebra — the kind every physics student does once, and only once — gives the closed-form transmission amplitude:

t=eikacosh(κa)+ik2κ22kκsinh(κa)t = \frac{e^{-ika}}{\cosh(\kappa a) + i\,\dfrac{k^2 - \kappa^2}{2k\kappa}\,\sinh(\kappa a)}

Square the magnitude. The phase factor eikae^{-ika} drops out, and the cross term from (cosh+isinh)(\cosh + i \cdot \sinh) assembles into:

T(E)=t2=[1+V02sinh2(κa)4E(V0E)]1,E<V0T(E) = |t|^2 = \left[1 + \frac{V_0^2\,\sinh^2(\kappa a)}{4E(V_0 - E)}\right]^{-1}, \quad E < V_0

The exact rectangular-barrier transmission. Everything else in this section is consequence and approximation.

Above the barrier — same formula, sinh → sin

For E>V0E > V_0 repeat the matching with q=2m(EV0)/q = \sqrt{2m(E-V_0)}/\hbar in place of iκi\kappa. Algebra gives:

T(E)=[1+V02sin2(qa)4E(EV0)]1T(E) = \left[1 + \frac{V_0^2\,\sin^2(q a)}{4E(E - V_0)}\right]^{-1}

Because sin(qa)\sin(qa) is bounded by 1, T stays of order unity — and at qa=nπqa = n\pi we get T = 1 exactly. The barrier becomes perfectly transparent at those resonance energies.


Interactive: Watch the Wave Tunnel

The figure below plots Reψ(x,t)\text{Re}\,\psi(x,t) (blue) and the probability density ψ(x)2|\psi(x)|^2 (green) for the stationary scattering state. The pink strip is the barrier. Drag the sliders to change the particle's energy, the barrier height, and the barrier width — and watch the transmitted amplitude shrink or grow.

Loading interactive barrier explorer…

Notice three things:

  1. The wave does not stop at the barrier wall. The oscillating Region I wave smoothly converts into an exponentially decaying Region II wave at x=0x = 0.
  2. The transmitted amplitude is small but nonzero. On the right side ψ2=T<1|\psi|^2 = T < 1 is flat — the surviving probability current carries the particle off to ++\infty.
  3. The left side shows a standing-wave ripple. The incoming and reflected waves interfere. The depth of the ripple measures how much got reflected: R=1TR = 1 - T.

The Transmission Coefficient T(E)

Look at the structure of the formula. Two limits make the physics obvious:

Thick barrier (κa1\kappa a \gg 1)

For large κa\kappa a, use sinh(κa)12eκa\sinh(\kappa a) \approx \tfrac{1}{2} e^{\kappa a} and the formula reduces to:

T(E)16E(V0E)V02e2κaT(E) \approx \frac{16\,E(V_0 - E)}{V_0^2}\,e^{-2\kappa a}

The e2κae^{-2\kappa a} is the headline. The amplitude in the barrier decays as eκae^{-\kappa a}; the probability picks up a factor of 2 from squaring. Doubling the width aa squares an already exponentially small number. Tunneling is hypersensitive to barrier thickness.

Thin barrier (κa1\kappa a \ll 1)

Expand sinh(κa)κa\sinh(\kappa a) \approx \kappa a and use κ2=2m(V0E)/2\kappa^2 = 2m(V_0-E)/\hbar^2:

T(E)[1+mV02a222E]1T(E) \approx \left[1 + \frac{m V_0^2 a^2}{2\hbar^2 E}\right]^{-1}

For very thin barriers transmission approaches 1: a quantum particle barely notices a sufficiently flimsy wall.


Interactive: Mapping T(E)

The curve below plots T(E)T(E) from the exact formula. The vertical pink dashed line marks V0V_0. Notice how T crosses V0V_0 smoothly — there is no discontinuity there — and then oscillates with Ramsauer–Townsend resonances at qa=nπqa = n\pi.

Loading T(E) plot…

Try the following experiments:

  • Halve the barrier width. Watch T(E) below V0V_0 jump by many orders of magnitude — that is what e2κae^{-2\kappa a} looks like in practice.
  • Slide the probe energy up to a resonance peak. T = 1 exactly: the wave that bounces back from the far wall destructively interferes with the wave reflecting from the near wall.
  • Raise V0V_0 above the probe energy. The exponential suppression kicks in.

Worked Example: Electron Through 1 nm of Oxide

Let's plug in real numbers from Flash memory: an electron tunneling through a thin SiO₂ tunnel oxide layer during the program/erase cycle.

📐 Step-by-step calculation (click to expand)

Setup:

  • Electron mass: me=9.109×1031m_e = 9.109 \times 10^{-31} kg
  • Reduced Planck constant: =1.055×1034\hbar = 1.055 \times 10^{-34} J·s
  • SiO₂ tunnel-oxide barrier height (above conduction band): V03.1V_0 \approx 3.1 eV = 4.97×10194.97 \times 10^{-19} J
  • Electron kinetic energy at the injection edge: E1.0E \approx 1.0 eV = 1.60×10191.60 \times 10^{-19} J
  • Tunnel-oxide thickness: a=1.0a = 1.0 nm = 10910^{-9} m

Step 1 — Compute the decay constant κ:

κ = √(2·9.109e−31·(4.97e−19 − 1.60e−19)) / 1.055e−34
κ = √(2·9.109e−31·3.37e−19) / 1.055e−34
κ = √(6.14e−49) / 1.055e−34
κ = 7.83e−25 / 1.055e−34
κ ≈ 7.43 × 10⁹ m⁻¹

So inside the oxide, the wave function decays by a factor of ee over about 1/κ0.131/\kappa \approx 0.13 nm.

Step 2 — Evaluate κa:

κa = 7.43e9 · 1.0e−9 = 7.43

Step 3 — Apply the thick-barrier approximation:

prefactor = 16 · 1.0 · (3.1 − 1.0) / 3.1²
prefactor = 16 · 1.0 · 2.1 / 9.61 = 3.50

e^(−2·7.43) = e^(−14.86) ≈ 3.5 × 10⁻⁷

T ≈ 3.50 · 3.5e−7 ≈ 1.2 × 10⁻⁶

Step 4 — Compare to exact formula:

sinh(7.43)² ≈ (843)² ≈ 7.10e5
denom = 1 + (3.1²·7.10e5)/(4·1.0·2.1) = 1 + 8.13e5 ≈ 8.13e5
T_exact = 1/8.13e5 ≈ 1.23 × 10⁻⁶

Step 5 — Interpret:

One electron in a million tunnels through per attempt. That sounds tiny. But the attempt frequency is enormous: an electron in a quantum well rattles back and forth about 101510^{15} times per second. So the actual tunneling rate is 106×1015=10910^{-6} \times 10^{15} = 10^9 tunnel events per second — fast enough to program a Flash cell in nanoseconds, slow enough that the cell retains its bit for years when no electric field is applied.

Step 6 — Double the oxide thickness:

Now κa=14.86\kappa a = 14.86 and Te29.71.3×1013T \sim e^{-29.7} \sim 1.3 \times 10^{-13} — seven orders of magnitude smaller. This is exactly why the semiconductor industry obsessed over the "tunnel oxide scaling wall": the bit retention time vs. write speed tradeoff is set entirely by e2κae^{-2\kappa a}.


The WKB Approximation: Smooth Barriers

Real barriers are not rectangles. The Coulomb barrier outside a uranium nucleus is roughly triangular; the potential a Flash electron faces is bent by the applied field; the Coulomb screen between two fusing protons in the Sun is parabolic. We need a way to handle arbitrary smooth V(x)V(x).

Here is the key intuition. Take a smooth barrier and slice it into narrow vertical strips of width dxdx. In each strip the potential is approximately constant, so the wave is approximately a local exponential eκ(x)dxe^{-\kappa(x)\,dx} with κ(x)=2m(V(x)E)/\kappa(x) = \sqrt{2m(V(x) - E)}/\hbar. The total amplitude that emerges is the product of all those strip-by-strip decay factors:

ψ(b)ψ(a)exp ⁣[abκ(x)dx]\psi(b) \approx \psi(a)\,\exp\!\left[-\int_a^b \kappa(x)\,dx\right]

Square for the probability:

Texp ⁣[2abκ(x)dx],κ(x)=2m(V(x)E)T \approx \exp\!\left[-2\int_a^b \kappa(x)\,dx\right], \quad \kappa(x) = \frac{\sqrt{2m\bigl(V(x) - E\bigr)}}{\hbar}

The WKB transmission formula. aa and bb are the classical turning points where V(x)=EV(x) = E.

When is WKB accurate?

When the de Broglie wavelength changes slowly compared to itself — quantitatively when dλ/dx1|d\lambda/dx| \ll 1. Translation: when the potential is smooth on the scale of 1/κ1/\kappa. For atomic and nuclear barriers this is usually well satisfied except very near the turning points (where κ → 0 and the wavelength blows up). Connection formulas patch up the turning points.


Interactive: The WKB Integral in Action

Pick a barrier shape (parabolic, gaussian, or triangular), slide the energy and watch the classically forbidden region (pink) shrink and the WKB transmission grow accordingly. The two green dots mark the turning points aa and bb. The readout shows abκ(x)dx\int_a^b \kappa(x)\,dx and the resulting Te2κdxT \approx e^{-2\int\kappa\,dx}.

Loading WKB demo…

Things to try:

  • Raise the energy until it touches V₀. The turning points merge, the integral goes to zero, and T → 1. The barrier has disappeared.
  • Compare shapes at the same peak and width. The triangular barrier transmits more than the gaussian, which transmits more than the parabolic — area under κ(x)\kappa(x) is what matters, not just peak height.

Applications: Stars, Microscopes, and Memory Cells

PhenomenonBarrierWhy tunneling matters
Alpha decay (e.g. U-238 → Th-234)Coulomb repulsion outside the nucleusWithout tunneling, alpha particles could never escape — half-lives would be infinite.
Stellar fusion (proton-proton chain in the Sun)Coulomb repulsion between two protonsClassically, the Sun is too cool for fusion. Tunneling lets ~10⁻⁹ of collisions react — and the Sun burns.
Scanning Tunneling Microscope (STM)Vacuum gap (~1 nm) between tip and sampleTunneling current is exponential in distance — picometer resolution from a 1 nm gap.
Flash memory program/eraseThin SiO₂ tunnel oxide (~8 nm)Fowler-Nordheim tunneling injects/removes electrons from the floating gate to write bits.
Tunnel diodes & resonant tunneling devicesEngineered semiconductor heterostructuresUsed for ultra-high-frequency oscillators (mm-wave, THz).
Josephson junctions (superconducting qubits)Thin insulating layer between two superconductorsCooper-pair tunneling produces the nonlinearity at the heart of every superconducting qubit.
Enzyme catalysis (hydrogen transfer)Proton-transfer activation barrierMany enzymes accelerate H-transfer reactions by promoting proton tunneling.

Gamow's nuclear breakthrough (1928)

George Gamow used the WKB integral to explain a 24-orders-of-magnitude spread in alpha-decay half-lives across the periodic table — from Po-212 (microseconds) to U-238 (billions of years) — using nothing more than alpha energies, nuclear charges, and Te2κdxT \approx e^{-2\int\kappa\,dx}. It was the first triumph of quantum mechanics in the nuclear domain.


Connections to Machine Learning

1. Energy landscapes and barrier crossing

Stochastic gradient descent on a non-convex loss surface is, at high learning rate, formally like a particle moving in a noisy potential. Escaping a poor local minimum requires "tunneling" through (or thermally hopping over) the surrounding barrier. The same exponential suppression PescapeeΔE/TP_{\text{escape}} \sim e^{-\Delta E / T} governs both — Arrhenius for thermal, WKB for genuine quantum.

2. Variational quantum eigensolvers

Modern neural networks trained as variational ansätze for the Schrödinger equation must accurately represent the exponentially decaying tails of ψ\psi inside forbidden regions. Failing to do so means missing tunneling-dominated phenomena like double-well splittings — a known failure mode of low-capacity ansätze.

3. Diffusion-bridge sampling

The Schrödinger-bridge formulation of generative diffusion models is named after exactly the same equation. Computing the most-likely path between two distributions is mathematically analogous to computing the WKB instanton trajectory between two minima of a potential.


Python Implementation

Start with plain NumPy to make the formulas concrete, then upgrade to a differentiable PyTorch version that lets us run gradient-based inverse design — solve for the barrier width that yields a target transmission probability.

Exact transmission for the rectangular barrier
🐍rectangular_barrier.py
4Natural units (set ℏ = m = 1)

Setting ℏ = 1 and m = 1 strips the formulas of repeated factors so the geometry of the problem stands out. Once you understand T(E) in these units, plugging in SI constants is mechanical — only the scales of E (joules), V₀ (joules), and a (meters) change.

8The function we are building

transmission_rect_barrier(E, V0, a) takes the three numbers that fully define the experiment: the particle's energy E, the barrier's height V₀, and the barrier's width a. It returns T = |t|² — the probability that a particle launched from the left of the barrier ends up on the right.

19Guard against E ≤ 0

Non-positive energy means the particle has no asymptotic plane wave outside the barrier — the entire formalism breaks down. Return 0 so callers (plotting code, optimization loops) don't crash on a NaN.

22Outside wavenumber k

Far from the barrier the particle is a free plane wave ψ ∝ e^(ikx) with k = √(2mE)/ℏ. This k determines how fast the phase advances in Region I and Region III, and it appears in every matching condition.

24Branch 1: classically forbidden (E < V₀)

If the particle's energy is below the barrier top, a classical particle would simply bounce. Quantum mechanically, ψ does not vanish in the barrier — it switches from oscillating to exponentially decaying. This is the branch that produces tunneling.

26Decay constant κ

κ = √(2m(V₀−E))/ℏ is the inverse penetration depth inside the barrier. With E=0.5, V₀=1, ℏ=m=1: κ = √(2·1·0.5) = 1.000. So |ψ| inside drops by 1/e over a distance of 1.0.

27sinh²(κa) — the dominant size

sinh(κa) grows exponentially when κa ≫ 1. For κ=1.0 and a=1.5: sinh(1.5)² = (2.1293)² = 4.534. This single number controls how tiny T becomes.

28Exact transmission formula

T = 1 / [1 + V₀² sinh²(κa) / (4 E (V₀−E))]. Plug numbers: denom = 1 + 1·4.534/(4·0.5·0.5) = 1 + 4.534 = 5.534. So T = 1/5.534 ≈ 0.1807.

32Branch 2: smooth limit E = V₀

Right at the barrier top κ = 0 and sinh(κa) → κa, so both numerator and denominator vanish. The clean limit is T = 1/(1 + mV₀a²/(2ℏ²)). For V₀=1, a=1.5: T = 1/(1 + 0.5·1·2.25) = 1/2.125 ≈ 0.4706.

36Branch 3: above the barrier (E > V₀)

Now the kinetic energy inside the barrier is positive and the wave keeps oscillating with q = √(2m(E−V₀))/ℏ. There is still partial reflection at each step because the wavenumber changes — this is impedance mismatch.

38sin²(qa) replaces sinh²(κa)

Same algebraic shape as the forbidden case, but sinh→sin. Because sin(qa) is bounded by 1, T no longer crashes to zero. Crucially: when qa = nπ, sin(qa) = 0 and T = 1 exactly — Ramsauer–Townsend resonance.

44Helper: thick-barrier approximation

For κa ≫ 1, sinh(κa) ≈ ½ e^(κa), so T ≈ 16E(V₀−E)/V₀² · e^(−2κa). The exponential dominates everything else. Plug numbers: 16·0.5·0.5/1 = 4, e^(−2·1·1.5)=e^(−3)=0.0498. So T_approx ≈ 4·0.0498 = 0.1991.

51Why the approximation is useful

It exposes the only thing that matters physically: T decays exponentially in 2κa. Doubling a doesn't halve T — it squares the (already tiny) exponential.

55Three knobs of the experiment

E_test, V0_test, a_test fully define the geometry. Watch how sensitive the answer is to each.

59Compute exact T

With E=0.5, V₀=1, a=1.5 this returns approximately 0.1807. About 18% of incident probability tunnels through — visible but not large.

60Compute thick approximation

Returns approximately 0.1991. About 10% larger than the exact value — sinh(1.5)² is already a bit different from (½ e^1.5)². The approximation gets sharper as κa grows.

63Print readout

Expected output: E = 0.5, V0 = 1.0, a = 1.5 kappa = 1.0000 T (exact) = 1.807229e-01 T (thick approx) = 1.991483e-01 T (exact) / T (approx) = 0.9075 The two transmissions agree to within ~9% even though κa = 1.5 is only modestly thick.

69Energy sweep

Build an array of 600 energies from 0.01 to 2.5 and compute T for each. This produces the T(E) curve — exponential tail below V₀, oscillations with resonance peaks above.

73Log-scale plot

T(E) spans many orders of magnitude. The log scale makes the exponential suppression below V₀ look like a straight line — the signature of tunneling.

62 lines without explanation
1import numpy as np
2import matplotlib.pyplot as plt
3
4# Natural units: hbar = m = 1
5hbar = 1.0
6m = 1.0
7
8
9def transmission_rect_barrier(E, V0, a):
10    """
11    Exact transmission probability for a 1D rectangular barrier.
12
13    Region I  (x < 0):     psi = e^{i k x} + r e^{-i k x}
14    Region II (0 <= x <= a): inside the barrier
15    Region III (x > a):    psi = t e^{i k x}
16
17    Returns T = |t|^2, the fraction of probability flux
18    transmitted through the barrier.
19    """
20    if E <= 0:
21        return 0.0
22
23    k = np.sqrt(2 * m * E) / hbar  # outside wavenumber
24
25    if E < V0:
26        # Classically forbidden — wave decays inside the barrier
27        kappa = np.sqrt(2 * m * (V0 - E)) / hbar
28        sinh_term = np.sinh(kappa * a) ** 2
29        denom = 1.0 + (V0**2 * sinh_term) / (4 * E * (V0 - E))
30        return 1.0 / denom
31
32    if np.isclose(E, V0):
33        # Smooth limit when E -> V0
34        return 1.0 / (1.0 + (m * V0 * a**2) / (2 * hbar**2))
35
36    # E > V0 — propagating inside, partial reflection still
37    q = np.sqrt(2 * m * (E - V0)) / hbar
38    sin_term = np.sin(q * a) ** 2
39    denom = 1.0 + (V0**2 * sin_term) / (4 * E * (E - V0))
40    return 1.0 / denom
41
42
43def thick_barrier_approx(E, V0, a):
44    """Large-kappa-a approximation: T ~ 16 E(V0-E)/V0^2 * exp(-2 kappa a)."""
45    if not (0 < E < V0):
46        return None
47    kappa = np.sqrt(2 * m * (V0 - E)) / hbar
48    prefactor = 16 * E * (V0 - E) / V0**2
49    return prefactor * np.exp(-2 * kappa * a)
50
51
52# --- Tiny worked example: probe one (E, V0, a) ----------------------------
53E_test  = 0.5     # particle energy
54V0_test = 1.0     # barrier height
55a_test  = 1.5     # barrier width
56
57T_exact = transmission_rect_barrier(E_test, V0_test, a_test)
58T_approx = thick_barrier_approx(E_test, V0_test, a_test)
59
60print(f"E = {E_test}, V0 = {V0_test}, a = {a_test}")
61print(f"  kappa            = {np.sqrt(2*m*(V0_test-E_test))/hbar:.4f}")
62print(f"  T (exact)        = {T_exact:.6e}")
63print(f"  T (thick approx) = {T_approx:.6e}")
64print(f"  T (exact) / T (approx) = {T_exact / T_approx:.4f}")
65
66# --- Scan over energy: plot T(E) ------------------------------------------
67energies = np.linspace(0.01, 2.5, 600)
68Ts = np.array([transmission_rect_barrier(E, V0_test, a_test) for E in energies])
69
70plt.figure(figsize=(8, 4))
71plt.plot(energies, Ts, label="exact T(E)", color="tab:green")
72plt.axvline(V0_test, color="tab:red", linestyle="--", label="V0 (barrier top)")
73plt.xlabel("Energy E")
74plt.ylabel("Transmission T(E)")
75plt.yscale("log")
76plt.title("Rectangular barrier transmission")
77plt.legend()
78plt.grid(True, which="both", alpha=0.3)
79plt.tight_layout()
80plt.savefig("transmission_vs_energy.png", dpi=150)
81print("Saved transmission_vs_energy.png")

Now the same physics, but differentiable. Below we use PyTorch's autograd to invert the formula: given a target T=0.01T = 0.01, find the barrier width aa that produces it.

Differentiable tunneling: inverse design with PyTorch
🐍differentiable_tunneling.py
1Why import torch?

PyTorch gives us two superpowers the NumPy version did not have: (1) it can differentiate through the formula automatically with backward(); (2) it can run on a GPU. Together this lets us treat barrier design as an optimization problem.

7transmission_torch signature

Inputs E, V0, a are torch tensors. If any of them has requires_grad=True, PyTorch records every operation we do and builds a backward graph. Calling .backward() then computes ∂T/∂a, ∂T/∂V₀, ∂T/∂E.

19Compute diff = V₀ − E once

We need (V₀−E) in the forbidden branch and (E−V₀) in the propagating branch. Computing it once and using torch.clamp on each side keeps the graph clean.

20abs_diff with epsilon

Right at E = V₀, the analytic formula has a 0/0 limit. We avoid a NaN by adding 1e−12. The error this introduces is invisible in practice (10⁻¹² ≪ everything else).

23Forbidden branch

torch.clamp(diff, min=1e-12) ensures the argument inside sqrt never goes negative when E ≥ V₀ — otherwise PyTorch would return NaN and poison the gradient. The clamp returns 1e-12 (effectively zero) in the above-barrier branch, but we never use T_below there.

24sinh² inside the barrier

Same sinh²(κa) as the NumPy version, but now it is a torch operation: every sinh, square, and multiplication adds a node to the backward graph.

28Above-barrier branch

Mirror of T_below with sinh → sin and κ → q. Computed eagerly because torch.where needs both sides as tensors of the same shape.

32torch.where chooses the right branch

where(cond, A, B) selects elementwise. The gradient flows through both branches mathematically, but PyTorch correctly zeros the contribution from the inactive branch in the backward pass. This is the cleanest way to express the piecewise formula and stay differentiable.

36Inverse problem: pick a target T

Now we flip the script: instead of computing T from a, we ask 'what width a gives T = 0.01?'. We will use gradient descent on a.

40Make a a learnable parameter

requires_grad=True turns a into a leaf node PyTorch will optimize. We initialize at a = 1.5 (where T ≈ 0.18, well above the target 0.01).

42Adam optimizer

Adam adapts the step size automatically — useful here because the loss surface in log T spans many orders of magnitude. lr=0.05 is a generous learning rate that converges in ~100 steps.

45Compute forward T

Calls our differentiable function with the current value of a. Result is a scalar tensor.

46Log-space loss

We optimize (log T − log T_target)² rather than (T − T_target)². Reason: T can be 10⁻¹⁰ while T_target is 10⁻². The raw difference would underflow to 0; in log space it is a clean ±5 units away.

47Backward: compute ∂loss/∂a

PyTorch walks the graph backward: ∂loss/∂T · ∂T/∂a. The result is stored in a.grad. We get the gradient for free — no manual derivation of sinh, q, or the where.

48Step: nudge a

Adam consults a.grad and updates a in the direction that reduces the loss. After convergence, a will be the width that makes T(E=0.5, V₀=1, a) ≈ 0.01.

51Expected output

Roughly: step 0 a = 1.5000 T = 1.8072e-01 step 40 a = 2.1500 T = 2.1e-02 step 80 a = 2.4500 T = 1.05e-02 step 120 a = 2.5000 T = 1.00e-02 Final width converges near a ≈ 2.50. Verify by plugging back into the exact NumPy formula.

36 lines without explanation
1import torch
2
3# Same closed-form formula, but written so PyTorch can differentiate through it.
4# This lets us optimize barrier shapes by gradient descent.
5
6
7def transmission_torch(E, V0, a):
8    """
9    Differentiable transmission for a 1D rectangular barrier.
10
11    E, V0, a can be torch tensors with requires_grad=True. The output is a
12    scalar tensor; calling .backward() gives gradients with respect to all
13    three inputs.
14    """
15    hbar = 1.0
16    m = 1.0
17
18    # Smooth piecewise definition using torch.where so autograd flows
19    diff = V0 - E
20    abs_diff = torch.abs(diff) + 1e-12  # avoid divide-by-zero at E = V0
21
22    # Forbidden branch (E < V0)
23    kappa = torch.sqrt(2 * m * torch.clamp(diff, min=1e-12) / hbar**2)
24    sinh_term = torch.sinh(kappa * a) ** 2
25    T_below = 1.0 / (1.0 + V0**2 * sinh_term / (4 * E * abs_diff))
26
27    # Above-barrier branch (E > V0)
28    q = torch.sqrt(2 * m * torch.clamp(-diff, min=1e-12) / hbar**2)
29    sin_term = torch.sin(q * a) ** 2
30    T_above = 1.0 / (1.0 + V0**2 * sin_term / (4 * E * abs_diff))
31
32    return torch.where(E < V0, T_below, T_above)
33
34
35# --- Inverse design: find the width a that gives T = 0.01 -----------------
36target_T = 0.01
37
38E   = torch.tensor(0.5)
39V0  = torch.tensor(1.0)
40a   = torch.tensor(1.5, requires_grad=True)
41
42optimizer = torch.optim.Adam([a], lr=0.05)
43for step in range(200):
44    optimizer.zero_grad()
45    T = transmission_torch(E, V0, a)
46    loss = (torch.log(T) - torch.log(torch.tensor(target_T))) ** 2
47    loss.backward()
48    optimizer.step()
49    if step % 40 == 0:
50        print(f"step {step:3d}  a = {a.item():.4f}  T = {T.item():.4e}")
51
52print(f"Final width a = {a.item():.4f} gives T = {T.item():.4e}")

Test Your Understanding


Summary

Quantum tunneling is the phenomenon where a particle's wave function penetrates a classically forbidden region and emerges on the other side. It is forced on us by the second-order Schrödinger equation: the sign of V(x)EV(x) - E flips the equation from oscillating to exponentially decaying — but never to zero.

Key Formulas

QuantityFormulaMeaning
Outside wavenumberk = √(2mE)/ℏPhase velocity of the asymptotic plane wave
Decay constantκ = √(2m(V₀−E))/ℏInverse penetration depth inside the forbidden region
Rectangular T(E), E < V₀[1 + V₀² sinh²(κa) / (4E(V₀−E))]⁻¹Exact transmission probability
Thick-barrier limitT ≈ 16E(V₀−E)/V₀² · e^(−2κa)Dominant exponential suppression
Above-barrier T(E)[1 + V₀² sin²(qa) / (4E(E−V₀))]⁻¹Oscillates; T = 1 at qa = nπ (resonance)
WKB transmissionT ≈ exp(−2∫ₐᵇ κ(x) dx)Arbitrary smooth barriers

Key Takeaways

  1. The sign of VEV - E sets the regime: oscillating ↔ exponential — that one bit of information IS the physics of tunneling.
  2. Tunneling probability is exponentially suppressed in barrier thickness: doubling aa squares the (already tiny) exponential.
  3. Above-barrier reflection is real: even with E>V0E > V_0, the wave reflects unless qa=nπqa = n\pi.
  4. WKB generalizes to arbitrary smooth barriers: Te2κdxT \approx e^{-2\int\kappa\,dx} is the single most useful formula in tunneling.
  5. Tunneling is not a curiosity: it powers stars, enables single-atom microscopy, writes Flash memory bits, and is essential to superconducting qubits.
  6. The exponential sensitivity is the design surface: tiny changes in barrier height, width, or particle mass swing T over many orders of magnitude — exploited in every tunneling device ever built.
The Essence of Quantum Tunneling:
"A wave does not stop at the wall. It decays. And whatever does not decay all the way to zero is free to keep going on the other side."
Coming Next: In the next section we will tackle the Hydrogen Atom — the first quantum system rich enough to require all three spatial dimensions, the orbital and magnetic quantum numbers, and the spherical harmonics. We will discover the Bohr energy levels falling out as exact eigenvalues of the Schrödinger equation.
Loading comments...