Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Yesun Huang
SumFrequencyGeneration
Commits
8b75662a
Commit
8b75662a
authored
Jun 12, 2021
by
YesunHuang
Browse files
Seperate Save function
parent
2df40450
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
ForSuperComputer/SFG_search.py
View file @
8b75662a
...
@@ -96,42 +96,5 @@ print('Time cost:'+str(te-ts)+'s')
...
@@ -96,42 +96,5 @@ print('Time cost:'+str(te-ts)+'s')
np
.
savetxt
(
'Data/population_g_'
+
str
(
g
)
+
'_Ea_'
+
str
(
Ea
)
+
'_DeltaB_'
+
str
(
DeltaB
[
0
])
+
'-'
+
str
(
DeltaB
[
-
1
])
+
'.txt'
,
data
)
np
.
savetxt
(
'Data/population_g_'
+
str
(
g
)
+
'_Ea_'
+
str
(
Ea
)
+
'_DeltaB_'
+
str
(
DeltaB
[
0
])
+
'-'
+
str
(
DeltaB
[
-
1
])
+
'.txt'
,
data
)
np
.
save
(
'Data/population_g_'
+
str
(
g
)
+
'_Ea_'
+
str
(
Ea
)
+
'_DeltaB_'
+
str
(
DeltaB
[
0
])
+
'-'
+
str
(
DeltaB
[
-
1
])
+
'.npy'
,
data
)
np
.
save
(
'Data/population_g_'
+
str
(
g
)
+
'_Ea_'
+
str
(
Ea
)
+
'_DeltaB_'
+
str
(
DeltaB
[
0
])
+
'-'
+
str
(
DeltaB
[
-
1
])
+
'.npy'
,
data
)
#print population
fig
,
axes
=
plt
.
subplots
(
3
,
1
,
figsize
=
(
3
,
18
))
axes
[
0
].
set_xlabel
(
r
'$\Delta_b$'
)
axes
[
1
].
set_xlabel
(
r
'$\Delta_b$'
)
axes
[
1
].
set_xlabel
(
r
'$\Delta_b$'
)
axes
[
0
].
set_ylabel
(
r
'$\langle b^{\dagger}b\rangle$'
)
axes
[
1
].
set_ylabel
(
r
'$\langle c^{\dagger}c\rangle$'
)
axes
[
2
].
set_ylabel
(
r
'$\langle a^{\dagger}a\rangle$'
)
axes
[
0
].
plot
(
DeltaB
,
data
[...,
0
],
linestyle
=
'-'
)
axes
[
1
].
plot
(
DeltaB
,
data
[...,
1
],
linestyle
=
'-'
)
axes
[
2
].
plot
(
DeltaB
,
data
[...,
2
],
linestyle
=
'-'
)
fig
.
savefig
(
'imgs/population_g_'
+
str
(
g
)
+
'_Ea_'
+
str
(
Ea
)
+
'_DeltaB_'
+
str
(
DeltaB
[
0
])
+
'-'
+
str
(
DeltaB
[
-
1
])
+
'.svg'
,
dpi
=
600
,
format
=
'svg'
,
bbox_inches
=
'tight'
)
#print other data
fig
,
axes
=
plt
.
subplots
(
3
,
2
,
figsize
=
(
12
,
18
))
axes
[
0
,
0
].
set_xlabel
(
r
'$\Delta_b$'
)
axes
[
0
,
1
].
set_xlabel
(
r
'$\Delta_b$'
)
axes
[
1
,
0
].
set_xlabel
(
r
'$\Delta_b$'
)
axes
[
1
,
1
].
set_xlabel
(
r
'$\Delta_b$'
)
axes
[
2
,
0
].
set_xlabel
(
r
'$\Delta_b$'
)
axes
[
2
,
1
].
set_xlabel
(
r
'$\Delta_b$'
)
#axes[0,1].set_ylim(0,5)
#axes[1,0].set_ylim(0,2)
#axes[1,1].set_ylim(0,2)
#axes[2,0].set_ylim(0,2)
axes
[
0
,
0
].
plot
(
DeltaB
,
data
[...,
4
],
linestyle
=
'-.'
)
axes
[
0
,
1
].
plot
(
DeltaB
,
data
[...,
5
],
linestyle
=
'-.'
)
axes
[
1
,
0
].
plot
(
DeltaB
,
data
[...,
8
],
linestyle
=
'-.'
)
axes
[
1
,
1
].
plot
(
DeltaB
,
data
[...,
6
],
linestyle
=
'-.'
)
axes
[
2
,
0
].
plot
(
DeltaB
,
data
[...,
7
],
linestyle
=
'-.'
)
axes
[
2
,
1
].
plot
(
DeltaB
,
data
[...,
0
],
linestyle
=
'-.'
)
axes
[
0
,
0
].
set_ylabel
(
r
'$g_2ab$'
)
axes
[
0
,
1
].
set_ylabel
(
r
'$g_2ac$'
)
axes
[
1
,
0
].
set_ylabel
(
r
'$g_2a$'
)
axes
[
1
,
1
].
set_ylabel
(
r
'$g_2b$'
)
axes
[
2
,
0
].
set_ylabel
(
r
'$g_2c$'
)
axes
[
2
,
1
].
set_ylabel
(
r
'$t_max$'
)
fig
.
savefig
(
'imgs/otherData_g_'
+
str
(
g
)
+
'_Ea_'
+
str
(
Ea
)
+
'_DeltaB_'
+
str
(
DeltaB
[
0
])
+
'-'
+
str
(
DeltaB
[
-
1
])
+
'.svg'
,
dpi
=
600
,
format
=
'svg'
,
bbox_inches
=
'tight'
)
ForSuperComputer/SFG_search.sh
View file @
8b75662a
...
@@ -2,7 +2,6 @@
...
@@ -2,7 +2,6 @@
#SBATCH -J SFG_Search
#SBATCH -J SFG_Search
#SBATCH -o job-%j.log
#SBATCH -o job-%j.log
#SBATCH -e job-%j.err
#SBATCH -e job-%j.err
#SBATCH -N 4 -n
8
#SBATCH -N 4 -n
16
cd
/gpfs/home/quaninfo/yesunhuang/SFG
cd
/gpfs/home/quaninfo/yesunhuang/SFG
conda activate sfg_dev
python SFG_search.py
python SFG_search.py
ReadAndPrint/2DDataPrinter.py
0 → 100644
View file @
8b75662a
import
numpy
as
np
from
scipy
import
math
import
matplotlib.pyplot
as
plt
from
mpl_toolkits.mplot3d
import
axes3d
from
matplotlib
import
cm
from
matplotlib.ticker
import
LinearLocator
,
FormatStrFormatter
from
matplotlib.pyplot
import
MultipleLocator
import
time
#load data
g
=
1
Ea
=
1
DeltaB_s
=-
4.0
;
DeltaB_e
=
4.0
data
=
np
.
load
(
'Data/population_g_'
+
str
(
g
)
+
'_Ea_'
+
str
(
Ea
)
+
'_DeltaB_'
+
str
(
DeltaB_s
)
+
'-'
+
str
(
DeltaB_e
)
+
'.npy'
)
DeltaB
=
np
.
linspace
(
DeltaB_s
,
DeltaB_e
,
np
.
size
(
data
,
0
))
#print population
fig
,
axes
=
plt
.
subplots
(
3
,
1
,
figsize
=
(
3
,
18
))
axes
[
0
].
set_xlabel
(
r
'$\Delta_b$'
)
axes
[
1
].
set_xlabel
(
r
'$\Delta_b$'
)
axes
[
1
].
set_xlabel
(
r
'$\Delta_b$'
)
axes
[
0
].
set_ylabel
(
r
'$\langle b^{\dagger}b\rangle$'
)
axes
[
1
].
set_ylabel
(
r
'$\langle c^{\dagger}c\rangle$'
)
axes
[
2
].
set_ylabel
(
r
'$\langle a^{\dagger}a\rangle$'
)
axes
[
0
].
plot
(
DeltaB
,
data
[...,
1
],
linestyle
=
'-'
)
axes
[
1
].
plot
(
DeltaB
,
data
[...,
2
],
linestyle
=
'-'
)
axes
[
2
].
plot
(
DeltaB
,
data
[...,
3
],
linestyle
=
'-'
)
fig
.
savefig
(
'imgs/population_g_'
+
str
(
g
)
+
'_Ea_'
+
str
(
Ea
)
+
'_DeltaB_'
+
str
(
DeltaB
[
0
])
+
'-'
+
str
(
DeltaB
[
-
1
])
+
'.svg'
,
dpi
=
600
,
format
=
'svg'
,
bbox_inches
=
'tight'
)
#print other data
fig
,
axes
=
plt
.
subplots
(
3
,
2
,
figsize
=
(
12
,
18
))
axes
[
0
,
0
].
set_xlabel
(
r
'$\Delta_b$'
)
axes
[
0
,
1
].
set_xlabel
(
r
'$\Delta_b$'
)
axes
[
1
,
0
].
set_xlabel
(
r
'$\Delta_b$'
)
axes
[
1
,
1
].
set_xlabel
(
r
'$\Delta_b$'
)
axes
[
2
,
0
].
set_xlabel
(
r
'$\Delta_b$'
)
axes
[
2
,
1
].
set_xlabel
(
r
'$\Delta_b$'
)
#axes[0,1].set_ylim(0,5)
#axes[1,0].set_ylim(0,2)
#axes[1,1].set_ylim(0,2)
#axes[2,0].set_ylim(0,2)
axes
[
0
,
0
].
plot
(
DeltaB
,
data
[...,
4
],
linestyle
=
'-.'
)
axes
[
0
,
1
].
plot
(
DeltaB
,
data
[...,
5
],
linestyle
=
'-.'
)
axes
[
1
,
0
].
plot
(
DeltaB
,
data
[...,
8
],
linestyle
=
'-.'
)
axes
[
1
,
1
].
plot
(
DeltaB
,
data
[...,
6
],
linestyle
=
'-.'
)
axes
[
2
,
0
].
plot
(
DeltaB
,
data
[...,
7
],
linestyle
=
'-.'
)
axes
[
2
,
1
].
plot
(
DeltaB
,
data
[...,
0
],
linestyle
=
'-.'
)
axes
[
0
,
0
].
set_ylabel
(
r
'$g_2ab$'
)
axes
[
0
,
1
].
set_ylabel
(
r
'$g_2ac$'
)
axes
[
1
,
0
].
set_ylabel
(
r
'$g_2a$'
)
axes
[
1
,
1
].
set_ylabel
(
r
'$g_2b$'
)
axes
[
2
,
0
].
set_ylabel
(
r
'$g_2c$'
)
axes
[
2
,
1
].
set_ylabel
(
r
'$t_max$'
)
fig
.
savefig
(
'imgs/otherData_g_'
+
str
(
g
)
+
'_Ea_'
+
str
(
Ea
)
+
'_DeltaB_'
+
str
(
DeltaB
[
0
])
+
'-'
+
str
(
DeltaB
[
-
1
])
+
'.svg'
,
dpi
=
600
,
format
=
'svg'
,
bbox_inches
=
'tight'
)
\ No newline at end of file
ReadAndPrint/3DDataPrinter.py
0 → 100644
View file @
8b75662a
import
numpy
as
np
from
scipy
import
math
import
matplotlib.pyplot
as
plt
from
mpl_toolkits.mplot3d
import
axes3d
from
matplotlib
import
cm
from
matplotlib.ticker
import
LinearLocator
,
FormatStrFormatter
from
matplotlib.pyplot
import
MultipleLocator
import
time
g
=
2
DeltaB_s
=-
4.0
;
DeltaB_e
=
4.0
Ea_s
=
0.1
;
Ea_e
=
1.0
data
=
np
.
load
(
'Data/population_g_'
+
str
(
g
)
+
'_Ea_'
+
str
(
Ea_s
)
+
'-'
+
str
(
Ea_e
)
+
'_DeltaB_'
+
str
(
DeltaB_s
)
+
'-'
+
str
(
DeltaB_e
)
+
'.npy'
)
DeltaB
=
np
.
linspace
(
DeltaB_s
,
DeltaB_e
,
np
.
size
(
data
,
1
))
Ea
=
np
.
linspace
(
Ea_s
,
Ea_e
,
np
.
size
(
data
,
0
))
#print population
fig
=
plt
.
figure
(
figsize
=
(
6
,
18
))
axes
=
[]
axes
.
append
(
fig
.
add_subplot
(
3
,
1
,
1
))
axes
.
append
(
fig
.
add_subplot
(
3
,
1
,
2
))
axes
.
append
(
fig
.
add_subplot
(
3
,
1
,
3
))
ax0
=
axes
[
0
].
contourf
(
DeltaB
,
Ea
,
data
[:,:,
0
],
cmap
=
cm
.
coolwarm
)
ax1
=
axes
[
1
].
contourf
(
DeltaB
,
Ea
,
data
[:,:,
1
],
cmap
=
cm
.
coolwarm
)
ax3
=
axes
[
2
].
contourf
(
DeltaB
,
Ea
,
data
[:,:,
2
],
cmap
=
cm
.
coolwarm
)
ax00
=
axes
[
0
].
contour
(
DeltaB
,
Ea
,
data
[:,:,
0
],
ax0
.
levels
)
ax11
=
axes
[
1
].
contour
(
DeltaB
,
Ea
,
data
[:,:,
1
],
ax1
.
levels
)
ax11
=
axes
[
2
].
contour
(
DeltaB
,
Ea
,
data
[:,:,
2
],
ax1
.
levels
)
#fmt = '%1.2f '
axes
[
0
].
clabel
(
ax00
,
ax00
.
levels
,
inline
=
True
)
axes
[
1
].
clabel
(
ax11
,
ax11
.
levels
,
inline
=
True
)
axes
[
2
].
clabel
(
ax11
,
ax11
.
levels
,
inline
=
True
)
axes
[
0
].
set_xlabel
(
r
'$\Delta_b$'
);
axes
[
1
].
set_xlabel
(
r
'$\Delta_b$'
);
axes
[
2
].
set_xlabel
(
r
'$\Delta_b$'
)
axes
[
0
].
set_ylabel
(
r
'$E_a$'
);
axes
[
1
].
set_ylabel
(
r
'$E_a$'
);
axes
[
2
].
set_ylabel
(
r
'$E_a$'
)
bar1
=
fig
.
colorbar
(
ax0
,
ax
=
axes
[
0
],
pad
=
0.1
)
bar2
=
fig
.
colorbar
(
ax1
,
ax
=
axes
[
1
],
pad
=
0.1
)
bar2
=
fig
.
colorbar
(
ax1
,
ax
=
axes
[
2
],
pad
=
0.1
)
fig
.
savefig
(
'imgs/population_g_'
+
str
(
g
)
+
'_Ea_'
+
str
(
Ea
[
0
])
+
'-'
+
str
(
Ea
[
-
1
])
+
'_DeltaB_'
+
str
(
DeltaB
[
0
])
+
'-'
+
str
(
DeltaB
[
-
1
])
+
'.svg'
,
dpi
=
600
,
format
=
'svg'
,
bbox_inches
=
'tight'
)
#print other data
fig
=
plt
.
figure
(
figsize
=
(
12
,
18
))
axes
=
[]
for
i
in
range
(
0
,
6
):
axes
.
append
(
fig
.
add_subplot
(
3
,
2
,
i
+
1
))
ax_s
=
axes
[
i
].
contourf
(
DeltaB
,
Ea
,
data
[:,:,(
i
+
3
)
%
9
],
cmap
=
cm
.
coolwarm
)
ax_ss
=
axes
[
i
].
contour
(
DeltaB
,
Ea
,
data
[:,:,(
i
+
3
)
%
9
],
ax_s
.
levels
)
axes
[
i
].
clabel
(
ax_ss
,
ax_ss
.
levels
,
inline
=
True
)
axes
[
i
].
set_xlabel
(
r
'$\Delta_b$'
)
axes
[
0
].
set_ylabel
(
r
'$E_a$'
)
fig
.
colorbar
(
ax_s
,
ax
=
axes
[
i
],
pad
=
0.1
)
axes
[
0
].
set_ylabel
(
r
'$[g_2ab]E_a$'
)
axes
[
1
].
set_ylabel
(
r
'$[g_2ac]E_a$'
)
axes
[
2
].
set_ylabel
(
r
'$[g_2a]E_a$'
)
axes
[
3
].
set_ylabel
(
r
'$[g_2b]E_a$'
)
axes
[
4
].
set_ylabel
(
r
'$[g_2c]E_a$'
)
axes
[
5
].
set_ylabel
(
r
'$[t_max]E_a$'
)
fig
.
savefig
(
'imgs/otherData_g_'
+
str
(
g
)
+
'_Ea_'
+
str
(
Ea
[
0
])
+
'-'
+
str
(
Ea
[
-
1
])
+
'_DeltaB_'
+
str
(
DeltaB
[
0
])
+
'-'
+
str
(
DeltaB
[
-
1
])
+
'.svg'
,
dpi
=
600
,
format
=
'svg'
,
bbox_inches
=
'tight'
)
imgs/otherData_g_1_Ea_1_DeltaB_-4.0-4.0.svg
View file @
8b75662a
This diff is collapsed.
Click to expand it.
imgs/otherData_g_2_Ea_0.1-1.0_DeltaB_-4.0-4.0.svg
View file @
8b75662a
This diff is collapsed.
Click to expand it.
imgs/population_g_1_Ea_1_DeltaB_-4.0-4.0.svg
0 → 100644
View file @
8b75662a
This diff is collapsed.
Click to expand it.
imgs/population_g_2_Ea_0.1-1.0_DeltaB_-4.0-4.0.svg
View file @
8b75662a
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment