Quellcode durchsuchen

Removing TQDMs

master
Pete Shadbolt vor 7 Jahren
Ursprung
Commit
2ba69d143e
3 geänderte Dateien mit 6 neuen und 6 gelöschten Zeilen
  1. +4
    -4
      tests/test_against_anders_and_briegel.py
  2. +1
    -1
      tests/test_qi.py
  3. +1
    -1
      tests/test_stabilizer.py

+ 4
- 4
tests/test_against_anders_and_briegel.py Datei anzeigen

@@ -17,7 +17,7 @@ def test_hadamard():

def test_local_rotations():
""" Test local rotations """
for i in tqdm(list(range(REPEATS)), "Testing local rotations"):
for i in list(range(REPEATS)):
circuit = [(0, random.choice(list(range(24)))) for j in range(DEPTH)]
mock.test_circuit(circuit, 1)

@@ -59,7 +59,7 @@ def test_all(n=10):
def test_single_qubit_measurement():
""" Determinstic test of all single-qubit situations """
space = it.product(list(range(24)), PAULIS, (0, 1))
for rotation, measurement, outcome in tqdm(space, "Testing single qubit measurements"):
for rotation, measurement, outcome in space:
a = mock.circuit_to_state(mock.ABPWrapper, 1, [(0, rotation)])
b = mock.circuit_to_state(mock.AndersWrapper, 1, [(0, rotation)])
result_a = a.measure(0, measurement, outcome)
@@ -80,7 +80,7 @@ def test_two_qubit_measurement():
def test_graph_state_measurement(n = 10):
""" Measuring random graph states """
space = list(it.product(list(range(REPEATS)), PAULIS, (0, 1)))
for i, measurement, outcome in tqdm(space, "Measuring random graph states"):
for i, measurement, outcome in space:
circuit = mock.random_graph_circuit(n, DEPTH)
a = mock.circuit_to_state(mock.ABPWrapper, n, circuit)
b = mock.circuit_to_state(mock.AndersWrapper, n, circuit)
@@ -91,7 +91,7 @@ def test_graph_state_measurement(n = 10):
def test_stabilizer_state_measurement(n = 10):
""" Measuring random stabilizer states """
space = list(it.product(list(range(REPEATS)), PAULIS, (0, 1)))
for i, measurement, outcome in tqdm(space, "Measuring random stabilizer states"):
for i, measurement, outcome in space:
circuit = mock.random_stabilizer_circuit(n, DEPTH)
a = mock.circuit_to_state(mock.ABPWrapper, n, circuit)
b = mock.circuit_to_state(mock.AndersWrapper, n, circuit)


+ 1
- 1
tests/test_qi.py Datei anzeigen

@@ -150,7 +150,7 @@ def test_against_chp(n=5):
# Run a random circuit
chp.init(n)
psi = qi.CircuitModel(n)
for i in tqdm(list(range(DEPTH)), "Testing CircuitModel against CHP"):
for i in list(range(DEPTH)):
if np.random.rand() > .5:
a = np.random.randint(0, n - 1)
chp.act_hadamard(a)


+ 1
- 1
tests/test_stabilizer.py Datei anzeigen

@@ -7,7 +7,7 @@ REPEATS = 1000
def test_stabilizers_against_anders_and_briegel(n=10):
""" Test that stabilizers are line-for-line equivalent """
for i in tqdm(list(range(REPEATS)), "Stabilizer representation VS A&B"):
for i in list(range(REPEATS)):
c = mock.random_stabilizer_circuit(n)
g = mock.AndersWrapper(list(range(n)))
g.act_circuit(c)


Laden…
Abbrechen
Speichern