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.
Fill in
One row per line, entries separated by commas. Complex entries like 0.5 - 0.5i or exp(i*pi/4)/sqrt(2). The first row and column belong to the first qubit, q[0].
Result
Loading the compiler…