This site is version 0.0.1. Most of the code on this site is drafted by an agent and needs review. I apologize for the AI-speak, we are working on rewriting it!
viv-lang.org

Notebooks · posts/transfer-matrices-and-resonant-tunneling

Tunneling through one and two barriers by transfer matrices

An electron meets a barrier it does not have the energy to climb. Chop the potential into flat pieces, and the wave on each side of every edge is related by a 2 by 2 matrix; the product of those matrices gives the chance of getting through, , and of bouncing back, . They add to 1 at every energy, to within . Two barriers 4 apart, each of which alone lets through less than 1% at , together let through 100% at that energy.

Units: , so a wave of energy in a region where the potential is has wavenumber . Every barrier here is high and 1 wide.

The reference, posts/refs/transfer-matrices-and-resonant-tunneling.py, does not multiply transfer matrices. It writes every matching condition of the whole potential as one linear system and solves it with numpy.linalg.solve, and it finds the resonances with scipy.optimize. The single barrier is also checked against its textbook closed form.

Look inside this program

  • Atlas

    The program’s map: every function and which calls which.

  • There’s no recorded run of this program yet.

Shift+Enter in a cell runs it and moves to the next. Running a cell runs every cell above it too, as one program.

A wave meets a step

Where the potential is flat, the time-independent Schrödinger equation has two solutions, a wave moving right and one moving left:

When the square root is imaginary, , and the two waves become a decaying and a growing exponential. That is tunneling: the wave does not stop at the wall, it fades inside it. The program takes the complex square root and never needs to ask which case it is in.

At an edge where jumps, and must be continuous. Those are two linear equations between on the left and on the right, so the right pair is a 2 by 2 matrix times the left pair. Crossing a flat region of width multiplies by and by , another 2 by 2 matrix. The whole potential is the product of these matrices, one matrix .

Far to the left the wave is the incoming one plus a reflected one, . Far to the right there is only the transmitted wave, . So , and the second row gives , the first . With the same potential on both sides, the transmission probability is and the reflection probability .

[1]lines 52–127

One barrier, and the check that nothing is lost

For a single rectangular barrier the answer is known in closed form. Below the top, with and width ,

and above it becomes with and becomes . The cell compares the matrix product with this formula at 500 energies from 0.05 to 10.

The second check needs no formula. The electron is either transmitted or reflected, so . Nothing in the matrix product enforces that; it comes out only if every matching condition is right. Before running: above the barrier top, is equal to 1? Classically yes. For a wave it is 1 only where a whole number of half wavelengths fit in the barrier, , and below 1 between those energies.

[2]lines 149–211

Two barriers

Now put a second barrier 4 to the right of the first. Between them is a well, and a particle trapped in a well of width 4 with infinitely high walls could have only the energies : 0.308, 1.234, 2.776. With walls of finite height the particle can leak out, so these are not exact states, but near such an energy a wave that gets into the well reflects back and forth between the walls and adds up in phase.

Each wall alone lets through about 1% at the lowest of these energies. A naive guess for two walls in a row is the product, . Before running: what is at the resonance?

The cell scans 3000 energies below the top, takes every local maximum of , and refines each by golden-section search, a bracket that shrinks by the golden ratio each step, until it is wide. Then it finds the two energies around each peak where by bisection; their distance is the width of the resonance.

[3]lines 234–353

Every resonance reaches to within (T_res), while a single wall at the same energy passes 0.94%, 4.9% and 16% (T_alone). The two walls are identical, so the waves reflected by the far wall and leaking back through the near one cancel the near wall's own reflection exactly at resonance. The resonances sit below the infinite-well energies (0.211 against 0.308), because the wave reaches into the walls and the well is effectively wider. The widths grow with the single-wall transmission: a leakier well holds the wave for a shorter time, and a shorter-lived state has a broader resonance.

The plot energies below are 400 evenly spaced points plus 41 points across each peak, since the first peak is narrower than the spacing of the even ones. The single wall is the dashed curve.

[4]lines 370–402