Transfer matrix of a delta potential (source code)

= Transfer matrix of a delta potential
{title2=$D(x_0)$}

For $V(x)=g\delta(x-x_0)$, put $q=\sqrt{2mE}/\hbar>0$ and $\gamma=mg/(\hbar^2q)$. Relate the coefficients of $Ae^{iqx}+Be^{-iqx}$ immediately to the right and left by $v_R=D(x_0)v_L$. Continuity of the <wavefunction> and integration of the <Schrödinger equation> across the <delta potential> give $\psi'(x_0^+)-\psi'(x_0^-)=2mg\psi(x_0)/\hbar^2$. Solving these two matching equations gives
$$
D(x_0)=\begin{pmatrix}1-i\gamma&-i\gamma e^{-2iqx_0}\\i\gamma e^{2iqx_0}&1+i\gamma\end{pmatrix},\qquad\det D(x_0)=1.
$$
For scatterers at $x_1<\cdots<x_N$, the full <transfer matrix> is $M=D(x_N)\cdots D(x_1)$: the leftmost scatterer acts first on the coefficient column. With these globally phased <plane waves>, the propagation phases are already in each $D(x_j)$. For incidence only from the left, $t=1/M_{22}$ and $r=-M_{21}/M_{22}$ follow from $(t,0)^T=M(1,r)^T$ and $\det M=1$.