Hi, I am new to Julia and I am writing a program that makes a random matrix drawn from the Haar distribution. It works fine for small matrices ~200x200 but when I try for 1000x1000 the program takes a very long time to run. I am not sure what the issue is here.
using Random, LinearAlgebra using Plots function mkHaar(dimMat) #initialize random number generatore and create complex 4x4 normal random matrix rng = MersenneTwister() rndMat = randn(rng, ComplexF64, (dimMat, dimMat)) Z = qr(rndMat) L = Diagonal(Z.R)/abs.(Diagonal(Z.R)) rndHaar = Z.Q*L #We can check to see that rndHaar is Unitary #println(adjoint(rndHaar)*rndHaar) #and that the eigenvalue phases are uniformly distributed EV = eigvals(rndHaar) phaseEV = angle.(EV) #Make histogram gr(size = (300,300), legend = false) #create binning breaks binbrks = range(-pi, stop = pi, length = 25) p = histogram(phaseEV,bins=binbrks) display(p) end