Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Lecture 2.2: Interferometers and the Bloch Sphere

Purdue University

Review of Last Lecture

In Lecture 2.1, we established the key ideas about waves and interference:

E1+E22=E12+E22+2Re(E1E2)|E_1 + E_2|^2 = |E_1|^2 + |E_2|^2 + 2\text{Re}(E_1^* E_2)
I=eiϕ1+eiϕ22=2(1+cos(ϕ1ϕ2))I = |e^{i\phi_1} + e^{i\phi_2}|^2 = 2(1 + \cos(\phi_1 - \phi_2))

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 I=eiϕ1+eiϕ22I = |e^{i \phi_1} + e^{i \phi_2} |^2. If Δϕ=π\Delta\phi = \pi, the interference is:


The Michelson Interferometer

Before we dive into the Mach-Zehnder interferometer, let’s discuss its historically important cousin: the Michelson interferometer.

The Setup

The Michelson interferometer. Light from a source is split by a beam splitter (BS). One beam travels to mirror M1 (distance L_1), the other to mirror M2 (distance L_2). Both beams reflect back and recombine at the beam splitter, where interference determines how much light goes to the detector.

Figure 1:The Michelson interferometer. Light from a source is split by a beam splitter (BS). One beam travels to mirror M1 (distance L1L_1), the other to mirror M2 (distance L2L_2). Both beams reflect back and recombine at the beam splitter, where interference determines how much light goes to the detector.

Components:

The key difference from the Mach-Zehnder is that light travels back and forth in each arm, so the total path length in arm jj is 2Lj2L_j.

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:

Earm1=E02ei2kL1=E02eiϕ1E_{arm1} = \frac{E_0}{\sqrt{2}} e^{i \cdot 2kL_1} = \frac{E_0}{\sqrt{2}} e^{i\phi_1}
Earm2=E02ei2kL2=E02eiϕ2E_{arm2} = \frac{E_0}{\sqrt{2}} e^{i \cdot 2kL_2} = \frac{E_0}{\sqrt{2}} e^{i\phi_2}

where ϕj=2kLj=4πLjλ\phi_j = 2kL_j = \frac{4\pi L_j}{\lambda} (note the factor of 2 from the round trip).

When the beams recombine at the beam splitter, the detected intensity is:

Idet=I02(1+cosΔϕ)I_{det} = \frac{I_0}{2}(1 + \cos\Delta\phi)

where Δϕ=ϕ1ϕ2=4πλ(L1L2)\Delta\phi = \phi_1 - \phi_2 = \frac{4\pi}{\lambda}(L_1 - L_2).

The interferometer is maximally sensitive when Δϕπ/2\Delta\phi \approx \pi/2, 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:

ΔL1018 m\Delta L \sim 10^{-18} \text{ m}

To put this in perspective:

How is this possible? The key is that interferometry measures path length relative to the wavelength λ1μm\lambda \approx 1 \,\mu\text{m}. A phase shift of Δϕ=0.001\Delta\phi = 0.001 radians corresponds to a path length change of:

ΔL=λ2πΔϕ0.16 nm\Delta L = \frac{\lambda}{2\pi} \Delta\phi \approx 0.16 \text{ nm}

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

The Mach-Zehnder interferometer. Light enters from the left, is split by BS1 into two arms with lengths L_1 and L_2, and recombines at BS2. Detectors D1 and D2 measure the output intensities.

Figure 2:The Mach-Zehnder interferometer. Light enters from the left, is split by BS1 into two arms with lengths L1L_1 and L2L_2, and recombines at BS2. Detectors D1 and D2 measure the output intensities.

Components:

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 aa entering from each input port, the outputs would be:

Eout1=12(a+a)=2a,Eout2=12(a+a)=2aE_{out1} = \frac{1}{\sqrt{2}}(a + a) = \sqrt{2}a, \qquad E_{out2} = \frac{1}{\sqrt{2}}(a + a) = \sqrt{2}a

The total output power would be Eout12+Eout22=4a2|E_{out1}|^2 + |E_{out2}|^2 = 4|a|^2, but the input power is only 2a22|a|^2. We’ve created energy from nothing!

