{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "imports",
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import matplotlib.pyplot as plt\n",
    "from pyprojroot import here"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "load",
   "metadata": {},
   "outputs": [],
   "source": [
    "data = pd.read_csv(here() / 'data/base/data.csv')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "plot",
   "metadata": {},
   "outputs": [],
   "source": [
    "fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(14, 5))\n",
    "\n",
    "# Separate room temp and cryogenic\n",
    "room_temp = data[data['Temperature (K)'] > 200]\n",
    "cryo = data[data['Temperature (K)'] <= 200]\n",
    "\n",
    "# Box plot comparison\n",
    "box_data = [room_temp['Entanglement Fidelity'], cryo['Entanglement Fidelity']]\n",
    "bp = ax1.boxplot(box_data, labels=['Room Temp', 'Cryogenic'],\n",
    "                  patch_artist=True, notch=True)\n",
    "bp['boxes'][0].set_facecolor('coral')\n",
    "bp['boxes'][1].set_facecolor('steelblue')\n",
    "ax1.set_ylabel('Entanglement Fidelity', fontsize=12)\n",
    "ax1.set_title('Fidelity: Room Temperature vs Cryogenic', fontsize=13)\n",
    "ax1.grid(True, alpha=0.3, axis='y')\n",
    "\n",
    "# Dark counts comparison\n",
    "box_data2 = [room_temp['Dark Count Rate A (Hz)'], cryo['Dark Count Rate A (Hz)']]\n",
    "bp2 = ax2.boxplot(box_data2, labels=['Room Temp', 'Cryogenic'],\n",
    "                   patch_artist=True, notch=True)\n",
    "bp2['boxes'][0].set_facecolor('coral')\n",
    "bp2['boxes'][1].set_facecolor('steelblue')\n",
    "ax2.set_ylabel('Dark Count Rate (Hz)', fontsize=12)\n",
    "ax2.set_title('Dark Counts: Room Temperature vs Cryogenic', fontsize=13)\n",
    "ax2.grid(True, alpha=0.3, axis='y')\n",
    "\n",
    "plt.tight_layout()\n",
    "plt.savefig(here() / 'output/plots/temperature_effects.png', dpi=300, bbox_inches='tight')"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
