MatConFluxOBC[v_,p_,phi_,phi0_]:=Module[{res,l=Length[p],lv=Length[v]},res=Table[0,{x,l},{y,l}];Do[{res[[v[[j,1]],v[[j,2]]]]=-Exp[I*Pi*phi*((p[[v[[j,2]]]])[[2]]-(p[[v[[j,1]]]])[[2]])*((p[[v[[j,2]]]])[[1]]+(p[[v[[j,1]]]])[[1]])/phi0];res[[v[[j,2]],v[[j,1]]]]=-Exp[I*Pi*phi*((p[[v[[j,1]]]])[[2]]-(p[[v[[j,2]]]])[[2]])*((p[[v[[j,2]]]])[[1]]+(p[[v[[j,1]]]])[[1]])/phi0]},{j,1,lv}];res];

MatConFluxOBC2[v_,p_,phi_,phi0_]:=Module[{res,l=Length[p],lv=Length[v]},res=Table[0,{x,l},{y,l}];Do[{res[[v[[j,1]],v[[j,2]]]]=-N[Exp[I*Pi*phi*((p[[v[[j,2]]]])[[2]]-(p[[v[[j,1]]]])[[2]])*((p[[v[[j,2]]]])[[1]]+(p[[v[[j,1]]]])[[1]])/phi0]];res[[v[[j,2]],v[[j,1]]]]=-N[Exp[I*Pi*phi*((p[[v[[j,1]]]])[[2]]-(p[[v[[j,2]]]])[[2]])*((p[[v[[j,2]]]])[[1]]+(p[[v[[j,1]]]])[[1]])/phi0]]},{j,1,lv}];res];

(* Avec aires commensurables*)

d3={};

For[j=1,j<1001,j++,AppendTo[d3,Flatten[{(j)/1000,Sort[Eigenvalues[MatConFluxOBC[vois3,ppniso3norm,(j)/1000,1]]]}]]];

tb3=Table[ListPlot[Transpose[{Transpose[d3][[1]],Transpose[d3][[i]]}],PlotStyle->{Blue,Thickness[0.0003]},PlotRange->{{0,1},{-4.3,4.3}},Joined->True],{i,2,265}];

pap3=Show[tb3,ImageSize->800]

MatConFluxOBC[v_,p_,phi_,phi0_]:=Module[{res,l=Length[p],lv=Length[v]},res=Table[0,{x,l},{y,l}];Do[{res[[v[[j,1]],v[[j,2]]]]=-Exp[I*Pi*phi*((p[[v[[j,2]]]])[[2]]-(p[[v[[j,1]]]])[[2]])*((p[[v[[j,2]]]])[[1]]+(p[[v[[j,1]]]])[[1]])/phi0];res[[v[[j,2]],v[[j,1]]]]=-Exp[I*Pi*phi*((p[[v[[j,1]]]])[[2]]-(p[[v[[j,2]]]])[[2]])*((p[[v[[j,2]]]])[[1]]+(p[[v[[j,1]]]])[[1]])/phi0]},{j,1,lv}];res];

d4={};

For[j=131,j<501,j++,AppendTo[d4,Flatten[{(j)/500,Sort[Eigenvalues[MatConFluxOBC[vois4,pniso4norm,(j)/500,1]]]}]]];

Length[d4]

tb4=Table[ListPlot[Transpose[{Transpose[d4][[1]],Transpose[d4][[i]]}],PlotStyle->{Blue,Thickness[0.0003]},PlotRange->{{0,1},{-4.3,4.3}},Joined->True],{i,2,1453}];

pap4=Show[tb4,ImageSize->800]

Export["pap4.dat",tb4]

d5={};

vois5=Import["vois5.dat"]

Length[ppniso5norm]

ppniso5norm=Import["ppniso5norm.dat"];

Length[d5]

d5[[1 ]]

For[j=1,j<101,j++,AppendTo[d5,Flatten[{j/2000,Sort[Eigenvalues[MatConFluxOBC[vois5,ppniso5norm,j/2000,1]]]}]]];

Length[Eigenvalues[MatConFluxOBC2[vois5,ppniso5norm,0,1]]]

Length[d5]

tb5=Table[ListPlot[Transpose[{Transpose[d5][[1]],Transpose[d5][[i]]}],PlotStyle->{Blue,Thickness[0.0003]},PlotRange->{{0,1/4},{-4.3,0}},Joined->True],{i,2,10}]

Show[tb5]

Fit[Transpose[{Transpose[d5][[1]],Transpose[d5][[2]]}],{1,x},x]

7.6547516682474575` /(2*Pi)

1/1.218291566142515`

(************ Calcul pente niveaux de Landau pour approximant 3 *************)

Length[ppniso]

