File tree Expand file tree Collapse file tree 2 files changed +22
-10
lines changed
applications/physical_systems/quantum_maps Expand file tree Collapse file tree 2 files changed +22
-10
lines changed Original file line number Diff line number Diff line change 503503 ]
504504 },
505505 {
506- "cell_type" : " markdown" ,
506+ "cell_type" : " code" ,
507+ "execution_count" : 19 ,
507508 "id" : " 29" ,
508509 "metadata" : {},
510+ "outputs" : [],
509511 "source" : [
510- " ## Technical Notes"
512+ " for i in range(len(timesteps)):\n " ,
513+ " df = results_simulator[i].dataframe\n " ,
514+ " assert float(df.loc[df[\" p\" ] == -2, \" probability\" ].iloc[0]) > 0.9"
511515 ]
512516 },
513517 {
514518 "cell_type" : " markdown" ,
515519 "id" : " 30" ,
516520 "metadata" : {},
521+ "source" : [
522+ " ## Technical Notes"
523+ ]
524+ },
525+ {
526+ "cell_type" : " markdown" ,
527+ "id" : " 31" ,
528+ "metadata" : {},
517529 "source" : [
518530 " Below we derive the time-evolution of the quantum sawtooth map. We start with the classical map and go through several renormalizations and redefinitions.\n " ,
519531 " The classical system is written for the so-called action-angle variables $(p,q)$\n " ,
559571 },
560572 {
561573 "cell_type" : " markdown" ,
562- "id" : " 31 " ,
574+ "id" : " 32 " ,
563575 "metadata" : {},
564576 "source" : [
565577 " ## References\n " ,
Original file line number Diff line number Diff line change 11from tests .utils_for_testbook import (
22 validate_quantum_program_size ,
3- validate_quantum_model ,
43 wrap_testbook ,
54)
65from testbook .client import TestbookNotebookClient
76
87
98@wrap_testbook ("quantum_sawtooth_map" , timeout_seconds = 60 )
109def test_notebook (tb : TestbookNotebookClient ) -> None :
11- # test models
12- validate_quantum_model (tb .ref ("qmod" ))
1310 # test quantum programs
1411 validate_quantum_program_size (
1512 tb .ref_pydantic ("qprog" ),
16- expected_width = None ,
17- expected_depth = None ,
18- expected_cx_count = None ,
13+ expected_width = 5 , # actual 3
14+ expected_depth = 100 , # actual 49
1915 )
2016
2117 # test notebook content
22- pass # Todo
18+ timesteps = tb .ref ("timesteps" )
19+ res_simulator = tb .ref_pydantic ("results_simulator" )
20+ for i in range (len (timesteps )):
21+ df = res_simulator [i ].dataframe
22+ assert float (df .loc [df ["p" ] == - 2 , "probability" ].iloc [0 ]) > 0.9
You can’t perform that action at this time.
0 commit comments