---
title: "Project: a resonant-tunneling diode"
heading: Transmission through a double barrier, computed with transfer matrices
eyebrow: "B10 · Lesson 53 · Project: a resonant-tunneling diode"
xp: 80
---

::: hook
A resonant-tunneling diode is two thin barriers with a quantum well between them, grown a few atomic layers at a time. An electron that arrives with exactly the energy of the well's quasi-bound level passes straight through both barriers, with probability near 1, even though each barrier alone would reflect most of it. Off resonance almost nothing gets through. Bias the diode and the level slides down past the incoming electrons' energies, so the current rises, peaks, and then falls as the voltage keeps increasing: **negative differential resistance**. RTD oscillators built on that falling slope have reached close to 2 THz, the fastest of any electronic oscillator at room temperature. In this project you'll compute the device's transmission from scratch with transfer matrices, find its resonance and its width, and follow the resonance under bias.
:::

::: predict
## Each barrier of a symmetric RTD transmits 8% of the electrons hitting it at the resonance energy. What fraction gets through both, exactly on resonance?

- [ ] 0.64%, the product
- [ ] 8%
- [ ] 16%
- [x] Nearly 100%

::: reveal
Nearly all of them. On resonance the waves bouncing back and forth in the well add in phase, building up a large amplitude inside, while the waves reflected from the first barrier cancel. It's a Fabry–Pérot etalon for electrons: two partial mirrors that become transparent at the cavity's resonant wavelengths. The catch is the narrow energy range where it happens.
:::
:::

::: nameit
## Transfer matrices

In layer j (potential $V_j$, width $d_j$), $\psi = A_je^{ik_jx} + B_je^{-ik_jx}$ with $k_j = \sqrt{m^*(E - V_j)/c}$, c = 0.0381 eV·nm², imaginary where E < $V_j$. Measure x from each layer's left edge.

- **Interface** from wavenumber k to k′: matching ψ and ψ′ gives $\begin{pmatrix}A'\\ B'\end{pmatrix} = \frac12\begin{pmatrix}1 + r & 1 - r\\ 1 - r & 1 + r\end{pmatrix}\begin{pmatrix}A\\ B\end{pmatrix}$ with r = k/k′.
- **Propagation** across a layer: $\text{diag}(e^{ikd}, e^{-ikd})$.

Multiply them in order, from the left lead (potential 0) to the right lead (potential $V_R$), to get M. With nothing coming in from the right, $B_R = 0$, and

$$T = \frac{k_L/k_R}{\lvert M_{22}\rvert^2}$$

(the current ratio, using det M = $k_L/k_R$). With the same effective mass everywhere, as here, this is exact for any stack of flat layers.

## The resonance

Near a resonance at $E_r$, T has the **Breit–Wigner** (Lorentzian) shape $\frac{T_{peak}(\Gamma/2)^2}{(E - E_r)^2 + (\Gamma/2)^2}$. Its full width Γ is the quasi-bound state's energy width, so the electron's **escape time** from the well is $\tau = \hbar/\Gamma$ (lesson 41), with ħ = 658 meV·fs. Thicker barriers give narrower resonances and longer escape times, roughly as $e^{2\kappa b}$. A symmetric structure reaches $T_{peak}$ = 1; unequal barriers transmit less.

## Under bias

A bias $V_b$ across the structure drops roughly linearly, so the well's center falls by about $V_b/2$ and the resonance with it (a little more, from the Stark effect). To model the slope, cut each layer into thin slices with constant potential. Current flows while the resonance lies among the emitter's occupied energies, between its band edge and its Fermi level; once the resonance drops below the band edge, near $V_b \approx 2E_r/e$, the current collapses. That's the peak of the I–V curve.
:::

::: example
## What escape time corresponds to a 4.73 meV resonance width?

::: solution
1. **Escape time.**
   $$\begin{aligned} \tau &= \frac{\hbar}{\Gamma} \\ &= \frac{658\text{ meV·fs}}{4.73\text{ meV}} \\ &= 139\ \text{fs} \end{aligned}$$
2. **What it limits.** An RTD can't respond faster than its electrons leave the well, so this, together with the device's RC time, limits how high it can oscillate.
3. **Thinner barriers.** They shorten it but broaden the resonance and weaken the negative resistance.

**Answer:** the escape time is 139 fs.
:::
:::

