Browse Source

Removing TQDMs

master
Pete Shadbolt 7 years ago
parent
commit
2ba69d143e
3 changed files with 6 additions and 6 deletions
  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 View File

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


def test_local_rotations(): def test_local_rotations():
""" 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)] circuit = [(0, random.choice(list(range(24)))) for j in range(DEPTH)]
mock.test_circuit(circuit, 1) mock.test_circuit(circuit, 1)


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


+ 1
- 1
tests/test_qi.py View File

@@ -150,7 +150,7 @@ def test_against_chp(n=5):
# Run a random circuit # Run a random circuit
chp.init(n) chp.init(n)
psi = qi.CircuitModel(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: if np.random.rand() > .5:
a = np.random.randint(0, n - 1) a = np.random.randint(0, n - 1)
chp.act_hadamard(a) chp.act_hadamard(a)


+ 1
- 1
tests/test_stabilizer.py View File

@@ -7,7 +7,7 @@ REPEATS = 1000
def test_stabilizers_against_anders_and_briegel(n=10): def test_stabilizers_against_anders_and_briegel(n=10):
""" Test that stabilizers are line-for-line equivalent """ """ 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) c = mock.random_stabilizer_circuit(n)
g = mock.AndersWrapper(list(range(n))) g = mock.AndersWrapper(list(range(n)))
g.act_circuit(c) g.act_circuit(c)


Loading…
Cancel
Save