Particle in a Box
From PIMC++
For a particle in a box with periodic boundary conditions, the quantized energy levels in a cube of side
are
where
and
but
is not allowed.
The expectation value of the energy is
where
.
This sum will converge rapidly to
and can be computed numerically with a few lines of Python code, for example.
