({{, (RefLink[GaussianUnitaryMatrixDistribution, paclet:ref/GaussianUnitaryMatrixDistribution])[σ,n] 
represents a Gaussian unitary matrix distribution with matrix dimensions {n,n} and scale parameter σ.}, {, (RefLink[GaussianUnitaryMatrixDistribution, paclet:ref/GaussianUnitaryMatrixDistribution])[n]
represents a Gaussian unitary matrix distribution with unit scale parameter.}})

OpenersNotesSection(Spacer1)Details

(RefLink[GaussianUnitaryMatrixDistribution, paclet:ref/GaussianUnitaryMatrixDistribution]) is also known as Gaussian unitary ensemble, or GUE.

(RefLink[GaussianUnitaryMatrixDistribution, paclet:ref/GaussianUnitaryMatrixDistribution]) is a distribution of a Hermitian matrix (x+(x^†))/2, where x is a complex square matrix with independent identically distributed real and imaginary matrix elements that follow (RefLink[NormalDistribution, paclet:ref/NormalDistribution])[0,σ].

The probability density for z is proportional to exp(-(1/(2(σ^2))) Tr[z.z]).

The scale parameter σ can be any positive number and n can be any positive integer.

(RefLink[GaussianUnitaryMatrixDistribution, paclet:ref/GaussianUnitaryMatrixDistribution]) can be used with such functions as (RefLink[MatrixPropertyDistribution, paclet:ref/MatrixPropertyDistribution]), (RefLink[EstimatedDistribution, paclet:ref/EstimatedDistribution]), and (RefLink[RandomVariate, paclet:ref/RandomVariate]).

OpenersPrimaryExamplesSection(Spacer1)Examples  (15)

OpenersExampleSection0(Spacer1)Basic Examples  (4)

Generate a pseudorandom GUE matrix:

RandomVariate[GaussianUnitaryMatrixDistribution[3]]

Check that it is Hermitian:

HermitianMatrixQ[%]

Independent real components of a matrix from (RefLink[GaussianUnitaryMatrixDistribution, paclet:ref/GaussianUnitaryMatrixDistribution]) are jointly Gaussian, uncorrelated, with entries off the diagonal having half the variance of entries on the diagonal:

sample=RandomVariate[MatrixPropertyDistribution[{Re[(IndexedDefault[x, 1, 1])],Re[(IndexedDefault[x, 2, 2])],Re[(IndexedDefault[x, 1, 2])],Im[(IndexedDefault[x, 1, 2])]},x\[Distributed]GaussianUnitaryMatrixDistribution[2]],10^4];

DistributionFitTest[sample,MultinormalDistribution[{0,0,0,0},DiagonalMatrix[{1,1,1/2,1/2}]],"TestConclusion"]

Use (RefLink[MatrixPropertyDistribution, paclet:ref/MatrixPropertyDistribution]) to sample eigenvalues of GUE matrices:

RandomVariate[MatrixPropertyDistribution[Eigenvalues[x],x\[Distributed]GaussianUnitaryMatrixDistribution[2000]]]//Histogram

Mean and variance:

Mean[GaussianUnitaryMatrixDistribution[1,3]]//MatrixForm

Variance[GaussianUnitaryMatrixDistribution[1,3]]//MatrixForm

OpenersExampleSection1(Spacer1)Scope  (4)

Generate a single pseudorandom matrix:

RandomVariate[GaussianUnitaryMatrixDistribution[2]]

Generate a set of pseudorandom matrices:

RandomVariate[GaussianUnitaryMatrixDistribution[2],3]

Compute statistical properties numerically:

𝒟=MatrixPropertyDistribution[Max[Eigenvalues[m]],m\[Distributed]GaussianUnitaryMatrixDistribution[100]];

NExpectation[x Log[x],x\[Distributed]𝒟]

Distribution parameters estimation:

dist=GaussianUnitaryMatrixDistribution[1/2,3];sample=RandomVariate[dist,10^3];

Estimate the distribution parameters from sample data:

edist=EstimatedDistribution[sample,GaussianUnitaryMatrixDistribution[σ,n]]

Compare (RefLink[LogLikelihood, paclet:ref/LogLikelihood]) of the distributions:

LogLikelihood[#,sample]&/@{edist,dist}

OpenersExampleSection3(Spacer1)Applications  (3)

Sample eigenvalue spacing distribution in a 2-by-2 GUE matrix:

dist=MatrixPropertyDistribution[{-1,1}.MinMax[Eigenvalues[x]],x\[Distributed]GaussianUnitaryMatrixDistribution[2]];

gaps=Normalize[RandomVariate[dist,10000],Mean];

Compare the histogram with the closed form, also known as Wigner surmise for Dyson index β=2:

WignerSurmisePDF[x_,β:2]:=2(4 x/Pi)^2 Exp[(-4/Pi) x^2]

Show[Histogram[gaps,{0.1},PDF],Plot[WignerSurmisePDF[x,2],{x,0,2.5}]]

Sample the joint distribution of eigenvalues of 2-by-2 GUE matrix:

λ𝒟=MatrixPropertyDistribution[Eigenvalues[𝓂],𝓂\[Distributed]GaussianUnitaryMatrixDistribution[2]];

Use (RefLink[RandomSample, paclet:ref/RandomSample]) to randomly permute eigenvalues to compensate for algorithm-specific ordering:

evs=RandomSample/@RandomVariate[λ𝒟,10^5];

Visualize estimated density:

SmoothHistogram3D[evs]

Compare the estimated density to the known closed form result:

LevelDistribution[n_Integer,β_]:=ProbabilityDistribution[(1/(((2π))^(n/2)))((∏_j^n)((Gamma[1+(β/2)])/(Gamma[1+((β j)/2)])))((∏_(i=1)^n)(∏_j^(i-1))((Abs[(Subscript[λ, i])-(Subscript[λ, j])])^β))Exp[-(1/2)(∑_(i=1)^n)((Subscript[λ, i])^2)],Array[{(Subscript[λ, #]),-∞,∞}&,n,1,Sequence]]

Evaluate the density for the case of 2-by-2 GUE matrices:

pdf=PDF[LevelDistribution[2,2],{λ1,λ2}]

Compare the density to the histogram density estimate from the sample:

Show[Histogram3D[evs,{0.5},PDF,ChartStyle->Opacity[0.5],PlotRange->All],
Plot3D[pdf,{λ1,-4,4},{λ2,-4,4},PlotStyle->None,MeshStyle->Thick,PlotRange->All]]

Confirm the agreement with a goodness-of-fit test:

DistributionFitTest[evs,LevelDistribution[2,2]]

Construct Brownian motion on CUE by using matrices from (RefLink[GaussianUnitaryMatrixDistribution, paclet:ref/GaussianUnitaryMatrixDistribution]) as infinitesimal generators:

mats=RandomVariate[GaussianUnitaryMatrixDistribution[0.1,2],100000];
mats=MatrixExp[I #]&/@mats;

Generate a Brownian path with initial matrix sampled from (RefLink[CircularUnitaryMatrixDistribution, paclet:ref/CircularUnitaryMatrixDistribution]):

initial=RandomVariate[CircularUnitaryMatrixDistribution[2]];
res=FoldList[#2.#1&,initial,mats];

Compute the phase of the eigenvalues and compare them with the PDF of the eigenvalues of matrices from (RefLink[CircularUnitaryMatrixDistribution, paclet:ref/CircularUnitaryMatrixDistribution]):

phases=Composition[RandomSample,Arg,Eigenvalues]/@res;

Show[
Histogram3D[phases,{-Pi,Pi,0.25},PDF],
Plot3D[(1/(8(Pi^2)))Abs[Exp[I ϕ1]-Exp[I ϕ2]]^2,{ϕ1,-Pi,Pi},{ϕ2,-Pi,Pi},PlotStyle->None,MeshStyle->Thick]]

OpenersExampleSection4(Spacer1)Properties & Relations  (4)

(RefLink[MatrixExp, paclet:ref/MatrixExp]) applied to i x  with x sampled from (RefLink[GaussianUnitaryMatrixDistribution, paclet:ref/GaussianUnitaryMatrixDistribution]) is unitary:

MatrixExp[I RandomVariate[GaussianUnitaryMatrixDistribution[3]]]

UnitaryMatrixQ[%]

Estimate the parameters of the distribution of elements of matrices drawn from (RefLink[GaussianUnitaryMatrixDistribution, paclet:ref/GaussianUnitaryMatrixDistribution]), assuming they are independent and normally distributed:

sample=RandomVariate[MatrixPropertyDistribution[{Re[(IndexedDefault[x, 1, 1])],Re[(IndexedDefault[x, 2, 2])],Re[(IndexedDefault[x, 1, 2])],Im[(IndexedDefault[x, 1, 2])]},x\[Distributed]GaussianUnitaryMatrixDistribution[2]],10^5];

FindDistributionParameters[sample,MultinormalDistribution[{0,0,0,0},DiagonalMatrix[{v11,v22,vr12,vi12}]]]

The spectral density of large GUE matrix converges to (RefLink[WignerSemicircleDistribution, paclet:ref/WignerSemicircleDistribution]):

n=300;
eigvs=RandomVariate[MatrixPropertyDistribution[Eigenvalues[x],x\[Distributed]GaussianUnitaryMatrixDistribution[n]],100];

Compare the histogram with the PDF:

Show[Histogram[(Join@@eigvs)/Sqrt[n],{0.1},PDF],Plot[PDF[WignerSemicircleDistribution[2],x],{x,-2,2}]]

The distribution of scaled largest eigenvalue of large GUE matrices converges to (RefLink[TracyWidomDistribution, paclet:ref/TracyWidomDistribution]):

n=256;
le=RandomVariate[MatrixPropertyDistribution[(Max[Eigenvalues[x]]-Sqrt[4.n])n^(1./6),x\[Distributed]GaussianUnitaryMatrixDistribution[n]],512];

Compare sample histogram with the (RefLink[PDF, paclet:ref/PDF]) of (RefLink[TracyWidomDistribution, paclet:ref/TracyWidomDistribution])[2]:

Show[Histogram[le,Automatic,PDF],Plot[PDF[TracyWidomDistribution[2],x ],{x,-5,2},PlotStyle->Thick]]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[NormalDistribution, paclet:ref/NormalDistribution])  ▪  (RefLink[GaussianOrthogonalMatrixDistribution, paclet:ref/GaussianOrthogonalMatrixDistribution])  ▪  (RefLink[GaussianSymplecticMatrixDistribution, paclet:ref/GaussianSymplecticMatrixDistribution])  ▪  (RefLink[MatrixPropertyDistribution, paclet:ref/MatrixPropertyDistribution])  ▪  (RefLink[MatrixNormalDistribution, paclet:ref/MatrixNormalDistribution])  ▪  (RefLink[UnitaryMatrixQ, paclet:ref/UnitaryMatrixQ])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Matrix Distributions, paclet:guide/MatrixDistributions])}})}})