// Gates outside stdgates.inc, defined in the program as an exporter defines // them, its parameter and qubit names generated. rzx(π/3) on |+⟩|0⟩ leaves // cos(π/6)|+⟩|0⟩ − i sin(π/6)|−⟩|1⟩: q[1] is 1 with probability 1/4, and // q[0] is 0 or 1 alike. sxdg written as s·h·s is rx(−π/2): q[2] is 1 with // probability 1/2. The exporter's `sxdg` is not the built-in one exactly (a // global phase apart), so the reader notes that its own definition runs. OPENQASM 3.0; include "stdgates.inc"; gate rzx(_gate_p_0) _gate_q_0, _gate_q_1 { h _gate_q_1; cx _gate_q_0, _gate_q_1; rz(_gate_p_0) _gate_q_1; cx _gate_q_0, _gate_q_1; h _gate_q_1; } gate sxdg _gate_q_0 { s _gate_q_0; h _gate_q_0; s _gate_q_0; } bit[3] c; qubit[3] q; h q[0]; rzx(pi/3) q[0], q[1]; sxdg q[2]; c[0] = measure q[0]; c[1] = measure q[1]; c[2] = measure q[2];