XQUANTUM, a quantum wave evolver

Oliver Knill, Posted December 5, 2025

xquantum.c

Abstract: the program xquantum.c, is a simple quantum simulator for X windows, written in C. I have placed the file in the public domain. Acknowledgements are welcome if you should develop it further. The program has been written on 22 April 2000 (which I was still at UT Texas). The x-interface was adapted from a program "xfires" written by Michael Creutz creutz@wind.phy.bnl.gov. Creutz wrote a nice book "quarks, gluons and lattices" which is a bookfriend of mine since early grad school. For the theory, see O. Knill, "A remark on quantum dynamics", Helvetica Physica Acta, 71, 233-241, 1998. This was a paper in which also experiments were done exploring the spectral type of various operators for which the spectral type is not known. My favorite example, (which I experimented with in the paper) is the random magnetic field model on a 2-dimensional flat lattice. My experiments (with the help of a beautiful Wiener theorem in Fourier theory) indicated that there is no point spectrum almost everywhere for that model. I was able to compute the first 1000 Fourier coefficients exactly on a 1000x1000 lattice. The reason why this was possible is because one can compute the Fourier coefficients by running the (coupled map lattice) cellular automaton. See the PDF.

In a Unix X windows environment like linux (like Ubuntu), you need he X11 development libraries. You get them with
sudo apt install libx11-dev
To compile and run xquantum.c, here is the Makefile:
compile:
        gcc -O -o xquantum xquantum.c -lX11 -lm
test:
        ./xquantum 10000 slit.ppm
Update February 11, 2026: I asked GPT 5.2 to adapt the program so that it compiles in the Xwindows implementation Xquartz of OS X.
 clang -O2 -Wall -Wextra -o xquantum xquantum_osx.c \
  -I/opt/X11/include -L/opt/X11/lib -lX11 -lm
An animation with a slightly larger slit experiment for the 4K resolution in the short (I ran it on a minisforum small form factor and recorded with OBS). The animation was accelerated exactly 8 times to get the short.
Oliver Knill, Posted December 5, 2025