-
Notifications
You must be signed in to change notification settings - Fork 0
/
runit14_8.m
234 lines (195 loc) · 6.62 KB
/
runit14_8.m
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
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
%This a script that calls the function that gives Raman spectra for the
%Kitaev Hyperhoneycomb (3D) model
function I = runit14_8(Jxx,h)
tic
disp(['Jxx= ',num2str(Jxx),' h= ',num2str(h)])
%
N=200;
nn=3;
bins = 200;
%initialization
Dt = cell(1,nn); Iv = Dt; Ier = Dt;
Ivt = cell(8,nn); It = Ivt;
I = cell(1,11); Iermax = I; Iermean = I;
%Runs for different parameters
Jz = 1;
flag = 1;
for Jx = Jxx
% if Jx == 1
% end
for n = 1:nn
%The function gets run nn times so we can do statistics
out = KitaevRaman14_8(N,bins,flag,nn,Jx,Jz,h);
Ev = out{1}; %Same every time
Dt{n} = out{2}; %D = [Dpp,Dmm,Dpm]
for m=1:8
Ivt{m,n} = out{m+2}; % I{m} = [Ipp{m},Imm{m},Ipm{m}];
It{m,n} = Ivt{m,n}(1) + Ivt{m,n}(2) + Ivt{m,n}(3);
end
end
%What I did below is garbage. I actually need to do means over a cell
%dimension, not an array dimension
for m=1:8
Ivtt = Ivt(m,:);
Iv{m} = mean(Ivtt,1,'c');
Ier{m} = std(Ivtt,1,'c');
%Ier2{m}= max(Ivtt,1,'c');
Iermean{m} = mean(Ier{m});
Iermax{m} = max(Ier{m});
disp(Iermean{m})
disp(Iermax{m})
I{m} = sum(Iv{m},2);
%I{m} = I{m}.*sign(I{m});
end
D = mean(Dt,1,'c');
Der = std(Dt,1,'c');
Der2= max(Der);
Der3= mean(Der);
disp(Der3)
disp(Der2)
DD = D(:,1)+D(:,2)+2*D(:,3);
dE = Ev(bins)/bins;
for m = 1:nn
EEE(m)=sum( ( Dt{m}(:,1)+Dt{m}(:,2) ).*(Ev/4)*dE/4 )/2;
end
format long e
disp(mean(EEE));
format short
disp(std(EEE));
I{9} = DD;
I{10} = Ev;
I{11} = [mean(EEE),std(EEE)];
pixs = get(0,'screensize');
%Plot DOS
%position = [pixs(3)/2 20 pixs(3)/2-114 pixs(4)/2-50];
hh=figure;%('Position',position); hold on;
plot(Ev,DD);
%errorbar(Ev,Ipp+Imm+Ipm,errs(:,4)+errs(:,5)+errs(:,6));
%title(['DOS for HyperHoneycomb Kitaev spinons: J_x=',num2str(Jx),', h=',num2str(h)])
xlabel('\omega/J^z');
ylabel('DOS');
%set(gca,'XTick',-3:3);
%set(gca,'YTick',2*(0:5));
%hold off;
filename = ['3D_DOS_2_Jx_',num2str(round(100*Jx)),'_h_',num2str(100*h),'_28'];
saveas(hh,filename)
print(hh, '-dpng', filename);
print(hh, '-depsc', filename);
position = [pixs(3)/2 20 pixs(3)/2-114 pixs(4)/2-50];
hh=figure('Position',position); hold on;
plot(Ev,D(:,2),Ev,D(:,1),Ev,2*D(:,3),Ev,DD);
%errorbar(Ev,Ipp+Imm+Ipm,errs(:,4)+errs(:,5)+errs(:,6));
%title(['DOS for HyperHoneycomb Kitaev spinons: J_x=',num2str(Jx),', h=',num2str(h)])
xlabel('\omega/J^z');
ylabel('DOS');
legend({'\rho_{--}', '\rho_{++}', '\rho_{+-}','\rho_{total}'}, 'Location', 'NorthEast');
%set(gca,'XTick',-3:3);
%set(gca,'YTick',2*(0:5));
hold off;
filename = ['3D_DOS_2_Jx_',num2str(round(100*Jx)),'_h_',num2str(100*h),'_8'];
saveas(hh,filename)
print(hh, '-dpng', filename);
print(hh, '-depsc', filename);
%
% if h==0 && Jxx ==1
% ptsE = [1.65685, 4, 5.65685, 8, 8.94427, 9.65685, 12];
%
% hh=figure;%('Position',position);
% hold on;
% plot(Ev,D(:,2),Ev,D(:,1),Ev,2*D(:,3),Ev,DD);
% %errorbar(Ev,Ipp+Imm+Ipm,errs(:,4)+errs(:,5)+errs(:,6));
% %title(['DOS for HyperHoneycomb Kitaev spinons: J_x=',num2str(Jx),', h=',num2str(h)])
% xlabel('\omega/J_z');
% ylabel('DOS');
% legend({'\rho_{--}', '\rho_{++}', '\rho_{+-}','\rho_{total}'}, 'Location', 'NorthEast');
% for j=1:7
% plot([ptsE(j),ptsE(j)],[0,max(DD)])
% end
% hold off;
% filename = ['3D_DOS_2_Jx_',num2str(round(100*Jx)),'_h_',num2str(100*h),'_5'];
% saveas(hh,filename)
% print(hh, '-dpng', filename);
% end
%Plot the ramans
hh=figure;%('Position',position);
hold on;
plot(Ev,I{1},Ev,I{2},Ev,-I{3},Ev,I{4},Ev,I{5},Ev,I{6}/3,Ev,I{7},Ev,I{8}/2);
%errorbar(Ev,Ipp+Imm+Ipm,errs(:,4)+errs(:,5)+errs(:,6));
%title(['Raman Spectrum for HyperHoneycomb Kitaev spinons: J_x=',num2str(Jx),', h=',num2str(h)])
xlabel('\omega/J^z');
ylabel('I(\omega)');
legend({'I_{aa}', 'I_{aa,ac}', '-I_{aa,cc}','I_{ac}','I_{ac,cc}','I_{cc}/3','I_{ab}','I_{bc}/2'}, 'Location', 'NorthEast');
hold off;
filename = ['3D_Raman_2_Jx_',num2str(round(100*Jx)),'_h_',num2str(h*100),'_8'];
saveas(hh,filename)
print(hh, '-dpng', filename);
print(hh, '-depsc', filename);
hh=figure;%('Position',position);
hold on;
plot(Ev,I{1},Ev,-I{3}/3,Ev,I{6}/9,Ev,I{2},Ev,-I{5}/3,Ev,I{4},Ev,I{8}/2);
%errorbar(Ev,Ipp+Imm+Ipm,errs(:,4)+errs(:,5)+errs(:,6));
%title(['Raman Spectrum for HyperHoneycomb Kitaev spinons: J_x=',num2str(Jx),', h=',num2str(h)])
xlabel('\omega/J^z');
ylabel('I(\omega)');
legend({'I_{aa}','-I_{aa,cc}/3','I_{cc}/9','I_{aa,ac}','-I_{ac,cc}/3','I_{ac}','I_{bc}/2'}, 'Location', 'NorthEast');
hold off;
filename = ['3D_Raman_2_Jx_',num2str(round(100*Jx)),'_h_',num2str(h*100),'_38'];
saveas(hh,filename)
print(hh, '-dpng', filename);
print(hh, '-depsc', filename);
hh=figure;%('Position',position);
hold on;
plot(Ev,I{1}.*sign(I{1}),Ev,I{4}.*sign(I{4}),Ev,I{7}.*sign(I{7}));
%errorbar(Ev,Ipp+Imm+Ipm,errs(:,4)+errs(:,5)+errs(:,6));
%title(['Raman Spectrum for HyperHoneycomb Kitaev spinons: J_x=',num2str(Jx),', h=',num2str(h)])
xlabel('\omega/J^z');
ylabel('I(\omega)');
legend({'I_{aa}','I_{ac}','I_{ab}'}, 'Location', 'NorthEast');
hold off;
filename = ['3D_Raman_2_Jx_',num2str(round(100*Jx)),'_h_',num2str(h*100),'_28'];
saveas(hh,filename)
print(hh, '-dpng', filename);
print(hh, '-depsc', filename);
%Print the ratios
disp(mean(I{3}(I{1}>0)./I{1}(I{1}>0)))
disp(mean(I{6}(I{1}>0)./I{1}(I{1}>0)))
disp(mean(I{5}(I{2}>0)./I{2}(I{2}>0)))
disp(mean(I{8}(I{4}>0)./I{4}(I{4}>0)))
% hh=figure;%('Position',position);
% hold on;
% plot(log(Ev(Ev<5*h)),log(I{1}(Ev<5*h)),log(Ev(Ev<5*h)),log(I{5}(Ev<5*h)));
% %errorbar(Ev,Ipp+Imm+Ipm,errs(:,4)+errs(:,5)+errs(:,6));
% %title(['Raman Spectrum for HyperHoneycomb Kitaev spinons: J_x=',num2str(Jx),', h=',num2str(h)])
% xlabel('log(\omega/J_z)');
% ylabel('log()');
% legend({'I_{aa}', 'I_{aa,ac}', 'I_{aa,cc}','I_{ac}','I_{ac,cc}','I_{cc}'}, 'Location', 'NorthEast');
% hold off;
% filename = ['3D_Raman_2_Jx_',num2str(round(100*Jx)),'_h_',num2str(h*100),'_3'];
% saveas(hh,filename)
% print(hh, '-dpng', filename);
for m=1:6
% if max(abs(I{m})) > 2*max(Iermax{m})
% hh=figure;%('Position',position);
% hold on;
% plot(Ev,Iv{m}(1),Ev,Iv{m}(2),Ev,Iv{m}(3),Ev,I{m});
% %errorbar(Ev,Ipp+Imm+Ipm,errs(:,4)+errs(:,5)+errs(:,6));
% %title(['Raman Spectrum for HyperHoneycomb spinons: J_x=',num2str(Jx),', h=',num2str(h)])
% xlabel('\omega/J_z');
% ylabel('I(\omega)');
% legend({'I_{--}','I_{+-}','I_{++}','I_{total}'}, 'Location', 'NorthEast');
% hold off;
% filename = ['3D_Raman_2_Jx_',num2str(round(100*Jx)),'_h_',num2str(h*100),...
% 'pol_',num2str(m1{m}),num2str(m2{m})];
% saveas(hh,filename)
% print(hh, '-dpng', filename);
% %hold off;
% %clf;
% else
% disp([max(abs(I{m})),max(Iermax{m})])
% end
end
flag=0;
end
%End New Code
toc
end