Skip to content
Snippets Groups Projects
Commit 687bb784 authored by Amir Mirzanejad's avatar Amir Mirzanejad
Browse files

Upload New File

parent bb62f316
No related branches found
No related tags found
No related merge requests found
%% Cell type:code id:c1bacd2c-a5c0-4cd4-b78d-9728220c136c tags:
``` python
# improt dependecies
import plotly
import scipy.ndimage
import numpy as np
import scipy
import plotly.io as pio
import plotly.graph_objects as go
pio.renderers.default = "iframe"
# Assuming Energy values from 'HubbardModelTriqs.ipynb' are stored in 'Energies_U_0.npy' file
Enegies_U_0 = np.load("Energies_U_0.npy")
# Apply the Gaussian filter
sigma = [0.1, 0.1]
data_smooth_U = scipy.ndimage.gaussian_filter(Enegies_U_0[:,:,0], sigma)
data_smooth_1_U = scipy.ndimage.gaussian_filter(Enegies_U_0[:,:,1], sigma)
data_smooth_2_U = scipy.ndimage.gaussian_filter(Enegies_U_0[:,:,2], sigma)
data_smooth = Enegies_U_0[:,:,0]
data_smooth_1 = Enegies_U_0[:,:,1]
data_smooth_2 = Enegies_U_0[:,:,2]
colorscale1 = [[0, 'yellow'], [1, 'darkorange']]
colorscale2 = [[0, 'darkorange'], [1, '#FF9912']]
colorscale3 = [[0, '#FF9912'], [1, '#FF6103']]
fig = go.Figure()
# Add surface trace without contours, using the smoothed data
fig.add_trace(go.Surface(z=data_smooth_U, colorscale=colorscale1))
fig.add_trace(go.Surface(z=data_smooth_1_U, colorscale=colorscale2))
fig.add_trace(go.Surface(z=data_smooth_2_U, colorscale=colorscale3))
# Generate x and y indices
x = np.arange(0, data_smooth.shape[1])
y = np.arange(0, data_smooth.shape[0])
# Add lines that correspond to constant x values
for i in range(data_smooth.shape[0]):
fig.add_trace(go.Scatter3d(x=np.full_like(y, i), y=y, z=data_smooth[:, i], mode='lines',
line=dict(color='black', width=5), showlegend=False))
for i in range(data_smooth.shape[0]):
fig.add_trace(go.Scatter3d(x=np.full_like(y, i), y=y, z=data_smooth_1[:, i], mode='lines',
line=dict(color='black', width=3), showlegend=False))
for i in range(data_smooth.shape[0]):
fig.add_trace(go.Scatter3d(x=np.full_like(y, i), y=y, z=data_smooth_2[:, i], mode='lines',
line=dict(color='black', width=3), showlegend=False))
# Adjust position of camera
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))
fig.update_layout(scene_camera=camera_params)
fig.update_layout(title='PES of Hamiltonian for U = 0', autosize=True,
scene = dict(xaxis = dict(title='', title_font_family="Arial", title_font_color='black', title_font_size=25),
yaxis = dict(title='', title_font_family="Arial", title_font_color='black', title_font_size=25),
zaxis = dict(title='', title_font_family="Arial", title_font_color='black', title_font_size=25,
tickfont=dict(size=15), range=[-3.1,-1]),),
width=1200, height=1800, margin=dict(l=60, r=60, b=60, t=90))
fig.show()
```
%% Output
%% Cell type:code id:beaf20ba-ea31-4a8b-87cd-ffa142c41e2c tags:
``` python
# Assuming Energy values from 'HubbardModelTriqs.ipynb' are stored in 'Energies_U_1.npy' file
Enegies_U_1 = np.load("Energies_U_1_1.npy")
# Apply the Gaussian filter
sigma = [0.1, 0.1]
data_smooth_U = scipy.ndimage.gaussian_filter(Enegies_U_1[:,:,0], sigma)
data_smooth = Enegies_U_1[:,:,0]
colorscale = [[0, 'orange'], [1, 'yellow']]
fig = go.Figure()
# Add surface trace without contours, using the smoothed data
fig.add_trace(go.Surface(z=data_smooth_U, colorscale=colorscale))
# Generate x and y indices
x = np.arange(0, data_smooth.shape[1])
y = np.arange(0, data_smooth.shape[0])
# Add lines that correspond to constant x values
for i in range(data_smooth.shape[0]):
fig.add_trace(go.Scatter3d(x=np.full_like(y, i), y=y, z=data_smooth[:, i], mode='lines',
line=dict(color='black', width=5), showlegend=False))
# Adjust position of camera
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))
fig.update_layout(scene_camera=camera_params)
fig.update_layout(title='PES of Hamiltonian for U > 0', autosize=True,
scene = dict(xaxis = dict(title='Reaction Progress, β', title_font_family="Arial", title_font_color='black', title_font_size=20),
yaxis = dict(title='Hückel - Möbius Transformation, ϕ', title_font_family="Arial", title_font_color='black', title_font_size=20),
zaxis = dict(title='Energy / β', title_font_family="Arial", title_font_color='black', title_font_size=20),),
width=1500, height=1500, margin=dict(l=60, r=60, b=60, t=90))
fig.show()
```
%% Output
%% Cell type:code id:b72bca99-960f-40d2-a0f5-94ef491856db tags:
``` python
```
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment