Monthly Archives: May 2016

The Quantum “Finite Step” problem


The Probability Wave:


The Wave Function:


This is an animation of the Finite Step problem, as described in a typical undergraduate quantum mechanics textbook.

  • The top animation shows the evolution of |\psi|^2 the probability density function.
  • The bottom animation shows the full wave function \psi. The real part is blue and the imaginary part is red.
  • Note how the probability wave “tunnels” a little way through the potential barrier.

Note: The animation may look better if you view it directly on Vimeo. Just click on the word “Vimeo” on the player.

Leave a Comment

Filed under Simulations

The Twins

This is an animation of the relativistic “twins” scenario. One twin stays on Earth. The other travels away at a high rate of velocity and then comes back.

Typically when you see this situation analysed in a textbook, they have the travelling twin doing something like going out at half the speed of light then instantaneously changing direction and coming back in at the same speed. They then proceed to use the two different frames of reference (going out and coming back in) to show that the travelling twin ages less than the one who stayed at home.

I wanted to try to model a more “realistic” scenario. One that could, at least in principle, actually happen. So what I’ve done here is to have the travelling twin accelerate out at 1 Earth gravity for half the “out” trip. Then the traveller decelerates at 1g for the other half of the way out, coming to a stop at the outward point. This 1g acceleration and deceleration if the repeated on the way back home.

So, instead of two frames of reference, we are “integrating over an infinite number of frames.” Of course, this is actually a numeric simulation and approximates the situation with a finite number of calculations.

The green “grid” lines represent the space and time coordinate systems of the travelling twin, as seen in the Earth frame. Note that, as the traveller “approaches” the speed of light, it’s not possible to draw “enough” grid lines.

Leave a Comment

Filed under Simulations

Liouville’s Theorem

The idea of this animation is to give an example of Liouville’s theorem in phase space.

I’m using a Hamiltonian suggested by Josh in the Portland Math and Science Group:

H=\sin(p) + \sin(x)

Leading to the update equations:

\dot{x}=\frac{\partial H}{\partial p}=\cos(p)

\dot{p} = -\frac{\partial H}{\partial x}=-\cos(x)

This Hamiltonian is not intended to represent any actual physical system. I’m using it simply because it exhibits an “interesting” behaviour.

We start out with a circle of radius 5 centered at the origin. In particular, it should be the case that none of the interior points (colored red) ever “cross” the boundary (colored black). Of course, I can only animate a finite number of points (in this case 1000 boundary points). But hopefully, it gives the basic picture.

The source code can be found at:

The Portland Math & Science repro at Github

It works on Ubuntu 12.04 with “all the regular python stuff” installed, for whatever that’s worth.

Leave a Comment

Filed under Simulations