fibonacciSequence[n_]:=Module[{fPrev=1,fNext=((-0.005RandomReal[])/(w+delta)) ,i=0},While[i++<n,{fPrev,fNext}={fNext,((-((w-delta)fPrev+0.005RandomReal[]* fNext))/(w+delta))}];
fNext]

ListLinePlot[Join[{1},Array[fibonacciSequence,20]]]

mu=0.05;
w=0.2;
delta=0.0;ListLinePlot[LinearRecurrence[{((-(w-delta))/(w+delta)),((-0.05RandomReal[])/(w+delta))},{0,1},10],PlotRange->All]

mu=0.05;
w=0.2;
delta=0.004;
(*a={1,((-mu)/(w+delta))};*)
a={0,1};
For[i=1,i≤1000,i++,AppendTo[a,-((((w-delta)a[[Length[a]-1]]+mu* a[[Length[a]]]))/(w+delta))]]

ListLinePlot[a,PlotRange->{{0,400},{-1,1}}]

Export["/Users/laser/Desktop/Study Related/大四下/吴组会/Fig2.pdf",]

Sum[((Binomial[8,i])^2),{i,1,8}]

mu=0.05;
w=0.2;
delta=0.004;
E=-1;
a={1,((-mu)/(w+delta))};
For[i=1,i≤2,i++,AppendTo[a,-((((w-delta)a[[Length[a]-1]]+mu* a[[Length[a]]]))/(w+delta))]]；
For[i=1,i≤20,i++,AppendTo[a,-(1/(((w+delta))^2))((((w-delta))^2)a[[Length[a]-3]]+2*(w-delta)*mu a[[Length[a]-2]]+((E^2)+(mu^2)+2*((w^2)-(delta^2)))a[[Length[a]-1]]+2*(w+delta)*mu* a[[Length[a]]])]]

ListLinePlot[a,PlotRange->All]

a[[6]]

a={}

mu=0.0;
w=1;
delta=1.;
n=50;
H=N[Table[If[i≤n,I(mu*KroneckerDelta[i,j-n]+(w-delta)*KroneckerDelta[i+1,j-n]+(w+delta)*KroneckerDelta[i-1,j-n]),-I(mu*KroneckerDelta[i-n,j]+(w+delta)*KroneckerDelta[i-n,j-1]+(w-delta)*KroneckerDelta[i-n,j+1])],{i,2n},{j,2n}]];

For[j=1,j≤2n,j++,Export["/Users/laser/Desktop/Study Related/大四下/吴组会/phase/"<>ToString[j]<>".pdf",ListLinePlot[Arg[Eigenvectors[H][[j]]],PlotRange->All,PlotLabel->"n="<>ToString[j]<>", E="<>ToString[Re[Eigenvalues[H][[j]]]]]]]

For[j=1,j≤2n,j++,Export["/Users/laser/Desktop/Study Related/大四下/吴组会/amp/"<>ToString[j]<>".pdf",ListLinePlot[Abs[Eigenvectors[H][[j]]],PlotRange->All,PlotLabel->"n="<>ToString[j]<>", E="<>ToString[Re[Eigenvalues[H][[j]]]]]]]

ListLinePlot[Abs[Eigenvectors[H][[2n]]],PlotRange->All,PlotLabel->"n="<>ToString[2n]<>", E="+ToExpression[Re[Eigenvalues[H][[2n]]]]]

ListPlot[Table[Abs[Eigenvalues[H]][[i]],{i,2n}]]

For[j=1,j≤2n,j++,Export["/Users/laser/Desktop/Study Related/大四下/吴组会/amp22/"<>ToString[j]<>".pdf",ListLinePlot[{Table[Abs[Eigenvectors[H][[j]][[i]]],{i,1,n}],Table[Abs[Eigenvectors[H][[j]][[n+i]]],{i,1,n}]},PlotRange->All,PlotLabel->"n="<>ToString[j]<>", E="<>ToString[Re[Eigenvalues[H][[j]]]]]]]

For[j=2n-10,j≤2n,j++,Export["/Users/laser/Desktop/Study Related/大四下/吴组会/amp3/"<>ToString[j]<>".pdf",ListLinePlot[{Table[Abs[Eigenvectors[H][[j]][[i]]],{i,1,n}],Table[Abs[Eigenvectors[H][[j]][[n+i]]],{i,1,n}]},PlotRange->All,PlotLabel->"n="<>ToString[j]<>", E="<>ToString[Re[Eigenvalues[H][[j]]]]]]]

For[j=2n-10,j≤2n,j++,Export["/Users/laser/Desktop/Study Related/大四下/吴组会/amp4/"<>ToString[j]<>".pdf",ListLinePlot[{Table[Abs[Eigenvectors[H][[j]][[i]]],{i,1,n}],Table[Abs[Eigenvectors[H][[j]][[n+i]]],{i,1,n}]},PlotRange->All,PlotLabel->"n="<>ToString[j]<>", E="<>ToString[Re[Eigenvalues[H][[j]]]]]]]

ListPlot[Table[Abs[Eigenvalues[H]][[2i]],{i,n}]]

Graphics[{Table[{Circle[{i,0},0.14],Circle[{i+0.35,0},0.14]},{i,2}],Table[{Circle[{i,0},0.14],Circle[{i+0.35,0},0.14]},{i,5,5}],Red,Table[{Disk[{i,0},0.14],Disk[{i+0.35,0},0.14]},{i,3,3}],Blue,Table[{Disk[{i,0},0.14],Disk[{i+0.35,0},0.14]},{i,4,4}]}]

<<MaTeX`
texStyle={FontFamily->"Latin Modern Roman",FontSize->15};

Graphics[{Table[{Opacity[1],RGBColor[0.97,0.95,0],EdgeForm[Thickness[Tiny]],Rectangle[{1.1i+0,0},{1.1i+1,1},RoundingRadius->0.1],Opacity[0.8],Red,Disk[{1.1i+0.3,0.5},0.1],Opacity[1],RGBColor[0.,0,0.6],Rotate[Rectangle[{1.1i+0.62,0.42},{1.1i+0.78,0.58}],45 Degree]},{i,3}],Table[{Dashed,Circle[{1.1i+0.5,0.5},{0.47,0.3}]},{i,2,3}],Arrowheads[.03],Arrow[BezierCurve[{{2.91,0.8},{3.35,1.4},{3.59,0.8}}]],Dashed,Arrow[{{2.9,0.33},{2.9,-0.2},{3.6,-0.2},{3.6,0.33}}]},Epilog->{Inset[MaTeX["U", Magnification->2],{3.3,1.3}],Inset[MaTeX["\\omega+\\Delta", Magnification->2],{3.3,-0.5}]},PlotRange->{{1.1,4.3},{-0.6,1.4}}]