QuantumCore

Lesson 1 · 45 min · introductory

Complex Numbers & Euler's Formula

Loading progress…

The arithmetic of C\mathbb{C}, the modulus and conjugate, polar form, Euler's formula derived from the exponential power series, De Moivre's theorem and the roots of unity whose vanishing sums power the quantum Fourier transform.

Objectives and key results
  • Perform addition, multiplication and division in C\mathbb{C} in Cartesian form a+iba+ib.

  • Convert between Cartesian form a+iba+ib and polar form reiθre^{i\theta}.

  • Use ∣z∣2=zzˉ\lvert z\rvert^2=z\bar z and the multiplicativity ∣zw∣=∣z∣∣w∣\lvert zw\rvert=\lvert z\rvert\lvert w\rvert.

  • Apply Euler's formula eiθ=cos⁡θ+isin⁡θe^{i\theta}=\cos\theta+i\sin\theta to multiply phases, compute powers with De Moivre's theorem, and evaluate sums of roots of unity.

formula · Complex multiplication
(a+ib)(c+id)=(ac−bd)+i(ad+bc)(a+ib)(c+id)=(ac-bd)+i(ad+bc)
identity · Modulus squared
∣z∣2=zzˉ=a2+b2\lvert z\rvert^2=z\bar z=a^2+b^2
theorem · Euler's formula
eiθ=cos⁡θ+isin⁡θe^{i\theta}=\cos\theta+i\sin\theta
identity · Polar multiplication
r1eiθ1 r2eiθ2=r1r2 ei(θ1+θ2)r_1e^{i\theta_1}\,r_2e^{i\theta_2}=r_1r_2\,e^{i(\theta_1+\theta_2)}
identity · Sum of roots of unity
∑k=0N−1ωNjk=N δj≡0 (mod N),ωN=e2πi/N\sum_{k=0}^{N-1}\omega_N^{jk}=N\,\delta_{j\equiv 0\ (\mathrm{mod}\ N)},\qquad \omega_N=e^{2\pi i/N}

Why quantum mechanics needs complex numbers#

Every quantum state you will meet on this platform is a list of complex numbers called amplitudes. A single qubit is described by two of them, α\alpha and β\beta, in ∣ψ⟩=α∣0⟩+β∣1⟩\lvert\psi\rangle=\alpha\lvert0\rangle+\beta\lvert1\rangle; a register of nn qubits needs 2n2^n of them. Real numbers are not enough: the phenomenon of interference, in which two computational paths cancel each other, depends on amplitudes that carry a direction (a phase) as well as a size. A phase can rotate a contribution by any angle, not just flip its sign, and the natural language for rotations in a plane is the complex numbers.

This lesson builds the arithmetic of C\mathbb{C} from scratch and proves every identity used later in the curriculum. The single most important result is Euler's formula eiθ=cos⁡θ+isin⁡θe^{i\theta}=\cos\theta+i\sin\theta, which turns multiplication of complex numbers into addition of angles. It is the reason phase gates such as S=diag(1,i)S=\mathrm{diag}(1,i) and T=diag(1,eiπ/4)T=\mathrm{diag}(1,e^{i\pi/4}) are so easy to compose, and the reason the quantum Fourier transform works.

Definition

Complex number

A complex number is an expression z=a+ibz=a+ib with a,b∈Ra,b\in\mathbb{R} and the imaginary unit ii satisfying i2=−1i^2=-1. The number a=Re za=\mathrm{Re}\,z is the real part and b=Im zb=\mathrm{Im}\,z is the imaginary part. Two complex numbers are equal exactly when their real parts are equal and their imaginary parts are equal. Geometrically, zz is the point (a,b)(a,b) of the complex plane, with the real axis horizontal and the imaginary axis vertical. The set of all complex numbers is denoted C\mathbb{C}.

Addition is component-wise, (a+ib)+(c+id)=(a+c)+i(b+d)(a+ib)+(c+id)=(a+c)+i(b+d), exactly like adding arrows in the plane. Multiplication is defined by expanding the product with the ordinary distributive law and then replacing i2i^2 by −1-1. The derivation below is the only rule you ever need to memorise; everything else follows from it.

Derivation

The multiplication rule

  1. Step 1:
    (a+ib)(c+id)=a⋅c+a⋅id+ib⋅c+ib⋅id(a+ib)(c+id)=a\cdot c+a\cdot id+ib\cdot c+ib\cdot id
    Distribute each term of the first factor over each term of the second.
  2. Step 2:
    =ac+iad+ibc+i2bd=ac+iad+ibc+i^2bd
    Real numbers commute with ii, so collect the factors of ii in each term.
  3. Step 3:
    =ac+iad+ibc−bd=ac+iad+ibc-bd
    Use the defining relation i2=−1i^2=-1.
  4. Step 4:
    =(ac−bd)+i(ad+bc)=(ac-bd)+i(ad+bc)
    Group the real terms and the terms multiplying ii.

Worked example. Take z=3+4iz=3+4i and w=1−2iw=1-2i. With a=3,b=4,c=1,d=−2a=3,b=4,c=1,d=-2:

zw=(3⋅1−4⋅(−2))+i(3⋅(−2)+4⋅1)=(3+8)+i(−6+4)=11−2i.zw=(3\cdot1-4\cdot(-2))+i(3\cdot(-2)+4\cdot1)=(3+8)+i(-6+4)=11-2i.

Addition gives z+w=4+2iz+w=4+2i and subtraction z−w=2+6iz-w=2+6i. With the addition and multiplication rules, C\mathbb{C} is a field: both operations are associative and commutative, multiplication distributes over addition, 00 and 11 are the neutral elements, and (as we prove next) every nonzero number has a multiplicative inverse.

Conjugate, modulus and division#

Definition

Complex conjugate and modulus

The complex conjugate of z=a+ibz=a+ib is zˉ=a−ib\bar z=a-ib, the mirror image of zz in the real axis. The modulus (absolute value) is ∣z∣=a2+b2\lvert z\rvert=\sqrt{a^2+b^2}, the Euclidean distance from 00 to the point (a,b)(a,b). Conjugation reverses the sign of the imaginary part only, so zˉˉ=z\bar{\bar z}=z, and zz is real exactly when zˉ=z\bar z=z.

Proposition

The modulus squared is zzˉz\bar z

For every z=a+ib∈Cz=a+ib\in\mathbb{C} we have zzˉ=a2+b2=∣z∣2z\bar z=a^2+b^2=\lvert z\rvert^2. In particular zzˉz\bar z is a non-negative real number, and it is zero only for z=0z=0.

Proof (4 steps)
  1. Step 1:
    zzˉ=(a+ib)(a−ib)z\bar z=(a+ib)(a-ib)
    Definition of the conjugate: zˉ=a+i(−b)\bar z=a+i(-b).
  2. Step 2:
    =(a⋅a−b⋅(−b))+i(a⋅(−b)+b⋅a)=(a\cdot a-b\cdot(-b))+i(a\cdot(-b)+b\cdot a)
    Multiplication rule with c=ac=a, d=−bd=-b.
  3. Step 3:
    =(a2+b2)+i(−ab+ab)=a2+b2=(a^2+b^2)+i(-ab+ab)=a^2+b^2
    The imaginary part cancels exactly.
  4. Step 4:
    =∣z∣2 ≥0,∣z∣2=0  ⟺  a=b=0=\lvert z\rvert^2\ \ge 0,\qquad \lvert z\rvert^2=0\iff a=b=0
    Definition of the modulus; a sum of two real squares vanishes only when both squares vanish.

∎

Lemma

Conjugation respects products

For all z,w∈Cz,w\in\mathbb{C}: zw‾=zˉ wˉ\overline{zw}=\bar z\,\bar w (and also z+w‾=zˉ+wˉ\overline{z+w}=\bar z+\bar w).

Proof (4 steps)
  1. Step 1:
    zw=(ac−bd)+i(ad+bc) ⇒ zw‾=(ac−bd)−i(ad+bc)zw=(ac-bd)+i(ad+bc)\ \Rightarrow\ \overline{zw}=(ac-bd)-i(ad+bc)
    Write z=a+ibz=a+ib, w=c+idw=c+id, multiply, then flip the sign of the imaginary part.
  2. Step 2:
    zˉ wˉ=(a−ib)(c−id)=(ac−(−b)(−d))+i(a(−d)+(−b)c)\bar z\,\bar w=(a-ib)(c-id)=(ac-(-b)(-d))+i(a(-d)+(-b)c)
    Multiplication rule applied to a+i(−b)a+i(-b) and c+i(−d)c+i(-d).
  3. Step 3:
    =(ac−bd)−i(ad+bc)=zw‾=(ac-bd)-i(ad+bc)=\overline{zw}
    Simplify the signs and compare with the first line.
  4. Step 4:
    z+w‾=(a+c)−i(b+d)=(a−ib)+(c−id)=zˉ+wˉ\overline{z+w}=(a+c)-i(b+d)=(a-ib)+(c-id)=\bar z+\bar w
    Addition is component-wise, so conjugating the sum conjugates each summand.

∎

Proposition

The modulus is multiplicative

For all z,w∈Cz,w\in\mathbb{C}: ∣zw∣=∣z∣ ∣w∣\lvert zw\rvert=\lvert z\rvert\,\lvert w\rvert.

Proof (4 steps)
  1. Step 1:
    ∣zw∣2=(zw) zw‾\lvert zw\rvert^2=(zw)\,\overline{zw}
    Apply ∣u∣2=uuˉ\lvert u\rvert^2=u\bar u to u=zwu=zw.
  2. Step 2:
    =(zw)(zˉ wˉ)=(zw)(\bar z\,\bar w)
    Conjugation respects products (previous lemma).
  3. Step 3:
    =(zzˉ)(wwˉ)=∣z∣2∣w∣2=(z\bar z)(w\bar w)=\lvert z\rvert^2\lvert w\rvert^2
    Multiplication in C\mathbb{C} is commutative and associative, so the four factors can be regrouped.
  4. Step 4:
    ∣zw∣=∣z∣ ∣w∣\lvert zw\rvert=\lvert z\rvert\,\lvert w\rvert
    Both sides are non-negative reals, so take the non-negative square root.

∎

Derivation

The multiplicative inverse z−1=zˉ/∣z∣2z^{-1}=\bar z/\lvert z\rvert^2

  1. Step 1:
    z≠0 ⇒ ∣z∣2=a2+b2>0z\ne0\ \Rightarrow\ \lvert z\rvert^2=a^2+b^2>0
    A nonzero complex number has at least one nonzero component.
  2. Step 2:
    z⋅zˉ∣z∣2=zzˉ∣z∣2z\cdot\frac{\bar z}{\lvert z\rvert^2}=\frac{z\bar z}{\lvert z\rvert^2}
    Dividing by the positive real number ∣z∣2\lvert z\rvert^2 is multiplication by the real number 1/∣z∣21/\lvert z\rvert^2.
  3. Step 3:
    =∣z∣2∣z∣2=1=\frac{\lvert z\rvert^2}{\lvert z\rvert^2}=1
    Use zzˉ=∣z∣2z\bar z=\lvert z\rvert^2.
  4. Step 4:
    ⇒ z−1=zˉ∣z∣2=a−iba2+b2\Rightarrow\ z^{-1}=\frac{\bar z}{\lvert z\rvert^2}=\frac{a-ib}{a^2+b^2}
    The number that multiplies zz to 11 is by definition its inverse; it is unique because C\mathbb{C} is a field.

Worked example. For z=3+4iz=3+4i we have zˉ=3−4i\bar z=3-4i and ∣z∣2=9+16=25\lvert z\rvert^2=9+16=25, so

