// Repeat until success, bounded as the reader requires: the first try and at // most three more each succeed with probability 1/2, so the run ends with // c[0] = 1 with probability 1 − 1/16, and is cut with c[0] = 0 with 1/16. OPENQASM 3.1; include "stdgates.inc"; qubit[1] q; bit[1] c; h q[0]; c[0] = measure q[0]; @wai.max_iterations 3 while (c[0] == 0) { reset q[0]; h q[0]; c[0] = measure q[0]; }