::: example
## A symmetric RTD has its resonance at 88.6 meV. Roughly where's its current peak?

::: solution
1. **Where the resonance meets the band edge.** The resonance falls by about half the bias, so it reaches the emitter's band edge near
   $$\begin{aligned} V_b &= 2 \times 0.0886\ \text{V} \\ &= 0.18\ \text{V} \end{aligned}$$
2. **Real devices.** They peak somewhat higher, because some of the voltage drops in the depleted regions outside the barriers; the simple model is still the right starting point for a design.

**Answer:** the current peaks near 0.18 V.
:::
:::

::: check
kind: python

## Step 1. Write `transmission(E, layers, m=0.067, VR=0.0)`. `layers` is a list of (V, width) pairs between a left lead at 0 eV and a right lead at VR.

```python starter
import numpy as np
C = 0.0381

def transmission(E, layers, m=0.067, VR=0.0):
    kL = np.sqrt(complex(m * E / C))
    kR = np.sqrt(complex(m * (E - VR) / C))
    M = np.eye(2, dtype=complex)
    k_prev = kL
    # for each layer: interface matrix (r = k_prev / k), then propagation
    # finally the interface into the right lead, and T = (kL / kR) / |M[1, 1]|^2
    return 0.0

print(transmission(0.1, [(0.3, 2.0)]))
```

```python solution
import numpy as np
C = 0.0381

def transmission(E, layers, m=0.067, VR=0.0):
    kL = np.sqrt(complex(m * E / C))
    kR = np.sqrt(complex(m * (E - VR) / C))
    M = np.eye(2, dtype=complex)
    k_prev = kL
    for V, d in layers:
        k = np.sqrt(complex(m * (E - V) / C))
        r = k_prev / k
        I = 0.5 * np.array([[1 + r, 1 - r], [1 - r, 1 + r]])
        P = np.array([[np.exp(1j * k * d), 0], [0, np.exp(-1j * k * d)]])
        M = P @ I @ M
        k_prev = k
    r = k_prev / kR
    M = 0.5 * np.array([[1 + r, 1 - r], [1 - r, 1 + r]]) @ M
    return float((kL / kR).real / abs(M[1, 1]) ** 2)

print(transmission(0.1, [(0.3, 2.0)]))
```

```python tests
import numpy as np
m = 0.067
for E, V, a in ((0.1, 0.3, 2.0), (0.25, 0.3, 1.0)):
    kap = np.sqrt(m * (V - E) / C)
    want = 1 / (1 + V**2 * np.sinh(kap * a)**2 / (4 * E * (V - E)))
    got = transmission(E, [(V, a)])
    assert abs(got - want) < 1e-9, f"A {V} eV, {a} nm barrier at {E} eV transmits {want:.6f} (lesson 12); got {got:.6f}."
q = np.sqrt(m * 0.2 / C)
want = 1 / (1 + 0.09 * np.sin(q * 3)**2 / (4 * 0.5 * 0.2))
assert abs(transmission(0.5, [(0.3, 3.0)]) - want) < 1e-9, "Above the barrier, the wavenumber is real and T oscillates; check the propagation matrix."
for E, VR in ((0.2, 0.1), (0.3, -0.1)):
    k1, k2 = np.sqrt(E), np.sqrt(E - VR)
    want = 4 * k1 * k2 / (k1 + k2)**2
    got = transmission(E, [], m, VR)
    assert abs(got - want) < 1e-9, f"A bare step to {VR} eV at E = {E} eV transmits {want:.6f} (lesson 49); got {got:.6f}. T is a ratio of currents."
assert abs(transmission(0.15, []) - 1) < 1e-12, "With no layers and VR = 0, T must be 1."
```

::: right
Right. One routine reproduces lesson 12's barrier and lesson 49's step exactly, and it handles any stack of layers.
:::
:::

::: check
kind: python

## Step 2. Write `resonance(layers, lo, hi, m=0.067, n=4001, VR=0.0)` returning `(E_peak, T_peak, fwhm)` from a scan of n energies between lo and hi.

