In[]:=
CompoundExpression[
]
​​deploy
Sun 30 Jul 2023 16:21:32
In[]:=
ClearAll["Global`*"];​​SeedRandom[1];​​n=2;​​depth=1;​​dist=NormalDistribution[];​​sample:=RandomVariate[dist,{n,n}]/Sqrt[n];​​sampled:=Nest[sample.#&,sample,depth-1];​​​​spectralNormalize[evals_]:=evals/Max[evals];​​genCDF[coefs_]:={spectralNormalize@Sort@coefs,Range[Length@coefs]/Length[coefs]};​​​​SF=StringForm;​​​​mats=Table[sampled,{30}];​​mats=#/Norm[#]&/@mats;​​eigLists=Eigenvalues/@mats;​​eigsReal[mat_]:=AllTrue[Eigenvalues@mat,RealValuedNumberQ];​​eigsComplex[mat_]:=Not[eigsReal[mat]];​​matsReal=Select[mats,eigsReal];​​matsComplex=Select[mats,eigsComplex];​​​​traj[mat_,vec_]:=NestList[Normalize[mat.#]&,vec,k];​​top5[list_]:=Take[list,-Min[5,Length[list]]];​​getTrajectoryPlots[mats_]:=​​plots=Table[Block[{k=k0},ListLinePlot[top5@traj[#,ConstantArray[1.,n]]&/@mats,AspectRatio->1,PlotStyle->Opacity[.5]]],{k0,1,25}]​​plotsReal=getTrajectoryPlots@matsReal;​​plotsComplex=getTrajectoryPlots@matsComplex;​​ListAnimate[plotsReal]​​ListAnimate[plotsComplex]​​
Out[]=
-1.0
-0.5
0.5
1.0
-1.0
-0.5
0.5
1.0
Out[]=
-1.0
-0.5
0.5
1.0
-1.0
-0.5
0.5
1.0
In[]:=
Export["plotsComplex.gif",plotsComplex]
Out[]=
plotsComplex.gif
In[]:=
Export["plotsReal.gif",plotsReal]
Out[]=
plotsReal.gif