13+4i=3−4i25=325−425i=0.12−0.16i.\frac{1}{3+4i}=\frac{3-4i}{25}=\frac{3}{25}-\frac{4}{25}i=0.12-0.16i.

Check: (3+4i)(0.12−0.16i)=(0.36+0.64)+i(−0.48+0.48)=1(3+4i)(0.12-0.16i)=(0.36+0.64)+i(-0.48+0.48)=1. To divide w=1−2iw=1-2i by zz multiply numerator and denominator by zˉ\bar z:

1−2i3+4i=(1−2i)(3−4i)25=(3−8)+i(−4−6)25=−5−10i25=−15−25i.\frac{1-2i}{3+4i}=\frac{(1-2i)(3-4i)}{25}=\frac{(3-8)+i(-4-6)}{25}=\frac{-5-10i}{25}=-\frac15-\frac25 i.

Multiplicativity of the modulus is a useful sanity check: ∣3+4i∣=5\lvert 3+4i\rvert=5, ∣1−2i∣=5\lvert1-2i\rvert=\sqrt5, and indeed ∣(3+4i)(1−2i)∣=∣11−2i∣=121+4=125=55\lvert(3+4i)(1-2i)\rvert=\lvert 11-2i\rvert=\sqrt{121+4}=\sqrt{125}=5\sqrt5.

Polar form and Euler's formula#

A point of the plane can be located either by Cartesian coordinates (a,b)(a,b) or by its distance r=∣z∣r=\lvert z\rvert from the origin together with the angle θ\theta measured counter-clockwise from the positive real axis. Elementary trigonometry gives a=rcos⁡θa=r\cos\theta and b=rsin⁡θb=r\sin\theta, so

z=r(cos⁡θ+isin⁡θ).z=r(\cos\theta+i\sin\theta).

The angle θ=arg⁡z\theta=\arg z is the argument (or phase) of zz. It is defined only up to adding integer multiples of 2π2\pi; the principal value lies in (−π,π](-\pi,\pi] and is computed as θ=atan2⁡(b,a)\theta=\operatorname{atan2}(b,a), which respects the quadrant of (a,b)(a,b). For example 1+i1+i has r=2r=\sqrt2 and θ=π/4\theta=\pi/4, whereas −1−i-1-i has r=2r=\sqrt2 and θ=−3π/4\theta=-3\pi/4 even though both have b/a=1b/a=1.

The combination cos⁡θ+isin⁡θ\cos\theta+i\sin\theta appears so often that it deserves a shorter name. Euler discovered that it is precisely the exponential function evaluated at the imaginary number iθi\theta. We define the complex exponential by the same power series as the real one, ew=∑k≥0wk/k!e^{w}=\sum_{k\ge0}w^k/k!, which converges for every w∈Cw\in\mathbb{C}, and derive the formula.

Theorem

Euler's formula

For every real θ\theta, eiθ=cos⁡θ+isin⁡θe^{i\theta}=\cos\theta+i\sin\theta. Consequently ∣eiθ∣=1\lvert e^{i\theta}\rvert=1 and every complex number can be written z=reiθz=re^{i\theta} with r=∣z∣r=\lvert z\rvert and θ=arg⁡z\theta=\arg z.

