Experimental tests of diffraction theory

In our undergraduate laboratory teaching we encourage students to think about their data and how to communicate what it means. Some years ago we introduced a prize for graphical excellence named after Florence Nightingale, an early pioneer in the creative presentation of data. The gold standard in the scientific method often means experiment and theory on the same graph. Odd then that many optics textbooks show lots of theory curves and photos of interference or diffraction but rarely both on the same graph.

This article discusses a simple example where we take a photo of a diffraction pattern and compare it to the prediction of Fraunhofer diffraction theory (see p. 85 in Optics f2f). All you need is a light source, a diffracting obstacle, and a camera. However, the trade-off is that to make the theory easier you need a more `idealised’ experiment.

First, we show a photo of the far-field diffraction pattern recorded on a camera when an obstacle consisting of 5 slits is illuminated by a laser.


The experiment was performed by Sarah Bunton an Ogden Trust Intern at Durham in 2016. The image is in black and white and saved as a .png file. The image is read using the python imread command and ‘replotted’ with axes.

from numpy import shape
from matplotlib.pyplot import close, figure, show,  cm
from matplotlib.image import imread

[ypix, xpix]=shape(img)
print ypix, xpix

fig = figure(1,facecolor='white')
ax = fig.add_axes([0.1, 0.1, 0.8, 0.8])
ax.axison = True

The code outputs the image size in terms of horizontal (x) and vertical (y) pixels, and allows us to identify a region of interest (rows 500 to 600 say). Now we want to analyse the data. First (lines 20-25), for illustration purposes only, we replot it as a colormap and reduce noise by binning the pixel data into superpixels made up of 2×2 real pixels.

from numpy import shape, arange, sin, pi
from matplotlib import rc
rc('font',**{'family':'serif','serif':['Times New Roman']})
from matplotlib.pyplot import close, figure, show, pcolormesh, xlabel, ylabel, rcParams,  cm
from matplotlib.image import imread


[ypix, xpix]=shape(img) # find size of image

fig = figure(1,facecolor='white')
ax = fig.add_axes([0.15, 0.3, 0.8, 1.0])
ax.axison = False # Start with True to find region of interest
ax.imshow(img[500:600,:],cmap=cm.gray) #Show region

small=img.reshape([ypix/4, 4, xpix/4, 4]).mean(3).mean(1) # create super pixels
ax = fig.add_axes([0.15, 0.875, 0.8, 0.1])
ax.axison = False
ax.pcolormesh(small) #plot image of super pixels

cut=557 #Select horizontal line to compare to theory
data=data**1.5 #Gamma correction

ax = fig.add_axes([0.15, 0.1, 0.8, 0.6])
ax.axison = True

x=arange(0.0001,xpix,1.0) # x values for theory line
xlabel('Position in the $x$ direction')
ylabel('${\cal I}/(N^2{\cal I}_0a^2/\lambda z)$')
ax.set_xticks([xoff-pi*flamd, xoff,(xoff+pi*flamd)])
ax.set_xticklabels(['$-(\lambda/d)z$', '0','$(\lambda/d)z$'])


Second, we select a row through the intensity maximum (lines 27-35) so that we can compare the intensity along the horizontal axis with the prediction of theory. For the theory (lines 37-48), we can measure the distances in the experiment (slit width, separation, distance to detector, pixel size and laser wavelength) or we can fit the data. Here we have only done a by-eye `fit’.


One thing you might notice in the code (line 29) is that we need to perform a scaling for the Gamma correction used by the camera. Some cameras may allow you to turn this off, otherwise you need to correct it in post-processing.

It is worth mentioning that the imread command is very versatile and can read many file formats, but if the image is colour then the data array may have three or four layers (RGB + tranparency) as well as horizontal and vertical position. Here is an example where we read in a jpg, direct from a camera, of Young’s double slit experiment using sunlight (more on that later). This is much more difficult to analyse unless we know how the exact spectral response of the RGB filters used in the camera, but still you can see some fun stuff like red is diffracted more than blue!

