## Activity: Kinetic energy

Computational Physics Lab II 2022
Students implement a finite-difference approximation for the kinetic energy operator as a matrix, and then use numpy to solve for eigenvalues and eigenstates, which they visualize.
What students learn
1. The wave function relates to a ket by $\psi(x) = \langle x|\psi\rangle$.
2. A wave function can be represented as an array holding the value of the wave function on a grid of points.
3. In this “position basis," the potential energy operator is diagonal, but the kinetic energy operator is not.
4. A differential operator like $\hat T$ can be approximated as a finite difference.

This activity introduces finite difference approximations, follows Position operator.

We have already seens several representations of the state of a particle moving in one dimension. We looked at wave functions and representation in a set of sinusoidal basis functions. The sinusoidal basis set had the advantage that we could use a finite amount of information to describe a smooth function at least approximately.

##### Note
You might think a wave function can be described with a finite amount of information, but that is only true for a function that can be described analytically. In the general case, we have no such luck, and require an infinite amount of information, essentially the value of the function at every possible position $x$.

There is another very effective finite representation for wave functions, which you've actually been using for weeks now (at least in effect), but we haven't talked about as a representation. That is the value of the function on a grid of regularly spaced points separated by a distance $\Delta x$. \begin{align} |\psi\rangle &\,\dot= \begin{pmatrix} \psi(\Delta x) \\ \psi(2\Delta x) \\ \psi(3\Delta x) \\ \psi(4\Delta x) \\ \vdots \\ \psi(L-2\Delta x) \\ \psi(L-\Delta x) \end{pmatrix} \end{align} This “discretized wave function” representation is what you have already been using when you create a plot, and also for numerically integrating to find inner products.

Note: I am not including in this vector $\psi(0)$ (or $\psi(L)$ at the other end). This is because the boundary condition at the edge of the box requires that the wave function have a zero value at those two points. We could instead have chosen to include those two points, and then manually forced their values to be zero.

## The kinetic energy

The kinetic energy of a particle in one dimension is given by \begin{align} \hat T &= \frac{\hat p^2}{2m} = -\frac{\hbar^2}{2m\Delta x^2}\frac{d^2}{dx^2} \end{align} Now this is a new beast for you, which we call a differential operator. Whenever you are confused by an operator, it helps to operate it on something. \begin{align} \hat T\psi(x) &= -\frac{\hbar^2}{2m}\left.\frac{d^2\psi}{dx^2}\right|_x \end{align} Our question for today is how we can represent this operator in our new “discretized wave function” representation. This requires us to think about what a derivative means, and I'll start with a first derivative: \begin{align} \left.\frac{d\psi}{dx}\right|_x &= \lim_{\Delta x\rightarrow 0}\frac{\psi(x+\Delta x/2) - \psi(x-\Delta x/2)}{\Delta x} \end{align} where I have used a centered difference, because it is symmetric. Now if $\Delta x$ is reasonably small, we can just omit the limit, which is called a finite difference approximation. Now we want a second derivative, so we need to repeat this. \begin{align} \frac{d^2\psi}{dx^2}(x) &= \lim_{\Delta x\rightarrow 0}\frac{\left.\frac{d\psi}{dx}\right|_{x+\Delta x/2} - \left.\frac{d\psi}{dx}\right|_{x-\Delta x/2}}{\Delta x} \\ &\approx \frac{\left(\psi(x+\Delta x) - \psi(x)\right)-\left(\psi(x)-\psi(x-\Delta x)\right)}{\Delta x^2} \\ &= \frac{\psi(x+\Delta x) +\psi(x-\Delta x)- 2\psi(x)}{\Delta x^2} \end{align} So you can see that the second derivative at $x$ is sort of a difference between the average of $\psi$ at the surrounding points and the value of $\psi(x)$. We can now plug this approximation into our definition for the kinetic energy operator to find: \begin{align} \hat T\psi(x) &\approx \frac{\hbar^2}{2m\Delta x^2}\left(2\psi(x)-\psi(x+\Delta x)-\psi(x-\Delta x)\right) \label{eq:finite-diff} \end{align} This equation is sufficient to express the kinetic energy operator as a matrix in terms of our discretized wave function representation. I will give you the result here, and ask you to prove it in a moment: \begin{align} \hat T &\,\dot= \frac{\hbar^2}{2m\Delta x^2} \begin{pmatrix} 2 & -1 & 0 & 0 & \cdots \\ -1 & 2 & -1 & 0 & \cdots \\ 0 & -1 & 2 & -1 & \cdots \\ 0 & 0 & -1 & 2 & \cdots \\ \vdots & \vdots & \vdots & \vdots & \ddots \end{pmatrix} \label{eq:T-matrix} \\ \begin{pmatrix} \hat T\psi(\Delta x) \\ \hat T\psi(2\Delta x) \\ \hat T\psi(3\Delta x) \\ \hat T\psi(4\Delta x) \\ \vdots \end{pmatrix} &= \frac{\hbar^2}{2m\Delta x^2} \begin{pmatrix} 2 & -1 & 0 & 0 & \cdots \\ -1 & 2 & -1 & 0 & \cdots \\ 0 & -1 & 2 & -1 & \cdots \\ 0 & 0 & -1 & 2 & \cdots \\ \vdots & \vdots & \vdots & \vdots & \ddots \end{pmatrix} \begin{pmatrix} \psi(\Delta x) \\ \psi(2\Delta x) \\ \psi(3\Delta x) \\ \psi(4\Delta x) \\ \vdots \end{pmatrix} \end{align}