MatFlux=Table[0,{x,l},{y,l}];Do[{MatFlux[[vois[[j,1]],vois[[j,2]]]]=-Exp[I*Pi*phi*((ppniso[[vois[[j,2]]]])[[2]]-(ppniso[[vois[[j,1]]]])[[2]])*((ppniso[[vois[[j,2]]]])[[1]]+(ppniso[[vois[[j,1]]]])[[1]])];MatFlux[[vois[[j,2]],vois[[j,1]]]]=-Exp[I*Pi*phi*((ppniso[[vois[[j,1]]]])[[2]]-(ppniso[[vois[[j,2]]]])[[2]])*((ppniso[[vois[[j,2]]]])[[1]]+(ppniso[[vois[[j,1]]]])[[1]])]},{j,1,lv}];

Length[MatFlux]

d3={};

Monitor[For[j=0,j<101,j++,AppendTo[d3,Flatten[{j/2000,Sort[Eigenvalues[MatFlux/.phi-> j/2000 ]]}]]],j];

Length[MatFlux]

N[1/2000]

tb3=Table[ListPlot[Transpose[{Transpose[d3][[1]],Transpose[d3][[i]]}],PlotStyle->{Blue,Thickness[0.0003]},PlotRange->{{0.0,1/4},{-4.3,0}},Joined->True],{i,2,265}];

Show[{tb3,ListPlot[droite,Joined->True,PlotStyle->{Red}]}]

droite=Table[{j/2000,j*Pi*minv3matBloch/2000-4.1794533882501455`},{j,0,100,1}];

l3=Transpose[{Transpose[d3][[1]],Transpose[d3][[2]]}];

ll3=Table[l3[[i]],{i,20,Length[l3]}];

ListPlot[ll3]

Fit[ll3,{1,x},x]

minv3=7.210452071787914`/Pi

minv3matBloch=2.9465582002000685`;

(******* Définition de la matrice avec sparse array **********)

Clear[sp4 ,RawHamFlux]

RawHamFlux=Reap[Do[{Sow[{{vois[[j,1]],vois[[j,2]]},-Exp[I*Pi*phi*((ppniso[[vois[[j,2]]]])[[2]]-(ppniso[[vois[[j,1]]]])[[2]])*((ppniso[[vois[[j,2]]]])[[1]]+(ppniso[[vois[[j,1]]]])[[1]])]}];Sow[{{vois[[j,2]],vois[[j,1]]},-Exp[I*Pi*phi*((ppniso[[vois[[j,1]]]])[[2]]-(ppniso[[vois[[j,2]]]])[[2]])*((ppniso[[vois[[j,2]]]])[[1]]+(ppniso[[vois[[j,1]]]])[[1]])]}]},{j,1,lv}]][[2,1]];
tmp=Split[Sort[RawHamFlux],#1[[1]]==#2[[1]]&];
RawHamFlux=Table[tmp[[i,1,1]]->Tr[Transpose[tmp[[i]]][[2]]],{i,1,Length[tmp]}];
MatF=SparseArray[RawHamFlux];

l

sp5=Monitor[Reap[
For[i=1,i≤100+1,i++,
rulef={phi->(i-1.)/2000};
ham=SparseArray[RawHamFlux/.rulef];
Sow[Flatten[{(i-1.)/2000,Sort[Eigenvalues[ham,3]]}]/.rulef]
(*
res=Eigensystem[ham];
For[j=1,j≤nto6t,j++,
If[Tr[((Abs[res[[2,j]]])^4)]<ϵ,Sow[Flatten[{f,Chop[res[[1,j]]]}]/.rulef]];
];*)

]][[2,1]],i];

p3=ListPlot[Transpose[{Transpose[sp3][[1]],Transpose[sp3][[2]]}]]

pp3=

sp4=Import["SpPap4.dat"];
p4=ListPlot[Transpose[{Transpose[sp4][[1]],Transpose[sp4][[2]]}],PlotStyle->Red]

pp4=

p5=ListPlot[Transpose[{Transpose[sp5][[1]],Transpose[sp5][[2]]}],PlotStyle->Green]

pp5=

p6=ListPlot[Transpose[{Transpose[sp6flux][[1]],Transpose[sp6flux][[2]]}],PlotStyle->Gray,Joined->False]

Show[Plot[Pi*2.6*x-4.222,{x,0,0.01},PlotStyle->Green],p6,pp5]

Show[p6,pp5 ]

Fit[Take[Transpose[{Transpose[sp4][[1]],Transpose[sp3][[2]]}],{40,80}],{1,x},x]
Fit[Take[Transpose[{Transpose[sp4][[1]],Transpose[sp4][[2]]}],{40,80}],{1,x},x]

Fit[Take[Transpose[{Transpose[sp4][[1]],Transpose[sp5][[2]]}],{40,80}],{1,x},x]

minv4=7.610245665754212`/Pi

Export["PentePap5.dat",p5]

Export["SpPap5.dat",sp5]

sp5