Complex Numbers & Functions

3–4 hours ~10 min read

Complex Numbers & Functions

A quantum amplitude is not a probability — it is a complex number. Probabilities are the 2|\cdot|^2 shadow it casts. Everything distinctively quantum, from interference to the Fourier transform that powers Shor's algorithm, lives in the phase that the shadow throws away. This lesson rebuilds the complex field from the ground up so that phase is never mysterious again.

Learning Objectives

By the end of this lesson you will be able to:

  1. Manipulate complex numbers fluently in both Cartesian (a+bia+bi) and polar (reiθre^{i\theta}) form, converting between them and computing modulus, argument, and conjugate.
  2. Derive Euler's formula eiθ=cosθ+isinθe^{i\theta}=\cos\theta+i\sin\theta from the Maclaurin series and use it to prove de Moivre's theorem.
  3. Define the NN-th roots of unity ωk\omega^k with ω=e2πi/N\omega = e^{2\pi i/N} and prove their summation property k=0N1ωk=0\sum_{k=0}^{N-1}\omega^{k}=0.
  4. Explain why quantum amplitudes must be complex — that relative phase is physically observable through interference — and connect this to the Fourier machinery developed later in the course.
  5. Compute and visualize roots of unity in NumPy and verify their algebraic identities numerically.

Intuition

A real number is a point on a line; a complex number is a point in a plane. That extra dimension is not a bookkeeping convenience — it is rotation. Multiplying by ii rotates the plane by 90°90°; multiplying by eiθe^{i\theta} rotates it by θ\theta. The single most important picture to carry forward is this:

A unit-modulus complex number eiθe^{i\theta} is a pure rotation by angle θ\theta.

Why does quantum mechanics need this and not just real probabilities? Consider two paths an amplitude can take to the same outcome. Classically you add probabilities: p=p1+p20p = p_1 + p_2 \ge 0, and more paths can only help. Quantum mechanically you add amplitudes: $\alpha = \alpha_1 + \alpha_2,andthensquare.If, and then square. If \alpha_1 = \tfrac12and and \alpha_2 = -\tfrac12$, the outcome probability is α1+α22=0|\alpha_1+\alpha_2|^2 = 0: the two paths cancel. That sign — more generally, that relative phase eiθe^{i\theta} — is the whole game. Real numbers give you only the signs ±1\pm 1; complex numbers give you a continuous dial of cancellation. We forward-reference this as interference, the engine of every quantum speedup.

Hold two facts together as you read the theory: complex numbers are (1) the algebra of rotations and (2) the only number system rich enough to let amplitudes interfere continuously while still collapsing to real probabilities via 2|\cdot|^2.


Theory

The complex field

Definition (complex numbers). The set C={a+bi:a,bR}\mathbb{C} = \{a + bi : a,b\in\mathbb{R}\} with the symbol ii satisfying i2=1i^2 = -1, equipped with

(a+bi)+(c+di)=(a+c)+(b+d)i,(a+bi)(c+di)=(acbd)+(ad+bc)i, (a+bi) + (c+di) = (a+c) + (b+d)i,\qquad (a+bi)(c+di) = (ac-bd) + (ad+bc)i,

forms a field: addition and multiplication are commutative, associative, and distributive; 0=0+0i0 = 0+0i and 1=1+0i1 = 1+0i are the identities; and every nonzero zz has an inverse (derived below). We call a=Re(z)a = \operatorname{Re}(z) the real part and b=Im(z)b = \operatorname{Im}(z) the imaginary part. (We freely write ii where Python writes 1j; see Appendix B §1.)

Definition (conjugate and modulus). The complex conjugate of z=a+biz = a+bi is zˉ=z=abi\bar z = z^{*} = a - bi, and the modulus is

z=a2+b2=zz. |z| = \sqrt{a^2 + b^2} = \sqrt{z\,z^{*}}.

The conjugate flips the sign of the imaginary part (a reflection across the real axis). Two identities we use constantly:

zz=(a+bi)(abi)=a2+b2=z2R0,(zw)=zw. z\,z^{*} = (a+bi)(a-bi) = a^2 + b^2 = |z|^2 \in \mathbb{R}_{\ge 0}, \qquad (zw)^{*} = z^{*}w^{*}.

The first gives the multiplicative inverse for z0z\neq 0:

z1=zz2=abia2+b2, z^{-1} = \frac{z^{*}}{|z|^2} = \frac{a - bi}{a^2+b^2},

