Mathematical foundations

Complex numbers and phase

Read rotations, magnitudes, and cancellation on the complex plane.

16 minFoundations

Intuition

A complex number has two coordinates. Multiplication by a unit complex number rotates it in the plane. This is the arithmetic behind phase shifts in quantum circuits.

Two arrows can reinforce or cancel when added. Two probability weights always add nonnegatively, while two complex amplitudes can add to zero. This distinction is central to interference.

Learning objectives

  • Convert between rectangular and polar form
  • Compute squared magnitudes
  • Predict cancellation from relative phase

Interactive exploration

Use the controls to change the state and see its calculated readout. You can return to this experiment as you work through the derivation.

Amplitude at |0⟩

Complex plane
ReIm

First 0.500Second 0.250 + 0.433iSum 0.750 + 0.433i

Prepare & recombine

90°
60°

Hadamard adds the input amplitudes for |0⟩ and subtracts them for |1⟩.

BasisAmplitudeProbability
|0⟩0.750 + 0.433i75%
|1⟩0.250 − 0.433i25%

Mathematical foundation

The imaginary unit i squares to −1. Complex conjugation changes the sign of the imaginary part, so multiplying by the conjugate gives the squared length.

z=a+ib,z∗=a−ib,∣z∣2=z∗z=a2+b2z=a+ib,\quad z^*=a-ib,\quad |z|^2=z^*z=a^2+b^2

Euler’s formula relates an angle to the unit circle. Multiplying by this unit complex number adds the angle to the phase and preserves length.

eiϕ=cos⁡ϕ+isin⁡ϕ,z=reiϕe^{i\phi}=\cos\phi+i\sin\phi,\qquad z=r e^{i\phi}

Worked example

Take two real contributions of equal magnitude 1/2. Rotate the second through π radians so it points the other way. Their sum vanishes. At π/2 the contributions are perpendicular and the squared length is 1/2.

∣12+i2∣2=14+14=12\left|\tfrac12+\tfrac{i}{2}\right|^2=\tfrac14+\tfrac14=\tfrac12

Guided experiment

Set the preparation angle to 90°. Sweep the phase from 0° through 90° to 180°. Follow the complex arrows and the output probability.

Go to the controls
Compare with the expected result

At 180° equal contributions cancel at output zero. At 90° each output probability is one half.

Understanding check

1. What is |3 + 4i|²?
2. What does multiplying a complex number by i do?

Next steps

Want to keep your results? Start your learning journey

Open Interference Studio