1 Modular Arithmetic Basics
Modular arithmetic is "clock arithmetic." When numbers reach a modulus \(N\), they wrap back to zero — just like hours on a clock wrap after 12. Formally, we write \(a \equiv b \pmod{N}\) when \(N\) divides \(a - b\).
Interactive Clock Face
Pick a modulus and explore addition mod \(N\). Click any number on the clock to add it to the current value. Watch the arc trace the addition path.
Congruence Classes
Every integer belongs to exactly one residue class mod \(N\). Hover over a number to highlight its entire equivalence class — all the numbers that are "the same" mod \(N\).
Check your understanding
What is \(15 + 19 \pmod{7}\)?
2 Modular Multiplication & Groups
The multiplication table mod \(N\) reveals deep structure. It shows which elements generate the entire group and exposes the cyclic patterns that connect to the QFT.
Cayley Table mod \(N\)
Toggle between addition and multiplication. Click a row header to see the cyclic subgroup generated by that element. Hover any cell to see the computation.
Check your understanding
In the addition table mod 6, what is \(4 + 5\)?
3 Roots of Unity on the Unit Circle
The \(N\)-th roots of unity are the complex numbers \(\omega^k = e^{2\pi i k/N}\) for \(k = 0, 1, \ldots, N-1\). They are evenly spaced on the unit circle and form a group under multiplication.
Interactive Unit Circle
Click a root to inspect it. Then select two roots and press Multiply to see how complex multiplication corresponds to adding exponents mod \(N\). The arc shows the rotation.
Check your understanding
For \(N = 6\), what is \(\omega^4 \cdot \omega^5\)? Where does it land on the unit circle?
4 The QFT Matrix Connection
The Quantum Fourier Transform on \(N\) states is defined by the unitary matrix:
where \(\omega = e^{2\pi i / N}\). Entry \((j, k)\) is \(\frac{1}{\sqrt{N}}\,\omega^{jk}\), and the exponent \(jk\) is computed mod \(N\) — connecting us directly back to Section 1.
Interactive QFT Phase Map
Each cell shows the phase \(\omega^{jk \bmod N}\) as a colored disc with the exponent label. Hover a cell for the full computation. Click a column header \(|k\rangle\) to see the QFT output vector visualized on the unit circle.
Worked Example: Step Through the QFT
Choose an input state and watch the QFT decompose it row by row. Each step shows how modular arithmetic determines the phase.
Check your understanding
In the \(N=4\) QFT matrix, what is the phase of entry \((3, 2)\)? Express it as a power of \(\omega\) and as a complex number.