Proof (8 steps)
  1. Step 1:
    eiθ=∑k=0∞(iθ)kk!e^{i\theta}=\sum_{k=0}^{\infty}\frac{(i\theta)^k}{k!}
    Definition of the exponential by its power series.
  2. Step 2:
    ∑k=0∞∣(iθ)kk!∣=∑k=0∞∣θ∣kk!=e∣θ∣<∞\sum_{k=0}^{\infty}\left\lvert\frac{(i\theta)^k}{k!}\right\rvert=\sum_{k=0}^{\infty}\frac{\lvert\theta\rvert^k}{k!}=e^{\lvert\theta\rvert}<\infty
    Since ∣i∣=1\lvert i\rvert=1 the series converges absolutely, so its terms may be regrouped in any order without changing the sum.
  3. Step 3:
    eiθ=∑m=0∞(iθ)2m(2m)!+∑m=0∞(iθ)2m+1(2m+1)!e^{i\theta}=\sum_{m=0}^{\infty}\frac{(i\theta)^{2m}}{(2m)!}+\sum_{m=0}^{\infty}\frac{(i\theta)^{2m+1}}{(2m+1)!}
    Split the terms into even indices k=2mk=2m and odd indices k=2m+1k=2m+1 (allowed by absolute convergence).
  4. Step 4:
    i2m=(i2)m=(−1)m,i2m+1=i⋅i2m=i (−1)mi^{2m}=(i^2)^m=(-1)^m,\qquad i^{2m+1}=i\cdot i^{2m}=i\,(-1)^m
    Powers of ii cycle with period four: 1,i,−1,−i1,i,-1,-i.
  5. Step 5:
    eiθ=∑m=0∞(−1)mθ2m(2m)!+i∑m=0∞(−1)mθ2m+1(2m+1)!e^{i\theta}=\sum_{m=0}^{\infty}\frac{(-1)^m\theta^{2m}}{(2m)!}+i\sum_{m=0}^{\infty}\frac{(-1)^m\theta^{2m+1}}{(2m+1)!}
    Substitute the powers of ii and pull the common factor ii out of the odd series.
  6. Step 6:
    =cos⁡θ+isin⁡θ=\cos\theta+i\sin\theta
    These are exactly the Taylor series of cos⁡θ=1−θ22!+θ44!−⋯\cos\theta=1-\frac{\theta^2}{2!}+\frac{\theta^4}{4!}-\cdots and sin⁡θ=θ−θ33!+θ55!−⋯\sin\theta=\theta-\frac{\theta^3}{3!}+\frac{\theta^5}{5!}-\cdots, which converge for all real θ\theta.
  7. Step 7:
    ∣eiθ∣2=cos⁡2θ+sin⁡2θ=1\lvert e^{i\theta}\rvert^2=\cos^2\theta+\sin^2\theta=1
    Modulus of a number with real part cos⁡θ\cos\theta and imaginary part sin⁡θ\sin\theta, plus the Pythagorean identity.
  8. Step 8:
    z=r(cos⁡θ+isin⁡θ)=reiθz=r(\cos\theta+i\sin\theta)=re^{i\theta}
    Insert Euler's formula into the trigonometric polar form.

∎

Special values follow immediately: eiπ/2=ie^{i\pi/2}=i, eiπ=−1e^{i\pi}=-1 (so eiπ+1=0e^{i\pi}+1=0), e3iπ/2=−ie^{3i\pi/2}=-i and e2πi=1e^{2\pi i}=1. The conjugate of a phase is the opposite phase, eiθ‾=cos⁡θ−isin⁡θ=e−iθ\overline{e^{i\theta}}=\cos\theta-i\sin\theta=e^{-i\theta}, so for z=reiθz=re^{i\theta} we have zˉ=re−iθ\bar z=re^{-i\theta}. The number eiπ/4=12+i2e^{i\pi/4}=\tfrac{1}{\sqrt2}+\tfrac{i}{\sqrt2} is the nontrivial entry of the TT gate.

Worked conversions. −3+i-\sqrt3+i has r=3+1=2r=\sqrt{3+1}=2 and lies in the second quadrant with cos⁡θ=−32\cos\theta=-\tfrac{\sqrt3}{2}, sin⁡θ=12\sin\theta=\tfrac12, hence θ=5π/6\theta=5\pi/6 and −3+i=2e5πi/6-\sqrt3+i=2e^{5\pi i/6}. Conversely 4e−iπ/3=4(12−32i)=2−23 i4e^{-i\pi/3}=4(\tfrac12-\tfrac{\sqrt3}{2}i)=2-2\sqrt3\,i.

Polar multiplication and De Moivre#

Theorem

Multiplication multiplies moduli and adds arguments

