-
Notifications
You must be signed in to change notification settings - Fork 1
/
cluster-floqgrapheneunitary_disordered_hopping.m
227 lines (212 loc) · 9.08 KB
/
cluster-floqgrapheneunitary_disordered_hopping.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
%define realspace position vectors
basvec=[kron(ones(1,Ly),[0:sqrt(3)/2:sqrt(3)*(Lx-1)/2])',(kron(ones(1,Ly/2),[kron(ones(1,Lx/2),[1/2,0]),kron(ones(1,Lx/2),[0,1/2])])+kron([0:3/2:3*(Ly-1)/2],ones(1,Lx)))'];
%find nn and nnn indices without double counting.
%find nn indices:
count=0;
nnindices=[];
for p=1:length(basvec)
for q=p:length(basvec)
if abs(sum(abs(basvec(p,:)-basvec(q,:)).^2,2)-1)<0.001
count=count+1;
nnindices(count,:)=[p,q];
end
end
end
%PBC nn indices
count=0;
PBCynnindices=[];
for p=1:length(basvec)
for q=p:length(basvec)
if (abs(abs(basvec(p,2)-basvec(q,2))-(3*(Ly/2-1)+2))<0.001) && abs(basvec(p,1)-basvec(q,1))<0.001
count=count+1;
PBCynnindices(count,:)=[p,q];
end
end
end
count=0;
PBCxnnindices=[];
for p=1:length(basvec)
for q=p:length(basvec)
if (abs(abs(basvec(p,1)-basvec(q,1))-(sqrt(3)*(Lx/2-1)+sqrt(3)/2))<0.001) && abs(abs(basvec(p,2)-basvec(q,2))-1/2)<0.001
count=count+1;
PBCxnnindices(count,:)=[p,q];
end
end
end
%find nnn indices
count=0;
nnnindices=[];
for p=1:length(basvec)
for q=p:length(basvec)
if abs(sum(abs(basvec(p,:)-basvec(q,:)).^2,2)-3)<0.001
count=count+1;
nnnindices(count,:)=[p,q];
end
end
end
%find PBC nnn indices
count=0;
PBCxnnnindices=[];
for p=1:length(basvec)
for q=p:length(basvec)
if (abs(abs(basvec(p,1)-basvec(q,1))-(sqrt(3)*(Lx/2-1)))<0.001) && abs(abs(basvec(p,2)-basvec(q,2)))<0.001
count=count+1;
PBCxnnnindices(count,:)=[p,q];
elseif (abs(abs(basvec(p,1)-basvec(q,1))-(sqrt(3)*(Lx/2-1)+sqrt(3)/2))<0.001) && abs(abs(basvec(p,2)-basvec(q,2))-3/2)<0.001
count=count+1;
PBCxnnnindices(count,:)=[p,q];
end
end
end
count=0;
PBCynnnindices=[];
for p=1:length(basvec)
for q=p:length(basvec)
if (abs(abs(basvec(p,1)-basvec(q,1))-(sqrt(3)/2))<0.001) && abs(abs(basvec(p,2)-basvec(q,2))-(3*(Ly/2-1)+3/2))<0.001
count=count+1;
PBCynnnindices(count,:)=[p,q];
end
end
end
count=0;
PBCxynnnindices=[];
for p=1:length(basvec)
for q=p:length(basvec)
if (abs(abs(basvec(p,1)-basvec(q,1))-(sqrt(3)*(Lx/2-1)+sqrt(3)/2))<0.001) && abs(abs(basvec(p,2)-basvec(q,2))-(3*(Ly/2-1)+3/2))<0.001
count=count+1;
PBCxynnnindices(count,:)=[p,q];
end
end
end
%define matrices with the sign
sgnPBCxnnindices=[];
sgnPBCynnindices=[];
sgnPBCxnnnindices=[];
sgnPBCynnnindices=[];
sgnPBCxynnnindices=[];
count=0;
for pp=1:length(PBCxnnindices)
count=count+1;
sgnPBCxnnindices(count,1)=sign(basvec(PBCxnnindices(pp,2),1)-basvec(PBCxnnindices(pp,1),1));
sgnPBCxnnindices(count,2)=sign(basvec(PBCxnnindices(pp,2),2)-basvec(PBCxnnindices(pp,1),2));
end
count=0;
for pp=1:length(PBCynnindices)
count=count+1;
sgnPBCynnindices(count,1)=sign(basvec(PBCynnindices(pp,2),1)-basvec(PBCynnindices(pp,1),1));
sgnPBCynnindices(count,2)=sign(basvec(PBCynnindices(pp,2),2)-basvec(PBCynnindices(pp,1),2));
end
count=0;
for pp=1:length(PBCxnnnindices)
count=count+1;
sgnPBCxnnnindices(count,1)=sign(basvec(PBCxnnnindices(pp,2),1)-basvec(PBCxnnnindices(pp,1),1));
sgnPBCxnnnindices(count,2)=sign(basvec(PBCxnnnindices(pp,2),2)-basvec(PBCxnnnindices(pp,1),2));
end
count=0;
for pp=1:length(PBCynnnindices)
count=count+1;
sgnPBCynnnindices(count,1)=sign(basvec(PBCynnnindices(pp,2),1)-basvec(PBCynnnindices(pp,1),1));
sgnPBCynnnindices(count,2)=sign(basvec(PBCynnnindices(pp,2),2)-basvec(PBCynnnindices(pp,1),2));
end
count=0;
for pp=1:length(PBCxynnnindices)
count=count+1;
sgnPBCxynnnindices(count,1)=sign(basvec(PBCxynnnindices(pp,2),1)-basvec(PBCxynnnindices(pp,1),1));
sgnPBCxynnnindices(count,2)=sign(basvec(PBCxynnnindices(pp,2),2)-basvec(PBCxynnnindices(pp,1),2));
end
%%%%%%%%%%%%%%%%%start loops
for Mchoice=1:length(Marr)
M=Marr(Mchoice);
for Vrandchoice=1:length(Vrandarr)
Vrand=Vrandarr(Vrandchoice)
tnn_dis=tnn_disarr(Vrandchoice);
tnnn_dis=tnnn_disarr(Vrandchoice);
%%% define filenames:
datestring=datestr(now,'yymmddHHMMSS')
%Definitions necessary for bott index
N1=Lx/2;
N2=Ly/2;
X1=(repmat(rem(1:Lx,2).*[2:Lx+1]/2+((-rem(1:Lx,2)+1).*([1:Lx]/2+0.5)),1,Ly))-1;
Y1temp=[repmat([0.5:3:3*N2;0:3:3*N2-1],N1,1);repmat([1.5:3:3*N2-1;2:3:3*N2],N1,1)];%repmat([2*ceil((1:Ly)/2)+ceil((2:Ly+1)/2-1);1*ceil((1:Ly)/2)+2*ceil((2:Ly+1)/2-1)+0.5],N1,1);
%Y1temp=repmat([0:Ly-1],Lx,1);
Y1=Y1temp(:);
expBIxmat=diag(exp(j*(2*pi/(N1))*X1));
%expBIymat=diag(exp(j*(2*pi/(2*N2))*Y1));
expBIymat=diag(exp(j*(2*pi/(3*N2))*Y1));
Hmass=diag(repmat([M*(kron(ones(1,Lx/2),[1,-1])),M*(kron(ones(1,Lx/2),[-1,1]))],1,Ly/2));
for disavg=1:disavmax
%disavg
expH=eye(Lx*Ly);
Hrand=diag(Vrand*(-0.5+rand(Lx*Ly,1)));
%define array of nn and nnn couplings
tnnarr=tnn+tnn_dis*(-0.5+rand(length(nnindices),1));
tnnPBCxarr=tnn+tnn_dis*(-0.5+rand(length(PBCxnnindices),1));
tnnPBCyarr=tnn+tnn_dis*(-0.5+rand(length(PBCynnindices),1));
tnnnarr=tnnn+tnnn_dis*(-0.5+rand(length(nnnindices),1));
tnnnPBCxarr=tnnn+tnnn_dis*(-0.5+rand(length(PBCxnnnindices),1));
tnnnPBCyarr=tnnn+tnnn_dis*(-0.5+rand(length(PBCynnnindices),1));
tnnnPBCxyarr=tnnn+tnnn_dis*(-0.5+rand(length(PBCxynnnindices),1));
%define Hamiltonian without any magnetic field
for tchoice=1:Tdiv
tchoice;
Ax=A*(sin(w*((tchoice)*dt)));
Ay=A*(cos(w*((tchoice)*dt)));
H1=zeros(Lx*Ly);
%nn elements
for pp=1:length(nnindices)
H1(nnindices(pp,1),nnindices(pp,2))=tnnarr(pp)*exp(1j*(Ax*(basvec(nnindices(pp,2),1)-basvec(nnindices(pp,1),1))+Ay*(basvec(nnindices(pp,2),2)-basvec(nnindices(pp,1),2))));
end
for pp=1:length(PBCxnnindices)
H1(PBCxnnindices(pp,1),PBCxnnindices(pp,2))=PBCx*tnnPBCxarr(pp)*exp(1j*(Ax*((basvec(PBCxnnindices(pp,2),1)-basvec(PBCxnnindices(pp,1),1))-sgnPBCxnnindices(pp,1)*(Lx/2)*sqrt(3))+Ay*(basvec(PBCxnnindices(pp,2),2)-basvec(PBCxnnindices(pp,1),2))));
end
for pp=1:length(PBCynnindices)
H1(PBCynnindices(pp,1),PBCynnindices(pp,2))=PBCy*tnnPBCyarr(pp)*exp(1j*(Ax*((basvec(PBCynnindices(pp,2),1)-basvec(PBCynnindices(pp,1),1)))+Ay*(basvec(PBCynnindices(pp,2),2)-basvec(PBCynnindices(pp,1),2)-sgnPBCynnindices(pp,2)*3*Ly/2)));
end
%nnn indices
for pp=1:length(nnnindices)
H1(nnnindices(pp,1),nnnindices(pp,2))=tnnnarr(pp)*exp(1j*(Ax*(basvec(nnnindices(pp,2),1)-basvec(nnnindices(pp,1),1))+Ay*(basvec(nnnindices(pp,2),2)-basvec(nnnindices(pp,1),2))));
end
for pp=1:length(PBCxnnnindices)
H1(PBCxnnnindices(pp,1),PBCxnnnindices(pp,2))=PBCx*tnnnPBCxarr(pp)*exp(1j*(Ax*(basvec(PBCxnnnindices(pp,2),1)-basvec(PBCxnnnindices(pp,1),1)-sgnPBCxnnnindices(pp,1)*sqrt(3)*Lx/2)+Ay*(basvec(PBCxnnnindices(pp,2),2)-basvec(PBCxnnnindices(pp,1),2))));
end
for pp=1:length(PBCynnnindices)
H1(PBCynnnindices(pp,1),PBCynnnindices(pp,2))=PBCy*tnnnPBCyarr(pp)*exp(1j*(Ax*(basvec(PBCynnnindices(pp,2),1)-basvec(PBCynnnindices(pp,1),1))+Ay*(basvec(PBCynnnindices(pp,2),2)-basvec(PBCynnnindices(pp,1),2)-sgnPBCynnnindices(pp,2)*3*Ly/2)));
end
for pp=1:length(PBCxynnnindices)
H1(PBCxynnnindices(pp,1),PBCxynnnindices(pp,2))=PBCx*PBCy*tnnnPBCxyarr(pp)*exp(1j*(Ax*(basvec(PBCxynnnindices(pp,2),1)-basvec(PBCxynnnindices(pp,1),1)-sgnPBCxynnnindices(pp,1)*sqrt(3)*Lx/2)+Ay*(basvec(PBCxynnnindices(pp,2),2)-basvec(PBCxynnnindices(pp,1),2)-sgnPBCxynnnindices(pp,2)*3*Ly/2)));
end
H=H1+H1'+Hrand+Hmass;
expH=expH*expm(-1j*H*dt);
end
%%%% eigenvalues and eigenvectors for the unitary
[Utemp,dUtemp]=spdiags(expH);
szU=size(expH);
U00=spdiags(Utemp,dUtemp,szU(1),szU(2));
logU=1i/T*logm(full(U00));
Hamiltonian=0.5*(logU+logU');
[Hamiltoniantemp,dHamiltoniantemp]=spdiags(Hamiltonian);
H00=spdiags(Hamiltoniantemp,dHamiltoniantemp,szU(1),szU(2));
[W,d]=eig(full(H00));
%d=eig(full(H00));
En(:,disavg)=diag(d);
%bott index
for movingboundchoice=1:length(movingboundarr)
movingbound=movingboundarr(movingboundchoice);
p2=max(find(diag(d)<=max(movingbound,fixedbound)));
p1=min(find(diag(d)>min(movingbound,fixedbound)));
UX=W(:,p1:p2)'*(expBIxmat)*W(:,p1:p2);
UY=W(:,p1:p2)'*(expBIymat)*W(:,p1:p2);
Ubott=UY*UX*UY'*UX';
[Ubotttemp,dUbotttemp]=spdiags(Ubott);
szUbott=size(Ubott);
Ubott00=spdiags(Ubotttemp,dUbotttemp,szUbott(1),szUbott(2));
index(movingboundchoice,disavg)=imag(sum(log(eig(full(Ubott00)))))/(2*pi);
end
Name=sprintf('data/graphenefloquetdisorderdata%s-%s.mat',datestring,JobID);
save(Name,'Lx','Ly','PBCx','PBCy','A','M','w','tnn','tnnn','tnn_dis','tnnn_dis' ,'T','Tdiv','dt','Vrand','disavmax','seedvalue','En','index','movingboundarr')%,'avgIPR')
end
Name=sprintf('data/graphenefloquetdisorderdata%s-%s.mat',datestring,JobID);
save(Name,'Lx','Ly','PBCx','PBCy','A','M','w','tnn','tnnn','tnn_dis','tnnn_dis' ,'T','Tdiv','dt','Vrand','disavmax','seedvalue','En','index','movingboundarr')%,'avgIPR')
toc
end
end