// qelib1.inc's gates past the table of standard gates, called without being // defined, as OpenQASM 2 exporters write them. With q[0], q[1] and q[2] set: // c3x sets q[3]; c4x then sets q[4]; csx twice is cx, which clears q[3]; // c3sqrtx twice is c3x, which clears q[4]; rccx flips q[4] as ccx does (with // a phase); u0 is an idle. Every shot reads q[4..0] = 1, 0, 1, 1, 1. OPENQASM 2.0; include "qelib1.inc"; qreg q[5]; creg c[5]; x q[0]; x q[1]; x q[2]; c3x q[0],q[1],q[2],q[3]; c4x q[0],q[1],q[2],q[3],q[4]; csx q[0],q[3]; csx q[0],q[3]; c3sqrtx q[0],q[1],q[2],q[4]; c3sqrtx q[0],q[1],q[2],q[4]; rccx q[0],q[1],q[4]; u0(1) q[2]; measure q -> c;