A double slit experiment#

Author Audun Skau Hansen ✉️

The Hylleraas Centre for Quantum Molecular Sciences, 2022


Richard Feynman once famously claimed that exerything in quantum mechanics can be understood in light of the double slit experiment. In his own words, it “contains the only mystery” of quantum physics.

If this is true, it is (perhaps) good news. It means that all we have to do to master quantum physics is to properly simulate the double slit experiment, and derive all insight from our results. So let’s do just that. And maybe we’ll steer clear of profound philosophical conundrums along the way.

A classical wave in a box#

In the following simulations we shall use the wavebox extension of BubbleBox:

import bubblebox as bb
from bubblebox.wavebox import boundaries_edge
import numpy as np
import matplotlib.pyplot as plt
b = bb.wavebox(resolution = (350,450), size = (3.5,4.5))

# set initial state
#b.u = np.exp(-500*((b.x[0][:, None] - 1.5)**2 + b.x[1][None,:]**2)) 


def boundaries_single_slit(resolution, slitwidth = 5):
    bo = np.zeros(resolution, dtype = bool)
    bo[:, 0] = True
    bo[:, -1] = True
    bo[int(resolution[0]/2), :int(resolution[1]/2)-slitwidth] = True
    bo[int(resolution[0]/2), int(resolution[1]/2)+slitwidth:] = True
    bo[0,:] = True
    bo[-1,:] = True
    return bo
    
    
def source(t):
    return 20*np.exp(-500*((b.x[0][:, None] - 1.5)**2 + b.x[1][None,:]**2))*np.sin(25*t)
    
    
b.source = source

# set boundary conditions
b.set_neumann_boundary_conditions(boundaries_single_slit(b.resolution))

interference_pattern = np.zeros(b.resolution[1], dtype = float)
for i in range(20):

    for j in range(80):
        b.advance()
    
        interference_pattern += b.u[1]**2

    plt.figure()
    plt.imshow(b.representation())
    plt.show()
    
plt.figure()
plt.plot(interference_pattern)
plt.show()
../../_images/58ebdfa873781e190f4e589930a20e73db1f679ecbc5d5b935b45d7c427a2852.png ../../_images/1d297d5f420895593bd01ba23f5b2cb20a8809270bb08ceac03409b7a1740079.png ../../_images/25698a8284f46aefe00e8b7b9ef2340c24d775a8bb6abd57c02339b6f06cae1b.png ../../_images/f0169eeb1595890d3b641dd7666d7f36209a1aa8c3c901918be90a68c48b3aeb.png ../../_images/f65c86a370a85a88b4770e96478e330d1ea5613e99e67835a41b4c11b663925d.png ../../_images/03af574ea91432451399e796dabf72cdac0d0f5a9bf75fc5c82641356e2050b7.png ../../_images/faed5cc8eb10c667bb90226610e6e51b12397990da8202ccba1bff516bb04ca9.png ../../_images/cfd7a3b804abc51dcc18967caee45c2a3fdab1577f68a2a57d2bdcfc786da14a.png ../../_images/3da5ef091be48004971d6e95f9570e10ec9f1bc8cfda8c7b38367ba624082d1a.png ../../_images/3c640990f174abc556bc020e308c7a15c90e02392922a76c907ac59a14b1a9c1.png ../../_images/2d4d89d4066e945c7dc7a1873dc9acd164017a40987210166865d538caa9a700.png ../../_images/9eabf231d1707f435ebbc3b6d472fcec84a1331d578973c4f00d1ef17f3751a3.png ../../_images/3b666f0b42b6e2a354e73cad06c8599459561737497f901d038df68a8e9a599a.png ../../_images/89534a7ad0831df2e7584aadb4d644b0b3797815c3a7655798decd17bab67c3f.png ../../_images/18813e8393f1ed442bc597bdf27977daa718e07eeeb0c247219f4df18ce66992.png ../../_images/467f085b329732f4d3067cfe1f8cb063b11cb879497f88ca148127215595e27e.png ../../_images/62eebb8ec77f9027c0fcb0878603f98596fa1e335067c4afbee6074b05c8de1f.png ../../_images/4330d920d5401bcc47f9d3e604368f35739482434c1348986c3f0bc6e3b07c83.png ../../_images/84f912097e4d1816a6fdd360469a1a648504e42a74a8f519d87c9b9565af7cfd.png ../../_images/65a9bb42b8506a49c8dc9b5db3a916812ee30f9de704cf9fedc474d3a63ed5a7.png ../../_images/7e65925d93240dd415d35aefbb9aa5de725d5736617f254e5572810373c02fd8.png
def boundaries_double_slit(resolution, slitwidth = 5, slit_separation = 32):
    bo = np.zeros(resolution, dtype = bool)
    bo[:, 0] = True
    bo[:, -1] = True
    bo[int(resolution[0]/2), :]=True
    
    
    bo[int(resolution[0]/2), int(resolution[1]/2)-slit_separation-slitwidth:int(resolution[1]/2)-slit_separation+slitwidth] = False
    
    bo[int(resolution[0]/2), int(resolution[1]/2)+slit_separation-slitwidth:int(resolution[1]/2)+slit_separation+slitwidth] = False
    
    bo[0,:] = True
    bo[-1,:] = True
    return bo
    
