liens=Import["/users/invites/soret/Bureau/pavage_octo/liensremy.dat"];
ppts=Import["/users/invites/soret/Bureau/pavage_octo/coord_remy.dat"];

Length[liens]
Length[ppts]

liens[[1]]
liens[[12]]

Norm[ppts[[1]]-ppts[[53]]]

Norm[ppts[[4]]-ppts[[246]]]

l=Length[liens];
ll=Length[ppts];

cut=N[0.5*29];


RawHamFlux=Reap[Do[{rat=1/0.7071067811865476`;
dx=ppts[[liens[[m,1]],1]]-ppts[[liens[[m,2]],1]];
dy=ppts[[liens[[m,1]],2]]-ppts[[liens[[m,2]],2]];

If[(liens[[m,1]]<liens[[m,2]])&&(Abs[dy]<cut)&&(Abs[dx]<cut),(*Print["Cond  "," ",dx," ",dy," ",liens[[m,1]]," ",liens[[m,2]]];*)
Sow[{{liens[[m,1]],liens[[m,2]]},-Exp[I*Pi*Phi*rat*rat*((ppts[[liens[[m,2]]]])[[2]]-(ppts[[liens[[m,1]]]])[[2]])*((ppts[[liens[[m,2]]]])[[1]]+(ppts[[liens[[m,1]]]])[[1]])]}];
Sow[{{liens[[m,2]],liens[[m,1]]},-Exp[-I*Pi*Phi*rat*rat*((ppts[[liens[[m,2]]]])[[2]]-(ppts[[liens[[m,1]]]])[[2]])*((ppts[[liens[[m,2]]]])[[1]]+(ppts[[liens[[m,1]]]])[[1]])]}];]
},{m,1,l}]][[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]}];

rulef={Phi->0.};
ham=SparseArray[RawHamFlux/.rulef];

eig1v2=Eigenvalues[ham];

eig0v2=Eigenvalues[ham];

eig2=Eigenvalues[ham];

eig05=Eigenvalues[ham];

eig025=Eigenvalues[ham];

ListPlot[eig025]

Export["flux025.dat",N[eig025]];

Union[Sort[eig0v2]-Sort[eig1v2]]