1. On paper (or whiteboard) confirm by matrix multiplication that the matrix in Eq. \ref{eq:T-matrix} is equivalent to the finite difference equation in Eq. \ref{eq:finite-diff}. Raise your hand.
2. Create a 2D array (or matrix) that represents the kinetic energy operator in a discrete "wave function" representation (i.e. Eq. \ref{eq:T-matrix}).
3. Find the eigenvalues and eigenfunctions/eigenvectors of the kinetic energy operator. (use numpy)
4. Plot the 4 eigenfunctions with the lowest energy. Raise your hand.
5. Create a second plot in which you visualize the eigenvalues.
6. Make your $\Delta x$ smaller, and see how these things change.
Extra fun

Construct a matrix for a harmonic potential energy operator \begin{align} \hat V &= \frac12 k \hat x^2 \end{align} This will require you to make use of the fact that \begin{align} \hat x \left|{\psi}\right\rangle \dot=\, x\psi(x) \end{align} which means that \begin{align} \begin{pmatrix} (\Delta x)\psi(\Delta x) \\ (2\Delta x)\psi(2\Delta x) \\ (3\Delta x)\psi(3\Delta x) \\ (4\Delta x)\psi(4\Delta x) \\ \vdots \end{pmatrix} &= \begin{pmatrix} x_{11} & x_{12} & x_{13} & \cdots \\ x_{21} & x_{22} & x_{23} & \cdots \\ x_{31} & x_{32} & x_{33} & \cdots \\ \vdots & \vdots & \vdots & \ddots \end{pmatrix} \begin{pmatrix} \psi(\Delta x) \\ \psi(2\Delta x) \\ \psi(3\Delta x) \\ \psi(4\Delta x) \\ \vdots \end{pmatrix} \end{align} where $x_{11}$ etc are unknowns that you must determine.

Once you have created a matrix representation for $\hat x$ and $\hat V$ in the discretized wavefunction representation, solve for the eigenvectors and eigenvalues of $\hat V$ and visualize its eigenvectors.

Then on a separate figure plot the potential $V(x)$ and visualize the eigenvalues as horizontal lines.

Springy fun

Construct a matrix for a Hamiltonian \begin{align} \hat H &= \hat T + \hat V \end{align} Solve for the eigenvectors and eigenvalues, and visualize a few of the lowest energy eigenvalues and eigenvectors.

In a separate figure plot the potential $V(x)$ and visualize the energy eigenvalues as horizontal lines.

How are your results affected by changing the spring constant $k$?

• keyboard Position operator

keyboard Computational Activity

120 min.

##### Position operator
Computational Physics Lab II 2022

Students find matrix elements of the position operator $\hat x$ in a sinusoidal basis. This allows them to express this operator as a matrix, which they can then numerically diagonalize and visualize the eigenfunctions.
• group Energy and Angular Momentum for a Quantum Particle on a Ring

group Small Group Activity

30 min.

##### Energy and Angular Momentum for a Quantum Particle on a Ring

Quantum Ring Sequence

Students calculate probabilities for a particle on a ring using three different notations: Dirac bra-ket, matrix, and wave function. After calculating the angular momentum and energy measurement probabilities, students compare their calculation methods for notation.
• group Hydrogen Probabilities in Matrix Notation