which proves C\mathbb{C} is a field. Conjugation is an involution ((z)=z(z^{*})^{*}=z) and is additive ((z+w)=z+w(z+w)^{*}=z^{*}+w^{*}); together with (zw)=zw(zw)^{*}=z^{*}w^{*} it is a field automorphism. This is exactly the operation that turns a ket into a bra: $\langle\psi| = |\psi\rangle^{\dagger}$ conjugates amplitudes (see Appendix C §1).

Cartesian and polar form

Plotting z=a+biz=a+bi at Cartesian coordinates (a,b)(a,b) in the complex plane (Argand diagram), the point also has polar coordinates (r,θ)(r,\theta):

a=rcosθ,b=rsinθ,r=z=a2+b2,θ=arg(z)=atan2(b,a). a = r\cos\theta,\quad b = r\sin\theta,\qquad r = |z| = \sqrt{a^2+b^2},\quad \theta = \arg(z) = \operatorname{atan2}(b,a).

We call rr the modulus and θ\theta the argument. The argument is only defined modulo 2π2\pi; the principal value Arg(z)(π,π]\operatorname{Arg}(z)\in(-\pi,\pi] is the standard choice (NumPy's np.angle returns it). Use atan2, not arctan(b/a)\arctan(b/a), so the correct quadrant is selected.

Euler's formula — derivation via power series

We want a meaning for eiθe^{i\theta}. Take the real Maclaurin series of exe^x, cosx\cos x, sinx\sin x — each converges for all real arguments, and the exponential series converges absolutely for every complex argument, so we may extend it to zCz\in\mathbb C and rearrange freely:

ez=n=0znn!,cosx=m=0(1)mx2m(2m)!,sinx=m=0(1)mx2m+1(2m+1)!. e^{z} = \sum_{n=0}^{\infty}\frac{z^n}{n!},\qquad \cos x = \sum_{m=0}^{\infty}\frac{(-1)^m x^{2m}}{(2m)!},\qquad \sin x = \sum_{m=0}^{\infty}\frac{(-1)^m x^{2m+1}}{(2m+1)!}.

Substitute z=iθz = i\theta and use the cycle i0=1, i1=i, i2=1, i3=i, i4=1,i^0=1,\ i^1=i,\ i^2=-1,\ i^3=-i,\ i^4=1,\dots:

eiθ=n=0(iθ)nn!=n=0inθnn!. e^{i\theta} = \sum_{n=0}^{\infty}\frac{(i\theta)^n}{n!} = \sum_{n=0}^{\infty}\frac{i^n\theta^n}{n!}.

Split into even (n=2mn=2m, giving i2m=(1)mi^{2m}=(-1)^m) and odd (n=2m+1n=2m+1, giving i2m+1=(1)mii^{2m+1}=(-1)^m i) terms. Absolute convergence lets us regroup:

eiθ=m=0(1)mθ2m(2m)!=cosθ  +  im=0(1)mθ2m+1(2m+1)!=sinθ. e^{i\theta} = \underbrace{\sum_{m=0}^{\infty}\frac{(-1)^m\theta^{2m}}{(2m)!}}_{=\,\cos\theta} \;+\; i\underbrace{\sum_{m=0}^{\infty}\frac{(-1)^m\theta^{2m+1}}{(2m+1)!}}_{=\,\sin\theta}.

This is Euler's formula:

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

Immediate consequences:

  • eiθ=cos2θ+sin2θ=1|e^{i\theta}| = \sqrt{\cos^2\theta+\sin^2\theta} = 1 — the unit circle, as the intuition promised.
  • θ=π\theta=\pi gives Euler's identity eiπ+1=0e^{i\pi}+1 = 0.
  • (eiθ)=cosθisinθ=eiθ(e^{i\theta})^{*} = \cos\theta - i\sin\theta = e^{-i\theta}, hence the inverse-on-the-circle: eiθeiθ=1e^{i\theta}e^{-i\theta}=1.
  • The complex exponential of a general z=a+biz=a+bi factors a stretch and a rotation:ez=ea+bi=eaeib=ea(cosb+isinb). e^{z} = e^{a+bi} = e^{a}\,e^{ib} = e^{a}\big(\cos b + i\sin b\big).

We can now read polar form as an exponential:

z=r(cosθ+isinθ)=reiθ,r=z, θ=argz. z = r(\cos\theta + i\sin\theta) = r\,e^{i\theta},\qquad r=|z|,\ \theta=\arg z.

Multiplication becomes transparent — moduli multiply, arguments add:

(r1eiθ1)(r2eiθ2)=r1r2ei(θ1+θ2). (r_1 e^{i\theta_1})(r_2 e^{i\theta_2}) = r_1 r_2\, e^{i(\theta_1+\theta_2)}.

This is the precise sense in which multiplying by eiθe^{i\theta} rotates by θ\theta.

De Moivre's theorem

Setting r=1r=1 and iterating the multiplication rule (or, formally, by induction on nn using ei(n+1)θ=einθeiθe^{i(n+1)\theta}=e^{in\theta}e^{i\theta}) gives de Moivre's theorem:

(cosθ+isinθ)n=cosnθ+isinnθ,nZ. \big(\cos\theta + i\sin\theta\big)^{n} = \cos n\theta + i\sin n\theta,\qquad n\in\mathbb{Z}.

It is just (eiθ)n=einθ\big(e^{i\theta}\big)^{n} = e^{in\theta} in disguise. It is the workhorse for deriving multiple-angle identities and, next, the roots of unity.

The NN-th roots of unity

We want all solutions of zN=1z^N = 1 for a positive integer NN. Write z=reiθz = r e^{i\theta}. Then zN=rNeiNθ=1=1ei0z^N = r^N e^{iN\theta} = 1 = 1\cdot e^{i\cdot 0}. Matching moduli forces r=1r=1; matching arguments (modulo 2π2\pi) forces Nθ=2πkN\theta = 2\pi k for integer kk, i.e. θ=2πk/N\theta = 2\pi k/N. Distinct values arise only for k=0,1,,N1k=0,1,\dots,N-1. Defining the primitive NN-th root of unity

ω:=e2πi/N(matches [Appendix E §6](../../appendix/Emathidentities.md)), \boxed{\,\omega := e^{2\pi i/N}\,}\qquad(\text{matches }[\text{Appendix E §6}](../../appendix/E-math-identities.md)),

the NN roots are exactly the powers of ω\omega:

zk=ωk=e2πik/N,k=0,1,,N1. z_k = \omega^{k} = e^{2\pi i k/N},\qquad k = 0,1,\dots,N-1.

Geometrically they are the NN vertices of a regular NN-gon inscribed in the unit circle, starting at 11 and stepping counter-clockwise by 2π/N2\pi/N. (We use the sign convention $\omega = e^{+2\pi i/N}$ throughout the program; see Appendix C §4. The DFT in lesson 3 uses e2πi/Ne^{-2\pi i/N} as its forward kernel — a deliberate, consistent choice.)

Theorem (vanishing sum). For N>1N>1,

k=0N1ωk=0. \sum_{k=0}^{N-1}\omega^{k} = 0.

Proof. The sum is a finite geometric series with ratio ω\omega. Since N>1N>1, $\omega = e^{2\pi i/N}\neq 1(itsargument (its argument 2\pi/N\in(0,2\pi)isnonzeromod is nonzero mod 2\pi$), so the closed form applies:

k=0N1ωk=1ωN1ω. \sum_{k=0}^{N-1}\omega^{k} = \frac{1-\omega^{N}}{1-\omega}.

But ωN=e2πi=1\omega^{N} = e^{2\pi i} = 1, so the numerator is 11=01-1 = 0 while the denominator $1-\omega\neq 0.Hencethesumis. Hence the sum is 0.. \blacksquare$

This is the algebraic heart of all Fourier analysis: distinct frequency components cancel when summed over a full period. We generalize it now.

Corollary (orthogonality of roots). For integers j,kj,k,

1Nx=0N1ωx(jk)=δjk(indices taken mod N), \frac{1}{N}\sum_{x=0}^{N-1} \omega^{x(j-k)} = \delta_{jk} \qquad\text{(indices taken mod }N),

matching the DFT/QFT orthogonality in Appendix E §6.

Proof. Let m=jkm = j-k. If m0(modN)m\equiv 0\pmod N then every term is ω0=1\omega^{0}=1 and the average is 1NN=1\tfrac1N\cdot N = 1. Otherwise ωm1\omega^{m}\neq 1 and the same geometric-series argument gives

x=0N1(ωm)x=1(ωm)N1ωm=1(ωN)m1ωm=111ωm=0. \sum_{x=0}^{N-1}(\omega^{m})^{x} = \frac{1-(\omega^{m})^{N}}{1-\omega^{m}} = \frac{1-(\omega^{N})^{m}}{1-\omega^{m}} = \frac{1-1}{1-\omega^{m}} = 0. \qquad\blacksquare

Other useful properties.

  • Closure / group structure. The roots {1,ω,,ωN1}\{1,\omega,\dots,\omega^{N-1}\} are closed under multiplication: ωjωk=ω(j+k)modN\omega^{j}\omega^{k} = \omega^{(j+k)\bmod N}. They form the cyclic group Z/NZ\mathbb Z/N\mathbb Z under addition of exponents — the same group that indexes computational basis states in the QFT.
  • Conjugate = inverse. ωk=ωk=ωNk\overline{\omega^{k}} = \omega^{-k} = \omega^{N-k}, since ωk=1|\omega^k|=1.
  • Product of all roots. $\prod_{k=0}^{N-1}\omega^{k} = \omega^{,0+1+\cdots+(N-1)} = \omega^{N(N-1)/2} = (-1)^{N-1}$.

Why quantum amplitudes are complex

A pure state is ψ=α0+β1|\psi\rangle = \alpha|0\rangle + \beta|1\rangle with α,βC\alpha,\beta\in\mathbb C and α2+β2=1|\alpha|^2 + |\beta|^2 = 1 (Appendix C §1). Measurement gives outcome 00 with probability α2|\alpha|^2 — so why not just store the probabilities (α2,β2)(|\alpha|^2,|\beta|^2) and stay real and nonnegative?

Because evolution mixes the components, and the mixing is sensitive to phase. Apply a Hadamard to +=12(0+1)|+\rangle = \tfrac1{\sqrt2}(|0\rangle+|1\rangle) versus $|-\rangle = \tfrac1{\sqrt2}(|0\rangle-|1\rangle)$:

H+=0,H=1. H|+\rangle = |0\rangle,\qquad H|-\rangle = |1\rangle.

Both +|+\rangle and |-\rangle have the same measurement statistics in the computational basis (50/5050/50), so the probability vector (12,12)(\tfrac12,\tfrac12) cannot tell them apart. Yet HH sends one to a certain 00 and the other to a certain 11. The only thing distinguishing them is the relative phase β/α=+1\beta/\alpha = +1 versus 1-1 — a phase eiπe^{i\pi}. Relative phase is therefore physically observable: it changes future measurement outcomes after interference.

Two more points pin this down:

  • Global phase is unobservable. ψ|\psi\rangle and eiγψe^{i\gamma}|\psi\rangle give identical statistics for every measurement, because eiγα2=α2|e^{i\gamma}\alpha|^2 = |\alpha|^2. Only phase differences between amplitudes matter — exactly the relative phase above.
  • Why not just signs ±1\pm1? Real amplitudes (β/α{±1}\beta/\alpha\in\{\pm1\} up to scale) allow only two-way cancellation. Continuous phases eiθe^{i\theta} let amplitudes interfere by any angle, and the canonical phases are precisely the roots of unity ωk\omega^k. When a quantum register holds a uniform superposition and we apply a phase ωxy\omega^{xy} to basis state y|y\rangle, the interference pattern is governed by sums like yωxy\sum_y \omega^{xy} — which, by the vanishing-sum theorem above, are zero except at special xx. That selective cancellation is the Quantum Fourier Transform, developed in Term 2.4 · The Quantum Fourier Transform.

So: amplitudes are complex because nature lets probability amplitudes rotate and interfere, and C\mathbb C is the minimal arena — a field where 2|\cdot|^2 recovers probabilities — in which continuous rotation lives.


Worked Examples

Example 1 — Polar form, powers, and a root

Let z=1+i3z = 1 + i\sqrt 3.

Modulus and argument. z=12+(3)2=4=2|z| = \sqrt{1^2 + (\sqrt3)^2} = \sqrt{4} = 2. The point (1,3)(1,\sqrt3) is in the first quadrant, so argz=atan2(3,1)=π/3\arg z = \operatorname{atan2}(\sqrt3, 1) = \pi/3. Thus

z=2eiπ/3. z = 2\,e^{i\pi/3}.

A power, via de Moivre. Compute z6z^{6}:

z6=26ei6π/3=64ei2π=641=64. z^{6} = 2^{6}\,e^{i\cdot 6\pi/3} = 64\,e^{i2\pi} = 64\cdot 1 = 64.

The phase wraps exactly once around the circle and lands back on the positive real axis — a clean illustration of "arguments add (mod 2π2\pi), moduli multiply."

A square root. $\sqrt z = \sqrt2,e^{i\pi/6} = \sqrt2(\cos\tfrac\pi6 + i\sin\tfrac\pi6) = \sqrt2\big(\tfrac{\sqrt3}{2} + \tfrac{i}{2}\big) = \tfrac{\sqrt6}{2} + \tfrac{\sqrt2}{2},i$. (The other root is its negative.)

Example 2 — The cube roots of unity and their sum

Take N=3N=3, ω=e2πi/3\omega = e^{2\pi i/3}. The roots are:

ω0=1,ω1=e2πi/3=cos2π3+isin2π3=12+32i, \omega^{0} = 1,\qquad \omega^{1} = e^{2\pi i/3} = \cos\tfrac{2\pi}{3} + i\sin\tfrac{2\pi}{3} = -\tfrac12 + \tfrac{\sqrt3}{2}i, ω2=e4πi/3=1232i. \omega^{2} = e^{4\pi i/3} = -\tfrac12 - \tfrac{\sqrt3}{2}i.

They are the vertices of an equilateral triangle on the unit circle. Their sum:

1+(12+32i)+(1232i)=(11212)+(3232)i=0, 1 + \Big(-\tfrac12 + \tfrac{\sqrt3}{2}i\Big) + \Big(-\tfrac12 - \tfrac{\sqrt3}{2}i\Big) = (1 - \tfrac12 - \tfrac12) + \big(\tfrac{\sqrt3}{2} - \tfrac{\sqrt3}{2}\big)i = 0,

confirming k=02ωk=0\sum_{k=0}^{2}\omega^k = 0. Note also ω2=ω1=ω1\omega^2 = \overline{\omega^1} = \omega^{-1}, as the conjugate-inverse property predicts.

Example 3 — Interference: distinguishing +|+\rangle from |-\rangle

Let α=12\alpha = \tfrac1{\sqrt2} and consider ±=α0±α1|\pm\rangle = \alpha|0\rangle \pm \alpha|1\rangle. The Hadamard H = \tfrac1{\sqrt2}\begin{psmallmatrix}1&1\\1&-1\end{psmallmatrix} acts as

H+=12[(1+1)0+(11)1]=0, H|+\rangle = \tfrac12\big[(1+1)|0\rangle + (1-1)|1\rangle\big] = |0\rangle, H=12[(11)0+(1+1)1]=1. H|-\rangle = \tfrac12\big[(1-1)|0\rangle + (1+1)|1\rangle\big] = |1\rangle.

In H+H|+\rangle the 1|1\rangle amplitudes 12\tfrac12 and 12-\tfrac12 cancel by destructive interference (their relative phase is eiπ=1e^{i\pi}=-1); in HH|-\rangle the 0|0\rangle amplitudes cancel instead. A purely real, nonnegative probability description (12,12)(\tfrac12,\tfrac12) for both inputs could never predict these opposite, deterministic outputs. The complex (here, just signed) relative phase is doing physical work — this is the smallest possible instance of the interference that the Fourier methods in this course exploit at scale.


Hands-on (Python)

import numpy as np
import matplotlib.pyplot as plt

# ----- Cartesian <-> polar -----
z = 1 + 1j * np.sqrt(3)          # 1 + i*sqrt(3)
print("z            =", z)
print("|z|          =", abs(z))            # 2.0   = modulus
print("arg(z) [rad] =", np.angle(z))       # ~1.047 = pi/3
print("conj(z)      =", z.conjugate())     # 1 - i*sqrt(3)
print("z * conj(z)  =", (z * z.conjugate()).real)  # |z|^2 = 4.0

# Reconstruct z from polar form r * e^{i*theta}
r, theta = abs(z), np.angle(z)
z_polar = r * np.exp(1j * theta)
print("polar matches Cartesian:", np.isclose(z, z_polar))  # True


def roots_of_unity(N):
    """Return the N-th roots of unity as a complex array [omega^0, ..., omega^{N-1}]."""
    k = np.arange(N)
    omega = np.exp(2j * np.pi / N)         # primitive root  ω = e^{2πi/N}
    return omega ** k                      # equivalently np.exp(2j*np.pi*k/N)


# ----- Verify the vanishing-sum theorem  Σ ω^k = 0  for several N -----
for N in (2, 3, 4, 8, 16):
    s = roots_of_unity(N).sum()
    print(f"N={N:2d}:  Σ ω^k = {s:.2e}   (|sum| = {abs(s):.2e})")
    assert np.isclose(s, 0.0, atol=1e-12), "vanishing-sum theorem failed!"

# ----- Verify orthogonality  (1/N) Σ_x ω^{x(j-k)} = δ_{jk} -----
N = 8
omega = np.exp(2j * np.pi / N)
x = np.arange(N)
# Build the N x N matrix M[j, k] = (1/N) Σ_x ω^{x(j-k)}; it should be the identity.
M = np.array([[np.mean(omega ** (x * (j - k))) for k in range(N)] for j in range(N)])
print("orthogonality gives identity:", np.allclose(M, np.eye(N), atol=1e-12))  # True


def plot_roots_of_unity(N):
    """Plot the N-th roots of unity on the unit circle."""
    roots = roots_of_unity(N)
    fig, ax = plt.subplots(figsize=(5, 5))
    circle = plt.Circle((0, 0), 1.0, fill=False, linestyle="--", color="gray")
    ax.add_patch(circle)
    ax.scatter(roots.real, roots.imag, zorder=3)
    for k, w in enumerate(roots):
        ax.annotate(rf"$\omega^{{{k}}}$", (w.real, w.imag),
                    textcoords="offset points", xytext=(6, 6))
    ax.axhline(0, color="black", lw=0.5); ax.axvline(0, color="black", lw=0.5)
    ax.set_aspect("equal"); ax.set_xlim(-1.3, 1.3); ax.set_ylim(-1.3, 1.3)
    ax.set_title(rf"$N={N}$ roots of unity,  $\omega=e^{{2\pi i/{N}}}$")
    ax.set_xlabel("Re"); ax.set_ylabel("Im")
    plt.tight_layout(); plt.show()


plot_roots_of_unity(8)

# ----- Interference demo: H distinguishes |+> from |-> -----
H = np.array([[1, 1], [1, -1]], dtype=complex) / np.sqrt(2)
ket_plus  = np.array([1,  1], dtype=complex) / np.sqrt(2)
ket_minus = np.array([1, -1], dtype=complex) / np.sqrt(2)
print("H|+> =", np.round(H @ ket_plus, 12).real)    # [1, 0]  -> |0>
print("H|-> =", np.round(H @ ket_minus, 12).real)   # [0, 1]  -> |1>

Running this prints |z|=2.0, arg(z)≈1.047 (=π/3=\pi/3), confirms ωk=0\sum\omega^k=0 to machine precision for every NN, verifies the orthogonality matrix is the identity, draws the regular 88-gon of roots, and shows that HH maps +0|+\rangle\mapsto|0\rangle and 1|-\rangle\mapsto|1\rangle — interference made visible.


Exercises

Attempt each before expanding the solution.

1. (Easy) Cartesian ↔ polar. Write z=3+iz = -\sqrt3 + i in polar form reiθre^{i\theta} with θ(π,π]\theta\in(-\pi,\pi], then compute z4z^{4}.

Solution

z=(3)2+12=2|z| = \sqrt{(\sqrt3)^2 + 1^2} = 2. The point (3,1)(-\sqrt3, 1) is in the second quadrant: θ=atan2(1,3)=ππ/6=5π/6\theta = \operatorname{atan2}(1, -\sqrt3) = \pi - \pi/6 = 5\pi/6. So z=2ei5π/6z = 2\,e^{i5\pi/6}. Then z4=24ei20π/6=16ei10π/3z^4 = 2^4 e^{i\cdot 20\pi/6} = 16\,e^{i10\pi/3}. Reduce the argument mod 2π2\pi: 10π/32π=4π/310\pi/3 - 2\pi = 4\pi/3, so $z^4 = 16,e^{i4\pi/3} = 16(-\tfrac12 - \tfrac{\sqrt3}{2}i) = -8 - 8\sqrt3,i$.

2. (Easy) Conjugate identities. Prove (zw)=zw(zw)^{*} = z^{*}w^{*} directly from z=a+biz=a+bi, w=c+diw=c+di, and use it to show zw=zw|zw| = |z|\,|w|.

Solution

zw=(acbd)+(ad+bc)izw = (ac-bd) + (ad+bc)i, so (zw)=(acbd)(ad+bc)i(zw)^{*} = (ac-bd) - (ad+bc)i. Meanwhile $z^{}w^{} = (a-bi)(c-di) = (ac - bd) - (ad+bc)i(thecrossterms (the cross terms -adi - bcicombineto combine to -(ad+bc)i$, and (bi)(di)=bdi2=bd(-bi)(-di) = bd i^2 = -bd). They match. Then $|zw|^2 = (zw)(zw)^{} = z w z^{} w^{} = (zz^{})(ww^{*}) = |z|^2|w|^2;takingnonnegativesquarerootsgives; taking nonnegative square roots gives |zw| = |z||w|$. (In polar form this is just "moduli multiply.")

3. (Medium) De Moivre → trig identity. Use de Moivre with n=3n=3 to derive cos3θ=4cos3θ3cosθ\cos 3\theta = 4\cos^3\theta - 3\cos\theta.

Solution

(cosθ+isinθ)3=cos3θ+isin3θ(\cos\theta + i\sin\theta)^3 = \cos3\theta + i\sin3\theta. Expand the left side with the binomial theorem: $\cos^3\theta + 3\cos^2\theta(i\sin\theta) + 3\cos\theta(i\sin\theta)^2 + (i\sin\theta)^3 = \cos^3\theta - 3\cos\theta\sin^2\theta + i(3\cos^2\theta\sin\theta - \sin^3\theta)$. Match real parts: cos3θ=cos3θ3cosθsin2θ\cos3\theta = \cos^3\theta - 3\cos\theta\sin^2\theta. Substitute $\sin^2\theta = 1 - \cos^2\theta:: \cos3\theta = \cos^3\theta - 3\cos\theta(1-\cos^2\theta) = 4\cos^3\theta - 3\cos\theta.. \blacksquare$

4. (Medium) Sum of a subset of roots. For N=6N=6, compute k=05ω2k\sum_{k=0}^{5}\omega^{2k} where ω=e2πi/6\omega = e^{2\pi i/6}. Explain the result group-theoretically.

Solution

ω2=e4πi/6=e2πi/3\omega^{2} = e^{4\pi i/6} = e^{2\pi i/3} is a primitive cube root of unity. As kk runs over 0,,50,\dots,5, ω2k\omega^{2k} runs over the cube roots {1,e2πi/3,e4πi/3}\{1, e^{2\pi i/3}, e^{4\pi i/3}\} twice (period 3). So k=05ω2k=2j=02(e2πi/3)j=20=0\sum_{k=0}^{5}\omega^{2k} = 2\sum_{j=0}^{2}(e^{2\pi i/3})^{j} = 2\cdot 0 = 0 by the vanishing-sum theorem for N=3N=3. Group-theoretically, {ω2k}\{\omega^{2k}\} is the subgroup generated by ω2\omega^2, which is the cyclic group of order 33; the sum over any nontrivial finite cyclic subgroup (here covered twice) vanishes.

5. (Hard) Geometric-series proof, general phase. Show that for any real ϕ\phi with ϕ≢0(mod2π)\phi\not\equiv 0\pmod{2\pi}, $\big|\sum_{k=0}^{N-1} e^{ik\phi}\big| = \big|\frac{\sin(N\phi/2)}{\sin(\phi/2)}\big|(theDirichletkernel).Thenrecover (the *Dirichlet kernel*). Then recover \sum_{k}\omega^k = 0asthespecialcase as the special case \phi = 2\pi/N$.

Solution

Sum the geometric series with ratio eiϕ1e^{i\phi}\neq 1: S=k=0N1eikϕ=1eiNϕ1eiϕS = \sum_{k=0}^{N-1} e^{ik\phi} = \frac{1 - e^{iN\phi}}{1 - e^{i\phi}}. Factor out the half-angle from numerator and denominator ("$1-e^{i\alpha} = e^{i\alpha/2}(e^{-i\alpha/2} - e^{i\alpha/2}) = -2i,e^{i\alpha/2}\sin(\alpha/2)$"):

S=2ieiNϕ/2sin(Nϕ/2)2ieiϕ/2sin(ϕ/2)=ei(N1)ϕ/2sin(Nϕ/2)sin(ϕ/2). S = \frac{-2i\,e^{iN\phi/2}\sin(N\phi/2)}{-2i\,e^{i\phi/2}\sin(\phi/2)} = e^{i(N-1)\phi/2}\,\frac{\sin(N\phi/2)}{\sin(\phi/2)}.

Taking the modulus (the leading exponential has modulus 1) gives S=sin(Nϕ/2)/sin(ϕ/2)|S| = \big|\sin(N\phi/2)/\sin(\phi/2)\big|. For ϕ=2π/N\phi = 2\pi/N: Nϕ/2=πN\phi/2 = \pi, so sin(Nϕ/2)=sinπ=0\sin(N\phi/2) = \sin\pi = 0 while sin(ϕ/2)=sin(π/N)0\sin(\phi/2) = \sin(\pi/N)\neq 0 for N>1N>1. Hence S=0|S|=0, i.e. kωk=0\sum_k \omega^k = 0. \blacksquare

6. (Hard) Phase encodes a number. A single qubit is prepared in ψφ=12(0+e2πiφ1)|\psi_\varphi\rangle = \tfrac1{\sqrt2}(|0\rangle + e^{2\pi i\varphi}|1\rangle) for some unknown φ[0,1)\varphi\in[0,1). (a) Show that measuring in the computational basis cannot reveal φ\varphi. (b) Show that applying HH first and then measuring gives outcome 00 with probability cos2(πφ)\cos^2(\pi\varphi), so the relative phase becomes measurable. (This is the seed of phase estimation.)

Solution

(a) 0ψφ2=122=12|\langle 0|\psi_\varphi\rangle|^2 = |\tfrac1{\sqrt2}|^2 = \tfrac12 and likewise for outcome 11, independent of φ\varphi — the global phase on 1|1\rangle is washed out by 2|\cdot|^2.

(b) $H|\psi_\varphi\rangle = \tfrac1{\sqrt2}\big[\tfrac1{\sqrt2}(|0\rangle+|1\rangle) + e^{2\pi i\varphi}\tfrac1{\sqrt2}(|0\rangle-|1\rangle)\big] = \tfrac12\big[(1+e^{2\pi i\varphi})|0\rangle + (1-e^{2\pi i\varphi})|1\rangle\big].Theamplitudeof. The amplitude of |0\rangleis is \tfrac12(1+e^{2\pi i\varphi}).Using. Using 1+e^{i\alpha} = e^{i\alpha/2}(e^{-i\alpha/2}+e^{i\alpha/2}) = 2e^{i\alpha/2} \cos(\alpha/2)with with \alpha = 2\pi\varphi,theamplitudeis, the amplitude is e^{i\pi\varphi}\cos(\pi\varphi)$, so p(0)=2=cos2(πφ)p(0) = |{\cdot}|^2 = \cos^2(\pi\varphi). The previously hidden phase φ\varphi now controls a measurable probability — interference has converted relative phase into statistics. This is exactly the mechanism scaled up in Term 2.4.


Checkpoint

1. State Euler's formula and give the one-line reason $|e^{i\theta}|=1$.

eiθ=cosθ+isinθe^{i\theta} = \cos\theta + i\sin\theta. Its modulus is cos2θ+sin2θ=1\sqrt{\cos^2\theta+\sin^2\theta}=1, so it lies on the unit circle — a pure rotation by θ\theta.

2. Why does $\sum_{k=0}^{N-1}\omega^k = 0$ for $N>1$, in one sentence?

It is a geometric series with ratio ω1\omega\neq1; its closed form (1ωN)/(1ω)(1-\omega^N)/(1-\omega) has numerator 1ωN=11=01-\omega^N = 1-1 = 0 because ωN=e2πi=1\omega^N = e^{2\pi i} = 1.

3. What is the difference between global phase and relative phase, and which is physical?

A global phase eiγe^{i\gamma} multiplies the whole state and is unobservable ($|e^{i\gamma}\alpha|^2 = |\alpha|^2).Arelativephaseisaphasedifferencebetweenamplitudes(e.g.). A relative phase is a phase *difference between amplitudes* (e.g. \beta/\alpha$); it is physically observable because it changes interference and hence future measurement statistics.

4. Concretely, why can't real nonnegative probabilities replace complex amplitudes?

Because evolution mixes amplitudes, and the result depends on phases. +|+\rangle and |-\rangle share the probability vector (12,12)(\tfrac12,\tfrac12) but HH maps them to 0|0\rangle and 1|1\rangle respectively — opposite deterministic outcomes. Only the complex (relative) phase distinguishes the inputs.

5. How are the $N$-th roots of unity related to the group $\mathbb Z/N\mathbb Z$?

ωjωk=ω(j+k)modN\omega^j\omega^k = \omega^{(j+k)\bmod N}, so the roots are closed under multiplication and form a cyclic group isomorphic to (Z/NZ,+)(\mathbb Z/N\mathbb Z, +) via kωkk\mapsto\omega^k. This is the group that indexes basis states in the (Quantum) Fourier Transform.

6. What single identity from this lesson is the algebraic core of the DFT/QFT?

The orthogonality relation 1Nx=0N1ωx(jk)=δjk\tfrac1N\sum_{x=0}^{N-1}\omega^{x(j-k)} = \delta_{jk} — distinct frequency components cancel over a full period, leaving only the matching term. We use it to prove the DFT matrix is unitary in lesson 3.


Further Reading

  • [NC, §2.1] — complex linear algebra background the program relies on.
  • [Axl]Linear Algebra Done Right: clean treatment of C\mathbb C as the scalar field.
  • Appendix E §6 — roots of unity, the QFT kernel, Euler's formula, in the program's exact notation.
  • Appendix C §1, §4 — global vs. relative phase; the Fourier sign convention.

← Prev: Classical Information Theory · Up: Term 0 · Next: Fourier Series & Transforms