Since T gates dominate the cost of a fault-tolerant program, compilers spend much of their effort removing them. Some come out by algebra alone: T·T = S, T⁴ = Z, and T·T† = I. A T gate can also travel through gates it commutes with to meet its partner. The engine's rewrites do this one step at a time, each step checked on the qubits it touches, so a chain of them proves the result the same circuit: ```sh runnable cat > ts.qasm <<'QASM' OPENQASM 3.0; include "stdgates.inc"; qubit[1] q; t q[0]; tdg q[0]; h q[0]; QASM wai-quantum rewrite simplify ts.qasm ``` The compiler goes further (`wai-quantum compile`): it folds phases across controlled-NOTs, resynthesises small blocks, and writes every rotation that is not a multiple of π/4 as a Clifford+T word within an error budget, with a certificate of every pass. Its T count is what the next lesson's estimate starts from.