Hello,
I was doing the bomb tester exercise with the following code, but I have no idea why I ran into this Error: Your quantum circuit isn’t quite right. I tried postselection as well as resetting the measurement, but it did not work. I would appreciate it if anyone who has had the same issue could help me with this.
n_shots = 10000
dev = qml.device(“default.qubit”, shots=n_shots)
np.random.seed(0)
@qml.qnode(dev)
def circuit():
qml.Hadamard(0)
m_bomb = qml.measure(0)
qml.cond(m_bomb == 0, qml.Hadamard)(0)
m_det = qml.measure(0)
return qml.counts(op=[m_bomb,m_det])
results = circuit()
prob_suc = results\[“00”\] / n_shots
print(“The success probability is”, prob_suc) = 0.2495