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.1: Waves, Complex Numbers, and Interference

Purdue University

Chapter 2 Overview

This chapter answers one big question: what is a qubit, physically and mathematically?

We’ll build the idea in a few steps:

By the end of the chapter, “qubit” should feel like a concrete wave/interference object—not a slogan.


Today’s Focus

Today we focus on the mathematical foundations:

Why does this matter for quantum computing? Quantum algorithms work by manipulating amplitudes so that wrong answers interfere destructively and right answers interfere constructively. Understanding interference is understanding how quantum computers compute.

Let’s start with waves.


The Wave Equation

Waves are everywhere in physics—light, sound, water, quantum mechanics. They all share a common mathematical structure.

Waves in Space

Consider a wave that varies in space at a fixed moment in time. The simplest wave equation is:

d2dx2E(x)=k2E(x)\frac{d^2}{dx^2} E(x) = -k^2 E(x)

This says: “the second derivative of EE is proportional to E-E itself.” Functions that equal (minus) their own second derivative are oscillatory—exactly what we expect for waves.

This is a second-order ordinary differential equation (ODE). From ODE theory, we know there must be two linearly independent solutions. Any solution can be written as a linear combination of these two.

One natural choice are the sines and cosines. The general real solution is:

E(x)=Acos(kx)+Bsin(kx)E(x) = A\cos(kx) + B\sin(kx)

Verify for yourself that both of these are valid solutions. We say these are two linearly independent solutions because there are no constants AA and BB such that Acos(kx)+Bsin(kx)=0A\cos(kx) + B\sin(kx) = 0 for all xx, except for A=B=0A=B=0.

The constant kk is called the wavenumber:

k=2πλk = \frac{2\pi}{\lambda}

where λ\lambda is the wavelength. The wave repeats every time xx increases by λ\lambda:

cos(kx)=cos(2πλx)\cos(kx) = \cos\left(\frac{2\pi}{\lambda}x\right)

However, another equally valid choice are the complex exponentials:

E(x)=Ceikx+DeikxE(x) = Ce^{ikx} + De^{-ikx}

Verify for yourself that these are also linearly independent. Both forms are correct. They’re connected by Euler’s formula:

eiθ=cosθ+isinθe^{i\theta} = \cos\theta + i\sin\theta

From this we can derive:

eiθ=cosθisinθe^{-i\theta} = \cos\theta - i\sin\theta

And solving these two for the trig functions gives:

cosθ=eiθ+eiθ2,sinθ=eiθeiθ2i\cos\theta = \frac{e^{i\theta} + e^{-i\theta}}{2}, \qquad \sin\theta = \frac{e^{i\theta} - e^{-i\theta}}{2i}

So {cos(kx),sin(kx)}\{\cos(kx), \sin(kx)\} and {eikx,eikx}\{e^{ikx}, e^{-ikx}\} span the same solution space—they’re just different bases. We’ll use whichever is more convenient.

Waves in Time

Now consider oscillation in time at a fixed position. The equation has the same form:

d2dt2E(t)=ω2E(t)\frac{d^2}{dt^2} E(t) = -\omega^2 E(t)

Same math, different physical meaning. Solutions include cos(ωt)\cos(\omega t), sin(ωt)\sin(\omega t), and e±iωte^{\pm i\omega t}.

The constants:

Traveling Waves: Space and Time Together

For light and other propagating waves, we need both space and time. If we look at the field at a fixed time it will look like cos(kx)\cos(kx). If we look at it at a fixed position it will look like cos(ωt)\cos(\omega t).

The full wave equation is:

2x2E(x,t)=1c22t2E(x,t)\frac{\partial^2}{\partial x^2} E(x,t) = \frac{1}{c^2} \frac{\partial^2}{\partial t^2} E(x,t)

where cc is the wave speed. This is a partial differential equation. It contains derivatives with respect to both position and time, which is why we write \partial instead of dd.

The traveling wave solution:

E(x,t)=E0cos(kxωt)E(x,t) = E_0 \cos(kx - \omega t)

describes a sinusoidal pattern moving to the right. To see this, rewrite it:

E(x,t)=E0cos(2πλ(xωkt))=E0cos(2πλ(xct))E(x,t) = E_0 \cos\left(\frac{2\pi}{\lambda}\left(x - \frac{\omega}{k} t\right)\right) = E_0 \cos\left(\frac{2\pi}{\lambda}(x - ct)\right)

This has the form f(xct)f(x - ct)—a shape that shifts to the right with speed cc. Similarly, cos(kx+ωt)\cos(kx + \omega t) has the form f(x+ct)f(x + ct) and travels to the left.

For electromagnetic waves:

c=fλ=ωk\boxed{c = f\lambda = \frac{\omega}{k}}

The two linearly independent real solutions are cos(kxωt)\cos(kx - \omega t) and sin(kxωt)\sin(kx - \omega t) (or equivalently, right-traveling and left-traveling waves).

Just like before, there is also a complex form of the traveling wave: ei(kxωt)e^{i(kx - \omega t)} and ei(kxωt)e^{-i(kx - \omega t)}. Verify for yourself that E(x,t)=E0ei(kxωt)E(x,t) = E_0 e^{i(kx - \omega t)} satisfies the wave equation. In classical electromagnetism, the electric field EE is real. But calculations are often easier using complex exponentials. Why?

Derivatives are simpler. They just bring down a factor of ikik or iω-i\omega—no sign changes or switching between sin and cos.

Adding waves is easier. Suppose we want to add two waves with different phases:

E1=cos(kx),E2=cos(kx+ϕ)E_1 = \cos(kx), \qquad E_2 = \cos(kx + \phi)

Using trig identities, this requires expanding cos(kx+ϕ)=cos(kx)cosϕsin(kx)sinϕ\cos(kx + \phi) = \cos(kx)\cos\phi - \sin(kx)\sin\phi and collecting terms. Tedious.

Using complex exponentials:

E1=eikx,E2=ei(kx+ϕ)=eikxeiϕE_1 = e^{ikx}, \qquad E_2 = e^{i(kx + \phi)} = e^{ikx} e^{i\phi}

E1+E2=eikx(1+eiϕ)E_1 + E_2 = e^{ikx}(1 + e^{i\phi})

We just factor out the common piece. The phases combine by multiplication, which is much simpler than trig identities.

When we talk about waves, we will generally assume the complex form:

E(x,t)=E0ei(kxωt)E(x,t) = E_0 e^{i(kx - \omega t)}

If we need the physical (real) field, we take the real part:

Ephysical(x,t)=Re[E(x,t)]E_{\text{physical}}(x,t) = \text{Re}\left[E(x,t)\right]

Often, we only need the intensity E2|E|^2, and we never need to take the real part at all.


Intensity: What Detectors Measure

Detectors (your eye, a camera, a photodiode) don’t measure the electric field directly. They measure intensity, which is proportional to the square of the field:

IntensityE2\text{Intensity} \propto E^2

Why squared? Energy in electromagnetic waves goes as E2E^2 (and B2B^2), and detectors respond to energy.

Time Averaging for Real Waves

The field oscillates rapidly—hundreds of THz for visible light. That’s 1014\sim 10^{14} oscillations per second. No detector can follow oscillations that fast; even the fastest photodetectors have response times of picoseconds (10-12 s), which is still thousands of optical cycles.

So detectors respond to the time-averaged intensity.

At a fixed position, let E(t)=E0cos(ωt)E(t) = E_0\cos(\omega t). Then:

E2(t)=E02cos2(ωt)E^2(t) = E_0^2 \cos^2(\omega t)

The average of cos2\cos^2 over one period is 1/21/2:

I=E2=1T0TE02cos2(ωt)dt=E022I = \langle E^2 \rangle = \frac{1}{T}\int_0^T E_0^2 \cos^2(\omega t)\, dt = \frac{E_0^2}{2}

The Complex Shortcut

Here’s the beautiful part: the complex representation gives us intensity without time averaging. For the complex field E=E0ei(kxωt)E = E_0 e^{i(kx - \omega t)}:

E2=EE=(E0ei(kxωt))(E0ei(kxωt))=E02|E|^2 = E \cdot E^* = \left(E_0 e^{i(kx-\omega t)}\right)\left(E_0^* e^{-i(kx-\omega t)}\right) = |E_0|^2

We used the key fact:

eiθ2=eiθeiθ=1|e^{i\theta}|^2 = e^{i\theta} \cdot e^{-i\theta} = 1

The time dependence cancels! The magnitude squared of the complex amplitude directly gives us something proportional to intensity, with no integral required.


Interference

Now the payoff: what happens when two waves combine?

Setup: Two Sources

Imagine two point sources emitting waves. At a detector, the waves have traveled different distances x1x_1 and x2x_2.

Each source contributes a complex amplitude at the detector:

E1=ei(kx1ωt),E2=ei(kx2ωt)E_1 = e^{i(kx_1 - \omega t)}, \qquad E_2 = e^{i(kx_2 - \omega t)}

The total field is the sum of the amplitudes:

Etotal=E1+E2E_{\text{total}} = E_1 + E_2

The Cross Term: Where Interference Lives

Before doing the full calculation, let’s see the structure. For any two complex amplitudes:

E1+E22=(E1+E2)(E1+E2)|E_1 + E_2|^2 = (E_1 + E_2)(E_1^* + E_2^*)

=E12+E22+E1E2+E1E2= |E_1|^2 + |E_2|^2 + E_1 E_2^* + E_1^* E_2

=E12+E22+2Re(E1E2)= |E_1|^2 + |E_2|^2 + 2\text{Re}(E_1^* E_2)

The last term is the cross term (or interference term). It depends on the relative phase between E1E_1 and E2E_2.

The Intensity Calculation

Now let’s work it out explicitly. The intensity is:

I=Etotal2=ei(kx1ωt)+ei(kx2ωt)2I = |E_{\text{total}}|^2 = |e^{i(kx_1 - \omega t)} + e^{i(kx_2 - \omega t)}|^2

Step 1: Factor out common terms.

I=eiωt2eikx1+eikx22I = |e^{-i\omega t}|^2 \cdot |e^{ikx_1} + e^{ikx_2}|^2

Since eiωt2=1|e^{-i\omega t}|^2 = 1:

I=eikx1+eikx22I = |e^{ikx_1} + e^{ikx_2}|^2

Step 2: Factor out eikx1e^{ikx_1}.

I=eikx121+eik(x2x1)2=1+eikΔx2I = |e^{ikx_1}|^2 \cdot |1 + e^{ik(x_2 - x_1)}|^2 = |1 + e^{ik\Delta x}|^2

where Δx=x2x1\Delta x = x_2 - x_1 is the path difference.

Step 3: Expand the magnitude squared.

1+eikΔx2=(1+eikΔx)(1+eikΔx)|1 + e^{ik\Delta x}|^2 = (1 + e^{ik\Delta x})(1 + e^{-ik\Delta x})

=1+eikΔx+eikΔx+1= 1 + e^{ik\Delta x} + e^{-ik\Delta x} + 1

=2+2cos(kΔx)= 2 + 2\cos(k\Delta x)

The Interference Formula

I=2(1+cos(kΔx))I = 2(1 + \cos(k\Delta x))

Using the identity 1+cosθ=2cos2(θ/2)1 + \cos\theta = 2\cos^2(\theta/2), we can also write this as:

I=4cos2(kΔx2)\boxed{I = 4\cos^2\left(\frac{k\Delta x}{2}\right)}

This form makes the oscillation between 0 and 4 more explicit. The intensity depends only on the path difference Δx\Delta x.

Global Phase Doesn’t Matter

Notice what happened in Step 1: the overall time-dependent phase eiωte^{-i\omega t} dropped out completely. And in Step 2, the overall spatial phase eikx1e^{ikx_1} also dropped out.

Only the relative phase kΔx=k(x2x1)k\Delta x = k(x_2 - x_1) matters.

This is a general principle: if we multiply all amplitudes by the same phase factor eiγe^{i\gamma}, the intensity doesn’t change:

eiγE1+eiγE22=eiγ2E1+E22=E1+E22|e^{i\gamma}E_1 + e^{i\gamma}E_2|^2 = |e^{i\gamma}|^2|E_1 + E_2|^2 = |E_1 + E_2|^2

Global phase is unobservable. Only relative phases between different paths or components affect measurements. This will be important throughout quantum mechanics.

Constructive and Destructive Interference

ConditionPhase kΔxk\Delta xcos(kΔx)\cos(k\Delta x)Intensity
Constructive0,2π,4π,...0, 2\pi, 4\pi, ...+1I=4I = 4 (max)
Destructiveπ,3π,5π,...\pi, 3\pi, 5\pi, ...-1I=0I = 0 (min)

The key insight: we add amplitudes first, then square. This creates the cross term 2Re(E1E2)=2cos(kΔx)2\text{Re}(E_1^* E_2) = 2\cos(k\Delta x) that depends on the relative phase.


Summary

  1. Wave equation: d2E/dx2=k2Ed^2E/dx^2 = -k^2 E has two linearly independent solutions; we can use {cos(kx),sin(kx)}\{\cos(kx), \sin(kx)\} or {eikx,eikx}\{e^{ikx}, e^{-ikx}\}

  2. Euler’s formula: eiθ=cosθ+isinθe^{i\theta} = \cos\theta + i\sin\theta connects the two bases

  3. Traveling waves: E(x,t)=E0cos(kxωt)E(x,t) = E_0\cos(kx - \omega t) moves right with speed c=fλ=ω/kc = f\lambda = \omega/k

  4. Complex representation: Use E=E0ei(kxωt)E = E_0 e^{i(kx-\omega t)}—derivatives and addition are simpler

  5. Intensity: IE2I \propto |E|^2 (magnitude squared of complex amplitude)

  6. Interference: When two waves combine:

    E1+E22=E12+E22+2Re(E1E2)|E_1 + E_2|^2 = |E_1|^2 + |E_2|^2 + 2\text{Re}(E_1^* E_2)
    • The cross term is where interference lives

    • Constructive when Δx=nλ\Delta x = n\lambda

    • Destructive when Δx=(n+1/2)λ\Delta x = (n + 1/2)\lambda

  7. Global phase is unobservable: Only relative phases affect measurements


Looking Ahead

Next lecture: We’ll see interference in action with the Mach-Zehnder interferometer—and discover that it’s mathematically identical to a quantum computing circuit. The interferometer will be our first concrete example of a qubit.

Homework 2.1

Problem 1: Separation of Variables for the Wave Equation

The wave equation in one dimension is:

2Ex2=1c22Et2\frac{\partial^2 E}{\partial x^2} = \frac{1}{c^2}\frac{\partial^2 E}{\partial t^2}

Solve this equation using separation of variables. Use the complex exponential form eikxe^{ikx} for your solutions. (Feel free to use the cos(kx)\cos(kx) form if you are a maniac.)

(a) Assume a solution of the form E(x,t)=X(x)T(t)E(x,t) = X(x) \cdot T(t). Substitute this into the wave equation and show that you can separate it into:

1Xd2Xdx2=1c2Td2Tdt2\frac{1}{X}\frac{d^2 X}{dx^2} = \frac{1}{c^2 T}\frac{d^2 T}{dt^2}

Hint: After substituting, divide both sides by X(x)T(t)X(x)T(t).

(b) The left side depends only on xx, and the right side depends only on tt. For these to be equal for all xx and tt, both sides must equal the same constant. Call it k2-k^2 (we choose negative so we get oscillatory solutions). Write the two ordinary differential equations for X(x)X(x) and T(t)T(t).

(c) Solve each ODE. What is the general solution E(x,t)=X(x)T(t)E(x,t) = X(x) \cdot T(t)?

(d) Show that the separation constant kk and the resulting frequency ω\omega in T(t)T(t) are related by ω=ck\omega = ck. This is the dispersion relation for waves.


Problem 2: Visualizing Traveling Waves

Plot the traveling wave E(x,t)=cos(kxωt)E(x,t) = \cos(kx - \omega t) with k=2π/λk = 2\pi/\lambda and ω=2πf\omega = 2\pi f, where λ=1\lambda = 1 and f=1f = 1.

(a) Plot EE vs xx over several wavelengths so you can see many oscillations. Change tt and watch the wave travel. Feel free to make an animation if you want to watch a video. There are many ways to do this in python.

(b) Now change kxωtkx - \omega t to kxωt-kx - \omega t (i.e., flip the sign of the kxkx term). What’s the difference?


Problem 3: Complex Exponential Conversion

The general real solution to the wave equation can be written as:

E(x)=Acos(kx)+Bsin(kx)E(x) = A\cos(kx) + B\sin(kx)

or equivalently as:

E(x)=Ceikx+DeikxE(x) = Ce^{ikx} + De^{-ikx}

Find CC and DD in terms of AA and BB.


Problem 4: Intensity and Time Averaging

(a) Show that cos2(ωt)=12\langle \cos^2(\omega t) \rangle = \frac{1}{2} by computing the integral:

1T0Tcos2(ωt)dt\frac{1}{T}\int_0^T \cos^2(\omega t)\, dt

Hint: Use the identity cos2θ=12(1+cos2θ)\cos^2\theta = \frac{1}{2}(1 + \cos 2\theta).

(b) Similarly, show that sin2(ωt)=12\langle \sin^2(\omega t) \rangle = \frac{1}{2}.

(c) What is cos(ωt)sin(ωt)\langle \cos(\omega t)\sin(\omega t) \rangle? This “cross term” will be important for interference.

(d) For a complex wave E=E0ei(kxωt)E = E_0 e^{i(kx - \omega t)}, compute E2|E|^2 and show it’s constant in time.