With the phase shift, if one reflection picks up a minus sign:

Eout1=12(a+a)=2a,Eout2=12(aa)=0E_{out1} = \frac{1}{\sqrt{2}}(a + a) = \sqrt{2}a, \qquad E_{out2} = \frac{1}{\sqrt{2}}(a - a) = 0

Now the total output power is 2a22|a|^2, 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:

Ein=E0eikxE_{in} = E_0 e^{ikx}

At the beam splitter (position x=0x = 0), the wave is split equally:

Earm1=E02,Earm2=E02E_{arm1} = \frac{E_0}{\sqrt{2}}, \qquad E_{arm2} = \frac{E_0}{\sqrt{2}}

The factor of 1/21/\sqrt{2} ensures intensity conservation: Earm12+Earm22=E02|E_{arm1}|^2 + |E_{arm2}|^2 = |E_0|^2.

Step 2: Phase accumulation

After traveling distance LjL_j in arm jj:

Earm1=E02eikL1=E02eiϕ1E_{arm1} = \frac{E_0}{\sqrt{2}} e^{ikL_1} = \frac{E_0}{\sqrt{2}} e^{i\phi_1}
Earm2=E02eikL2=E02eiϕ2E_{arm2} = \frac{E_0}{\sqrt{2}} e^{ikL_2} = \frac{E_0}{\sqrt{2}} e^{i\phi_2}

where ϕj=kLj=2πλLj\phi_j = kL_j = \frac{2\pi}{\lambda} L_j.

Step 3: Second beam splitter and detection

At BS2, including the phase shift from reflection:

ED1=12(E02eiϕ1+E02eiϕ2)=E02(eiϕ1+eiϕ2)E_{D1} = \frac{1}{\sqrt{2}}\left(\frac{E_0}{\sqrt{2}} e^{i\phi_1} + \frac{E_0}{\sqrt{2}} e^{i\phi_2}\right) = \frac{E_0}{2}(e^{i\phi_1} + e^{i\phi_2})
ED2=12(E02eiϕ1E02eiϕ2)=E02(eiϕ1eiϕ2)E_{D2} = \frac{1}{\sqrt{2}}\left(\frac{E_0}{\sqrt{2}} e^{i\phi_1} - \frac{E_0}{\sqrt{2}} e^{i\phi_2}\right) = \frac{E_0}{2}(e^{i\phi_1} - e^{i\phi_2})

Step 4: Calculate intensities

Using eiϕ1+eiϕ22=2(1+cos(ϕ1ϕ2))|e^{i\phi_1} + e^{i\phi_2}|^2 = 2(1 + \cos(\phi_1 - \phi_2)) and normalizing:

ID1=12(1+cosΔϕ),ID2=12(1cosΔϕ)\boxed{I_{D1} = \frac{1}{2}(1 + \cos\Delta\phi), \qquad I_{D2} = \frac{1}{2}(1 - \cos\Delta\phi)}

where Δϕ=ϕ1ϕ2=k(L1L2)\Delta\phi = \phi_1 - \phi_2 = k(L_1 - L_2).

Key Results

Important observations:

  1. Conservation of energy: ID1+ID2=1I_{D1} + I_{D2} = 1. All the light goes somewhere!

  2. Complementary outputs: When D1 is bright, D2 is dark, and vice versa.

  3. Only the phase difference matters: The intensities depend on Δϕ=ϕ1ϕ2\Delta\phi = \phi_1 - \phi_2, not on ϕ1\phi_1 and ϕ2\phi_2 individually.

Phase difference Δϕ\Delta\phiID1I_{D1}ID2I_{D2}Result
010All light to D1
π/2\pi/21/21/21/21/2Split equally
π\pi01All light to D2
3π/23\pi/21/21/21/21/2Split equally
2π2\pi10All light to D1

Global Phase Doesn’t Matter

Let’s verify explicitly that only relative phase matters.

Adding a common phase γ\gamma to both arms:

