Skip to content

Commit fb3a264

Browse files
committed
Create tests (WIP)
1 parent bf7c610 commit fb3a264

8 files changed

+82
-21
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
from tests.utils_for_testbook import (
2+
validate_quantum_program_size,
3+
validate_quantum_model,
4+
wrap_testbook,
5+
)
6+
from testbook.client import TestbookNotebookClient
7+
8+
9+
@wrap_testbook("hhl_lanchester", timeout_seconds=450)
10+
def test_notebook(tb: TestbookNotebookClient) -> None:
11+
pass # TODO

tests/notebooks/test_logical_qubits_by_alice_and_bob.py

Whitespace-only changes.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
from tests.utils_for_testbook import (
2+
validate_quantum_program_size,
3+
validate_quantum_model,
4+
wrap_testbook,
5+
)
6+
from testbook.client import TestbookNotebookClient
7+
8+
9+
@wrap_testbook("qaoa_maxcut", timeout_seconds=300)
10+
def test_notebook(tb: TestbookNotebookClient) -> None:
11+
pass # TODO
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
from tests.utils_for_testbook import (
2+
validate_quantum_program_size,
3+
validate_quantum_model,
4+
wrap_testbook,
5+
)
6+
from testbook.client import TestbookNotebookClient
7+
8+
9+
@wrap_testbook("rainbow_options_direct_method", timeout_seconds=1000)
10+
def test_notebook(tb: TestbookNotebookClient) -> None:
11+
pass # TODO
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
from tests.utils_for_testbook import (
2+
validate_quantum_program_size,
3+
validate_quantum_model,
4+
wrap_testbook,
5+
)
6+
from testbook.client import TestbookNotebookClient
7+
8+
9+
@wrap_testbook("rectangles_packing_grid", timeout_seconds=1800)
10+
def test_notebook(tb: TestbookNotebookClient) -> None:
11+
pass # TODO

tests/notebooks/test_shor.py

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,3 @@ def test_notebook(tb: TestbookNotebookClient) -> None:
1919

2020
# test notebook content
2121
pass # TODO
22-
23-
24-
@wrap_testbook("shor_modular_exponentiation", timeout_seconds=300)
25-
def test_notebook(tb: TestbookNotebookClient) -> None:
26-
# test models
27-
validate_quantum_model(tb.ref("qmod_1"))
28-
validate_quantum_model(tb.ref("qmod_2"))
29-
# test quantum programs
30-
validate_quantum_program_size(
31-
tb.ref("qprog_1"),
32-
expected_width=8, # actual width: 8
33-
expected_depth=300, # actual depth: 296
34-
)
35-
validate_quantum_program_size(
36-
tb.ref("qprog_2"),
37-
expected_width=22, # actual width: 22
38-
expected_depth=30000, # actual depth: 26607
39-
)
40-
41-
# test notebook content
42-
pass # TODO
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
from tests.utils_for_testbook import (
2+
validate_quantum_program_size,
3+
validate_quantum_model,
4+
wrap_testbook,
5+
)
6+
from testbook.client import TestbookNotebookClient
7+
8+
9+
@wrap_testbook("shor_modular_exponentiation", timeout_seconds=300)
10+
def test_notebook(tb: TestbookNotebookClient) -> None:
11+
# test models
12+
validate_quantum_model(tb.ref("qmod_1"))
13+
validate_quantum_model(tb.ref("qmod_2"))
14+
# test quantum programs
15+
validate_quantum_program_size(
16+
tb.ref("qprog_1"),
17+
expected_width=8, # actual width: 8
18+
expected_depth=300, # actual depth: 296
19+
)
20+
validate_quantum_program_size(
21+
tb.ref("qprog_2"),
22+
expected_width=22, # actual width: 22
23+
expected_depth=30000, # actual depth: 26607
24+
)
25+
26+
# test notebook content
27+
pass # TODO
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
from tests.utils_for_testbook import (
2+
validate_quantum_program_size,
3+
validate_quantum_model,
4+
wrap_testbook,
5+
)
6+
from testbook.client import TestbookNotebookClient
7+
8+
9+
@wrap_testbook("time_marching", timeout_seconds=500)
10+
def test_notebook(tb: TestbookNotebookClient) -> None:
11+
pass # TODO

0 commit comments

Comments
 (0)