```python starter
import numpy as np
C = 0.0381

def transmission(E, layers, m=0.067, VR=0.0):
    kL = np.sqrt(complex(m * E / C))
    kR = np.sqrt(complex(m * (E - VR) / C))
    M = np.eye(2, dtype=complex)
    k_prev = kL
    for V, d in layers:
        k = np.sqrt(complex(m * (E - V) / C))
        r = k_prev / k
        M = np.array([[np.exp(1j * k * d), 0], [0, np.exp(-1j * k * d)]]) @ (0.5 * np.array([[1 + r, 1 - r], [1 - r, 1 + r]])) @ M
        k_prev = k
    r = k_prev / kR
    M = 0.5 * np.array([[1 + r, 1 - r], [1 - r, 1 + r]]) @ M
    return float((kL / kR).real / abs(M[1, 1]) ** 2)

def resonance(layers, lo, hi, m=0.067, n=4001, VR=0.0):
    Es = np.linspace(lo, hi, n)
    T = np.array([transmission(E, layers, m, VR) for E in Es])
    # the peak (refine with a parabola through three points), and where T crosses half the peak on each side
    return 0.0, 0.0, 0.0

print(resonance([(0.3, 3.0), (0.0, 5.0), (0.3, 3.0)], 0.0786, 0.0986))
```

```python solution
import numpy as np
C = 0.0381

def transmission(E, layers, m=0.067, VR=0.0):
    kL = np.sqrt(complex(m * E / C))
    kR = np.sqrt(complex(m * (E - VR) / C))
    M = np.eye(2, dtype=complex)
    k_prev = kL
    for V, d in layers:
        k = np.sqrt(complex(m * (E - V) / C))
        r = k_prev / k
        M = np.array([[np.exp(1j * k * d), 0], [0, np.exp(-1j * k * d)]]) @ (0.5 * np.array([[1 + r, 1 - r], [1 - r, 1 + r]])) @ M
        k_prev = k
    r = k_prev / kR
    M = 0.5 * np.array([[1 + r, 1 - r], [1 - r, 1 + r]]) @ M
    return float((kL / kR).real / abs(M[1, 1]) ** 2)

def resonance(layers, lo, hi, m=0.067, n=4001, VR=0.0):
    Es = np.linspace(lo, hi, n)
    T = np.array([transmission(E, layers, m, VR) for E in Es])
    i = int(np.argmax(T))
    y0, y1, y2 = T[i - 1], T[i], T[i + 1]
    Ep = Es[i] + 0.5 * (Es[1] - Es[0]) * (y0 - y2) / (y0 - 2 * y1 + y2)
    half = T[i] / 2
    j = i
    while j > 0 and T[j] > half:
        j -= 1
    k = i
    while k < n - 1 and T[k] > half:
        k += 1
    cross = lambda a, b: Es[a] + (half - T[a]) * (Es[b] - Es[a]) / (T[b] - T[a])
    return float(Ep), float(T[i]), float(cross(k - 1, k) - cross(j, j + 1))

print(resonance([(0.3, 3.0), (0.0, 5.0), (0.3, 3.0)], 0.0786, 0.0986))
```

```python tests
E3, T3, w3 = resonance([(0.3, 3.0), (0.0, 5.0), (0.3, 3.0)], 0.0786, 0.0986)
assert abs(E3 - 0.0885990) < 2e-5, f"With 3 nm barriers the resonance is at 88.60 meV; got {E3 * 1000:.3f} meV."
assert T3 > 0.999, f"A symmetric double barrier transmits fully on resonance; got T = {T3:.4f}."
assert abs(w3 / 0.00472988 - 1) < 0.01, f"Its full width at half maximum is 4.73 meV; got {w3 * 1000:.3f} meV."
E2, T2, w2 = resonance([(0.3, 2.0), (0.0, 5.0), (0.3, 2.0)], 0.066, 0.106)
assert abs(E2 - 0.0862386) < 2e-5, f"With 2 nm barriers the resonance is at 86.24 meV; got {E2 * 1000:.3f} meV."
assert abs(w2 / 0.0164062 - 1) < 0.01, f"With 2 nm barriers the width is 16.41 meV; got {w2 * 1000:.3f} meV."
assert E2 < E3 < 0.0896, "Thinner barriers let the state leak more and lower it further below the isolated well's 89.6 meV."
```

::: right
Right. The 3 nm barriers give a 4.73 meV resonance, an escape time of 139 fs; thinning them to 2 nm widens it 3.5 times, close to the $e^{2\kappa\Delta b}$ = 3.4 the tunneling exponent predicts.
:::
:::

::: check
kind: python

