From 74dc9b4a29705f9c5ae81992d7537a75e1705bf9 Mon Sep 17 00:00:00 2001
From: Amir Mirzanejad <aqm6884@psu.edu>
Date: Fri, 8 Sep 2023 12:10:23 -0400
Subject: [PATCH] Upload New File

---
 PES_of_Hamiltonian.ipynb | 120 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 120 insertions(+)
 create mode 100644 PES_of_Hamiltonian.ipynb

diff --git a/PES_of_Hamiltonian.ipynb b/PES_of_Hamiltonian.ipynb
new file mode 100644
index 0000000..be85fc2
--- /dev/null
+++ b/PES_of_Hamiltonian.ipynb
@@ -0,0 +1,120 @@
+{
+ "cells": [
+  {
+   "cell_type": "code",
+   "execution_count": 1,
+   "id": "c1bacd2c-a5c0-4cd4-b78d-9728220c136c",
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/html": [
+       "<iframe\n",
+       "    scrolling=\"no\"\n",
+       "    width=\"1220px\"\n",
+       "    height=\"1820\"\n",
+       "    src=\"iframe_figures/figure_3.html\"\n",
+       "    frameborder=\"0\"\n",
+       "    allowfullscreen\n",
+       "></iframe>\n"
+      ]
+     },
+     "metadata": {},
+     "output_type": "display_data"
+    }
+   ],
+   "source": [
+    "# improt dependecies\n",
+    "import plotly\n",
+    "import scipy.ndimage\n",
+    "import numpy as np\n",
+    "import scipy\n",
+    "import plotly.io as pio\n",
+    "import plotly.graph_objects as go\n",
+    "pio.renderers.default = \"iframe\"\n",
+    "\n",
+    "# Assuming Energy values from 'HubbardModelTriqs.ipynb' are stored in 'Energies_U_0.npy' file \n",
+    "Enegies_U_0 = np.load(\"Energies_U_0.npy\")\n",
+    "\n",
+    "# Apply the Gaussian filter\n",
+    "sigma = [0.1, 0.1]\n",
+    "data_smooth_U   = scipy.ndimage.gaussian_filter(Enegies_U_0[:,:,0], sigma)\n",
+    "data_smooth_1_U = scipy.ndimage.gaussian_filter(Enegies_U_0[:,:,1], sigma)\n",
+    "data_smooth_2_U = scipy.ndimage.gaussian_filter(Enegies_U_0[:,:,2], sigma)\n",
+    "\n",
+    "data_smooth   = Enegies_U_0[:,:,0]\n",
+    "data_smooth_1 = Enegies_U_0[:,:,1]\n",
+    "data_smooth_2 = Enegies_U_0[:,:,2]\n",
+    "\n",
+    "colorscale1 = [[0, 'yellow'],     [1, 'darkorange']]\n",
+    "colorscale2 = [[0, 'darkorange'], [1, '#FF9912']]\n",
+    "colorscale3 = [[0, '#FF9912'],    [1, '#FF6103']]\n",
+    "\n",
+    "fig = go.Figure()\n",
+    "\n",
+    "# Add surface trace without contours, using the smoothed data\n",
+    "fig.add_trace(go.Surface(z=data_smooth_U, colorscale=colorscale1))\n",
+    "fig.add_trace(go.Surface(z=data_smooth_1_U, colorscale=colorscale2))\n",
+    "fig.add_trace(go.Surface(z=data_smooth_2_U, colorscale=colorscale3))\n",
+    "\n",
+    "# Generate x and y indices\n",
+    "x = np.arange(0, data_smooth.shape[1])\n",
+    "y = np.arange(0, data_smooth.shape[0])\n",
+    "\n",
+    "# Add lines that correspond to constant x values\n",
+    "for i in range(data_smooth.shape[0]):\n",
+    "    fig.add_trace(go.Scatter3d(x=np.full_like(y, i), y=y, z=data_smooth[:, i], mode='lines', \n",
+    "                               line=dict(color='black', width=5), showlegend=False))    \n",
+    "for i in range(data_smooth.shape[0]):\n",
+    "    fig.add_trace(go.Scatter3d(x=np.full_like(y, i), y=y, z=data_smooth_1[:, i], mode='lines', \n",
+    "                               line=dict(color='black', width=3), showlegend=False))\n",
+    "for i in range(data_smooth.shape[0]):\n",
+    "    fig.add_trace(go.Scatter3d(x=np.full_like(y, i), y=y, z=data_smooth_2[:, i], mode='lines', \n",
+    "                               line=dict(color='black', width=3), showlegend=False))\n",
+    "\n",
+    "# Adjust position of camera    \n",
+    "camera_params = dict(up=dict(x=1.25,y=0,z=1),center=dict(x=0,y=0,z=0),eye=dict(x=2.9,y=-2.1,z=0.5)) \n",
+    "\n",
+    "fig.update_layout(scene_camera=camera_params)\n",
+    "\n",
+    "fig.update_layout(title='PES of Hamiltonian for U = 0', autosize=True,\n",
+    "    scene = dict(xaxis = dict(title='', title_font_family=\"Arial\", title_font_color='black', title_font_size=25), \n",
+    "                 yaxis = dict(title='', title_font_family=\"Arial\", title_font_color='black', title_font_size=25),\n",
+    "                 zaxis = dict(title='', title_font_family=\"Arial\", title_font_color='black', title_font_size=25, \n",
+    "                              tickfont=dict(size=15), range=[-3.1,-1]),),\n",
+    "                 width=1200, height=1800, margin=dict(l=60, r=60, b=60, t=90))\n",
+    "\n",
+    "fig.show()"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "id": "beaf20ba-ea31-4a8b-87cd-ffa142c41e2c",
+   "metadata": {},
+   "outputs": [],
+   "source": []
+  }
+ ],
+ "metadata": {
+  "kernelspec": {
+   "display_name": "Python 3 (ipykernel)",
+   "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.10.8"
+  }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 5
+}
-- 
GitLab