Skip to content
Merged
Changes from all 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
69 changes: 46 additions & 23 deletions cookbook/exploring_protocol_settings.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@
]
},
{
"metadata": {},
"cell_type": "markdown",
"id": "84d716d6bc428c83",
"metadata": {},
"source": [
"## Sampling and performance settings\n",
"\n",
Expand All @@ -52,14 +53,25 @@
"| **Protocol repeats** | The number of independent executions of the protocol. | `protocol_repeats` | `int` |\n",
"\n",
"The appropriate changes to these settings are transformation dependent with no single setting guaranteeing sufficient convergence or accuracy in general. These settings provide a good starting point to investigate the affect of additional sampling. The following example retrieves them from the default settings:"
],
"id": "84d716d6bc428c83"
]
},
{
"metadata": {},
"cell_type": "code",
"outputs": [],
"execution_count": null,
"execution_count": 2,
"id": "921c307e3d1f19b8",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Lambda windows: 11\n",
"Production length per state: 5.0 nanosecond\n",
"Equilibration length per state: 1.0 nanosecond\n",
"Independent repeats: 3\n"
]
}
],
"source": [
"n_repeats = settings.protocol_repeats\n",
"n_windows = settings.lambda_settings.lambda_windows\n",
Expand All @@ -70,12 +82,12 @@
"print(f\"Production length per state: {production_length}\")\n",
"print(f\"Equilibration length per state: {equilibration_length}\")\n",
"print(f\"Independent repeats: {n_repeats}\")"
],
"id": "921c307e3d1f19b8"
]
},
{
"metadata": {},
"cell_type": "markdown",
"id": "22b1aa1dd390fd73",
"metadata": {},
"source": [
"### Estimating the computational cost of a protocol\n",
"\n",
Expand All @@ -97,14 +109,22 @@
"</div>\n",
"\n",
"So for the default settings the total simulation time is:"
],
"id": "22b1aa1dd390fd73"
]
},
{
"metadata": {},
"cell_type": "code",
"outputs": [],
"execution_count": null,
"execution_count": 3,
"id": "c8b951b79fd1c4bb",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Total simulation time: 198.0 nanosecond\n"
]
}
],
"source": [
"def estimate_rbfe_cost(settings):\n",
" n_repeats = settings.protocol_repeats\n",
Expand All @@ -117,8 +137,7 @@
"\n",
"total_sim_time_per_leg = estimate_rbfe_cost(settings)\n",
"print(f\"Total simulation time: {total_sim_time_per_leg}\")"
],
"id": "c8b951b79fd1c4bb"
]
},
{
"cell_type": "markdown",
Expand Down Expand Up @@ -390,7 +409,7 @@
},
{
"cell_type": "markdown",
"id": "c1d2e3f4a5b60001",
"id": "881aec55e73c19cd",
"metadata": {},
"source": [
"### Other protocols\n",
Expand All @@ -402,16 +421,20 @@
"\n",
"These protocols execute both the `complex` and `solvent` legs within a single transformation, the settings to control the production sampling are then prefixed with the leg name `complex_*` or `solvent_*`.\n",
"\n",
"In addition, each leg has a `*_equil_simulation_settings` object controlling an initial MD simulation used to determine the restraint atoms in the complex and to seed both legs production simulations.\n"
"In addition, each leg has a `*_equil_simulation_settings` object controlling an initial MD simulation used to determine the restraint atoms in the complex and to seed both legs production simulations.\n",
"\n",
"<div alert class=\"alert alert-info\">\n",
"\n",
"**Note:** The **AbsoluteSolvationProtocol** follows the same per-leg settings pattern, but uses the prefixes **vacuum_*** and **solvent_*** rather than **complex_*** and **solvent_*** and the following examples also apply to that protocol.\n",
"\n",
"</div>"
]
},
{
"cell_type": "code",
"execution_count": 8,
"id": "61192c7c",
"metadata": {
"nbsphinx": "hidden"
},
"id": "f6c511b6841b4135",
"metadata": {},
"outputs": [],
"source": [
"import warnings\n",
Expand All @@ -423,7 +446,7 @@
{
"cell_type": "code",
"execution_count": 9,
"id": "other-protocol-imports",
"id": "bb9691bd6e6cec83",
"metadata": {},
"outputs": [],
"source": [
Expand Down
Loading