fn local_layer(first, second, third) {
parallel {
h first
x second
y third
}
}
circuit structured_programming {
qubit q[4]: "|0>" -> "out"
h q[0]
h q[0]
local_layer(q[0], q[1], q[2])
gate "U" on q[0..3] with fill: yellow
repeat 2 {
x q[3] if q[2]
}
reverse {
s q[0]
t q[1]
x q[2] if q[1]
}
measure q[0..4]
}