ED1=eiγ2(eiϕ1+eiϕ2)E_{D1} = \frac{e^{i\gamma}}{2}(e^{i\phi_1} + e^{i\phi_2})

The intensity:

ID1=ED12=eiγ22eiϕ1+eiϕ22=14eiϕ1+eiϕ22I_{D1} = |E_{D1}|^2 = \left|\frac{e^{i\gamma}}{2}\right|^2 |e^{i\phi_1} + e^{i\phi_2}|^2 = \frac{1}{4}|e^{i\phi_1} + e^{i\phi_2}|^2

The global phase eiγe^{i\gamma} 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:

ψ=(c1c2)|\psi\rangle = \begin{pmatrix} c_1 \\ c_2 \end{pmatrix}

where c1c_1 is the amplitude in arm 1 (path 0|0\rangle) and c2c_2 is the amplitude in arm 2 (path 1|1\rangle).

The input light enters arm 1 only:

ψin=(10)=0|\psi_{in}\rangle = \begin{pmatrix} 1 \\ 0 \end{pmatrix} = |0\rangle

The Hadamard Matrix (Beam Splitter)

A 50/50 beam splitter is represented by the Hadamard matrix:

H=12(1111)H = \frac{1}{\sqrt{2}}\begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix}

Notice the minus sign in the (2,2) position—this is the π phase shift we discussed!

Let’s verify this does what we expect:

H0=12(1111)(10)=12(11)H|0\rangle = \frac{1}{\sqrt{2}}\begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix}\begin{pmatrix} 1 \\ 0 \end{pmatrix} = \frac{1}{\sqrt{2}}\begin{pmatrix} 1 \\ 1 \end{pmatrix}

Equal amplitude 1/21/\sqrt{2} in each arm, as expected.

The Phase Gate

The relative phase between arms is represented by:

P(ϕ)=(100eiϕ)P(\phi) = \begin{pmatrix} 1 & 0 \\ 0 & e^{i\phi} \end{pmatrix}

This applies phase ϕ\phi to the 1|1\rangle component while leaving 0|0\rangle unchanged.

The Full Calculation

The MZI corresponds to:

ψout=HP(ϕ)Hψin|\psi_{out}\rangle = H \cdot P(\phi) \cdot H \cdot |\psi_{in}\rangle

Step 1: Apply first Hadamard

H0=12(11)H|0\rangle = \frac{1}{\sqrt{2}}\begin{pmatrix} 1 \\ 1 \end{pmatrix}

Step 2: Apply phase gate

P(ϕ)12(11)=12(1eiϕ)P(\phi) \cdot \frac{1}{\sqrt{2}}\begin{pmatrix} 1 \\ 1 \end{pmatrix} = \frac{1}{\sqrt{2}}\begin{pmatrix} 1 \\ e^{i\phi} \end{pmatrix}

Step 3: Apply second Hadamard

H12(1eiϕ)=12(1+eiϕ1eiϕ)H \cdot \frac{1}{\sqrt{2}}\begin{pmatrix} 1 \\ e^{i\phi} \end{pmatrix} = \frac{1}{2}\begin{pmatrix} 1 + e^{i\phi} \\ 1 - e^{i\phi} \end{pmatrix}

Detection probabilities:

P(D1)=12(1+eiϕ)2=12(1+cosϕ)P(D1) = \left|\frac{1}{2}(1 + e^{i\phi})\right|^2 = \frac{1}{2}(1 + \cos\phi)

P(D2)=12(1eiϕ)2=12(1cosϕ)P(D2) = \left|\frac{1}{2}(1 - e^{i\phi})\right|^2 = \frac{1}{2}(1 - \cos\phi)

This matches our wave calculation exactly!

The Quantum Circuit Diagram

0HP(ϕ)Hmeasure|0\rangle \xrightarrow{\quad H \quad} \xrightarrow{\quad P(\phi) \quad} \xrightarrow{\quad H \quad} \text{measure}
Interferometer ComponentQuantum Gate
Beam splitter (split)Hadamard HH
Path length differencePhase gate P(ϕ)P(\phi)
Beam splitter (recombine)Hadamard HH
DetectorMeasurement