from numpy import shape
from matplotlib import rc
rc('font',**{'family':'serif','serif':['Times New Roman']})
from matplotlib.pyplot import close, figure, show, rcParams,  cm
from matplotlib.image import imread


[ypix, xpix, dim]=shape(img)

fig = figure(1,facecolor='white')
ax = fig.add_axes([0.15, 0.3, 0.8, 1.0])
ax.axison = False



ax = fig.add_axes([0.15, 0.35, 0.8, 0.25])
ax.axison = True

ax = fig.add_axes([0.15, 0.075, 0.8, 0.25])
ax.axison = True


ax.axison = True



Finally, here is an example for Biot’s sugar experiment,


where we see the effect of the overlap between the RGB channels, e.g. the scattered blue laser light even shows up in the red channel. The unsaturated data on the right (obtained through the horizontal polarizer) gives a better indication of the relative light levels.


Polarization: linear in the circular basis

We can describe the polarization of light (Chapter 5 in Optics f2f) in terms of a superposition (or statistical mixture) of left- and right-circularly polarized components (see p. 55 in Optics f2f). For example, linearly-polarized light consists of a superposition of equal amounts of left- and right-circular as in the Figure below. If you click on the interactive version you can watch the time evolution (use the left and right buttons on a keyboard to move forwards and backwards in time).


Click here to see interactive figure.

The field (shown in the centre) propagates from left to right and we have shown left and right components displaced towards the back and front, respectively. Notice, how as we move forward in time and look into the field, the left-hand and right-hand components (at a particular position as indicated by the red vectors) rotate anti-clockwise and clockwise, respectively.

An interesting effect occurs when we change the relative phase of the left and right components. Such a phase shift arises whenever light propagates through a circularly birefringent medium (p. 61 in Optics f2f), such as a solution of chiral molecules (e.g. sugar as discussed here) or an optical medium in a magnetic field. The effect of changing the relative phase (with time fixed) is illustrated in the next interactive figure.


Click here to see interactive figure.

We find the superposition remains linearly polarized but the plane of polarization rotates. This effect is the basis of optical activity and the Faraday effect (see p. 62 in Optics f2f).

From Fresnel to the lighthouse

From bees to Vikings (see p. 51 in Optics f2f), from Harrison’s chronometer to atomic clocks and GPS, navigation has always been a matter of live and death. Often, what begins as blue-skies scientific curiosity, may later save lives. A beautiful example is the work of Augustin-Jean Fresnel.

One early success of Young’s experiments was to inspire Frensel to study shadows using a honey-drop lens in 1815. To explain his observations, Fresnel developed the theory of diffraction that we still use today, see Chapter 5 in Optics f2f. Fresnel’s experiments and theory firmly established the wave theory of light, and began a new way of thinking about optical devices such as the humble lens. For Fresnel, a lens was less about bending light, than ensuring that all parts of the wave arrive with their peaks and troughs synchronised (in phase) at the focus.

Fresnel realised if we observe the light amplitude at a point then it is made up of contributions from the input plane that sometimes add in-phase and sometimes out-of-phase due to differences in the optical path. He separated the regions that add in and out-of phase into zones, where all the odd zones (white in the image below) have say a positive phase and all the even zones (grey in the image below) have a negative phase.


Fresnel zones: The white and grey regions contribute with positive and negative phase respectively and therefore interfere destructively with one another.

He showed that the light contributions from neighbouring zones where equal and opposite. So if you use a circular aperture to block all the light except for the two central zones then you observe zero light intensity (on axis). If you increase the radius of the aperture to allow the third zone to contribute then you observe high intensity again. This is illustrated in the two images below which show the light intensity pattern downstream of a circular hole. In both cases, the top image is light intensity observed in particular plane and the bottom image is how the light distribution is changing as it propagates (the green line marks the observation plane). If you click on the interactive plot you can vary the diameter of the hole and see how the pattern changes. Note in particular how the observed intensity on-axis oscillates between zero and a maximum as more and more Fresnel zones are allowed to contribute.


