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.

Click for copyable input
scaledSpectrum\[ScriptCapitalD][n_] := MatrixPropertyDistribution[ Eigenvalues[\[Lambda]]/(2 Sqrt[n]), \[Lambda] \[Distributed] GaussianUnitaryMatrixDistribution[n]];
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.

Click for copyable input
scaledSpectra = Flatten[RandomVariate[scaledSpectrum\[ScriptCapitalD][#], 10^5]] & /@ {3, 4, 5};
show complete Wolfram Language input
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}]

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

Click for copyable input
n = 250; scaledSpectrum = Flatten[RandomVariate[scaledSpectrum\[ScriptCapitalD][n], 10^2]];
show complete Wolfram Language input
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]

Related Examples

de es fr ja ko pt-br ru zh