Measurement as Projection

What does “measurement” mean mathematically? When we measure in the {0,1}\{|0\rangle, |1\rangle\} basis, we project the state onto one of these basis vectors.

For a state ψ=c00+c11|\psi\rangle = c_0|0\rangle + c_1|1\rangle:

The detectors D1 and D2 in our interferometer are doing exactly this: D1 measures whether the photon is in the 0|0\rangle state (output port 1), and D2 measures whether it’s in 1|1\rangle (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 eiθe^{i\theta} enters from the side. The Hadamard matrix gives the outputs. What value of θ\theta gives equal power in both outputs?

Setup: Input state is ψin=(1eiθ)|\psi_{in}\rangle = \begin{pmatrix} 1 \\ e^{i\theta} \end{pmatrix}

Output: ψout=Hψin=12(1+eiθ1eiθ)|\psi_{out}\rangle = H|\psi_{in}\rangle = \frac{1}{\sqrt{2}}\begin{pmatrix} 1 + e^{i\theta} \\ 1 - e^{i\theta} \end{pmatrix}

Solution: For equal power, we need 1+eiθ2=1eiθ2|1 + e^{i\theta}|^2 = |1 - e^{i\theta}|^2.

Using 1+eiθ2=2(1+cosθ)|1 + e^{i\theta}|^2 = 2(1 + \cos\theta) and 1eiθ2=2(1cosθ)|1 - e^{i\theta}|^2 = 2(1 - \cos\theta):

Equal power requires 1+cosθ=1cosθ1 + \cos\theta = 1 - \cos\theta, which means cosθ=0\cos\theta = 0.

This gives θ=π/2\theta = \pi/2 or θ=3π/2\theta = 3\pi/2.


The Bloch Sphere

We’ve seen that a qubit state can be written as:

ψ=c00+c11=(c0c1)|\psi\rangle = c_0|0\rangle + c_1|1\rangle = \begin{pmatrix} c_0 \\ c_1 \end{pmatrix}

How do we visualize this?

Counting Degrees of Freedom

Start: Two complex numbers = 4 real parameters

Constraint 1: Normalization c02+c12=1|c_0|^2 + |c_1|^2 = 1 removes one parameter: 3 real parameters

Constraint 2: Global phase is unobservable We can make c0c_0 real and non-negative: 2 real parameters

The Bloch Parametrization

With these constraints:

c0=cosθ2,c1=eiϕsinθ2c_0 = \cos\frac{\theta}{2}, \qquad c_1 = e^{i\phi}\sin\frac{\theta}{2}

where:

ψ=cosθ20+eiϕsinθ21\boxed{|\psi\rangle = \cos\frac{\theta}{2}|0\rangle + e^{i\phi}\sin\frac{\theta}{2}|1\rangle}

Every qubit state corresponds to a point on the unit sphere: the Bloch sphere.

Key Points on the Bloch Sphere

Stateθ\thetaϕ\phiPosition
0|0\rangle0North pole (+z)
1|1\rangleπ\piSouth pole (−z)
+=12(0+1)|+\rangle = \frac{1}{\sqrt{2}}(|0\rangle + |1\rangle)π/2\pi/20+x axis
=12(01)|-\rangle = \frac{1}{\sqrt{2}}(|0\rangle - |1\rangle)π/2\pi/2π\pi−x axis
+i=12(0+i1)|+i\rangle = \frac{1}{\sqrt{2}}(|0\rangle + i|1\rangle)π/2\pi/2π/2\pi/2+y axis
i=12(0i1)|-i\rangle = \frac{1}{\sqrt{2}}(|0\rangle - i|1\rangle)π/2\pi/23π/23\pi/2−y axis

Orthogonal States are Antipodal

Orthogonal quantum states are on opposite sides of the Bloch sphere.

This is why we use θ/2\theta/2 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 P(ϕ)P(\phi) rotates the Bloch sphere around the z-axis by angle ϕ\phi:

The Hadamard gate HH is a rotation by π\pi around an axis halfway between x and z (the direction (1,0,1)/2(1, 0, 1)/\sqrt{2}):


iClicker Questions

iClicker 1: A state has Bloch coordinates θ=π/2\theta = \pi/2, ϕ=π/2\phi = \pi/2. What is the state?

Solution: With θ=π/2\theta = \pi/2: cos(π/4)=sin(π/4)=1/2\cos(\pi/4) = \sin(\pi/4) = 1/\sqrt{2}. With ϕ=π/2\phi = \pi/2: eiπ/2=ie^{i\pi/2} = i. So ψ=12(0+i1)=+i|\psi\rangle = \frac{1}{\sqrt{2}}(|0\rangle + i|1\rangle) = |+i\rangle.


iClicker 2: I start with +=12(0+1)|+\rangle = \frac{1}{\sqrt{2}}(|0\rangle + |1\rangle) on the +x axis and apply the phase gate P(π)=(1001)P(\pi) = \begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix}. Where do I end up on the Bloch sphere?