Click here to see interactive figure.

Once you have this concept of Fresnel zones then you realise that to make all the light contribute with same (or nearly the same) phase you just need a small adjustment to the phase within each zones to make each contribution interference constructively at the focus. Consequently, to make a lens, instead of a big thick piece of glass we can use segments of glass that produce the desired phase shift for each zone. This idea, illustrated on the right below, is known as the Fresnel lens.


The Fresnel lens completely revolutionised lighthouse design as now it was possible to make much larger lenses constructed from smaller lighter segments. The first Fresnel lens was installed in the Cordouan lighthouse only 8 years after Frensel began his blue-skies experiment using a honey-drop lens.

Postscript: The lighhouse story continues with another giant of nineteenth century physics, Michael Faraday. If you have the chance, go and visit his workshop below the Trinity Buoy Lighthouse in London.


Young’s double-slit in colour

Young’s double slit has become the standard paradigm to explore two-path interference. Not that it matters that Young’s did a different experiment that requires a different explanation. [1]

In the far-field, the ‘classic’ two-slit experiment produces fringes whose spacing is inversely proportional to the slit spacing. You can see this by varying the slit separation in the interactive figure linked below (credit to Nikola Sibalic).


Click here to see interactive figure.

Most textbooks only tell us about the far field, where the effect of diffraction dominates over the transverse size of the light distribution and we can make the Fraunhofer approximation, see e.g. p. 39 in Optics f2f. But now using computers it is easy to calculate the field everywhere. The code below uses Fresnel integrals, see p. 85 in Optics f2f, but we could also perform the calculation using Fourier methods, p. 99 in Optics f2f.

from numpy import dstack, linspace, size, sqrt, pi, clip
from pylab import figure, clf, show, imshow, meshgrid
from scipy.special import fresnel
from time import clock
from matplotlib.pyplot import close
startTime = clock()

Z, X = meshgrid(linspace(1,10001,480), linspace(-120,120,480))
R=0*X #initialise RGB arrays

wavelengths=linspace(0.4, 0.675, 12) # define 12 wavelengths + RGB conversion
rw=[0.1, 0.05, 0.0, 0.0,   0.0,   0.0, 0.0, 0.1, 0.13, 0.2, 0.2, 0.05]
gw=[0.0,  0.0,   0.0, 0.067, 0.133, 0.2, 0.2, 0.1, 0.067, 0.0, 0.0, 0.0]
bw=[0.1, 0.15, 0.2, 0.133, 0.067, 0.0, 0.0, 0.0,  0.0,   0.0, 0.0, 0.0]

a=12.5 #slit half width
off1=25.0 #slit offset

for ii in range (0,12): #add intensity patterns into the RGB channels

brightness=4.0 #saturate
RGB=dstack((R, G, B))

fig = figure(1,facecolor='white')
ax = fig.add_axes([0.05, 0.05, 0.9, 0.9])
ax.axison = False
print 'elapsed time: ', (clock() - startTime)

The code is so fast that it is easy to add colour as in the above example, where we have used the ideas from Interferometry in colour to create a wavelength to RGB mapping. By modifying the spectrum of the input light it is possible to explore coherence, see Chapter 8 in Optics f2f. By reducing the range of wavelengths, e.g. using a green filter as in the image below (in the code above, take the wavelength index from 4 to 8 instead of 0 to 12), we see higher fringe visibility off axis, see also Fig. 8.15 in Optics f2f, and we say that the light is more coherent.


Click here to see interactive figure.

