Skip to content
Open
Show file tree
Hide file tree
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
7 changes: 3 additions & 4 deletions hoomd-blue/classic/butane/ann/butane_ANN.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,7 @@
}
],
"source": [
"run_result = pysages.run(method, generate_context, int(5e5))"
"raw_result = pysages.run(method, generate_context, int(5e5))"
]
},
{
Expand Down Expand Up @@ -694,11 +694,10 @@
},
"outputs": [],
"source": [
"result = pysages.analyze(run_result)\n",
"result = pysages.analyze(raw_result)\n",
"\n",
"mesh = result[\"mesh\"]\n",
"A = result[\"free_energy\"]\n",
"A = A.max() - A"
"A = result[\"free_energy\"]"
]
},
{
Expand Down
5 changes: 2 additions & 3 deletions hoomd-blue/classic/butane/ann/butane_ANN.md
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ Make sure to run with GPU support, otherwise, it can take a very long time.
<!-- #endregion -->

```python colab={"base_uri": "https://localhost:8080/"} id="K951m4BbpUar" outputId="f01ca7e3-69f4-4218-9eb5-cdc022f877b8"
run_result = pysages.run(method, generate_context, int(5e5))
raw_result = pysages.run(method, generate_context, int(5e5))
```

<!-- #region id="PXBKUfK0p9T2" -->
Expand All @@ -382,11 +382,10 @@ import matplotlib.pyplot as plt
```

```python id="6W7Xf0ilqAcm"
result = pysages.analyze(run_result)
result = pysages.analyze(raw_result)

mesh = result["mesh"]
A = result["free_energy"]
A = A.max() - A
```

```python colab={"base_uri": "https://localhost:8080/", "height": 300} id="TBiPAnMwqEIF" outputId="de1e6c26-0dc9-48ef-cecd-6f94bf11c25c"
Expand Down
8 changes: 3 additions & 5 deletions hoomd-blue/classic/butane/ann/butane_ANN.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from pysages.methods import ANN

# %%
kT = 0.596161
kT = 0.596161 # kcal/mol
dt = 0.02045


Expand Down Expand Up @@ -284,7 +284,6 @@ def main(argv=[]):

mesh = result["mesh"]
A = result["free_energy"]
A = A.max() - A

fig, ax = plt.subplots()

Expand All @@ -295,9 +294,8 @@ def main(argv=[]):
plt.gca()
fig.savefig("butane-fe.png")

# write free energy to file
dih_vs_A = np.stack([mesh[:, 0], A[:, 0]], axis=1)
np.savetxt("butane-fe.dat", dih_vs_A, header='"dih" "Free energy"')
# write results to pickle file
pickle.dump( raw_result, open("raw_result.pickle", "wb") )

return result["free_energy"]

Expand Down