## Step 3. Write `biased(b, w, Vb, Vbar=0.3, slices=10)`: the layers of a double barrier (barriers b, well w, in nm) with a bias Vb dropping linearly across the 2b + w active region, each region cut into `slices` flat slices using the potential at each slice's center.

```python starter
import numpy as np
C = 0.0381

def transmission(E, layers, m=0.067, VR=0.0):
    kL = np.sqrt(complex(m * E / C))
    kR = np.sqrt(complex(m * (E - VR) / C))
    M = np.eye(2, dtype=complex)
    k_prev = kL
    for V, d in layers:
        k = np.sqrt(complex(m * (E - V) / C))
        r = k_prev / k
        M = np.array([[np.exp(1j * k * d), 0], [0, np.exp(-1j * k * d)]]) @ (0.5 * np.array([[1 + r, 1 - r], [1 - r, 1 + r]])) @ M
        k_prev = k
    r = k_prev / kR
    M = 0.5 * np.array([[1 + r, 1 - r], [1 - r, 1 + r]]) @ M
    return float((kL / kR).real / abs(M[1, 1]) ** 2)

def resonance(layers, lo, hi, m=0.067, n=4001, VR=0.0):
    Es = np.linspace(lo, hi, n)
    T = np.array([transmission(E, layers, m, VR) for E in Es])
    i = int(np.argmax(T))
    y0, y1, y2 = T[i - 1], T[i], T[i + 1]
    Ep = Es[i] + 0.5 * (Es[1] - Es[0]) * (y0 - y2) / (y0 - 2 * y1 + y2)
    half = T[i] / 2
    j = i
    while j > 0 and T[j] > half:
        j -= 1
    k = i
    while k < n - 1 and T[k] > half:
        k += 1
    cross = lambda a, b: Es[a] + (half - T[a]) * (Es[b] - Es[a]) / (T[b] - T[a])
    return float(Ep), float(T[i]), float(cross(k - 1, k) - cross(j, j + 1))

def biased(b, w, Vb, Vbar=0.3, slices=10):
    total = 2 * b + w
    layers = []
    # three regions (barrier, well, barrier), each cut into slices
    return layers

lay = biased(3.0, 5.0, 0.04)
print(len(lay), resonance(lay, 0.0586, 0.0786, n=2001, VR=-0.04))
```

```python solution
import numpy as np
C = 0.0381

def transmission(E, layers, m=0.067, VR=0.0):
    kL = np.sqrt(complex(m * E / C))
    kR = np.sqrt(complex(m * (E - VR) / C))
    M = np.eye(2, dtype=complex)
    k_prev = kL
    for V, d in layers:
        k = np.sqrt(complex(m * (E - V) / C))
        r = k_prev / k
        M = np.array([[np.exp(1j * k * d), 0], [0, np.exp(-1j * k * d)]]) @ (0.5 * np.array([[1 + r, 1 - r], [1 - r, 1 + r]])) @ M
        k_prev = k
    r = k_prev / kR
    M = 0.5 * np.array([[1 + r, 1 - r], [1 - r, 1 + r]]) @ M
    return float((kL / kR).real / abs(M[1, 1]) ** 2)

def resonance(layers, lo, hi, m=0.067, n=4001, VR=0.0):
    Es = np.linspace(lo, hi, n)
    T = np.array([transmission(E, layers, m, VR) for E in Es])
    i = int(np.argmax(T))
    y0, y1, y2 = T[i - 1], T[i], T[i + 1]
    Ep = Es[i] + 0.5 * (Es[1] - Es[0]) * (y0 - y2) / (y0 - 2 * y1 + y2)
    half = T[i] / 2
    j = i
    while j > 0 and T[j] > half:
        j -= 1
    k = i
    while k < n - 1 and T[k] > half:
        k += 1
    cross = lambda a, b: Es[a] + (half - T[a]) * (Es[b] - Es[a]) / (T[b] - T[a])
    return float(Ep), float(T[i]), float(cross(k - 1, k) - cross(j, j + 1))

def biased(b, w, Vb, Vbar=0.3, slices=10):
    total = 2 * b + w
    layers = []
    for start, width, V0 in ((0, b, Vbar), (b, w, 0.0), (b + w, b, Vbar)):
        d = width / slices
        for s in range(slices):
            xm = start + (s + 0.5) * d
            layers.append((V0 - Vb * xm / total, d))
    return layers

lay = biased(3.0, 5.0, 0.04)
print(len(lay), resonance(lay, 0.0586, 0.0786, n=2001, VR=-0.04))
```

