In[]:=
Sat 11 Jan 2025 09:00:23
In[]:=
ClearAll["Global`*"];SeedRandom[2];graph=GraphData["PappusGraph","Graph"];d=Length@VertexList@graph;grid4[plots_,name_String]:=Column[{Style[Text[name],FontSize->Large,Bold],(*Titleabovethegrid*)With[{k=4},paddedPlots=PadRight[plots,Ceiling[Length[plots]/k]*k,Graphics[]];GraphicsGrid[Partition[paddedPlots,k],Frame->All]]},Alignment->Center]randomDirection[a_b_]:=If[RandomReal[]<.5,ba,ab];directedGraphs=Table[Graph[randomDirection/@EdgeList@graph],{50}];GraphsWithDistinctSpectra[graphs_List]:=Module[{spectra},spectra=Sort/@(Eigenvalues[AdjacencyMatrix[#]]&/@graphs);Pick[graphs,Map[Count[spectra,#]==1&,spectra]]];directedGraphs=GraphsWithDistinctSpectra[directedGraphs];grid4[directedGraphs,"Graphs"]eigs=Table[Eigenvalues@AdjacencyMatrix@g,{g,directedGraphs}];plots=ComplexListPlot[#,PlotStyle->PointSize[Large],Axes->None]&/@eigs;grid4[plots,"Eigenvalues"]isoclinic[theta_,P_]:=Module[{blocks,realJordanform,p,R,n},n=Length@P;blocks=Table[R[i]->RotationMatrix[theta],{i,n/2}];realJordanform=ArrayFlatten@(DiagonalMatrix[Array[R,n/2]]/.blocks);P.realJordanform.P];genTraj[mat_,P_]:=With[{},evals=Table[Eigenvalues[isoclinic[theta,P].mat],{theta,0,2Pi,.02}];ListPlot[ReIm@Flatten@evals,PlotStyle->Directive[PointSize[.01],Opacity[.5]],PlotRange->{{-1.5,1.5},{-1.5,1.5}},AspectRatio->1,Axes->None]];plots=genTraj[Normal@AdjacencyMatrix@#,IdentityMatrix[d]]&/@directedGraphs;grid4[plots,"Trajectories"]