For r1,r2≥0r_1,r_2\ge0 and real θ1,θ2\theta_1,\theta_2:   r1eiθ1 r2eiθ2=r1r2 ei(θ1+θ2)\;r_1e^{i\theta_1}\,r_2e^{i\theta_2}=r_1r_2\,e^{i(\theta_1+\theta_2)}.

Proof (5 steps)
  1. Step 1:
    eiθ1eiθ2=(cos⁡θ1+isin⁡θ1)(cos⁡θ2+isin⁡θ2)e^{i\theta_1}e^{i\theta_2}=(\cos\theta_1+i\sin\theta_1)(\cos\theta_2+i\sin\theta_2)
    Euler's formula for each factor.
  2. Step 2:
    =(cos⁡θ1cos⁡θ2−sin⁡θ1sin⁡θ2)+i(cos⁡θ1sin⁡θ2+sin⁡θ1cos⁡θ2)=(\cos\theta_1\cos\theta_2-\sin\theta_1\sin\theta_2)+i(\cos\theta_1\sin\theta_2+\sin\theta_1\cos\theta_2)
    Multiplication rule with a=cos⁡θ1a=\cos\theta_1, b=sin⁡θ1b=\sin\theta_1, c=cos⁡θ2c=\cos\theta_2, d=sin⁡θ2d=\sin\theta_2.
  3. Step 3:
    =cos⁡(θ1+θ2)+isin⁡(θ1+θ2)=\cos(\theta_1+\theta_2)+i\sin(\theta_1+\theta_2)
    Angle-addition formulas for cosine and sine.
  4. Step 4:
    =ei(θ1+θ2)=e^{i(\theta_1+\theta_2)}
    Euler's formula read backwards.
  5. Step 5:
    r1eiθ1 r2eiθ2=(r1r2) eiθ1eiθ2=r1r2 ei(θ1+θ2)r_1e^{i\theta_1}\,r_2e^{i\theta_2}=(r_1r_2)\,e^{i\theta_1}e^{i\theta_2}=r_1r_2\,e^{i(\theta_1+\theta_2)}
    Real numbers commute with complex numbers, so the moduli can be collected in front.

∎

Corollary

De Moivre's theorem

For every integer n≥0n\ge0 and real θ\theta: (reiθ)n=rneinθ(re^{i\theta})^n=r^ne^{in\theta}, i.e. (cos⁡θ+isin⁡θ)n=cos⁡nθ+isin⁡nθ(\cos\theta+i\sin\theta)^n=\cos n\theta+i\sin n\theta.

Proof (5 steps)
  1. Step 1:
    n=0:(reiθ)0=1=r0ei⋅0n=0:\quad (re^{i\theta})^0=1=r^0e^{i\cdot0}
    Base case: every number to the power zero is 11, and e0=1e^0=1.
  2. Step 2:
    (reiθ)n+1=(reiθ)n (reiθ)(re^{i\theta})^{n+1}=(re^{i\theta})^n\,(re^{i\theta})
    Inductive step: definition of the (n+1)(n+1)-st power.
  3. Step 3:
    =rneinθ reiθ=r^ne^{in\theta}\,re^{i\theta}
    Induction hypothesis for nn.
  4. Step 4:
    =rn+1ei(n+1)θ=r^{n+1}e^{i(n+1)\theta}
    Polar multiplication theorem: moduli multiply, arguments add.
  5. Step 5:
    r=1: (cos⁡θ+isin⁡θ)n=cos⁡nθ+isin⁡nθr=1:\ (\cos\theta+i\sin\theta)^n=\cos n\theta+i\sin n\theta
    Specialise to unit modulus and apply Euler's formula on both sides.

∎

Worked example. Compute (1+i)8(1+i)^8. In polar form 1+i=2 eiπ/41+i=\sqrt2\,e^{i\pi/4}, so by De Moivre

(1+i)8=(2)8e8iπ/4=16 e2πi=16.(1+i)^8=(\sqrt2)^8e^{8i\pi/4}=16\,e^{2\pi i}=16.

