# Creating a random normal matrix

I would like to create a random matrix with the constraint that the matrix must be normal, i.e. the matrix and its Hermitian conjugate must commute. I would create a random matrix "without constraints" as

    RandomReal[NormalDistribution[0,s],{n,n}]+
I*RandomReal[NormalDistribution[0,s],{n,n}]


But I have no idea how I can implement the constraint, that the matrix must be normal.

• Your problem is under-specified, because complex n x n matrix has 2 n^2 degrees of freedom. Hermiticity provides n^2 constraints, but you still have n^2 independent real numbers. These can be distributed however you like, and you will get very different behavior of matrix ensembles depending on their distributions. In Random Matrix Theory, for example, gaussian ensembles are frequently studied, where matrix entries are independent normally distributed (complex) numbers, subject to some symmetry constraints (Hermiticity for example) - and this is a well-specified problem. – Leonid Shifrin Sep 25 '12 at 13:20
• I don't know if I understand your point. Do you want me to say something like: Let P(M)dM=k*exp[-Tr[w[M]]]dM be a probability measure, where dM is the measure on the space of normal matrices induced by the Euclidean metric on all complex matrices, w is a potential function, and k is a factor of normalization. How do I generate a random matrix from this ensemble? – Jesper Ipsen Sep 25 '12 at 14:06
• Yes, my point was only that in your formulation, there is not enough information. If you specify the probability (as you did, for example), and then w[M] as well, then your problem is well-specified. How to generate such a matrix (if it is subject to non-trivial symmetry constraints) is another matter. Random Matrix Theory is a general field which studies such random matrix ensembles. In particular, some of its most powerful results are universality statements, which state that eigenvalue statistics may be independent of the exact form of potential w, but depend on the symmetries only. – Leonid Shifrin Sep 25 '12 at 14:21
• In my book, I gave an example of how one can construct a random Wishart matrix, which has a more complex symmetry than e.g. Hermitian. Your constraint seems more involved. You may want to look at research literature on random normal matrices for the algorithms of their generation. But, to re-iterate, first you should define your probability measure. Then, if your potential w is not simple, I would look at whether or not any universality holds, because it may seriously simplify it. – Leonid Shifrin Sep 25 '12 at 14:28
• @LeonidShifrin I don't know if it was available in v6, when you wrote the book, but as of v8, you can load the MultivariateStatistics package and use WishartDistribution. For example, RandomVariate[ WishartDistribution [ IdentityMatrix@10, 20 ], 1] – rm -rf Sep 25 '12 at 16:10

n = (* desired dimension *);
(* random unitary matrix *)
q = Orthogonalize[RandomVariate[NormalDistribution[], {n, n}] +
I RandomVariate[NormalDistribution[], {n, n}]]
(* random normal matrix *)
mat = q.DiagonalMatrix[RandomVariate[NormalDistribution[], n] +
I RandomVariate[NormalDistribution[], n]].ConjugateTranspose[q]


You can check the normality of mat with mat.ConjugateTranspose[mat] - ConjugateTranspose[mat].mat // Chop; it should return an array of 0s.

I'm not entirely sure of what distribution a matrix generated in this manner follows, though.

• Yes, it was something like that I had in mind. The main problem with this approach is that one is not looking random matrix (meaning that entries are chosen according to some distribution), but rather at random distributed eigenvalues. – Jesper Ipsen Sep 25 '12 at 13:03
• I don't understand your objection. I did concede that I don't know the distribution being followed by the matrix generated in this manner, but I'm not sure about your entries are chosen according to some distribution; certainly, the entries of a matrix generated in this way will follow a distribution of some sort. – J. M. will be back soon Sep 25 '12 at 13:15
• You're of course right; the entries do follow some distribution(s). Please disregard my last comment. I found your answer very informative, and think I can use it solve original problem. – Jesper Ipsen Sep 25 '12 at 13:38