B95 of 29
0 XP
  1. Hook
  2. Play
  3. Predict
  4. Name it
  5. Check
  6. Explain

B9 · Lesson 5 · Quantum lab

Energy levels by matrix, a finite well by bisection, tunneling and the uncertainty principle in code

The first four lessons solved the box with hard walls exactly and estimated everything else: finite wells, barriers, wave packets. A computer removes the need to estimate. In this lab you'll find a box's energy levels as the eigenvalues of a matrix, solve a finite well's ground state by bisection, compute the exact chance of tunneling through a barrier and see when the simple exponential estimate is trustworthy, and check the uncertainty principle on a wave packet with the FFT.

  • An electron of energy E meets a barrier of height V and thickness d. The solid curve is the exact chance of getting through, the dashed one the simple estimate 16E(V−E)V2e−2κd, on a log scale against thickness.
  • For thick barriers the two curves lie on top of each other. For thin ones the estimate overshoots, and at zero thickness it gives a nonsense value.
  • The readout gives the exact transmission through 1 nm.

Predict

A GaAs well 10 nm wide (effective mass 0.067) has walls 0.3 eV high instead of hard walls. How does its ground state compare with the hard-walled box's 56 meV?

Name it

Levels from a matrix

On a grid of spacing Δx, the second derivative is ψi+1−2ψi+ψi−1Δx2, so the Schrödinger equation −ℏ22mψ′′=Eψ becomes a matrix eigenvalue problem. The matrix has ℏ2mΔx2 on its diagonal and −ℏ22mΔx2 beside it, and its eigenvalues are the energy levels. Any potential can be added to the diagonal.

A finite well

For a well of depth V0 and width a, the even states satisfy ktan⁡ka2=κ, with k=2mEℏ inside and κ=2m(V0−E)ℏ in the walls. The ground state lies below both V0 and the hard-wall value, and bisection finds it by halving an interval where the function changes sign.

Exact tunneling

Through a rectangular barrier of height V0 and thickness d, with E<V0,

T=[1+V02sinh2⁡κd4E(V0−E)]−1,

which for κd≫1 becomes 16E(V0−E)V02e−2κd.

Uncertainty by FFT

A wave packet's momentum distribution is its Fourier transform. For a Gaussian ψ=e−x2/4σ2, the spreads of |ψ|2 in x and of its transform in k multiply to exactly 12, the smallest product the uncertainty principle allows.

Worked example

How accurately does a 500-point grid reproduce the levels of a 1 nm box?

Show the solution
  1. Compare the levels. The matrix gives the three lowest levels below, against the exact values (computed with the same constants).
LevelGrid (eV)Exact (eV)Error
10.3761060.3761080.0003%
21.5044111.5044300.0013%
33.3848683.3849680.003%
  1. How the error scales. The errors grow as n2 for higher states and shrink as 1N2 with more points.
  2. Where the grid struggles. The grid struggles most with the highest states, which wiggle fastest, but the first few levels come out to four or five digits.
  3. Other wells. The same code with any potential on the diagonal solves wells nobody can solve on paper.

Answer very closely: the first three levels are off by 0.0003%, 0.0013% and 0.003%.

Worked example

What is the exact chance that a 1 eV electron tunnels through a 3 eV barrier 1 nm thick, and how good is the simple estimate? And through 0.2 nm?

Show the solution
  1. Decay constant. κ=2m×2 eVℏ=7.24×109m−1 so κd = 7.24 for the 1 nm barrier.
  2. The 1 nm barrier. The exact formula gives 1.813×10−6, and the estimate agrees to six digits.
  3. The 0.2 nm barrier. Here κd = 1.45, and the exact value is 0.180 while the estimate gives 0.196, 9% high.
  4. Where the estimate works. The simple exponential holds whenever κd is more than about 2, which covers almost every barrier that matters in devices.

Answer through 1 nm the chance is 1.813×10−6, and the estimate agrees to six digits; through 0.2 nm it's 0.180, and the estimate is 9% high.

Worked example

What are the wavelengths of the first three Balmer lines, from En=−13.6 eVn2?

Show the solution
  1. Photon energies. Drops to level 2 from levels 3, 4 and 5 release 13.6(14−1n2)eV which is 1.889, 2.550 and 2.856 eV.
  2. Wavelengths. Those are 656.4, 486.2 and 434.1 nm: red, blue-green and violet.
  3. Compare with measurement. The measured lines are at 656.3, 486.1 and 434.0 nm, so the simple model is off by about a part in 10 000.
  4. Why they differ. The gap comes mostly from the proton not being infinitely heavy, and correcting for the reduced mass closes most of it.

Answer 656.4, 486.2 and 434.1 nm (red, blue-green and violet).

Check

Step 1. Write box_levels(L, N, k) that builds the N × N finite-difference matrix for an electron in a box of width L (N interior points, spacing LN+1) and returns its k lowest eigenvalues in eV. Use ħ = 1.0546 × 10⁻³⁴ J·s, m = 9.109 × 10⁻³¹ kg and 1.602 × 10⁻¹⁹ J/eV.

Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.

Check

Step 2. Write well_ground(V0, a, mr) that finds the ground state (in eV) of a finite well of depth V0 eV and width a meters for a particle of mass mr times the electron's, by bisection on ktan⁡ka2−κ between nearly 0 and the smaller of V0 and the hard-wall energy.

Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.

Check

Step 3. Write T_exact(E, V0, d) and T_approx(E, V0, d) for an electron (energies in eV, d in meters) tunneling through a rectangular barrier, using the exact formula and the exponential estimate.

Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.

Check

Step 4. Write packet(sigma, N) that samples ψ=e−x2/4σ2 on N points across 40σ, computes the standard deviations of |ψ|2 in x and of |ψ~|2 in k (with np.fft.fft and np.fft.fftfreq), and returns (dx, dk, dx * dk).

Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.

Check

Step 5. Write balmer(nmax) returning the wavelengths in nm of hydrogen's lines from levels 3 to nmax down to level 2, using 13.6 eV and hc = 1239.84 eV·nm, and series_limit() returning the shortest Balmer wavelength.

Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.

Check

An electron of 1 eV meets a barrier 2 eV high and 1.5 nm thick.

(a)

What is κd?

(b)

What is the exact transmission?

Check

A finite-difference grid with N interior points in a box spaces them LN+1 apart. By roughly what factor would the spacing squared shrink, going from N to 2N + 1 points? (Answer as spacing² at N over spacing² at 2N + 1, divided by 4.)

Explain why

Why does a finite well's ground state sit lower than a hard-walled box of the same width?

Practice

Keep practicing

4 kinds of problem on this topic, dealt one at a time with new numbers every time, for as long as you like.