|
15 | 15 | "metadata": {}, |
16 | 16 | "outputs": [], |
17 | 17 | "source": [ |
| 18 | + "import sys\n", |
| 19 | + "sys.path.append('/home/fosteradam/oneqmc/src')\n", |
| 20 | + "\n", |
18 | 21 | "import matplotlib.pyplot as plt\n", |
19 | 22 | "from matplotlib import rcParams\n", |
20 | 23 | "import numpy as np\n", |
|
58 | 61 | "metadata": {}, |
59 | 62 | "outputs": [], |
60 | 63 | "source": [ |
61 | | - "save_figures = False" |
| 64 | + "save_figures = True" |
62 | 65 | ] |
63 | 66 | }, |
64 | 67 | { |
|
168 | 171 | "# Single color for all non-QMC methods, different markers\n", |
169 | 172 | "non_qmc_color = \"#E05A33\" # red/orange\n", |
170 | 173 | "non_qmc_markers = ['s', '^', 'v', 'D', 'p', 'h', '*', 'X', 'P', '<', '>'] # variety of markers\n", |
| 174 | + "non_qmc_marker_sizes = {'s': 180, '^': 240, 'v': 240, 'D': 180, 'p': 180, 'h': 180, '*': 300, 'X': 180, 'P': 180, '<': 180, '>': 180}\n", |
171 | 175 | "\n", |
172 | 176 | "fig, ax = plt.subplots(3, 2, figsize=(18.5, 19), sharey=True)\n", |
173 | 177 | "compute_sec = {\n", |
|
195 | 199 | " x_gpu_hr = x * 4 * compute_sec[i] / 3600\n", |
196 | 200 | " y = 627.5 * MAE[i][j][:, 1]\n", |
197 | 201 | " h, v = np.divmod(m, 3)\n", |
198 | | - " ax[v][h].scatter(x_gpu_hr, y, marker=\"o\", s=140, label=j, color=qmc_colors[n])\n", |
| 202 | + " ax[v][h].scatter(x_gpu_hr, y, marker=\"o\", s=140, label=j, color=qmc_colors[n], zorder=3)\n", |
199 | 203 | " a, b = np.polyfit(np.log(x_gpu_hr), np.log(y), 1)\n", |
200 | | - " ax[v][h].plot(x_gpu_hr, np.exp(a * np.log(x_gpu_hr) + b), color=qmc_colors[n], linewidth=4)\n", |
| 204 | + " ax[v][h].plot(x_gpu_hr, np.exp(a * np.log(x_gpu_hr) + b), color=qmc_colors[n], linewidth=4, zorder=2)\n", |
201 | 205 | " ax[v][h].set_xscale(\"log\", base=10)\n", |
202 | 206 | " ax[v][h].set_yscale(\"log\", base=4)\n", |
203 | 207 | " ticks = [0.01, 0.1, 1, 10, 100]\n", |
|
210 | 214 | " gpu_hr_equiv,\n", |
211 | 215 | " 627.5 * MAE_es[i][k][1],\n", |
212 | 216 | " label=k,\n", |
213 | | - " s=180,\n", |
| 217 | + " s=non_qmc_marker_sizes[non_qmc_markers[idx % len(non_qmc_markers)]],\n", |
214 | 218 | " color=non_qmc_color,\n", |
215 | 219 | " marker=non_qmc_markers[idx % len(non_qmc_markers)],\n", |
| 220 | + " zorder=4,\n", |
| 221 | + " edgecolors='white',\n", |
| 222 | + " linewidths=1.5,\n", |
216 | 223 | " )\n", |
217 | 224 | " ax[v][h].set_xticks(ticks)\n", |
218 | 225 | " ax[v][h].set_xticklabels(ticks, fontsize=16)\n", |
219 | | - " ax[v][h].axhspan(0.2, 5, color=\"grey\", alpha=0.2, lw=0)\n", |
220 | | - " ax[v][h].set_xlim([0.0025, 500])\n", |
221 | | - " ax[v][h].axhline(1, color=\"k\", ls=\":\", linewidth=4)\n", |
| 226 | + " ax[v][h].axhspan(0.2, 5, color=\"grey\", alpha=0.2, lw=0, zorder=0)\n", |
| 227 | + " ax[v][h].set_xlim([0.0025, 300] if h == 0 else [0.005, 1100])\n", |
| 228 | + " ax[v][h].axhline(1, color=\"darkgray\", ls=\":\", linewidth=4, zorder=1)\n", |
222 | 229 | " ax[v][h].set_yticks(\n", |
223 | | - " [0.5, 1, 2, 5, 10, 20, 50], [0.5, 1, 2, 5, 10, 20, 50], fontsize=16\n", |
| 230 | + " [0.5, 1, 2, 5, 10, 20, 50, 100, 200], [0.5, 1, 2, 5, 10, 20, 50, 100, 200], fontsize=16\n", |
224 | 231 | " )\n", |
| 232 | + " ax[v][h].minorticks_off()\n", |
225 | 233 | " ax[v][h].set_ylim([0.25, 850])\n", |
226 | 234 | " if h == 0:\n", |
227 | | - " ax[v][h].set_ylabel(\"MARE over entire MEP (kcal/mol)\", fontsize=22)\n", |
| 235 | + " ax[v][h].set_ylabel(\"MARE over MEP (kcal/mol)\", fontsize=22)\n", |
228 | 236 | "ax[2][1].set_axis_off()\n", |
229 | 237 | "\n", |
230 | 238 | "ax[0][0].legend(\n", |
|
335 | 343 | "source": [ |
336 | 344 | "## Get reaction profile figure\n", |
337 | 345 | "\n", |
338 | | - "fig, ax = plt.subplots(3, 2, figsize=(13, 17.5), sharex=True)\n", |
| 346 | + "fig, ax = plt.subplots(3, 2, figsize=(13, 19), sharex=True)\n", |
339 | 347 | "\n", |
340 | 348 | "for m, j in enumerate([\"Ethane\", \"Formamide\", \"2-Aminopropan-2-ol\"]):\n", |
341 | 349 | " step = int(MAE[j][\"Orbformer fine-tune LAC (400k), all structures\"][-1, 0])\n", |
|
440 | 448 | " )\n", |
441 | 449 | " ax[m][0].set_ylabel(\"Relative E (kcal/mol)\", fontsize=22)\n", |
442 | 450 | " ax[m][1].set_ylabel(\"Relative E Error (kcal/mol)\", fontsize=22)\n", |
443 | | - "ax[0][0].text(0.03, 0.9, \"(a) Ethane\", transform=ax[0][0].transAxes, fontsize=24)\n", |
444 | | - "ax[0][1].text(0.03, 0.9, \"(d) Ethane\", transform=ax[0][1].transAxes, fontsize=24)\n", |
| 451 | + "ax[0][0].text(0.03, 1.02, \"(a) Ethane\", transform=ax[0][0].transAxes, fontsize=24)\n", |
| 452 | + "ax[0][1].text(0.03, 1.02, \"(d) Ethane\", transform=ax[0][1].transAxes, fontsize=24)\n", |
445 | 453 | "ax[1][0].text(0.03, 0.9, \"(b) Formamide\", transform=ax[1][0].transAxes, fontsize=24)\n", |
446 | 454 | "ax[1][1].text(0.03, 0.9, \"(e) Formamide\", transform=ax[1][1].transAxes, fontsize=24)\n", |
447 | 455 | "ax[2][0].text(\n", |
|
508 | 516 | "ax[0][1].text(\n", |
509 | 517 | " 0.18, 1.1, \"Relative Energy Error\", transform=ax[0][1].transAxes, fontsize=26\n", |
510 | 518 | ")\n", |
| 519 | + "ax[0][0].set_ylim([-100, 55])\n", |
511 | 520 | "ax[2][0].set_ylim([-65, 58])\n", |
512 | | - "plt.subplots_adjust(wspace=0.2, hspace=0.02)\n", |
| 521 | + "fig.align_ylabels(ax[:, 0])\n", |
| 522 | + "fig.align_ylabels(ax[:, 1])\n", |
| 523 | + "plt.subplots_adjust(wspace=0.2, hspace=0.15)\n", |
513 | 524 | "ax[2][0].set_xticks(2 * np.arange(11))\n", |
514 | 525 | "ax[2][0].set_xlim([-0.5, 19.5])\n", |
515 | 526 | "ax[2][0].set_xticklabels(2 * np.arange(11))\n", |
516 | 527 | "ax[2][0].set_xlabel(\"Image ID on MEP\", fontsize=22)\n", |
517 | 528 | "ax[2][1].set_xlabel(\"Image ID on MEP\", fontsize=22)\n", |
518 | 529 | "plt.draw()\n", |
| 530 | + "\n", |
519 | 531 | "if save_figures:\n", |
520 | 532 | " plt.savefig(f\"{data_dir}/BBMEP_energy_profile.pdf\", dpi=600, bbox_inches='tight')\n", |
521 | 533 | "plt.show()" |
|
532 | 544 | ], |
533 | 545 | "metadata": { |
534 | 546 | "kernelspec": { |
535 | | - "display_name": "Python 3 (ipykernel)", |
| 547 | + "display_name": "oneqmc", |
536 | 548 | "language": "python", |
537 | 549 | "name": "python3" |
538 | 550 | }, |
|
0 commit comments