Skip to content

Commit cc7211a

Browse files
committed
Add test: link_monitoring
1 parent db308d0 commit cc7211a

File tree

3 files changed

+67
-3
lines changed

3 files changed

+67
-3
lines changed

applications/cybersecurity/link_monitoring/link_monitoring.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,7 @@
653653
"source": [
654654
"from classiq import execute\n",
655655
"\n",
656-
"res = execute(qprog).result()"
656+
"result = execute(qprog).result_value()"
657657
]
658658
},
659659
{
@@ -698,7 +698,7 @@
698698
"source": [
699699
"from classiq.execution import VQESolverResult\n",
700700
"\n",
701-
"vqe_result = VQESolverResult.parse_obj(res[0].value)\n",
701+
"vqe_result = VQESolverResult.parse_obj(result)\n",
702702
"vqe_result.convergence_graph"
703703
]
704704
},
Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,44 @@
1-
{}
1+
{
2+
"constraints": {
3+
"max_gate_count": {},
4+
"optimization_parameter": "no_opt"
5+
},
6+
"preferences": {
7+
"machine_precision": 8,
8+
"custom_hardware_settings": {
9+
"basis_gates": [
10+
"cx",
11+
"t",
12+
"u2",
13+
"x",
14+
"tdg",
15+
"s",
16+
"id",
17+
"ry",
18+
"sx",
19+
"cy",
20+
"y",
21+
"r",
22+
"sdg",
23+
"u",
24+
"sxdg",
25+
"z",
26+
"cz",
27+
"rx",
28+
"h",
29+
"p",
30+
"u1",
31+
"rz"
32+
],
33+
"is_symmetric_connectivity": true
34+
},
35+
"debug_mode": true,
36+
"synthesize_all_separately": false,
37+
"optimization_level": 3,
38+
"output_format": ["qasm"],
39+
"pretty_qasm": true,
40+
"transpilation_option": "auto optimize",
41+
"timeout_seconds": 300,
42+
"random_seed": 3117123804
43+
}
44+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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("link_monitoring", timeout_seconds=76)
10+
def test_notebook(tb: TestbookNotebookClient) -> None:
11+
# test models
12+
validate_quantum_model(tb.ref("qmod"))
13+
# test quantum programs
14+
validate_quantum_program_size(
15+
tb.ref("qprog"),
16+
expected_width=15, # actual width: 12
17+
expected_depth=30, # actual depth: 23
18+
)
19+
20+
# test notebook content
21+
pass # Todo

0 commit comments

Comments
 (0)