[1] In his 1804 paper Young describes a experiment where a small hole is made in a screen to create a beam of sunlight. A thin card is placed in this beam to block the central portion such that the light can pass on either side and `interfere’ downstream. Such an arrangement is not easily explained by two-path interference. The diffraction pattern shown below is described by Fresnel diffraction in the near field and is a good example of Babinet‘s principle in the far-field, see p. 106 in Optics f2f.


Optical Fourier Transforms (of letters)

In Optics f2f we frequently use the example of letters to illustrate Fraunhofer diffraction (Chapter 6), convolution (Chapter 10 and Appendix B), spatial filtering (Chapter 10) and the properties of Fourier transforms in general (Chapters 6, 10 and Appendix B). Below, we share a python code, based on eqns (6.35) and (9.9) in Optics f2f, that calculates the intensity patterns associated with the optical Fourier transforms of letters.

The code works by printing a letter as an image, e.g. an E


then digitising this image as an array, calculating the Fourier transform, and finally plotting the modulus squared as a colormap.


The code (last updated 2019-02-14 [1]) evaluates eqns (6.35) and (9.9) in Optics f2f for cases where the input aperture function has the shape of a letter.

from numpy import frombuffer, uint8, mean, shape, zeros, log, flipud, meshgrid
from numpy.fft import fft2, fftshift, ifftshift
from matplotlib import figure, cm
from matplotlib.pyplot import close, show, figure, pcolormesh
fig = figure(1,facecolor='white')
ax = fig.add_axes([0.1, 0.1, 0.8, 0.8]) #add axis for letter
ax.axison = False
ax.text(-0.5,-1.0, 'Z', fontsize=460,family='sans-serif') #print letter
fig.canvas.draw() #extract data from figure
data = frombuffer(fig.canvas.tostring_rgb(), dtype=uint8)
data = data.reshape(fig.canvas.get_width_height()[::-1] + (3,))
bw-=1.0 #invert
[xpix, ypix]=shape(bw)
mul=4 # add zeros to increase resolution
F=flipud(fftshift(fft2(H))) #perform Fourier transform and centre
F2=Fr*Fr+Fi*Fi #calculate modulus squared
fig = figure(2,facecolor='white')
ax = fig.add_axes([0.1, 0.1, 0.8, 0.8])
ax.axison = False
p=ax.pcolormesh(log(Fs),cmap=cm.afmhot) # plot log(intensity) pattern
p.set_clim(12,20) #choose limits to highlight desired region

[1] Note, code works using python 2 and 3. Cut and paste text into jupyter notebook. Last tested using jupyter with python 3.7.1 numpy 1.15.4 and matplotlib 3.0.2 .

Biot’s sugar experiment

Of all experiments in optics, one can make a case that none pack more pedagogical punch then optical rotation in sugar. In one beautiful and simple experiment we learn about the physics of light scattering, polarization, chiral chemistry, and fluorescence.


Optical rotation was first discovered by Jean-Baptiste Biot in 1815, and has an almost immediate impact by providing a quantitative measure of the purity of sugar. [1] In 1848 Louis Pasteur establsihed chiral chemistry by using Biot’s optical rotation technique to distinguish between left- and right-handed tartrate crystals.


The modern variant of the experiment is to send a laser beam through a sugar solution, for example, corn syrup which is liquid at room temperature and about 1/3 glucose by weight.

For the laser we use the Hexa-beam laser which has the advantages of 6 colours in one box. Below we show photographs of first a green laser and second a blue laser passing through a tube of corn syrup.



In both cases we can see the laser beam as it propagages through the sugar but oddly the green laser seems to oscillate between bright green and a fainter orange, whereas the blue laser oscillates between blue and green. What is going on?

Light scattering

Given that we should never look directly at a laser beam we only ever see laser light because it is scattered. This light scattering effect is the same as we see in the sky. We are not looking at the sunlight directly, only sunlight that is scattered by molecules in the atmosphere (which scatter more blue than red, see p. 223 in Optics f2f).

If the light is propagating across our field of view and we are observing from the side then we only vertically polarized light is scattered. This is illustrated below for the case of unpolarized light propoaging from left to right and we observed vertically polarized light.


This effect is well known to landscape photographers who may exploit this effect using a polarizing filter. The images on the left and right below are taken with the polarizer aligned vertically and horizontally, respectively, allowing first vertical and second horizontally polarized light to pass. When we detect horizontal light (right image) the sky looks very dark because the scattered light is mostly vertically polarized and does not pass through the polarizer.


The difference in the sugar experiment is that the input is linearly polarized and we will only see scattered light from the side if the polarization is vertical and remains vertical. The fact that scattered green and blue in the experiment sometimes disappears suggests that the polarization might be changing as the light propagates.

Optical rotation

In fact, what happens is that the axis of linear polarization rotates, as shown in this figure.


The light starts out vertically polarized and we can see vertically polarized scattered light but then rotates to horizontal and we see nothing (in microscopic terms the electric charges in the sugar, cannot emit light in the direction of their oscillation, i.e. in the direction of the observer). As the light continues it rotates back to vertical and we see scattered light again. This explains the bands of light and dark observed in the experiment.

The reason for this rotation is that the sugar molecules are chiral (see p. 62 in Optics f2f).

As in landscape photography, we can verify the polarization of the scattered light by placing a linear polarizer between the object and the detector. Below we show what happens if we view the sugar experiment through both vertical (on the left) and horizontal (on the right) polarizing sheets. We have overlapped the two sheets slightly to show that through crossed polarizers we really do see nothing.


Through the vertical polarizers there is not much change, whereas through the horizontal polarizer all the scattered light (which is vertically polarized) is blocked and we see nothing. Well, not quite nothing. In fact we see some light of a different colour. This is fluorescence.


In fluorescence, the incident light is absorbed (not scattered), both the polarization and the wavelength of the emitted light can be different to the input. In this example the fluorescence is unpolarized which is why we can see it through both the vertical and linear polarizers. By energy conversation the wavelength of the emission cannot be shorter than that of the input which explains why the green and blue lasers produce orange and green fluorescence, respectively.

[1] According to The Shadow of Enlightenment
Optical and Political Transparency in France 1789-1848
Theresa Levitt, “the price of a batch of sugar was determined directly by its polarimeter reading”.

Laser design using the complex beam parameter

Three decades ago I began my PhD with the great Allister Ferguson. My goal would become to design and build the world’s first single-frequency Ti:sapphire laser. In January 1989 I began by designing a Nd:YAG ring laser. Below is a photograph of the first page of my PhD notebook.


To design a laser cavity, you start with the equations that describe the propagation of laser beams, and on the left (in the image) you can see a matrix equation that describes how the complex beam parameter q of a laser beam changes when it passes through a lens with focal length f  (or is reflected by a curved mirror). I had learnt this equation from Geoff Brooker, except that his equation (see here) included an odd factor called “cancel me”. At the time I did not understand why I needed to “cancel me”  but as long the equations gave the right answers (which they do) I could start building lasers.

The Nd:YAG laser worked and we published a paper, then I started work on the Ti:sapphire laser. Using the same equations this is the desgin I came up with.


Using an early version of the laser we published a paper on Doppler-free spectroscopy of rubidium atoms. Later this laser was developed into a commercial product by Microlase who subsequently became Coherent Scotland. Hundreds of these lasers (perhaps one thousand by now costing around 100k each) have been sold worldwide. I mention this because it helps us to appreciate the utility of both maths and physics.

Thirty years on, while writing a textbook on optics, I found the motivation to revisit those old equations on the complex beam parameter and rewrite them in a more elegant form. As I suspected there is no need for “cancel me” or even to write the equation in the form of a matrix times a vector. The point is that a gaussian beam is simply a paraxial spherical wave with a complex argument (see p. 178 in Optics f2f) and an ideal lens or curved mirror is simply an element which modifies the curvature of a spherical wave (see p. 27-8 of Optics f2f).

This beautiful piece of mathematics (p. 181 in Optics f2f), with real applications, has been putting `bread on the table’ for many, over many years.