Review of Last Lecture¶
In Lecture 2.1, we established the key ideas about waves and interference:
Traveling waves in complex form:
Intensity is the magnitude squared:
Interference comes from adding amplitudes before squaring:
For two sources with phases and :
Only the relative phase matters — the intensity depends on , not on the individual phases.
Today we’ll explore two important interferometers: the Michelson interferometer (historically crucial for physics) and the Mach-Zehnder interferometer (conceptually cleaner for quantum computing). Then we’ll develop the Bloch sphere as a way to visualize qubit states.
iClicker: Review Question¶
Two waves interfere with intensity . If , the interference is:
(A) Constructive ()
(B) Destructive () ✓
(C) Partially constructive ()
(D) Depends on the wavelength
The Michelson Interferometer¶
Before we dive into the Mach-Zehnder interferometer, let’s discuss its historically important cousin: the Michelson interferometer.
The Setup¶
Figure 1:The Michelson interferometer. Light from a source is split by a beam splitter (BS). One beam travels to mirror M1 (distance ), the other to mirror M2 (distance ). Both beams reflect back and recombine at the beam splitter, where interference determines how much light goes to the detector.
Components:
BS: A 50/50 beam splitter at 45° to the incoming beam
M1, M2: Mirrors that reflect light back toward the beam splitter
Arm 1 and Arm 2: The two paths, with lengths and
Detector: Measures the output intensity
The key difference from the Mach-Zehnder is that light travels back and forth in each arm, so the total path length in arm is .
The Calculation¶
Following the same approach as before, light entering the interferometer is split at the beam splitter. After traveling to the mirrors and back:
where (note the factor of 2 from the round trip).
When the beams recombine at the beam splitter, the detected intensity is:
where .
The interferometer is maximally sensitive when , where small changes in path length cause large changes in intensity.
Historical Significance: The Michelson-Morley Experiment¶
In 1887, Albert Michelson and Edward Morley performed one of the most important experiments in the history of physics using this interferometer.
The question they asked: Does light travel through a medium called the “luminiferous ether”?
In the 19th century, physicists believed that light waves, like sound waves, must propagate through some medium. They called this hypothetical medium the “ether” and assumed it filled all of space. If Earth moves through this ether, then the speed of light should be different in different directions—faster when moving with the ether, slower when moving against it.
The experiment: Michelson and Morley oriented their interferometer so that one arm pointed in the direction of Earth’s motion through space (about 30 km/s around the Sun), and the other arm was perpendicular. If light traveled through an ether, the round-trip times in the two arms would differ slightly, causing a phase shift. By rotating the entire apparatus, they expected to see the interference pattern shift.
The result: Nothing. No matter how they oriented the interferometer or what time of year they measured, they found no difference in the speed of light in different directions. The expected fringe shift was about 0.4 fringes; they observed less than 0.01 fringes.
The implication: The speed of light is the same in all directions, regardless of the motion of the observer. This null result was deeply puzzling at the time, but it became one of the key experimental foundations for Einstein’s special theory of relativity (1905), which postulates that the speed of light is constant in all inertial reference frames.
Modern Application: LIGO and Gravitational Waves¶
The same basic principle—measuring tiny path length differences via interference—is used today in the most sensitive displacement measurements ever made: the Laser Interferometer Gravitational-Wave Observatory (LIGO).
The setup: LIGO is essentially a giant Michelson interferometer with arms 4 km long. Laser light travels back and forth in each arm about 280 times (using Fabry-Pérot cavities), giving an effective path length of over 1000 km.
The sensitivity: When a gravitational wave passes through LIGO, it stretches space in one direction while compressing it in the perpendicular direction. This causes a differential change in the arm lengths. LIGO can detect changes in arm length of:
To put this in perspective:
A hydrogen atom is about 10-10 m
A proton is about 10-15 m
LIGO measures displacements 1000 times smaller than a proton!
How is this possible? The key is that interferometry measures path length relative to the wavelength . A phase shift of radians corresponds to a path length change of:
By using sophisticated techniques (high laser power, multiple bounces, quantum squeezing of light), LIGO pushes this sensitivity to extraordinary levels. In 2015, LIGO made the first direct detection of gravitational waves from merging black holes—a discovery that earned the 2017 Nobel Prize in Physics.
The Mach-Zehnder Interferometer¶
The Mach-Zehnder interferometer (MZI) is conceptually cleaner than the Michelson because light travels through each arm only once, and there are two distinct output ports.
The Setup¶
Figure 2:The Mach-Zehnder interferometer. Light enters from the left, is split by BS1 into two arms with lengths and , and recombines at BS2. Detectors D1 and D2 measure the output intensities.
Components:
BS1: First 50/50 beam splitter — splits incoming light equally into two arms
Arm 1 and Arm 2: The two paths, with lengths and
M1, M2: Mirrors that redirect the beams toward the second beam splitter
BS2: Second 50/50 beam splitter — recombines the two beams
D1, D2: Two detectors that measure the output intensity
The Beam Splitter: Why the Phase Shift?¶
Before we calculate, let’s understand a crucial property of beam splitters: reflection from one side must pick up a π phase shift relative to reflection from the other side.
Why? Energy conservation.
Consider what would happen if there were no phase shift. With equal amplitudes entering from each input port, the outputs would be:
The total output power would be , but the input power is only . We’ve created energy from nothing!
With the phase shift, if one reflection picks up a minus sign:
Now the total output power is , which equals the input. Energy is conserved.
The physical origin of this phase shift depends on the type of beam splitter. For a dielectric beam splitter, it comes from the boundary conditions for electromagnetic waves: reflection from the high-index side picks up no phase shift, while reflection from the low-index side picks up a π phase shift.
Calculation Using Wave Amplitudes¶
Let’s analyze the MZI using the complex amplitude formalism.
Step 1: Input and first beam splitter
An incident wave arrives at BS1:
At the beam splitter (position ), the wave is split equally:
The factor of ensures intensity conservation: .
Step 2: Phase accumulation
After traveling distance in arm :
where .
Step 3: Second beam splitter and detection
At BS2, including the phase shift from reflection:
Detector D1 receives the sum of the two amplitudes
Detector D2 receives the difference (one path has the π phase shift)
Step 4: Calculate intensities
Using and normalizing:
where .
Key Results¶
Important observations:
Conservation of energy: . All the light goes somewhere!
Complementary outputs: When D1 is bright, D2 is dark, and vice versa.
Only the phase difference matters: The intensities depend on , not on and individually.
| Phase difference | Result | ||
|---|---|---|---|
| 0 | 1 | 0 | All light to D1 |
| Split equally | |||
| 0 | 1 | All light to D2 | |
| Split equally | |||
| 1 | 0 | All light to D1 |
Global Phase Doesn’t Matter¶
Let’s verify explicitly that only relative phase matters.
Adding a common phase to both arms:
The intensity:
The global phase has magnitude 1, so it drops out!
The MZI as a Quantum Circuit¶
Now let’s rewrite the calculation using matrix notation. This reveals that the MZI is mathematically identical to a quantum computing circuit.
State Vector Notation¶
Instead of tracking separate amplitudes, we combine them into a state vector:
where is the amplitude in arm 1 (path ) and is the amplitude in arm 2 (path ).
The input light enters arm 1 only:
The Hadamard Matrix (Beam Splitter)¶
A 50/50 beam splitter is represented by the Hadamard matrix:
Notice the minus sign in the (2,2) position—this is the π phase shift we discussed!
Let’s verify this does what we expect:
Equal amplitude in each arm, as expected.
The Phase Gate¶
The relative phase between arms is represented by:
This applies phase to the component while leaving unchanged.
The Full Calculation¶
The MZI corresponds to:
Step 1: Apply first Hadamard
Step 2: Apply phase gate
Step 3: Apply second Hadamard
Detection probabilities:
This matches our wave calculation exactly!
The Quantum Circuit Diagram¶
| Interferometer Component | Quantum Gate |
|---|---|
| Beam splitter (split) | Hadamard |
| Path length difference | Phase gate |
| Beam splitter (recombine) | Hadamard |
| Detector | Measurement |
Measurement as Projection¶
What does “measurement” mean mathematically? When we measure in the basis, we project the state onto one of these basis vectors.
For a state :
Probability of measuring :
Probability of measuring :
The detectors D1 and D2 in our interferometer are doing exactly this: D1 measures whether the photon is in the state (output port 1), and D2 measures whether it’s in (output port 2).
This is a general principle: measurement collapses the quantum state onto one of the measurement basis states, with probability given by the squared magnitude of the amplitude.
iClicker: Beam Splitter with Two Inputs¶
A beam splitter has two inputs: amplitude 1 enters from the top, and amplitude enters from the side. The Hadamard matrix gives the outputs. What value of gives equal power in both outputs?
Setup: Input state is
Output:
(A)
(B) ✓
(C)
(D)
Solution: For equal power, we need .
Using and :
Equal power requires , which means .
This gives or .
The Bloch Sphere¶
We’ve seen that a qubit state can be written as:
How do we visualize this?
Counting Degrees of Freedom¶
Start: Two complex numbers = 4 real parameters
Constraint 1: Normalization removes one parameter: 3 real parameters
Constraint 2: Global phase is unobservable We can make real and non-negative: 2 real parameters
The Bloch Parametrization¶
With these constraints:
where:
is the polar angle (from the north pole)
is the azimuthal angle (around the equator)
Every qubit state corresponds to a point on the unit sphere: the Bloch sphere.
Key Points on the Bloch Sphere¶
| State | Position | ||
|---|---|---|---|
| 0 | — | North pole (+z) | |
| — | South pole (−z) | ||
| 0 | +x axis | ||
| −x axis | |||
| +y axis | |||
| −y axis |
Orthogonal States are Antipodal¶
Orthogonal quantum states are on opposite sides of the Bloch sphere.
(north pole) and (south pole): orthogonal ✓
(+x) and (−x): orthogonal ✓
(+y) and (−y): orthogonal ✓
This is why we use in the parametrization—it makes orthogonal states antipodal.
Gates as Rotations on the Bloch Sphere¶
Here’s a beautiful geometric picture: quantum gates correspond to rotations of the Bloch sphere.
The phase gate rotates the Bloch sphere around the z-axis by angle :
States on the z-axis ( and ) are unchanged
States on the equator rotate around the equator
The Hadamard gate is a rotation by around an axis halfway between x and z (the direction ):
It swaps the z-axis and x-axis
and
iClicker Questions¶
iClicker 1: A state has Bloch coordinates , . What is the state?
(A)
(B)
(C)
(D) ✓
Solution: With : . With : . So .
iClicker 2: I start with on the +x axis and apply the phase gate . Where do I end up on the Bloch sphere?
(A) +x axis (same place)
(B) −x axis ✓
(C) +y axis
(D) North pole
Solution:
The phase gate rotated us by around the z-axis, taking +x to −x.
Visualizing the MZI on the Bloch Sphere¶
The MZI sequence:
Start: at north pole
After H: on +x axis (equator)
After P(φ): Rotate around z-axis by φ, staying on equator
After second H: Final position depends on φ
| Phase | After | Final state | |
|---|---|---|---|
| 0 | $ | +\rangle$ (+x) | $ |
| $ | +i\rangle$ (+y) | superposition | |
| $ | -\rangle$ (−x) | $ | |
| $ | -i\rangle$ (−y) | superposition |
Visualizing States with Qiskit¶
Qiskit is a Python library for quantum computing that includes tools for visualizing quantum states on the Bloch sphere.
Installation¶
Run this once to install Qiskit:
# Uncomment the line below and run once to install, then comment it out
# !pip install qiskitBasic Bloch Sphere Visualization¶
import numpy as np
from qiskit.quantum_info import Statevector
from qiskit.visualization import plot_bloch_multivector
def bloch_state(theta, phi):
"""
Create qubit state: cos(theta/2)|0> + e^(i*phi)*sin(theta/2)|1>
Parameters:
theta: polar angle from north pole (0 to pi)
phi: azimuthal angle around equator (0 to 2*pi)
Returns:
Qiskit Statevector object
"""
c0 = np.cos(theta / 2)
c1 = np.exp(1j * phi) * np.sin(theta / 2)
return Statevector([c0, c1])
# Example: Plot the |+i⟩ state (theta = pi/2, phi = pi/2)
state = bloch_state(np.pi/2, np.pi/2)
plot_bloch_multivector(state)
Plotting the Six Cardinal States¶
import numpy as np
from qiskit.quantum_info import Statevector
from qiskit.visualization import plot_bloch_multivector
import matplotlib.pyplot as plt
# Define the six cardinal states
states = {
'|0⟩': Statevector([1, 0]),
'|1⟩': Statevector([0, 1]),
'|+⟩': Statevector([1, 1]) / np.sqrt(2),
'|−⟩': Statevector([1, -1]) / np.sqrt(2),
'|+i⟩': Statevector([1, 1j]) / np.sqrt(2),
'|−i⟩': Statevector([1, -1j]) / np.sqrt(2),
}
# Plot each state
for name, state in states.items():
print(f"\n{name}:")
display(plot_bloch_multivector(state))Visualizing the MZI Sequence¶
import numpy as np
from qiskit.quantum_info import Statevector, Operator
from qiskit.visualization import plot_bloch_multivector
# Define gates
H = Operator([[1, 1], [1, -1]]) / np.sqrt(2) # Hadamard
def phase_gate(phi):
"""Phase gate P(phi) = diag(1, e^(i*phi))"""
return Operator([[1, 0], [0, np.exp(1j * phi)]])
# MZI with phase = pi/2
phi = np.pi / 2
psi = Statevector([1, 0]) # Start at |0⟩
print("Initial |0⟩:")
display(plot_bloch_multivector(psi))
psi = psi.evolve(H) # After first Hadamard
print("After H:")
display(plot_bloch_multivector(psi))
psi = psi.evolve(phase_gate(phi)) # After phase gate
print(f"After P({phi:.2f}):")
display(plot_bloch_multivector(psi))
psi = psi.evolve(H) # After second Hadamard
print("Final state:")
display(plot_bloch_multivector(psi))
Homework: Interferometers and the Bloch Sphere¶
This homework is designed to be completed in Python. You’ll use NumPy for linear algebra and Qiskit for visualization.
Setup¶
First, install the required packages if you haven’t already:
# Uncomment and run once to install, then comment out
# !pip install qiskit numpy matplotlibImport the libraries you’ll need:
import numpy as np
from qiskit.quantum_info import Statevector
from qiskit.visualization import plot_bloch_multivector
import matplotlib.pyplot as pltProblem 1: Bloch Sphere Visualization¶
The six cardinal states on the Bloch sphere are fundamental reference points for understanding qubit states.
Part (a): Create a State Table¶
Complete the following table by filling in the state vector components and for each state, where .
| State Name | Notation | Bloch Position | ||
|---|---|---|---|---|
| Zero | ? | ? | North pole (+z) | |
| One | ? | ? | South pole (−z) | |
| Plus | ? | ? | +x axis | |
| Minus | ? | ? | −x axis | |
| Plus-i | ? | ? | +y axis | |
| Minus-i | ? | ? | −y axis |
Part (b): Create States in Python¶
Write Python code to create each of the six cardinal states as Qiskit Statevector objects. Store them in a dictionary called cardinal_states with keys '|0⟩', '|1⟩', '|+⟩', '|−⟩', '|+i⟩', '|−i⟩'.
# Your code here
cardinal_states = {
'|0⟩': # ...,
'|1⟩': # ...,
# ... complete for all six states
}Part (c): Visualize All Six States¶
Write a loop that plots each of the six cardinal states on the Bloch sphere. Include a title for each plot indicating which state is being displayed.
Problem 2: Quantum Gates¶
Part (a): Define the Hadamard Gate¶
The Hadamard gate is:
Define this as a NumPy array. Verify that is unitary by showing that (the identity matrix). Later we will learn that this means that energy is conserved on the output.
Part (b): Define the Phase Gate Function¶
The phase gate with parameter is:
Write a function phase_gate(phi) that returns this matrix as a NumPy array:
def phase_gate(phi):
"""
Returns the phase gate P(phi) as a 2x2 numpy array.
Parameters:
phi: phase angle in radians
Returns:
2x2 numpy array representing P(phi)
"""
# Your code here
Test your function by verifying that:
(identity matrix)
has a -1 in the bottom-right corner
Part (c): Apply Gates to States¶
Using your definitions of and phase_gate():
Compute and verify it equals
Compute and verify it equals
Compute and verify it equals
# Define |0⟩
ket_0 = np.array([1, 0])
# 1. Compute H|0⟩
result1 = # ...
print("H|0⟩ =", result1)
# 2. Compute P(π)|+⟩
# ...
# 3. Compute H|+⟩
# ...Problem 3: Mach-Zehnder Interferometer Simulation¶
In this problem, you’ll simulate the complete Mach-Zehnder interferometer and reproduce the interference pattern.
Part (a): MZI Output Calculation¶
The MZI applies the sequence to an input state .
Write a function mzi_output(phi) that takes a phase and returns the output state vector:
def mzi_output(phi):
"""
Compute the output state of a Mach-Zehnder interferometer.
The MZI applies H -> P(phi) -> H to |0⟩.
Parameters:
phi: relative phase between the two arms (radians)
Returns:
Output state as a numpy array [c0, c1]
"""
# Your code here
Test your function:
mzi_output(0)should return (approximately)mzi_output(np.pi)should return (approximately)
Part (b): Calculate Detection Probabilities¶
The probability of detecting the photon at detector D1 (output port 0) is , and at D2 is .
Write a function detection_probabilities(phi) that returns both probabilities:
def detection_probabilities(phi):
"""
Compute detection probabilities for the MZI.
Parameters:
phi: relative phase between the two arms (radians)
Returns:
Tuple (P_D1, P_D2) of detection probabilities
"""
# Your code here
Verify that for several values of .
Part (c): Plot the Interference Pattern¶
Create a plot showing and as functions of from 0 to .
Your plot should:
Show both (perhaps in blue) and (perhaps in red) on the same axes
Have proper axis labels: “ (radians)” and “Detection Probability”
Include a legend identifying each curve
Have a title: “Mach-Zehnder Interferometer Output”
# Create array of phi values
phi_values = np.linspace(0, 4 * np.pi, 200)
# Calculate probabilities for each phi
P_D1 = # ...
P_D2 = # ...
# Create the plot
plt.figure(figsize=(10, 6))
# Your plotting code here
plt.show()