Wolfram Language

Random Matrices

Spectral Density of a Matrix

The joint spectral density of many matrix distributions has a corresponding universal limiting form. For Hermitian random matrices with independent entries, this is the Wigner semicircle law.

For Gaussian ensembles, the scaled spectral density of the matrices has a closed form for finite matrix dimension, related to the eigenfunctions of the quantum harmonic oscillator.

Use MatrixPropertyDistribution to represent the scaled spectrum of the Gaussian unitary ensemble and provide the closed-form expression of its joint spectral density.

In[1]:=
Click for copyable input
scaledSpectrum\[ScriptCapitalD][n_] := MatrixPropertyDistribution[ Eigenvalues[\[Lambda]]/(2 Sqrt[n]), \[Lambda] \[Distributed] GaussianUnitaryMatrixDistribution[n]];
In[2]:=
Click for copyable input
spectralPDF[n_Integer, \[Lambda]_] := Sqrt[2/(\[Pi] n)] Exp[-2 n \[Lambda]^2] \!\( \*UnderoverscriptBox[\(\[Sum]\), \(j = 0\), \(n - 1\)] \*FractionBox[ SuperscriptBox[\(HermiteH[j, \*SqrtBox[\(2\ n\)]\ \[Lambda]]\), \(2\)], \( \*SuperscriptBox[\(2\), \(j\)]\ \(j!\)\)]\)

For small matrix dimension, there is a characteristic oscillatory pattern, whose number of density maxima equals the matrix size.

In[3]:=
Click for copyable input
scaledSpectra = Flatten[RandomVariate[scaledSpectrum\[ScriptCapitalD][#], 10^5]] & /@ {3, 4, 5};
show complete Wolfram Language input
In[4]:=
Click for copyable input
Row@MapThread[ Show[Plot[spectralPDF[#1, x], {x, -1.5, 1.5}, PlotTheme -> "Scientific", PlotStyle -> ColorData[97, 1], PlotLegends -> Placed["n = " <> ToString@#1, Above]], Histogram[#2, {0.05}, PDF]] &, {{3, 4, 5}, scaledSpectra}]
Out[4]=

In the limit of large dimension, the density converges to WignerSemicircleDistribution.

In[5]:=
Click for copyable input
n = 250; scaledSpectrum = Flatten[RandomVariate[scaledSpectrum\[ScriptCapitalD][n], 10^2]];
show complete Wolfram Language input
In[6]:=
Click for copyable input
Show[Histogram[scaledSpectrum, {0.05}, PDF, PlotTheme -> "Detailed"], Plot[PDF[WignerSemicircleDistribution[1], x], {x, -1.5, 1.5}, Exclusions -> None, PlotTheme -> "Scientific", PlotLegends -> None, PlotStyle -> ColorData[97, 1]], ImageSize -> Medium]
Out[6]=

Related Examples

de es fr ja ko pt-br ru zh