b = bb.wavebox(resolution = (350,450), size = (3.5,4.5))


# set initial state
#b.u = np.exp(-500*((b.x[0][:, None] - 1.5)**2 + b.x[1][None,:]**2)) 

#b.potential = lambda 
    
def source(t):
    return 20*np.exp(-500*((b.x[0][:, None] - 1.5)**2 + b.x[1][None,:]**2))*np.sin(25*t)
b.source = source
    
# set boundary conditions
b.set_neumann_boundary_conditions(boundaries_double_slit(b.resolution))

interference_pattern = np.zeros(b.resolution[1], dtype = float)
for i in range(20):

    for j in range(80):
        b.advance()
    
        interference_pattern += b.u[1]**2

    plt.figure()
    plt.imshow(b.representation())
    plt.show()
    
plt.figure()
plt.plot(interference_pattern)
plt.show()
../../_images/76933c4a9b37dc92f4cd5a3211d4c6bcf37266280a04570b201c291a3b5deb3a.png ../../_images/08cbfd88036259637c2730d64164f5723adb32c148ab07ae0f089908e526d6b0.png ../../_images/4a48dc02965034906463dad18200296ba806e4f9fbcaae45b3e2ea856e7867c3.png ../../_images/4243f9a4531e71f09f6198154e15a8e60b544847c72c6391490a708eb43452af.png ../../_images/13788f3d414765db210cc39428a6ae610e0b90ee3bcc4459f9a055e31bebe947.png ../../_images/22ed32e8dec761bd64248ec225f50d0ec02b6b0ceba057df4d6c5a9a30613ed4.png ../../_images/9348bc125e97cdac9619364efed237cd3ede18a5c9b00e02c17353cfb8d579df.png ../../_images/a8a1bfa97611f4df8c3fb3080f3a0e4cd8d05afdcfdab5b504286f54663b334f.png ../../_images/6d9d4e629c1a3ec622e171e87ae0f2ced66c50972037d8362bd498e97f75e765.png ../../_images/0a5adf96d6577a4826668ee3809a85e3dc3638f04e9f12fb3b04b9904e5a1d3f.png ../../_images/df29f6abf6fb9b12f7e00cbe76cd44d1e44206f50184fdf4b9d3fba4b3728090.png ../../_images/403134efe132b2dc7f9576c2330ab36376feeca9a3ed4ad964163ed71918b779.png ../../_images/6eb8cf7bdff707a5716fcb1ca902c8f45ec9d256bf3b4a62070917b6846e2410.png ../../_images/120a8d0bb1cbe7bb2cdf62908c40f6982658c9f16116b63cfd4a23fa770153a4.png ../../_images/8826e18c016e5e59e6da97ed959fc60b5a69f28bb3e6fb54605cbad1e1fff093.png ../../_images/fa8a05be3bc7918f72ba2653d6c32e9c68377b188bbfd5a464b299c399278070.png ../../_images/66633f51aed1e50738a74753c0509ee6d816f0d16d44724a36f191f976da76f8.png ../../_images/bf1bd2a91e638383a1d33540aaf027799011d8fcedbe7b316c63d27fbda7e5a2.png ../../_images/5d902a5ddf5d42dc976c5e36f65adb5e20156dd91ce74604ca837e88fc384ed5.png ../../_images/627ac59bbb9b37ef318de7c2bb9106c96fa6a4b0359663231d6e42b767b6c787.png ../../_images/c52da037a6647a56722461302f4d129d4adc63ca26cc629c49e4bccdd6a10531.png