-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathfermi_2b_btp2_plot_transport_tensor.py
191 lines (164 loc) · 6.79 KB
/
fermi_2b_btp2_plot_transport_tensor.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
#from pymatgen.electronic_structure.boltztrap2 import VasprunBSLoader,BztInterpolator,BztTransportProperties,BztPlotter
from pymatgen.electronic_structure.boltztrap2 import BztTransportProperties,BztPlotter
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.ticker as tck
SMALL_SIZE = 20
MEDIUM_SIZE = 20
BIGGER_SIZE = 20
LARGE_SIZE = 25
plt.rc('font', size=BIGGER_SIZE) # controls default text sizes
plt.rc('axes', titlesize=BIGGER_SIZE) # fontsize of the axes title
plt.rc('axes', labelsize=MEDIUM_SIZE) # fontsize of the x and y labels
plt.rc('xtick', labelsize=SMALL_SIZE) # fontsize of the tick labels
plt.rc('ytick', labelsize=SMALL_SIZE) # fontsize of the tick labels
plt.rc('legend', fontsize=SMALL_SIZE) # legend fontsize
plt.rc('figure', titlesize=BIGGER_SIZE) # fontsize of the figure title
#print('length of bztInterp.coeffs',len(bztInterp.coeffs))
print('\nRead transport properties')
bztTransp = BztTransportProperties.load(fname='bztTranspProps.json.gz')
print('\nPlot and save diagrams...')
#bztPlotter = BztPlotter(bzt_transP=bztTransp, bzt_interp=bztInterp)
bztPlotter = BztPlotter(bzt_transP=bztTransp)
############################################################################
plot_seebeck=True
plot_sigma=False
############################################################################
if plot_seebeck:
# y=seebeck, x=fermi_level, label=temperature
fig,ax=plt.subplots(1,1)
temperatures=np.array([50,100])
bztplot=bztPlotter.plot_props('S','mu','temp',temps=temperatures, output="eigs", fermi_unit='meV')
##############################
#xlimits=[-0.1,0.1] #eV
xlimits=[-100,100] #meV
ylimits=[-200,400]
plt.xlim(xlimits)
plt.ylim(ylimits)
#plt.ticklabel_format(style='sci', axis='x', scilimits=(0,0))
plt.xticks(np.round(np.linspace(xlimits[0],xlimits[1],5),5))
plt.hlines(0,xlimits[0],xlimits[1],linewidth=3.0,color='black')
plt.vlines(0,ylimits[0],ylimits[1],linewidth=3.0,color='black')
#plt.legend(fontsize=22,loc='lower left')
ax=plt.gca()
ax.spines['left'].set_linewidth(1.5)
ax.spines['right'].set_linewidth(1.5)
ax.spines['top'].set_linewidth(1.5)
ax.spines['bottom'].set_linewidth(1.5)
ax.grid(True)
#plt.legend(loc='lower left')
##############################
plt.tight_layout()
figname='btp2_seebeck2a_mu_temp_scalar.pdf'
plt.savefig(figname,transparent=True)
print(figname,' is saved')
plt.close()
# y=seebeck, x=temperature, label=doping
fig,ax=plt.subplots(1,1)
temperatures=np.array([20,40,50,60,80,100,150,200,250,300])
bztplot=bztPlotter.plot_props('S','temp','doping',doping=[1e18, 1e19], dop_type='n',temps=temperatures, output="eigs")
##############################
xlimits=[0,300]
ylimits=[-200,400]
plt.xlim(xlimits)
plt.ylim(ylimits)
#plt.ticklabel_format(style='sci', axis='x', scilimits=(0,0))
plt.hlines(0,xlimits[0],xlimits[1],linewidth=3.0,color='black')
plt.vlines(0,ylimits[0],ylimits[1],linewidth=3.0,color='black')
ax=plt.gca()
ax.spines['left'].set_linewidth(1.5)
ax.spines['right'].set_linewidth(1.5)
ax.spines['top'].set_linewidth(1.5)
ax.spines['bottom'].set_linewidth(1.5)
ax.grid(True)
##############################
plt.tight_layout()
figname='btp2_seebeck2b_temp_n-doping.pdf'
plt.savefig(figname,transparent=True)
print(figname,' is saved')
plt.close()
# y=seebeck, x=temperature, label=doping
fig,ax=plt.subplots(1,1)
temperatures=np.array([20,40,50,60,80,100,150,200,250,300])
bztplot=bztPlotter.plot_props('S','temp','doping',doping=[1e18, 1e19], dop_type='p',temps=temperatures, output="eigs")
##############################
xlimits=[0,300]
ylimits=[-200,400]
plt.xlim(xlimits)
plt.ylim(ylimits)
#plt.ticklabel_format(style='sci', axis='x', scilimits=(0,0))
plt.hlines(0,xlimits[0],xlimits[1],linewidth=3.0,color='black')
plt.vlines(0,ylimits[0],ylimits[1],linewidth=3.0,color='black')
ax=plt.gca()
ax.spines['left'].set_linewidth(1.5)
ax.spines['right'].set_linewidth(1.5)
ax.spines['top'].set_linewidth(1.5)
ax.spines['bottom'].set_linewidth(1.5)
ax.grid(True)
##############################
plt.tight_layout()
figname='btp2_seebeck2c_temp_p-doping.pdf'
plt.savefig(figname,transparent=True)
print(figname,' is saved')
plt.close()
if plot_sigma:
# y=conductivity, x=fermi_level, label=temperature
fig,ax=plt.subplots(1,1)
temperatures=np.array([2])
bztplot=bztPlotter.plot_props('Conductivity','mu','temp',temps=temperatures, output="eigs")
# bamnsb2 nsc40 fac3 [25760:26360] more precise range is [26000:26100] or [26032:26096]
##############################
ax=plt.gca()
#plt.legend(labels=['$\sigma_x$', '$\sigma_y$', '$\sigma_z$'])
ax.get_legend().remove()
plt.yscale("log")
#xlimits=[-0.1,0.1] #eV
xlimits=[-100,100] # meV
ylimits=[1,1e6]
#ylimits=[0,2e5]
#plt.yticks(np.round(np.linspace(ylimits[0],ylimits[1],5),5))
plt.xlim(xlimits)
plt.ylim(ylimits)
plt.xticks(np.round(np.linspace(xlimits[0],xlimits[1],5),5))
plt.yticks(np.logspace(0,6,7))
plt.vlines(0,ylimits[0],ylimits[1],linewidth=3.0,color='black')
#plt.ticklabel_format(style='sci', axis='y', scilimits=(0,0))
#ax.yaxis.get_offset_text().set_fontsize(20)
ax.spines['left'].set_linewidth(1.5)
ax.spines['right'].set_linewidth(1.5)
ax.spines['top'].set_linewidth(1.5)
ax.spines['bottom'].set_linewidth(1.5)
ax.grid(True)
##############################
plt.tight_layout()
figname='btp2_conductivity2a_mu_low-temp_tensor.pdf'
plt.savefig(figname,transparent=True)
print(figname,' is saved')
plt.close()
# y=conductivity, x=temperature, label=doping
fig,ax=plt.subplots(1,1)
temperatures=np.array([20,40,50,60,80,100,150,200,250,300])
bztplot=bztPlotter.plot_props('Conductivity','temp','doping',doping=[1e17,1e19], dop_type='n',temps=temperatures,output='eigs')
##############################
plt.yscale("log")
xlimits=[0,300]
ylimits=[1,1e6]
plt.xlim(xlimits)
plt.ylim(ylimits)
plt.xticks(np.round(np.linspace(xlimits[0],xlimits[1],5),5))
plt.yticks(np.logspace(0,6,7))
#plt.vlines(0,ylimits[0],ylimits[1],linewidth=3.0,color='black')
ax=plt.gca()
#plt.ticklabel_format(style='sci', axis='y', scilimits=(0,0))
#ax.yaxis.get_offset_text().set_fontsize(20)
ax.spines['left'].set_linewidth(1.5)
ax.spines['right'].set_linewidth(1.5)
ax.spines['top'].set_linewidth(1.5)
ax.spines['bottom'].set_linewidth(1.5)
ax.grid(True)
##############################
plt.tight_layout()
figname='btp2_conductivity2b_temp_n-doping_tensor.pdf'
plt.savefig(figname,transparent=True)
print(figname,' is saved')
plt.close()