0

I tried to use Mathematica to study random matrix and expect to get Distribution of level spacings $p_2(s)=\frac{32}{\pi^2}s^2 \exp(-\frac{4}{\pi}s^2)$ for large Gaussian unitary matrix. However, the PDF and CDF histograms did not fit very well. It is NOT due to random fluctuation. Is there something wrong with me?

n = 4000;
a = RandomVariate[GaussianUnitaryMatrixDistribution[n]];
s = Eigenvalues[a] // Sort;
s = Subsequences[s, {2}];
t = (#[[2]] - #[[1]]) & /@ s;
t = t/Mean[t];
p2[x_] := 32/\[Pi]^2 x^2 E^(-4/\[Pi] x^2);
Show[{Histogram[t, {0, 3, 0.01}, "PDF"],
     Plot[p2[x], {x, 0, 3}]}]
Show[{Histogram[t, {0, 3, 0.01}, "CDF"],
     Plot[Evaluate[Integrate[p2[x], {x, 0, x}]], {x, 0, 3}]}]

enter image description here

ShenLei
  • 311
  • 1
    The function $p_2(s)$ you quote is the exact pdf for the level spacing of a $2\times 2$ Gaussian (hermitian) random matrix, not for a $N\times N$ one. The exact result for $N\times N$ is more complicated (see e.g. Mehta's book). The Wikipedia page you cite indeed states: " The probability distribution of spacings is approximately given by..." – Pierpaolo Vivo Nov 26 '17 at 15:08
  • @PierpaoloVivo Is there any formula of $p_2(s)$ for $N \rightarrow \infty $? IMO, $p_2(s)$ gets statistical meaning only when N is large enough. – ShenLei Nov 27 '17 at 02:13
  • It's on Mehta's book, it is expressed as an infinite product...see also https://arxiv.org/pdf/physics/0510136.pdf end of pag. 2 – Pierpaolo Vivo Nov 27 '17 at 09:00

0 Answers0