---
title: "Project: a quantum-well laser's wavelength"
heading: Electron and hole levels in a finite well, designed to a target wavelength
eyebrow: "B12 · Lesson 53 · Project: a quantum-well laser's wavelength"
xp: 80
---

::: hook
The 850 nm lasers in datacenter optical links (VCSELs) emit from GaAs quantum wells a few nanometers thick between AlGaAs barriers. The wavelength isn't set by GaAs's bulk gap, 871 nm, but by the well: confinement pushes the lowest electron level up and the lowest heavy-hole level down, widening the effective gap. So the designer picks the well width to hit the wavelength. In this project you'll build that calculation from the finite-well physics of B10.12 and the band offsets of lesson 33: solve for the confined levels exactly, assemble the transition energy, and search for the width that lands on 850 nm.
:::

::: predict
## A GaAs quantum well between Al₀.₃Ga₀.₇As barriers emits at 850 nm. Roughly how wide is it?

- [ ] 0.5 nm
- [ ] 3 nm
- [x] About 11 nm
- [ ] About 100 nm

::: reveal
850 nm is 1.459 eV, 35 meV above GaAs's 1.424 eV gap. That extra energy is the electron's and heavy hole's confinement energies combined. With the finite-well levels for 0.243 eV and 0.131 eV barriers, the well that gives exactly 35 meV is 10.65 nm wide: about 38 monolayers of GaAs. A 100 nm well would emit essentially at the bulk 871 nm.
:::
:::

::: nameit
## The model

