Skip to content

Commit 77416a0

Browse files
[doc] fix notebook benchmark
1 parent 1b959bd commit 77416a0

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

docs/examples/benchmark/benchmark_njit.ipynb

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
},
3030
{
3131
"cell_type": "code",
32-
"execution_count": null,
32+
"execution_count": 2,
3333
"metadata": {},
3434
"outputs": [],
3535
"source": [
@@ -45,13 +45,18 @@
4545
" state = rydstate.RydbergStateSQDTAlkali(species, n, l=l, j=l + 0.5)\n",
4646
" potential = state.potential\n",
4747
" nu = state.nu\n",
48+
" RadialKet.clear_cached_instances()\n",
4849
" radial = RadialKet(nu, potential, dz=1e-3, use_njit=use_njit)\n",
4950
" radial.integrate_wavefunction()\n",
5051
"\n",
5152
" results = []\n",
5253
" for species, n, l, use_njit in test_cases:\n",
5354
" # Setup the test function\n",
54-
" stmt = \"radial = RadialKet(nu, potential, dz=1e-3, use_njit=use_njit)\\nradial.integrate_wavefunction()\"\n",
55+
" stmt = (\n",
56+
" \"RadialKet.clear_cached_instances()\\n\"\n",
57+
" \"radial = RadialKet(nu, potential, dz=1e-3, use_njit=use_njit)\\n\"\n",
58+
" \"radial.integrate_wavefunction()\"\n",
59+
" )\n",
5560
"\n",
5661
" # Time the integration multiple times and take average/std\n",
5762
" globals_dict = {\n",
@@ -92,8 +97,8 @@
9297
"----------------------------------------------------------------------\n",
9398
" species n l use_njit time (ms) std (ms)\n",
9499
"----------------------------------------------------------------------\n",
95-
" H 100 80 True 14.74 0.96\n",
96-
" H 100 80 False 140.28 4.93\n"
100+
" H 100 80 True 13.75 0.20\n",
101+
" H 100 80 False 136.34 10.99\n"
97102
]
98103
}
99104
],

0 commit comments

Comments
 (0)