Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
p,counts,count,probability,bitstring
-2,927,927,0.927,110
-1,46,46,0.046,111
-3,18,18,0.018,101
-4,4,4,0.004,100
0,3,3,0.003,000
2,1,1,0.001,010
3,1,1,0.001,011
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
p,counts,count,probability,bitstring
-2,952,952,0.952,110
-1,25,25,0.025,111
-3,10,10,0.01,101
0,8,8,0.008,000
2,3,3,0.003,010
3,1,1,0.001,011
-4,1,1,0.001,100
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
p,counts,count,probability,bitstring
-2,973,973,0.973,110
2,9,9,0.009,010
0,8,8,0.008,000
-4,4,4,0.004,100
-1,3,3,0.003,111
-3,2,2,0.002,101
1,1,1,0.001,001
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
p,counts,count,probability,bitstring
-2,906,906,0.906,110
-1,39,39,0.039,111
-3,28,28,0.028,101
2,17,17,0.017,010
0,7,7,0.007,000
3,3,3,0.003,011
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
p,counts,count,probability,bitstring
-2,706,706,0.706,110
-1,78,78,0.078,111
-3,70,70,0.07,101
2,44,44,0.044,010
1,34,34,0.034,001
-4,32,32,0.032,100
3,24,24,0.024,011
0,12,12,0.012,000
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
p,counts,count,probability,bitstring
-2,585,585,0.585,110
-1,128,128,0.128,111
-3,71,71,0.071,101
1,56,56,0.056,001
2,53,53,0.053,010
-4,45,45,0.045,100
3,36,36,0.036,011
0,26,26,0.026,000
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
p,counts,count,probability,bitstring
-2,548,548,0.548,110
1,94,94,0.094,001
-1,91,91,0.091,111
2,66,66,0.066,010
-3,58,58,0.058,101
3,53,53,0.053,011
-4,46,46,0.046,100
0,44,44,0.044,000
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
p,counts,count,probability,bitstring
-2,390,390,0.39,110
1,144,144,0.144,001
-1,131,131,0.131,111
-3,87,87,0.087,101
2,77,77,0.077,010
-4,70,70,0.07,100
3,56,56,0.056,011
0,45,45,0.045,000
646 changes: 646 additions & 0 deletions applications/physical_systems/quantum_maps/quantum_sawtooth_map.ipynb

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"title": "Quantum Sawtooth Map",
"subtitle": "The Quantum Sawtooth Map",
"description": "The Quantum Sawtooth Map",
"friendly_name": "Quantum Sawtooth Map",
"vertical_tags": [],
"problem_domain_tags": [],
"qmod_type": [],
"level": [],
"id": "applications/physical_systems/quantum_maps/quantum_sawtooth_map.ipynb",
"quantum_program": "applications/physical_systems/quantum_maps/quantum_sawtooth_map.ipynb",
"thumbnail": "applications/physical_systems/quantum_maps/quantum_sawtooth_map.ipynb",
"preview-file/code": "applications/physical_systems/quantum_maps/quantum_sawtooth_map.ipynb",
"quantum-program": [],
"type": []
}
22 changes: 22 additions & 0 deletions tests/notebooks/test_quantum_sawtooth_map.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
from tests.utils_for_testbook import (
validate_quantum_program_size,
wrap_testbook,
)
from testbook.client import TestbookNotebookClient


@wrap_testbook("quantum_sawtooth_map", timeout_seconds=60)
def test_notebook(tb: TestbookNotebookClient) -> None:
# test quantum programs
validate_quantum_program_size(
tb.ref_pydantic("qprog"),
expected_width=5, # actual 3
expected_depth=100, # actual 49
)

# test notebook content
timesteps = tb.ref("timesteps")
res_simulator = tb.ref_pydantic("results_simulator")
for i in range(len(timesteps)):
df = res_simulator[i].dataframe
assert float(df.loc[df["p"] == -2, "probability"].iloc[0]) > 0.9
Loading