- Copenhagen, quantum information
An exchange semester at DTU included 10384 Quantum Information: weekly exercise sheets worked in Python, first with raw NumPy matrices, then with QuTiP 5 and qutip-qip. Everything on this page is those algorithms, re-implemented in TypeScript so you can watch them run.
- First contact with QuTiP
The course's intro notebook builds the mental model: states and gates are Qobj matrices, multi-qubit systems are tensor products, and a three-gate QubitCircuit (Hadamard, CNOT, controlled-RZ) prepares a Bell state. The circuit builder's Bell preset is that exact circuit, and the Werner-state fidelity curve it plots is reproduced live in the panel.
- One qubit is a sphere
Exercise sheet 8: verify the Pauli identities σxσy = iσz (cyclic), write qubit(θ, φ), and build two-qubit gates with kron. The Bloch panel is that sheet made tangible: θ and φ place the arrow, every gate is a rotation about some axis, and the identities can be checked by watching three quarter-turns compose.
- Oracles and one-query tricks
Week 9 builds U_f |x⟩|y⟩ = |x⟩|y ⊕ f(x)⟩ as a permutation matrix and runs Deutsch–Jozsa (constant functions send the input register back to |0…0⟩ with probability exactly 1, balanced ones with probability exactly 0) and Bernstein–Vazirani, which reads a hidden dot-product string in a single query.
- Simon's algorithm: the exponential separation
Week 10's oracle hides a string s inside a two-to-one function f(x) = min(x, x⊕s). One query plus a Hadamard leaves only outcomes y with y·s = 0 (mod 2): each measurement is one linear equation over GF(2), and about n of them pin s down. Classically you'd need exponentially many queries: this is the course's first exponential quantum win.
- Amplitude amplification
The course closed with Grover's algorithm: theory plus a small-scale implementation verifying the ⌊π/4·√(N/M)⌋ iteration formula. The iterator panel shows the two moves: the oracle flips the marked amplitude, the diffusion operator reflects everything about the mean. Keep going past the optimum and the amplitude rotates right back out.
- Rebuilt for this page (2026-08-31)
The simulator is hand-written TypeScript (complex kron, gate application, permutation oracles, GF(2) elimination), tested against NumPy fixtures generated from the course solutions. The weekly-sheet Python was written with AI coding tools during the course; sheet 8's exercise 4 (the 4×4 pen-and-paper gates) was never run in the raw notebook and Week 9's broken pip cell never fixed; both completed here. A QAOA paper sits in the same folder: that's the next thing to build.