I would like to make a code that is executed iteratively.
For example: in a one-qubit
system, I would like to make a measurement 100 times in each angle theta = [ 0, ..., 2π]
with the circuit as follows.
Can we make an iterative code as follows? (This is completely wrong !)
theta = 0
for theta in np.arange(0, np.pi, np.pi/100):
qreg q[1]
creg c[1]
ry(theta) q[0]
measure q[0] -> c[0]
In addition, can we make a function whose argument is theta as follows? (This is completely wrong !)
function q_citcuit(theta)
qreg q[1]
creg c[1]
ry(theta) q[0]
measure q[0] -> c[0]
return result