diff --git a/NOON.ipynb b/NOON.ipynb new file mode 100644 index 0000000000000000000000000000000000000000..f2f2e44c0b247e472c082ef58276ebe61a8e142c --- /dev/null +++ b/NOON.ipynb @@ -0,0 +1,114 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "id": "14832308-bfbd-409d-aeec-05aa7b41993c", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "<iframe\n", + " scrolling=\"no\"\n", + " width=\"1320px\"\n", + " height=\"1320\"\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 Natural Orbital Occupation Number values from 'HubbardModelTriqs.ipynb' are stored in 'NOOC_U_1.npy' file \n", + "NatOcc = np.load(\"NOOC_U_1.npy\")\n", + "\n", + "# Apply the Gaussian filter\n", + "sigma = [0.1, 0.1]\n", + "data_smooth_U = scipy.ndimage.gaussian_filter(NatOcc[:,:,0], sigma)\n", + "data_smooth_1_U = scipy.ndimage.gaussian_filter(NatOcc[:,:,1], sigma)\n", + "data_smooth_2_U = scipy.ndimage.gaussian_filter(NatOcc[:,:,2], sigma)\n", + "\n", + "data_smooth = NatOcc[:,:,0]\n", + "data_smooth_1 = NatOcc[:,:,1]\n", + "data_smooth_2 = NatOcc[:,:,2]\n", + "\n", + "colorscale1 = [[0, 'yellow'], [1, 'darkorange']]\n", + "colorscale2 = [[0, 'darkorange'], [1, 'orangered']]\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_1_U, colorscale=colorscale1))\n", + "fig.add_trace(go.Surface(z=data_smooth_2_U, colorscale=colorscale2))\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_2[:, i], mode='lines', \n", + " line=dict(color='black', width=2), showlegend=False))\n", + "\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=2), showlegend=False))\n", + " \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=1.15)) \n", + "\n", + "fig.update_layout(scene_camera=camera_params)\n", + "\n", + "fig.update_layout(title='NOON for U > 0', autosize=True,\n", + " scene = dict(xaxis = dict(title='Reaction Progress, β', title_font_family=\"Arial\", title_font_color='black', title_font_size=20), \n", + " yaxis = dict(title='Hückel - Möbius Transformation, ϕ', title_font_family=\"Arial\", title_font_color='black', title_font_size=20),\n", + " zaxis = dict(title='Occupation Number', title_font_family=\"Arial\", title_font_color='black', title_font_size=20),),\n", + " width=1300, height=1300, margin=dict(l=60, r=60, b=60, t=90))\n", + "\n", + "fig.show()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "5b75a05e-5489-4a0b-80e0-e5412dc22469", + "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 +}