Doing this in Cartesian form requires three squarings: (1+i)2=1+2i+i2=2i(1+i)^2=1+2i+i^2=2i, (2i)2=−4(2i)^2=-4, (−4)2=16(-4)^2=16. The polar route scales to any power in one line.

Worked example (phase gates). The gate T=diag(1,eiπ/4)T=\mathrm{diag}(1,e^{i\pi/4}) applied twice multiplies the ∣1⟩\lvert1\rangle amplitude by eiπ/4eiπ/4=eiπ/2=ie^{i\pi/4}e^{i\pi/4}=e^{i\pi/2}=i, which is why T2=ST^2=S; four applications give eiπ=−1e^{i\pi}=-1, so T4=ZT^4=Z. Multiplying (1+i)(1+i) by eiπ/4e^{i\pi/4} adds π/4\pi/4 to its argument π/4\pi/4 and multiplies the modulus by 11, giving 2eiπ/2=2 i\sqrt2e^{i\pi/2}=\sqrt2\,i.

Roots of unity and their sums#

Definition

N-th roots of unity

For an integer N≥1N\ge1 let ωN=e2πi/N\omega_N=e^{2\pi i/N}. The NN numbers ωNk=e2πik/N\omega_N^k=e^{2\pi ik/N}, k=0,1,…,N−1k=0,1,\dots,N-1, are the NN-th roots of unity: by De Moivre (ωNk)N=e2πik=1(\omega_N^k)^N=e^{2\pi ik}=1. They are the vertices of a regular NN-gon inscribed in the unit circle, starting at 11. Because ωNN=1\omega_N^N=1, the powers are periodic: ωNk+N=ωNk\omega_N^{k+N}=\omega_N^k, so exponents can always be reduced modulo NN.

Theorem

Orthogonality of the roots of unity

