RandomMatrices.jl icon indicating copy to clipboard operation
RandomMatrices.jl copied to clipboard

The function ` rand(d::Wigner{2}, n::Int)` returns incorrect matrix???

Open danpablo opened this issue 1 year ago • 0 comments

I think that the following code is missing a factor of 2 dividing when the function returns.

function rand(d::Wigner{2}, n::Int)   
    A = randn(n, n) + im*randn(n, n) 
    normalization = √(4*n)  
    return Hermitian((A + A') / normalization)  
end

That is, replace this line return Hermitian((A + A') / normalization) with this other one return Hermitian( (A + A') / 2 / normalization ).

Thanks and regards

Pablo

danpablo avatar Sep 06 '24 17:09 danpablo