Skip to content

Commit f6888de

Browse files
committed
eqsn is running
1 parent ee71787 commit f6888de

3 files changed

Lines changed: 17 additions & 11 deletions

File tree

tests/test_measuring_from_threads.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def test_measure_from_threads():
1111
def measure_or_hadamard(id):
1212
n = random.randrange(10, 100, 1)
1313
for _ in range(n):
14-
time.sleep(0.1)
14+
time.sleep(0.01)
1515
q_sim.H_gate(id)
1616
print("Finished Hadamard, measure qubit %s!" % id)
1717
print(q_sim.measure(id))
@@ -27,7 +27,8 @@ def measure_or_hadamard(id):
2727
q_sim.cnot_gate(id1, c)
2828
thread_list = []
2929
for id in ids:
30-
t = threading.Thread(target=measure_or_hadamard, args=(id))
30+
print(id)
31+
t = threading.Thread(target=measure_or_hadamard, args=(id,))
3132
t.start()
3233
thread_list.append(t)
3334
for t in thread_list:

tests/test_multi_gate.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from eqsn import EQSN
2+
import time
23

34

45
def test_epr_creation():
@@ -36,4 +37,5 @@ def test_5_qubits_gate():
3637

3738
if __name__ == "__main__":
3839
test_epr_creation()
40+
time.sleep(0.1)
3941
test_5_qubits_gate()

tests/test_single_gate.py

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import sys
22
from eqsn import EQSN
3-
3+
import time
44

55
def test_x_gate():
66
q_sim = EQSN()
@@ -108,11 +108,14 @@ def test_measure():
108108

109109

110110
if __name__ == "__main__":
111-
test_x_gate()
112-
test_y_gate()
113-
test_z_gate()
114-
test_H_gate()
115-
test_T_gate()
116-
test_S_gate()
117-
test_K_gate()
118-
test_measure()
111+
test_list = [test_x_gate,
112+
test_y_gate,
113+
test_z_gate,
114+
test_H_gate,
115+
test_T_gate,
116+
test_S_gate,
117+
test_K_gate,
118+
test_measure]
119+
for func in test_list:
120+
func()
121+
time.sleep(0.01)

0 commit comments

Comments
 (0)