For every integer jj: ∑k=0N−1ωNjk={N,j≡0(modN)0,otherwise.\displaystyle\sum_{k=0}^{N-1}\omega_N^{jk}=\begin{cases}N,& j\equiv0\pmod N\\0,& \text{otherwise.}\end{cases}

Proof (7 steps)
  1. Step 1:
    j=mN:ωNjk=e2πi mNk/N=e2πi mk=1j=mN:\quad \omega_N^{jk}=e^{2\pi i\,mNk/N}=e^{2\pi i\,mk}=1
    If NN divides jj, every term is 11 because mkmk is an integer and e2πi=1e^{2\pi i}=1.
  2. Step 2:
    ⇒ ∑k=0N−1ωNjk=∑k=0N−11=N\Rightarrow\ \sum_{k=0}^{N-1}\omega_N^{jk}=\sum_{k=0}^{N-1}1=N
    A sum of NN ones.
  3. Step 3:
    q:=ωNj=e2πij/N≠1when N∤jq:=\omega_N^{j}=e^{2\pi ij/N}\ne1\quad\text{when } N\nmid j
    eiφ=1e^{i\varphi}=1 only for φ∈2πZ\varphi\in2\pi\mathbb{Z}, and j/Nj/N is not an integer.
  4. Step 4:
    S:=∑k=0N−1qk,qS=∑k=1NqkS:=\sum_{k=0}^{N-1}q^k,\qquad qS=\sum_{k=1}^{N}q^k
    Name the sum (note ωNjk=qk\omega_N^{jk}=q^k) and multiply it by qq, shifting every exponent by one.
  5. Step 5:
    S−qS=q0−qN=1−qNS-qS=q^0-q^N=1-q^N
    All terms q1,…,qN−1q^1,\dots,q^{N-1} appear in both sums and cancel (telescoping).
  6. Step 6:
    qN=e2πij=1 ⇒ (1−q)S=0q^N=e^{2\pi ij}=1\ \Rightarrow\ (1-q)S=0
    jj is an integer, so qN=1q^N=1.
  7. Step 7:
    ⇒ S=0\Rightarrow\ S=0
    Divide by 1−q≠01-q\ne0.

∎

Worked example. For N=4N=4 we have ω4=eiπ/2=i\omega_4=e^{i\pi/2}=i and the roots are 1,i,−1,−i1,i,-1,-i. With j=1j=1: 1+i+(−1)+(−i)=01+i+(-1)+(-i)=0. With j=2j=2: 1+i2+i4+i6=1−1+1−1=01+i^2+i^4+i^6=1-1+1-1=0. With j=4j=4: every term is i4k=1i^{4k}=1 and the sum is 44. Geometrically, for j≢0j\not\equiv0 the points ωNjk\omega_N^{jk} are spread symmetrically around the circle and their centre of mass is the origin.

This identity is the engine of the quantum Fourier transform: the QFT matrix has entries 1NωNjk\tfrac{1}{\sqrt N}\omega_N^{jk}, and the theorem above is exactly the statement that its columns are orthonormal, i.e. that the QFT is unitary. When amplitudes are summed with phases that go all the way around the circle they cancel, and only the frequencies that match survive.

TypeScriptrunnable
import { cadd, cexpi, cmul, cabs, cformat, c } from '@/lib/quantum-simulator/complex';

// (3 + 4i)(1 - 2i) = 11 - 2i and |zw| = |z||w| = 5 * sqrt(5)
const z = c(3, 4);
const w = c(1, -2);
const zw = cmul(z, w);
console.log('zw =', cformat(zw), ' |zw| =', cabs(zw).toFixed(6), ' |z||w| =', (cabs(z) * cabs(w)).toFixed(6));

// (1 + i) * e^{i pi/4} = sqrt(2) i : moduli multiply, arguments add
console.log('(1+i)e^{i pi/4} =', cformat(cmul(c(1, 1), cexpi(Math.PI / 4))));

// sum over k of omega_N^{jk} equals N if N divides j, else 0
const N = 8;
for (const j of [0, 1, 3, 8]) {
  let s = c(0, 0);
  for (let k = 0; k < N; k++) s = cadd(s, cexpi((2 * Math.PI * j * k) / N));
  console.log('j =', j, ' sum =', cformat(s, 6));
}

Expected output

zw = 11-2i  |zw| = 11.180340  |z||w| = 11.180340
(1+i)e^{i pi/4} = 1.4142i
j = 0  sum = 8
j = 1  sum = 0
j = 3  sum = 0
j = 8  sum = 8

Check your understanding#

Quick check

Compute ∣(2+i)(1−3i)∣\lvert(2+i)(1-3i)\rvert (give a decimal).

tolerance ±0.001

Quick check

Which number is 11+i\dfrac{1}{1+i}?

Select one answer

Quick check

What is the imaginary part of eiπ/3 eiπ/6e^{i\pi/3}\,e^{i\pi/6}?

tolerance ±0.001

Quick check

Evaluate ∑k=07ω83k\sum_{k=0}^{7}\omega_8^{3k} with ω8=e2πi/8\omega_8=e^{2\pi i/8} (enter the real number it equals).

tolerance ±0.001

Quick check

Using De Moivre, what is (12+32i)6\left(\tfrac{1}{2}+\tfrac{\sqrt3}{2}i\right)^6?

Select one answer

References

  1. M. A. Nielsen, I. L. Chuang, Quantum Computation and Quantum Information, 10th anniversary ed., Cambridge University Press (2010), §2.1 (notation) and §5.1 (roots of unity in the quantum Fourier transform).
  2. T. Needham, Visual Complex Analysis, Oxford University Press (1997), Ch. 1 (geometry of complex multiplication) and Ch. 2 (the complex exponential).
  3. E. M. Stein, R. Shakarchi, Complex Analysis, Princeton University Press (2003), Ch. 1 §1–2 (power series and the exponential).
  4. S. Axler, Linear Algebra Done Right, 4th ed., Springer (2024), §1A (complex numbers).linear.axler.net

Hands-on labs

  • Multiply by a phase

    1 step · auto-graded

    Compute w=(1+i) eiπ/4w=(1+i)\,e^{i\pi/4} in Cartesian form, using Euler's formula and polar multiplication.

    Open lab