Skip to content

Commit

Permalink
Add ASE functionality back into the nanotube notebook
Browse files Browse the repository at this point in the history
  • Loading branch information
hjstroud committed Oct 11, 2024
1 parent c17fdeb commit 12097d7
Showing 1 changed file with 45 additions and 23 deletions.
68 changes: 45 additions & 23 deletions examples/ase/ase_openmm_nanotube.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,11 @@
]
},
{
"metadata": {},
"cell_type": "markdown",
"source": "Now we have our simulation ready, we can set up our NanoVer server to run the simulation. We run interactive ASE-OpenMM simulations in NanoVer using the `OmniRunner` class, which is in charge of serving and running the simulation."
"metadata": {},
"source": [
"Now we have our simulation ready, we can set up our NanoVer server to run the simulation. We run interactive ASE-OpenMM simulations in NanoVer using the `OmniRunner` class, which is in charge of serving and running the simulation."
]
},
{
"cell_type": "code",
Expand Down Expand Up @@ -171,7 +173,9 @@
" imd_runner.close()\n",
"except NameError:\n",
" pass\n",
"imd_runner = OmniRunner.with_basic_server(nanotube_simulation, name=\"nanotube-ase-omm-server\")"
"imd_runner = OmniRunner.with_basic_server(nanotube_simulation, name=\"nanotube-ase-omm-server\")\n",
"imd_runner.next()\n",
"imd_runner.pause()"
]
},
{
Expand All @@ -194,17 +198,26 @@
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Let's get the simulation running"
]
"source": "As we are running the OpenMM simulation via ASE, we can use the ASE functionality to run a few simulation steps to check that everything is working:"
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [],
"outputs": [
{
"data": {
"text/plain": [
"True"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"imd_runner.next()"
"nanotube_simulation.dynamics.run(10)"
]
},
{
Expand All @@ -215,7 +228,7 @@
{
"data": {
"text/plain": [
"18"
"10"
]
},
"execution_count": 6,
Expand All @@ -235,7 +248,7 @@
{
"data": {
"text/plain": [
"18.91275119857118"
"29.37619863848655"
]
},
"execution_count": 7,
Expand Down Expand Up @@ -275,6 +288,15 @@
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [],
"source": [
"imd_runner.play()"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {
"ExecuteTime": {
"end_time": "2019-06-06T16:04:25.876184Z",
Expand Down Expand Up @@ -302,10 +324,10 @@
{
"data": {
"text/plain": [
"33.20070838500853"
"24.45851002327552"
]
},
"execution_count": 8,
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
Expand Down Expand Up @@ -362,13 +384,13 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 10,
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "d1de02c5fe4241ea9ff04bd6f6903a8a",
"model_id": "2039748b2f864b1f94024a907af8b5c1",
"version_major": 2,
"version_minor": 0
},
Expand Down Expand Up @@ -441,7 +463,7 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": 13,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -458,7 +480,7 @@
},
{
"cell_type": "code",
"execution_count": 13,
"execution_count": 14,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -467,7 +489,7 @@
},
{
"cell_type": "code",
"execution_count": 14,
"execution_count": 15,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -486,7 +508,7 @@
},
{
"cell_type": "code",
"execution_count": 15,
"execution_count": 16,
"metadata": {
"ExecuteTime": {
"end_time": "2019-06-06T16:04:26.778540Z",
Expand All @@ -505,7 +527,7 @@
},
{
"cell_type": "code",
"execution_count": 16,
"execution_count": 17,
"metadata": {},
"outputs": [
{
Expand All @@ -514,7 +536,7 @@
"True"
]
},
"execution_count": 16,
"execution_count": 17,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -525,7 +547,7 @@
},
{
"cell_type": "code",
"execution_count": 17,
"execution_count": 18,
"metadata": {},
"outputs": [
{
Expand All @@ -534,7 +556,7 @@
"True"
]
},
"execution_count": 17,
"execution_count": 18,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -559,7 +581,7 @@
},
{
"cell_type": "code",
"execution_count": 18,
"execution_count": 19,
"metadata": {},
"outputs": [],
"source": [
Expand Down

0 comments on commit 12097d7

Please sign in to comment.