Skip to content

Commit e2caf47

Browse files
allow random circuit structure
1 parent eaff834 commit e2caf47

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

examples/sample_benchmark.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ def construct_circuit(n, nlayers):
1717
c.H(i)
1818
for _ in range(nlayers):
1919
for i in range(n):
20-
c.cnot(i, (i + nlayers - 1) % n)
20+
r = np.random.randint(n - 1) + 1
21+
c.cnot(i, (i + r) % n)
2122
return c
2223

2324

0 commit comments

Comments
 (0)