- GaAs gap $E_g$ = 1.424 eV; barrier $\text{Al}_x\text{Ga}_{1-x}\text{As}$ with $\Delta E_g$ = 1.247x eV, split 65% to the conduction band, 35% to the valence band.
- Electrons: mass 0.067, well depth $\Delta E_c$. Heavy holes: mass 0.5, well depth $\Delta E_v$. (Same mass in well and barrier, for simplicity.)
- Transition energy $E = E_g + E_{e1} + E_{hh1}$ and wavelength λ = 1239.84/E nm. (The exciton's binding, about 8 meV in a narrow well, would lower E slightly; we leave it out.)

## The finite well's ground state

For a well of width L and depth $V_0$, set a = L/2 and $z_0 = a\sqrt{mV_0/c}$, c = 0.0381 eV·nm². The even ground state satisfies

$$\tan z = \sqrt{\frac{z_0^2}{z^2} - 1}, \qquad 0 < z < \min\left(\frac\pi2, z_0\right)$$

and its energy is $E = \frac{c}{m}\left(\frac za\right)^2$. The left side rises from 0 and the right falls to 0, so there's exactly one root: bisection finds it to machine precision.

## What you'll write

1. `ground_level(V0, L, m)`: the ground-state energy (eV) above the well bottom, by bisecting the equation above.
2. `emission(L, x=0.3)`: return `(E, wavelength_nm)` for a well of width L between $\text{Al}_x\text{Ga}_{1-x}\text{As}$ barriers.
3. `design_width(target, x=0.3, lo=2.0, hi=30.0)`: bisect on L (wider wells emit longer wavelengths) until `emission` gives the target wavelength.
:::

::: example
## Find the electron and heavy-hole levels of an 8 nm GaAs well with Al₀.₃Ga₀.₇As barriers.

::: solution
1. **Well depths.** $\Delta E_g$ = 0.374 eV, so the electron well is 0.243 eV deep and the hole well 0.131 eV.
2. **Electron level.** The electron's ground level comes out at 45.0 meV (an infinite well would give 87.7).
3. **Heavy-hole level.** The heavy hole's comes out at 8.3 meV (infinite: 11.8).
4. **Transition energy and wavelength.**
   $$\begin{aligned} E &= 1.424 + 0.045 + 0.008 \\ &= 1.477\ \text{eV} \end{aligned}$$
   so λ = 839.3 nm.

**Answer:** the electron level is at 45.0 meV and the heavy-hole level at 8.3 meV, so the well emits at 1.477 eV, or 839.3 nm.
:::
:::

::: example
## Why does the electron level differ so much from the infinite-well estimate, while the hole's differs less?

::: solution
1. **The electron.** The electron is light, so its infinite-well energy (88 meV) is a large fraction of its 243 meV barrier.
2. **Leakage into the barriers.** Its wave function leaks substantially into the barriers, lowering the level almost by half.
3. **The heavy hole.** Its infinite-well energy is only 12 meV against a 131 meV barrier, so it's well confined and the finite well changes it by about 30%.
4. **When it matters.** Light carriers in shallow wells need the full finite-well treatment.

**Answer:** the light electron's infinite-well energy is a large fraction of its barrier, so it leaks into the barriers and its level drops almost by half; the heavy hole is well confined and shifts only about 30%.
:::
:::

::: check
kind: python

## Step 1. Write `ground_level(V0, L, m)`.

```python starter
import math
C = 0.0381

def ground_level(V0, L, m):
    a = L / 2
    z0 = a * math.sqrt(m * V0 / C)
    # bisect tan(z) - sqrt((z0/z)^2 - 1) on (0, min(pi/2, z0))
    z = 0.5 * min(math.pi / 2, z0)
    return C / m * (z / a) ** 2

print(ground_level(0.243, 8, 0.067))
```

```python solution
import math
C = 0.0381

def ground_level(V0, L, m):
    a = L / 2
    z0 = a * math.sqrt(m * V0 / C)
    f = lambda z: math.tan(z) - math.sqrt((z0 / z) ** 2 - 1)
    lo, hi = 1e-12, min(math.pi / 2, z0) * (1 - 1e-12)
    for _ in range(200):
        mid = 0.5 * (lo + hi)
        if f(lo) * f(mid) <= 0:
            hi = mid
        else:
            lo = mid
    z = 0.5 * (lo + hi)
    return C / m * (z / a) ** 2

print(ground_level(0.243, 8, 0.067))
```

```python tests
import math
for V0, L, m, want in ((0.243, 8, 0.067, 0.045039713), (0.131, 8, 0.5, 0.0082601616), (0.243, 4, 0.067, 0.10428545)):
    got = ground_level(V0, L, m)
    assert abs(got - want) < 1e-7, f"A {L} nm well, {V0} eV deep, mass {m}: ground level {want * 1000:.4f} meV; got {got * 1000:.4f} meV."
deep = ground_level(1000.0, 10, 0.067)
inf = C * math.pi ** 2 / (0.067 * 100)
assert abs(deep / inf - 1) < 0.01, "A very deep well should approach the infinite-well energy."
```

::: right
Right. Bisection on the transcendental equation gives the levels exactly, and a very deep well recovers the infinite-well result.
:::
:::

::: check
kind: python

## Step 2. Write `emission(L, x=0.3)` returning `(E, wavelength_nm)`.

```python starter
import math
C = 0.0381

def ground_level(V0, L, m):
    a = L / 2
    z0 = a * math.sqrt(m * V0 / C)
    f = lambda z: math.tan(z) - math.sqrt((z0 / z) ** 2 - 1)
    lo, hi = 1e-12, min(math.pi / 2, z0) * (1 - 1e-12)
    for _ in range(200):
        mid = 0.5 * (lo + hi)
        if f(lo) * f(mid) <= 0:
            hi = mid
        else:
            lo = mid
    z = 0.5 * (lo + hi)
    return C / m * (z / a) ** 2

def emission(L, x=0.3):
    # gap + electron level (65% of the offset, m = 0.067) + heavy-hole level (35%, m = 0.5)
    E = 1.424
    return E, 1239.84 / E

print(emission(8))
```

```python solution
import math
C = 0.0381

def ground_level(V0, L, m):
    a = L / 2
    z0 = a * math.sqrt(m * V0 / C)
    f = lambda z: math.tan(z) - math.sqrt((z0 / z) ** 2 - 1)
    lo, hi = 1e-12, min(math.pi / 2, z0) * (1 - 1e-12)
    for _ in range(200):
        mid = 0.5 * (lo + hi)
        if f(lo) * f(mid) <= 0:
            hi = mid
        else:
            lo = mid
    z = 0.5 * (lo + hi)
    return C / m * (z / a) ** 2

def emission(L, x=0.3):
    dEg = 1.247 * x
    E = 1.424 + ground_level(0.65 * dEg, L, 0.067) + ground_level(0.35 * dEg, L, 0.5)
    return E, 1239.84 / E

print(emission(8))
```

```python tests
for L, x, want in ((8, 0.3, 839.2561), (5, 0.3, 813.7303), (20, 0.3, 863.3035), (8, 0.2, 842.7444)):
    E, lam = emission(L, x)
    assert abs(lam - want) < 0.01, f"An {L} nm well with x = {x} should emit at {want:.2f} nm; got {lam:.3f}."
    assert abs(lam - 1239.84 / E) < 1e-9, "Return the energy and the wavelength that goes with it."
```

::: right
Right. The well emits from 814 nm at 5 nm wide to 863 nm at 20 nm, always above the 1.424 eV bulk gap.
:::
:::

::: check
kind: python

## Step 3. Write `design_width(target, x=0.3, lo=2.0, hi=30.0)`.

```python starter
import math
C = 0.0381

def ground_level(V0, L, m):
    a = L / 2
    z0 = a * math.sqrt(m * V0 / C)
    f = lambda z: math.tan(z) - math.sqrt((z0 / z) ** 2 - 1)
    lo, hi = 1e-12, min(math.pi / 2, z0) * (1 - 1e-12)
    for _ in range(200):
        mid = 0.5 * (lo + hi)
        if f(lo) * f(mid) <= 0:
            hi = mid
        else:
            lo = mid
    z = 0.5 * (lo + hi)
    return C / m * (z / a) ** 2

def emission(L, x=0.3):
    dEg = 1.247 * x
    E = 1.424 + ground_level(0.65 * dEg, L, 0.067) + ground_level(0.35 * dEg, L, 0.5)
    return E, 1239.84 / E

def design_width(target, x=0.3, lo=2.0, hi=30.0):
    # bisect on L: a wider well emits a longer wavelength
    return 0.5 * (lo + hi)

print(design_width(850))
```

```python solution
import math
C = 0.0381

def ground_level(V0, L, m):
    a = L / 2
    z0 = a * math.sqrt(m * V0 / C)
    f = lambda z: math.tan(z) - math.sqrt((z0 / z) ** 2 - 1)
    lo, hi = 1e-12, min(math.pi / 2, z0) * (1 - 1e-12)
    for _ in range(200):
        mid = 0.5 * (lo + hi)
        if f(lo) * f(mid) <= 0:
            hi = mid
        else:
            lo = mid
    z = 0.5 * (lo + hi)
    return C / m * (z / a) ** 2

def emission(L, x=0.3):
    dEg = 1.247 * x
    E = 1.424 + ground_level(0.65 * dEg, L, 0.067) + ground_level(0.35 * dEg, L, 0.5)
    return E, 1239.84 / E

def design_width(target, x=0.3, lo=2.0, hi=30.0):
    for _ in range(60):
        mid = 0.5 * (lo + hi)
        if emission(mid, x)[1] < target:
            lo = mid
        else:
            hi = mid
    return 0.5 * (lo + hi)

print(design_width(850))
```

```python tests
for target, x, want in ((850, 0.3, 10.6521), (830, 0.35, 6.8327)):
    L = design_width(target, x)
    assert abs(L - want) < 1e-3, f"For {target} nm with x = {x}, the well should be {want:.3f} nm; got {L:.4f}."
    assert abs(emission(L, x)[1] - target) < 0.01, "The designed well must actually emit at the target."
```

::: right
Right. A 10.65 nm well hits 850 nm with Al₀.₃Ga₀.₇As barriers; deeper barriers (x = 0.35) let a narrower 6.8 nm well reach 830 nm.
:::
:::

::: check
given: l = 800..860 step 5
answer: 1239.84/l - 1.424
unit: eV
tolerance: 0.5%

## A GaAs quantum well emits at {l} nm. How much combined confinement energy does that imply, $E_{e1} + E_{hh1}$?

::: right
Right. $\frac{1239.84}{\lambda} - 1.424$ = {answer} eV.
:::

::: misses
- [1239.84/l] That's the whole photon energy; subtract the gap.
- [any] Not yet. Photon energy minus GaAs's 1.424 eV.
:::
:::

::: check
given: x = 0.2 | 0.3 | 0.4; f = 0.65
answer: f*1.247*x
unit: eV
tolerance: 0.5%

## How deep is the electron well for $\text{Al}_x\text{Ga}_{1-x}\text{As}$ barriers with x = {x}, if {f} of the gap difference falls in the conduction band?

::: right
Right. {answer} eV.
:::

::: misses
- [1.247*x] That's the whole gap difference.
- [any] Not yet. $f \times 1.247x$.
:::
:::

::: check
given: L = 5 | 8 | 10; m = 0.067 | 0.5
answer: 0.0381*pi^2/(m*L^2)*1000
unit: meV
tolerance: 0.5%

## What would an infinite well {L} nm wide give for the ground level of a carrier with mass {m}? (The finite-well answer is always lower.)

::: right
Right. $\frac{\pi^2c}{mL^2}$ = {answer} meV.
:::

::: misses
- [any] Not yet. $E_1 = \frac{0.376}{mL^2}$ eV.
:::
:::

::: explain
## Why does a narrower quantum well emit at a shorter wavelength?

::: model
The light comes from an electron in the lowest conduction-band level of the well recombining with a hole in the highest valence-band level. In a bulk crystal those sit at the band edges, separated by the gap. In a well, both carriers are confined, so their lowest levels sit above the band edges by their confinement energies, which grow roughly as $1/L^2$ (less steeply once the levels approach the barrier tops). Narrowing the well raises the electron's level and lowers the hole's, widening the effective gap and shifting the emitted photon to higher energy and shorter wavelength. The laser's color is therefore chosen by the well width as much as by the material.
:::
:::

::: practice

::: check
given: l = 800..860 step 5
answer: 1239.84/l - 1.424
unit: eV
tolerance: 0.5%

## Confinement energy implied by {l} nm emission?

::: misses
- [any] $1239.84/\lambda - 1.424$.
:::
:::

::: check
given: x = 0.15 | 0.45; f = 0.6 | 0.65
answer: f*1.247*x
unit: eV
tolerance: 0.5%

## Electron well depth for x = {x}, conduction share {f}?

::: misses
- [any] $f \times 1.247x$.
:::
:::

::: check
given: L = 4 | 12; m = 0.067 | 0.45
answer: 0.0381*pi^2/(m*L^2)*1000
unit: meV
tolerance: 0.5%

## Infinite-well ground level: {L} nm, m = {m}?

::: misses
- [any] $\pi^2c/mL^2$.
:::
:::
:::
