⚠ Couldn't load the 3D engineThree.js failed to load from the CDN. Check your connection and reload.

Quantum Circuit Transpiler: Gate Decomposition & Depth Optimization

Behind every quantum programming framework sits a transpiler: a compiler pass that rewrites a circuit's convenient high-level gates (Toffoli, SWAP, CZ) into the small native gate set real hardware executes, then optimizes the result. This simulator renders a 4-qubit circuit in 3D — wires running left to right, gates as colored blocks and connectors — and lets you flip on real decomposition rules (Toffoli → 15 H/T/T†/CNOT gates, SWAP → 3 CNOTs, CZ → H-CNOT-H) and a genuine peephole optimization pass that cancels adjacent gate pairs multiplying to the identity, re-scanning to a fixed point exactly like a real compiler. Live readouts track gate count, ASAP-scheduled circuit depth, and T-count — the metric that determines fault-tolerant cost — as you toggle each stage and switch between three preset circuits.