Skip to content
Merged
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
20 changes: 20 additions & 0 deletions experiment_results/10_atct_tae/processed_results.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
mol_hash,expt_tae_hartree,orbformer_tae_hartree,error_hartree,mol_name
eba17b263db5931204ce0e3bad2208d90d6ae5b2,0.25153868253104555,0.2516+/-0.0012,0.0001+/-0.0012,HOF
0aea381c62db3dbdc08b53ccb257de998cd9fadb,0.4721367552004738,0.4709+/-0.0010,-0.0012+/-0.0010,HNNH
4c10d269767a07c8bacc97412aefb406d26bb885,0.448033670561951,0.4488+/-0.0006,0.0007+/-0.0006,BH3
e2667a31a0501142121671cffb29ef29ff55b90b,0.37733511197398145,0.3787+/-0.0009,0.0014+/-0.0009,COH
11079e187c6cf1b00382df7ae072041b03e009ff,0.2907371948824763,0.2914+/-0.0008,0.0007+/-0.0008,NH2
721618082328d71d3ed3ffcc564fa31650ccfcc5,0.28855414373426,0.2861+/-0.0006,-0.0024+/-0.0006,CN
8abed7996b474e53a432451eda23dbef3e8e2b00,0.13518584989477067,0.1364+/-0.0006,0.0012+/-0.0006,BH
2e2c8e112963b1a264738e56e7f73a01a7da0f7d,0.5352275884973267,0.5347+/-0.0007,-0.0005+/-0.0007,HCNH
12dc877fdffd1017bef4d73d1ad22536e3345b34,0.766446755755141,0.7672+/-0.0010,0.0008+/-0.0010,CH2NH2
b08117237eefcfe2ac85ce649a8ad527f1c47bae,0.474751967901278,0.4743+/-0.0006,-0.0005+/-0.0006,HNC
e43b724499fbe5c5737980bed3dfe8607200f80d,0.6729133816045395,0.6738+/-0.0013,0.0009+/-0.0013,CH3F
e6a133e73524e2faa153e2ccae3f6e13ec98961f,0.6996729053826066,0.7005+/-0.0011,0.0008+/-0.0011,CH2NH
d9e8418abac9d4266b7fe06e1da26d4d1ff664e9,0.572685114130136,0.5718+/-0.0008,-0.0008+/-0.0008,NH2OH
7ba71c46d511e9f2cc3495cf3ebee78aa731c52a,0.6696352703168832,0.6699+/-0.0006,0.0003+/-0.0006,CH4
e04ef516ad033825f7e5229f6f6fd2683351d8a2,0.47477466834241727,0.4750+/-0.0007,0.0002+/-0.0007,NH3
8d1a784c36e552fd5dde13fb40caecca99d5e391,0.7100637352277853,0.7103+/-0.0011,0.0002+/-0.0011,CH2CH
16a89282c5978b3aa4b17cfc8871cec741899cd5,0.4249917172827222,0.4263+/-0.0006,0.0014+/-0.0006,HNOH
b532b5d380913eedf01c4bd931cf433c8fb2dfd4,0.8981979527295672,0.8981+/-0.0009,-0.0001+/-0.0009,CH2CH2
6bcca83d66412cbc0ad8c9214f5433bbb98ea44c,0.210723411244248,0.2120+/-0.0013,0.0013+/-0.0013,CF
76 changes: 76 additions & 0 deletions notebooks/10_atct_tae/create_figures.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"id": "83183e67",
"metadata": {},
"outputs": [],
"source": [
"import re\n",
"from oneqmc.analysis.energy import HARTREE_TO_KCAL\n",
"from uncertainties import ufloat_fromstr\n",
"from uncertainties.unumpy import nominal_values, std_devs\n",
"import matplotlib.pyplot as plt\n",
"import pandas as pd"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "4cc87ebd",
"metadata": {},
"outputs": [],
"source": [
"results_df = pd.read_csv(\"../../experiment_results/10_atct_tae/processed_results.csv\")\n",
"results_df[\"orbformer_tae_hartree\"] = results_df[\"orbformer_tae_hartree\"].apply(ufloat_fromstr)\n",
"results_df[\"error_hartree\"] = results_df[\"error_hartree\"].apply(ufloat_fromstr)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "77381197",
"metadata": {},
"outputs": [],
"source": [
"def digit_to_subscript(formula: str) -> str:\n",
" # Replace all digits with a LaTeX style subscript\n",
" return re.sub(r\"(\\d)\", r\"$_{\\1}$\", formula)\n",
"\n",
"fig, ax = plt.subplots(figsize=(6, 3.5))\n",
"length = len(results_df)\n",
"ax.errorbar(range(len(results_df)), HARTREE_TO_KCAL * nominal_values(results_df[\"error_hartree\"]), yerr=HARTREE_TO_KCAL * std_devs(results_df[\"error_hartree\"]), fmt=\"o\")\n",
"ax.fill_between([-1, length], -1, 1, color=\"gray\", alpha=0.2)\n",
"ax.axhline(0, color=\"gray\", linestyle=\"--\")\n",
"ax.set_xlim(-0.7, length - 0.3)\n",
"ax.set_xticks(range(len(results_df)))\n",
"ax.set_xticklabels(results_df[\"mol_name\"].apply(digit_to_subscript), rotation=90)\n",
"ax.set_ylabel(r\"Diff. to experimental $\\Delta H^\\circ_f(0 \\, \\text{K})$ (kcal/mol)\")\n",
"print(f'{nominal_values(results_df[\"error_hartree\"].abs()).mean() * HARTREE_TO_KCAL:.2f} kcal/mol MAE')\n",
"fig.savefig(\"atct_tae_error.pdf\", bbox_inches=\"tight\", dpi=300)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "env",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.13.12"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
Loading