```python tests
lay = biased(3.0, 5.0, 0.0)
assert len(lay) == 30, f"Three regions of 10 slices make 30 layers; got {len(lay)}."
assert abs(sum(d for _, d in lay) - 11.0) < 1e-12, "The slices must add up to 2b + w = 11 nm."
for Vb, E_want, T_want in ((0.04, 0.0684690, 0.94263), (0.1, 0.0377943, 0.67604)):
    c = 0.0886 - Vb / 2
    E, T, _ = resonance(biased(3.0, 5.0, Vb), c - 0.01, c + 0.01, n=2001, VR=-Vb)
    assert abs(E - E_want) < 2e-5, f"At {Vb} V the resonance should be at {E_want * 1000:.2f} meV; got {E * 1000:.3f} meV."
    assert abs(T - T_want) < 3e-3, f"At {Vb} V the peak transmission should be {T_want:.4f}; got {T:.4f}. Is the right lead at -Vb?"
```

::: right
Right. The resonance falls by 20.1 meV at 40 mV and 50.8 meV at 100 mV, a little more than half the bias each time, and the peak transmission drops as the bias makes the two barriers unequal.
:::
:::

::: check
given: w = 2 | 4.73 | 16.4
answer: 658.21/w
unit: fs
tolerance: 0.5%

## A resonance has a full width of {w} meV. What's the escape time from the well?

::: right
Right. $\tau = \hbar/\Gamma$ = {answer} fs.
:::

::: misses
- [4135.7/w] Use ħ, not h.
- [any] Not yet. ħ = 658 meV·fs.
:::
:::

::: check
given: E = 60 | 88.6 | 120
answer: 2*E/1000
unit: V
tolerance: 0.5%

## An RTD's resonance sits {E} meV above the emitter's band edge at zero bias. In the linear-drop model, near what bias does the current peak?

::: right
Right. The resonance falls by about half the bias, so it reaches the band edge near $2E_r/e$ = {answer} V.
:::

::: misses
- [E/1000] Only about half the bias drops between the emitter and the well's center.
- [any] Not yet. The well's center is halfway through the structure.
:::
:::

::: check
given: k = 0.55 | 0.61 | 0.7; d = 0.5 | 1
answer: exp(2*k*d)
tolerance: 1%

## The barriers' decay constant at resonance is κ = {k} nm⁻¹. By what factor does the resonance narrow when each barrier is {d} nm thicker?

::: right
Right. $e^{2\kappa\Delta b}$ = {answer}.
:::

::: misses
- [exp(k*d)] The escape rate goes as each barrier's transmission, $e^{-2\kappa b}$.
- [any] Not yet. Γ is proportional to the barriers' transmission.
:::
:::

::: explain
## Why does an RTD's current fall when the voltage rises past its peak?

::: model
Electrons get through the double barrier efficiently only when their energy matches the well's quasi-bound level. Raising the bias lowers that level relative to the emitter, because part of the voltage drops between the emitter and the well. At first this brings the level down into the range of energies the emitter's electrons occupy, so more of them find a matching state and the current grows. Once the level drops below the emitter's conduction-band edge, no incoming electron has the right energy any more, and only small off-resonance tunneling remains, so the current falls even though the voltage keeps rising. That falling stretch is the negative differential resistance an oscillator uses.
:::
:::

::: practice

::: check
given: w = 0.1 | 0.8 | 2 | 5 | 10 | 25
answer: 658.21/w
unit: fs
tolerance: 0.5%

## Escape time for a {w} meV wide resonance?

::: misses
- [any] $\hbar/\Gamma$.
:::
:::

::: check
given: E = 30 | 45 | 60 | 100 | 150 | 200
answer: 2*E/1000
unit: V
tolerance: 0.5%

## Peak bias for a resonance {E} meV above the band edge?

::: misses
- [any] About $2E_r/e$.
:::
:::

::: check
given: k = 0.5 | 0.8; d = 0.4 | 1.5
answer: exp(2*k*d)
tolerance: 1%

## Narrowing factor for κ = {k} nm⁻¹ and {d} nm thicker barriers?

::: misses
- [any] $e^{2\kappa\Delta b}$.
:::
:::
:::
