Given a gate U and a state |ψ⟩ with U|ψ⟩ = e^{2πiφ}|ψ⟩, *phase estimation* reads φ in binary. It is the core of factoring, of quantum chemistry's energy estimates, and of many other algorithms. The circuit has a counting register of n qubits in superposition. Counting qubit k controls U raised to the power 2ᵏ on |ψ⟩. By phase kickback each power leaves its phase on its control, and the register ends in Σₓ e^{2πiφx} |x⟩ / √2ⁿ, which is the quantum Fourier transform of |2ⁿφ⟩. The inverse transform turns it back into the basis state |2ⁿφ⟩, and measuring reads φ to n bits. When 2ⁿφ is a whole number the outcome is certain; otherwise it is most likely the nearest one. A controlled T is `cp(π/4)`, and its powers are `cp(π/2)` and `cp(π)`. Here φ = 1/8 and n = 3, so the outcome is 1, written 001.