-
Notifications
You must be signed in to change notification settings - Fork 0
/
runit_H1.m
127 lines (104 loc) · 2.62 KB
/
runit_H1.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
%This a script that calls the function that gives Raman spectra for the
%Kitaev Hyperhoneycomb (3D) model
function I = runit_H1(Jx,N)
tic
h=0;
disp(['Jxx= ',num2str(Jx),' h= ',num2str(h)])
%m1 = {1,1,1,2,2,3};
%m2 = {1,2,3,2,3,3};
%
%N=40;
nn=3;
bins = 200;
%initialization
%dosx=zeros(nn,bins,3); dosy = dosx; dosz = dosx;
Dt = cell(1,nn); Iv = Dt; Ier = Dt;
It = cell(6,nn);
I = cell(1,8); Iermax = I; Iermean = I;
%Runs for different parameters
Jz = 1;
flag = 1;
for n = 1:nn
%The function gets run nn times so we can do statistics
out = KitaevRaman_H1(N,bins,flag,nn,Jx,Jz,h);
Ev = out{1}; %Same every time
DDt{n} = out{2}; %D = [DD,DD2]
Dt{n} = out{3};
% for m=1:6
% It{m,n} = out{m+2}; % I{m} = [Ipp{m},Imm{m},Ipm{m}];
% end
end
%
% for m=1:6
% Ivtt = It(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} = Iv{m};
% end
DD = mean(DDt,1,'c');
DDer = std(DDt,1,'c');
DDer2= max(DDer);
DDer3= mean(DDer);
disp(DDer3)
disp(DDer2)
D = mean(Dt,1,'c');
Der = std(DDt,1,'c');
Der2= max(Der);
Der3= mean(Der);
disp(Der3)
disp(Der2)
I{7} = DD;
I{8} = D;
I{9} = Ev;
%Plot 2-particle 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(['2p DOS for H1: J_x=',num2str(Jx),', h=',num2str(h)])
xlabel('\omega/J_z');
ylabel('density of states');
%set(gca,'XTick',-3:3);
%set(gca,'YTick',2*(0:5));
hold off;
filename = ['3D_2p_DOS_H1_Jx_',num2str(round(100*Jx)),'_h_',num2str(100*h)];
saveas(hh,filename)
print(hh, '-dpng', filename);
print(hh, '-depsc', filename);
%Plot DOS
%position = [pixs(3)/2 20 pixs(3)/2-114 pixs(4)/2-50];
hh=figure;%('Position',position); hold on;
plot(Ev/4,D);
%errorbar(Ev,Ipp+Imm+Ipm,errs(:,4)+errs(:,5)+errs(:,6));
title(['DOS for H1: J_x=',num2str(Jx),', h=',num2str(h)])
xlabel('\omega/J_z');
ylabel('density of states');
%set(gca,'XTick',-3:3);
%set(gca,'YTick',2*(0:5));
hold off;
filename = ['DOS_H1_Jx_',num2str(round(100*Jx)),'_h_',num2str(100*h)];
saveas(hh,filename)
print(hh, '-dpng', filename);
print(hh, '-depsc', filename);
%Display the total energy with an error estimate
dE = Ev(200)/bins;
EE = (Ev/4).*D*dE/4;
for m = 1:nn
EEE(m)=sum(Dt{m}.*(Ev/4)*dE/4);
end
format long e
disp(mean(EEE));
format short
disp(std(EEE));
%disp(sum(D*dE/4));
%Store the mean and std of the total energy
I{1}=mean(EEE);
I{2}=std(EEE);
toc
end