How to build a POE ensemble in julia

I'm having trouble creating a POE ensemble in julia. I follow this document and part of this other.

In julia, I calculate:

X = randn(dim, dim) Q, R = qr(X) Q = Q*diagm(sign(diag(R))) ij = (irealiz-1)*dim phases_ens[1+ij:ij+dim] = angle(eigvals(Q)) 

where dim is the dimension of the matrix, and irealiz is just the index for the total number of implementations.

I'm interested in the phases of Q, since I want Q to be an orthogonal matrix with the corresponding Haar measure. If dim=50 and the total implementation number is 100000 , and as I correct Q, I should expect a flat distribution of phases_ens . However, I get a flat distribution, with the exception of the peak at zero and at pi. Is there something wrong with the code?

+5
source share
1 answer

The code is actually correct, you just have the wrong field

The result of eigenvalues ​​is valid for unitary matrices (complex records); based on the code from section 4.6 of the Edelman and Rao document, if you replace the first line with

 X = randn(dim, dim) + im*randn(dim, dim) 

You will get the desired result.

Orthogonal matrices (real records) behave somewhat differently (see note 1, section 3 of this document ):

  • when dims is odd, one eigenvalue will be +1 or -1 (each with a probability of 1/2), all others will occur as conjugate pairs.
  • when dims even, both +1 and -1 will be eigenvalues ​​with a probability of 1/2, otherwise there are no real eigenvalues.

(Thanks for the links, by the way: I did not know about Stuart's paper)

+4
source

All Articles