Finite Differences

In this recitation we will explore a really useful way to think about quantum mechanical operators. We will discretize space, and view the operators as finite matrices. This is a very powerful approach -- and often when something abstract confuses you, going to this representation can simplify your thoughts. Although not exclusively, we will often use this representation for computations, for theoretical discussions and homework.

Instead of thinking of $x$ as a continuous variable, we imagine it can take on only $N$ discrete equally spaced values $x_1,x_2,\cdots, x_N$. In that case a function $\psi(x)$ can be fully represented by its values at these $N$ points, $f_1=f(x_1), f_2=f(x_2),\cdots$. We then think of $f$ as a vector $\vec f=(f_1,f_2,\cdots f_n)$.

Any linear operator (like the Hamiltonian) acts in this representation as a matrix. Take for example the operator $\hat x$, defined by $(\hat xf)(x)=x f(x)$. If we evaluate this expression at the positions $x_j$ we get $(\hat x f)(x_j)=x_j f(x_j)$, and we can think of $\hat x$ as the matrix
\begin{equation}
\overleftrightarrow{ x}=\left(\begin{array}{cccc}
x_1&0&\cdots&\\
0&x_2&0&\cdots\\
\vdots&&&
\end{array}\right).
\end{equation}
A less trivial example is the derivative operator, $\partial$ defined by $(\partial f)(x)=f^\prime(x)$. The simplest way to understand this operator is to consider the Taylor expansion of $f$,
\begin{eqnarray}
f(x+\delta)&=&f(x)+\delta f'(x)+\frac{\delta^2}{2} f''(x)+\cdots
\end{eqnarray}
Note, as long as $f$ is well behaved, and $\delta$ is small, then each term in this series is smaller than the previous one. It is therefore reasonable to truncate at the second order. Lets write down this approximation (and the one we get with $x-\delta$)
\begin{eqnarray}
f(x+\delta)&\approx&f(x)+\delta f'(x)+\frac{\delta^2}{2} f''(x)\\
f(x-\delta)&\approx&f(x)-\delta f'(x)+\frac{\delta^2}{2} f''(x)
\end{eqnarray}
Subtracting these equations, and specializing to points on the grid, we find
\begin{equation}
(\partial f)(x_n)=f'(x_n)=\frac{1}{2\delta}f(x_{n+1})-\frac{1}{2\delta} f(x_{n-1}),
\end{equation}
where $\delta$ is the grid spacing. We can write this as a vector expression as
\begin{eqnarray}
(\partial f)_n&=&\frac{1}{2\delta} f_{n+1} -\frac{1}{2\delta} f_{n-1}\\
&=& \sum_m \partial_{nm} f_m
\end{eqnarray}
with $\partial_{nm}=1/(2\delta^2)$ if $m=n+1$, and $\partial_{nm}=-1/(2\delta^2)$ if $m=n-1$, but $\partial_{nm}=0$, for all other values of $m$.
In other words
\begin{equation}
\overrightarrow{(\partial f)} = \overleftrightarrow{\delta} \vec f
\end{equation}
with
\begin{equation}
\overleftrightarrow{\delta}=
\left(
\begin{array}{cccc}
0&\frac{1}{2\delta}&\cdots&\\
-\frac{1}{2\delta}&0&\frac{1}{2\delta}&\cdots\\
0&-\frac{1}{2\delta}&0&\frac{1}{2\delta}\\
\cdots
\end{array}
\right).
\end{equation}
You will work with the computer, generating these matrices, and studying their properties.