// Loops as an exporter writes them: an untyped loop variable over a range // (both ends included), and a typed one whose value is an angle's factor. // rx(π/12) four times is rx(π/3): q[0] reads 1 with probability 1/4; ry by // π/12, 2π/12 and 3π/12 is ry(π/2): q[1] reads 1 with probability 1/2. OPENQASM 3.0; include "stdgates.inc"; bit[2] c; qubit[2] q; for _loop_i_0 in [0:3] { rx(pi/12) q[0]; } for uint i in [1:3] { ry(i * pi / 12) q[1]; } c[0] = measure q[0]; c[1] = measure q[1];