Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
data
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SOSP-4n
data
Commits
687bb784
Commit
687bb784
authored
1 year ago
by
Amir Mirzanejad
Browse files
Options
Downloads
Patches
Plain Diff
Upload New File
parent
bb62f316
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
PES_of_Hamiltonian.ipynb
+181
-0
181 additions, 0 deletions
PES_of_Hamiltonian.ipynb
with
181 additions
and
0 deletions
PES_of_Hamiltonian.ipynb
0 → 100644
+
181
−
0
View file @
687bb784
{
"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_6.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": 2,
"id": "beaf20ba-ea31-4a8b-87cd-ffa142c41e2c",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<iframe\n",
" scrolling=\"no\"\n",
" width=\"1520px\"\n",
" height=\"1520\"\n",
" src=\"iframe_figures/figure_2.html\"\n",
" frameborder=\"0\"\n",
" allowfullscreen\n",
"></iframe>\n"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"# Assuming Energy values from 'HubbardModelTriqs.ipynb' are stored in 'Energies_U_1.npy' file \n",
"Enegies_U_1 = np.load(\"Energies_U_1_1.npy\")\n",
"\n",
"# Apply the Gaussian filter\n",
"sigma = [0.1, 0.1]\n",
"data_smooth_U = scipy.ndimage.gaussian_filter(Enegies_U_1[:,:,0], sigma)\n",
"data_smooth = Enegies_U_1[:,:,0]\n",
"colorscale = [[0, 'orange'], [1, 'yellow']]\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=colorscale))\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",
"\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=1.15)) \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='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='Energy / β', title_font_family=\"Arial\", title_font_color='black', title_font_size=20),),\n",
" width=1500, height=1500, margin=dict(l=60, r=60, b=60, t=90))\n",
"\n",
"fig.show()"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "b72bca99-960f-40d2-a0f5-94ef491856db",
"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
}
%% 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
```
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment