Gate decomposition playground

Pick a device's native gates and decompose any gate into them, with the fewest gates. It runs in your browser: the QCC core, compiled from Rust to WebAssembly.

Native gates

Select any combination: the compiler uses whichever of them gives the fewest gates.

Single-qubit
Two-qubit

Decompose

Try

Any gate of OpenQASM's stdgates.inc or qelib1.inc, or sqrt_swap and sqrt_iswap. Parameters can use pi, + − × ÷ and sqrt, sin, cos.

Result

Loading the compiler…