Skip to content

Commit a55d05f

Browse files
Merge pull request #1439 from qiboteam/fix-shor-example
Fix Shor example
2 parents e93ec84 + c645237 commit a55d05f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

examples/shor/functions.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -393,8 +393,9 @@ def quantum_order_finding_semiclassical(N, a):
393393
circuit.add(gates.U1(q_reg, -angle))
394394
circuit.add(gates.H(q_reg))
395395
results.append(circuit.add(gates.M(q_reg, collapse=True)))
396+
circuit.add(gates.M(q_reg))
396397

397-
circuit() # execute
398+
circuit(nshots=1) # execute
398399
s = sum(int(r.symbols[0].outcome()) * (2**i) for i, r in enumerate(results))
399400
print(f"The quantum circuit measures s = {s}.\n")
400401
return s

0 commit comments

Comments
 (0)