Solution:

P(π)+=(1001)12(11)=12(11)=P(\pi)|+\rangle = \begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix} \frac{1}{\sqrt{2}}\begin{pmatrix} 1 \\ 1 \end{pmatrix} = \frac{1}{\sqrt{2}}\begin{pmatrix} 1 \\ -1 \end{pmatrix} = |-\rangle

The phase gate rotated us by π\pi around the z-axis, taking +x to −x.


Visualizing the MZI on the Bloch Sphere

The MZI sequence: 0HP(ϕ)H|0\rangle \xrightarrow{H} \xrightarrow{P(\phi)} \xrightarrow{H}

  1. Start: 0|0\rangle at north pole

  2. After H: +|+\rangle on +x axis (equator)

  3. After P(φ): Rotate around z-axis by φ, staying on equator

  4. After second H: Final position depends on φ

Phase ϕ\phiAfter P(ϕ)P(\phi)Final stateP(D1)P(D1)
0$+\rangle$ (+x)$
π/2\pi/2$+i\rangle$ (+y)superposition
π\pi$-\rangle$ (−x)$
3π/23\pi/2$-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 qiskit

Basic 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)
alt text

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))
alt text


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 matplotlib

Import 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 plt

Problem 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 c0c_0 and c1c_1 for each state, where ψ=c00+c11|\psi\rangle = c_0|0\rangle + c_1|1\rangle.

State NameNotationc0c_0c1c_1Bloch Position
Zero0|0\rangle??North pole (+z)
One1|1\rangle??South pole (−z)
Plus+|+\rangle??+x axis
Minus|-\rangle??−x axis
Plus-i+i|+i\rangle??+y axis
Minus-ii|-i\rangle??−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:

H=12(1111)H = \frac{1}{\sqrt{2}}\begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix}

Define this as a NumPy array. Verify that HH is unitary by showing that HH=IH H^\dagger = I (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 ϕ\phi is:

P(ϕ)=(100eiϕ)P(\phi) = \begin{pmatrix} 1 & 0 \\ 0 & e^{i\phi} \end{pmatrix}

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:

Part (c): Apply Gates to States

Using your definitions of HH and phase_gate():

  1. Compute H0H|0\rangle and verify it equals +|+\rangle

  2. Compute P(π)+P(\pi)|+\rangle and verify it equals |-\rangle

  3. Compute H+H|+\rangle and verify it equals 0|0\rangle

# 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 HP(ϕ)HH \to P(\phi) \to H to an input state 0|0\rangle.

Write a function mzi_output(phi) that takes a phase ϕ\phi 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:

Part (b): Calculate Detection Probabilities

The probability of detecting the photon at detector D1 (output port 0) is PD1=c02P_{D1} = |c_0|^2, and at D2 is PD2=c12P_{D2} = |c_1|^2.

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 PD1+PD2=1P_{D1} + P_{D2} = 1 for several values of ϕ\phi.

Part (c): Plot the Interference Pattern

Create a plot showing PD1P_{D1} and PD2P_{D2} as functions of ϕ\phi from 0 to 4π4\pi.

Your plot should:

# 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()