keyboard Computational Activity

120 min.

Electrostatic potential of four point charges
Computational Physics Lab II 2022

electrostatic potential python

Students write python programs to compute and visualize the potential due to four point charges. For students with minimal programming ability and no python experience, this activity can be a good introduction to writing code in python using numpy and matplotlib.

keyboard Computational Activity

120 min.

Electrostatic potential of a square of charge
Computational Physics Lab II 2022

integration electrostatic potential surface charge density

Students write python programs to compute the potential due to a square of surface charge, and then to visualize the result. This activity can be used to introduce students to the process of integrating numerically.

keyboard Computational Activity

120 min.

Electrostatic potential of spherical shell
Computational Physics Lab II 2022

electrostatic potential spherical coordinates

Students solve numerically for the potential due to a spherical shell of charge. Although this potential is straightforward to compute using Gauss's Law, it serves as a nice example for numerically integrating in spherical coordinates because the correct answer is easy to recognize.

keyboard Computational Activity

120 min.

Sinusoidal basis set
Computational Physics Lab II 2022

inner product wave function quantum mechanics particle in a box

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.

keyboard Computational Activity

120 min.

Mean position
Computational Physics Lab II 2022

probability density particle in a box wave function quantum mechanics

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 Computational Activity

120 min.

Position operator
Computational Physics Lab II 2022

quantum mechanics operator matrix element particle in a box eigenfunction

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.