Skip to content

Commit f659e3d

Browse files
committed
add qw_fmo notebook
1 parent 72594f1 commit f659e3d

File tree

3 files changed

+483
-0
lines changed

3 files changed

+483
-0
lines changed

applications/chemistry/quantum_walk_fmo/quantum_walk_fmo.ipynb

Lines changed: 443 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"title": "Photosynthetic Energy Transfer",
3+
"subtitle": "Continuous-Time Quantum Walk in Photosynthetic Energy Transfer",
4+
"description": "Continuous-Time Quantum Walk in Photosynthetic Energy Transfer",
5+
"friendly_name": "Photosynthetic Energy Transfer",
6+
"problem_domain_tags": [
7+
"chemistry"
8+
],
9+
"qmod_type": [
10+
"algorithms"
11+
],
12+
"level": [
13+
"demos"
14+
]
15+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import numpy as np
2+
from testbook.client import TestbookNotebookClient
3+
4+
from tests.utils_for_testbook import validate_quantum_program_size, wrap_testbook
5+
6+
7+
@wrap_testbook("quantum_walk_fmo", timeout_seconds=150)
8+
def test_notebook(tb: TestbookNotebookClient) -> None:
9+
# test quantum programs
10+
for qprog in tb.ref_pydantic("qprogs"):
11+
validate_quantum_program_size(
12+
qprog,
13+
expected_width=3, # actual width: 3
14+
expected_depth=800, # actual max depth: 761
15+
)
16+
17+
# test notebook content
18+
for duration in tb.ref("durations"):
19+
assert duration < 15 # locally it is no longer than 15 seconds
20+
21+
assert np.isclose(
22+
tb.ref("trotter_results")[0][0],
23+
tb.ref("probs")[0][0],
24+
atol=0.01,
25+
) # should be atol=0.01

0 commit comments

Comments
 (0)