B10 · Lesson 51 · Quantum lab
Finite differences, shooting, and the levels of real wells
Only a handful of potentials have exact solutions. Device engineers solve the rest numerically, and two methods cover most of what they need. Finite differences turn the Schrödinger equation into a matrix eigenvalue problem: every level at once. Shooting integrates the equation from one wall at a trial energy and adjusts the energy until the solution lands on the other wall: one level at a time, very accurately. In this lab you'll write both, check them against the infinite well and the oscillator, use shooting on the 10 nm GaAs well of lesson 12, and solve the MOSFET triangular well that lessons 37 and 38 could only approximate.
Predict
A finite-difference solver uses 1000 interior points across an infinite well. How accurate is its ground-state energy?
The second-difference formula is exact for up to a factor . With that's an error of . Higher levels, with more wiggles per grid point, are less accurate in proportion to .
Name it
What you'll write
fd_levels(V, a, b, n=1000, k=4, m=1.0): the lowest k energies (eV) for the potential V(x) (x in nm, V in eV) on (a, b) with hard walls, effective mass m (in units of ), using n interior grid points. The Hamiltonian is the symmetric tridiagonal matrix with on the diagonal and −t beside it, where and c = 0.0381 eV·nm². Usenp.linalg.eigvalsh.numerov(V, E, a, b, n=4000, m=1.0): integrate from ψ(a) = 0, ψ(a + h) = h to x = b with Numerov's method, and return ψ(b). Thenshoot_level(V, a, b, lo, hi, m=1.0, n=4000): bisect on the sign of ψ(b) between energies lo and hi, which must bracket one level, 50 times.triangular_levels(F, m, k=2): the lowest k levels of the triangular well V = eFx (F in MV/cm, so eF = 0.1F eV/nm) with a hard wall at x = 0, usingfd_levelson a domain long enough that the far wall doesn't matter.
Numerov's method
For , with :
It's accurate to per unit length for smooth potentials. At a jump in V, put a grid point exactly on the jump and give V its average value there; otherwise the well's edges are effectively misplaced by up to a grid step.
What to expect
- Infinite well: eV.
- Oscillator : .
- 10 nm GaAs well with 0.3 eV walls: 34.21, 132.59 and 271.50 meV.
- Triangular well: and .
Worked example
Write the oscillator potential for ħω = 50 meV with x in nm.
Show the solution
- The potential. With , which is 0.0381 eV·nm²,
- Ground-state width.
- Choosing the box. A box from −8 to 8 nm puts the walls about nine widths away, where ψ is negligible for the first several levels.
Answer eV with x in nm.
Worked example
How do you know which level shooting found?
Show the solution
- Count the zeros. Count the zeros of ψ between the walls: level j has j − 1 of them.
- Watch the sign at the far wall. As E increases through the levels, ψ(b) changes sign once per level, so between two consecutive levels it has one fixed sign.
- Bracket and bisect. Bracketing with energies on either side of a single sign change, and bisecting, can't skip to the wrong level.
Answer count the nodes of ψ (level j has j − 1), and bracket a single sign change of ψ(b) so bisection can't jump to another level.
Check
Step 1. Write fd_levels(V, a, b, n=1000, k=4, m=1.0).
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 numerov(V, E, a, b, n=4000, m=1.0) and shoot_level(V, a, b, lo, hi, m=1.0, n=4000).
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 triangular_levels(F, m, k=2) using fd_levels.
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Check
A finite-difference solver uses N = 200 interior points in an infinite well. By about what fraction does it underestimate level j = 3?
Check
What coefficient, in eV/nm², gives an electron oscillator potential with ħω = 50 meV?
Write units the way you normally would: 1.5 eV/nm², 1500 meV/nm² and 0.0015 keV/nm² are the same answer.
Check
What's the second level of the triangular well at 1 MV/cm with = 0.19?
Write units the way you normally would: 1.5 eV, 1500 meV and 0.0015 keV are the same answer.
Explain why
Why does a shooting solution at a wrong energy blow up past the far wall, and how does that help find the level?
In a region where the energy is below the potential, the equation's solutions grow or decay exponentially. At an allowed energy, the solution that started at the first wall decays into the far barrier, matching the boundary condition. At any other energy it contains a little of the growing solution, which takes over and drives ψ toward large positive or negative values. Which way it goes flips as the trial energy passes through a level, so the sign of ψ at the far end acts as a switch, and bisection on that sign homes in on the level as precisely as the arithmetic allows.
Practice
Keep practicing
6 kinds of problem on this topic, dealt one at a time with new numbers every time, for as long as you like.