HomeQuantum PhysicsQuantum Circuit Transpiler: Gate Decomposition & Depth Optimization

Quantum Circuit Transpiler: Gate Decomposition & Depth Optimization

Interactive quantum-circuit transpiler: watch Toffoli, SWAP and CZ gates decompose into the native H/T/T†/CNOT gate set, then a real peephole optimization pass cancel redundant adjacent gate pairs, with live gate-count, depth and T-count readouts.

Quantum Physics3DAdvanced60 FPS📱 Mobile-adapted⇄ 2D version
qe-topic-59 ↗ Open standalone

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.

⚙ Under the hood

An interactive quantum-circuit transpiler that decomposes Toffoli, SWAP and CZ gates into the native H/T/T†/CNOT gate set and runs a real peephole optimization pass cancelling redundant adjacent gate pairs, with live gate-count, depth and T-count readouts.

quantum computingquantum circuitcompilergate decompositionToffoli gatecircuit optimization

3D · Three.js / WebGL renderer · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)