group Small Group Activity

30 min.

##### Hydrogen Probabilities in Matrix Notation
Central Forces 2023 (2 years)
• group Going from Spin States to Wavefunctions

group Small Group Activity

60 min.

##### Going from Spin States to Wavefunctions
Quantum Fundamentals 2022 (2 years)

Arms Sequence for Complex Numbers and Quantum States

Students review using the Arms representation to represent states for discrete quantum systems and connecting the Arms representation to histogram and matrix representation. The student then extend the Arms representation to begin exploring the continuous position basis.
• assignment Working with Representations on the Ring

assignment Homework

##### Working with Representations on the Ring
Central Forces 2023 (3 years)

The following are 3 different representations for the $\textbf{same}$ state on a quantum ring for $r_0=1$ $$\left|{\Phi_a}\right\rangle = i\sqrt{\frac{ 2}{12}}\left|{3}\right\rangle - \sqrt{\frac{ 1}{12}}\left|{1}\right\rangle +\sqrt{\frac{ 3}{12}}e^{i\frac{\pi}{4}}\left|{0}\right\rangle -i\sqrt{\frac{ 2}{ 12}}\left|{-1}\right\rangle +\sqrt{\frac{ 4}{12}}\left|{-3}\right\rangle$$ $$\left| \Phi_b\right\rangle \doteq \left( \begin{matrix} \vdots \\ i\sqrt{\frac{ 2}{12}}\\ 0 \\ -\sqrt{\frac{ 1}{12}} \\ \sqrt{\frac{ 3}{12}}e^{i\frac{\pi}{4}} \\ -i\sqrt{\frac{ 2}{12}}\\ 0 \\ \sqrt{\frac{4}{12} }\\ \vdots \end{matrix}\right) \begin{matrix} \leftarrow m=0 \end{matrix}$$ $$\Phi_c(\phi) \doteq \sqrt{\frac{1}{24 \pi}} \left( i\sqrt{2}e^{i 3 \phi} -e^{i\phi} +\sqrt{3}e^{i\frac{\pi}{4}} -i \sqrt{2} e^{-i\phi} + \sqrt{4}e^{-i 3 \phi} \right)$$

1. With each representation of the state given above, explicitly calculate the probability that $L_z=-1\hbar$. Then, calculate all other non-zero probabilities for values of $L_z$ with a method/representation of your choice.
2. Explain how you could be sure you calculated all of the non-zero probabilities.
3. If you measured the $z$-component of angular momentum to be $3\hbar$, what would the state of the particle be immediately after the measurement is made?
4. With each representation of the state given above, explicitly calculate the probability that $E=\frac{9}{2}\frac{\hbar^2}{I}$. Then, calculate all other non-zero probabilities for values of $E$ with a method of your choice.
5. If you measured the energy of the state to be $\frac{9}{2}\frac{\hbar^2}{I}$, what would the state of the particle be immediately after the measurement is made?

• group Matrix Representation of Angular Momentum

group Small Group Activity

10 min.

##### Matrix Representation of Angular Momentum
Central Forces 2023 (2 years)
• group Quantum Expectation Values

group Small Group Activity

30 min.

##### Quantum Expectation Values
Quantum Fundamentals 2022 (3 years)
• keyboard Mean position

keyboard Computational Activity

120 min.

##### Mean position
Computational Physics Lab II 2022

Students compute probabilities and averages given a probability density in one dimension. This activity serves as a soft introduction to the particle in a box, introducing all the concepts that are needed.
• keyboard Sinusoidal basis set

keyboard Computational Activity

120 min.

##### Sinusoidal basis set
Computational Physics Lab II 2022

Students compute inner products to expand a wave function in a sinusoidal basis set. This activity introduces the inner product for wave functions, and the idea of approximating a wave function using a finite set of basis functions.
• face Ideal Gas

face Lecture

120 min.

##### Ideal Gas
Thermal and Statistical Physics 2020

These notes from week 6 of Thermal and Statistical Physics cover the ideal gas from a grand canonical standpoint starting with the solutions to a particle in a three-dimensional box. They include a number of small group activities.

Learning Outcomes
• ph366: 1) Write functions and entire programs in python
• ph366: 2) Apply the python programming language to solve scientific problems
• ph366: 3) Use the matplotlib and numpy packages
• ph366: 4) Model the physical systems studied in the course